summaryrefslogtreecommitdiff
path: root/apps/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs')
-rw-r--r--apps/codecs/libasap/CREDITS73
-rw-r--r--apps/codecs/libasap/README193
-rw-r--r--apps/codecs/libasap/README.rockbox10
-rw-r--r--apps/codecs/libasap/acpu.c862
-rw-r--r--apps/codecs/libasap/anylang.h218
-rw-r--r--apps/codecs/libasap/apokeysnd.c586
-rw-r--r--apps/codecs/libasap/asap.c1796
-rw-r--r--apps/codecs/libasap/asap.h125
-rw-r--r--apps/codecs/libasap/asap_internal.h91
-rw-r--r--apps/codecs/libasap/players.h2333
10 files changed, 3696 insertions, 2591 deletions
diff --git a/apps/codecs/libasap/CREDITS b/apps/codecs/libasap/CREDITS
index 97d41067fe..387cbb6266 100644
--- a/apps/codecs/libasap/CREDITS
+++ b/apps/codecs/libasap/CREDITS
@@ -1,37 +1,58 @@
1People who have contributed to ASAP 1Authors
2----------------------------------- 2-------
3 3
4Atari800 Development Team (http://atari800.sourceforge.net) 4Piotr Fusik {asapwww!<fox@scene.pl>}::
5* 6502 and POKEY emulation used in 0.x.y versions of ASAP 5Creator and main developer.
6 6
7Zdenek Eisenhammer <pg@pinknet.cz> 7Atari800 Emulator Developers {asapwww!(http://atari800.sourceforge.net)}::
8* testing 86502 and POKEY emulation used in 0.x.y versions of ASAP.
9 9
10Piotr Fusik <fox@scene.pl> 10Zdenek Eisenhammer {asapwww!<pg@pinknet.cz>}::
11* author and maintainer of ASAP 11Testing.
12 12
13Maciek Konecki <maciusk1@wp.pl> 13Henryk Karpowicz {asapwww!<henkar@poczta.tygrys.net>}::
14* porting to C# 14CMC routine modified for the CM3 format.
15 15
16Marcin Lewandowski <jaskier@atari8.info> 16Maciek Konecki {asapwww!<maciusk1@wp.pl>}::
17* 6502 routines for playing CMC, MPT, TMC and TM2 17Porting to C#.
18 18
19Perry McFarlane <perry_m@fastmail.fm> 19Marek Konopka {asapwww!<konop11@poczta.onet.pl>}::
20* POKEY reverse-engineering 206502 routine for playing DLT.
21 21
22Kostas Nakos <knakos@gmail.com> 22Marcin Lewandowski {asapwww!<jaskier@atari8.info>}::
23* compilation for Windows CE 236502 routines for playing CMC, MPT, TMC and TM2.
24 24
25Slawomir Sledz <slaves@scene.pl> 25Adrian Matoga {asapwww!<epi@atari8.info>}::
26* testing 26COVOX information and test files. Testing.
27 27
28Radek Sterba <raster@infos.cz> 28Perry McFarlane {asapwww!<perry_m@fastmail.fm>}::
29* 6502 routine for playing RMT 29POKEY reverse-engineering.
30* testing
31 30
32Lukasz Sychowicz <xray@scene.pl> 31Kostas Nakos {asapwww!<knakos@gmail.com>}::
33* Windows icons 32Windows CE testing.
34* testing
35 33
36Michal Szpilowski <miker@atari.pl> 34Mariusz Rozwadowski {asapwww!<ramosc64@o2.pl>}::
37* testing 35Suggested CMS, CM3 and DLT format support.
36
37Slawomir Sledz {asapwww!<slaves@scene.pl>}::
38Testing.
39
40David Spilka::
416502 routine for playing CMS.
42
43Radek Sterba {asapwww!<raster@infos.cz>}::
446502 routine for playing RMT.
45Testing.
46
47Lukasz Sychowicz {asapwww!<xray@scene.pl>}::
48Windows icons.
49Testing.
50
51Pawel Szewczyk {asapwww!<ripek@op.pl>}::
52Windows setup graphics.
53
54Michal Szpilowski {asapwww!<miker@atari.pl>}::
55Testing.
56
57Grzegorz Zyla {asapwww!<gsunr@poczta.onet.pl>}::
58XBMC plugin testing.
diff --git a/apps/codecs/libasap/README b/apps/codecs/libasap/README
index d43a872b25..4da0aa7b90 100644
--- a/apps/codecs/libasap/README
+++ b/apps/codecs/libasap/README
@@ -1,59 +1,142 @@
1ASAP - Another Slight Atari Player 1ASAP - Another Slight Atari Player
2---------------------------------- 2==================================
3 3
4ASAP is a player of Atari 8-bit music for modern computers. 4// This file is in AsciiDoc format. It is converted to README.html.
5It emulates the POKEY sound chip and the 6502 processor. 5:Compact-Option:
6The project was initially based on the routines from the Atari800 emulator, 6
7ifdef::asapwww[]
8http://sourceforge.net/projects/asap/files/asap/[Download] |
9http://asap.git.sourceforge.net/git/gitweb.cgi?p=asap/asap;a=summary[Browse source code (Git)] |
10http://sourceforge.net/scm/?type=git&group_id=154391[Get latest source code (Git)] |
11http://sourceforge.net/projects/asap/[SourceForge project page]
12endif::asapwww[]
13
14ASAP is a player of http://en.wikipedia.org/wiki/Atari_8-bit_family[8-bit Atari]
15music for modern computers.
16It emulates the http://en.wikipedia.org/wiki/POKEY[POKEY sound chip]
17and the http://en.wikipedia.org/wiki/6502[6502 processor].
18The project was initially based on the routines from the
19http://atari800.sourceforge.net/[Atari800 emulator],
7but the current version has a completely new original emulation core. 20but the current version has a completely new original emulation core.
8 21
9The ASAP project includes the following programs: 22ASAP includes the following programs:
10* ASAP2WAV - portable command-line utility that generates WAV files 23
11* WASAP - tiny player for Windows 24- asapconv - portable command-line converter {asapwin=}
12* plugin for Apollo 25- WASAP - tiny player for Windows {asapwin=}
13* plugin for foobar2000 0.9 26- plugin for http://koti.welho.com/hylinen/apollo/[Apollo] {asapwin=}
14* plugin for GSPlayer 27- plugin for http://foobar2000.org/[foobar2000] {asapwin=}
15* plugin for MOC 28- plugin for http://hp.vector.co.jp/authors/VA032810/[GSPlayer] {asapwin=}{asapwince=}
16* plugin for Winamp 29- plugin for http://moc.daper.net/[MOC]
17* plugin for XMMS 30- plugin for http://www.winamp.com/[Winamp] {asapwin=}
18* DirectShow source filter (for Windows Media Player) 31- plugin for http://www.microsoft.com/windows/windowsmedia/player/[Windows Media Player] {asapwin=}
19* Java version of ASAP2WAV 32- plugin for http://xbmc.org/[XBMC] {asapwin=}
20* Java applet 33- plugin for http://xmms.org/[XMMS]
21* Java midlet 34- plugin for http://www.un4seen.com/[XMPlay] {asapwin=}
22* C# version of ASAP2WAV 35- POKEY sound emulation DLL for http://raster.infos.cz/atari/rmt/rmt.htm[Raster Music Tracker] {asapwin=}
23 36- Java version of ASAP2WAV - command-line converter to WAV files {asapjava=}
24The following input formats are supported: 37- Java applet - for web pages {asapjava=}{asapwww?(see link:applet.html[online demo])}
25* SAP (Slight Atari Player - standard file format for playing Atari 8-bit 38- Java midlet - for mobile devices {asapjava=}
26 music on modern computers) 39- C# version of ASAP2WAV
27* CMC (Chaos Music Composer) 40- experimental JScript version of ASAP2WAV running in Windows Script Host {asapjavascript=}
28* CMR (CMC Rzog) 41- experimental JavaScript version of ASAP2WAV running in Firefox {asapjavascript=}
29* DMC (DoublePlay CMC) 42- Flash player - for web pages {asapflash=}{asapwww?(see link:flash.html[online demo])}
30* MPT (Music ProTracker) 43
31* MPD (MPT DoublePlay) 44{asapports}The summary of the differences between the above versions is in link:PORTS.xml[this table].
32* RMT (Raster Music Tracker) 45
33* TMC, TM8 (Theta Music Composer 1.x) 46There are other projects which use ASAP:
34* TM2 (Theta Music Composer 2.x) 47
35 48- http://mmsap.sourceforge.net/[mmSAP 2] - standalone player for GNU/Linux with GTK+ user interface
36If you are looking for Atari 8-bit music, there is a single big collection 49- http://www.rockbox.org/[Rockbox] - open source firmware for MP3 players
37of it called Atari SAP Music Archive (http://asma.atari.org). 50
38 51
39If you are interested in the ASAP project, please subscribe its mailing list: 52Input file formats
40https://lists.sourceforge.net/lists/listinfo/asap-users 53------------------
41As in the Atari800 project, this is a combined list for end users 54
42and for developers. Once you subscribe, you can post comments, ideas 55ASAP supports the following file formats (determined by the filename extension):
43and questions about ASAP. They will be answered ASAP. ;-) 56
44 57SAP (Slight Atari Player)::
45If, for some reason, you do not want to subscribe the mailing list, 58The format designed for playing 8-bit Atari music on modern computers.
46but have a bug report, feature request or a small code patch, you can use 59All other formats can be converted to SAP.
47the sf.net tracker. Use "Bugs", "Feature Requests" or "Patches" link 60http://asma.atari.org/[Atari SAP Music Archive (ASMA)]
48on this page: 61is a single big collection of SAP files.
49http://sourceforge.net/projects/asap/ 62
50 63CMC (Chaos Music Composer)::
51ASAP is free software; you can redistribute it and/or modify it 64Atari music editor from early 1990s.
52under the terms of the GNU General Public License as published 65
53by the Free Software Foundation; either version 2 of the License, 66CM3 (CMC "3/4")::
54or (at your option) any later version. 67CMC with modified pattern length.
55 68
56ASAP is distributed in the hope that it will be useful, 69CMR (CMC "Rzog")::
57but WITHOUT ANY WARRANTY; without even the implied warranty 70CMC with modified bass sounds.
58of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 71
59See the included GNU General Public License for more details. 72CMS (Stereo Double CMC)::
73Stereo CMC.
74
75DMC (DoublePlay CMC)::
76CMC with 6502 routine executed at double rate of the original CMC.
77
78DLT (Delta Music Composer)::
79Atari music editor from 1990s.
80
81MPT (Music ProTracker)::
82Atari music editor from 1990s.
83
84MPD (MPT DoublePlay)::
85MPT with 6502 routine executed at double rate of the original MPT.
86
87RMT (http://raster.infos.cz/atari/rmt/rmt.htm[Raster Music Tracker])::
88Modern Atari music editor running on Windows.
89
90TMC, TM8 (http://jaskier.atari8.info/[Theta Music Composer] 1.x)::
91Atari music editor from late 1990s.
92The two file extensions are treated identically and played in stereo.
93TM8 means it's stereo (8-channel) music while TMC can be either mono or stereo.
94
95TM2 (http://jaskier.atari8.info/[Theta Music Composer] 2.x)::
96Modern Atari music editor.
97
98
99ifdef::asapsrc[]
100include::INSTALL[]
101endif::asapsrc[]
102
103ifdef::asapflash[]
104include::flash/USAGE[]
105endif::asapflash[]
106
107ifdef::asapjava[]
108include::java/USAGE[]
109endif::asapjava[]
110
111ifdef::asapjavascript[]
112include::javascript/USAGE[]
113endif::asapjavascript[]
114
115ifdef::asapwin[]
116include::win32/USAGE[]
117endif::asapwin[]
118
119ifdef::asapwince[]
120include::gsplayer/USAGE[]
121endif::asapwince[]
122
123include::NEWS[]
124
125include::CREDITS[]
126
127
128Feedback
129--------
130
131If you are interested in the ASAP project, please subscribe its
132https://lists.sourceforge.net/lists/listinfo/asap-users[mailing list].
133This list is for users and developers.
134Once you subscribe, you can post comments, ideas and questions about ASAP.
135They will be answered ASAP. ;-)
136
137Use http://sourceforge.net/tracker/?group_id=154391[tracker]
138to submit bug reports, feature requests and small code patches.
139
140ifdef::asapwww[]
141image::http://sflogo.sourceforge.net/sflogo.php?group_id=154391&amp;type=13["Get ASAP - Another Slight Atari Player at SourceForge.net. Fast, secure and Free Open Source software downloads",width=120,height=30,link="http://sourceforge.net/projects/asap/"]
142endif::asapwww[]
diff --git a/apps/codecs/libasap/README.rockbox b/apps/codecs/libasap/README.rockbox
index 322c130358..6ea47e9639 100644
--- a/apps/codecs/libasap/README.rockbox
+++ b/apps/codecs/libasap/README.rockbox
@@ -1,5 +1,5 @@
1Library: asap-1.2.0 1Library: asap-2.1.0
2Imported: 2008-26-07 by Dominik Wenger 2Imported: 2010-02-02 by Dominik Wenger
3 3
4This directory contains a local version of asap (http://asap.sourceforge.net/) for decoding Atari 8bit .sap 4This directory contains a local version of asap (http://asap.sourceforge.net/) for decoding Atari 8bit .sap
5audio streams. 5audio streams.
@@ -14,12 +14,8 @@ The Licence is the same as the rest of Rockbox.
14IMPORT DETAILS 14IMPORT DETAILS
15 15
16The .[ch] files in apps/codec/asap are copied from ASAP. 16The .[ch] files in apps/codec/asap are copied from ASAP.
17Some #defines were added, so it uses the ci-> Pointer.
18 17
19A small modification was needed in asap.h Line 120. 18players.h (contains binarys of players) was generated and copied
20(changed the delta buffer to signed char)
21
22Also players.h (contains binarys of players) was generated and copied
23into Rockbox. 19into Rockbox.
24 20
25 21
diff --git a/apps/codecs/libasap/acpu.c b/apps/codecs/libasap/acpu.c
index a4def24371..7c3c8f6f28 100644
--- a/apps/codecs/libasap/acpu.c
+++ b/apps/codecs/libasap/acpu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * acpu.c - another 6502 CPU emulator 2 * acpu.c - another 6502 CPU emulator
3 * 3 *
4 * Copyright (C) 2007-2008 Piotr Fusik 4 * Copyright (C) 2007-2009 Piotr Fusik
5 * 5 *
6 * This file is part of ASAP (Another Slight Atari Player), 6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net 7 * see http://asap.sourceforge.net
@@ -21,10 +21,37 @@
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */ 22 */
23 23
24/* How 6502 registers are stored in this emulator:
25 All variables are int, because modern processors (and Java bytecode)
26 tend to operate more effectively on these type than narrower ones.
27 pc is really an unsigned 16-bit integer.
28 a, x, y and s are unsigned 8-bit integers.
29 Flags are decomposed into three variables for improved performance.
30 c is either 0 or 1.
31 nz contains 6502 flags N and Z.
32 N is set if (nz >= 0x80). Z is set if ((nz & 0xff) == 0).
33 Usually nz is simply assigned the unsigned 8-bit operation result.
34 There are just a few operations (ADC in decimal mode, BIT, PLP and RTI)
35 where both N and Z may be set. In these cases, N is reflected by the 8th
36 (not 7th) bit of nz.
37 vdi contains rarely used flags V, D and I, as a combination
38 of V_FLAG, D_FLAG and I_FLAG. Other vdi bits are clear.
39
40 "Unofficial" opcodes are not documented as "legal" 6502 opcodes.
41 Their operation has been reverse-engineered on Atari 800XL and Atari 65XE.
42 Unofficial opcodes are identical to C64's 6510, except for 0x8b and 0xab.
43 The operation of "unstable" opcodes is partially uncertain.
44 Explanation is welcome.
45
46 Emulation of POKEY timer interrupts is included.
47
48 Two preprocessor symbols may be used to strip the size of this emulator.
49 Define ACPU_NO_DECIMAL to disable emulation of the BCD mode.
50 Define ACPU_NO_UNOFFICIAL to disable emulation of unofficial opcodes. */
51
24#include "asap_internal.h" 52#include "asap_internal.h"
25 53
26CONST_LOOKUP(int, opcode_cycles) = 54CONST_ARRAY(int, opcode_cycles)
27{
28/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ 55/* 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 */ 56 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 */ 57 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* 1x */
@@ -42,12 +69,38 @@ CONST_LOOKUP(int, opcode_cycles) =
42 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7, /* Dx */ 69 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 */ 70 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 */ 71 2, 5, 2, 8, 4, 4, 6, 6, 2, 4, 2, 7, 4, 4, 7, 7 /* Fx */
45}; 72END_CONST_ARRAY;
73
74#ifdef ACPU_NO_DECIMAL
75
76#define DO_ADC \
77 { \
78 /* binary mode */ \
79 V(int, tmp) = a + data + c; \
80 c = tmp >> 8; \
81 vdi &= D_FLAG | I_FLAG; \
82 if (((a ^ data) & 0x80) == 0 && ((data ^ tmp) & 0x80) != 0) \
83 vdi += V_FLAG; \
84 nz = a = tmp & 0xff; \
85 }
86
87#define DO_SBC \
88 { \
89 /* binary mode */ \
90 V(int, tmp) = a - data - 1 + c; \
91 c = (tmp >= 0) ? 1 : 0; \
92 vdi &= D_FLAG | I_FLAG; \
93 if (((a ^ tmp) & 0x80) != 0 && ((a ^ data) & 0x80) != 0) \
94 vdi += V_FLAG; \
95 nz = a = tmp & 0xff; \
96 }
97
98#else /* ACPU_NO_DECIMAL */
46 99
47#define DO_ADC \ 100#define DO_ADC \
48 if ((vdi & D_FLAG) == 0) { \ 101 if ((vdi & D_FLAG) == 0) { \
49 /* binary mode */ \ 102 /* binary mode */ \
50 int tmp = a + data + c; \ 103 V(int, tmp) = a + data + c; \
51 c = tmp >> 8; \ 104 c = tmp >> 8; \
52 vdi &= D_FLAG | I_FLAG; \ 105 vdi &= D_FLAG | I_FLAG; \
53 if (((a ^ data) & 0x80) == 0 && ((data ^ tmp) & 0x80) != 0) \ 106 if (((a ^ data) & 0x80) == 0 && ((data ^ tmp) & 0x80) != 0) \
@@ -56,7 +109,7 @@ CONST_LOOKUP(int, opcode_cycles) =
56 } \ 109 } \
57 else { \ 110 else { \
58 /* decimal mode */ \ 111 /* decimal mode */ \
59 int tmp = (a & 0x0f) + (data & 0x0f) + c; \ 112 V(int, tmp) = (a & 0x0f) + (data & 0x0f) + c; \
60 if (tmp >= 10) \ 113 if (tmp >= 10) \
61 tmp = (tmp - 10) | 0x10; \ 114 tmp = (tmp - 10) | 0x10; \
62 tmp += (a & 0xf0) + (data & 0xf0); \ 115 tmp += (a & 0xf0) + (data & 0xf0); \
@@ -73,7 +126,7 @@ CONST_LOOKUP(int, opcode_cycles) =
73#define DO_SBC \ 126#define DO_SBC \
74 if ((vdi & D_FLAG) == 0) { \ 127 if ((vdi & D_FLAG) == 0) { \
75 /* binary mode */ \ 128 /* binary mode */ \
76 int tmp = a - data - 1 + c; \ 129 V(int, tmp) = a - data - 1 + c; \
77 c = (tmp >= 0) ? 1 : 0; \ 130 c = (tmp >= 0) ? 1 : 0; \
78 vdi &= D_FLAG | I_FLAG; \ 131 vdi &= D_FLAG | I_FLAG; \
79 if (((a ^ tmp) & 0x80) != 0 && ((a ^ data) & 0x80) != 0) \ 132 if (((a ^ tmp) & 0x80) != 0 && ((a ^ data) & 0x80) != 0) \
@@ -82,9 +135,9 @@ CONST_LOOKUP(int, opcode_cycles) =
82 } \ 135 } \
83 else { \ 136 else { \
84 /* decimal mode */ \ 137 /* decimal mode */ \
85 int tmp = a - data - 1 + c; \ 138 V(int, tmp) = a - data - 1 + c; \
86 int al = (a & 0x0f) - (data & 0x0f) - 1 + c; \ 139 V(int, al) = (a & 0x0f) - (data & 0x0f) - 1 + c; \
87 int ah = (a >> 4) - (data >> 4); \ 140 V(int, ah) = (a >> 4) - (data >> 4); \
88 if ((al & 0x10) != 0) { \ 141 if ((al & 0x10) != 0) { \
89 al -= 6; \ 142 al -= 6; \
90 ah--; \ 143 ah--; \
@@ -99,6 +152,8 @@ CONST_LOOKUP(int, opcode_cycles) =
99 a = ((ah & 0xf) << 4) + (al & 0x0f); \ 152 a = ((ah & 0xf) << 4) + (al & 0x0f); \
100 } 153 }
101 154
155#endif /* ACPU_NO_DECIMAL */
156
102#define zGetByte(addr) dGetByte((addr) & 0xff) 157#define zGetByte(addr) dGetByte((addr) & 0xff)
103 158
104#define PEEK dGetByte(pc) 159#define PEEK dGetByte(pc)
@@ -112,13 +167,13 @@ CONST_LOOKUP(int, opcode_cycles) =
112#define ZPAGE_Y addr = (FETCH + y) & 0xff 167#define ZPAGE_Y addr = (FETCH + y) & 0xff
113#define INDIRECT_X addr = (FETCH + x) & 0xff; addr = dGetByte(addr) + (zGetByte(addr + 1) << 8) 168#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 169#define INDIRECT_Y addr = FETCH; addr = (dGetByte(addr) + (zGetByte(addr + 1) << 8) + y) & 0xffff
115#define NCYCLES_X if ((addr & 0xff) < x) AST cycle++ 170#define NCYCLES_X if ((addr & 0xff) < x) ast _ cycle++
116#define NCYCLES_Y if ((addr & 0xff) < y) AST cycle++ 171#define NCYCLES_Y if ((addr & 0xff) < y) ast _ cycle++
117 172
118#define PL(dest) s = (s + 1) & 0xff; dest = dGetByte(0x0100 + s) 173#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 174#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 175#define PH(data) dPutByte(0x0100 + s, data); s = (s - 1) & 0xff
121#define PHW(data) PH((data) >> 8); PH(data) 176#define PHW(data) PH((data) >> 8); PH(TO_BYTE(data))
122#define PHP(bflag) PH(((nz | (nz >> 1)) & 0x80) + vdi + ((nz & 0xff) == 0 ? Z_FLAG : 0) + c + bflag) 177#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) */ 178#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) */ 179#define PHPB1 PHP(0x30) /* push flags with B flag set (PHP, BRK) */
@@ -163,28 +218,8 @@ CONST_LOOKUP(int, opcode_cycles) =
163#define ROL_ZP nz = dGetByte(addr); nz = (nz << 1) + c; c = nz >> 8; nz &= 0xff; dPutByte(addr, nz) 218#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) 219#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) 220#define LSR_ZP nz = dGetByte(addr); c = nz & 1; nz >>= 1; dPutByte(addr, nz)
166#define ROR \ 221#define ROR RMW_GetByte(nz, addr); nz += c << 8; c = nz & 1; nz >>= 1; PutByte(addr, nz)
167 RMW_GetByte(nz, addr); \ 222#define ROR_ZP nz = dGetByte(addr) + (c << 8); c = nz & 1; nz >>= 1; dPutByte(addr, nz)
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) 223#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) 224#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) 225#define INC RMW_GetByte(nz, addr); nz = (nz + 1) & 0xff; PutByte(addr, nz)
@@ -205,11 +240,12 @@ CONST_LOOKUP(int, opcode_cycles) =
205 240
206#define BRANCH(cond) \ 241#define BRANCH(cond) \
207 if (cond) { \ 242 if (cond) { \
208 addr = SBYTE(FETCH); \ 243 addr = SBYTE(PEEK); \
244 pc++; \
209 addr += pc; \ 245 addr += pc; \
210 if (((addr ^ pc) & 0xff00) != 0) \ 246 if ((addr ^ pc) >> 8 != 0) \
211 AST cycle++; \ 247 ast _ cycle++; \
212 AST cycle++; \ 248 ast _ cycle++; \
213 pc = addr; \ 249 pc = addr; \
214 break; \ 250 break; \
215 } \ 251 } \
@@ -217,78 +253,81 @@ CONST_LOOKUP(int, opcode_cycles) =
217 break 253 break
218 254
219#define CHECK_IRQ \ 255#define CHECK_IRQ \
220 if ((vdi & I_FLAG) == 0 && AST irqst != 0xff) { \ 256 if ((vdi & I_FLAG) == 0 && ast _ irqst != 0xff) { \
221 PHPC; \ 257 PHPC; \
222 PHPB0; \ 258 PHPB0; \
223 vdi |= I_FLAG; \ 259 vdi |= I_FLAG; \
224 pc = dGetWord(0xfffe); \ 260 pc = dGetWord(0xfffe); \
225 AST cycle += 7; \ 261 ast _ cycle += 7; \
226 } 262 }
227 263
228ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines) 264/* Runs 6502 emulation for the specified number of Atari scanlines.
265 Each scanline is 114 cycles of which 9 is taken by ANTIC for memory refresh. */
266FUNC(void, Cpu_RunScanlines, (P(ASAP_State PTR, ast), P(int, scanlines)))
229{ 267{
230 int pc; 268 /* copy registers from ASAP_State to local variables for improved performance */
231 int nz; 269 V(int, pc);
232 int a; 270 V(int, nz);
233 int x; 271 V(int, a);
234 int y; 272 V(int, x);
235 int c; 273 V(int, y);
236 int s; 274 V(int, c);
237 int vdi; 275 V(int, s);
238 int next_event_cycle; 276 V(int, vdi);
239 int cycle_limit; 277 V(int, next_event_cycle);
240 pc = AST cpu_pc; 278 V(int, cycle_limit);
241 nz = AST cpu_nz; 279 pc = ast _ cpu_pc;
242 a = AST cpu_a; 280 nz = ast _ cpu_nz;
243 x = AST cpu_x; 281 a = ast _ cpu_a;
244 y = AST cpu_y; 282 x = ast _ cpu_x;
245 c = AST cpu_c; 283 y = ast _ cpu_y;
246 s = AST cpu_s; 284 c = ast _ cpu_c;
247 vdi = AST cpu_vdi; 285 s = ast _ cpu_s;
248 AST next_scanline_cycle = 114; 286 vdi = ast _ cpu_vdi;
287 ast _ next_scanline_cycle = 114;
249 next_event_cycle = 114; 288 next_event_cycle = 114;
250 cycle_limit = 114 * scanlines; 289 cycle_limit = 114 * scanlines;
251 if (next_event_cycle > AST timer1_cycle) 290 if (next_event_cycle > ast _ timer1_cycle)
252 next_event_cycle = AST timer1_cycle; 291 next_event_cycle = ast _ timer1_cycle;
253 if (next_event_cycle > AST timer2_cycle) 292 if (next_event_cycle > ast _ timer2_cycle)
254 next_event_cycle = AST timer2_cycle; 293 next_event_cycle = ast _ timer2_cycle;
255 if (next_event_cycle > AST timer4_cycle) 294 if (next_event_cycle > ast _ timer4_cycle)
256 next_event_cycle = AST timer4_cycle; 295 next_event_cycle = ast _ timer4_cycle;
257 AST nearest_event_cycle = next_event_cycle; 296 ast _ nearest_event_cycle = next_event_cycle;
258 for (;;) { 297 for (;;) {
259 int cycle; 298 V(int, cycle);
260 int addr; 299 V(int, addr);
261 int data; 300 V(int, data);
262 cycle = AST cycle; 301 cycle = ast _ cycle;
263 if (cycle >= AST nearest_event_cycle) { 302 if (cycle >= ast _ nearest_event_cycle) {
264 if (cycle >= AST next_scanline_cycle) { 303 if (cycle >= ast _ next_scanline_cycle) {
265 if (++AST scanline_number == 312) 304 if (++ast _ scanline_number == 312)
266 AST scanline_number = 0; 305 ast _ scanline_number = 0;
267 AST cycle = cycle += 9; 306 ast _ cycle = cycle += 9;
268 AST next_scanline_cycle += 114; 307 ast _ next_scanline_cycle += 114;
269 if (--scanlines <= 0) 308 if (--scanlines <= 0)
270 break; 309 break;
271 } 310 }
272 next_event_cycle = AST next_scanline_cycle; 311 next_event_cycle = ast _ next_scanline_cycle;
273#define CHECK_TIMER_IRQ(ch) \ 312#define CHECK_TIMER_IRQ(ch) \
274 if (cycle >= AST timer##ch##_cycle) { \ 313 if (cycle >= ast _ timer##ch##_cycle) { \
275 AST irqst &= ~ch; \ 314 ast _ irqst &= ~ch; \
276 AST timer##ch##_cycle = NEVER; \ 315 ast _ timer##ch##_cycle = NEVER; \
277 } \ 316 } \
278 else if (next_event_cycle > AST timer##ch##_cycle) \ 317 else if (next_event_cycle > ast _ timer##ch##_cycle) \
279 next_event_cycle = AST timer##ch##_cycle; 318 next_event_cycle = ast _ timer##ch##_cycle;
280 CHECK_TIMER_IRQ(1); 319 CHECK_TIMER_IRQ(1);
281 CHECK_TIMER_IRQ(2); 320 CHECK_TIMER_IRQ(2);
282 CHECK_TIMER_IRQ(4); 321 CHECK_TIMER_IRQ(4);
283 AST nearest_event_cycle = next_event_cycle; 322 ast _ nearest_event_cycle = next_event_cycle;
284 CHECK_IRQ; 323 CHECK_IRQ;
285 } 324 }
286#ifdef ASAPSCAN 325#ifdef ASAPSCAN
287 if (cpu_trace) 326 if (cpu_trace != 0)
288 print_cpu_state(as, pc, a, x, y, s, nz, vdi, c); 327 trace_cpu(ast, pc, a, x, y, s, nz, vdi, c);
289#endif 328#endif
290 data = FETCH; 329 data = FETCH;
291 AST cycle += opcode_cycles[data]; 330 ast _ cycle += opcode_cycles[data];
292 switch (data) { 331 switch (data) {
293 case 0x00: /* BRK */ 332 case 0x00: /* BRK */
294 pc++; 333 pc++;
@@ -313,10 +352,11 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
313 case 0xb2: 352 case 0xb2:
314 case 0xd2: 353 case 0xd2:
315 case 0xf2: 354 case 0xf2:
316 AST scanline_number = (AST scanline_number + scanlines - 1) % 312; 355 ast _ scanline_number = (ast _ scanline_number + scanlines - 1) % 312;
317 scanlines = 1; 356 scanlines = 1;
318 AST cycle = cycle_limit; 357 ast _ cycle = cycle_limit;
319 break; 358 break;
359#ifndef ACPU_NO_UNOFFICIAL
320 case 0x03: /* ASO (ab,x) [unofficial] */ 360 case 0x03: /* ASO (ab,x) [unofficial] */
321 INDIRECT_X; 361 INDIRECT_X;
322 ASO; 362 ASO;
@@ -337,6 +377,314 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
337 case 0xe2: 377 case 0xe2:
338 pc++; 378 pc++;
339 break; 379 break;
380 case 0x07: /* ASO ab [unofficial] */
381 ZPAGE;
382 ASO_ZP;
383 break;
384 case 0x0b: /* ANC #ab [unofficial] */
385 case 0x2b:
386 nz = a &= FETCH;
387 c = nz >> 7;
388 break;
389 case 0x0c: /* NOP abcd [unofficial] */
390 pc += 2;
391 break;
392 case 0x0f: /* ASO abcd [unofficial] */
393 ABSOLUTE;
394 ASO;
395 break;
396 case 0x13: /* ASO (ab),y [unofficial] */
397 INDIRECT_Y;
398 ASO;
399 break;
400 case 0x17: /* ASO ab,x [unofficial] */
401 ZPAGE_X;
402 ASO_ZP;
403 break;
404 case 0x1b: /* ASO abcd,y [unofficial] */
405 ABSOLUTE_Y;
406 ASO;
407 break;
408 case 0x1c: /* NOP abcd,x [unofficial] */
409 case 0x3c:
410 case 0x5c:
411 case 0x7c:
412 case 0xdc:
413 case 0xfc:
414 if (FETCH + x >= 0x100)
415 ast _ cycle++;
416 pc++;
417 break;
418 case 0x1f: /* ASO abcd,x [unofficial] */
419 ABSOLUTE_X;
420 ASO;
421 break;
422 case 0x23: /* RLA (ab,x) [unofficial] */
423 INDIRECT_X;
424 RLA;
425 break;
426 case 0x27: /* RLA ab [unofficial] */
427 ZPAGE;
428 RLA_ZP;
429 break;
430 case 0x2f: /* RLA abcd [unofficial] */
431 ABSOLUTE;
432 RLA;
433 break;
434 case 0x33: /* RLA (ab),y [unofficial] */
435 INDIRECT_Y;
436 RLA;
437 break;
438 case 0x37: /* RLA ab,x [unofficial] */
439 ZPAGE_X;
440 RLA_ZP;
441 break;
442 case 0x3b: /* RLA abcd,y [unofficial] */
443 ABSOLUTE_Y;
444 RLA;
445 break;
446 case 0x3f: /* RLA abcd,x [unofficial] */
447 ABSOLUTE_X;
448 RLA;
449 break;
450 case 0x43: /* LSE (ab,x) [unofficial] */
451 INDIRECT_X;
452 LSE;
453 break;
454 case 0x47: /* LSE ab [unofficial] */
455 ZPAGE;
456 LSE_ZP;
457 break;
458 case 0x4b: /* ALR #ab [unofficial] */
459 a &= FETCH;
460 c = a & 1;
461 nz = a >>= 1;
462 break;
463 case 0x4f: /* LSE abcd [unofficial] */
464 ABSOLUTE;
465 LSE;
466 break;
467 case 0x53: /* LSE (ab),y [unofficial] */
468 INDIRECT_Y;
469 LSE;
470 break;
471 case 0x57: /* LSE ab,x [unofficial] */
472 ZPAGE_X;
473 LSE_ZP;
474 break;
475 case 0x5b: /* LSE abcd,y [unofficial] */
476 ABSOLUTE_Y;
477 LSE;
478 break;
479 case 0x5f: /* LSE abcd,x [unofficial] */
480 ABSOLUTE_X;
481 LSE;
482 break;
483 case 0x63: /* RRA (ab,x) [unofficial] */
484 INDIRECT_X;
485 RRA;
486 break;
487 case 0x67: /* RRA ab [unofficial] */
488 ZPAGE;
489 RRA_ZP;
490 break;
491 case 0x6b: /* ARR #ab [unofficial] */
492 data = a & FETCH;
493 nz = a = (data >> 1) + (c << 7);
494 vdi = (vdi & (D_FLAG | I_FLAG)) + ((a ^ data) & V_FLAG);
495#ifdef ACPU_NO_DECIMAL
496 c = data >> 7;
497#else
498 if ((vdi & D_FLAG) == 0)
499 c = data >> 7;
500 else {
501 if ((data & 0xf) >= 5)
502 a = (a & 0xf0) + ((a + 6) & 0xf);
503 if (data >= 0x50) {
504 a = (a + 0x60) & 0xff;
505 c = 1;
506 }
507 else
508 c = 0;
509 }
510#endif
511 break;
512 case 0x6f: /* RRA abcd [unofficial] */
513 ABSOLUTE;
514 RRA;
515 break;
516 case 0x73: /* RRA (ab),y [unofficial] */
517 INDIRECT_Y;
518 RRA;
519 break;
520 case 0x77: /* RRA ab,x [unofficial] */
521 ZPAGE_X;
522 RRA_ZP;
523 break;
524 case 0x7b: /* RRA abcd,y [unofficial] */
525 ABSOLUTE_Y;
526 RRA;
527 break;
528 case 0x7f: /* RRA abcd,x [unofficial] */
529 ABSOLUTE_X;
530 RRA;
531 break;
532 case 0x83: /* SAX (ab,x) [unofficial] */
533 INDIRECT_X;
534 SAX;
535 break;
536 case 0x87: /* SAX ab [unofficial] */
537 ZPAGE;
538 SAX_ZP;
539 break;
540 case 0x8b: /* ANE #ab [unofficial] */
541 data = FETCH;
542 a &= x;
543 nz = a & data;
544 a &= data | 0xef;
545 break;
546 case 0x8f: /* SAX abcd [unofficial] */
547 ABSOLUTE;
548 SAX;
549 break;
550 case 0x93: /* SHA (ab),y [unofficial, unstable] */
551 ZPAGE;
552 data = zGetByte(addr + 1);
553 addr = (dGetByte(addr) + (data << 8) + y) & 0xffff;
554 data = a & x & (data + 1);
555 PutByte(addr, data);
556 break;
557 case 0x97: /* SAX ab,y [unofficial] */
558 ZPAGE_Y;
559 SAX_ZP;
560 break;
561 case 0x9b: /* SHS abcd,y [unofficial, unstable] */
562 /* S seems to be stable, only memory values vary */
563 addr = FETCH;
564 data = FETCH;
565 addr = (addr + (data << 8) + y) & 0xffff;
566 s = a & x;
567 data = s & (data + 1);
568 PutByte(addr, data);
569 break;
570 case 0x9c: /* SHY abcd,x [unofficial] */
571 addr = FETCH;
572 data = FETCH;
573 addr = (addr + (data << 8) + x) & 0xffff;
574 data = y & (data + 1);
575 PutByte(addr, data);
576 break;
577 case 0x9e: /* SHX abcd,y [unofficial] */
578 addr = FETCH;
579 data = FETCH;
580 addr = (addr + (data << 8) + y) & 0xffff;
581 data = x & (data + 1);
582 PutByte(addr, data);
583 break;
584 case 0x9f: /* SHA abcd,y [unofficial, unstable] */
585 addr = FETCH;
586 data = FETCH;
587 addr = (addr + (data << 8) + y) & 0xffff;
588 data = a & x & (data + 1);
589 PutByte(addr, data);
590 break;
591 case 0xa3: /* LAX (ab,x) [unofficial] */
592 INDIRECT_X;
593 LAX;
594 break;
595 case 0xa7: /* LAX ab [unofficial] */
596 ZPAGE;
597 LAX_ZP;
598 break;
599 case 0xab: /* ANX #ab [unofficial] */
600 nz = x = a &= FETCH;
601 break;
602 case 0xaf: /* LAX abcd [unofficial] */
603 ABSOLUTE;
604 LAX;
605 break;
606 case 0xb3: /* LAX (ab),y [unofficial] */
607 INDIRECT_Y;
608 NCYCLES_Y;
609 LAX;
610 break;
611 case 0xb7: /* LAX ab,y [unofficial] */
612 ZPAGE_Y;
613 LAX_ZP;
614 break;
615 case 0xbb: /* LAS abcd,y [unofficial] */
616 ABSOLUTE_Y;
617 NCYCLES_Y;
618 nz = x = a = s &= GetByte(addr);
619 break;
620 case 0xbf: /* LAX abcd,y [unofficial] */
621 ABSOLUTE_Y;
622 NCYCLES_Y;
623 LAX;
624 break;
625 case 0xc3: /* DCM (ab,x) [unofficial] */
626 INDIRECT_X;
627 DCM;
628 break;
629 case 0xc7: /* DCM ab [unofficial] */
630 ZPAGE;
631 DCM_ZP;
632 break;
633 case 0xcb: /* SBX #ab [unofficial] */
634 nz = FETCH;
635 x &= a;
636 c = (x >= nz) ? 1 : 0;
637 nz = x = (x - nz) & 0xff;
638 break;
639 case 0xcf: /* DCM abcd [unofficial] */
640 ABSOLUTE;
641 DCM;
642 break;
643 case 0xd3: /* DCM (ab),y [unofficial] */
644 INDIRECT_Y;
645 DCM;
646 break;
647 case 0xd7: /* DCM ab,x [unofficial] */
648 ZPAGE_X;
649 DCM_ZP;
650 break;
651 case 0xdb: /* DCM abcd,y [unofficial] */
652 ABSOLUTE_Y;
653 DCM;
654 break;
655 case 0xdf: /* DCM abcd,x [unofficial] */
656 ABSOLUTE_X;
657 DCM;
658 break;
659 case 0xe3: /* INS (ab,x) [unofficial] */
660 INDIRECT_X;
661 INS;
662 break;
663 case 0xe7: /* INS ab [unofficial] */
664 ZPAGE;
665 INS_ZP;
666 break;
667 case 0xef: /* INS abcd [unofficial] */
668 ABSOLUTE;
669 INS;
670 break;
671 case 0xf3: /* INS (ab),y [unofficial] */
672 INDIRECT_Y;
673 INS;
674 break;
675 case 0xf7: /* INS ab,x [unofficial] */
676 ZPAGE_X;
677 INS_ZP;
678 break;
679 case 0xfb: /* INS abcd,y [unofficial] */
680 ABSOLUTE_Y;
681 INS;
682 break;
683 case 0xff: /* INS abcd,x [unofficial] */
684 ABSOLUTE_X;
685 INS;
686 break;
687#endif /* ACPU_NO_UNOFFICIAL */
340 case 0x05: /* ORA ab */ 688 case 0x05: /* ORA ab */
341 ZPAGE; 689 ZPAGE;
342 ORA_ZP; 690 ORA_ZP;
@@ -345,10 +693,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
345 ZPAGE; 693 ZPAGE;
346 ASL_ZP; 694 ASL_ZP;
347 break; 695 break;
348 case 0x07: /* ASO ab [unofficial] */
349 ZPAGE;
350 ASO_ZP;
351 break;
352 case 0x08: /* PHP */ 696 case 0x08: /* PHP */
353 PHPB1; 697 PHPB1;
354 break; 698 break;
@@ -359,14 +703,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
359 c = a >> 7; 703 c = a >> 7;
360 nz = a = (a << 1) & 0xff; 704 nz = a = (a << 1) & 0xff;
361 break; 705 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 */ 706 case 0x0d: /* ORA abcd */
371 ABSOLUTE; 707 ABSOLUTE;
372 ORA; 708 ORA;
@@ -375,10 +711,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
375 ABSOLUTE; 711 ABSOLUTE;
376 ASL; 712 ASL;
377 break; 713 break;
378 case 0x0f: /* ASO abcd [unofficial] */
379 ABSOLUTE;
380 ASO;
381 break;
382 case 0x10: /* BPL */ 714 case 0x10: /* BPL */
383 BRANCH(nz < 0x80); 715 BRANCH(nz < 0x80);
384 case 0x11: /* ORA (ab),y */ 716 case 0x11: /* ORA (ab),y */
@@ -386,10 +718,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
386 NCYCLES_Y; 718 NCYCLES_Y;
387 ORA; 719 ORA;
388 break; 720 break;
389 case 0x13: /* ASO (ab),y [unofficial] */
390 INDIRECT_Y;
391 ASO;
392 break;
393 case 0x15: /* ORA ab,x */ 721 case 0x15: /* ORA ab,x */
394 ZPAGE_X; 722 ZPAGE_X;
395 ORA_ZP; 723 ORA_ZP;
@@ -398,10 +726,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
398 ZPAGE_X; 726 ZPAGE_X;
399 ASL_ZP; 727 ASL_ZP;
400 break; 728 break;
401 case 0x17: /* ASO ab,x [unofficial] */
402 ZPAGE_X;
403 ASO_ZP;
404 break;
405 case 0x18: /* CLC */ 729 case 0x18: /* CLC */
406 c = 0; 730 c = 0;
407 break; 731 break;
@@ -410,20 +734,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
410 NCYCLES_Y; 734 NCYCLES_Y;
411 ORA; 735 ORA;
412 break; 736 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 */ 737 case 0x1d: /* ORA abcd,x */
428 ABSOLUTE_X; 738 ABSOLUTE_X;
429 NCYCLES_X; 739 NCYCLES_X;
@@ -433,10 +743,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
433 ABSOLUTE_X; 743 ABSOLUTE_X;
434 ASL; 744 ASL;
435 break; 745 break;
436 case 0x1f: /* ASO abcd,x [unofficial] */
437 ABSOLUTE_X;
438 ASO;
439 break;
440 case 0x20: /* JSR abcd */ 746 case 0x20: /* JSR abcd */
441 addr = FETCH; 747 addr = FETCH;
442 PHPC; 748 PHPC;
@@ -446,10 +752,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
446 INDIRECT_X; 752 INDIRECT_X;
447 AND; 753 AND;
448 break; 754 break;
449 case 0x23: /* RLA (ab,x) [unofficial] */
450 INDIRECT_X;
451 RLA;
452 break;
453 case 0x24: /* BIT ab */ 755 case 0x24: /* BIT ab */
454 ZPAGE; 756 ZPAGE;
455 nz = dGetByte(addr); 757 nz = dGetByte(addr);
@@ -464,10 +766,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
464 ZPAGE; 766 ZPAGE;
465 ROL_ZP; 767 ROL_ZP;
466 break; 768 break;
467 case 0x27: /* RLA ab [unofficial] */
468 ZPAGE;
469 RLA_ZP;
470 break;
471 case 0x28: /* PLP */ 769 case 0x28: /* PLP */
472 PLP; 770 PLP;
473 CHECK_IRQ; 771 CHECK_IRQ;
@@ -494,10 +792,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
494 ABSOLUTE; 792 ABSOLUTE;
495 ROL; 793 ROL;
496 break; 794 break;
497 case 0x2f: /* RLA abcd [unofficial] */
498 ABSOLUTE;
499 RLA;
500 break;
501 case 0x30: /* BMI */ 795 case 0x30: /* BMI */
502 BRANCH(nz >= 0x80); 796 BRANCH(nz >= 0x80);
503 case 0x31: /* AND (ab),y */ 797 case 0x31: /* AND (ab),y */
@@ -505,10 +799,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
505 NCYCLES_Y; 799 NCYCLES_Y;
506 AND; 800 AND;
507 break; 801 break;
508 case 0x33: /* RLA (ab),y [unofficial] */
509 INDIRECT_Y;
510 RLA;
511 break;
512 case 0x35: /* AND ab,x */ 802 case 0x35: /* AND ab,x */
513 ZPAGE_X; 803 ZPAGE_X;
514 AND_ZP; 804 AND_ZP;
@@ -517,10 +807,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
517 ZPAGE_X; 807 ZPAGE_X;
518 ROL_ZP; 808 ROL_ZP;
519 break; 809 break;
520 case 0x37: /* RLA ab,x [unofficial] */
521 ZPAGE_X;
522 RLA_ZP;
523 break;
524 case 0x38: /* SEC */ 810 case 0x38: /* SEC */
525 c = 1; 811 c = 1;
526 break; 812 break;
@@ -529,10 +815,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
529 NCYCLES_Y; 815 NCYCLES_Y;
530 AND; 816 AND;
531 break; 817 break;
532 case 0x3b: /* RLA abcd,y [unofficial] */
533 ABSOLUTE_Y;
534 RLA;
535 break;
536 case 0x3d: /* AND abcd,x */ 818 case 0x3d: /* AND abcd,x */
537 ABSOLUTE_X; 819 ABSOLUTE_X;
538 NCYCLES_X; 820 NCYCLES_X;
@@ -542,10 +824,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
542 ABSOLUTE_X; 824 ABSOLUTE_X;
543 ROL; 825 ROL;
544 break; 826 break;
545 case 0x3f: /* RLA abcd,x [unofficial] */
546 ABSOLUTE_X;
547 RLA;
548 break;
549 case 0x40: /* RTI */ 827 case 0x40: /* RTI */
550 PLP; 828 PLP;
551 PL(pc); 829 PL(pc);
@@ -557,10 +835,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
557 INDIRECT_X; 835 INDIRECT_X;
558 EOR; 836 EOR;
559 break; 837 break;
560 case 0x43: /* LSE (ab,x) [unofficial] */
561 INDIRECT_X;
562 LSE;
563 break;
564 case 0x45: /* EOR ab */ 838 case 0x45: /* EOR ab */
565 ZPAGE; 839 ZPAGE;
566 EOR_ZP; 840 EOR_ZP;
@@ -569,10 +843,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
569 ZPAGE; 843 ZPAGE;
570 LSR_ZP; 844 LSR_ZP;
571 break; 845 break;
572 case 0x47: /* LSE ab [unofficial] */
573 ZPAGE;
574 LSE_ZP;
575 break;
576 case 0x48: /* PHA */ 846 case 0x48: /* PHA */
577 PH(a); 847 PH(a);
578 break; 848 break;
@@ -583,11 +853,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
583 c = a & 1; 853 c = a & 1;
584 nz = a >>= 1; 854 nz = a >>= 1;
585 break; 855 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 */ 856 case 0x4c: /* JMP abcd */
592 addr = FETCH; 857 addr = FETCH;
593 pc = addr + (PEEK << 8); 858 pc = addr + (PEEK << 8);
@@ -600,10 +865,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
600 ABSOLUTE; 865 ABSOLUTE;
601 LSR; 866 LSR;
602 break; 867 break;
603 case 0x4f: /* LSE abcd [unofficial] */
604 ABSOLUTE;
605 LSE;
606 break;
607 case 0x50: /* BVC */ 868 case 0x50: /* BVC */
608 BRANCH((vdi & V_FLAG) == 0); 869 BRANCH((vdi & V_FLAG) == 0);
609 case 0x51: /* EOR (ab),y */ 870 case 0x51: /* EOR (ab),y */
@@ -611,10 +872,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
611 NCYCLES_Y; 872 NCYCLES_Y;
612 EOR; 873 EOR;
613 break; 874 break;
614 case 0x53: /* LSE (ab),y [unofficial] */
615 INDIRECT_Y;
616 LSE;
617 break;
618 case 0x55: /* EOR ab,x */ 875 case 0x55: /* EOR ab,x */
619 ZPAGE_X; 876 ZPAGE_X;
620 EOR_ZP; 877 EOR_ZP;
@@ -623,10 +880,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
623 ZPAGE_X; 880 ZPAGE_X;
624 LSR_ZP; 881 LSR_ZP;
625 break; 882 break;
626 case 0x57: /* LSE ab,x [unofficial] */
627 ZPAGE_X;
628 LSE_ZP;
629 break;
630 case 0x58: /* CLI */ 883 case 0x58: /* CLI */
631 vdi &= V_FLAG | D_FLAG; 884 vdi &= V_FLAG | D_FLAG;
632 CHECK_IRQ; 885 CHECK_IRQ;
@@ -636,10 +889,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
636 NCYCLES_Y; 889 NCYCLES_Y;
637 EOR; 890 EOR;
638 break; 891 break;
639 case 0x5b: /* LSE abcd,y [unofficial] */
640 ABSOLUTE_Y;
641 LSE;
642 break;
643 case 0x5d: /* EOR abcd,x */ 892 case 0x5d: /* EOR abcd,x */
644 ABSOLUTE_X; 893 ABSOLUTE_X;
645 NCYCLES_X; 894 NCYCLES_X;
@@ -649,10 +898,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
649 ABSOLUTE_X; 898 ABSOLUTE_X;
650 LSR; 899 LSR;
651 break; 900 break;
652 case 0x5f: /* LSE abcd,x [unofficial] */
653 ABSOLUTE_X;
654 LSE;
655 break;
656 case 0x60: /* RTS */ 901 case 0x60: /* RTS */
657 PL(pc); 902 PL(pc);
658 PL(addr); 903 PL(addr);
@@ -662,10 +907,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
662 INDIRECT_X; 907 INDIRECT_X;
663 ADC; 908 ADC;
664 break; 909 break;
665 case 0x63: /* RRA (ab,x) [unofficial] */
666 INDIRECT_X;
667 RRA;
668 break;
669 case 0x65: /* ADC ab */ 910 case 0x65: /* ADC ab */
670 ZPAGE; 911 ZPAGE;
671 ADC_ZP; 912 ADC_ZP;
@@ -674,10 +915,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
674 ZPAGE; 915 ZPAGE;
675 ROR_ZP; 916 ROR_ZP;
676 break; 917 break;
677 case 0x67: /* RRA ab [unofficial] */
678 ZPAGE;
679 RRA_ZP;
680 break;
681 case 0x68: /* PLA */ 918 case 0x68: /* PLA */
682 PL(a); 919 PL(a);
683 nz = a; 920 nz = a;
@@ -691,24 +928,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
691 c = a & 1; 928 c = a & 1;
692 a = nz; 929 a = nz;
693 break; 930 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) */ 931 case 0x6c: /* JMP (abcd) */
713 ABSOLUTE; 932 ABSOLUTE;
714 if ((addr & 0xff) == 0xff) 933 if ((addr & 0xff) == 0xff)
@@ -724,10 +943,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
724 ABSOLUTE; 943 ABSOLUTE;
725 ROR; 944 ROR;
726 break; 945 break;
727 case 0x6f: /* RRA abcd [unofficial] */
728 ABSOLUTE;
729 RRA;
730 break;
731 case 0x70: /* BVS */ 946 case 0x70: /* BVS */
732 BRANCH((vdi & V_FLAG) != 0); 947 BRANCH((vdi & V_FLAG) != 0);
733 case 0x71: /* ADC (ab),y */ 948 case 0x71: /* ADC (ab),y */
@@ -735,10 +950,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
735 NCYCLES_Y; 950 NCYCLES_Y;
736 ADC; 951 ADC;
737 break; 952 break;
738 case 0x73: /* RRA (ab),y [unofficial] */
739 INDIRECT_Y;
740 RRA;
741 break;
742 case 0x75: /* ADC ab,x */ 953 case 0x75: /* ADC ab,x */
743 ZPAGE_X; 954 ZPAGE_X;
744 ADC_ZP; 955 ADC_ZP;
@@ -747,10 +958,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
747 ZPAGE_X; 958 ZPAGE_X;
748 ROR_ZP; 959 ROR_ZP;
749 break; 960 break;
750 case 0x77: /* RRA ab,x [unofficial] */
751 ZPAGE_X;
752 RRA_ZP;
753 break;
754 case 0x78: /* SEI */ 961 case 0x78: /* SEI */
755 vdi |= I_FLAG; 962 vdi |= I_FLAG;
756 break; 963 break;
@@ -759,10 +966,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
759 NCYCLES_Y; 966 NCYCLES_Y;
760 ADC; 967 ADC;
761 break; 968 break;
762 case 0x7b: /* RRA abcd,y [unofficial] */
763 ABSOLUTE_Y;
764 RRA;
765 break;
766 case 0x7d: /* ADC abcd,x */ 969 case 0x7d: /* ADC abcd,x */
767 ABSOLUTE_X; 970 ABSOLUTE_X;
768 NCYCLES_X; 971 NCYCLES_X;
@@ -772,18 +975,10 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
772 ABSOLUTE_X; 975 ABSOLUTE_X;
773 ROR; 976 ROR;
774 break; 977 break;
775 case 0x7f: /* RRA abcd,x [unofficial] */
776 ABSOLUTE_X;
777 RRA;
778 break;
779 case 0x81: /* STA (ab,x) */ 978 case 0x81: /* STA (ab,x) */
780 INDIRECT_X; 979 INDIRECT_X;
781 STA; 980 STA;
782 break; 981 break;
783 case 0x83: /* SAX (ab,x) [unofficial] */
784 INDIRECT_X;
785 SAX;
786 break;
787 case 0x84: /* STY ab */ 982 case 0x84: /* STY ab */
788 ZPAGE; 983 ZPAGE;
789 STY_ZP; 984 STY_ZP;
@@ -796,22 +991,12 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
796 ZPAGE; 991 ZPAGE;
797 STX_ZP; 992 STX_ZP;
798 break; 993 break;
799 case 0x87: /* SAX ab [unofficial] */
800 ZPAGE;
801 SAX_ZP;
802 break;
803 case 0x88: /* DEY */ 994 case 0x88: /* DEY */
804 nz = y = (y - 1) & 0xff; 995 nz = y = (y - 1) & 0xff;
805 break; 996 break;
806 case 0x8a: /* TXA */ 997 case 0x8a: /* TXA */
807 nz = a = x; 998 nz = a = x;
808 break; 999 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 */ 1000 case 0x8c: /* STY abcd */
816 ABSOLUTE; 1001 ABSOLUTE;
817 STY; 1002 STY;
@@ -824,23 +1009,12 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
824 ABSOLUTE; 1009 ABSOLUTE;
825 STX; 1010 STX;
826 break; 1011 break;
827 case 0x8f: /* SAX abcd [unofficial] */
828 ABSOLUTE;
829 SAX;
830 break;
831 case 0x90: /* BCC */ 1012 case 0x90: /* BCC */
832 BRANCH(c == 0); 1013 BRANCH(c == 0);
833 case 0x91: /* STA (ab),y */ 1014 case 0x91: /* STA (ab),y */
834 INDIRECT_Y; 1015 INDIRECT_Y;
835 STA; 1016 STA;
836 break; 1017 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 */ 1018 case 0x94: /* STY ab,x */
845 ZPAGE_X; 1019 ZPAGE_X;
846 STY_ZP; 1020 STY_ZP;
@@ -853,10 +1027,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
853 ZPAGE_Y; 1027 ZPAGE_Y;
854 STX_ZP; 1028 STX_ZP;
855 break; 1029 break;
856 case 0x97: /* SAX ab,y [unofficial] */
857 ZPAGE_Y;
858 SAX_ZP;
859 break;
860 case 0x98: /* TYA */ 1030 case 0x98: /* TYA */
861 nz = a = y; 1031 nz = a = y;
862 break; 1032 break;
@@ -867,40 +1037,10 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
867 case 0x9a: /* TXS */ 1037 case 0x9a: /* TXS */
868 s = x; 1038 s = x;
869 break; 1039 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 */ 1040 case 0x9d: /* STA abcd,x */
887 ABSOLUTE_X; 1041 ABSOLUTE_X;
888 STA; 1042 STA;
889 break; 1043 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 */ 1044 case 0xa0: /* LDY #ab */
905 nz = y = FETCH; 1045 nz = y = FETCH;
906 break; 1046 break;
@@ -911,10 +1051,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
911 case 0xa2: /* LDX #ab */ 1051 case 0xa2: /* LDX #ab */
912 nz = x = FETCH; 1052 nz = x = FETCH;
913 break; 1053 break;
914 case 0xa3: /* LAX (ab,x) [unofficial] */
915 INDIRECT_X;
916 LAX;
917 break;
918 case 0xa4: /* LDY ab */ 1054 case 0xa4: /* LDY ab */
919 ZPAGE; 1055 ZPAGE;
920 LDY_ZP; 1056 LDY_ZP;
@@ -927,10 +1063,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
927 ZPAGE; 1063 ZPAGE;
928 LDX_ZP; 1064 LDX_ZP;
929 break; 1065 break;
930 case 0xa7: /* LAX ab [unofficial] */
931 ZPAGE;
932 LAX_ZP;
933 break;
934 case 0xa8: /* TAY */ 1066 case 0xa8: /* TAY */
935 nz = y = a; 1067 nz = y = a;
936 break; 1068 break;
@@ -940,9 +1072,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
940 case 0xaa: /* TAX */ 1072 case 0xaa: /* TAX */
941 nz = x = a; 1073 nz = x = a;
942 break; 1074 break;
943 case 0xab: /* ANX #ab [unofficial] */
944 nz = x = a &= FETCH;
945 break;
946 case 0xac: /* LDY abcd */ 1075 case 0xac: /* LDY abcd */
947 ABSOLUTE; 1076 ABSOLUTE;
948 LDY; 1077 LDY;
@@ -955,10 +1084,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
955 ABSOLUTE; 1084 ABSOLUTE;
956 LDX; 1085 LDX;
957 break; 1086 break;
958 case 0xaf: /* LAX abcd [unofficial] */
959 ABSOLUTE;
960 LAX;
961 break;
962 case 0xb0: /* BCS */ 1087 case 0xb0: /* BCS */
963 BRANCH(c != 0); 1088 BRANCH(c != 0);
964 case 0xb1: /* LDA (ab),y */ 1089 case 0xb1: /* LDA (ab),y */
@@ -966,11 +1091,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
966 NCYCLES_Y; 1091 NCYCLES_Y;
967 LDA; 1092 LDA;
968 break; 1093 break;
969 case 0xb3: /* LAX (ab),y [unofficial] */
970 INDIRECT_Y;
971 NCYCLES_Y;
972 LAX;
973 break;
974 case 0xb4: /* LDY ab,x */ 1094 case 0xb4: /* LDY ab,x */
975 ZPAGE_X; 1095 ZPAGE_X;
976 LDY_ZP; 1096 LDY_ZP;
@@ -983,10 +1103,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
983 ZPAGE_Y; 1103 ZPAGE_Y;
984 LDX_ZP; 1104 LDX_ZP;
985 break; 1105 break;
986 case 0xb7: /* LAX ab,y [unofficial] */
987 ZPAGE_Y;
988 LAX_ZP;
989 break;
990 case 0xb8: /* CLV */ 1106 case 0xb8: /* CLV */
991 vdi &= D_FLAG | I_FLAG; 1107 vdi &= D_FLAG | I_FLAG;
992 break; 1108 break;
@@ -998,11 +1114,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
998 case 0xba: /* TSX */ 1114 case 0xba: /* TSX */
999 nz = x = s; 1115 nz = x = s;
1000 break; 1116 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 */ 1117 case 0xbc: /* LDY abcd,x */
1007 ABSOLUTE_X; 1118 ABSOLUTE_X;
1008 NCYCLES_X; 1119 NCYCLES_X;
@@ -1018,11 +1129,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1018 NCYCLES_Y; 1129 NCYCLES_Y;
1019 LDX; 1130 LDX;
1020 break; 1131 break;
1021 case 0xbf: /* LAX abcd,y [unofficial] */
1022 ABSOLUTE_Y;
1023 NCYCLES_Y;
1024 LAX;
1025 break;
1026 case 0xc0: /* CPY #ab */ 1132 case 0xc0: /* CPY #ab */
1027 nz = FETCH; 1133 nz = FETCH;
1028 c = (y >= nz) ? 1 : 0; 1134 c = (y >= nz) ? 1 : 0;
@@ -1032,10 +1138,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1032 INDIRECT_X; 1138 INDIRECT_X;
1033 CMP; 1139 CMP;
1034 break; 1140 break;
1035 case 0xc3: /* DCM (ab,x) [unofficial] */
1036 INDIRECT_X;
1037 DCM;
1038 break;
1039 case 0xc4: /* CPY ab */ 1141 case 0xc4: /* CPY ab */
1040 ZPAGE; 1142 ZPAGE;
1041 CPY_ZP; 1143 CPY_ZP;
@@ -1048,10 +1150,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1048 ZPAGE; 1150 ZPAGE;
1049 DEC_ZP; 1151 DEC_ZP;
1050 break; 1152 break;
1051 case 0xc7: /* DCM ab [unofficial] */
1052 ZPAGE;
1053 DCM_ZP;
1054 break;
1055 case 0xc8: /* INY */ 1153 case 0xc8: /* INY */
1056 nz = y = (y + 1) & 0xff; 1154 nz = y = (y + 1) & 0xff;
1057 break; 1155 break;
@@ -1063,12 +1161,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1063 case 0xca: /* DEX */ 1161 case 0xca: /* DEX */
1064 nz = x = (x - 1) & 0xff; 1162 nz = x = (x - 1) & 0xff;
1065 break; 1163 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 */ 1164 case 0xcc: /* CPY abcd */
1073 ABSOLUTE; 1165 ABSOLUTE;
1074 CPY; 1166 CPY;
@@ -1081,10 +1173,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1081 ABSOLUTE; 1173 ABSOLUTE;
1082 DEC; 1174 DEC;
1083 break; 1175 break;
1084 case 0xcf: /* DCM abcd [unofficial] */
1085 ABSOLUTE;
1086 DCM;
1087 break;
1088 case 0xd0: /* BNE */ 1176 case 0xd0: /* BNE */
1089 BRANCH((nz & 0xff) != 0); 1177 BRANCH((nz & 0xff) != 0);
1090 case 0xd1: /* CMP (ab),y */ 1178 case 0xd1: /* CMP (ab),y */
@@ -1092,10 +1180,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1092 NCYCLES_Y; 1180 NCYCLES_Y;
1093 CMP; 1181 CMP;
1094 break; 1182 break;
1095 case 0xd3: /* DCM (ab),y [unofficial] */
1096 INDIRECT_Y;
1097 DCM;
1098 break;
1099 case 0xd5: /* CMP ab,x */ 1183 case 0xd5: /* CMP ab,x */
1100 ZPAGE_X; 1184 ZPAGE_X;
1101 CMP_ZP; 1185 CMP_ZP;
@@ -1104,10 +1188,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1104 ZPAGE_X; 1188 ZPAGE_X;
1105 DEC_ZP; 1189 DEC_ZP;
1106 break; 1190 break;
1107 case 0xd7: /* DCM ab,x [unofficial] */
1108 ZPAGE_X;
1109 DCM_ZP;
1110 break;
1111 case 0xd8: /* CLD */ 1191 case 0xd8: /* CLD */
1112 vdi &= V_FLAG | I_FLAG; 1192 vdi &= V_FLAG | I_FLAG;
1113 break; 1193 break;
@@ -1116,10 +1196,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1116 NCYCLES_Y; 1196 NCYCLES_Y;
1117 CMP; 1197 CMP;
1118 break; 1198 break;
1119 case 0xdb: /* DCM abcd,y [unofficial] */
1120 ABSOLUTE_Y;
1121 DCM;
1122 break;
1123 case 0xdd: /* CMP abcd,x */ 1199 case 0xdd: /* CMP abcd,x */
1124 ABSOLUTE_X; 1200 ABSOLUTE_X;
1125 NCYCLES_X; 1201 NCYCLES_X;
@@ -1129,10 +1205,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1129 ABSOLUTE_X; 1205 ABSOLUTE_X;
1130 DEC; 1206 DEC;
1131 break; 1207 break;
1132 case 0xdf: /* DCM abcd,x [unofficial] */
1133 ABSOLUTE_X;
1134 DCM;
1135 break;
1136 case 0xe0: /* CPX #ab */ 1208 case 0xe0: /* CPX #ab */
1137 nz = FETCH; 1209 nz = FETCH;
1138 c = (x >= nz) ? 1 : 0; 1210 c = (x >= nz) ? 1 : 0;
@@ -1142,10 +1214,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1142 INDIRECT_X; 1214 INDIRECT_X;
1143 SBC; 1215 SBC;
1144 break; 1216 break;
1145 case 0xe3: /* INS (ab,x) [unofficial] */
1146 INDIRECT_X;
1147 INS;
1148 break;
1149 case 0xe4: /* CPX ab */ 1217 case 0xe4: /* CPX ab */
1150 ZPAGE; 1218 ZPAGE;
1151 CPX_ZP; 1219 CPX_ZP;
@@ -1158,10 +1226,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1158 ZPAGE; 1226 ZPAGE;
1159 INC_ZP; 1227 INC_ZP;
1160 break; 1228 break;
1161 case 0xe7: /* INS ab [unofficial] */
1162 ZPAGE;
1163 INS_ZP;
1164 break;
1165 case 0xe8: /* INX */ 1229 case 0xe8: /* INX */
1166 nz = x = (x + 1) & 0xff; 1230 nz = x = (x + 1) & 0xff;
1167 break; 1231 break;
@@ -1190,10 +1254,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1190 ABSOLUTE; 1254 ABSOLUTE;
1191 INC; 1255 INC;
1192 break; 1256 break;
1193 case 0xef: /* INS abcd [unofficial] */
1194 ABSOLUTE;
1195 INS;
1196 break;
1197 case 0xf0: /* BEQ */ 1257 case 0xf0: /* BEQ */
1198 BRANCH((nz & 0xff) == 0); 1258 BRANCH((nz & 0xff) == 0);
1199 case 0xf1: /* SBC (ab),y */ 1259 case 0xf1: /* SBC (ab),y */
@@ -1201,10 +1261,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1201 NCYCLES_Y; 1261 NCYCLES_Y;
1202 SBC; 1262 SBC;
1203 break; 1263 break;
1204 case 0xf3: /* INS (ab),y [unofficial] */
1205 INDIRECT_Y;
1206 INS;
1207 break;
1208 case 0xf5: /* SBC ab,x */ 1264 case 0xf5: /* SBC ab,x */
1209 ZPAGE_X; 1265 ZPAGE_X;
1210 SBC_ZP; 1266 SBC_ZP;
@@ -1213,10 +1269,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1213 ZPAGE_X; 1269 ZPAGE_X;
1214 INC_ZP; 1270 INC_ZP;
1215 break; 1271 break;
1216 case 0xf7: /* INS ab,x [unofficial] */
1217 ZPAGE_X;
1218 INS_ZP;
1219 break;
1220 case 0xf8: /* SED */ 1272 case 0xf8: /* SED */
1221 vdi |= D_FLAG; 1273 vdi |= D_FLAG;
1222 break; 1274 break;
@@ -1225,10 +1277,6 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1225 NCYCLES_Y; 1277 NCYCLES_Y;
1226 SBC; 1278 SBC;
1227 break; 1279 break;
1228 case 0xfb: /* INS abcd,y [unofficial] */
1229 ABSOLUTE_Y;
1230 INS;
1231 break;
1232 case 0xfd: /* SBC abcd,x */ 1280 case 0xfd: /* SBC abcd,x */
1233 ABSOLUTE_X; 1281 ABSOLUTE_X;
1234 NCYCLES_X; 1282 NCYCLES_X;
@@ -1238,25 +1286,21 @@ ASAP_FUNC void Cpu_RunScanlines(ASAP_State PTR ast, int scanlines)
1238 ABSOLUTE_X; 1286 ABSOLUTE_X;
1239 INC; 1287 INC;
1240 break; 1288 break;
1241 case 0xff: /* INS abcd,x */
1242 ABSOLUTE_X;
1243 INS;
1244 break;
1245 } 1289 }
1246 } 1290 }
1247 AST cpu_pc = pc; 1291 ast _ cpu_pc = pc;
1248 AST cpu_nz = nz; 1292 ast _ cpu_nz = nz;
1249 AST cpu_a = a; 1293 ast _ cpu_a = a;
1250 AST cpu_x = x; 1294 ast _ cpu_x = x;
1251 AST cpu_y = y; 1295 ast _ cpu_y = y;
1252 AST cpu_c = c; 1296 ast _ cpu_c = c;
1253 AST cpu_s = s; 1297 ast _ cpu_s = s;
1254 AST cpu_vdi = vdi; 1298 ast _ cpu_vdi = vdi;
1255 AST cycle -= cycle_limit; 1299 ast _ cycle -= cycle_limit;
1256 if (AST timer1_cycle != NEVER) 1300 if (ast _ timer1_cycle != NEVER)
1257 AST timer1_cycle -= cycle_limit; 1301 ast _ timer1_cycle -= cycle_limit;
1258 if (AST timer2_cycle != NEVER) 1302 if (ast _ timer2_cycle != NEVER)
1259 AST timer2_cycle -= cycle_limit; 1303 ast _ timer2_cycle -= cycle_limit;
1260 if (AST timer4_cycle != NEVER) 1304 if (ast _ timer4_cycle != NEVER)
1261 AST timer4_cycle -= cycle_limit; 1305 ast _ timer4_cycle -= cycle_limit;
1262} 1306}
diff --git a/apps/codecs/libasap/anylang.h b/apps/codecs/libasap/anylang.h
new file mode 100644
index 0000000000..4d955d6026
--- /dev/null
+++ b/apps/codecs/libasap/anylang.h
@@ -0,0 +1,218 @@
1/*
2 * anylang.h - C/Java/C#/JavaScript/ActionScript abstraction layer
3 *
4 * Copyright (C) 2007-2010 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 _ANYLANG_H_
25#define _ANYLANG_H_
26
27#if defined(JAVA) || defined(CSHARP) || defined(JAVASCRIPT) || defined(ACTIONSCRIPT)
28
29#define FALSE false
30#define TRUE true
31#define NULL null
32#define _ .
33#define PRIVATE
34#define CONST
35#define OUT_STRING STRING
36
37#else
38
39#define C
40#include <string.h>
41
42#define PRIVATE static
43#define FUNC(type, name, pars) type name pars
44#define P(type, name) type name
45#define V(type, name) type name
46#define CONST const
47#define _ ->
48#define PTR *
49#define ADDRESSOF &
50#define CAST(type) (type)
51#define TO_INT(x) (int) (x)
52#define TO_BYTE(x) (byte) (x)
53#define BYTEARRAY byte *
54#define BOOLARRAY abool *
55#define VOIDPTR void *
56#define UBYTE(data) (data)
57#define SBYTE(data) (signed char) (data)
58#define CONST_ARRAY(type, name) static const type name[] = {
59#define END_CONST_ARRAY }
60#define ZERO_ARRAY(array) memset(array, 0, sizeof(array))
61#define COPY_ARRAY(dest, dest_offset, src, src_offset, len) \
62 memcpy(dest + dest_offset, src + src_offset, len)
63#define NEW_ARRAY(type, name, size) \
64 type name[size]
65#define INIT_ARRAY(array) memset(array, 0, sizeof(array))
66#define STRING const char *
67#define OUT_STRING char *
68#define CHARAT(s, i) (s)[i]
69#define CHARCODEAT(s, i) (s)[i]
70#define CHARCODE(c) (c)
71#define EQUAL_STRINGS(s1, s2) (strcmp(s1, s2) == 0)
72#define EMPTY_STRING(s) (s)[0] = '\0'
73#define SUBSTR(s, i) (s + i)
74#define BYTES_TO_STRING(dest, src, src_offset, len) \
75 do { memcpy(dest, src + src_offset, len); (dest)[len] = '\0'; } while (FALSE)
76#define SUBSTRING(dest, src, src_offset, len) \
77 do { memcpy(dest, src + src_offset, len); (dest)[len] = '\0'; } while (FALSE)
78
79#define RESOURCE const byte *
80#define GET_RESOURCE(name, ext) name##_##ext
81
82#endif /* defined(JAVA) || defined(CSHARP) || defined(JAVASCRIPT) || defined(ACTIONSCRIPT) */
83
84#ifdef JAVA
85
86#define abool boolean
87#define FUNC(type, name, pars) private static type name pars
88#define P(type, name) type name
89#define V(type, name) type name
90#define PTR
91#define ADDRESSOF
92#define CAST(type) (type)
93#define TO_INT(x) (int) (x)
94#define TO_BYTE(x) (byte) (x)
95#define BYTEARRAY byte[]
96#define BOOLARRAY boolean[]
97#define VOIDPTR byte[]
98#define UBYTE(data) ((data) & 0xff)
99#define SBYTE(data) (byte) (data)
100#define CONST_ARRAY(type, name) private static final type[] name = {
101#define END_CONST_ARRAY }
102#define sizeof(array) array.length
103#define ZERO_ARRAY(array) for (int ii = 0; ii < array.length; ii++) array[ii] = 0
104#define COPY_ARRAY(dest, dest_offset, src, src_offset, len) \
105 System.arraycopy(src, src_offset, dest, dest_offset, len)
106#define NEW_ARRAY(type, name, size) \
107 type[] name = new type[size]
108#define INIT_ARRAY(array)
109#define STRING String
110#define CHARAT(s, i) (s).charAt(i)
111#define CHARCODEAT(s, i) (s).charAt(i)
112#define CHARCODE(c) (c)
113#define strlen(s) (s).length()
114#define EQUAL_STRINGS(s1, s2) (s1).equals(s2)
115#define EMPTY_STRING(s) (s) = ""
116#define SUBSTR(s, i) (s).substring(i)
117#define BYTES_TO_STRING(dest, src, src_offset, len) \
118 (dest) = new String(src, src_offset, len)
119#define SUBSTRING(dest, src, src_offset, len) \
120 (dest) = (src).substring(src_offset, src_offset + len)
121
122#define RESOURCE byte[]
123#define GET_RESOURCE(name, ext) getResourceBytes(#name + "." + #ext)
124
125#elif defined(CSHARP)
126
127#define abool bool
128#define FUNC(type, name, pars) private static type name pars
129#define P(type, name) type name
130#define V(type, name) type name
131#define PTR
132#define ADDRESSOF
133#define CAST(type) (type)
134#define TO_INT(x) (int) (x)
135#define TO_BYTE(x) (byte) (x)
136#define BYTEARRAY byte[]
137#define BOOLARRAY bool[]
138#define VOIDPTR byte[]
139#define UBYTE(data) (data)
140#define SBYTE(data) (sbyte) (data)
141#define CONST_ARRAY(type, name) private static readonly type[] name = {
142#define END_CONST_ARRAY }
143#define sizeof(array) array.Length
144#define ZERO_ARRAY(array) Array.Clear(array, 0, array.Length)
145#define COPY_ARRAY(dest, dest_offset, src, src_offset, len) \
146 Array.Copy(src, src_offset, dest, dest_offset, len)
147#define NEW_ARRAY(type, name, size) \
148 type[] name = new type[size]
149#define INIT_ARRAY(array)
150#define STRING string
151#define CHARAT(s, i) (s)[i]
152#define CHARCODEAT(s, i) (s)[i]
153#define CHARCODE(c) (c)
154#define strlen(s) (s).Length
155#define EQUAL_STRINGS(s1, s2) ((s1) == (s2))
156#define EMPTY_STRING(s) (s) = string.Empty
157#define SUBSTR(s, i) (s).Substring(i)
158#define BYTES_TO_STRING(dest, src, src_offset, len) \
159 (dest) = System.Text.Encoding.ASCII.GetString(src, src_offset, len)
160#define SUBSTRING(dest, src, src_offset, len) \
161 (dest) = (src).Substring(src_offset, len)
162
163#define RESOURCE byte[]
164#define GET_RESOURCE(name, ext) name##_##ext
165
166#elif defined(JAVASCRIPT) || defined(ACTIONSCRIPT)
167
168#ifdef ACTIONSCRIPT
169#define abool Boolean
170#define char String
171#define STRING String
172#define BYTEARRAY ByteArray
173#define BOOLARRAY Array
174#define VOIDPTR ByteArray
175#define RESOURCE Array
176#define FUNC(type, name, pars) private static function name pars : type
177#define P(type, name) name : type
178#define V(type, name) var name : type
179#define TO_INT(x) int(x)
180#define CONST_ARRAY(type, name) private static const name : Array = [
181#else
182#define FUNC(type, name, pars) function name pars
183#define P(type, name) name
184#define V(type, name) var name
185#define TO_INT(x) Math.floor(x)
186#define CONST_ARRAY(type, name) var name = [
187#endif
188#define PTR
189#define ADDRESSOF
190#define CAST(type)
191#define TO_BYTE(x) ((x) & 0xff)
192#define UBYTE(data) (data)
193#define SBYTE(data) ((data) < 0x80 ? (data) : (data) - 256)
194#define END_CONST_ARRAY ]
195#define sizeof(array) array.length
196#define ZERO_ARRAY(array) for (V(int, ii) = 0; ii < array.length; ii++) array[ii] = 0
197#define COPY_ARRAY(dest, dest_offset, src, src_offset, len) \
198 for (V(int, ii) = 0; ii < len; ii++) dest[dest_offset + ii] = src[src_offset + ii]
199#define NEW_ARRAY(type, name, size) \
200 V(Array, name) = new Array(size)
201#define INIT_ARRAY(array) for (V(int, ii) = 0; ii < array.length; ii++) array[ii] = 0
202#define CHARAT(s, i) (s).charAt(i)
203#define CHARCODEAT(s, i) (s).charCodeAt(i)
204#define CHARCODE(c) (c).charCodeAt(0)
205#define strlen(s) (s).length
206#define EQUAL_STRINGS(s1, s2) ((s1) == (s2))
207#define EMPTY_STRING(s) s = ""
208#define SUBSTR(s, i) (s).substr(i)
209#define BYTES_TO_STRING(dest, src, src_offset, len) \
210 { dest = ""; for (V(int, ii) = 0; ii < len; ii++) dest += String.fromCharCode(src[src_offset + ii]); }
211#define SUBSTRING(dest, src, src_offset, len) \
212 dest = (src).substring(src_offset, src_offset + len)
213
214#define GET_RESOURCE(name, ext) name##_##ext
215
216#endif
217
218#endif /* _ANYLANG_H_ */
diff --git a/apps/codecs/libasap/apokeysnd.c b/apps/codecs/libasap/apokeysnd.c
index 1d48bc20d2..a461fa96da 100644
--- a/apps/codecs/libasap/apokeysnd.c
+++ b/apps/codecs/libasap/apokeysnd.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * apokeysnd.c - another POKEY sound emulator 2 * apokeysnd.c - another POKEY sound emulator
3 * 3 *
4 * Copyright (C) 2007-2008 Piotr Fusik 4 * Copyright (C) 2007-2009 Piotr Fusik
5 * 5 *
6 * This file is part of ASAP (Another Slight Atari Player), 6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net 7 * see http://asap.sourceforge.net
@@ -20,114 +20,109 @@
20 * along with ASAP; if not, write to the Free Software Foundation, Inc., 20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */ 22 */
23#include "codeclib.h"
24#if !defined(JAVA) && !defined(CSHARP)
25#include <string.h>
26#endif
27 23
28#include "asap_internal.h" 24#include "asap_internal.h"
29 25
30#define memset ci->memset
31#define ULTRASOUND_CYCLES 112 26#define ULTRASOUND_CYCLES 112
32 27
33#define MUTE_FREQUENCY 1 28#define MUTE_FREQUENCY 1
34#define MUTE_INIT 2 29#define MUTE_INIT 2
35#define MUTE_USER 4 30#define MUTE_USER 4
36 31
37CONST_LOOKUP(byte, poly4_lookup) = 32CONST_ARRAY(byte, poly4_lookup)
38 { 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1 }; 33 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1
39CONST_LOOKUP(byte, poly5_lookup) = 34END_CONST_ARRAY;
40 { 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 35CONST_ARRAY(byte, poly5_lookup)
41 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1 }; 36 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1,
37 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1
38END_CONST_ARRAY;
42 39
43FILE_FUNC void init_state(PokeyState PTR pst) 40PRIVATE FUNC(void, PokeySound_InitializeChip, (P(PokeyState PTR, pst)))
44{ 41{
45 PST audctl = 0; 42 pst _ audctl = 0;
46 PST init = FALSE; 43 pst _ init = FALSE;
47 PST poly_index = 15 * 31 * 131071; 44 pst _ poly_index = 15 * 31 * 131071;
48 PST div_cycles = 28; 45 pst _ div_cycles = 28;
49 PST mute1 = MUTE_FREQUENCY | MUTE_USER; 46 pst _ mute1 = MUTE_FREQUENCY | MUTE_USER;
50 PST mute2 = MUTE_FREQUENCY | MUTE_USER; 47 pst _ mute2 = MUTE_FREQUENCY | MUTE_USER;
51 PST mute3 = MUTE_FREQUENCY | MUTE_USER; 48 pst _ mute3 = MUTE_FREQUENCY | MUTE_USER;
52 PST mute4 = MUTE_FREQUENCY | MUTE_USER; 49 pst _ mute4 = MUTE_FREQUENCY | MUTE_USER;
53 PST audf1 = 0; 50 pst _ audf1 = 0;
54 PST audf2 = 0; 51 pst _ audf2 = 0;
55 PST audf3 = 0; 52 pst _ audf3 = 0;
56 PST audf4 = 0; 53 pst _ audf4 = 0;
57 PST audc1 = 0; 54 pst _ audc1 = 0;
58 PST audc2 = 0; 55 pst _ audc2 = 0;
59 PST audc3 = 0; 56 pst _ audc3 = 0;
60 PST audc4 = 0; 57 pst _ audc4 = 0;
61 PST tick_cycle1 = NEVER; 58 pst _ tick_cycle1 = NEVER;
62 PST tick_cycle2 = NEVER; 59 pst _ tick_cycle2 = NEVER;
63 PST tick_cycle3 = NEVER; 60 pst _ tick_cycle3 = NEVER;
64 PST tick_cycle4 = NEVER; 61 pst _ tick_cycle4 = NEVER;
65 PST period_cycles1 = 28; 62 pst _ period_cycles1 = 28;
66 PST period_cycles2 = 28; 63 pst _ period_cycles2 = 28;
67 PST period_cycles3 = 28; 64 pst _ period_cycles3 = 28;
68 PST period_cycles4 = 28; 65 pst _ period_cycles4 = 28;
69 PST reload_cycles1 = 28; 66 pst _ reload_cycles1 = 28;
70 PST reload_cycles3 = 28; 67 pst _ reload_cycles3 = 28;
71 PST out1 = 0; 68 pst _ out1 = 0;
72 PST out2 = 0; 69 pst _ out2 = 0;
73 PST out3 = 0; 70 pst _ out3 = 0;
74 PST out4 = 0; 71 pst _ out4 = 0;
75 PST delta1 = 0; 72 pst _ delta1 = 0;
76 PST delta2 = 0; 73 pst _ delta2 = 0;
77 PST delta3 = 0; 74 pst _ delta3 = 0;
78 PST delta4 = 0; 75 pst _ delta4 = 0;
79 PST skctl = 3; 76 pst _ skctl = 3;
80 ZERO_ARRAY(PST delta_buffer); 77 ZERO_ARRAY(pst _ delta_buffer);
81} 78}
82 79
83ASAP_FUNC void PokeySound_Initialize(ASAP_State PTR ast) 80FUNC(void, PokeySound_Initialize, (P(ASAP_State PTR, ast)))
84{ 81{
85 int i; 82 V(int, i);
86 int reg; 83 V(int, reg);
87 reg = 0x1ff; 84 reg = 0x1ff;
88 for (i = 0; i < 511; i++) { 85 for (i = 0; i < 511; i++) {
89 reg = ((((reg >> 5) ^ reg) & 1) << 8) + (reg >> 1); 86 reg = ((((reg >> 5) ^ reg) & 1) << 8) + (reg >> 1);
90 AST poly9_lookup[i] = (byte) reg; 87 ast _ poly9_lookup[i] = TO_BYTE(reg);
91 } 88 }
92 reg = 0x1ffff; 89 reg = 0x1ffff;
93 for (i = 0; i < 16385; i++) { 90 for (i = 0; i < 16385; i++) {
94 reg = ((((reg >> 5) ^ reg) & 0xff) << 9) + (reg >> 8); 91 reg = ((((reg >> 5) ^ reg) & 0xff) << 9) + (reg >> 8);
95 AST poly17_lookup[i] = (byte) (reg >> 1); 92 ast _ poly17_lookup[i] = TO_BYTE(reg >> 1);
96 } 93 }
97 AST sample_offset = 0; 94 ast _ sample_offset = 0;
98 AST sample_index = 0; 95 ast _ sample_index = 0;
99 AST samples = 0; 96 ast _ samples = 0;
100 AST iir_acc_left = 0; 97 ast _ iir_acc_left = 0;
101 AST iir_acc_right = 0; 98 ast _ iir_acc_right = 0;
102 init_state(ADDRESSOF AST base_pokey); 99 PokeySound_InitializeChip(ADDRESSOF ast _ base_pokey);
103 init_state(ADDRESSOF AST extra_pokey); 100 PokeySound_InitializeChip(ADDRESSOF ast _ extra_pokey);
104} 101}
105 102
106#define CYCLE_TO_SAMPLE(cycle) (((cycle) * ASAP_SAMPLE_RATE + AST sample_offset) / ASAP_MAIN_CLOCK)
107
108#define DO_TICK(ch) \ 103#define DO_TICK(ch) \
109 if (PST init) { \ 104 if (pst _ init) { \
110 switch (PST audc##ch >> 4) { \ 105 switch (pst _ audc##ch >> 4) { \
111 case 10: \ 106 case 10: \
112 case 14: \ 107 case 14: \
113 PST out##ch ^= 1; \ 108 pst _ out##ch ^= 1; \
114 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta##ch = -PST delta##ch; \ 109 pst _ delta_buffer[CYCLE_TO_SAMPLE(cycle)] += pst _ delta##ch = -pst _ delta##ch; \
115 break; \ 110 break; \
116 default: \ 111 default: \
117 break; \ 112 break; \
118 } \ 113 } \
119 } \ 114 } \
120 else { \ 115 else { \
121 int poly = cycle + PST poly_index - (ch - 1); \ 116 V(int, poly) = cycle + pst _ poly_index - (ch - 1); \
122 int newout = PST out##ch; \ 117 V(int, newout) = pst _ out##ch; \
123 switch (PST audc##ch >> 4) { \ 118 switch (pst _ audc##ch >> 4) { \
124 case 0: \ 119 case 0: \
125 if (poly5_lookup[poly % 31] != 0) { \ 120 if (poly5_lookup[poly % 31] != 0) { \
126 if ((PST audctl & 0x80) != 0) \ 121 if ((pst _ audctl & 0x80) != 0) \
127 newout = AST poly9_lookup[poly % 511] & 1; \ 122 newout = ast _ poly9_lookup[poly % 511] & 1; \
128 else { \ 123 else { \
129 poly %= 131071; \ 124 poly %= 131071; \
130 newout = (AST poly17_lookup[poly >> 3] >> (poly & 7)) & 1; \ 125 newout = (ast _ poly17_lookup[poly >> 3] >> (poly & 7)) & 1; \
131 } \ 126 } \
132 } \ 127 } \
133 break; \ 128 break; \
@@ -140,11 +135,11 @@ ASAP_FUNC void PokeySound_Initialize(ASAP_State PTR ast)
140 newout = poly4_lookup[poly % 15]; \ 135 newout = poly4_lookup[poly % 15]; \
141 break; \ 136 break; \
142 case 8: \ 137 case 8: \
143 if ((PST audctl & 0x80) != 0) \ 138 if ((pst _ audctl & 0x80) != 0) \
144 newout = AST poly9_lookup[poly % 511] & 1; \ 139 newout = ast _ poly9_lookup[poly % 511] & 1; \
145 else { \ 140 else { \
146 poly %= 131071; \ 141 poly %= 131071; \
147 newout = (AST poly17_lookup[poly >> 3] >> (poly & 7)) & 1; \ 142 newout = (ast _ poly17_lookup[poly >> 3] >> (poly & 7)) & 1; \
148 } \ 143 } \
149 break; \ 144 break; \
150 case 10: \ 145 case 10: \
@@ -157,125 +152,141 @@ ASAP_FUNC void PokeySound_Initialize(ASAP_State PTR ast)
157 default: \ 152 default: \
158 break; \ 153 break; \
159 } \ 154 } \
160 if (newout != PST out##ch) { \ 155 if (newout != pst _ out##ch) { \
161 PST out##ch = newout; \ 156 pst _ out##ch = newout; \
162 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta##ch = -PST delta##ch; \ 157 pst _ delta_buffer[CYCLE_TO_SAMPLE(cycle)] += pst _ delta##ch = -pst _ delta##ch; \
163 } \ 158 } \
164 } 159 }
165 160
166FILE_FUNC void generate(ASAP_State PTR ast, PokeyState PTR pst, int current_cycle) 161/* Fills delta_buffer up to current_cycle basing on current AUDF/AUDC/AUDCTL values. */
162PRIVATE FUNC(void, PokeySound_GenerateUntilCycle, (P(ASAP_State PTR, ast), P(PokeyState PTR, pst), P(int, current_cycle)))
167{ 163{
168 for (;;) { 164 for (;;) {
169 int cycle = current_cycle; 165 V(int, cycle) = current_cycle;
170 if (cycle > PST tick_cycle1) 166 if (cycle > pst _ tick_cycle1)
171 cycle = PST tick_cycle1; 167 cycle = pst _ tick_cycle1;
172 if (cycle > PST tick_cycle2) 168 if (cycle > pst _ tick_cycle2)
173 cycle = PST tick_cycle2; 169 cycle = pst _ tick_cycle2;
174 if (cycle > PST tick_cycle3) 170 if (cycle > pst _ tick_cycle3)
175 cycle = PST tick_cycle3; 171 cycle = pst _ tick_cycle3;
176 if (cycle > PST tick_cycle4) 172 if (cycle > pst _ tick_cycle4)
177 cycle = PST tick_cycle4; 173 cycle = pst _ tick_cycle4;
178 if (cycle == current_cycle) 174 if (cycle == current_cycle)
179 break; 175 break;
180 if (cycle == PST tick_cycle3) { 176 if (cycle == pst _ tick_cycle3) {
181 PST tick_cycle3 += PST period_cycles3; 177 pst _ tick_cycle3 += pst _ period_cycles3;
182 if ((PST audctl & 4) != 0 && PST delta1 > 0 && PST mute1 == 0) 178 if ((pst _ audctl & 4) != 0 && pst _ delta1 > 0 && pst _ mute1 == 0)
183 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta1 = -PST delta1; 179 pst _ delta_buffer[CYCLE_TO_SAMPLE(cycle)] += pst _ delta1 = -pst _ delta1;
184 DO_TICK(3); 180 DO_TICK(3);
185 } 181 }
186 if (cycle == PST tick_cycle4) { 182 if (cycle == pst _ tick_cycle4) {
187 PST tick_cycle4 += PST period_cycles4; 183 pst _ tick_cycle4 += pst _ period_cycles4;
188 if ((PST audctl & 8) != 0) 184 if ((pst _ audctl & 8) != 0)
189 PST tick_cycle3 = cycle + PST reload_cycles3; 185 pst _ tick_cycle3 = cycle + pst _ reload_cycles3;
190 if ((PST audctl & 2) != 0 && PST delta2 > 0 && PST mute2 == 0) 186 if ((pst _ audctl & 2) != 0 && pst _ delta2 > 0 && pst _ mute2 == 0)
191 PST delta_buffer[CYCLE_TO_SAMPLE(cycle)] += PST delta2 = -PST delta2; 187 pst _ delta_buffer[CYCLE_TO_SAMPLE(cycle)] += pst _ delta2 = -pst _ delta2;
192 DO_TICK(4); 188 DO_TICK(4);
193 } 189 }
194 if (cycle == PST tick_cycle1) { 190 if (cycle == pst _ tick_cycle1) {
195 PST tick_cycle1 += PST period_cycles1; 191 pst _ tick_cycle1 += pst _ period_cycles1;
196 if ((PST skctl & 0x88) == 8) 192 if ((pst _ skctl & 0x88) == 8) /* two-tone, sending 1 (i.e. timer1) */
197 PST tick_cycle2 = cycle + PST period_cycles2; 193 pst _ tick_cycle2 = cycle + pst _ period_cycles2;
198 DO_TICK(1); 194 DO_TICK(1);
199 } 195 }
200 if (cycle == PST tick_cycle2) { 196 if (cycle == pst _ tick_cycle2) {
201 PST tick_cycle2 += PST period_cycles2; 197 pst _ tick_cycle2 += pst _ period_cycles2;
202 if ((PST audctl & 0x10) != 0) 198 if ((pst _ audctl & 0x10) != 0)
203 PST tick_cycle1 = cycle + PST reload_cycles1; 199 pst _ tick_cycle1 = cycle + pst _ reload_cycles1;
204 else if ((PST skctl & 8) != 0) 200 else if ((pst _ skctl & 8) != 0) /* two-tone */
205 PST tick_cycle1 = cycle + PST period_cycles1; 201 pst _ tick_cycle1 = cycle + pst _ period_cycles1;
206 DO_TICK(2); 202 DO_TICK(2);
207 } 203 }
208 } 204 }
209} 205}
210 206
207#ifdef APOKEYSND
208
209#define CURRENT_CYCLE 0
210#define CURRENT_SAMPLE 0
211#define DO_STORE(reg) \
212 if (data == pst _ reg) \
213 break; \
214 pst _ reg = data;
215
216#else
217
218#define CURRENT_CYCLE ast _ cycle
219#define CURRENT_SAMPLE CYCLE_TO_SAMPLE(ast _ cycle)
220#define DO_STORE(reg) \
221 if (data == pst _ reg) \
222 break; \
223 PokeySound_GenerateUntilCycle(ast, pst, ast _ cycle); \
224 pst _ reg = data;
225
226#endif /* APOKEYSND */
227
211#define MUTE_CHANNEL(ch, cond, mask) \ 228#define MUTE_CHANNEL(ch, cond, mask) \
212 if (cond) { \ 229 if (cond) { \
213 PST mute##ch |= mask; \ 230 pst _ mute##ch |= mask; \
214 PST tick_cycle##ch = NEVER; \ 231 pst _ tick_cycle##ch = NEVER; \
215 } \ 232 } \
216 else { \ 233 else { \
217 PST mute##ch &= ~mask; \ 234 pst _ mute##ch &= ~mask; \
218 if (PST tick_cycle##ch == NEVER && PST mute##ch == 0) \ 235 if (pst _ tick_cycle##ch == NEVER && pst _ mute##ch == 0) \
219 PST tick_cycle##ch = AST cycle; \ 236 pst _ tick_cycle##ch = CURRENT_CYCLE; \
220 } 237 }
221 238
222#define DO_ULTRASOUND(ch) \ 239#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) 240 MUTE_CHANNEL(ch, pst _ period_cycles##ch <= ULTRASOUND_CYCLES && (pst _ audc##ch >> 4 == 10 || pst _ audc##ch >> 4 == 14), MUTE_FREQUENCY)
224 241
225#define DO_AUDC(ch) \ 242#define DO_AUDC(ch) \
226 if (data == PST audc##ch) \ 243 DO_STORE(audc##ch); \
227 break; \
228 generate(ast, pst, AST cycle); \
229 PST audc##ch = data; \
230 if ((data & 0x10) != 0) { \ 244 if ((data & 0x10) != 0) { \
231 data &= 0xf; \ 245 data = (data & 0xf) << DELTA_SHIFT_POKEY; \
232 if ((PST mute##ch & MUTE_USER) == 0) \ 246 if ((pst _ mute##ch & MUTE_USER) == 0) \
233 PST delta_buffer[CYCLE_TO_SAMPLE(AST cycle)] \ 247 pst _ delta_buffer[CURRENT_SAMPLE] \
234 += PST delta##ch > 0 ? data - PST delta##ch : data; \ 248 += pst _ delta##ch > 0 ? data - pst _ delta##ch : data; \
235 PST delta##ch = data; \ 249 pst _ delta##ch = data; \
236 } \ 250 } \
237 else { \ 251 else { \
238 data &= 0xf; \ 252 data = (data & 0xf) << DELTA_SHIFT_POKEY; \
239 DO_ULTRASOUND(ch); \ 253 DO_ULTRASOUND(ch); \
240 if (PST delta##ch > 0) { \ 254 if (pst _ delta##ch > 0) { \
241 if ((PST mute##ch & MUTE_USER) == 0) \ 255 if ((pst _ mute##ch & MUTE_USER) == 0) \
242 PST delta_buffer[CYCLE_TO_SAMPLE(AST cycle)] \ 256 pst _ delta_buffer[CURRENT_SAMPLE] \
243 += data - PST delta##ch; \ 257 += data - pst _ delta##ch; \
244 PST delta##ch = data; \ 258 pst _ delta##ch = data; \
245 } \ 259 } \
246 else \ 260 else \
247 PST delta##ch = -data; \ 261 pst _ delta##ch = -data; \
248 } \ 262 } \
249 break; 263 break;
250 264
251#define DO_INIT(ch, cond) \ 265#define DO_INIT(ch, cond) \
252 MUTE_CHANNEL(ch, PST init && cond, MUTE_INIT) 266 MUTE_CHANNEL(ch, pst _ init && cond, MUTE_INIT)
253 267
254ASAP_FUNC void PokeySound_PutByte(ASAP_State PTR ast, int addr, int data) 268FUNC(void, PokeySound_PutByte, (P(ASAP_State PTR, ast), P(int, addr), P(int, data)))
255{ 269{
256 PokeyState PTR pst = (addr & AST extra_pokey_mask) != 0 270 V(PokeyState PTR, pst) = (addr & ast _ extra_pokey_mask) != 0
257 ? ADDRESSOF AST extra_pokey : ADDRESSOF AST base_pokey; 271 ? ADDRESSOF ast _ extra_pokey : ADDRESSOF ast _ base_pokey;
258 switch (addr & 0xf) { 272 switch (addr & 0xf) {
259 case 0x00: 273 case 0x00:
260 if (data == PST audf1) 274 DO_STORE(audf1);
261 break; 275 switch (pst _ audctl & 0x50) {
262 generate(ast, pst, AST cycle);
263 PST audf1 = data;
264 switch (PST audctl & 0x50) {
265 case 0x00: 276 case 0x00:
266 PST period_cycles1 = PST div_cycles * (data + 1); 277 pst _ period_cycles1 = pst _ div_cycles * (data + 1);
267 break; 278 break;
268 case 0x10: 279 case 0x10:
269 PST period_cycles2 = PST div_cycles * (data + 256 * PST audf2 + 1); 280 pst _ period_cycles2 = pst _ div_cycles * (data + 256 * pst _ audf2 + 1);
270 PST reload_cycles1 = PST div_cycles * (data + 1); 281 pst _ reload_cycles1 = pst _ div_cycles * (data + 1);
271 DO_ULTRASOUND(2); 282 DO_ULTRASOUND(2);
272 break; 283 break;
273 case 0x40: 284 case 0x40:
274 PST period_cycles1 = data + 4; 285 pst _ period_cycles1 = data + 4;
275 break; 286 break;
276 case 0x50: 287 case 0x50:
277 PST period_cycles2 = data + 256 * PST audf2 + 7; 288 pst _ period_cycles2 = data + 256 * pst _ audf2 + 7;
278 PST reload_cycles1 = data + 4; 289 pst _ reload_cycles1 = data + 4;
279 DO_ULTRASOUND(2); 290 DO_ULTRASOUND(2);
280 break; 291 break;
281 } 292 }
@@ -284,20 +295,17 @@ ASAP_FUNC void PokeySound_PutByte(ASAP_State PTR ast, int addr, int data)
284 case 0x01: 295 case 0x01:
285 DO_AUDC(1) 296 DO_AUDC(1)
286 case 0x02: 297 case 0x02:
287 if (data == PST audf2) 298 DO_STORE(audf2);
288 break; 299 switch (pst _ audctl & 0x50) {
289 generate(ast, pst, AST cycle);
290 PST audf2 = data;
291 switch (PST audctl & 0x50) {
292 case 0x00: 300 case 0x00:
293 case 0x40: 301 case 0x40:
294 PST period_cycles2 = PST div_cycles * (data + 1); 302 pst _ period_cycles2 = pst _ div_cycles * (data + 1);
295 break; 303 break;
296 case 0x10: 304 case 0x10:
297 PST period_cycles2 = PST div_cycles * (PST audf1 + 256 * data + 1); 305 pst _ period_cycles2 = pst _ div_cycles * (pst _ audf1 + 256 * data + 1);
298 break; 306 break;
299 case 0x50: 307 case 0x50:
300 PST period_cycles2 = PST audf1 + 256 * data + 7; 308 pst _ period_cycles2 = pst _ audf1 + 256 * data + 7;
301 break; 309 break;
302 } 310 }
303 DO_ULTRASOUND(2); 311 DO_ULTRASOUND(2);
@@ -305,25 +313,22 @@ ASAP_FUNC void PokeySound_PutByte(ASAP_State PTR ast, int addr, int data)
305 case 0x03: 313 case 0x03:
306 DO_AUDC(2) 314 DO_AUDC(2)
307 case 0x04: 315 case 0x04:
308 if (data == PST audf3) 316 DO_STORE(audf3);
309 break; 317 switch (pst _ audctl & 0x28) {
310 generate(ast, pst, AST cycle);
311 PST audf3 = data;
312 switch (PST audctl & 0x28) {
313 case 0x00: 318 case 0x00:
314 PST period_cycles3 = PST div_cycles * (data + 1); 319 pst _ period_cycles3 = pst _ div_cycles * (data + 1);
315 break; 320 break;
316 case 0x08: 321 case 0x08:
317 PST period_cycles4 = PST div_cycles * (data + 256 * PST audf4 + 1); 322 pst _ period_cycles4 = pst _ div_cycles * (data + 256 * pst _ audf4 + 1);
318 PST reload_cycles3 = PST div_cycles * (data + 1); 323 pst _ reload_cycles3 = pst _ div_cycles * (data + 1);
319 DO_ULTRASOUND(4); 324 DO_ULTRASOUND(4);
320 break; 325 break;
321 case 0x20: 326 case 0x20:
322 PST period_cycles3 = data + 4; 327 pst _ period_cycles3 = data + 4;
323 break; 328 break;
324 case 0x28: 329 case 0x28:
325 PST period_cycles4 = data + 256 * PST audf4 + 7; 330 pst _ period_cycles4 = data + 256 * pst _ audf4 + 7;
326 PST reload_cycles3 = data + 4; 331 pst _ reload_cycles3 = data + 4;
327 DO_ULTRASOUND(4); 332 DO_ULTRASOUND(4);
328 break; 333 break;
329 } 334 }
@@ -332,20 +337,17 @@ ASAP_FUNC void PokeySound_PutByte(ASAP_State PTR ast, int addr, int data)
332 case 0x05: 337 case 0x05:
333 DO_AUDC(3) 338 DO_AUDC(3)
334 case 0x06: 339 case 0x06:
335 if (data == PST audf4) 340 DO_STORE(audf4);
336 break; 341 switch (pst _ audctl & 0x28) {
337 generate(ast, pst, AST cycle);
338 PST audf4 = data;
339 switch (PST audctl & 0x28) {
340 case 0x00: 342 case 0x00:
341 case 0x20: 343 case 0x20:
342 PST period_cycles4 = PST div_cycles * (data + 1); 344 pst _ period_cycles4 = pst _ div_cycles * (data + 1);
343 break; 345 break;
344 case 0x08: 346 case 0x08:
345 PST period_cycles4 = PST div_cycles * (PST audf3 + 256 * data + 1); 347 pst _ period_cycles4 = pst _ div_cycles * (pst _ audf3 + 256 * data + 1);
346 break; 348 break;
347 case 0x28: 349 case 0x28:
348 PST period_cycles4 = PST audf3 + 256 * data + 7; 350 pst _ period_cycles4 = pst _ audf3 + 256 * data + 7;
349 break; 351 break;
350 } 352 }
351 DO_ULTRASOUND(4); 353 DO_ULTRASOUND(4);
@@ -353,141 +355,153 @@ ASAP_FUNC void PokeySound_PutByte(ASAP_State PTR ast, int addr, int data)
353 case 0x07: 355 case 0x07:
354 DO_AUDC(4) 356 DO_AUDC(4)
355 case 0x08: 357 case 0x08:
356 if (data == PST audctl) 358 DO_STORE(audctl);
357 break; 359 pst _ div_cycles = ((data & 1) != 0) ? 114 : 28;
358 generate(ast, pst, AST cycle);
359 PST audctl = data;
360 PST div_cycles = ((data & 1) != 0) ? 114 : 28;
361 /* TODO: tick_cycles */ 360 /* TODO: tick_cycles */
362 switch (data & 0x50) { 361 switch (data & 0x50) {
363 case 0x00: 362 case 0x00:
364 PST period_cycles1 = PST div_cycles * (PST audf1 + 1); 363 pst _ period_cycles1 = pst _ div_cycles * (pst _ audf1 + 1);
365 PST period_cycles2 = PST div_cycles * (PST audf2 + 1); 364 pst _ period_cycles2 = pst _ div_cycles * (pst _ audf2 + 1);
366 break; 365 break;
367 case 0x10: 366 case 0x10:
368 PST period_cycles1 = PST div_cycles * 256; 367 pst _ period_cycles1 = pst _ div_cycles * 256;
369 PST period_cycles2 = PST div_cycles * (PST audf1 + 256 * PST audf2 + 1); 368 pst _ period_cycles2 = pst _ div_cycles * (pst _ audf1 + 256 * pst _ audf2 + 1);
370 PST reload_cycles1 = PST div_cycles * (PST audf1 + 1); 369 pst _ reload_cycles1 = pst _ div_cycles * (pst _ audf1 + 1);
371 break; 370 break;
372 case 0x40: 371 case 0x40:
373 PST period_cycles1 = PST audf1 + 4; 372 pst _ period_cycles1 = pst _ audf1 + 4;
374 PST period_cycles2 = PST div_cycles * (PST audf2 + 1); 373 pst _ period_cycles2 = pst _ div_cycles * (pst _ audf2 + 1);
375 break; 374 break;
376 case 0x50: 375 case 0x50:
377 PST period_cycles1 = 256; 376 pst _ period_cycles1 = 256;
378 PST period_cycles2 = PST audf1 + 256 * PST audf2 + 7; 377 pst _ period_cycles2 = pst _ audf1 + 256 * pst _ audf2 + 7;
379 PST reload_cycles1 = PST audf1 + 4; 378 pst _ reload_cycles1 = pst _ audf1 + 4;
380 break; 379 break;
381 } 380 }
382 DO_ULTRASOUND(1); 381 DO_ULTRASOUND(1);
383 DO_ULTRASOUND(2); 382 DO_ULTRASOUND(2);
384 switch (data & 0x28) { 383 switch (data & 0x28) {
385 case 0x00: 384 case 0x00:
386 PST period_cycles3 = PST div_cycles * (PST audf3 + 1); 385 pst _ period_cycles3 = pst _ div_cycles * (pst _ audf3 + 1);
387 PST period_cycles4 = PST div_cycles * (PST audf4 + 1); 386 pst _ period_cycles4 = pst _ div_cycles * (pst _ audf4 + 1);
388 break; 387 break;
389 case 0x08: 388 case 0x08:
390 PST period_cycles3 = PST div_cycles * 256; 389 pst _ period_cycles3 = pst _ div_cycles * 256;
391 PST period_cycles4 = PST div_cycles * (PST audf3 + 256 * PST audf4 + 1); 390 pst _ period_cycles4 = pst _ div_cycles * (pst _ audf3 + 256 * pst _ audf4 + 1);
392 PST reload_cycles3 = PST div_cycles * (PST audf3 + 1); 391 pst _ reload_cycles3 = pst _ div_cycles * (pst _ audf3 + 1);
393 break; 392 break;
394 case 0x20: 393 case 0x20:
395 PST period_cycles3 = PST audf3 + 4; 394 pst _ period_cycles3 = pst _ audf3 + 4;
396 PST period_cycles4 = PST div_cycles * (PST audf4 + 1); 395 pst _ period_cycles4 = pst _ div_cycles * (pst _ audf4 + 1);
397 break; 396 break;
398 case 0x28: 397 case 0x28:
399 PST period_cycles3 = 256; 398 pst _ period_cycles3 = 256;
400 PST period_cycles4 = PST audf3 + 256 * PST audf4 + 7; 399 pst _ period_cycles4 = pst _ audf3 + 256 * pst _ audf4 + 7;
401 PST reload_cycles3 = PST audf3 + 4; 400 pst _ reload_cycles3 = pst _ audf3 + 4;
402 break; 401 break;
403 } 402 }
404 DO_ULTRASOUND(3); 403 DO_ULTRASOUND(3);
405 DO_ULTRASOUND(4); 404 DO_ULTRASOUND(4);
405 DO_INIT(1, (data & 0x40) == 0);
406 DO_INIT(2, (data & 0x50) != 0x50);
407 DO_INIT(3, (data & 0x20) == 0);
408 DO_INIT(4, (data & 0x28) != 0x28);
406 break; 409 break;
407 case 0x09: 410 case 0x09:
408 /* TODO: STIMER */ 411 /* TODO: STIMER */
409 break; 412 break;
410 case 0x0f: 413 case 0x0f:
411 PST skctl = data; 414 DO_STORE(skctl);
412 PST init = ((data & 3) == 0); 415 pst _ init = ((data & 3) == 0);
413 DO_INIT(1, (PST audctl & 0x40) == 0); 416 DO_INIT(1, (pst _ audctl & 0x40) == 0);
414 DO_INIT(2, (PST audctl & 0x50) != 0x50); 417 DO_INIT(2, (pst _ audctl & 0x50) != 0x50);
415 DO_INIT(3, (PST audctl & 0x20) == 0); 418 DO_INIT(3, (pst _ audctl & 0x20) == 0);
416 DO_INIT(4, (PST audctl & 0x28) != 0x28); 419 DO_INIT(4, (pst _ audctl & 0x28) != 0x28);
417 break; 420 break;
418 default: 421 default:
419 break; 422 break;
420 } 423 }
421} 424}
422 425
423ASAP_FUNC int PokeySound_GetRandom(ASAP_State PTR ast, int addr) 426FUNC(int, PokeySound_GetRandom, (P(ASAP_State PTR, ast), P(int, addr), P(int, cycle)))
424{ 427{
425 PokeyState PTR pst = (addr & AST extra_pokey_mask) != 0 428 V(PokeyState PTR, pst) = (addr & ast _ extra_pokey_mask) != 0
426 ? ADDRESSOF AST extra_pokey : ADDRESSOF AST base_pokey; 429 ? ADDRESSOF ast _ extra_pokey : ADDRESSOF ast _ base_pokey;
427 int i; 430 V(int, i);
428 if (PST init) 431 if (pst _ init)
429 return 0xff; 432 return 0xff;
430 i = AST cycle + PST poly_index; 433 i = cycle + pst _ poly_index;
431 if ((PST audctl & 0x80) != 0) 434 if ((pst _ audctl & 0x80) != 0)
432 return AST poly9_lookup[i % 511]; 435 return ast _ poly9_lookup[i % 511];
433 else { 436 else {
434 int j; 437 V(int, j);
435 i %= 131071; 438 i %= 131071;
436 j = i >> 3; 439 j = i >> 3;
437 i &= 7; 440 i &= 7;
438 return ((AST poly17_lookup[j] >> i) + (AST poly17_lookup[j + 1] << (8 - i))) & 0xff; 441 return ((ast _ poly17_lookup[j] >> i) + (ast _ poly17_lookup[j + 1] << (8 - i))) & 0xff;
439 } 442 }
440} 443}
441 444
442FILE_FUNC void end_frame(ASAP_State PTR ast, PokeyState PTR pst, int cycle_limit) 445PRIVATE FUNC(void, end_frame, (P(ASAP_State PTR, ast), P(PokeyState PTR, pst), P(int, cycle_limit)))
443{ 446{
444 int m; 447 V(int, m);
445 generate(ast, pst, cycle_limit); 448 PokeySound_GenerateUntilCycle(ast, pst, cycle_limit);
446 PST poly_index += cycle_limit; 449 pst _ poly_index += cycle_limit;
447 m = ((PST audctl & 0x80) != 0) ? 15 * 31 * 511 : 15 * 31 * 131071; 450 m = ((pst _ audctl & 0x80) != 0) ? 15 * 31 * 511 : 15 * 31 * 131071;
448 if (PST poly_index >= 2 * m) 451 if (pst _ poly_index >= 2 * m)
449 PST poly_index -= m; 452 pst _ poly_index -= m;
450 if (PST tick_cycle1 != NEVER) 453 if (pst _ tick_cycle1 != NEVER)
451 PST tick_cycle1 -= cycle_limit; 454 pst _ tick_cycle1 -= cycle_limit;
452 if (PST tick_cycle2 != NEVER) 455 if (pst _ tick_cycle2 != NEVER)
453 PST tick_cycle2 -= cycle_limit; 456 pst _ tick_cycle2 -= cycle_limit;
454 if (PST tick_cycle3 != NEVER) 457 if (pst _ tick_cycle3 != NEVER)
455 PST tick_cycle3 -= cycle_limit; 458 pst _ tick_cycle3 -= cycle_limit;
456 if (PST tick_cycle4 != NEVER) 459 if (pst _ tick_cycle4 != NEVER)
457 PST tick_cycle4 -= cycle_limit; 460 pst _ tick_cycle4 -= cycle_limit;
458} 461}
459 462
460ASAP_FUNC void PokeySound_StartFrame(ASAP_State PTR ast) 463FUNC(void, PokeySound_StartFrame, (P(ASAP_State PTR, ast)))
461{ 464{
462 ZERO_ARRAY(AST base_pokey.delta_buffer); 465 ZERO_ARRAY(ast _ base_pokey.delta_buffer);
463 if (AST extra_pokey_mask != 0) 466 if (ast _ extra_pokey_mask != 0)
464 ZERO_ARRAY(AST extra_pokey.delta_buffer); 467 ZERO_ARRAY(ast _ extra_pokey.delta_buffer);
465} 468}
466 469
467ASAP_FUNC void PokeySound_EndFrame(ASAP_State PTR ast, int current_cycle) 470FUNC(void, PokeySound_EndFrame, (P(ASAP_State PTR, ast), P(int, current_cycle)))
468{ 471{
469 end_frame(ast, ADDRESSOF AST base_pokey, current_cycle); 472 end_frame(ast, ADDRESSOF ast _ base_pokey, current_cycle);
470 if (AST extra_pokey_mask != 0) 473 if (ast _ extra_pokey_mask != 0)
471 end_frame(ast, ADDRESSOF AST extra_pokey, current_cycle); 474 end_frame(ast, ADDRESSOF ast _ extra_pokey, current_cycle);
472 AST sample_offset += current_cycle * ASAP_SAMPLE_RATE; 475 ast _ sample_offset += current_cycle * ASAP_SAMPLE_RATE;
473 AST sample_index = 0; 476 ast _ sample_index = 0;
474 AST samples = AST sample_offset / ASAP_MAIN_CLOCK; 477 ast _ samples = TO_INT(ast _ sample_offset / ASAP_MAIN_CLOCK);
475 AST sample_offset %= ASAP_MAIN_CLOCK; 478 ast _ sample_offset %= ASAP_MAIN_CLOCK;
476} 479}
477 480
478ASAP_FUNC int PokeySound_Generate(ASAP_State PTR ast, byte ARRAY buffer, int buffer_offset, int blocks, ASAP_SampleFormat format) 481/* Fills buffer with samples from delta_buffer. */
482FUNC(int, PokeySound_Generate, (P(ASAP_State PTR, ast), P(BYTEARRAY, buffer), P(int, buffer_offset), P(int, blocks), P(ASAP_SampleFormat, format)))
479{ 483{
480 int i = AST sample_index; 484 V(int, i) = ast _ sample_index;
481 int samples = AST samples; 485 V(int, samples) = ast _ samples;
482 int acc_left = AST iir_acc_left; 486 V(int, acc_left) = ast _ iir_acc_left;
483 int acc_right = AST iir_acc_right; 487 V(int, acc_right) = ast _ iir_acc_right;
484 if (blocks < samples - i) 488 if (blocks < samples - i)
485 samples = i + blocks; 489 samples = i + blocks;
486 else 490 else
487 blocks = samples - i; 491 blocks = samples - i;
488 for (; i < samples; i++) { 492 for (; i < samples; i++) {
489 int sample; 493#ifdef ACTIONSCRIPT
490 acc_left += (AST base_pokey.delta_buffer[i] << 20) - (acc_left * 3 >> 10); 494 acc_left += ast _ base_pokey.delta_buffer[i] - (acc_left * 3 >> 10);
495 var sample : Number = acc_left / 33553408;
496 buffer.writeFloat(sample);
497 if (ast.extra_pokey_mask != 0) {
498 acc_right += ast _ extra_pokey.delta_buffer[i] - (acc_right * 3 >> 10);
499 sample = acc_right / 33553408;
500 }
501 buffer.writeFloat(sample);
502#else
503 V(int, sample);
504 acc_left += ast _ base_pokey.delta_buffer[i] - (acc_left * 3 >> 10);
491 sample = acc_left >> 10; 505 sample = acc_left >> 10;
492#define STORE_SAMPLE \ 506#define STORE_SAMPLE \
493 if (sample < -32767) \ 507 if (sample < -32767) \
@@ -496,43 +510,89 @@ ASAP_FUNC int PokeySound_Generate(ASAP_State PTR ast, byte ARRAY buffer, int buf
496 sample = 32767; \ 510 sample = 32767; \
497 switch (format) { \ 511 switch (format) { \
498 case ASAP_FORMAT_U8: \ 512 case ASAP_FORMAT_U8: \
499 buffer[buffer_offset++] = (byte) ((sample >> 8) + 128); \ 513 buffer[buffer_offset++] = CAST(byte) ((sample >> 8) + 128); \
500 break; \ 514 break; \
501 case ASAP_FORMAT_S16_LE: \ 515 case ASAP_FORMAT_S16_LE: \
502 buffer[buffer_offset++] = (byte) sample; \ 516 buffer[buffer_offset++] = TO_BYTE(sample); \
503 buffer[buffer_offset++] = (byte) (sample >> 8); \ 517 buffer[buffer_offset++] = TO_BYTE(sample >> 8); \
504 break; \ 518 break; \
505 case ASAP_FORMAT_S16_BE: \ 519 case ASAP_FORMAT_S16_BE: \
506 buffer[buffer_offset++] = (byte) (sample >> 8); \ 520 buffer[buffer_offset++] = TO_BYTE(sample >> 8); \
507 buffer[buffer_offset++] = (byte) sample; \ 521 buffer[buffer_offset++] = TO_BYTE(sample); \
508 break; \ 522 break; \
509 } 523 }
510 STORE_SAMPLE; 524 STORE_SAMPLE;
511 if (AST extra_pokey_mask != 0) { 525 if (ast _ extra_pokey_mask != 0) {
512 acc_right += (AST extra_pokey.delta_buffer[i] << 20) - (acc_right * 3 >> 10); 526 acc_right += ast _ extra_pokey.delta_buffer[i] - (acc_right * 3 >> 10);
513 sample = acc_right >> 10; 527 sample = acc_right >> 10;
514 STORE_SAMPLE; 528 STORE_SAMPLE;
515 } 529 }
530#endif /* ACTIONSCRIPT */
516 } 531 }
517 if (i == AST samples) { 532 if (i == ast _ samples) {
518 acc_left += AST base_pokey.delta_buffer[i] << 20; 533 acc_left += ast _ base_pokey.delta_buffer[i];
519 acc_right += AST extra_pokey.delta_buffer[i] << 20; 534 acc_right += ast _ extra_pokey.delta_buffer[i];
520 } 535 }
521 AST sample_index = i; 536 ast _ sample_index = i;
522 AST iir_acc_left = acc_left; 537 ast _ iir_acc_left = acc_left;
523 AST iir_acc_right = acc_right; 538 ast _ iir_acc_right = acc_right;
539#ifdef APOKEYSND
540 return buffer_offset;
541#else
524 return blocks; 542 return blocks;
543#endif
525} 544}
526 545
527ASAP_FUNC abool PokeySound_IsSilent(const PokeyState PTR pst) 546FUNC(abool, PokeySound_IsSilent, (P(CONST PokeyState PTR, pst)))
528{ 547{
529 return ((PST audc1 | PST audc2 | PST audc3 | PST audc4) & 0xf) == 0; 548 return ((pst _ audc1 | pst _ audc2 | pst _ audc3 | pst _ audc4) & 0xf) == 0;
530} 549}
531 550
532ASAP_FUNC void PokeySound_Mute(const ASAP_State PTR ast, PokeyState PTR pst, int mask) 551FUNC(void, PokeySound_Mute, (P(CONST ASAP_State PTR, ast), P(PokeyState PTR, pst), P(int, mask)))
533{ 552{
534 MUTE_CHANNEL(1, (mask & 1) != 0, MUTE_USER); 553 MUTE_CHANNEL(1, (mask & 1) != 0, MUTE_USER);
535 MUTE_CHANNEL(2, (mask & 2) != 0, MUTE_USER); 554 MUTE_CHANNEL(2, (mask & 2) != 0, MUTE_USER);
536 MUTE_CHANNEL(3, (mask & 4) != 0, MUTE_USER); 555 MUTE_CHANNEL(3, (mask & 4) != 0, MUTE_USER);
537 MUTE_CHANNEL(4, (mask & 8) != 0, MUTE_USER); 556 MUTE_CHANNEL(4, (mask & 8) != 0, MUTE_USER);
538} 557}
558
559#ifdef APOKEYSND
560
561static ASAP_State asap;
562
563__declspec(dllexport) void APokeySound_Initialize(abool stereo)
564{
565 asap.extra_pokey_mask = stereo ? 0x10 : 0;
566 PokeySound_Initialize(&asap);
567 PokeySound_Mute(&asap, &asap.base_pokey, 0);
568 PokeySound_Mute(&asap, &asap.extra_pokey, 0);
569 PokeySound_StartFrame(&asap);
570}
571
572__declspec(dllexport) void APokeySound_PutByte(int addr, int data)
573{
574 PokeySound_PutByte(&asap, addr, data);
575}
576
577__declspec(dllexport) int APokeySound_GetRandom(int addr, int cycle)
578{
579 return PokeySound_GetRandom(&asap, addr, cycle);
580}
581
582__declspec(dllexport) int APokeySound_Generate(int cycles, byte buffer[], ASAP_SampleFormat format)
583{
584 int len;
585 PokeySound_EndFrame(&asap, cycles);
586 len = PokeySound_Generate(&asap, buffer, 0, asap.samples, format);
587 PokeySound_StartFrame(&asap);
588 return len;
589}
590
591__declspec(dllexport) void APokeySound_About(const char **name, const char **author, const char **description)
592{
593 *name = "Another POKEY sound emulator, v" ASAP_VERSION;
594 *author = "Piotr Fusik, (C) " ASAP_YEARS;
595 *description = "Part of ASAP, http://asap.sourceforge.net";
596}
597
598#endif /* APOKEYSND */
diff --git a/apps/codecs/libasap/asap.c b/apps/codecs/libasap/asap.c
index 31de730d93..87b537ef63 100644
--- a/apps/codecs/libasap/asap.c
+++ b/apps/codecs/libasap/asap.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * asap.c - ASAP engine 2 * asap.c - ASAP engine
3 * 3 *
4 * Copyright (C) 2005-2008 Piotr Fusik 4 * Copyright (C) 2005-2010 Piotr Fusik
5 * 5 *
6 * This file is part of ASAP (Another Slight Atari Player), 6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net 7 * see http://asap.sourceforge.net
@@ -20,70 +20,48 @@
20 * along with ASAP; if not, write to the Free Software Foundation, Inc., 20 * along with ASAP; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */ 22 */
23#include "codeclib.h"
24#if !defined(JAVA) && !defined(CSHARP)
25#include <string.h>
26#endif
27 23
28#include "asap_internal.h" 24#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 25
51ASAP_FUNC int ASAP_GetByte(ASAP_State PTR ast, int addr) 26FUNC(int, ASAP_GetByte, (P(ASAP_State PTR, ast), P(int, addr)))
52{ 27{
53 switch (addr & 0xff0f) { 28 switch (addr & 0xff0f) {
54 case 0xd20a: 29 case 0xd20a:
55 return PokeySound_GetRandom(ast, addr); 30 return PokeySound_GetRandom(ast, addr, ast _ cycle);
56 case 0xd20e: 31 case 0xd20e:
57 if ((addr & AST extra_pokey_mask) != 0) 32 if ((addr & ast _ extra_pokey_mask) != 0) {
33 /* interrupts in the extra POKEY not emulated at the moment */
58 return 0xff; 34 return 0xff;
59 return AST irqst; 35 }
36 return ast _ irqst;
60 case 0xd20f: 37 case 0xd20f:
38 /* just because some SAP files rely on this */
61 return 0xff; 39 return 0xff;
62 case 0xd40b: 40 case 0xd40b:
63 return AST scanline_number >> 1; 41 return ast _ scanline_number >> 1;
64 default: 42 default:
65 return dGetByte(addr); 43 return dGetByte(addr);
66 } 44 }
67} 45}
68 46
69ASAP_FUNC void ASAP_PutByte(ASAP_State PTR ast, int addr, int data) 47FUNC(void, ASAP_PutByte, (P(ASAP_State PTR, ast), P(int, addr), P(int, data)))
70{ 48{
71 if ((addr >> 8) == 0xd2) { 49 if ((addr >> 8) == 0xd2) {
72 if ((addr & (AST extra_pokey_mask + 0xf)) == 0xe) { 50 if ((addr & (ast _ extra_pokey_mask + 0xf)) == 0xe) {
73 AST irqst |= data ^ 0xff; 51 ast _ irqst |= data ^ 0xff;
74#define SET_TIMER_IRQ(ch) \ 52#define SET_TIMER_IRQ(ch) \
75 if ((data & AST irqst & ch) != 0) { \ 53 if ((data & ast _ irqst & ch) != 0) { \
76 if (AST timer##ch##_cycle == NEVER) { \ 54 if (ast _ timer##ch##_cycle == NEVER) { \
77 int t = AST base_pokey.tick_cycle##ch; \ 55 V(int, t) = ast _ base_pokey.tick_cycle##ch; \
78 while (t < AST cycle) \ 56 while (t < ast _ cycle) \
79 t += AST base_pokey.period_cycles##ch; \ 57 t += ast _ base_pokey.period_cycles##ch; \
80 AST timer##ch##_cycle = t; \ 58 ast _ timer##ch##_cycle = t; \
81 if (AST nearest_event_cycle > t) \ 59 if (ast _ nearest_event_cycle > t) \
82 AST nearest_event_cycle = t; \ 60 ast _ nearest_event_cycle = t; \
83 } \ 61 } \
84 } \ 62 } \
85 else \ 63 else \
86 AST timer##ch##_cycle = NEVER; 64 ast _ timer##ch##_cycle = NEVER;
87 SET_TIMER_IRQ(1); 65 SET_TIMER_IRQ(1);
88 SET_TIMER_IRQ(2); 66 SET_TIMER_IRQ(2);
89 SET_TIMER_IRQ(4); 67 SET_TIMER_IRQ(4);
@@ -92,136 +70,120 @@ ASAP_FUNC void ASAP_PutByte(ASAP_State PTR ast, int addr, int data)
92 PokeySound_PutByte(ast, addr, data); 70 PokeySound_PutByte(ast, addr, data);
93 } 71 }
94 else if ((addr & 0xff0f) == 0xd40a) { 72 else if ((addr & 0xff0f) == 0xd40a) {
95 if (AST cycle <= AST next_scanline_cycle - 8) 73 if (ast _ cycle <= ast _ next_scanline_cycle - 8)
96 AST cycle = AST next_scanline_cycle - 8; 74 ast _ cycle = ast _ next_scanline_cycle - 8;
75 else
76 ast _ cycle = ast _ next_scanline_cycle + 106;
77 }
78 else if ((addr & 0xff00) == ast _ module_info.covox_addr) {
79 V(PokeyState PTR, pst);
80 addr &= 3;
81 if (addr == 0 || addr == 3)
82 pst = ADDRESSOF ast _ base_pokey;
97 else 83 else
98 AST cycle = AST next_scanline_cycle + 106; 84 pst = ADDRESSOF ast _ extra_pokey;
85 pst _ delta_buffer[CYCLE_TO_SAMPLE(ast _ cycle)] += (data - UBYTE(ast _ covox[addr])) << DELTA_SHIFT_COVOX;
86 ast _ covox[addr] = CAST(byte) (data);
87 }
88 else if ((addr & 0xff1f) == 0xd01f) {
89 V(int, sample) = CYCLE_TO_SAMPLE(ast _ cycle);
90 V(int, delta);
91 data &= 8;
92 /* NOT data - ast _ consol; reverse to the POKEY sound */
93 delta = (ast _ consol - data) << DELTA_SHIFT_GTIA;
94 ast _ consol = data;
95 ast _ base_pokey.delta_buffer[sample] += delta;
96 ast _ extra_pokey.delta_buffer[sample] += delta;
99 } 97 }
100 else 98 else
101 dPutByte(addr, data); 99 dPutByte(addr, data);
102} 100}
103 101
104#define MAX_SONGS 32 102#define UWORD(array, index) (UBYTE(array[index]) + (UBYTE(array[(index) + 1]) << 8))
105 103
106CONST_LOOKUP(int, perframe2fastplay) = { 312, 312 / 2, 312 / 3, 312 / 4 }; 104#ifndef ASAP_ONLY_SAP
107 105
108FILE_FUNC abool load_native(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 106#ifndef JAVA
109 const byte ARRAY module, int module_len, ASAP_OBX player) 107#include "players.h"
110{
111#if defined(JAVA) || defined(CSHARP)
112 try
113#endif 108#endif
114 { 109
115 int player_last_byte; 110#define CMR_BASS_TABLE_OFFSET 0x70f
116 int block_len; 111
117 if (UBYTE(module[0]) != 0xff || UBYTE(module[1]) != 0xff) 112CONST_ARRAY(byte, cmr_bass_table)
113 0x5C, 0x56, 0x50, 0x4D, 0x47, 0x44, 0x41, 0x3E,
114 0x38, 0x35, CAST(byte) (0x88), 0x7F, 0x79, 0x73, 0x6C, 0x67,
115 0x60, 0x5A, 0x55, 0x51, 0x4C, 0x48, 0x43, 0x3F,
116 0x3D, 0x39, 0x34, 0x33, 0x30, 0x2D, 0x2A, 0x28,
117 0x25, 0x24, 0x21, 0x1F, 0x1E
118END_CONST_ARRAY;
119
120CONST_ARRAY(int, perframe2fastplay)
121 312, 312 / 2, 312 / 3, 312 / 4
122END_CONST_ARRAY;
123
124/* Loads native module (anything except SAP) and 6502 player routine. */
125PRIVATE FUNC(abool, load_native, (
126 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
127 P(CONST BYTEARRAY, module), P(int, module_len), P(RESOURCE, player)))
128{
129 V(int, player_last_byte);
130 V(int, music_last_byte);
131 V(int, block_len);
132 if ((UBYTE(module[0]) != 0xff || UBYTE(module[1]) != 0xff)
133 && (module[0] != 0 || module[1] != 0)) /* some CMC and clones start with zeros */
134 return FALSE;
135 module_info _ player = UWORD(player, 2);
136 player_last_byte = UWORD(player, 4);
137 module_info _ music = UWORD(module, 2);
138 if (module_info _ music <= player_last_byte)
139 return FALSE;
140 music_last_byte = UWORD(module, 4);
141 if (module_info _ music <= 0xd7ff && music_last_byte >= 0xd000)
142 return FALSE;
143 block_len = music_last_byte + 1 - module_info _ music;
144 if (6 + block_len != module_len) {
145 V(int, info_addr);
146 V(int, info_len);
147 if (module_info _ type != ASAP_TYPE_RMT || 11 + block_len > module_len)
118 return FALSE; 148 return FALSE;
119#ifdef JAVA 149 /* allow optional info for Raster Music Tracker */
120 try { 150 info_addr = UWORD(module, 6 + block_len);
121 player.read(); 151 if (info_addr != module_info _ music + block_len)
122 player.read(); 152 return FALSE;
123 MODULE_INFO player = player.read(); 153 info_len = UWORD(module, 8 + block_len) + 1 - info_addr;
124 MODULE_INFO player += player.read() << 8; 154 if (10 + block_len + info_len != module_len)
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; 155 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 } 156 }
195#elif defined(CSHARP) 157 if (ast != NULL) {
196 finally { 158 COPY_ARRAY(ast _ memory, module_info _ music, module, 6, block_len);
197 player.Close(); 159 COPY_ARRAY(ast _ memory, module_info _ player, player, 6, player_last_byte + 1 - module_info _ player);
198 } 160 }
199#endif 161 return TRUE;
200} 162}
201 163
202FILE_FUNC void set_song_duration(ASAP_ModuleInfo PTR module_info, int player_calls) 164PRIVATE FUNC(void, set_song_duration, (P(ASAP_ModuleInfo PTR, module_info), P(int, player_calls)))
203{ 165{
204 MODULE_INFO durations[MODULE_INFO songs] = (int) (player_calls * MODULE_INFO fastplay * 114000.0 / 1773447); 166 module_info _ durations[module_info _ songs] = TO_INT(player_calls * module_info _ fastplay * 114000.0 / 1773447);
205 MODULE_INFO songs++; 167 module_info _ songs++;
206} 168}
207 169
208#define SEEN_THIS_CALL 1 170#define SEEN_THIS_CALL 1
209#define SEEN_BEFORE 2 171#define SEEN_BEFORE 2
210#define SEEN_REPEAT 3 172#define SEEN_REPEAT 3
211 173
212FILE_FUNC void parse_cmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, int pos) 174PRIVATE FUNC(void, parse_cmc_song, (P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module), P(int, pos)))
213{ 175{
214 int tempo = UBYTE(module[0x19]); 176 V(int, tempo) = UBYTE(module[0x19]);
215 int player_calls = 0; 177 V(int, player_calls) = 0;
216 int rep_start_pos = 0; 178 V(int, rep_start_pos) = 0;
217 int rep_end_pos = 0; 179 V(int, rep_end_pos) = 0;
218 int rep_times = 0; 180 V(int, rep_times) = 0;
219 NEW_ARRAY(byte, seen, 0x55); 181 NEW_ARRAY(byte, seen, 0x55);
220 INIT_ARRAY(seen); 182 INIT_ARRAY(seen);
221 while (pos >= 0 && pos < 0x55) { 183 while (pos >= 0 && pos < 0x55) {
222 int p1; 184 V(int, p1);
223 int p2; 185 V(int, p2);
224 int p3; 186 V(int, p3);
225 if (pos == rep_end_pos && rep_times > 0) { 187 if (pos == rep_end_pos && rep_times > 0) {
226 for (p1 = 0; p1 < 0x55; p1++) 188 for (p1 = 0; p1 < 0x55; p1++)
227 if (seen[p1] == SEEN_THIS_CALL || seen[p1] == SEEN_REPEAT) 189 if (seen[p1] == SEEN_THIS_CALL || seen[p1] == SEEN_REPEAT)
@@ -231,7 +193,7 @@ FILE_FUNC void parse_cmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
231 } 193 }
232 if (seen[pos] != 0) { 194 if (seen[pos] != 0) {
233 if (seen[pos] != SEEN_THIS_CALL) 195 if (seen[pos] != SEEN_THIS_CALL)
234 MODULE_INFO loops[MODULE_INFO songs] = TRUE; 196 module_info _ loops[module_info _ songs] = TRUE;
235 break; 197 break;
236 } 198 }
237 seen[pos] = SEEN_THIS_CALL; 199 seen[pos] = SEEN_THIS_CALL;
@@ -270,53 +232,145 @@ FILE_FUNC void parse_cmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
270 continue; 232 continue;
271 } 233 }
272 if (p1 == 0xe) { 234 if (p1 == 0xe) {
273 MODULE_INFO loops[MODULE_INFO songs] = TRUE; 235 module_info _ loops[module_info _ songs] = TRUE;
274 break; 236 break;
275 } 237 }
276 p2 = rep_times > 0 ? SEEN_REPEAT : SEEN_BEFORE; 238 p2 = rep_times > 0 ? SEEN_REPEAT : SEEN_BEFORE;
277 for (p1 = 0; p1 < 0x55; p1++) 239 for (p1 = 0; p1 < 0x55; p1++)
278 if (seen[p1] == SEEN_THIS_CALL) 240 if (seen[p1] == SEEN_THIS_CALL)
279 seen[p1] = (byte) p2; 241 seen[p1] = CAST(byte) p2;
280 player_calls += tempo << 6; 242 player_calls += tempo * (module_info _ type == ASAP_TYPE_CM3 ? 48 : 64);
281 pos++; 243 pos++;
282 } 244 }
283 set_song_duration(module_info, player_calls); 245 set_song_duration(module_info, player_calls);
284} 246}
285 247
286FILE_FUNC abool parse_cmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 248PRIVATE FUNC(abool, parse_cmc, (
287 const byte ARRAY module, int module_len, abool cmr) 249 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
250 P(CONST BYTEARRAY, module), P(int, module_len), P(int, type), P(RESOURCE, player)))
288{ 251{
289 int last_pos; 252 V(int, last_pos);
290 int pos; 253 V(int, pos);
291 if (module_len < 0x306) 254 if (module_len < 0x306)
292 return FALSE; 255 return FALSE;
293 MODULE_INFO type = cmr ? 'z' : 'c'; 256 module_info _ type = type;
294 if (!load_native(ast, module_info, module, module_len, GET_OBX(cmc))) 257 if (!load_native(ast, module_info, module, module_len, player))
295 return FALSE; 258 return FALSE;
296 if (ast != NULL && cmr) 259 if (ast != NULL && type == ASAP_TYPE_CMR)
297 COPY_ARRAY(AST memory, 0x500 + CMR_BASS_TABLE_OFFSET, cmr_bass_table, 0, sizeof(cmr_bass_table)); 260 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; 261 last_pos = 0x54;
300 while (--last_pos >= 0) { 262 while (--last_pos >= 0) {
301 if (UBYTE(module[0x206 + last_pos]) < 0xb0 263 if (UBYTE(module[0x206 + last_pos]) < 0xb0
302 || UBYTE(module[0x25b + last_pos]) < 0x40 264 || UBYTE(module[0x25b + last_pos]) < 0x40
303 || UBYTE(module[0x2b0 + last_pos]) < 0x40) 265 || UBYTE(module[0x2b0 + last_pos]) < 0x40)
304 break; 266 break;
267 if (module_info _ channels == 2) {
268 if (UBYTE(module[0x306 + last_pos]) < 0xb0
269 || UBYTE(module[0x35b + last_pos]) < 0x40
270 || UBYTE(module[0x3b0 + last_pos]) < 0x40)
271 break;
272 }
305 } 273 }
306 MODULE_INFO songs = 0; 274 module_info _ songs = 0;
307 parse_cmc_song(module_info, module, 0); 275 parse_cmc_song(module_info, module, 0);
308 for (pos = 0; pos < last_pos && MODULE_INFO songs < MAX_SONGS; pos++) 276 for (pos = 0; pos < last_pos && module_info _ songs < ASAP_SONGS_MAX; pos++)
309 if (UBYTE(module[0x206 + pos]) == 0x8f || UBYTE(module[0x206 + pos]) == 0xef) 277 if (UBYTE(module[0x206 + pos]) == 0x8f || UBYTE(module[0x206 + pos]) == 0xef)
310 parse_cmc_song(module_info, module, pos + 1); 278 parse_cmc_song(module_info, module, pos + 1);
311 return TRUE; 279 return TRUE;
312} 280}
313 281
314FILE_FUNC void parse_mpt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, 282PRIVATE FUNC(abool, is_dlt_track_empty, (P(CONST BYTEARRAY, module), P(int, pos)))
315 abool ARRAY global_seen, int song_len, int pos) 283{
284 return UBYTE(module[0x2006 + pos]) >= 0x43
285 && UBYTE(module[0x2106 + pos]) >= 0x40
286 && UBYTE(module[0x2206 + pos]) >= 0x40
287 && UBYTE(module[0x2306 + pos]) >= 0x40;
288}
289
290PRIVATE FUNC(abool, is_dlt_pattern_end, (P(CONST BYTEARRAY, module), P(int, pos), P(int, i)))
291{
292 V(int, ch);
293 for (ch = 0; ch < 4; ch++) {
294 V(int, pattern) = UBYTE(module[0x2006 + (ch << 8) + pos]);
295 if (pattern < 64) {
296 V(int, offset) = 6 + (pattern << 7) + (i << 1);
297 if ((module[offset] & 0x80) == 0 && (module[offset + 1] & 0x80) != 0)
298 return TRUE;
299 }
300 }
301 return FALSE;
302}
303
304PRIVATE FUNC(void, parse_dlt_song, (
305 P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module),
306 P(BOOLARRAY, seen), P(int, pos)))
307{
308 V(int, player_calls) = 0;
309 V(abool, loop) = FALSE;
310 V(int, tempo) = 6;
311 while (pos < 128 && !seen[pos] && is_dlt_track_empty(module, pos))
312 seen[pos++] = TRUE;
313 module_info _ song_pos[module_info _ songs] = CAST(byte) pos;
314 while (pos < 128) {
315 V(int, p1);
316 if (seen[pos]) {
317 loop = TRUE;
318 break;
319 }
320 seen[pos] = TRUE;
321 p1 = module[0x2006 + pos];
322 if (p1 == 0x40 || is_dlt_track_empty(module, pos))
323 break;
324 if (p1 == 0x41)
325 pos = UBYTE(module[0x2086 + pos]);
326 else if (p1 == 0x42)
327 tempo = UBYTE(module[0x2086 + pos++]);
328 else {
329 V(int, i);
330 for (i = 0; i < 64 && !is_dlt_pattern_end(module, pos, i); i++)
331 player_calls += tempo;
332 pos++;
333 }
334 }
335 if (player_calls > 0) {
336 module_info _ loops[module_info _ songs] = loop;
337 set_song_duration(module_info, player_calls);
338 }
339}
340
341PRIVATE FUNC(abool, parse_dlt, (
342 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
343 P(CONST BYTEARRAY, module), P(int, module_len)))
344{
345 V(int, pos);
346 NEW_ARRAY(abool, seen, 128);
347 if (module_len == 0x2c06) {
348 if (ast != NULL)
349 ast _ memory[0x4c00] = 0;
350 }
351 else if (module_len != 0x2c07)
352 return FALSE;
353 module_info _ type = ASAP_TYPE_DLT;
354 if (!load_native(ast, module_info, module, module_len, GET_RESOURCE(dlt, obx))
355 || module_info _ music != 0x2000) {
356 return FALSE;
357 }
358 INIT_ARRAY(seen);
359 module_info _ songs = 0;
360 for (pos = 0; pos < 128 && module_info _ songs < ASAP_SONGS_MAX; pos++) {
361 if (!seen[pos])
362 parse_dlt_song(module_info, module, seen, pos);
363 }
364 return module_info _ songs > 0;
365}
366
367PRIVATE FUNC(void, parse_mpt_song, (
368 P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module),
369 P(BOOLARRAY, global_seen), P(int, song_len), P(int, pos)))
316{ 370{
317 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6; 371 V(int, addr_to_offset) = UWORD(module, 2) - 6;
318 int tempo = UBYTE(module[0x1cf]); 372 V(int, tempo) = UBYTE(module[0x1cf]);
319 int player_calls = 0; 373 V(int, player_calls) = 0;
320 NEW_ARRAY(byte, seen, 256); 374 NEW_ARRAY(byte, seen, 256);
321 NEW_ARRAY(int, pattern_offset, 4); 375 NEW_ARRAY(int, pattern_offset, 4);
322 NEW_ARRAY(int, blank_rows, 4); 376 NEW_ARRAY(int, blank_rows, 4);
@@ -324,12 +378,12 @@ FILE_FUNC void parse_mpt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
324 INIT_ARRAY(seen); 378 INIT_ARRAY(seen);
325 INIT_ARRAY(blank_rows); 379 INIT_ARRAY(blank_rows);
326 while (pos < song_len) { 380 while (pos < song_len) {
327 int i; 381 V(int, i);
328 int ch; 382 V(int, ch);
329 int pattern_rows; 383 V(int, pattern_rows);
330 if (seen[pos] != 0) { 384 if (seen[pos] != 0) {
331 if (seen[pos] != SEEN_THIS_CALL) 385 if (seen[pos] != SEEN_THIS_CALL)
332 MODULE_INFO loops[MODULE_INFO songs] = TRUE; 386 module_info _ loops[module_info _ songs] = TRUE;
333 break; 387 break;
334 } 388 }
335 seen[pos] = SEEN_THIS_CALL; 389 seen[pos] = SEEN_THIS_CALL;
@@ -345,7 +399,7 @@ FILE_FUNC void parse_mpt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
345 if (i >= 0x40) 399 if (i >= 0x40)
346 break; 400 break;
347 i <<= 1; 401 i <<= 1;
348 i = UBYTE(module[0x46 + i]) + (UBYTE(module[0x47 + i]) << 8); 402 i = UWORD(module, 0x46 + i);
349 pattern_offset[ch] = i == 0 ? 0 : i - addr_to_offset; 403 pattern_offset[ch] = i == 0 ? 0 : i - addr_to_offset;
350 blank_rows_counter[ch] = 0; 404 blank_rows_counter[ch] = 0;
351 } 405 }
@@ -386,20 +440,21 @@ FILE_FUNC void parse_mpt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
386 set_song_duration(module_info, player_calls); 440 set_song_duration(module_info, player_calls);
387} 441}
388 442
389FILE_FUNC abool parse_mpt(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 443PRIVATE FUNC(abool, parse_mpt, (
390 const byte ARRAY module, int module_len) 444 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
445 P(CONST BYTEARRAY, module), P(int, module_len)))
391{ 446{
392 int track0_addr; 447 V(int, track0_addr);
393 int pos; 448 V(int, pos);
394 int song_len; 449 V(int, song_len);
395 /* seen[i] == TRUE if the track position i has been processed */ 450 /* seen[i] == TRUE if the track position i has been processed */
396 NEW_ARRAY(abool, global_seen, 256); 451 NEW_ARRAY(abool, global_seen, 256);
397 if (module_len < 0x1d0) 452 if (module_len < 0x1d0)
398 return FALSE; 453 return FALSE;
399 MODULE_INFO type = 'm'; 454 module_info _ type = ASAP_TYPE_MPT;
400 if (!load_native(ast, module_info, module, module_len, GET_OBX(mpt))) 455 if (!load_native(ast, module_info, module, module_len, GET_RESOURCE(mpt, obx)))
401 return FALSE; 456 return FALSE;
402 track0_addr = UBYTE(module[2]) + (UBYTE(module[3]) << 8) + 0x1ca; 457 track0_addr = UWORD(module, 2) + 0x1ca;
403 if (UBYTE(module[0x1c6]) + (UBYTE(module[0x1ca]) << 8) != track0_addr) 458 if (UBYTE(module[0x1c6]) + (UBYTE(module[0x1ca]) << 8) != track0_addr)
404 return FALSE; 459 return FALSE;
405 /* Calculate the length of the first track. Address of the second track minus 460 /* Calculate the length of the first track. Address of the second track minus
@@ -409,36 +464,39 @@ FILE_FUNC abool parse_mpt(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
409 if (song_len > 0xfe) 464 if (song_len > 0xfe)
410 return FALSE; 465 return FALSE;
411 INIT_ARRAY(global_seen); 466 INIT_ARRAY(global_seen);
412 MODULE_INFO songs = 0; 467 module_info _ songs = 0;
413 for (pos = 0; pos < song_len && MODULE_INFO songs < MAX_SONGS; pos++) { 468 for (pos = 0; pos < song_len && module_info _ songs < ASAP_SONGS_MAX; pos++) {
414 if (!global_seen[pos]) { 469 if (!global_seen[pos]) {
415 MODULE_INFO song_pos[MODULE_INFO songs] = (byte) pos; 470 module_info _ song_pos[module_info _ songs] = CAST(byte) pos;
416 parse_mpt_song(module_info, module, global_seen, song_len, pos); 471 parse_mpt_song(module_info, module, global_seen, song_len, pos);
417 } 472 }
418 } 473 }
419 return MODULE_INFO songs != 0; 474 return module_info _ songs > 0;
420} 475}
421 476
422CONST_LOOKUP(byte, rmt_volume_silent) = { 16, 8, 4, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1 }; 477CONST_ARRAY(byte, rmt_volume_silent)
478 16, 8, 4, 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1
479END_CONST_ARRAY;
423 480
424FILE_FUNC int rmt_instrument_frames(const byte ARRAY module, int instrument, int volume, int volume_frame, abool extra_pokey) 481PRIVATE FUNC(int, rmt_instrument_frames, (
482 P(CONST BYTEARRAY, module), P(int, instrument),
483 P(int, volume), P(int, volume_frame), P(abool, extra_pokey)))
425{ 484{
426 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6; 485 V(int, addr_to_offset) = UWORD(module, 2) - 6;
427 int per_frame = module[0xc]; 486 V(int, per_frame) = module[0xc];
428 int player_call; 487 V(int, player_call);
429 int player_calls; 488 V(int, player_calls);
430 int index; 489 V(int, index);
431 int index_end; 490 V(int, index_end);
432 int index_loop; 491 V(int, index_loop);
433 int volume_slide_depth; 492 V(int, volume_slide_depth);
434 int volume_min; 493 V(int, volume_min);
435 abool looping; 494 V(int, volume_slide);
436 int volume_slide; 495 V(abool, silent_loop);
437 abool silent_loop; 496 instrument = UWORD(module, 0xe) - addr_to_offset + (instrument << 1);
438 instrument = UBYTE(module[0xe]) + (UBYTE(module[0xf]) << 8) - addr_to_offset + (instrument << 1);
439 if (module[instrument + 1] == 0) 497 if (module[instrument + 1] == 0)
440 return 0; 498 return 0;
441 instrument = UBYTE(module[instrument]) + (UBYTE(module[instrument + 1]) << 8) - addr_to_offset; 499 instrument = UWORD(module, instrument) - addr_to_offset;
442 player_calls = player_call = volume_frame * per_frame; 500 player_calls = player_call = volume_frame * per_frame;
443 index = UBYTE(module[instrument]) + 1 + player_call * 3; 501 index = UBYTE(module[instrument]) + 1 + player_call * 3;
444 index_end = UBYTE(module[instrument + 2]) + 3; 502 index_end = UBYTE(module[instrument + 2]) + 3;
@@ -447,12 +505,11 @@ FILE_FUNC int rmt_instrument_frames(const byte ARRAY module, int instrument, int
447 return 0; /* error */ 505 return 0; /* error */
448 volume_slide_depth = UBYTE(module[instrument + 6]); 506 volume_slide_depth = UBYTE(module[instrument + 6]);
449 volume_min = UBYTE(module[instrument + 7]); 507 volume_min = UBYTE(module[instrument + 7]);
450 looping = index >= index_end; 508 if (index >= index_end)
451 if (looping)
452 index = (index - index_end) % (index_end - index_loop) + index_loop; 509 index = (index - index_end) % (index_end - index_loop) + index_loop;
453 else { 510 else {
454 do { 511 do {
455 int vol = module[instrument + index]; 512 V(int, vol) = module[instrument + index];
456 if (extra_pokey) 513 if (extra_pokey)
457 vol >>= 4; 514 vol >>= 4;
458 if ((vol & 0xf) >= rmt_volume_silent[volume]) 515 if ((vol & 0xf) >= rmt_volume_silent[volume])
@@ -466,7 +523,7 @@ FILE_FUNC int rmt_instrument_frames(const byte ARRAY module, int instrument, int
466 volume_slide = 128; 523 volume_slide = 128;
467 silent_loop = FALSE; 524 silent_loop = FALSE;
468 for (;;) { 525 for (;;) {
469 int vol; 526 V(int, vol);
470 if (index >= index_end) { 527 if (index >= index_end) {
471 if (silent_loop) 528 if (silent_loop)
472 break; 529 break;
@@ -492,17 +549,18 @@ FILE_FUNC int rmt_instrument_frames(const byte ARRAY module, int instrument, int
492 return player_calls / per_frame; 549 return player_calls / per_frame;
493} 550}
494 551
495FILE_FUNC void parse_rmt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, 552PRIVATE FUNC(void, parse_rmt_song, (
496 abool ARRAY global_seen, int song_len, int pos_shift, int pos) 553 P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module),
554 P(BOOLARRAY, global_seen), P(int, song_len), P(int, pos_shift), P(int, pos)))
497{ 555{
498 int ch; 556 V(int, ch);
499 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6; 557 V(int, addr_to_offset) = UWORD(module, 2) - 6;
500 int tempo = UBYTE(module[0xb]); 558 V(int, tempo) = UBYTE(module[0xb]);
501 int frames = 0; 559 V(int, frames) = 0;
502 int song_offset = UBYTE(module[0x14]) + (UBYTE(module[0x15]) << 8) - addr_to_offset; 560 V(int, song_offset) = UWORD(module, 0x14) - addr_to_offset;
503 int pattern_lo_offset = UBYTE(module[0x10]) + (UBYTE(module[0x11]) << 8) - addr_to_offset; 561 V(int, pattern_lo_offset) = UWORD(module, 0x10) - addr_to_offset;
504 int pattern_hi_offset = UBYTE(module[0x12]) + (UBYTE(module[0x13]) << 8) - addr_to_offset; 562 V(int, pattern_hi_offset) = UWORD(module, 0x12) - addr_to_offset;
505 int instrument_frames; 563 V(int, instrument_frames);
506 NEW_ARRAY(byte, seen, 256); 564 NEW_ARRAY(byte, seen, 256);
507 NEW_ARRAY(int, pattern_begin, 8); 565 NEW_ARRAY(int, pattern_begin, 8);
508 NEW_ARRAY(int, pattern_offset, 8); 566 NEW_ARRAY(int, pattern_offset, 8);
@@ -517,11 +575,11 @@ FILE_FUNC void parse_rmt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
517 INIT_ARRAY(volume_value); 575 INIT_ARRAY(volume_value);
518 INIT_ARRAY(volume_frame); 576 INIT_ARRAY(volume_frame);
519 while (pos < song_len) { 577 while (pos < song_len) {
520 int i; 578 V(int, i);
521 int pattern_rows; 579 V(int, pattern_rows);
522 if (seen[pos] != 0) { 580 if (seen[pos] != 0) {
523 if (seen[pos] != SEEN_THIS_CALL) 581 if (seen[pos] != SEEN_THIS_CALL)
524 MODULE_INFO loops[MODULE_INFO songs] = TRUE; 582 module_info _ loops[module_info _ songs] = TRUE;
525 break; 583 break;
526 } 584 }
527 seen[pos] = SEEN_THIS_CALL; 585 seen[pos] = SEEN_THIS_CALL;
@@ -589,37 +647,38 @@ FILE_FUNC void parse_rmt_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
589 } 647 }
590 instrument_frames = 0; 648 instrument_frames = 0;
591 for (ch = 0; ch < 1 << pos_shift; ch++) { 649 for (ch = 0; ch < 1 << pos_shift; ch++) {
592 int frame = instrument_frame[ch]; 650 V(int, frame) = instrument_frame[ch];
593 frame += rmt_instrument_frames(module, instrument_no[ch], volume_value[ch], volume_frame[ch] - frame, ch >= 4); 651 frame += rmt_instrument_frames(module, instrument_no[ch], volume_value[ch], volume_frame[ch] - frame, ch >= 4);
594 if (instrument_frames < frame) 652 if (instrument_frames < frame)
595 instrument_frames = frame; 653 instrument_frames = frame;
596 } 654 }
597 if (frames > instrument_frames) { 655 if (frames > instrument_frames) {
598 if (frames - instrument_frames > 100) 656 if (frames - instrument_frames > 100)
599 MODULE_INFO loops[MODULE_INFO songs] = FALSE; 657 module_info _ loops[module_info _ songs] = FALSE;
600 frames = instrument_frames; 658 frames = instrument_frames;
601 } 659 }
602 if (frames > 0) 660 if (frames > 0)
603 set_song_duration(module_info, frames); 661 set_song_duration(module_info, frames);
604} 662}
605 663
606FILE_FUNC abool parse_rmt(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 664PRIVATE FUNC(abool, parse_rmt, (
607 const byte ARRAY module, int module_len) 665 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
666 P(CONST BYTEARRAY, module), P(int, module_len)))
608{ 667{
609 int per_frame; 668 V(int, per_frame);
610 int pos_shift; 669 V(int, pos_shift);
611 int song_len; 670 V(int, song_len);
612 int pos; 671 V(int, pos);
613 NEW_ARRAY(abool, global_seen, 256); 672 NEW_ARRAY(abool, global_seen, 256);
614 if (module_len < 0x30 || module[6] != 'R' || module[7] != 'M' 673 if (module_len < 0x30 || module[6] != CHARCODE('R') || module[7] != CHARCODE('M')
615 || module[8] != 'T' || module[0xd] != 1) 674 || module[8] != CHARCODE('T') || module[0xd] != 1)
616 return FALSE; 675 return FALSE;
617 switch ((char) module[9]) { 676 switch (CAST(char) module[9]) {
618 case '4': 677 case CHARCODE('4'):
619 pos_shift = 2; 678 pos_shift = 2;
620 break; 679 break;
621 case '8': 680 case CHARCODE('8'):
622 MODULE_INFO channels = 2; 681 module_info _ channels = 2;
623 pos_shift = 3; 682 pos_shift = 3;
624 break; 683 break;
625 default: 684 default:
@@ -628,45 +687,44 @@ FILE_FUNC abool parse_rmt(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
628 per_frame = module[0xc]; 687 per_frame = module[0xc];
629 if (per_frame < 1 || per_frame > 4) 688 if (per_frame < 1 || per_frame > 4)
630 return FALSE; 689 return FALSE;
631 MODULE_INFO type = 'r'; 690 module_info _ type = ASAP_TYPE_RMT;
632 if (!load_native(ast, module_info, module, module_len, 691 if (!load_native(ast, module_info, module, module_len,
633 MODULE_INFO channels == 2 ? GET_OBX(rmt8) : GET_OBX(rmt4))) 692 module_info _ channels == 2 ? GET_RESOURCE(rmt8, obx) : GET_RESOURCE(rmt4, obx)))
634 return FALSE; 693 return FALSE;
635 song_len = UBYTE(module[4]) + (UBYTE(module[5]) << 8) + 1 694 song_len = UWORD(module, 4) + 1 - UWORD(module, 0x14);
636 - UBYTE(module[0x14]) - (UBYTE(module[0x15]) << 8);
637 if (pos_shift == 3 && (song_len & 4) != 0 695 if (pos_shift == 3 && (song_len & 4) != 0
638 && UBYTE(module[6 + UBYTE(module[4]) + (UBYTE(module[5]) << 8) 696 && UBYTE(module[6 + UWORD(module, 4) - UWORD(module, 2) - 3]) == 0xfe)
639 - UBYTE(module[2]) - (UBYTE(module[3]) << 8) - 3]) == 0xfe)
640 song_len += 4; 697 song_len += 4;
641 song_len >>= pos_shift; 698 song_len >>= pos_shift;
642 if (song_len >= 0x100) 699 if (song_len >= 0x100)
643 return FALSE; 700 return FALSE;
644 INIT_ARRAY(global_seen); 701 INIT_ARRAY(global_seen);
645 MODULE_INFO songs = 0; 702 module_info _ songs = 0;
646 for (pos = 0; pos < song_len && MODULE_INFO songs < MAX_SONGS; pos++) { 703 for (pos = 0; pos < song_len && module_info _ songs < ASAP_SONGS_MAX; pos++) {
647 if (!global_seen[pos]) { 704 if (!global_seen[pos]) {
648 MODULE_INFO song_pos[MODULE_INFO songs] = (byte) pos; 705 module_info _ song_pos[module_info _ songs] = CAST(byte) pos;
649 parse_rmt_song(module_info, module, global_seen, song_len, pos_shift, pos); 706 parse_rmt_song(module_info, module, global_seen, song_len, pos_shift, pos);
650 } 707 }
651 } 708 }
652 /* must set fastplay after song durations calculations, so they assume 312 */ 709 /* must set fastplay after song durations calculations, so they assume 312 */
653 MODULE_INFO fastplay = perframe2fastplay[per_frame - 1]; 710 module_info _ fastplay = perframe2fastplay[per_frame - 1];
654 MODULE_INFO player = 0x600; 711 module_info _ player = 0x600;
655 return MODULE_INFO songs != 0; 712 return module_info _ songs > 0;
656} 713}
657 714
658FILE_FUNC void parse_tmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, int pos) 715PRIVATE FUNC(void, parse_tmc_song, (
716 P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module), P(int, pos)))
659{ 717{
660 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6; 718 V(int, addr_to_offset) = UWORD(module, 2) - 6;
661 int tempo = UBYTE(module[0x24]) + 1; 719 V(int, tempo) = UBYTE(module[0x24]) + 1;
662 int frames = 0; 720 V(int, frames) = 0;
663 NEW_ARRAY(int, pattern_offset, 8); 721 NEW_ARRAY(int, pattern_offset, 8);
664 NEW_ARRAY(int, blank_rows, 8); 722 NEW_ARRAY(int, blank_rows, 8);
665 while (UBYTE(module[0x1a6 + 15 + pos]) < 0x80) { 723 while (UBYTE(module[0x1a6 + 15 + pos]) < 0x80) {
666 int ch; 724 V(int, ch);
667 int pattern_rows; 725 V(int, pattern_rows);
668 for (ch = 7; ch >= 0; ch--) { 726 for (ch = 7; ch >= 0; ch--) {
669 int pat = UBYTE(module[0x1a6 + 15 + pos - 2 * ch]); 727 V(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; 728 pattern_offset[ch] = UBYTE(module[0xa6 + pat]) + (UBYTE(module[0x126 + pat]) << 8) - addr_to_offset;
671 blank_rows[ch] = 0; 729 blank_rows[ch] = 0;
672 } 730 }
@@ -675,7 +733,7 @@ FILE_FUNC void parse_tmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
675 if (--blank_rows[ch] >= 0) 733 if (--blank_rows[ch] >= 0)
676 continue; 734 continue;
677 for (;;) { 735 for (;;) {
678 int i = UBYTE(module[pattern_offset[ch]++]); 736 V(int, i) = UBYTE(module[pattern_offset[ch]++]);
679 if (i < 0x40) { 737 if (i < 0x40) {
680 pattern_offset[ch]++; 738 pattern_offset[ch]++;
681 break; 739 break;
@@ -710,21 +768,22 @@ FILE_FUNC void parse_tmc_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
710 pos += 16; 768 pos += 16;
711 } 769 }
712 if (UBYTE(module[0x1a6 + 14 + pos]) < 0x80) 770 if (UBYTE(module[0x1a6 + 14 + pos]) < 0x80)
713 MODULE_INFO loops[MODULE_INFO songs] = TRUE; 771 module_info _ loops[module_info _ songs] = TRUE;
714 set_song_duration(module_info, frames); 772 set_song_duration(module_info, frames);
715} 773}
716 774
717FILE_FUNC abool parse_tmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 775PRIVATE FUNC(abool, parse_tmc, (
718 const byte ARRAY module, int module_len) 776 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
777 P(CONST BYTEARRAY, module), P(int, module_len)))
719{ 778{
720 int i; 779 V(int, i);
721 int last_pos; 780 V(int, last_pos);
722 if (module_len < 0x1d0) 781 if (module_len < 0x1d0)
723 return FALSE; 782 return FALSE;
724 MODULE_INFO type = 't'; 783 module_info _ type = ASAP_TYPE_TMC;
725 if (!load_native(ast, module_info, module, module_len, GET_OBX(tmc))) 784 if (!load_native(ast, module_info, module, module_len, GET_RESOURCE(tmc, obx)))
726 return FALSE; 785 return FALSE;
727 MODULE_INFO channels = 2; 786 module_info _ channels = 2;
728 i = 0; 787 i = 0;
729 /* find first instrument */ 788 /* find first instrument */
730 while (module[0x66 + i] == 0) { 789 while (module[0x66 + i] == 0) {
@@ -732,7 +791,7 @@ FILE_FUNC abool parse_tmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
732 return FALSE; /* no instrument */ 791 return FALSE; /* no instrument */
733 } 792 }
734 last_pos = (UBYTE(module[0x66 + i]) << 8) + UBYTE(module[0x26 + i]) 793 last_pos = (UBYTE(module[0x66 + i]) << 8) + UBYTE(module[0x26 + i])
735 - UBYTE(module[2]) - (UBYTE(module[3]) << 8) - 0x1b0; 794 - UWORD(module, 2) - 0x1b0;
736 if (0x1b5 + last_pos >= module_len) 795 if (0x1b5 + last_pos >= module_len)
737 return FALSE; 796 return FALSE;
738 /* skip trailing jumps */ 797 /* skip trailing jumps */
@@ -741,9 +800,9 @@ FILE_FUNC abool parse_tmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
741 return FALSE; /* no pattern to play */ 800 return FALSE; /* no pattern to play */
742 last_pos -= 16; 801 last_pos -= 16;
743 } while (UBYTE(module[0x1b5 + last_pos]) >= 0x80); 802 } while (UBYTE(module[0x1b5 + last_pos]) >= 0x80);
744 MODULE_INFO songs = 0; 803 module_info _ songs = 0;
745 parse_tmc_song(module_info, module, 0); 804 parse_tmc_song(module_info, module, 0);
746 for (i = 0; i < last_pos && MODULE_INFO songs < MAX_SONGS; i += 16) 805 for (i = 0; i < last_pos && module_info _ songs < ASAP_SONGS_MAX; i += 16)
747 if (UBYTE(module[0x1b5 + i]) >= 0x80) 806 if (UBYTE(module[0x1b5 + i]) >= 0x80)
748 parse_tmc_song(module_info, module, i + 16); 807 parse_tmc_song(module_info, module, i + 16);
749 /* must set fastplay after song durations calculations, so they assume 312 */ 808 /* must set fastplay after song durations calculations, so they assume 312 */
@@ -751,29 +810,30 @@ FILE_FUNC abool parse_tmc(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
751 if (i < 1 || i > 4) 810 if (i < 1 || i > 4)
752 return FALSE; 811 return FALSE;
753 if (ast != NULL) 812 if (ast != NULL)
754 AST tmc_per_frame = module[0x25]; 813 ast _ tmc_per_frame = module[0x25];
755 MODULE_INFO fastplay = perframe2fastplay[i - 1]; 814 module_info _ fastplay = perframe2fastplay[i - 1];
756 return TRUE; 815 return TRUE;
757} 816}
758 817
759FILE_FUNC void parse_tm2_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY module, int pos) 818PRIVATE FUNC(void, parse_tm2_song, (
819 P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module), P(int, pos)))
760{ 820{
761 int addr_to_offset = UBYTE(module[2]) + (UBYTE(module[3]) << 8) - 6; 821 V(int, addr_to_offset) = UWORD(module, 2) - 6;
762 int tempo = UBYTE(module[0x24]) + 1; 822 V(int, tempo) = UBYTE(module[0x24]) + 1;
763 int player_calls = 0; 823 V(int, player_calls) = 0;
764 NEW_ARRAY(int, pattern_offset, 8); 824 NEW_ARRAY(int, pattern_offset, 8);
765 NEW_ARRAY(int, blank_rows, 8); 825 NEW_ARRAY(int, blank_rows, 8);
766 for (;;) { 826 for (;;) {
767 int ch; 827 V(int, ch);
768 int pattern_rows = UBYTE(module[0x386 + 16 + pos]); 828 V(int, pattern_rows) = UBYTE(module[0x386 + 16 + pos]);
769 if (pattern_rows == 0) 829 if (pattern_rows == 0)
770 break; 830 break;
771 if (pattern_rows >= 0x80) { 831 if (pattern_rows >= 0x80) {
772 MODULE_INFO loops[MODULE_INFO songs] = TRUE; 832 module_info _ loops[module_info _ songs] = TRUE;
773 break; 833 break;
774 } 834 }
775 for (ch = 7; ch >= 0; ch--) { 835 for (ch = 7; ch >= 0; ch--) {
776 int pat = UBYTE(module[0x386 + 15 + pos - 2 * ch]); 836 V(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; 837 pattern_offset[ch] = UBYTE(module[0x106 + pat]) + (UBYTE(module[0x206 + pat]) << 8) - addr_to_offset;
778 blank_rows[ch] = 0; 838 blank_rows[ch] = 0;
779 } 839 }
@@ -782,7 +842,7 @@ FILE_FUNC void parse_tm2_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
782 if (--blank_rows[ch] >= 0) 842 if (--blank_rows[ch] >= 0)
783 continue; 843 continue;
784 for (;;) { 844 for (;;) {
785 int i = UBYTE(module[pattern_offset[ch]++]); 845 V(int, i) = UBYTE(module[pattern_offset[ch]++]);
786 if (i == 0) { 846 if (i == 0) {
787 pattern_offset[ch]++; 847 pattern_offset[ch]++;
788 break; 848 break;
@@ -829,36 +889,37 @@ FILE_FUNC void parse_tm2_song(ASAP_ModuleInfo PTR module_info, const byte ARRAY
829 set_song_duration(module_info, player_calls); 889 set_song_duration(module_info, player_calls);
830} 890}
831 891
832FILE_FUNC abool parse_tm2(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 892PRIVATE FUNC(abool, parse_tm2, (
833 const byte ARRAY module, int module_len) 893 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
894 P(CONST BYTEARRAY, module), P(int, module_len)))
834{ 895{
835 int i; 896 V(int, i);
836 int last_pos; 897 V(int, last_pos);
837 int c; 898 V(int, c);
838 if (module_len < 0x3a4) 899 if (module_len < 0x3a4)
839 return FALSE; 900 return FALSE;
840 MODULE_INFO type = 'T'; 901 module_info _ type = ASAP_TYPE_TM2;
841 if (!load_native(ast, module_info, module, module_len, GET_OBX(tm2))) 902 if (!load_native(ast, module_info, module, module_len, GET_RESOURCE(tm2, obx)))
842 return FALSE; 903 return FALSE;
843 i = module[0x25]; 904 i = module[0x25];
844 if (i < 1 || i > 4) 905 if (i < 1 || i > 4)
845 return FALSE; 906 return FALSE;
846 MODULE_INFO fastplay = perframe2fastplay[i - 1]; 907 module_info _ fastplay = perframe2fastplay[i - 1];
847 MODULE_INFO player = 0x500; 908 module_info _ player = 0x500;
848 if (module[0x1f] != 0) 909 if (module[0x1f] != 0)
849 MODULE_INFO channels = 2; 910 module_info _ channels = 2;
850 last_pos = 0xffff; 911 last_pos = 0xffff;
851 for (i = 0; i < 0x80; i++) { 912 for (i = 0; i < 0x80; i++) {
852 int instr_addr = UBYTE(module[0x86 + i]) + (UBYTE(module[0x306 + i]) << 8); 913 V(int, instr_addr) = UBYTE(module[0x86 + i]) + (UBYTE(module[0x306 + i]) << 8);
853 if (instr_addr != 0 && instr_addr < last_pos) 914 if (instr_addr != 0 && instr_addr < last_pos)
854 last_pos = instr_addr; 915 last_pos = instr_addr;
855 } 916 }
856 for (i = 0; i < 0x100; i++) { 917 for (i = 0; i < 0x100; i++) {
857 int pattern_addr = UBYTE(module[0x106 + i]) + (UBYTE(module[0x206 + i]) << 8); 918 V(int, pattern_addr) = UBYTE(module[0x106 + i]) + (UBYTE(module[0x206 + i]) << 8);
858 if (pattern_addr != 0 && pattern_addr < last_pos) 919 if (pattern_addr != 0 && pattern_addr < last_pos)
859 last_pos = pattern_addr; 920 last_pos = pattern_addr;
860 } 921 }
861 last_pos -= UBYTE(module[2]) + (UBYTE(module[3]) << 8) + 0x380; 922 last_pos -= UWORD(module, 2) + 0x380;
862 if (0x386 + last_pos >= module_len) 923 if (0x386 + last_pos >= module_len)
863 return FALSE; 924 return FALSE;
864 /* skip trailing stop/jump commands */ 925 /* skip trailing stop/jump commands */
@@ -868,9 +929,9 @@ FILE_FUNC abool parse_tm2(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
868 last_pos -= 17; 929 last_pos -= 17;
869 c = UBYTE(module[0x386 + 16 + last_pos]); 930 c = UBYTE(module[0x386 + 16 + last_pos]);
870 } while (c == 0 || c >= 0x80); 931 } while (c == 0 || c >= 0x80);
871 MODULE_INFO songs = 0; 932 module_info _ songs = 0;
872 parse_tm2_song(module_info, module, 0); 933 parse_tm2_song(module_info, module, 0);
873 for (i = 0; i < last_pos && MODULE_INFO songs < MAX_SONGS; i += 17) { 934 for (i = 0; i < last_pos && module_info _ songs < ASAP_SONGS_MAX; i += 17) {
874 c = UBYTE(module[0x386 + 16 + i]); 935 c = UBYTE(module[0x386 + 16 + i]);
875 if (c == 0 || c >= 0x80) 936 if (c == 0 || c >= 0x80)
876 parse_tm2_song(module_info, module, i + 17); 937 parse_tm2_song(module_info, module, i + 17);
@@ -878,280 +939,262 @@ FILE_FUNC abool parse_tm2(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
878 return TRUE; 939 return TRUE;
879} 940}
880 941
881#if !defined(JAVA) && !defined(CSHARP) 942#endif /* ASAP_ONLY_SAP */
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 943
904static abool parse_dec(int *retval, const char *p, int minval, int maxval) 944PRIVATE FUNC(abool, has_string_at, (P(CONST BYTEARRAY, module), P(int, module_index), P(STRING, s)))
905{ 945{
906 int r = 0; 946 V(int, i);
907 do { 947 V(int, n) = strlen(s);
908 char c = *p; 948 for (i = 0; i < n; i++)
909 if (c >= '0' && c <= '9') 949 if (module[module_index + i] != CHARCODEAT(s, i))
910 r = 10 * r + c - '0';
911 else
912 return FALSE; 950 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; 951 return TRUE;
920} 952}
921 953
922static abool parse_text(char *retval, const char *p) 954PRIVATE FUNC(STRING, parse_text, (P(OUT_STRING, dest), P(CONST BYTEARRAY, module), P(int, module_index)))
923{ 955{
924 int i; 956 V(int, i);
925 if (*p != '"') 957 if (module[module_index] != CHARCODE('"'))
926 return FALSE; 958 return NULL;
927 p++; 959 if (has_string_at(module, module_index + 1, "<?>\""))
928 if (p[0] == '<' && p[1] == '?' && p[2] == '>' && p[3] == '"') 960 return dest;
929 return TRUE; 961 for (i = 0; ; i++) {
930 i = 0; 962 V(int, c) = module[module_index + 1 + i];
931 while (*p != '"') { 963 if (c == CHARCODE('"'))
932 if (i >= 127) 964 break;
933 return FALSE; 965 if (c < 32 || c >= 127)
934 if (*p == '\0') 966 return NULL;
935 return FALSE;
936 retval[i++] = *p++;
937 } 967 }
938 retval[i] = '\0'; 968 BYTES_TO_STRING(dest, module, module_index + 1, i);
939 return TRUE; 969 return dest;
940} 970}
941 971
942int ASAP_ParseDuration(const char *s) 972PRIVATE FUNC(int, parse_dec, (P(CONST BYTEARRAY, module), P(int, module_index), P(int, maxval)))
943{ 973{
944 int r; 974 V(int, r);
945 if (*s < '0' || *s > '9') 975 if (module[module_index] == 0xd)
946 return -1; 976 return -1;
947 r = *s++ - '0'; 977 for (r = 0;;) {
948 if (*s >= '0' && *s <= '9') 978 V(int, c) = module[module_index++];
949 r = 10 * r + *s++ - '0'; 979 if (c == 0xd)
950 if (*s == ':') { 980 break;
951 s++; 981 if (c < CHARCODE('0') || c > CHARCODE('9'))
952 if (*s < '0' || *s > '5')
953 return -1; 982 return -1;
954 r = 60 * r + (*s++ - '0') * 10; 983 r = 10 * r + c - 48;
955 if (*s < '0' || *s > '9') 984 if (r > maxval)
956 return -1; 985 return -1;
957 r += *s++ - '0';
958 } 986 }
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; 987 return r;
973} 988}
974 989
975static char *two_digits(char *s, int x) 990PRIVATE FUNC(int, parse_hex, (P(CONST BYTEARRAY, module), P(int, module_index)))
976{ 991{
977 s[0] = '0' + x / 10; 992 V(int, r);
978 s[1] = '0' + x % 10; 993 if (module[module_index] == 0xd)
979 return s + 2; 994 return -1;
995 for (r = 0;;) {
996 V(int, c) = module[module_index++];
997 if (c == 0xd)
998 break;
999 if (r > 0xfff)
1000 return -1;
1001 r <<= 4;
1002 if (c >= CHARCODE('0') && c <= CHARCODE('9'))
1003 r += c - CHARCODE('0');
1004 else if (c >= CHARCODE('A') && c <= CHARCODE('F'))
1005 r += c - CHARCODE('A') + 10;
1006 else if (c >= CHARCODE('a') && c <= CHARCODE('f'))
1007 r += c - CHARCODE('a') + 10;
1008 else
1009 return -1;
1010 }
1011 return r;
980} 1012}
981 1013
982void ASAP_DurationToString(char *s, int duration) 1014FUNC(int, ASAP_ParseDuration, (P(STRING, s)))
983{ 1015{
984 if (duration >= 0) { 1016 V(int, i) = 0;
985 int seconds = duration / 1000; 1017 V(int, r);
986 int minutes = seconds / 60; 1018 V(int, d);
987 s = two_digits(s, minutes); 1019 V(int, n) = strlen(s);
988 *s++ = ':'; 1020#define PARSE_DIGIT(maxdig, retifnot) \
989 s = two_digits(s, seconds % 60); 1021 if (i >= n) \
990 duration %= 1000; 1022 return retifnot; \
991 if (duration != 0) { 1023 d = CHARCODEAT(s, i) - 48; \
992 *s++ = '.'; 1024 if (d < 0 || d > maxdig) \
993 s = two_digits(s, duration / 10); 1025 return -1; \
994 duration %= 10; 1026 i++;
995 if (duration != 0) 1027
996 *s++ = '0' + duration; 1028 PARSE_DIGIT(9, -1);
1029 r = d;
1030 if (i < n) {
1031 d = CHARCODEAT(s, i) - 48;
1032 if (d >= 0 && d <= 9) {
1033 i++;
1034 r = 10 * r + d;
1035 }
1036 if (i < n && CHARAT(s, i) == ':') {
1037 i++;
1038 PARSE_DIGIT(5, -1);
1039 r = (6 * r + d) * 10;
1040 PARSE_DIGIT(9, -1);
1041 r += d;
997 } 1042 }
998 } 1043 }
999 *s = '\0'; 1044 r *= 1000;
1045 if (i >= n)
1046 return r;
1047 if (CHARAT(s, i) != '.')
1048 return -1;
1049 i++;
1050 PARSE_DIGIT(9, -1);
1051 r += 100 * d;
1052 PARSE_DIGIT(9, r);
1053 r += 10 * d;
1054 PARSE_DIGIT(9, r);
1055 r += d;
1056 return r;
1000} 1057}
1001 1058
1002#endif /* !defined(JAVA) && !defined(CSHARP) */ 1059PRIVATE FUNC(abool, parse_sap_header, (
1003 1060 P(ASAP_ModuleInfo PTR, module_info), P(CONST BYTEARRAY, module), P(int, module_len)))
1004FILE_FUNC abool parse_sap_header(ASAP_ModuleInfo PTR module_info,
1005 const byte ARRAY module, int module_len)
1006{ 1061{
1007 int module_index = 0; 1062 V(int, module_index);
1008 abool sap_signature = FALSE; 1063 V(int, type) = 0;
1009 int duration_index = 0; 1064 V(int, duration_index) = 0;
1010 for (;;) { 1065 if (!has_string_at(module, 0, "SAP\r\n"))
1011 NEW_ARRAY(char, line, 256); 1066 return FALSE;
1012 int i; 1067 module_index = 5;
1013#if !defined(JAVA) && !defined(CSHARP) 1068 while (UBYTE(module[module_index]) != 0xff) {
1014 char *p;
1015#endif
1016 if (module_index + 8 >= module_len) 1069 if (module_index + 8 >= module_len)
1017 return FALSE; 1070 return FALSE;
1018 if (UBYTE(module[module_index]) == 0xff) 1071#define TAG_IS(s) has_string_at(module, module_index, s)
1019 break; 1072#ifdef C
1020 i = 0; 1073#define SET_TEXT(v, i) if (parse_text(v, module, module_index + i) == NULL) return FALSE
1021 while (module[module_index] != 0x0d) { 1074#else
1022 line[i++] = (char) module[module_index++]; 1075#define SET_TEXT(v, i) v = parse_text(v, module, module_index + i); if (v == NULL) return FALSE
1023 if (module_index >= module_len || (unsigned)i >= sizeof(line) - 1) 1076#endif
1024 return FALSE; 1077#define SET_DEC(v, i, min, max) v = parse_dec(module, module_index + i, max); if (v < min) return FALSE
1078#define SET_HEX(v, i) v = parse_hex(module, module_index + i)
1079 if (TAG_IS("AUTHOR ")) {
1080 SET_TEXT(module_info _ author, 7);
1025 } 1081 }
1026 if (++module_index >= module_len || module[module_index++] != 0x0a) 1082 else if (TAG_IS("NAME ")) {
1027 return FALSE; 1083 SET_TEXT(module_info _ name, 5);
1028 1084 }
1029#ifdef JAVA 1085 else if (TAG_IS("DATE ")) {
1030 String tag = new String(line, 0, i); 1086 SET_TEXT(module_info _ date, 5);
1031 String arg = null; 1087 }
1032 i = tag.indexOf(' '); 1088 else if (TAG_IS("SONGS ")) {
1033 if (i >= 0) { 1089 SET_DEC(module_info _ songs, 6, 1, ASAP_SONGS_MAX);
1034 arg = tag.substring(i + 1); 1090 }
1035 tag = tag.substring(0, i); 1091 else if (TAG_IS("DEFSONG ")) {
1036 } 1092 SET_DEC(module_info _ default_song, 8, 0, ASAP_SONGS_MAX - 1);
1037#define TAG_IS(t) tag.equals(t) 1093 }
1038#define CHAR_ARG arg.charAt(0) 1094 else if (TAG_IS("STEREO\r"))
1039#define SET_HEX(v) v = Integer.parseInt(arg, 16) 1095 module_info _ channels = 2;
1040#define SET_DEC(v, min, max) do { v = Integer.parseInt(arg); if (v < min || v > max) return FALSE; } while (FALSE) 1096 else if (TAG_IS("TIME ")) {
1041#define SET_TEXT(v) v = arg.substring(1, arg.length() - 1) 1097 V(int, i);
1042#define DURATION_ARG parseDuration(arg) 1098#ifdef C
1043#define ARG_CONTAINS(t) (arg.indexOf(t) >= 0) 1099 char s[ASAP_DURATION_CHARS];
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 1100#else
1060 line[i] = '\0'; 1101 V(STRING, s);
1061 for (p = line; *p != '\0'; p++) { 1102#endif
1062 if (*p == ' ') { 1103 module_index += 5;
1063 *p++ = '\0'; 1104 for (i = 0; module[module_index + i] != 0xd; i++);
1064 break; 1105 if (i > 5 && has_string_at(module, module_index + i - 5, " LOOP")) {
1106 module_info _ loops[duration_index] = TRUE;
1107 i -= 5;
1065 } 1108 }
1066 } 1109#ifdef C
1067#define TAG_IS(t) (strcmp(line, t) == 0) 1110 if (i >= ASAP_DURATION_CHARS)
1068#define CHAR_ARG *p 1111 return FALSE;
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 1112#endif
1113 BYTES_TO_STRING(s, module, module_index, i);
1114 i = ASAP_ParseDuration(s);
1115 if (i < 0 || duration_index >= ASAP_SONGS_MAX)
1116 return FALSE;
1117 module_info _ durations[duration_index++] = i;
1118 }
1119 else if (TAG_IS("TYPE "))
1120 type = module[module_index + 5];
1121 else if (TAG_IS("FASTPLAY ")) {
1122 SET_DEC(module_info _ fastplay, 9, 1, 312);
1123 }
1124 else if (TAG_IS("MUSIC ")) {
1125 SET_HEX(module_info _ music, 6);
1126 }
1127 else if (TAG_IS("INIT ")) {
1128 SET_HEX(module_info _ init, 5);
1129 }
1130 else if (TAG_IS("PLAYER ")) {
1131 SET_HEX(module_info _ player, 7);
1132 }
1133 else if (TAG_IS("COVOX ")) {
1134 SET_HEX(module_info _ covox_addr, 6);
1135 if (module_info _ covox_addr != 0xd600)
1136 return FALSE;
1137 module_info _ channels = 2;
1138 }
1075 1139
1076 if (TAG_IS("SAP")) 1140 while (module[module_index++] != 0x0d) {
1077 sap_signature = TRUE; 1141 if (module_index >= module_len)
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; 1142 return FALSE;
1096 MODULE_INFO durations[duration_index] = duration; 1143 }
1097 if (ARG_CONTAINS("LOOP")) 1144 if (module[module_index++] != 0x0a)
1098 MODULE_INFO loops[duration_index] = TRUE; 1145 return FALSE;
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 } 1146 }
1112 if (MODULE_INFO default_song >= MODULE_INFO songs) 1147 if (module_info _ default_song >= module_info _ songs)
1113 return FALSE; 1148 return FALSE;
1114 switch (MODULE_INFO type) { 1149 switch (type) {
1115 case 'B': 1150 case CHARCODE('B'):
1116 case 'D': 1151 if (module_info _ player < 0 || module_info _ init < 0)
1117 if (MODULE_INFO player < 0 || MODULE_INFO init < 0) 1152 return FALSE;
1153 module_info _ type = ASAP_TYPE_SAP_B;
1154 break;
1155 case CHARCODE('C'):
1156 if (module_info _ player < 0 || module_info _ music < 0)
1118 return FALSE; 1157 return FALSE;
1158 module_info _ type = ASAP_TYPE_SAP_C;
1119 break; 1159 break;
1120 case 'C': 1160 case CHARCODE('D'):
1121 if (MODULE_INFO player < 0 || MODULE_INFO music < 0) 1161 if (module_info _ init < 0)
1122 return FALSE; 1162 return FALSE;
1163 module_info _ type = ASAP_TYPE_SAP_D;
1123 break; 1164 break;
1124 case 'S': 1165 case CHARCODE('S'):
1125 if (MODULE_INFO init < 0) 1166 if (module_info _ init < 0)
1126 return FALSE; 1167 return FALSE;
1127 MODULE_INFO fastplay = 78; 1168 module_info _ type = ASAP_TYPE_SAP_S;
1169 module_info _ fastplay = 78;
1128 break; 1170 break;
1129 default: 1171 default:
1130 return FALSE; 1172 return FALSE;
1131 } 1173 }
1132 if (UBYTE(module[module_index + 1]) != 0xff) 1174 if (UBYTE(module[module_index + 1]) != 0xff)
1133 return FALSE; 1175 return FALSE;
1134 MODULE_INFO header_len = module_index; 1176 module_info _ header_len = module_index;
1135 return TRUE; 1177 return TRUE;
1136} 1178}
1137 1179
1138FILE_FUNC abool parse_sap(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 1180PRIVATE FUNC(abool, parse_sap, (
1139 const byte ARRAY module, int module_len) 1181 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
1182 P(CONST BYTEARRAY, module), P(int, module_len)))
1140{ 1183{
1141 int module_index; 1184 V(int, module_index);
1142 if (!parse_sap_header(module_info, module, module_len)) 1185 if (!parse_sap_header(module_info, module, module_len))
1143 return FALSE; 1186 return FALSE;
1144 if (ast == NULL) 1187 if (ast == NULL)
1145 return TRUE; 1188 return TRUE;
1146 ZERO_ARRAY(AST memory); 1189 ZERO_ARRAY(ast _ memory);
1147 module_index = MODULE_INFO header_len + 2; 1190 module_index = module_info _ header_len + 2;
1148 while (module_index + 5 <= module_len) { 1191 while (module_index + 5 <= module_len) {
1149 int start_addr = UBYTE(module[module_index]) + (UBYTE(module[module_index + 1]) << 8); 1192 V(int, start_addr) = UWORD(module, module_index);
1150 int block_len = UBYTE(module[module_index + 2]) + (UBYTE(module[module_index + 3]) << 8) + 1 - start_addr; 1193 V(int, block_len) = UWORD(module, module_index + 2) + 1 - start_addr;
1151 if (block_len <= 0 || module_index + block_len > module_len) 1194 if (block_len <= 0 || module_index + block_len > module_len)
1152 return FALSE; 1195 return FALSE;
1153 module_index += 4; 1196 module_index += 4;
1154 COPY_ARRAY(AST memory, start_addr, module, module_index, block_len); 1197 COPY_ARRAY(ast _ memory, start_addr, module, module_index, block_len);
1155 module_index += block_len; 1198 module_index += block_len;
1156 if (module_index == module_len) 1199 if (module_index == module_len)
1157 return TRUE; 1200 return TRUE;
@@ -1162,387 +1205,452 @@ FILE_FUNC abool parse_sap(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info,
1162 return FALSE; 1205 return FALSE;
1163} 1206}
1164 1207
1165#define ASAP_EXT(c1, c2, c3) (((c1) + ((c2) << 8) + ((c3) << 16)) | 0x202020) 1208#define ASAP_EXT(c1, c2, c3) ((CHARCODE(c1) + (CHARCODE(c2) << 8) + (CHARCODE(c3) << 16)) | 0x202020)
1166 1209
1167FILE_FUNC int get_packed_ext(STRING filename) 1210PRIVATE FUNC(int, get_packed_ext, (P(STRING, filename)))
1168{ 1211{
1169#ifdef JAVA 1212 V(int, i) = strlen(filename);
1170 int i = filename.length(); 1213 V(int, ext) = 0;
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) { 1214 while (--i > 0) {
1182 if (filename[i] == '.') 1215 V(char, c) = CHARAT(filename, i);
1216 if (c <= ' ' || c > 'z')
1217 return 0;
1218 if (c == '.')
1183 return ext | 0x202020; 1219 return ext | 0x202020;
1184 ext = (ext << 8) + filename[i]; 1220 ext = (ext << 8) + CHARCODE(c);
1185 } 1221 }
1186 return 0; 1222 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} 1223}
1201 1224
1202FILE_FUNC abool is_our_ext(int ext) 1225PRIVATE FUNC(abool, is_our_ext, (P(int, ext)))
1203{ 1226{
1204 switch (ext) { 1227 switch (ext) {
1228 case ASAP_EXT('S', 'A', 'P'):
1229#ifndef ASAP_ONLY_SAP
1205 case ASAP_EXT('C', 'M', 'C'): 1230 case ASAP_EXT('C', 'M', 'C'):
1231 case ASAP_EXT('C', 'M', '3'):
1206 case ASAP_EXT('C', 'M', 'R'): 1232 case ASAP_EXT('C', 'M', 'R'):
1233 case ASAP_EXT('C', 'M', 'S'):
1207 case ASAP_EXT('D', 'M', 'C'): 1234 case ASAP_EXT('D', 'M', 'C'):
1208 case ASAP_EXT('M', 'P', 'D'): 1235 case ASAP_EXT('D', 'L', 'T'):
1209 case ASAP_EXT('M', 'P', 'T'): 1236 case ASAP_EXT('M', 'P', 'T'):
1237 case ASAP_EXT('M', 'P', 'D'):
1210 case ASAP_EXT('R', 'M', 'T'): 1238 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'): 1239 case ASAP_EXT('T', 'M', 'C'):
1240 case ASAP_EXT('T', 'M', '8'):
1241 case ASAP_EXT('T', 'M', '2'):
1242#endif
1215 return TRUE; 1243 return TRUE;
1216 default: 1244 default:
1217 return FALSE; 1245 return FALSE;
1218 } 1246 }
1219} 1247}
1220 1248
1221ASAP_FUNC abool ASAP_IsOurFile(STRING filename) 1249FUNC(abool, ASAP_IsOurFile, (P(STRING, filename)))
1222{ 1250{
1223 int ext = get_packed_ext(filename); 1251 V(int, ext) = get_packed_ext(filename);
1224 return is_our_ext(ext); 1252 return is_our_ext(ext);
1225} 1253}
1226 1254
1227ASAP_FUNC abool ASAP_IsOurExt(STRING ext) 1255FUNC(abool, ASAP_IsOurExt, (P(STRING, ext)))
1228{ 1256{
1229#ifdef JAVA 1257 return strlen(ext) == 3
1230 return ext.length() == 3 1258 && is_our_ext(ASAP_EXT(CHARAT(ext, 0), CHARAT(ext, 1), CHARAT(ext, 2)));
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} 1259}
1237 1260
1238FILE_FUNC abool parse_file(ASAP_State PTR ast, ASAP_ModuleInfo PTR module_info, 1261PRIVATE FUNC(abool, parse_file, (
1239 STRING filename, const byte ARRAY module, int module_len) 1262 P(ASAP_State PTR, ast), P(ASAP_ModuleInfo PTR, module_info),
1263 P(STRING, filename), P(CONST BYTEARRAY, module), P(int, module_len)))
1240{ 1264{
1241 int i; 1265 V(int, i);
1242#ifdef JAVA 1266 V(int, len) = strlen(filename);
1243 int basename = 0; 1267 V(int, basename) = 0;
1244 int ext = -1; 1268 V(int, ext) = -1;
1245 for (i = 0; i < filename.length(); i++) { 1269 for (i = 0; i < len; i++) {
1246 int c = filename.charAt(i); 1270 V(char, c) = CHARAT(filename, i);
1247 if (c == '/' || c == '\\') 1271 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; 1272 basename = i + 1;
1273 ext = -1;
1274 }
1264 else if (c == '.') 1275 else if (c == '.')
1265 ext = i; 1276 ext = i;
1266 } 1277 }
1267 if (ext < 0) 1278 if (ext < 0)
1268 ext = i; 1279 return FALSE;
1269 module_info.author = string.Empty; 1280 EMPTY_STRING(module_info _ author);
1270 module_info.name = filename.Substring(basename, ext - basename); 1281 SUBSTRING(module_info _ name, filename, basename, ext - basename);
1271 module_info.date = string.Empty; 1282 EMPTY_STRING(module_info _ date);
1272#else 1283 module_info _ channels = 1;
1273 const char *p; 1284 module_info _ songs = 1;
1274 const char *basename = filename; 1285 module_info _ default_song = 0;
1275 const char *ext = NULL; 1286 for (i = 0; i < ASAP_SONGS_MAX; i++) {
1276 for (p = filename; *p != '\0'; p++) { 1287 module_info _ durations[i] = -1;
1277 if (*p == '/' || *p == '\\') 1288 module_info _ loops[i] = FALSE;
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 } 1289 }
1297 MODULE_INFO type = '?'; 1290 module_info _ fastplay = 312;
1298 MODULE_INFO fastplay = 312; 1291 module_info _ music = -1;
1299 MODULE_INFO music = -1; 1292 module_info _ init = -1;
1300 MODULE_INFO init = -1; 1293 module_info _ player = -1;
1301 MODULE_INFO player = -1; 1294 module_info _ covox_addr = -1;
1302 switch (get_packed_ext(filename)) { 1295 switch (get_packed_ext(filename)) {
1296 case ASAP_EXT('S', 'A', 'P'):
1297 return parse_sap(ast, module_info, module, module_len);
1298#ifndef ASAP_ONLY_SAP
1303 case ASAP_EXT('C', 'M', 'C'): 1299 case ASAP_EXT('C', 'M', 'C'):
1304 return parse_cmc(ast, module_info, module, module_len, FALSE); 1300 return parse_cmc(ast, module_info, module, module_len, ASAP_TYPE_CMC, GET_RESOURCE(cmc, obx));
1301 case ASAP_EXT('C', 'M', '3'):
1302 return parse_cmc(ast, module_info, module, module_len, ASAP_TYPE_CM3, GET_RESOURCE(cm3, obx));
1305 case ASAP_EXT('C', 'M', 'R'): 1303 case ASAP_EXT('C', 'M', 'R'):
1306 return parse_cmc(ast, module_info, module, module_len, TRUE); 1304 return parse_cmc(ast, module_info, module, module_len, ASAP_TYPE_CMR, GET_RESOURCE(cmc, obx));
1305 case ASAP_EXT('C', 'M', 'S'):
1306 module_info _ channels = 2;
1307 return parse_cmc(ast, module_info, module, module_len, ASAP_TYPE_CMS, GET_RESOURCE(cms, obx));
1307 case ASAP_EXT('D', 'M', 'C'): 1308 case ASAP_EXT('D', 'M', 'C'):
1308 MODULE_INFO fastplay = 156; 1309 module_info _ fastplay = 156;
1309 return parse_cmc(ast, module_info, module, module_len, FALSE); 1310 return parse_cmc(ast, module_info, module, module_len, ASAP_TYPE_CMC, GET_RESOURCE(cmc, obx));
1310 case ASAP_EXT('M', 'P', 'D'): 1311 case ASAP_EXT('D', 'L', 'T'):
1311 MODULE_INFO fastplay = 156; 1312 return parse_dlt(ast, module_info, module, module_len);
1312 return parse_mpt(ast, module_info, module, module_len);
1313 case ASAP_EXT('M', 'P', 'T'): 1313 case ASAP_EXT('M', 'P', 'T'):
1314 return parse_mpt(ast, module_info, module, module_len); 1314 return parse_mpt(ast, module_info, module, module_len);
1315 case ASAP_EXT('M', 'P', 'D'):
1316 module_info _ fastplay = 156;
1317 return parse_mpt(ast, module_info, module, module_len);
1315 case ASAP_EXT('R', 'M', 'T'): 1318 case ASAP_EXT('R', 'M', 'T'):
1316 return parse_rmt(ast, module_info, module, module_len); 1319 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'): 1320 case ASAP_EXT('T', 'M', 'C'):
1321 case ASAP_EXT('T', 'M', '8'):
1323 return parse_tmc(ast, module_info, module, module_len); 1322 return parse_tmc(ast, module_info, module, module_len);
1323 case ASAP_EXT('T', 'M', '2'):
1324 return parse_tm2(ast, module_info, module, module_len);
1325#endif
1324 default: 1326 default:
1325 return FALSE; 1327 return FALSE;
1326 } 1328 }
1327} 1329}
1328 1330
1329ASAP_FUNC abool ASAP_GetModuleInfo(ASAP_ModuleInfo PTR module_info, STRING filename, 1331FUNC(abool, ASAP_GetModuleInfo, (
1330 const byte ARRAY module, int module_len) 1332 P(ASAP_ModuleInfo PTR, module_info), P(STRING, filename),
1333 P(CONST BYTEARRAY, module), P(int, module_len)))
1331{ 1334{
1332 return parse_file(NULL, module_info, filename, module, module_len); 1335 return parse_file(NULL, module_info, filename, module, module_len);
1333} 1336}
1334 1337
1335ASAP_FUNC abool ASAP_Load(ASAP_State PTR ast, STRING filename, 1338FUNC(abool, ASAP_Load, (
1336 const byte ARRAY module, int module_len) 1339 P(ASAP_State PTR, ast), P(STRING, filename),
1340 P(CONST BYTEARRAY, module), P(int, module_len)))
1337{ 1341{
1338 AST silence_cycles = 0; 1342 ast _ silence_cycles = 0;
1339 return parse_file(ast, ADDRESSOF AST module_info, filename, module, module_len); 1343 return parse_file(ast, ADDRESSOF ast _ module_info, filename, module, module_len);
1340} 1344}
1341 1345
1342ASAP_FUNC void ASAP_DetectSilence(ASAP_State PTR ast, int seconds) 1346FUNC(void, ASAP_DetectSilence, (P(ASAP_State PTR, ast), P(int, seconds)))
1343{ 1347{
1344 AST silence_cycles = seconds * ASAP_MAIN_CLOCK; 1348 ast _ silence_cycles = seconds * ASAP_MAIN_CLOCK;
1345} 1349}
1346 1350
1347FILE_FUNC void call_6502(ASAP_State PTR ast, int addr, int max_scanlines) 1351PRIVATE FUNC(void, call_6502, (P(ASAP_State PTR, ast), P(int, addr), P(int, max_scanlines)))
1348{ 1352{
1349 AST cpu_pc = addr; 1353 ast _ cpu_pc = addr;
1350 /* put a CIM at 0xd20a and a return address on stack */ 1354 /* put a CIM at 0xd20a and a return address on stack */
1351 dPutByte(0xd20a, 0xd2); 1355 dPutByte(0xd20a, 0xd2);
1352 dPutByte(0x01fe, 0x09); 1356 dPutByte(0x01fe, 0x09);
1353 dPutByte(0x01ff, 0xd2); 1357 dPutByte(0x01ff, 0xd2);
1354 AST cpu_s = 0xfd; 1358 ast _ cpu_s = 0xfd;
1355 Cpu_RunScanlines(ast, max_scanlines); 1359 Cpu_RunScanlines(ast, max_scanlines);
1356} 1360}
1357 1361
1358/* 50 Atari frames for the initialization routine - some SAPs are self-extracting. */ 1362/* 50 Atari frames for the initialization routine - some SAPs are self-extracting. */
1359#define SCANLINES_FOR_INIT (50 * 312) 1363#define SCANLINES_FOR_INIT (50 * 312)
1360 1364
1361FILE_FUNC void call_6502_init(ASAP_State PTR ast, int addr, int a, int x, int y) 1365PRIVATE FUNC(void, call_6502_init, (P(ASAP_State PTR, ast), P(int, addr), P(int, a), P(int, x), P(int, y)))
1362{ 1366{
1363 AST cpu_a = a & 0xff; 1367 ast _ cpu_a = a & 0xff;
1364 AST cpu_x = x & 0xff; 1368 ast _ cpu_x = x & 0xff;
1365 AST cpu_y = y & 0xff; 1369 ast _ cpu_y = y & 0xff;
1366 call_6502(ast, addr, SCANLINES_FOR_INIT); 1370 call_6502(ast, addr, SCANLINES_FOR_INIT);
1367} 1371}
1368 1372
1369ASAP_FUNC void ASAP_PlaySong(ASAP_State PTR ast, int song, int duration) 1373FUNC(void, ASAP_PlaySong, (P(ASAP_State PTR, ast), P(int, song), P(int, duration)))
1370{ 1374{
1371 AST current_song = song; 1375 ast _ current_song = song;
1372 AST current_duration = duration; 1376 ast _ current_duration = duration;
1373 AST blocks_played = 0; 1377 ast _ blocks_played = 0;
1374 AST silence_cycles_counter = AST silence_cycles; 1378 ast _ silence_cycles_counter = ast _ silence_cycles;
1375 AST extra_pokey_mask = AST module_info.channels > 1 ? 0x10 : 0; 1379 ast _ extra_pokey_mask = ast _ module_info.channels > 1 ? 0x10 : 0;
1380 ast _ consol = 8;
1381 ast _ covox[0] = CAST(byte) 0x80;
1382 ast _ covox[1] = CAST(byte) 0x80;
1383 ast _ covox[2] = CAST(byte) 0x80;
1384 ast _ covox[3] = CAST(byte) 0x80;
1376 PokeySound_Initialize(ast); 1385 PokeySound_Initialize(ast);
1377 AST cycle = 0; 1386 ast _ cycle = 0;
1378 AST cpu_nz = 0; 1387 ast _ cpu_nz = 0;
1379 AST cpu_c = 0; 1388 ast _ cpu_c = 0;
1380 AST cpu_vdi = 0; 1389 ast _ cpu_vdi = 0;
1381 AST scanline_number = 0; 1390 ast _ scanline_number = 0;
1382 AST next_scanline_cycle = 0; 1391 ast _ next_scanline_cycle = 0;
1383 AST timer1_cycle = NEVER; 1392 ast _ timer1_cycle = NEVER;
1384 AST timer2_cycle = NEVER; 1393 ast _ timer2_cycle = NEVER;
1385 AST timer4_cycle = NEVER; 1394 ast _ timer4_cycle = NEVER;
1386 AST irqst = 0xff; 1395 ast _ irqst = 0xff;
1387 switch (AST module_info.type) { 1396 switch (ast _ module_info.type) {
1388 case 'B': 1397 case ASAP_TYPE_SAP_B:
1389 call_6502_init(ast, AST module_info.init, song, 0, 0); 1398 call_6502_init(ast, ast _ module_info.init, song, 0, 0);
1390 break; 1399 break;
1391 case 'C': 1400 case ASAP_TYPE_SAP_C:
1392 case 'c': 1401#ifndef ASAP_ONLY_SAP
1393 case 'z': 1402 case ASAP_TYPE_CMC:
1394 call_6502_init(ast, AST module_info.player + 3, 0x70, AST module_info.music, AST module_info.music >> 8); 1403 case ASAP_TYPE_CM3:
1395 call_6502_init(ast, AST module_info.player + 3, 0x00, song, 0); 1404 case ASAP_TYPE_CMR:
1405 case ASAP_TYPE_CMS:
1406#endif
1407 call_6502_init(ast, ast _ module_info.player + 3, 0x70, ast _ module_info.music, ast _ module_info.music >> 8);
1408 call_6502_init(ast, ast _ module_info.player + 3, 0x00, song, 0);
1409 break;
1410 case ASAP_TYPE_SAP_D:
1411 case ASAP_TYPE_SAP_S:
1412 ast _ cpu_a = song;
1413 ast _ cpu_x = 0x00;
1414 ast _ cpu_y = 0x00;
1415 ast _ cpu_s = 0xff;
1416 ast _ cpu_pc = ast _ module_info.init;
1396 break; 1417 break;
1397 case 'D': 1418#ifndef ASAP_ONLY_SAP
1398 case 'S': 1419 case ASAP_TYPE_DLT:
1399 AST cpu_a = song; 1420 call_6502_init(ast, ast _ module_info.player + 0x100, 0x00, 0x00, ast _ module_info.song_pos[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; 1421 break;
1405 case 'm': 1422 case ASAP_TYPE_MPT:
1406 call_6502_init(ast, AST module_info.player, 0x00, AST module_info.music >> 8, AST module_info.music); 1423 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); 1424 call_6502_init(ast, ast _ module_info.player, 0x02, ast _ module_info.song_pos[song], 0);
1408 break; 1425 break;
1409 case 'r': 1426 case ASAP_TYPE_RMT:
1410 call_6502_init(ast, AST module_info.player, AST module_info.song_pos[song], AST module_info.music, AST module_info.music >> 8); 1427 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; 1428 break;
1412 case 't': 1429 case ASAP_TYPE_TMC:
1413 case 'T': 1430 case ASAP_TYPE_TM2:
1414 call_6502_init(ast, AST module_info.player, 0x70, AST module_info.music >> 8, AST module_info.music); 1431 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); 1432 call_6502_init(ast, ast _ module_info.player, 0x00, song, 0);
1416 AST tmc_per_frame_counter = 1; 1433 ast _ tmc_per_frame_counter = 1;
1417 break; 1434 break;
1435#endif
1418 } 1436 }
1419 ASAP_MutePokeyChannels(ast, 0); 1437 ASAP_MutePokeyChannels(ast, 0);
1420} 1438}
1421 1439
1422ASAP_FUNC void ASAP_MutePokeyChannels(ASAP_State PTR ast, int mask) 1440FUNC(void, ASAP_MutePokeyChannels, (P(ASAP_State PTR, ast), P(int, mask)))
1423{ 1441{
1424 PokeySound_Mute(ast, ADDRESSOF AST base_pokey, mask); 1442 PokeySound_Mute(ast, ADDRESSOF ast _ base_pokey, mask);
1425 PokeySound_Mute(ast, ADDRESSOF AST extra_pokey, mask >> 4); 1443 PokeySound_Mute(ast, ADDRESSOF ast _ extra_pokey, mask >> 4);
1426} 1444}
1427 1445
1428ASAP_FUNC abool call_6502_player(ASAP_State PTR ast) 1446FUNC(abool, call_6502_player, (P(ASAP_State PTR, ast)))
1429{ 1447{
1430 int s; 1448 V(int, player) = ast _ module_info.player;
1431 PokeySound_StartFrame(ast); 1449 PokeySound_StartFrame(ast);
1432 switch (AST module_info.type) { 1450 switch (ast _ module_info.type) {
1433 case 'B': 1451 case ASAP_TYPE_SAP_B:
1434 call_6502(ast, AST module_info.player, AST module_info.fastplay); 1452 call_6502(ast, player, ast _ module_info.fastplay);
1435 break; 1453 break;
1436 case 'C': 1454 case ASAP_TYPE_SAP_C:
1437 case 'c': 1455#ifndef ASAP_ONLY_SAP
1438 case 'z': 1456 case ASAP_TYPE_CMC:
1439 call_6502(ast, AST module_info.player + 6, AST module_info.fastplay); 1457 case ASAP_TYPE_CM3:
1458 case ASAP_TYPE_CMR:
1459 case ASAP_TYPE_CMS:
1460#endif
1461 call_6502(ast, player + 6, ast _ module_info.fastplay);
1440 break; 1462 break;
1441 case 'D': 1463 case ASAP_TYPE_SAP_D:
1442 s = AST cpu_s; 1464 if (player >= 0) {
1465 V(int, s)= ast _ cpu_s;
1443#define PUSH_ON_6502_STACK(x) dPutByte(0x100 + s, x); s = (s - 1) & 0xff 1466#define PUSH_ON_6502_STACK(x) dPutByte(0x100 + s, x); s = (s - 1) & 0xff
1444#define RETURN_FROM_PLAYER_ADDR 0xd200 1467#define RETURN_FROM_PLAYER_ADDR 0xd200
1445 /* save 6502 state on 6502 stack */ 1468 /* save 6502 state on 6502 stack */
1446 PUSH_ON_6502_STACK(AST cpu_pc >> 8); 1469 PUSH_ON_6502_STACK(ast _ cpu_pc >> 8);
1447 PUSH_ON_6502_STACK(AST cpu_pc & 0xff); 1470 PUSH_ON_6502_STACK(ast _ cpu_pc & 0xff);
1448 PUSH_ON_6502_STACK(((AST cpu_nz | (AST cpu_nz >> 1)) & 0x80) + AST cpu_vdi + \ 1471 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); 1472 ((ast _ cpu_nz & 0xff) == 0 ? Z_FLAG : 0) + ast _ cpu_c + 0x20);
1450 PUSH_ON_6502_STACK(AST cpu_a); 1473 PUSH_ON_6502_STACK(ast _ cpu_a);
1451 PUSH_ON_6502_STACK(AST cpu_x); 1474 PUSH_ON_6502_STACK(ast _ cpu_x);
1452 PUSH_ON_6502_STACK(AST cpu_y); 1475 PUSH_ON_6502_STACK(ast _ cpu_y);
1453 /* RTS will jump to 6502 code that restores the state */ 1476 /* RTS will jump to 6502 code that restores the state */
1454 PUSH_ON_6502_STACK((RETURN_FROM_PLAYER_ADDR - 1) >> 8); 1477 PUSH_ON_6502_STACK((RETURN_FROM_PLAYER_ADDR - 1) >> 8);
1455 PUSH_ON_6502_STACK((RETURN_FROM_PLAYER_ADDR - 1) & 0xff); 1478 PUSH_ON_6502_STACK((RETURN_FROM_PLAYER_ADDR - 1) & 0xff);
1456 AST cpu_s = s; 1479 ast _ cpu_s = s;
1457 dPutByte(RETURN_FROM_PLAYER_ADDR, 0x68); /* PLA */ 1480 dPutByte(RETURN_FROM_PLAYER_ADDR, 0x68); /* PLA */
1458 dPutByte(RETURN_FROM_PLAYER_ADDR + 1, 0xa8); /* TAY */ 1481 dPutByte(RETURN_FROM_PLAYER_ADDR + 1, 0xa8); /* TAY */
1459 dPutByte(RETURN_FROM_PLAYER_ADDR + 2, 0x68); /* PLA */ 1482 dPutByte(RETURN_FROM_PLAYER_ADDR + 2, 0x68); /* PLA */
1460 dPutByte(RETURN_FROM_PLAYER_ADDR + 3, 0xaa); /* TAX */ 1483 dPutByte(RETURN_FROM_PLAYER_ADDR + 3, 0xaa); /* TAX */
1461 dPutByte(RETURN_FROM_PLAYER_ADDR + 4, 0x68); /* PLA */ 1484 dPutByte(RETURN_FROM_PLAYER_ADDR + 4, 0x68); /* PLA */
1462 dPutByte(RETURN_FROM_PLAYER_ADDR + 5, 0x40); /* RTI */ 1485 dPutByte(RETURN_FROM_PLAYER_ADDR + 5, 0x40); /* RTI */
1463 AST cpu_pc = AST module_info.player; 1486 ast _ cpu_pc = player;
1464 Cpu_RunScanlines(ast, AST module_info.fastplay); 1487 }
1488 Cpu_RunScanlines(ast, ast _ module_info.fastplay);
1465 break; 1489 break;
1466 case 'S': 1490 case ASAP_TYPE_SAP_S:
1467 Cpu_RunScanlines(ast, AST module_info.fastplay); 1491 Cpu_RunScanlines(ast, ast _ module_info.fastplay);
1468 { 1492 {
1469 int i = dGetByte(0x45) - 1; 1493 V(int, i) = dGetByte(0x45) - 1;
1470 dPutByte(0x45, i); 1494 dPutByte(0x45, i);
1471 if (i == 0) 1495 if (i == 0)
1472 dPutByte(0xb07b, dGetByte(0xb07b) + 1); 1496 dPutByte(0xb07b, dGetByte(0xb07b) + 1);
1473 } 1497 }
1474 break; 1498 break;
1475 case 'm': 1499#ifndef ASAP_ONLY_SAP
1476 case 'r': 1500 case ASAP_TYPE_DLT:
1477 case 'T': 1501 call_6502(ast, player + 0x103, ast _ module_info.fastplay);
1478 call_6502(ast, AST module_info.player + 3, AST module_info.fastplay);
1479 break; 1502 break;
1480 case 't': 1503 case ASAP_TYPE_MPT:
1481 if (--AST tmc_per_frame_counter <= 0) { 1504 case ASAP_TYPE_RMT:
1482 AST tmc_per_frame_counter = AST tmc_per_frame; 1505 case ASAP_TYPE_TM2:
1483 call_6502(ast, AST module_info.player + 3, AST module_info.fastplay); 1506 call_6502(ast, player + 3, ast _ module_info.fastplay);
1507 break;
1508 case ASAP_TYPE_TMC:
1509 if (--ast _ tmc_per_frame_counter <= 0) {
1510 ast _ tmc_per_frame_counter = ast _ tmc_per_frame;
1511 call_6502(ast, player + 3, ast _ module_info.fastplay);
1484 } 1512 }
1485 else 1513 else
1486 call_6502(ast, AST module_info.player + 6, AST module_info.fastplay); 1514 call_6502(ast, player + 6, ast _ module_info.fastplay);
1487 break; 1515 break;
1516#endif
1488 } 1517 }
1489 PokeySound_EndFrame(ast, AST module_info.fastplay * 114); 1518 PokeySound_EndFrame(ast, ast _ module_info.fastplay * 114);
1490 if (AST silence_cycles > 0) { 1519 if (ast _ silence_cycles > 0) {
1491 if (PokeySound_IsSilent(ADDRESSOF AST base_pokey) 1520 if (PokeySound_IsSilent(ADDRESSOF ast _ base_pokey)
1492 && PokeySound_IsSilent(ADDRESSOF AST extra_pokey)) { 1521 && PokeySound_IsSilent(ADDRESSOF ast _ extra_pokey)) {
1493 AST silence_cycles_counter -= AST module_info.fastplay * 114; 1522 ast _ silence_cycles_counter -= ast _ module_info.fastplay * 114;
1494 if (AST silence_cycles_counter <= 0) 1523 if (ast _ silence_cycles_counter <= 0)
1495 return FALSE; 1524 return FALSE;
1496 } 1525 }
1497 else 1526 else
1498 AST silence_cycles_counter = AST silence_cycles; 1527 ast _ silence_cycles_counter = ast _ silence_cycles;
1499 } 1528 }
1500 return TRUE; 1529 return TRUE;
1501} 1530}
1502 1531
1503FILE_FUNC int milliseconds_to_blocks(int milliseconds) 1532FUNC(int, ASAP_GetPosition, (P(CONST ASAP_State PTR, ast)))
1533{
1534 return ast _ blocks_played * 10 / (ASAP_SAMPLE_RATE / 100);
1535}
1536
1537FUNC(int, milliseconds_to_blocks, (P(int, milliseconds)))
1504{ 1538{
1505 return milliseconds * (ASAP_SAMPLE_RATE / 100) / 10; 1539 return milliseconds * (ASAP_SAMPLE_RATE / 100) / 10;
1506} 1540}
1507 1541
1508ASAP_FUNC void ASAP_Seek(ASAP_State PTR ast, int position) 1542#ifndef ACTIONSCRIPT
1543
1544FUNC(void, ASAP_Seek, (P(ASAP_State PTR, ast), P(int, position)))
1509{ 1545{
1510 int block = milliseconds_to_blocks(position); 1546 V(int, block) = milliseconds_to_blocks(position);
1511 if (block < AST blocks_played) 1547 if (block < ast _ blocks_played)
1512 ASAP_PlaySong(ast, AST current_song, AST current_duration); 1548 ASAP_PlaySong(ast, ast _ current_song, ast _ current_duration);
1513 while (AST blocks_played + AST samples - AST sample_index < block) { 1549 while (ast _ blocks_played + ast _ samples - ast _ sample_index < block) {
1514 AST blocks_played += AST samples - AST sample_index; 1550 ast _ blocks_played += ast _ samples - ast _ sample_index;
1515 call_6502_player(ast); 1551 call_6502_player(ast);
1516 } 1552 }
1517 AST sample_index += block - AST blocks_played; 1553 ast _ sample_index += block - ast _ blocks_played;
1518 AST blocks_played = block; 1554 ast _ blocks_played = block;
1555}
1556
1557PRIVATE FUNC(void, serialize_int, (P(BYTEARRAY, buffer), P(int, offset), P(int, value)))
1558{
1559 buffer[offset] = TO_BYTE(value);
1560 buffer[offset + 1] = TO_BYTE(value >> 8);
1561 buffer[offset + 2] = TO_BYTE(value >> 16);
1562 buffer[offset + 3] = TO_BYTE(value >> 24);
1563}
1564
1565FUNC(void, ASAP_GetWavHeaderForPart, (
1566 P(CONST ASAP_State PTR, ast), P(BYTEARRAY, buffer),
1567 P(ASAP_SampleFormat, format), P(int, blocks)))
1568{
1569 V(int, use_16bit) = format != ASAP_FORMAT_U8 ? 1 : 0;
1570 V(int, block_size) = ast _ module_info.channels << use_16bit;
1571 V(int, bytes_per_second) = ASAP_SAMPLE_RATE * block_size;
1572 V(int, remaining_blocks) = milliseconds_to_blocks(ast _ current_duration) - ast _ blocks_played;
1573 V(int, n_bytes);
1574 if (blocks > remaining_blocks)
1575 blocks = remaining_blocks;
1576 n_bytes = blocks * block_size;
1577 buffer[0] = CAST(byte) CHARCODE('R');
1578 buffer[1] = CAST(byte) CHARCODE('I');
1579 buffer[2] = CAST(byte) CHARCODE('F');
1580 buffer[3] = CAST(byte) CHARCODE('F');
1581 serialize_int(buffer, 4, n_bytes + 36);
1582 buffer[8] = CAST(byte) CHARCODE('W');
1583 buffer[9] = CAST(byte) CHARCODE('A');
1584 buffer[10] = CAST(byte) CHARCODE('V');
1585 buffer[11] = CAST(byte) CHARCODE('E');
1586 buffer[12] = CAST(byte) CHARCODE('f');
1587 buffer[13] = CAST(byte) CHARCODE('m');
1588 buffer[14] = CAST(byte) CHARCODE('t');
1589 buffer[15] = CAST(byte) CHARCODE(' ');
1590 buffer[16] = 16;
1591 buffer[17] = 0;
1592 buffer[18] = 0;
1593 buffer[19] = 0;
1594 buffer[20] = 1;
1595 buffer[21] = 0;
1596 buffer[22] = CAST(byte) ast _ module_info.channels;
1597 buffer[23] = 0;
1598 serialize_int(buffer, 24, ASAP_SAMPLE_RATE);
1599 serialize_int(buffer, 28, bytes_per_second);
1600 buffer[32] = CAST(byte) block_size;
1601 buffer[33] = 0;
1602 buffer[34] = CAST(byte) (8 << use_16bit);
1603 buffer[35] = 0;
1604 buffer[36] = CAST(byte) CHARCODE('d');
1605 buffer[37] = CAST(byte) CHARCODE('a');
1606 buffer[38] = CAST(byte) CHARCODE('t');
1607 buffer[39] = CAST(byte) CHARCODE('a');
1608 serialize_int(buffer, 40, n_bytes);
1609}
1610
1611FUNC(void, ASAP_GetWavHeader, (
1612 P(CONST ASAP_State PTR, ast), P(BYTEARRAY, buffer), P(ASAP_SampleFormat, format)))
1613{
1614 V(int, remaining_blocks) = milliseconds_to_blocks(ast _ current_duration) - ast _ blocks_played;
1615 ASAP_GetWavHeaderForPart(ast, buffer, format, remaining_blocks);
1519} 1616}
1520 1617
1521ASAP_FUNC int ASAP_Generate(ASAP_State PTR ast, VOIDPTR buffer, int buffer_len, 1618#endif /* ACTIONSCRIPT */
1522 ASAP_SampleFormat format) 1619
1620PRIVATE FUNC(int, ASAP_GenerateAt, (P(ASAP_State PTR, ast), P(VOIDPTR, buffer), P(int, buffer_offset), P(int, buffer_len), P(ASAP_SampleFormat, format)))
1523{ 1621{
1524 int block_shift; 1622 V(int, block_shift);
1525 int buffer_blocks; 1623 V(int, buffer_blocks);
1526 int block; 1624 V(int, block);
1527 if (AST silence_cycles > 0 && AST silence_cycles_counter <= 0) 1625 if (ast _ silence_cycles > 0 && ast _ silence_cycles_counter <= 0)
1528 return 0; 1626 return 0;
1529 block_shift = (AST module_info.channels - 1) + (format != ASAP_FORMAT_U8 ? 1 : 0); 1627#ifdef ACTIONSCRIPT
1628 block_shift = 0;
1629#else
1630 block_shift = (ast _ module_info.channels - 1) + (format != ASAP_FORMAT_U8 ? 1 : 0);
1631#endif
1530 buffer_blocks = buffer_len >> block_shift; 1632 buffer_blocks = buffer_len >> block_shift;
1531 if (AST current_duration > 0) { 1633 if (ast _ current_duration > 0) {
1532 int total_blocks = milliseconds_to_blocks(AST current_duration); 1634 V(int, total_blocks) = milliseconds_to_blocks(ast _ current_duration);
1533 if (buffer_blocks > total_blocks - AST blocks_played) 1635 if (buffer_blocks > total_blocks - ast _ blocks_played)
1534 buffer_blocks = total_blocks - AST blocks_played; 1636 buffer_blocks = total_blocks - ast _ blocks_played;
1535 } 1637 }
1536 block = 0; 1638 block = 0;
1537 do { 1639 do {
1538 int blocks = PokeySound_Generate(ast, buffer, block << block_shift, buffer_blocks - block, format); 1640 V(int, blocks) = PokeySound_Generate(ast, CAST(BYTEARRAY) buffer,
1539 AST blocks_played += blocks; 1641 buffer_offset + (block << block_shift), buffer_blocks - block, format);
1642 ast _ blocks_played += blocks;
1540 block += blocks; 1643 block += blocks;
1541 } while (block < buffer_blocks && call_6502_player(ast)); 1644 } while (block < buffer_blocks && call_6502_player(ast));
1542 return block << block_shift; 1645 return block << block_shift;
1543} 1646}
1544 1647
1545#if !defined(JAVA) && !defined(CSHARP) 1648FUNC(int, ASAP_Generate, (P(ASAP_State PTR, ast), P(VOIDPTR, buffer), P(int, buffer_len), P(ASAP_SampleFormat, format)))
1649{
1650 return ASAP_GenerateAt(ast, buffer, 0, buffer_len, format);
1651}
1652
1653#if defined(C) && !defined(ASAP_ONLY_SAP)
1546 1654
1547abool ASAP_ChangeExt(char *filename, const char *ext) 1655abool ASAP_ChangeExt(char *filename, const char *ext)
1548{ 1656{
@@ -1586,7 +1694,6 @@ static byte *put_dec(byte *dest, int value)
1586static byte *put_text_tag(byte *dest, const char *tag, const char *value) 1694static byte *put_text_tag(byte *dest, const char *tag, const char *value)
1587{ 1695{
1588 dest = put_string(dest, tag); 1696 dest = put_string(dest, tag);
1589 *dest++ = ' ';
1590 *dest++ = '"'; 1697 *dest++ = '"';
1591 if (*value == '\0') 1698 if (*value == '\0')
1592 value = "<?>"; 1699 value = "<?>";
@@ -1601,13 +1708,21 @@ static byte *put_text_tag(byte *dest, const char *tag, const char *value)
1601 return dest; 1708 return dest;
1602} 1709}
1603 1710
1711static byte *put_dec_tag(byte *dest, const char *tag, int value)
1712{
1713 dest = put_string(dest, tag);
1714 dest = put_dec(dest, value);
1715 *dest++ = '\r';
1716 *dest++ = '\n';
1717 return dest;
1718}
1719
1604static byte *put_hex_tag(byte *dest, const char *tag, int value) 1720static byte *put_hex_tag(byte *dest, const char *tag, int value)
1605{ 1721{
1606 int i; 1722 int i;
1607 if (value < 0) 1723 if (value < 0)
1608 return dest; 1724 return dest;
1609 dest = put_string(dest, tag); 1725 dest = put_string(dest, tag);
1610 *dest++ = ' ';
1611 for (i = 12; i >= 0; i -= 4) { 1726 for (i = 12; i >= 0; i -= 4) {
1612 int digit = (value >> i) & 0xf; 1727 int digit = (value >> i) & 0xf;
1613 *dest++ = (byte) (digit + (digit < 10 ? '0' : 'A' - 10)); 1728 *dest++ = (byte) (digit + (digit < 10 ? '0' : 'A' - 10));
@@ -1617,38 +1732,54 @@ static byte *put_hex_tag(byte *dest, const char *tag, int value)
1617 return dest; 1732 return dest;
1618} 1733}
1619 1734
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) 1735static byte *start_sap_header(byte *dest, const ASAP_ModuleInfo *module_info)
1631{ 1736{
1632 dest = put_string(dest, "SAP\r\n"); 1737 dest = put_string(dest, "SAP\r\n");
1633 dest = put_text_tag(dest, "AUTHOR", module_info->author); 1738 dest = put_text_tag(dest, "AUTHOR ", module_info->author);
1634 if (dest == NULL) 1739 if (dest == NULL)
1635 return NULL; 1740 return NULL;
1636 dest = put_text_tag(dest, "NAME", module_info->name); 1741 dest = put_text_tag(dest, "NAME ", module_info->name);
1637 if (dest == NULL) 1742 if (dest == NULL)
1638 return NULL; 1743 return NULL;
1639 dest = put_text_tag(dest, "DATE", module_info->date); 1744 dest = put_text_tag(dest, "DATE ", module_info->date);
1640 if (dest == NULL) 1745 if (dest == NULL)
1641 return NULL; 1746 return NULL;
1642 if (module_info->songs > 1) { 1747 if (module_info->songs > 1) {
1643 dest = put_dec_tag(dest, "SONGS", module_info->songs); 1748 dest = put_dec_tag(dest, "SONGS ", module_info->songs);
1644 if (module_info->default_song > 0) 1749 if (module_info->default_song > 0)
1645 dest = put_dec_tag(dest, "DEFSONG", module_info->default_song); 1750 dest = put_dec_tag(dest, "DEFSONG ", module_info->default_song);
1646 } 1751 }
1647 if (module_info->channels > 1) 1752 if (module_info->channels > 1)
1648 dest = put_string(dest, "STEREO\r\n"); 1753 dest = put_string(dest, "STEREO\r\n");
1649 return dest; 1754 return dest;
1650} 1755}
1651 1756
1757static char *two_digits(char *s, int x)
1758{
1759 s[0] = '0' + x / 10;
1760 s[1] = '0' + x % 10;
1761 return s + 2;
1762}
1763
1764void ASAP_DurationToString(char *s, int duration)
1765{
1766 if (duration >= 0 && duration < 100 * 60 * 1000) {
1767 int seconds = duration / 1000;
1768 s = two_digits(s, seconds / 60);
1769 *s++ = ':';
1770 s = two_digits(s, seconds % 60);
1771 duration %= 1000;
1772 if (duration != 0) {
1773 *s++ = '.';
1774 s = two_digits(s, duration / 10);
1775 duration %= 10;
1776 if (duration != 0)
1777 *s++ = '0' + duration;
1778 }
1779 }
1780 *s = '\0';
1781}
1782
1652static byte *put_durations(byte *dest, const ASAP_ModuleInfo *module_info) 1783static byte *put_durations(byte *dest, const ASAP_ModuleInfo *module_info)
1653{ 1784{
1654 int song; 1785 int song;
@@ -1677,16 +1808,15 @@ static byte *put_sap_header(byte *dest, const ASAP_ModuleInfo *module_info, char
1677 *dest++ = '\r'; 1808 *dest++ = '\r';
1678 *dest++ = '\n'; 1809 *dest++ = '\n';
1679 if (module_info->fastplay != 312) 1810 if (module_info->fastplay != 312)
1680 dest = put_dec_tag(dest, "FASTPLAY", module_info->fastplay); 1811 dest = put_dec_tag(dest, "FASTPLAY ", module_info->fastplay);
1681 dest = put_hex_tag(dest, "MUSIC", music); 1812 dest = put_hex_tag(dest, "MUSIC ", music);
1682 dest = put_hex_tag(dest, "INIT", init); 1813 dest = put_hex_tag(dest, "INIT ", init);
1683 dest = put_hex_tag(dest, "PLAYER", player); 1814 dest = put_hex_tag(dest, "PLAYER ", player);
1684 dest = put_durations(dest, module_info); 1815 dest = put_durations(dest, module_info);
1685 return dest; 1816 return dest;
1686} 1817}
1687 1818
1688int ASAP_SetModuleInfo(const ASAP_ModuleInfo *module_info, const byte ARRAY module, 1819int ASAP_SetModuleInfo(const ASAP_ModuleInfo *module_info, const BYTEARRAY module, int module_len, BYTEARRAY out_module)
1689 int module_len, byte ARRAY out_module)
1690{ 1820{
1691 byte *dest; 1821 byte *dest;
1692 int i; 1822 int i;
@@ -1702,7 +1832,7 @@ int ASAP_SetModuleInfo(const ASAP_ModuleInfo *module_info, const byte ARRAY modu
1702 || memcmp(module + i, "DATE ", 5) == 0 1832 || memcmp(module + i, "DATE ", 5) == 0
1703 || memcmp(module + i, "SONGS ", 6) == 0 1833 || memcmp(module + i, "SONGS ", 6) == 0
1704 || memcmp(module + i, "DEFSONG ", 8) == 0 1834 || memcmp(module + i, "DEFSONG ", 8) == 0
1705 || memcmp(module + i, "STEREO", 6) == 0 1835 || memcmp(module + i, "STEREO\r", 7) == 0
1706 || memcmp(module + i, "TIME ", 5) == 0) { 1836 || memcmp(module + i, "TIME ", 5) == 0) {
1707 while (i < module_len && module[i++] != 0x0a); 1837 while (i < module_len && module[i++] != 0x0a);
1708 } 1838 }
@@ -1724,12 +1854,15 @@ int ASAP_SetModuleInfo(const ASAP_ModuleInfo *module_info, const byte ARRAY modu
1724#define RMT_INIT 0x0c80 1854#define RMT_INIT 0x0c80
1725#define TM2_INIT 0x1080 1855#define TM2_INIT 0x1080
1726 1856
1727const char *ASAP_CanConvert(const char *filename, const ASAP_ModuleInfo *module_info, 1857const char *ASAP_CanConvert(
1728 const byte ARRAY module, int module_len) 1858 const char *filename, const ASAP_ModuleInfo *module_info,
1859 const BYTEARRAY module, int module_len)
1729{ 1860{
1730 (void)filename; 1861 (void) filename;
1731 switch (module_info->type) { 1862 switch (module_info->type) {
1732 case 'B': 1863 case ASAP_TYPE_SAP_B:
1864 if ((module_info->init == 0x3fb || module_info->init == 0x3f9) && module_info->player == 0x503)
1865 return "dlt";
1733 if (module_info->init == 0x4f3 || module_info->init == 0xf4f3 || module_info->init == 0x4ef) 1866 if (module_info->init == 0x4f3 || module_info->init == 0xf4f3 || module_info->init == 0x4ef)
1734 return module_info->fastplay == 156 ? "mpd" : "mpt"; 1867 return module_info->fastplay == 156 ? "mpd" : "mpt";
1735 if (module_info->init == RMT_INIT) 1868 if (module_info->init == RMT_INIT)
@@ -1741,19 +1874,28 @@ const char *ASAP_CanConvert(const char *filename, const ASAP_ModuleInfo *module_
1741 if (module_info->init == TM2_INIT) 1874 if (module_info->init == TM2_INIT)
1742 return "tm2"; 1875 return "tm2";
1743 break; 1876 break;
1744 case 'C': 1877 case ASAP_TYPE_SAP_C:
1745 if (module_info->player == 0x500 || module_info->player == 0xf500) { 1878 if (module_info->player == 0x500 || module_info->player == 0xf500) {
1746 if (module_info->fastplay == 156) 1879 if (module_info->fastplay == 156)
1747 return "dmc"; 1880 return "dmc";
1748 return module[module_len - 170] == 0x1e ? "cmr" : "cmc"; 1881 if (module_info->channels > 1)
1882 return "cms";
1883 if (module[module_len - 170] == 0x1e)
1884 return "cmr";
1885 if (module[module_len - 909] == 0x30)
1886 return "cm3";
1887 return "cmc";
1749 } 1888 }
1750 break; 1889 break;
1751 case 'c': 1890 case ASAP_TYPE_CMC:
1752 case 'z': 1891 case ASAP_TYPE_CM3:
1753 case 'm': 1892 case ASAP_TYPE_CMR:
1754 case 'r': 1893 case ASAP_TYPE_CMS:
1755 case 't': 1894 case ASAP_TYPE_DLT:
1756 case 'T': 1895 case ASAP_TYPE_MPT:
1896 case ASAP_TYPE_RMT:
1897 case ASAP_TYPE_TMC:
1898 case ASAP_TYPE_TM2:
1757 return "sap"; 1899 return "sap";
1758 default: 1900 default:
1759 break; 1901 break;
@@ -1761,8 +1903,9 @@ const char *ASAP_CanConvert(const char *filename, const ASAP_ModuleInfo *module_
1761 return NULL; 1903 return NULL;
1762} 1904}
1763 1905
1764int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info, 1906int ASAP_Convert(
1765 const byte ARRAY module, int module_len, byte ARRAY out_module) 1907 const char *filename, const ASAP_ModuleInfo *module_info,
1908 const BYTEARRAY module, int module_len, BYTEARRAY out_module)
1766{ 1909{
1767 (void) filename; 1910 (void) filename;
1768 int out_len; 1911 int out_len;
@@ -1772,27 +1915,80 @@ int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
1772 static const int tmc_player[4] = { 3, -9, -10, -10 }; 1915 static const int tmc_player[4] = { 3, -9, -10, -10 };
1773 static const int tmc_init[4] = { -14, -16, -17, -17 }; 1916 static const int tmc_init[4] = { -14, -16, -17, -17 };
1774 switch (module_info->type) { 1917 switch (module_info->type) {
1775 case 'B': 1918 case ASAP_TYPE_SAP_B:
1776 case 'C': 1919 case ASAP_TYPE_SAP_C:
1777 out_len = module[module_info->header_len + 4] + (module[module_info->header_len + 5] << 8) 1920 out_len = UWORD(module, module_info->header_len + 4) - UWORD(module, module_info->header_len + 2) + 7;
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) 1921 if (out_len < 7 || module_info->header_len + out_len >= module_len)
1780 return -1; 1922 return -1;
1781 memcpy(out_module, module + module_info->header_len, out_len); 1923 memcpy(out_module, module + module_info->header_len, out_len);
1782 return out_len; 1924 return out_len;
1783 case 'c': 1925 case ASAP_TYPE_CMC:
1784 case 'z': 1926 case ASAP_TYPE_CM3:
1927 case ASAP_TYPE_CMR:
1928 case ASAP_TYPE_CMS:
1785 dest = put_sap_header(out_module, module_info, 'C', module_info->music, -1, module_info->player); 1929 dest = put_sap_header(out_module, module_info, 'C', module_info->music, -1, module_info->player);
1786 if (dest == NULL) 1930 if (dest == NULL)
1787 return -1; 1931 return -1;
1788 memcpy(dest, module, module_len); 1932 memcpy(dest, module, module_len);
1933 dest[0] = 0xff; /* some modules start with zeros */
1934 dest[1] = 0xff;
1789 dest += module_len; 1935 dest += module_len;
1790 memcpy(dest, cmc_obx + 2, sizeof(cmc_obx) - 2); 1936 if (module_info->type == ASAP_TYPE_CM3) {
1791 if (module_info->type == 'z') 1937 memcpy(dest, cm3_obx + 2, sizeof(cm3_obx) - 2);
1792 memcpy(dest + 4 + CMR_BASS_TABLE_OFFSET, cmr_bass_table, sizeof(cmr_bass_table)); 1938 dest += sizeof(cm3_obx) - 2;
1793 dest += sizeof(cmc_obx) - 2; 1939 }
1940 else if (module_info->type == ASAP_TYPE_CMS) {
1941 memcpy(dest, cms_obx + 2, sizeof(cms_obx) - 2);
1942 dest += sizeof(cms_obx) - 2;
1943 }
1944 else {
1945 memcpy(dest, cmc_obx + 2, sizeof(cmc_obx) - 2);
1946 if (module_info->type == ASAP_TYPE_CMR)
1947 memcpy(dest + 4 + CMR_BASS_TABLE_OFFSET, cmr_bass_table, sizeof(cmr_bass_table));
1948 dest += sizeof(cmc_obx) - 2;
1949 }
1950 return dest - out_module;
1951 case ASAP_TYPE_DLT:
1952 if (module_info->songs != 1) {
1953 addr = module_info->player - 7 - module_info->songs;
1954 dest = put_sap_header(out_module, module_info, 'B', -1, module_info->player - 7, module_info->player + 0x103);
1955 }
1956 else {
1957 addr = module_info->player - 5;
1958 dest = put_sap_header(out_module, module_info, 'B', -1, addr, module_info->player + 0x103);
1959 }
1960 if (dest == NULL)
1961 return -1;
1962 memcpy(dest, module, module_len);
1963 if (module_len == 0x2c06) {
1964 dest[4] = 0;
1965 dest[5] = 0x4c;
1966 dest[0x2c06] = 0;
1967 }
1968 dest += 0x2c07;
1969 *dest++ = (byte) addr;
1970 *dest++ = (byte) (addr >> 8);
1971 *dest++ = dlt_obx[4];
1972 *dest++ = dlt_obx[5];
1973 if (module_info->songs != 1) {
1974 memcpy(dest, module_info->song_pos, module_info->songs);
1975 dest += module_info->songs;
1976 *dest++ = 0xaa; /* tax */
1977 *dest++ = 0xbc; /* ldy song2pos,x */
1978 *dest++ = (byte) addr;
1979 *dest++ = (byte) (addr >> 8);
1980 }
1981 else {
1982 *dest++ = 0xa0; /* ldy #0 */
1983 *dest++ = 0;
1984 }
1985 *dest++ = 0x4c; /* jmp init */
1986 *dest++ = (byte) module_info->player;
1987 *dest++ = (byte) ((module_info->player >> 8) + 1);
1988 memcpy(dest, dlt_obx + 6, sizeof(dlt_obx) - 6);
1989 dest += sizeof(dlt_obx) - 6;
1794 return dest - out_module; 1990 return dest - out_module;
1795 case 'm': 1991 case ASAP_TYPE_MPT:
1796 if (module_info->songs != 1) { 1992 if (module_info->songs != 1) {
1797 addr = module_info->player - 17 - module_info->songs; 1993 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); 1994 dest = put_sap_header(out_module, module_info, 'B', -1, module_info->player - 17, module_info->player + 3);
@@ -1839,7 +2035,7 @@ int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
1839 memcpy(dest, mpt_obx + 6, sizeof(mpt_obx) - 6); 2035 memcpy(dest, mpt_obx + 6, sizeof(mpt_obx) - 6);
1840 dest += sizeof(mpt_obx) - 6; 2036 dest += sizeof(mpt_obx) - 6;
1841 return dest - out_module; 2037 return dest - out_module;
1842 case 'r': 2038 case ASAP_TYPE_RMT:
1843 dest = put_sap_header(out_module, module_info, 'B', -1, RMT_INIT, module_info->player + 3); 2039 dest = put_sap_header(out_module, module_info, 'B', -1, RMT_INIT, module_info->player + 3);
1844 if (dest == NULL) 2040 if (dest == NULL)
1845 return -1; 2041 return -1;
@@ -1882,7 +2078,7 @@ int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
1882 dest += sizeof(rmt8_obx) - 2; 2078 dest += sizeof(rmt8_obx) - 2;
1883 } 2079 }
1884 return dest - out_module; 2080 return dest - out_module;
1885 case 't': 2081 case ASAP_TYPE_TMC:
1886 player = module_info->player + tmc_player[module[0x25] - 1]; 2082 player = module_info->player + tmc_player[module[0x25] - 1];
1887 addr = player + tmc_init[module[0x25] - 1]; 2083 addr = player + tmc_init[module[0x25] - 1];
1888 if (module_info->songs != 1) 2084 if (module_info->songs != 1)
@@ -1959,7 +2155,7 @@ int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
1959 memcpy(dest, tmc_obx + 6, sizeof(tmc_obx) - 6); 2155 memcpy(dest, tmc_obx + 6, sizeof(tmc_obx) - 6);
1960 dest += sizeof(tmc_obx) - 6; 2156 dest += sizeof(tmc_obx) - 6;
1961 return dest - out_module; 2157 return dest - out_module;
1962 case 'T': 2158 case ASAP_TYPE_TM2:
1963 dest = put_sap_header(out_module, module_info, 'B', -1, TM2_INIT, module_info->player + 3); 2159 dest = put_sap_header(out_module, module_info, 'B', -1, TM2_INIT, module_info->player + 3);
1964 if (dest == NULL) 2160 if (dest == NULL)
1965 return -1; 2161 return -1;
@@ -2007,4 +2203,4 @@ int ASAP_Convert(const char *filename, const ASAP_ModuleInfo *module_info,
2007 } 2203 }
2008} 2204}
2009 2205
2010#endif /* !defined(JAVA) && !defined(CSHARP) */ 2206#endif /* defined(C) && !defined(ASAP_ONLY_SAP) */
diff --git a/apps/codecs/libasap/asap.h b/apps/codecs/libasap/asap.h
index 783d628019..02f6e680f2 100644
--- a/apps/codecs/libasap/asap.h
+++ b/apps/codecs/libasap/asap.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * asap.h - public interface of the ASAP engine 2 * asap.h - public interface of ASAP
3 * 3 *
4 * Copyright (C) 2005-2008 Piotr Fusik 4 * Copyright (C) 2005-2010 Piotr Fusik
5 * 5 *
6 * This file is part of ASAP (Another Slight Atari Player), 6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net 7 * see http://asap.sourceforge.net
@@ -29,17 +29,19 @@ extern "C" {
29#endif 29#endif
30 30
31/* ASAP version. */ 31/* ASAP version. */
32#define ASAP_VERSION_MAJOR 1 32#define ASAP_VERSION_MAJOR 2
33#define ASAP_VERSION_MINOR 2 33#define ASAP_VERSION_MINOR 1
34#define ASAP_VERSION_MICRO 0 34#define ASAP_VERSION_MICRO 0
35#define ASAP_VERSION "1.2.0" 35#define ASAP_VERSION "2.1.0"
36 36
37/* Short credits of the ASAP engine. */ 37/* Short credits of the ASAP engine. */
38#define ASAP_YEARS "2005-2008" 38#define ASAP_YEARS "2005-2010"
39#define ASAP_CREDITS \ 39#define ASAP_CREDITS \
40 "Another Slight Atari Player (C) 2005-2008 Piotr Fusik\n" \ 40 "Another Slight Atari Player (C) 2005-2010 Piotr Fusik\n" \
41 "CMC, MPT, TMC players (C) 1994-2005 Marcin Lewandowski\n" \ 41 "CMC, MPT, TMC, TM2 players (C) 1994-2005 Marcin Lewandowski\n" \
42 "RMT player (C) 2002-2005 Radek Sterba\n" 42 "RMT player (C) 2002-2005 Radek Sterba\n" \
43 "DLT player (C) 2009 Marek Konopka\n" \
44 "CMS player (C) 1999 David Spilka\n"
43 45
44/* Short GPL notice. 46/* Short GPL notice.
45 Display after the credits. */ 47 Display after the credits. */
@@ -49,6 +51,32 @@ extern "C" {
49 "by the Free Software Foundation; either version 2 of the License,\n" \ 51 "by the Free Software Foundation; either version 2 of the License,\n" \
50 "or (at your option) any later version." 52 "or (at your option) any later version."
51 53
54/* Maximum length of AUTHOR, NAME and DATE tags including the terminator. */
55#define ASAP_INFO_CHARS 128
56
57/* Maximum length of a "mm:ss.xxx" string including the terminator. */
58#define ASAP_DURATION_CHARS 10
59
60/* Maximum length of a supported input file.
61 You can assume that files longer than this are not supported by ASAP. */
62#define ASAP_MODULE_MAX 65000
63
64/* Maximum number of songs in a file. */
65#define ASAP_SONGS_MAX 32
66
67/* Output sample rate. */
68#define ASAP_SAMPLE_RATE 44100
69
70/* WAV file header length. */
71#define ASAP_WAV_HEADER_BYTES 44
72
73/* Output formats. */
74typedef enum {
75 ASAP_FORMAT_U8 = 8, /* unsigned char */
76 ASAP_FORMAT_S16_LE = 16, /* signed short, little-endian */
77 ASAP_FORMAT_S16_BE = -16 /* signed short, big-endian */
78} ASAP_SampleFormat;
79
52/* Useful type definitions. */ 80/* Useful type definitions. */
53#ifndef FALSE 81#ifndef FALSE
54#define FALSE 0 82#define FALSE 0
@@ -59,24 +87,25 @@ extern "C" {
59typedef int abool; 87typedef int abool;
60typedef unsigned char byte; 88typedef unsigned char byte;
61 89
62/* Information about a file. */ 90/* Information about a music file. */
63typedef struct { 91typedef struct {
64 char author[128]; /* author's name */ 92 char author[ASAP_INFO_CHARS]; /* author's name */
65 char name[128]; /* title */ 93 char name[ASAP_INFO_CHARS]; /* title */
66 char date[128]; /* creation date */ 94 char date[ASAP_INFO_CHARS]; /* creation date */
67 int channels; /* 1 for mono or 2 for stereo */ 95 int channels; /* 1 for mono or 2 for stereo */
68 int songs; /* number of subsongs */ 96 int songs; /* number of subsongs */
69 int default_song; /* 0-based index of the "main" subsong */ 97 int default_song; /* 0-based index of the "main" subsong */
70 int durations[32]; /* lengths of songs, in milliseconds, -1 = unspecified */ 98 int durations[ASAP_SONGS_MAX]; /* lengths of songs, in milliseconds, -1 = indeterminate */
71 abool loops[32]; /* whether songs repeat or not */ 99 abool loops[ASAP_SONGS_MAX]; /* whether songs repeat or not */
72 /* the following technical information should not be used outside ASAP. */ 100 /* the following technical information should not be used outside ASAP. */
73 char type; 101 int type;
74 int fastplay; 102 int fastplay;
75 int music; 103 int music;
76 int init; 104 int init;
77 int player; 105 int player;
106 int covox_addr;
78 int header_len; 107 int header_len;
79 byte song_pos[128]; 108 byte song_pos[ASAP_SONGS_MAX];
80} ASAP_ModuleInfo; 109} ASAP_ModuleInfo;
81 110
82/* POKEY state. 111/* POKEY state.
@@ -117,7 +146,7 @@ typedef struct {
117 int delta3; 146 int delta3;
118 int delta4; 147 int delta4;
119 int skctl; 148 int skctl;
120 signed char delta_buffer[888]; 149 int delta_buffer[888];
121} PokeyState; 150} PokeyState;
122 151
123/* Player state. 152/* Player state.
@@ -140,6 +169,8 @@ typedef struct {
140 int timer4_cycle; 169 int timer4_cycle;
141 int irqst; 170 int irqst;
142 int extra_pokey_mask; 171 int extra_pokey_mask;
172 int consol;
173 byte covox[4];
143 PokeyState base_pokey; 174 PokeyState base_pokey;
144 PokeyState extra_pokey; 175 PokeyState extra_pokey;
145 int sample_offset; 176 int sample_offset;
@@ -160,23 +191,6 @@ typedef struct {
160 byte memory[65536]; 191 byte memory[65536];
161} ASAP_State; 192} ASAP_State;
162 193
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 194/* Parses the string in the "mm:ss.xxx" format
181 and returns the number of milliseconds or -1 if an error occurs. */ 195 and returns the number of milliseconds or -1 if an error occurs. */
182int ASAP_ParseDuration(const char *s); 196int ASAP_ParseDuration(const char *s);
@@ -203,7 +217,7 @@ abool ASAP_GetModuleInfo(ASAP_ModuleInfo *module_info, const char *filename,
203 const byte module[], int module_len); 217 const byte module[], int module_len);
204 218
205/* Loads music data. 219/* Loads music data.
206 "as" is the destination structure. 220 "ast" is the destination structure.
207 "filename" determines file format. 221 "filename" determines file format.
208 "module" is the music data (contents of the file). 222 "module" is the music data (contents of the file).
209 "module_len" is the number of data bytes. 223 "module_len" is the number of data bytes.
@@ -212,39 +226,50 @@ abool ASAP_GetModuleInfo(ASAP_ModuleInfo *module_info, const char *filename,
212 ASAP_Load() returns true on success. 226 ASAP_Load() returns true on success.
213 If false is returned, the structure is invalid and you cannot 227 If false is returned, the structure is invalid and you cannot
214 call the following functions. */ 228 call the following functions. */
215abool ASAP_Load(ASAP_State *as, const char *filename, 229abool ASAP_Load(ASAP_State *ast, const char *filename,
216 const byte module[], int module_len); 230 const byte module[], int module_len);
217 231
218/* Enables silence detection. 232/* Enables silence detection.
219 Makes ASAP finish playing after the specified period of silence. 233 Makes ASAP finish playing after the specified period of silence.
220 "as" is ASAP state initialized by ASAP_Load(). 234 "ast" is ASAP state initialized by ASAP_Load().
221 "seconds" is the minimum length of silence that ends playback. */ 235 "seconds" is the minimum length of silence that ends playback. */
222void ASAP_DetectSilence(ASAP_State *as, int seconds); 236void ASAP_DetectSilence(ASAP_State *ast, int seconds);
223 237
224/* Prepares ASAP to play the specified song of the loaded module. 238/* Prepares ASAP to play the specified song of the loaded module.
225 "as" is ASAP state initialized by ASAP_Load(). 239 "ast" is ASAP state initialized by ASAP_Load().
226 "song" is a zero-based index which must be less than the "songs" field 240 "song" is a zero-based index which must be less than the "songs" field
227 of the ASAP_ModuleInfo structure. 241 of the ASAP_ModuleInfo structure.
228 "duration" is playback time in milliseconds - use durations[song] 242 "duration" is playback time in milliseconds - use durations[song]
229 unless you want to override it. -1 means indefinitely. */ 243 unless you want to override it. -1 means indefinitely. */
230void ASAP_PlaySong(ASAP_State *as, int song, int duration); 244void ASAP_PlaySong(ASAP_State *ast, int song, int duration);
231 245
232/* Mutes the selected POKEY channels. 246/* Mutes the selected POKEY channels.
233 This is only useful for people who want to grab samples of individual 247 This is only useful for people who want to grab samples of individual
234 instruments. 248 instruments.
235 "as" is ASAP state after calling ASAP_PlaySong(). 249 "ast" is ASAP state after calling ASAP_PlaySong().
236 "mask" is a bit mask which selects POKEY channels to be muted. 250 "mask" is a bit mask which selects POKEY channels to be muted.
237 Bits 0-3 control the base POKEY channels, 251 Bits 0-3 control the base POKEY channels,
238 bits 4-7 control the extra POKEY channels. */ 252 bits 4-7 control the extra POKEY channels. */
239void ASAP_MutePokeyChannels(ASAP_State *as, int mask); 253void ASAP_MutePokeyChannels(ASAP_State *ast, int mask);
254
255/* Returns current position in milliseconds.
256 "ast" is ASAP state initialized by ASAP_PlaySong(). */
257int ASAP_GetPosition(const ASAP_State *ast);
240 258
241/* Rewinds the current song. 259/* Rewinds the current song.
242 "as" is ASAP state initialized by ASAP_PlaySong(). 260 "ast" is ASAP state initialized by ASAP_PlaySong().
243 "position" is the requested absolute position in milliseconds. */ 261 "position" is the requested absolute position in milliseconds. */
244void ASAP_Seek(ASAP_State *as, int position); 262void ASAP_Seek(ASAP_State *ast, int position);
263
264/* Fills the specified buffer with WAV file header.
265 "ast" is ASAP state initialized by ASAP_PlaySong() with a positive "duration".
266 "buffer" is buffer of ASAP_WAV_HEADER_BYTES bytes.
267 "format" is the format of samples. */
268void ASAP_GetWavHeader(const ASAP_State *ast, byte buffer[],
269 ASAP_SampleFormat format);
245 270
246/* Fills the specified buffer with generated samples. 271/* Fills the specified buffer with generated samples.
247 "as" is ASAP state initialized by ASAP_PlaySong(). 272 "ast" is ASAP state initialized by ASAP_PlaySong().
248 "buffer" is the destination buffer. 273 "buffer" is the destination buffer.
249 "buffer_len" is the length of this buffer in bytes. 274 "buffer_len" is the length of this buffer in bytes.
250 "format" is the format of samples. 275 "format" is the format of samples.
@@ -252,7 +277,7 @@ void ASAP_Seek(ASAP_State *as, int position);
252 (less than buffer_len if reached the end of the song). 277 (less than buffer_len if reached the end of the song).
253 Normally you use a buffer of a few kilobytes or less, 278 Normally you use a buffer of a few kilobytes or less,
254 and call ASAP_Generate() in a loop or via a callback. */ 279 and call ASAP_Generate() in a loop or via a callback. */
255int ASAP_Generate(ASAP_State *as, void *buffer, int buffer_len, 280int ASAP_Generate(ASAP_State *ast, void *buffer, int buffer_len,
256 ASAP_SampleFormat format); 281 ASAP_SampleFormat format);
257 282
258/* Checks whether information in the specified file can be edited. */ 283/* Checks whether information in the specified file can be edited. */
diff --git a/apps/codecs/libasap/asap_internal.h b/apps/codecs/libasap/asap_internal.h
index 1385215f37..1e38496344 100644
--- a/apps/codecs/libasap/asap_internal.h
+++ b/apps/codecs/libasap/asap_internal.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * asap_internal.h - private interface of the ASAP engine 2 * asap_internal.h - private interface of ASAP
3 * 3 *
4 * Copyright (C) 2005-2008 Piotr Fusik 4 * Copyright (C) 2005-2010 Piotr Fusik
5 * 5 *
6 * This file is part of ASAP (Another Slight Atari Player), 6 * This file is part of ASAP (Another Slight Atari Player),
7 * see http://asap.sourceforge.net 7 * see http://asap.sourceforge.net
@@ -24,33 +24,35 @@
24#ifndef _ASAP_INTERNAL_H_ 24#ifndef _ASAP_INTERNAL_H_
25#define _ASAP_INTERNAL_H_ 25#define _ASAP_INTERNAL_H_
26 26
27#if !defined(JAVA) && !defined(CSHARP) 27#include "anylang.h"
28 28
29#include "asap.h" 29#ifndef C
30
31#define ASAP_SONGS_MAX 32
32#define ASAP_SAMPLE_RATE 44100
33
34#endif
35
36#ifdef JAVA
37
38#define ASAP_FORMAT_U8 8
39#define ASAP_FORMAT_S16_LE 16
40#define ASAP_FORMAT_S16_BE -16
41#define ASAP_SampleFormat int
42
43#elif defined(CSHARP) || defined(JAVASCRIPT)
44
45#define ASAP_FORMAT_U8 ASAP_SampleFormat.U8
46#define ASAP_FORMAT_S16_LE ASAP_SampleFormat.S16LE
47#define ASAP_FORMAT_S16_BE ASAP_SampleFormat.S16BE
30 48
31#define CONST_LOOKUP(type, name) \ 49#elif defined(ACTIONSCRIPT)
32 static const type name[] 50
33#define FILE_FUNC static 51#define ASAP_SampleFormat int
34#define ASAP_FUNC 52
35#define PTR * 53#else /* C */
36#define ADDRESSOF & 54
37#define ARRAY * 55#include "asap.h"
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 56
55int ASAP_GetByte(ASAP_State *ast, int addr); 57int ASAP_GetByte(ASAP_State *ast, int addr);
56void ASAP_PutByte(ASAP_State *ast, int addr, int data); 58void ASAP_PutByte(ASAP_State *ast, int addr, int data);
@@ -60,7 +62,7 @@ void Cpu_RunScanlines(ASAP_State *ast, int scanlines);
60void PokeySound_Initialize(ASAP_State *ast); 62void PokeySound_Initialize(ASAP_State *ast);
61void PokeySound_StartFrame(ASAP_State *ast); 63void PokeySound_StartFrame(ASAP_State *ast);
62void PokeySound_PutByte(ASAP_State *ast, int addr, int data); 64void PokeySound_PutByte(ASAP_State *ast, int addr, int data);
63int PokeySound_GetRandom(ASAP_State *ast, int addr); 65int PokeySound_GetRandom(ASAP_State *ast, int addr, int cycle);
64void PokeySound_EndFrame(ASAP_State *ast, int cycle_limit); 66void PokeySound_EndFrame(ASAP_State *ast, int cycle_limit);
65int PokeySound_Generate(ASAP_State *ast, byte buffer[], int buffer_offset, int blocks, ASAP_SampleFormat format); 67int PokeySound_Generate(ASAP_State *ast, byte buffer[], int buffer_offset, int blocks, ASAP_SampleFormat format);
66abool PokeySound_IsSilent(const PokeyState *pst); 68abool PokeySound_IsSilent(const PokeyState *pst);
@@ -68,11 +70,11 @@ void PokeySound_Mute(const ASAP_State *ast, PokeyState *pst, int mask);
68 70
69#ifdef ASAPSCAN 71#ifdef ASAPSCAN
70abool call_6502_player(ASAP_State *ast); 72abool call_6502_player(ASAP_State *ast);
71extern abool cpu_trace; 73extern int 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); 74void trace_cpu(const ASAP_State *ast, int pc, int a, int x, int y, int s, int nz, int vdi, int c);
73#endif 75#endif
74 76
75#endif /* !defined(JAVA) && !defined(CSHARP) */ 77#endif /* C */
76 78
77#define ASAP_MAIN_CLOCK 1773447 79#define ASAP_MAIN_CLOCK 1773447
78 80
@@ -83,11 +85,32 @@ void print_cpu_state(const ASAP_State *ast, int pc, int a, int x, int y, int s,
83 85
84#define NEVER 0x800000 86#define NEVER 0x800000
85 87
86#define dGetByte(addr) UBYTE(AST memory[addr]) 88#define DELTA_SHIFT_POKEY 20
87#define dPutByte(addr, data) AST memory[addr] = (byte) (data) 89#define DELTA_SHIFT_GTIA 20
90#define DELTA_SHIFT_COVOX 17
91
92/* 6502 player types */
93#define ASAP_TYPE_SAP_B 1
94#define ASAP_TYPE_SAP_C 2
95#define ASAP_TYPE_SAP_D 3
96#define ASAP_TYPE_SAP_S 4
97#define ASAP_TYPE_CMC 5
98#define ASAP_TYPE_CM3 6
99#define ASAP_TYPE_CMR 7
100#define ASAP_TYPE_CMS 8
101#define ASAP_TYPE_DLT 9
102#define ASAP_TYPE_MPT 10
103#define ASAP_TYPE_RMT 11
104#define ASAP_TYPE_TMC 12
105#define ASAP_TYPE_TM2 13
106
107#define dGetByte(addr) UBYTE(ast _ memory[addr])
108#define dPutByte(addr, data) ast _ memory[addr] = CAST(byte) (data)
88#define dGetWord(addr) (dGetByte(addr) + (dGetByte((addr) + 1) << 8)) 109#define dGetWord(addr) (dGetByte(addr) + (dGetByte((addr) + 1) << 8))
89#define GetByte(addr) (((addr) & 0xf900) == 0xd000 ? ASAP_GetByte(ast, addr) : dGetByte(addr)) 110#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) 111#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) 112#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)
113
114#define CYCLE_TO_SAMPLE(cycle) TO_INT(((cycle) * ASAP_SAMPLE_RATE + ast _ sample_offset) / ASAP_MAIN_CLOCK)
92 115
93#endif /* _ASAP_INTERNAL_H_ */ 116#endif /* _ASAP_INTERNAL_H_ */
diff --git a/apps/codecs/libasap/players.h b/apps/codecs/libasap/players.h
index ac94f66d49..893de67821 100644
--- a/apps/codecs/libasap/players.h
+++ b/apps/codecs/libasap/players.h
@@ -1,947 +1,1386 @@
1static const unsigned char cmc_obx[] = { 1CONST_ARRAY(byte, cmc_obx)
2 0xFF, 0xFF, 0x00, 0x05, 0xDC, 0x0C, 0x4C, 0x0F, 0x0B, 0x4C, 0x78, 0x05, 0x4C, 0xCB, 0x07, 0x00, 2 255,255,0,5,220,12,76,15,11,76,120,5,76,203,7,0,
3 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xE3, 0xED, 0xE3, 0xA0, 0xF0, 0xEC, 0xE1, 3 0,0,0,0,0,0,0,0,160,227,237,227,160,240,236,225,
4 0xF9, 0xE5, 0xF2, 0xA0, 0xF6, 0xA0, 0xB2, 0xAE, 0xB1, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 249,229,242,160,246,160,178,174,177,160,0,0,0,0,0,0,
5 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 5 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
6 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
7 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 0,128,128,128,128,0,0,0,0,0,0,0,0,0,0,0,
8 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
9 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0x6E, 9 0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,110,
10 0x05, 0x8E, 0x6F, 0x05, 0x8C, 0x70, 0x05, 0x29, 0x70, 0x4A, 0x4A, 0x4A, 0xAA, 0xBD, 0x91, 0x0B, 10 5,142,111,5,140,112,5,41,112,74,74,74,170,189,145,11,
11 0x8D, 0xA9, 0x05, 0xBD, 0x92, 0x0B, 0x8D, 0xAA, 0x05, 0xA9, 0x03, 0x8D, 0x0F, 0xD2, 0xD8, 0xA5, 11 141,169,5,189,146,11,141,170,5,169,3,141,15,210,216,165,
12 0xFE, 0x48, 0xA5, 0xFF, 0x48, 0xAC, 0x70, 0x05, 0xAE, 0x6F, 0x05, 0xAD, 0x6E, 0x05, 0x20, 0xB2, 12 254,72,165,255,72,172,112,5,174,111,5,173,110,5,32,178,
13 0x05, 0x68, 0x85, 0xFF, 0x68, 0x85, 0xFE, 0x60, 0xAD, 0x76, 0x05, 0x85, 0xFE, 0xAD, 0x77, 0x05, 13 5,104,133,255,104,133,254,96,173,118,5,133,254,173,119,5,
14 0x85, 0xFF, 0xA0, 0x00, 0x8A, 0xF0, 0x1C, 0xB1, 0xFE, 0xC9, 0x8F, 0xF0, 0x04, 0xC9, 0xEF, 0xD0, 14 133,255,160,0,138,240,28,177,254,201,143,240,4,201,239,208,
15 0x0C, 0xCA, 0xD0, 0x09, 0xC8, 0xC0, 0x54, 0xB0, 0x09, 0x98, 0xAA, 0x10, 0x06, 0xC8, 0xC0, 0x54, 15 12,202,208,9,200,192,84,176,9,152,170,16,6,200,192,84,
16 0x90, 0xE5, 0x60, 0x8E, 0x68, 0x05, 0x20, 0x7B, 0x06, 0xA9, 0x00, 0xA2, 0x09, 0x9D, 0x45, 0x05, 16 144,229,96,142,104,5,32,123,6,169,0,162,9,157,69,5,
17 0xCA, 0x10, 0xFA, 0x8D, 0x67, 0x05, 0xA9, 0x01, 0x8D, 0x71, 0x05, 0xA9, 0xFF, 0x8D, 0x6A, 0x05, 17 202,16,250,141,103,5,169,1,141,113,5,169,255,141,106,5,
18 0xAD, 0x72, 0x05, 0x85, 0xFE, 0xAD, 0x73, 0x05, 0x85, 0xFF, 0xA0, 0x13, 0xB1, 0xFE, 0xAA, 0xAD, 18 173,114,5,133,254,173,115,5,133,255,160,19,177,254,170,173,
19 0x76, 0x05, 0x85, 0xFE, 0xAD, 0x77, 0x05, 0x85, 0xFF, 0xAC, 0x68, 0x05, 0xB1, 0xFE, 0xC9, 0xCF, 19 118,5,133,254,173,119,5,133,255,172,104,5,177,254,201,207,
20 0xD0, 0x0D, 0x98, 0x18, 0x69, 0x55, 0xA8, 0xB1, 0xFE, 0x30, 0x0F, 0xAA, 0x4C, 0x34, 0x06, 0xC9, 20 208,13,152,24,105,85,168,177,254,48,15,170,76,52,6,201,
21 0x8F, 0xF0, 0x07, 0xC9, 0xEF, 0xF0, 0x03, 0x88, 0x10, 0xE2, 0x8E, 0x6C, 0x05, 0x8E, 0x6D, 0x05, 21 143,240,7,201,239,240,3,136,16,226,142,108,5,142,109,5,
22 0x60, 0x29, 0x0F, 0xF0, 0xF5, 0x8E, 0xDA, 0x0A, 0x8E, 0xF0, 0x0A, 0x8E, 0xFF, 0x0A, 0x8C, 0xDB, 22 96,41,15,240,245,142,218,10,142,240,10,142,255,10,140,219,
23 0x0A, 0x8C, 0xF1, 0x0A, 0x8C, 0x00, 0x0B, 0x60, 0x8E, 0x72, 0x05, 0x86, 0xFE, 0x8C, 0x73, 0x05, 23 10,140,241,10,140,0,11,96,142,114,5,134,254,140,115,5,
24 0x84, 0xFF, 0x18, 0x8A, 0x69, 0x14, 0x8D, 0x74, 0x05, 0x98, 0x69, 0x00, 0x8D, 0x75, 0x05, 0x8E, 24 132,255,24,138,105,20,141,116,5,152,105,0,141,117,5,142,
25 0x76, 0x05, 0xC8, 0xC8, 0x8C, 0x77, 0x05, 0xA0, 0x13, 0xB1, 0xFE, 0x8D, 0x6C, 0x05, 0x8D, 0x6D, 25 118,5,200,200,140,119,5,160,19,177,254,141,108,5,141,109,
26 0x05, 0xA2, 0x08, 0xA9, 0x00, 0x8D, 0x71, 0x05, 0x9D, 0x00, 0xD2, 0xE0, 0x03, 0xB0, 0x08, 0x9D, 26 5,162,8,169,0,141,113,5,157,0,210,224,3,176,8,157,
27 0x09, 0x05, 0xA9, 0xFF, 0x9D, 0x39, 0x05, 0xCA, 0x10, 0xE9, 0xA9, 0x80, 0xA2, 0x03, 0x9D, 0x4B, 27 9,5,169,255,157,57,5,202,16,233,169,128,162,3,157,75,
28 0x05, 0xCA, 0x10, 0xFA, 0x60, 0xA9, 0x01, 0x8D, 0x71, 0x05, 0xA9, 0x00, 0xF0, 0xEE, 0x29, 0x03, 28 5,202,16,250,96,169,1,141,113,5,169,0,240,238,41,3,
29 0xC9, 0x03, 0xF0, 0xF0, 0xE0, 0x40, 0xB0, 0xEC, 0xC0, 0x1A, 0xB0, 0xE8, 0xAA, 0xA9, 0x80, 0x9D, 29 201,3,240,240,224,64,176,236,192,26,176,232,170,169,128,157,
30 0x4B, 0x05, 0xA9, 0x00, 0x9D, 0x39, 0x05, 0x9D, 0x3C, 0x05, 0x9D, 0x3F, 0x05, 0xAD, 0x6F, 0x05, 30 75,5,169,0,157,57,5,157,60,5,157,63,5,173,111,5,
31 0x9D, 0x0C, 0x05, 0xAD, 0x70, 0x05, 0x0A, 0x0A, 0x0A, 0x85, 0xFE, 0x18, 0xAD, 0x72, 0x05, 0x69, 31 157,12,5,173,112,5,10,10,10,133,254,24,173,114,5,105,
32 0x30, 0x48, 0xAD, 0x73, 0x05, 0x69, 0x01, 0xA8, 0x68, 0x18, 0x65, 0xFE, 0x9D, 0x61, 0x05, 0x98, 32 48,72,173,115,5,105,1,168,104,24,101,254,157,97,5,152,
33 0x69, 0x00, 0x9D, 0x64, 0x05, 0x18, 0xAD, 0x72, 0x05, 0x69, 0x94, 0x85, 0xFE, 0xAD, 0x73, 0x05, 33 105,0,157,100,5,24,173,114,5,105,148,133,254,173,115,5,
34 0x69, 0x00, 0x85, 0xFF, 0xAD, 0x70, 0x05, 0x0A, 0x6D, 0x70, 0x05, 0x0A, 0xA8, 0xB1, 0xFE, 0x9D, 34 105,0,133,255,173,112,5,10,109,112,5,10,168,177,254,157,
35 0x4F, 0x05, 0xC8, 0xB1, 0xFE, 0x9D, 0x52, 0x05, 0x29, 0x07, 0x8D, 0x6E, 0x05, 0xC8, 0xB1, 0xFE, 35 79,5,200,177,254,157,82,5,41,7,141,110,5,200,177,254,
36 0x9D, 0x55, 0x05, 0xC8, 0xB1, 0xFE, 0x9D, 0x58, 0x05, 0xC8, 0xB1, 0xFE, 0x9D, 0x5B, 0x05, 0xC8, 36 157,85,5,200,177,254,157,88,5,200,177,254,157,91,5,200,
37 0xB1, 0xFE, 0x9D, 0x5E, 0x05, 0xA0, 0x00, 0xAD, 0x6E, 0x05, 0xC9, 0x03, 0xD0, 0x02, 0xA0, 0x02, 37 177,254,157,94,5,160,0,173,110,5,201,3,208,2,160,2,
38 0xC9, 0x07, 0xD0, 0x02, 0xA0, 0x04, 0xB9, 0xAF, 0x0B, 0x85, 0xFE, 0xB9, 0xB0, 0x0B, 0x85, 0xFF, 38 201,7,208,2,160,4,185,175,11,133,254,185,176,11,133,255,
39 0xBD, 0x55, 0x05, 0x4A, 0x4A, 0x4A, 0x4A, 0x18, 0x6D, 0x6F, 0x05, 0x8D, 0x6F, 0x05, 0x8D, 0xC2, 39 189,85,5,74,74,74,74,24,109,111,5,141,111,5,141,194,
40 0x07, 0xA8, 0xAD, 0x6E, 0x05, 0xC9, 0x07, 0xD0, 0x0F, 0x98, 0x0A, 0xA8, 0xB1, 0xFE, 0x9D, 0x2D, 40 7,168,173,110,5,201,7,208,15,152,10,168,177,254,157,45,
41 0x05, 0xC8, 0x8C, 0x6F, 0x05, 0x4C, 0x83, 0x07, 0xB1, 0xFE, 0x9D, 0x2D, 0x05, 0xBD, 0x55, 0x05, 41 5,200,140,111,5,76,131,7,177,254,157,45,5,189,85,5,
42 0x29, 0x0F, 0x18, 0x6D, 0x6F, 0x05, 0x8D, 0x6F, 0x05, 0xAC, 0x6F, 0x05, 0xAD, 0x6E, 0x05, 0xC9, 42 41,15,24,109,111,5,141,111,5,172,111,5,173,110,5,201,
43 0x05, 0x08, 0xB1, 0xFE, 0x28, 0xF0, 0x08, 0xDD, 0x2D, 0x05, 0xD0, 0x03, 0x38, 0xE9, 0x01, 0x9D, 43 5,8,177,254,40,240,8,221,45,5,208,3,56,233,1,157,
44 0x30, 0x05, 0xBD, 0x4F, 0x05, 0x48, 0x29, 0x03, 0xA8, 0xB9, 0xB5, 0x0B, 0x9D, 0x36, 0x05, 0x68, 44 48,5,189,79,5,72,41,3,168,185,181,11,157,54,5,104,
45 0x4A, 0x4A, 0x4A, 0x4A, 0xA0, 0x3E, 0xC9, 0x0F, 0xF0, 0x10, 0xA0, 0x37, 0xC9, 0x0E, 0xF0, 0x0A, 45 74,74,74,74,160,62,201,15,240,16,160,55,201,14,240,10,
46 0xA0, 0x30, 0xC9, 0x0D, 0xF0, 0x04, 0x18, 0x69, 0x00, 0xA8, 0xB9, 0xB9, 0x0B, 0x9D, 0x33, 0x05, 46 160,48,201,13,240,4,24,105,0,168,185,185,11,157,51,5,
47 0x60, 0xD8, 0xA5, 0xFC, 0x48, 0xA5, 0xFD, 0x48, 0xA5, 0xFE, 0x48, 0xA5, 0xFF, 0x48, 0xAD, 0x71, 47 96,216,165,252,72,165,253,72,165,254,72,165,255,72,173,113,
48 0x05, 0xD0, 0x03, 0x4C, 0x02, 0x0B, 0xAD, 0x4E, 0x05, 0xF0, 0x03, 0x4C, 0x6B, 0x09, 0xAD, 0x6C, 48 5,208,3,76,2,11,173,78,5,240,3,76,107,9,173,108,
49 0x05, 0xCD, 0x6D, 0x05, 0xF0, 0x03, 0x4C, 0x58, 0x09, 0xAD, 0x67, 0x05, 0xF0, 0x03, 0x4C, 0xDC, 49 5,205,109,5,240,3,76,88,9,173,103,5,240,3,76,220,
50 0x08, 0xA2, 0x02, 0xBC, 0x4B, 0x05, 0x30, 0x03, 0x9D, 0x4B, 0x05, 0x9D, 0x45, 0x05, 0xCA, 0x10, 50 8,162,2,188,75,5,48,3,157,75,5,157,69,5,202,16,
51 0xF2, 0xAD, 0x76, 0x05, 0x85, 0xFC, 0xAD, 0x77, 0x05, 0x85, 0xFD, 0xAC, 0x68, 0x05, 0x84, 0xFE, 51 242,173,118,5,133,252,173,119,5,133,253,172,104,5,132,254,
52 0xCC, 0x6A, 0x05, 0xD0, 0x19, 0xAD, 0x6B, 0x05, 0xF0, 0x14, 0xAD, 0x68, 0x05, 0xAC, 0x69, 0x05, 52 204,106,5,208,25,173,107,5,240,20,173,104,5,172,105,5,
53 0x8C, 0x68, 0x05, 0xCE, 0x6B, 0x05, 0xD0, 0xE8, 0x8D, 0x68, 0x05, 0xA8, 0x10, 0xE2, 0xA2, 0x00, 53 140,104,5,206,107,5,208,232,141,104,5,168,16,226,162,0,
54 0xB1, 0xFC, 0xC9, 0xFE, 0xD0, 0x0E, 0xAC, 0x68, 0x05, 0xC8, 0xC4, 0xFE, 0xF0, 0x43, 0x8C, 0x68, 54 177,252,201,254,208,14,172,104,5,200,196,254,240,67,140,104,
55 0x05, 0x4C, 0x1A, 0x08, 0x9D, 0x42, 0x05, 0x18, 0x98, 0x69, 0x55, 0xA8, 0xE8, 0xE0, 0x03, 0x90, 55 5,76,26,8,157,66,5,24,152,105,85,168,232,224,3,144,
56 0xDF, 0xAC, 0x68, 0x05, 0xB1, 0xFC, 0x10, 0x7A, 0xC9, 0xFF, 0xF0, 0x76, 0x4A, 0x4A, 0x4A, 0x29, 56 223,172,104,5,177,252,16,122,201,255,240,118,74,74,74,41,
57 0x0E, 0xAA, 0xBD, 0xA1, 0x0B, 0x8D, 0x7E, 0x08, 0xBD, 0xA2, 0x0B, 0x8D, 0x7F, 0x08, 0xAD, 0x43, 57 14,170,189,161,11,141,126,8,189,162,11,141,127,8,173,67,
58 0x05, 0x85, 0xFF, 0x20, 0x93, 0x08, 0x8C, 0x68, 0x05, 0xC0, 0x55, 0xB0, 0x04, 0xC4, 0xFE, 0xD0, 58 5,133,255,32,147,8,140,104,5,192,85,176,4,196,254,208,
59 0x8F, 0xA4, 0xFE, 0x8C, 0x68, 0x05, 0x4C, 0x02, 0x0B, 0x20, 0x94, 0x06, 0xA0, 0xFF, 0x60, 0x30, 59 143,164,254,140,104,5,76,2,11,32,148,6,160,255,96,48,
60 0xFB, 0xA8, 0x60, 0x30, 0xF7, 0x38, 0x98, 0xE5, 0xFF, 0xA8, 0x60, 0x30, 0xEF, 0x18, 0x98, 0x65, 60 251,168,96,48,247,56,152,229,255,168,96,48,239,24,152,101,
61 0xFF, 0xA8, 0x60, 0x30, 0xE7, 0x8D, 0x6C, 0x05, 0x8D, 0x6D, 0x05, 0xC8, 0x60, 0x30, 0xDD, 0xAD, 61 255,168,96,48,231,141,108,5,141,109,5,200,96,48,221,173,
62 0x44, 0x05, 0x30, 0xD8, 0x8D, 0x6B, 0x05, 0xC8, 0x8C, 0x69, 0x05, 0x18, 0x98, 0x65, 0xFF, 0x8D, 62 68,5,48,216,141,107,5,200,140,105,5,24,152,101,255,141,
63 0x6A, 0x05, 0x60, 0x88, 0x30, 0x0A, 0xB1, 0xFC, 0xC9, 0x8F, 0xF0, 0x04, 0xC9, 0xEF, 0xD0, 0xF3, 63 106,5,96,136,48,10,177,252,201,143,240,4,201,239,208,243,
64 0xC8, 0x60, 0xA2, 0x02, 0xBD, 0x48, 0x05, 0xF0, 0x05, 0xDE, 0x48, 0x05, 0x10, 0x63, 0xBD, 0x4B, 64 200,96,162,2,189,72,5,240,5,222,72,5,16,99,189,75,
65 0x05, 0xD0, 0x5E, 0xBC, 0x42, 0x05, 0xC0, 0x40, 0xB0, 0x57, 0xAD, 0x74, 0x05, 0x85, 0xFC, 0xAD, 65 5,208,94,188,66,5,192,64,176,87,173,116,5,133,252,173,
66 0x75, 0x05, 0x85, 0xFD, 0xB1, 0xFC, 0x85, 0xFE, 0x18, 0x98, 0x69, 0x40, 0xA8, 0xB1, 0xFC, 0x85, 66 117,5,133,253,177,252,133,254,24,152,105,64,168,177,252,133,
67 0xFF, 0x25, 0xFE, 0xC9, 0xFF, 0xF0, 0x3A, 0xBC, 0x45, 0x05, 0xB1, 0xFE, 0x29, 0xC0, 0xD0, 0x0C, 67 255,37,254,201,255,240,58,188,69,5,177,254,41,192,208,12,
68 0xB1, 0xFE, 0x29, 0x3F, 0x9D, 0x0F, 0x05, 0xFE, 0x45, 0x05, 0x10, 0xEB, 0xC9, 0x40, 0xD0, 0x13, 68 177,254,41,63,157,15,5,254,69,5,16,235,201,64,208,19,
69 0xB1, 0xFE, 0x29, 0x3F, 0x8D, 0x6F, 0x05, 0xBD, 0x0F, 0x05, 0x8D, 0x70, 0x05, 0x20, 0xBC, 0x06, 69 177,254,41,63,141,111,5,189,15,5,141,112,5,32,188,6,
70 0x4C, 0x48, 0x09, 0xC9, 0x80, 0xD0, 0x0A, 0xB1, 0xFE, 0x29, 0x3F, 0x9D, 0x48, 0x05, 0xFE, 0x45, 70 76,72,9,201,128,208,10,177,254,41,63,157,72,5,254,69,
71 0x05, 0xCA, 0x10, 0x90, 0xAE, 0x67, 0x05, 0xE8, 0x8A, 0x29, 0x3F, 0x8D, 0x67, 0x05, 0xCE, 0x6D, 71 5,202,16,144,174,103,5,232,138,41,63,141,103,5,206,109,
72 0x05, 0xD0, 0x0E, 0xAD, 0x6C, 0x05, 0x8D, 0x6D, 0x05, 0xAD, 0x67, 0x05, 0xD0, 0x03, 0xEE, 0x68, 72 5,208,14,173,108,5,141,109,5,173,103,5,208,3,238,104,
73 0x05, 0xAC, 0x30, 0x05, 0xAD, 0x52, 0x05, 0x29, 0x07, 0xC9, 0x05, 0xF0, 0x04, 0xC9, 0x06, 0xD0, 73 5,172,48,5,173,82,5,41,7,201,5,240,4,201,6,208,
74 0x01, 0x88, 0x8C, 0x27, 0x05, 0xA0, 0x00, 0xC9, 0x05, 0xF0, 0x04, 0xC9, 0x06, 0xD0, 0x02, 0xA0, 74 1,136,140,39,5,160,0,201,5,240,4,201,6,208,2,160,
75 0x02, 0xC9, 0x07, 0xD0, 0x02, 0xA0, 0x28, 0x8C, 0x2C, 0x05, 0xA2, 0x02, 0xBD, 0x52, 0x05, 0x29, 75 2,201,7,208,2,160,40,140,44,5,162,2,189,82,5,41,
76 0xE0, 0x9D, 0x28, 0x05, 0xBD, 0x61, 0x05, 0x85, 0xFC, 0xBD, 0x64, 0x05, 0x85, 0xFD, 0xBD, 0x39, 76 224,157,40,5,189,97,5,133,252,189,100,5,133,253,189,57,
77 0x05, 0xC9, 0xFF, 0xF0, 0x36, 0xC9, 0x0F, 0xD0, 0x20, 0xBD, 0x3F, 0x05, 0xF0, 0x2D, 0xDE, 0x3F, 77 5,201,255,240,54,201,15,208,32,189,63,5,240,45,222,63,
78 0x05, 0xBD, 0x3F, 0x05, 0xD0, 0x25, 0xBC, 0x09, 0x05, 0xF0, 0x01, 0x88, 0x98, 0x9D, 0x09, 0x05, 78 5,189,63,5,208,37,188,9,5,240,1,136,152,157,9,5,
79 0xBD, 0x58, 0x05, 0x9D, 0x3F, 0x05, 0x4C, 0xE5, 0x09, 0xBD, 0x39, 0x05, 0x4A, 0xA8, 0xB1, 0xFC, 79 189,88,5,157,63,5,76,229,9,189,57,5,74,168,177,252,
80 0x90, 0x04, 0x4A, 0x4A, 0x4A, 0x4A, 0x29, 0x0F, 0x9D, 0x09, 0x05, 0xBC, 0x2D, 0x05, 0xBD, 0x52, 80 144,4,74,74,74,74,41,15,157,9,5,188,45,5,189,82,
81 0x05, 0x29, 0x07, 0xC9, 0x01, 0xD0, 0x1F, 0x88, 0x98, 0xC8, 0xDD, 0x30, 0x05, 0x08, 0xA9, 0x01, 81 5,41,7,201,1,208,31,136,152,200,221,48,5,8,169,1,
82 0x28, 0xD0, 0x02, 0x0A, 0x0A, 0x3D, 0x3C, 0x05, 0xF0, 0x0C, 0xBC, 0x30, 0x05, 0xC0, 0xFF, 0xD0, 82 40,208,2,10,10,61,60,5,240,12,188,48,5,192,255,208,
83 0x05, 0xA9, 0x00, 0x9D, 0x09, 0x05, 0x98, 0x9D, 0x24, 0x05, 0xA9, 0x01, 0x8D, 0x6E, 0x05, 0xBD, 83 5,169,0,157,9,5,152,157,36,5,169,1,141,110,5,189,
84 0x39, 0x05, 0xC9, 0x0F, 0xF0, 0x38, 0x29, 0x07, 0xA8, 0xB9, 0xCD, 0x0C, 0x85, 0xFE, 0xBD, 0x39, 84 57,5,201,15,240,56,41,7,168,185,205,12,133,254,189,57,
85 0x05, 0x29, 0x08, 0x08, 0x8A, 0x28, 0x18, 0xF0, 0x02, 0x69, 0x03, 0xA8, 0xB9, 0x5B, 0x05, 0x25, 85 5,41,8,8,138,40,24,240,2,105,3,168,185,91,5,37,
86 0xFE, 0xF0, 0x1B, 0xBD, 0x33, 0x05, 0x9D, 0x24, 0x05, 0x8E, 0x6E, 0x05, 0xCA, 0x10, 0x08, 0x8D, 86 254,240,27,189,51,5,157,36,5,142,110,5,202,16,8,141,
87 0x27, 0x05, 0xA9, 0x00, 0x8D, 0x2C, 0x05, 0xE8, 0xBD, 0x36, 0x05, 0x9D, 0x28, 0x05, 0xBD, 0x39, 87 39,5,169,0,141,44,5,232,189,54,5,157,40,5,189,57,
88 0x05, 0x29, 0x0F, 0xC9, 0x0F, 0xF0, 0x10, 0xFE, 0x39, 0x05, 0xBD, 0x39, 0x05, 0xC9, 0x0F, 0xD0, 88 5,41,15,201,15,240,16,254,57,5,189,57,5,201,15,208,
89 0x06, 0xBD, 0x58, 0x05, 0x9D, 0x3F, 0x05, 0xBD, 0x4B, 0x05, 0x10, 0x0A, 0xBD, 0x09, 0x05, 0xD0, 89 6,189,88,5,157,63,5,189,75,5,16,10,189,9,5,208,
90 0x05, 0xA9, 0x40, 0x9D, 0x4B, 0x05, 0xFE, 0x3C, 0x05, 0xA0, 0x00, 0xBD, 0x52, 0x05, 0x4A, 0x4A, 90 5,169,64,157,75,5,254,60,5,160,0,189,82,5,74,74,
91 0x4A, 0x4A, 0x90, 0x01, 0x88, 0x4A, 0x90, 0x01, 0xC8, 0x18, 0x98, 0x7D, 0x2D, 0x05, 0x9D, 0x2D, 91 74,74,144,1,136,74,144,1,200,24,152,125,45,5,157,45,
92 0x05, 0xBD, 0x30, 0x05, 0xC9, 0xFF, 0xD0, 0x02, 0xA0, 0x00, 0x18, 0x98, 0x7D, 0x30, 0x05, 0x9D, 92 5,189,48,5,201,255,208,2,160,0,24,152,125,48,5,157,
93 0x30, 0x05, 0xCA, 0x30, 0x03, 0x4C, 0x96, 0x09, 0xAD, 0x28, 0x05, 0x8D, 0x2B, 0x05, 0xAD, 0x52, 93 48,5,202,48,3,76,150,9,173,40,5,141,43,5,173,82,
94 0x05, 0x29, 0x07, 0xAA, 0xA0, 0x03, 0xAD, 0x6E, 0x05, 0xF0, 0x03, 0xBC, 0xD5, 0x0C, 0x98, 0x48, 94 5,41,7,170,160,3,173,110,5,240,3,188,213,12,152,72,
95 0xB9, 0xB9, 0x0C, 0x08, 0x29, 0x7F, 0xAA, 0x98, 0x29, 0x03, 0x0A, 0xA8, 0xBD, 0x24, 0x05, 0x99, 95 185,185,12,8,41,127,170,152,41,3,10,168,189,36,5,153,
96 0x00, 0xD2, 0xC8, 0xBD, 0x09, 0x05, 0xE0, 0x03, 0xD0, 0x03, 0xAD, 0x09, 0x05, 0x1D, 0x28, 0x05, 96 0,210,200,189,9,5,224,3,208,3,173,9,5,29,40,5,
97 0x28, 0x10, 0x02, 0xA9, 0x00, 0x99, 0x00, 0xD2, 0x68, 0xA8, 0x88, 0x29, 0x03, 0xD0, 0xCF, 0xA0, 97 40,16,2,169,0,153,0,210,104,168,136,41,3,208,207,160,
98 0x08, 0xAD, 0x2C, 0x05, 0x99, 0x00, 0xD2, 0x18, 0x68, 0x85, 0xFF, 0x68, 0x85, 0xFE, 0x68, 0x85, 98 8,173,44,5,153,0,210,24,104,133,255,104,133,254,104,133,
99 0xFD, 0x68, 0x85, 0xFC, 0x60, 0x68, 0xAA, 0xF0, 0x4E, 0xC9, 0x02, 0xF0, 0x06, 0x68, 0x68, 0xCA, 99 253,104,133,252,96,104,170,240,78,201,2,240,6,104,104,202,
100 0xD0, 0xFB, 0x60, 0xA5, 0x14, 0xC5, 0x14, 0xF0, 0xFC, 0xAD, 0x24, 0x02, 0xC9, 0x86, 0xD0, 0x07, 100 208,251,96,165,20,197,20,240,252,173,36,2,201,134,208,7,
101 0xAD, 0x25, 0x02, 0xC9, 0x0B, 0xF0, 0xE6, 0xAD, 0x24, 0x02, 0x8D, 0x8F, 0x0B, 0xAD, 0x25, 0x02, 101 173,37,2,201,11,240,230,173,36,2,141,143,11,173,37,2,
102 0x8D, 0x90, 0x0B, 0xA9, 0x86, 0x8D, 0x24, 0x02, 0xA9, 0x0B, 0x8D, 0x25, 0x02, 0x68, 0x68, 0xF0, 102 141,144,11,169,134,141,36,2,169,11,141,37,2,104,104,240,
103 0x03, 0x38, 0xE9, 0x01, 0x8D, 0x5D, 0x0B, 0x68, 0xA8, 0x68, 0xAA, 0xA9, 0x70, 0x20, 0x78, 0x05, 103 3,56,233,1,141,93,11,104,168,104,170,169,112,32,120,5,
104 0xA9, 0x00, 0xA2, 0x00, 0x4C, 0x78, 0x05, 0xA5, 0x14, 0xC5, 0x14, 0xF0, 0xFC, 0xAD, 0x24, 0x02, 104 169,0,162,0,76,120,5,165,20,197,20,240,252,173,36,2,
105 0xC9, 0x86, 0xD0, 0xAE, 0xAD, 0x25, 0x02, 0xC9, 0x0B, 0xD0, 0xA7, 0xAD, 0x8F, 0x0B, 0x8D, 0x24, 105 201,134,208,174,173,37,2,201,11,208,167,173,143,11,141,36,
106 0x02, 0xAD, 0x90, 0x0B, 0x8D, 0x25, 0x02, 0xA9, 0x40, 0x4C, 0x78, 0x05, 0x20, 0xCB, 0x07, 0x90, 106 2,173,144,11,141,37,2,169,64,76,120,5,32,203,7,144,
107 0x03, 0x20, 0x75, 0x0B, 0x4C, 0xFF, 0xFF, 0xB2, 0x05, 0xDD, 0x05, 0xA8, 0x06, 0x3B, 0x06, 0x7B, 107 3,32,117,11,76,255,255,178,5,221,5,168,6,59,6,123,
108 0x06, 0x94, 0x06, 0x9F, 0x06, 0x52, 0x06, 0x93, 0x08, 0x99, 0x08, 0x9D, 0x08, 0xA5, 0x08, 0xAD, 108 6,148,6,159,6,82,6,147,8,153,8,157,8,165,8,173,
109 0x08, 0xB7, 0x08, 0xCD, 0x08, 0xB9, 0x0B, 0xFA, 0x0B, 0x3B, 0x0C, 0x80, 0xA0, 0x20, 0x40, 0xFF, 109 8,183,8,205,8,185,11,250,11,59,12,128,160,32,64,255,
110 0xF1, 0xE4, 0xD7, 0xCB, 0xC0, 0xB5, 0xAA, 0xA1, 0x98, 0x8F, 0x87, 0x7F, 0x78, 0x72, 0x6B, 0x65, 110 241,228,215,203,192,181,170,161,152,143,135,127,120,114,107,101,
111 0x5F, 0x5A, 0x55, 0x50, 0x4B, 0x47, 0x43, 0x3F, 0x3C, 0x38, 0x35, 0x32, 0x2F, 0x2C, 0x2A, 0x27, 111 95,90,85,80,75,71,67,63,60,56,53,50,47,44,42,39,
112 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 112 37,35,33,31,29,28,26,24,23,22,20,19,18,17,16,15,
113 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 113 14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,0,
114 0x00, 0x00, 0x00, 0x00, 0xF2, 0xE9, 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 114 0,0,0,0,242,233,218,206,191,182,170,161,152,143,137,128,
115 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x00, 0x56, 0x50, 0x67, 0x60, 0x5A, 0x55, 0x51, 0x4C, 0x48, 0x43, 115 122,113,107,101,95,0,86,80,103,96,90,85,81,76,72,67,
116 0x3F, 0x3D, 0x39, 0x34, 0x33, 0x39, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x00, 0x00, 116 63,61,57,52,51,57,45,42,40,37,36,33,31,30,0,0,
117 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 117 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,
118 0x00, 0x38, 0x0B, 0x8C, 0x0A, 0x00, 0x0A, 0x6A, 0x09, 0xE8, 0x08, 0x6A, 0x08, 0xEF, 0x07, 0x80, 118 0,56,11,140,10,0,10,106,9,232,8,106,8,239,7,128,
119 0x07, 0x08, 0x07, 0xAE, 0x06, 0x46, 0x06, 0xE6, 0x05, 0x95, 0x05, 0x41, 0x05, 0xF6, 0x04, 0xB0, 119 7,8,7,174,6,70,6,230,5,149,5,65,5,246,4,176,
120 0x04, 0x6E, 0x04, 0x30, 0x04, 0xF6, 0x03, 0xBB, 0x03, 0x84, 0x03, 0x52, 0x03, 0x22, 0x03, 0xF4, 120 4,110,4,48,4,246,3,187,3,132,3,82,3,34,3,244,
121 0x02, 0xC8, 0x02, 0xA0, 0x02, 0x7A, 0x02, 0x55, 0x02, 0x34, 0x02, 0x14, 0x02, 0xF5, 0x01, 0xD8, 121 2,200,2,160,2,122,2,85,2,52,2,20,2,245,1,216,
122 0x01, 0xBD, 0x01, 0xA4, 0x01, 0x8D, 0x01, 0x77, 0x01, 0x60, 0x01, 0x4E, 0x01, 0x38, 0x01, 0x27, 122 1,189,1,164,1,141,1,119,1,96,1,78,1,56,1,39,
123 0x01, 0x15, 0x01, 0x06, 0x01, 0xF7, 0x00, 0xE8, 0x00, 0xDB, 0x00, 0xCF, 0x00, 0xC3, 0x00, 0xB8, 123 1,21,1,6,1,247,0,232,0,219,0,207,0,195,0,184,
124 0x00, 0xAC, 0x00, 0xA2, 0x00, 0x9A, 0x00, 0x90, 0x00, 0x88, 0x00, 0x7F, 0x00, 0x78, 0x00, 0x70, 124 0,172,0,162,0,154,0,144,0,136,0,127,0,120,0,112,
125 0x00, 0x6A, 0x00, 0x64, 0x00, 0x5E, 0x00, 0x57, 0x00, 0x52, 0x00, 0x32, 0x00, 0x0A, 0x00, 0x00, 125 0,106,0,100,0,94,0,87,0,82,0,50,0,10,0,0,
126 0x01, 0x02, 0x83, 0x00, 0x01, 0x02, 0x03, 0x01, 0x00, 0x02, 0x83, 0x01, 0x00, 0x02, 0x03, 0x01, 126 1,2,131,0,1,2,3,1,0,2,131,1,0,2,3,1,
127 0x02, 0x80, 0x03, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x03, 0x03, 0x03, 0x03, 0x07, 127 2,128,3,128,64,32,16,8,4,2,1,3,3,3,3,7,
128 0x0B, 0x0F, 0x13 128 11,15,19
129}; 129END_CONST_ARRAY;
130static const unsigned char mpt_obx[] = { 130CONST_ARRAY(byte, cm3_obx)
131 0xFF, 0xFF, 0x00, 0x05, 0xB2, 0x0D, 0x4C, 0xCD, 0x0B, 0xAD, 0x2E, 0x07, 0xD0, 0x01, 0x60, 0xA9, 131 255,255,0,5,223,12,76,18,11,76,120,5,76,203,7,0,
132 0x00, 0x8D, 0x1C, 0x0E, 0xEE, 0x1D, 0x0E, 0xAD, 0x17, 0x0E, 0xCD, 0xBB, 0x0D, 0x90, 0x50, 0xCE, 132 0,0,0,0,0,0,0,0,160,227,237,227,160,240,236,225,
133 0x15, 0x0E, 0xF0, 0x03, 0x4C, 0xC5, 0x05, 0xA2, 0x00, 0x8E, 0x17, 0x0E, 0xA9, 0x00, 0x9D, 0xED, 133 249,229,242,160,246,160,178,174,177,160,0,0,0,0,0,0,
134 0x0D, 0x9D, 0xF5, 0x0D, 0xBD, 0xB3, 0x0D, 0x85, 0xEC, 0xBD, 0xB7, 0x0D, 0x85, 0xED, 0xAC, 0x16, 134 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,
135 0x0E, 0xB1, 0xEC, 0xC8, 0xC9, 0xFF, 0xF0, 0x07, 0xC9, 0xFE, 0xD0, 0x0F, 0x4C, 0x2A, 0x0C, 0xB1, 135 255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
136 0xEC, 0x30, 0xF9, 0x0A, 0xA8, 0x8C, 0x16, 0x0E, 0x4C, 0x3B, 0x05, 0x9D, 0xE9, 0x0D, 0xB1, 0xEC, 136 0,128,128,128,128,0,0,0,0,0,0,0,0,0,0,0,
137 0x9D, 0xD5, 0x0D, 0xE8, 0xE0, 0x04, 0xD0, 0xC4, 0xC8, 0x8C, 0x16, 0x0E, 0x4C, 0xC5, 0x05, 0xCE, 137 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
138 0x15, 0x0E, 0x10, 0x57, 0xAD, 0xBC, 0x0D, 0x8D, 0x15, 0x0E, 0xA2, 0x03, 0xDE, 0xF5, 0x0D, 0x10, 138 0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,110,
139 0x44, 0xBD, 0xE9, 0x0D, 0x0A, 0xA8, 0xB9, 0xFF, 0xFF, 0x85, 0xEC, 0xC8, 0xB9, 0xFF, 0xFF, 0x85, 139 5,142,111,5,140,112,5,41,112,74,74,74,170,189,148,11,
140 0xED, 0x05, 0xEC, 0xF0, 0x30, 0xBD, 0xED, 0x0D, 0x8D, 0x1F, 0x0E, 0x20, 0x3E, 0x07, 0xAC, 0x1F, 140 141,169,5,189,149,11,141,170,5,169,3,141,15,210,216,165,
141 0x0E, 0xC8, 0x98, 0x9D, 0xED, 0x0D, 0xBD, 0xF1, 0x0D, 0x9D, 0xF5, 0x0D, 0xE0, 0x02, 0xD0, 0x15, 141 254,72,165,255,72,172,112,5,174,111,5,173,110,5,32,178,
142 0xBD, 0xC5, 0x0D, 0x49, 0x0F, 0x0A, 0x0A, 0x0A, 0x0A, 0x69, 0x45, 0x8D, 0xA1, 0x0D, 0xA9, 0x0A, 142 5,104,133,255,104,133,254,96,173,118,5,133,254,173,119,5,
143 0x69, 0x00, 0x8D, 0xA2, 0x0D, 0xCA, 0x10, 0xB4, 0xEE, 0x17, 0x0E, 0xA2, 0x01, 0xAD, 0x1B, 0x0E, 143 133,255,160,0,138,240,28,177,254,201,143,240,4,201,239,208,
144 0xC9, 0x02, 0xF0, 0x02, 0xA2, 0x03, 0xAD, 0x1B, 0x0E, 0xC9, 0x02, 0xD0, 0x05, 0xEC, 0x19, 0x0E, 144 12,202,208,9,200,192,84,176,9,152,170,16,6,200,192,84,
145 0xF0, 0x03, 0x4C, 0x76, 0x06, 0xB5, 0xF0, 0x3D, 0x72, 0x06, 0xF0, 0x12, 0xA0, 0x28, 0xB1, 0xEC, 145 144,229,96,142,104,5,32,123,6,169,0,162,9,157,69,5,
146 0x18, 0x7D, 0xE1, 0x0D, 0x20, 0x75, 0x09, 0x38, 0x7D, 0x01, 0x0E, 0x9D, 0xCB, 0x0D, 0xCA, 0x10, 146 202,16,250,141,103,5,169,1,141,113,5,169,255,141,106,5,
147 0xD5, 0xA9, 0x03, 0x8D, 0x0F, 0xD2, 0xA5, 0xF1, 0x29, 0x10, 0xF0, 0x0F, 0xAC, 0xE2, 0x0D, 0xB9, 147 173,114,5,133,254,173,115,5,133,255,160,19,177,254,170,173,
148 0xC6, 0x09, 0x8D, 0xC9, 0x0D, 0xB9, 0x05, 0x0A, 0x8D, 0xCA, 0x0D, 0xAD, 0xC9, 0x0D, 0x8D, 0x00, 148 118,5,133,254,173,119,5,133,255,172,104,5,177,254,201,207,
149 0xD2, 0xAD, 0xCA, 0x0D, 0x8D, 0x02, 0xD2, 0xAD, 0xCB, 0x0D, 0x8D, 0x04, 0xD2, 0xAD, 0xCC, 0x0D, 149 208,13,152,24,105,85,168,177,254,48,15,170,76,52,6,201,
150 0x8D, 0x06, 0xD2, 0xAD, 0xC1, 0x0D, 0xA2, 0xFF, 0xAC, 0x1B, 0x0E, 0xC0, 0x01, 0xD0, 0x05, 0xAE, 150 143,240,7,201,239,240,3,136,16,226,142,108,5,142,109,5,
151 0x19, 0x0E, 0xF0, 0x03, 0x8D, 0x01, 0xD2, 0xAD, 0xC2, 0x0D, 0xE0, 0x01, 0xF0, 0x03, 0x8D, 0x03, 151 96,41,15,240,245,142,221,10,142,243,10,142,2,11,140,222,
152 0xD2, 0xC0, 0x02, 0xF0, 0x14, 0xAD, 0xC3, 0x0D, 0xE0, 0x02, 0xF0, 0x03, 0x8D, 0x05, 0xD2, 0xAD, 152 10,140,244,10,140,3,11,96,142,114,5,134,254,140,115,5,
153 0xC4, 0x0D, 0xE0, 0x03, 0xF0, 0x03, 0x8D, 0x07, 0xD2, 0xA5, 0xF0, 0x05, 0xF1, 0x05, 0xF2, 0x05, 153 132,255,24,138,105,20,141,116,5,152,105,0,141,117,5,142,
154 0xF3, 0x0D, 0x1C, 0x0E, 0x8D, 0x08, 0xD2, 0x60, 0x04, 0x02, 0x00, 0x00, 0xBD, 0xD9, 0x0D, 0x85, 154 118,5,200,200,140,119,5,160,19,177,254,141,108,5,141,109,
155 0xEC, 0xBD, 0xDD, 0x0D, 0x85, 0xED, 0x05, 0xEC, 0xD0, 0x08, 0x9D, 0xC1, 0x0D, 0x95, 0xF0, 0x4C, 155 5,162,8,169,0,141,113,5,157,0,210,224,3,176,8,157,
156 0xF8, 0x05, 0xB4, 0xF4, 0xC0, 0x20, 0xF0, 0x42, 0xB1, 0xEC, 0x38, 0xFD, 0xC5, 0x0D, 0x2C, 0x3A, 156 9,5,169,255,157,57,5,202,16,233,169,128,162,3,157,75,
157 0x07, 0xF0, 0x02, 0x29, 0xF0, 0x9D, 0xC1, 0x0D, 0xC8, 0xB1, 0xEC, 0x8D, 0x1E, 0x0E, 0xC8, 0x94, 157 5,202,16,250,96,169,1,141,113,5,169,0,240,238,41,3,
158 0xF4, 0x29, 0x07, 0xF0, 0x3C, 0xA8, 0xB9, 0x7E, 0x09, 0x8D, 0xCB, 0x06, 0xB9, 0x85, 0x09, 0x8D, 158 201,3,240,240,224,64,176,236,192,26,176,232,170,169,128,157,
159 0xCC, 0x06, 0xAD, 0x1E, 0x0E, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x09, 0x28, 0xA8, 0xB1, 0xEC, 0x18, 159 75,5,169,0,157,57,5,157,60,5,157,63,5,173,111,5,
160 0x20, 0xFF, 0xFF, 0xA9, 0x00, 0x95, 0xF0, 0x4C, 0xF8, 0x05, 0xBD, 0x09, 0x0E, 0xF0, 0x12, 0xDE, 160 157,12,5,173,112,5,10,10,10,133,254,24,173,114,5,105,
161 0x0D, 0x0E, 0xD0, 0x0D, 0x9D, 0x0D, 0x0E, 0xBD, 0xC1, 0x0D, 0x29, 0x0F, 0xF0, 0x03, 0xDE, 0xC1, 161 48,72,173,115,5,105,1,168,104,24,101,254,157,97,5,152,
162 0x0D, 0xA0, 0x23, 0xB1, 0xEC, 0x95, 0xF0, 0xBD, 0x11, 0x0E, 0x18, 0x69, 0x25, 0xA8, 0x29, 0x03, 162 105,0,157,100,5,24,173,114,5,105,148,133,254,173,115,5,
163 0x9D, 0x11, 0x0E, 0x88, 0xB1, 0xEC, 0x7D, 0xD1, 0x0D, 0x9D, 0xE1, 0x0D, 0x20, 0x77, 0x09, 0x9D, 163 105,0,133,255,173,112,5,10,109,112,5,10,168,177,254,157,
164 0xC9, 0x0D, 0xBD, 0x05, 0x0E, 0xF0, 0x06, 0xDE, 0x05, 0x0E, 0x4C, 0xDF, 0x05, 0xBD, 0xBD, 0x0D, 164 79,5,200,177,254,157,82,5,41,7,141,110,5,200,177,254,
165 0x8D, 0x1E, 0x07, 0x10, 0xFE, 0x4C, 0xC2, 0x08, 0x00, 0x4C, 0xE5, 0x08, 0x00, 0x4C, 0xFB, 0x08, 165 157,85,5,200,177,254,157,88,5,200,177,254,157,91,5,200,
166 0x00, 0x4C, 0x15, 0x09, 0x00, 0x4C, 0x25, 0x09, 0x00, 0x4C, 0x38, 0x09, 0x00, 0x4C, 0x42, 0x09, 166 177,254,157,94,5,160,0,173,110,5,201,3,208,2,160,2,
167 0x10, 0x4C, 0x48, 0x09, 0xA9, 0x00, 0x9D, 0xC5, 0x0D, 0xAC, 0x1F, 0x0E, 0x88, 0xC8, 0xB1, 0xEC, 167 201,7,208,2,160,4,185,178,11,133,254,185,179,11,133,255,
168 0xC9, 0xFE, 0xD0, 0x04, 0x8C, 0x1F, 0x0E, 0x60, 0xC9, 0xE0, 0x90, 0x08, 0xAD, 0xBB, 0x0D, 0x8D, 168 189,85,5,74,74,74,74,24,109,111,5,141,111,5,141,194,
169 0x17, 0x0E, 0xD0, 0xE9, 0xC9, 0xD0, 0x90, 0x0A, 0x29, 0x0F, 0x8D, 0xBC, 0x0D, 0x8D, 0x15, 0x0E, 169 7,168,173,110,5,201,7,208,15,152,10,168,177,254,157,45,
170 0x10, 0xDB, 0xC9, 0xC0, 0x90, 0x09, 0x29, 0x0F, 0x49, 0x0F, 0x9D, 0xC5, 0x0D, 0x10, 0xCE, 0xC9, 170 5,200,140,111,5,76,131,7,177,254,157,45,5,189,85,5,
171 0x80, 0x90, 0x07, 0x29, 0x3F, 0x9D, 0xF1, 0x0D, 0x10, 0xC3, 0xC9, 0x40, 0x90, 0x1B, 0xC8, 0x8C, 171 41,15,24,109,111,5,141,111,5,172,111,5,173,110,5,201,
172 0x1F, 0x0E, 0x29, 0x1F, 0x9D, 0xE5, 0x0D, 0x0A, 0xA8, 0xB9, 0xFF, 0xFF, 0x9D, 0xD9, 0x0D, 0xC8, 172 5,8,177,254,40,240,8,221,45,5,208,3,56,233,1,157,
173 0xB9, 0xFF, 0xFF, 0x9D, 0xDD, 0x0D, 0x4C, 0x3E, 0x07, 0x8C, 0x1F, 0x0E, 0x8D, 0x1E, 0x0E, 0x18, 173 48,5,189,79,5,72,41,3,168,185,184,11,157,54,5,104,
174 0x7D, 0xD5, 0x0D, 0x9D, 0xD1, 0x0D, 0xAD, 0x1B, 0x0E, 0xF0, 0x42, 0xC9, 0x02, 0xF0, 0x3A, 0xBD, 174 74,74,74,74,160,62,201,15,240,16,160,55,201,14,240,10,
175 0xE5, 0x0D, 0xC9, 0x1F, 0xD0, 0x37, 0xAD, 0x1E, 0x0E, 0x38, 0xE9, 0x01, 0x29, 0x0F, 0xA8, 0xB1, 175 160,48,201,13,240,4,24,105,0,168,185,188,11,157,51,5,
176 0xFE, 0x85, 0xFD, 0x98, 0x09, 0x10, 0xA8, 0xB1, 0xFE, 0x85, 0xF8, 0xA0, 0x01, 0x05, 0xFD, 0xD0, 176 96,216,165,252,72,165,253,72,165,254,72,165,255,72,173,113,
177 0x02, 0xA0, 0x00, 0x8C, 0x1A, 0x0E, 0xA9, 0x00, 0x85, 0xFC, 0x9D, 0xD9, 0x0D, 0x9D, 0xDD, 0x0D, 177 5,208,3,76,5,11,173,78,5,240,3,76,110,9,173,108,
178 0x8A, 0x0A, 0x8D, 0x18, 0x0E, 0x8E, 0x19, 0x0E, 0x60, 0xE0, 0x02, 0xB0, 0x63, 0xBD, 0xD9, 0x0D, 178 5,205,109,5,240,3,76,91,9,173,103,5,240,3,76,220,
179 0x85, 0xEE, 0xBD, 0xDD, 0x0D, 0x85, 0xEF, 0x05, 0xEE, 0xF0, 0x4A, 0xA0, 0x20, 0xB1, 0xEE, 0x29, 179 8,162,2,188,75,5,48,3,157,75,5,157,69,5,202,16,
180 0x0F, 0x9D, 0xF9, 0x0D, 0xB1, 0xEE, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0xBD, 0x0D, 0xC8, 0xB1, 0xEE, 180 242,173,118,5,133,252,173,119,5,133,253,172,104,5,132,254,
181 0x0A, 0x0A, 0x48, 0x29, 0x3F, 0x9D, 0x05, 0x0E, 0x68, 0x29, 0xC0, 0x9D, 0xCD, 0x0D, 0xC8, 0xB1, 181 204,106,5,208,25,173,107,5,240,20,173,104,5,172,105,5,
182 0xEE, 0x9D, 0x09, 0x0E, 0x9D, 0x0D, 0x0E, 0xA9, 0x00, 0x95, 0xF4, 0x9D, 0x11, 0x0E, 0x9D, 0xFD, 182 140,104,5,206,107,5,208,232,141,104,5,168,16,226,162,0,
183 0x0D, 0x9D, 0x01, 0x0E, 0xBD, 0xD1, 0x0D, 0x9D, 0xE1, 0x0D, 0x20, 0x75, 0x09, 0x9D, 0xC9, 0x0D, 183 177,252,201,254,208,14,172,104,5,200,196,254,240,67,140,104,
184 0xEC, 0x19, 0x0E, 0xF0, 0x01, 0x60, 0xA0, 0xFF, 0x8C, 0x19, 0x0E, 0xC8, 0x8C, 0x1A, 0x0E, 0x60, 184 5,76,26,8,157,66,5,24,152,105,85,168,232,224,3,144,
185 0xE0, 0x02, 0xD0, 0x33, 0xAC, 0xD3, 0x0D, 0xB9, 0x45, 0x0B, 0x8D, 0x79, 0x0D, 0xB9, 0x81, 0x0B, 185 223,172,104,5,177,252,16,122,201,255,240,118,74,74,74,41,
186 0x8D, 0x7F, 0x0D, 0xA9, 0x00, 0x85, 0xF9, 0x85, 0xFA, 0xAD, 0xE7, 0x0D, 0x29, 0x0F, 0xA8, 0xB1, 186 14,170,189,164,11,141,126,8,189,165,11,141,127,8,173,67,
187 0xFE, 0x85, 0xFB, 0x98, 0x09, 0x10, 0xA8, 0xB1, 0xFE, 0x8D, 0x89, 0x0D, 0x05, 0xFB, 0xD0, 0x06, 187 5,133,255,32,147,8,140,104,5,192,85,176,4,196,254,208,
188 0x8D, 0x79, 0x0D, 0x8D, 0x7F, 0x0D, 0x60, 0xAD, 0xE8, 0x0D, 0x29, 0x0F, 0xA8, 0xB1, 0xFE, 0x85, 188 143,164,254,140,104,5,76,5,11,32,148,6,160,255,96,48,
189 0xFD, 0x98, 0x09, 0x10, 0xA8, 0xB1, 0xFE, 0x05, 0xFD, 0xF0, 0x0F, 0xB1, 0xFE, 0x38, 0xE5, 0xFD, 189 251,168,96,48,247,56,152,229,255,168,96,48,239,24,152,101,
190 0x85, 0xF8, 0xA9, 0x00, 0x85, 0xFC, 0xA9, 0x8D, 0xD0, 0x02, 0xA9, 0xAD, 0x8D, 0x61, 0x0D, 0x8D, 190 255,168,96,48,231,141,108,5,141,109,5,200,96,48,221,173,
191 0x38, 0x0D, 0xA9, 0x18, 0x8D, 0x07, 0xD2, 0x60, 0xAD, 0x1D, 0x0E, 0x29, 0x07, 0x4A, 0x4A, 0x90, 191 68,5,48,216,141,107,5,200,140,105,5,24,152,101,255,141,
192 0x12, 0xD0, 0x18, 0xBD, 0xF9, 0x0D, 0x18, 0x9D, 0x01, 0x0E, 0x7D, 0xC9, 0x0D, 0x9D, 0xC9, 0x0D, 192 106,5,96,136,48,10,177,252,201,143,240,4,201,239,208,243,
193 0x4C, 0xDF, 0x05, 0xA9, 0x00, 0x9D, 0x01, 0x0E, 0x4C, 0xDF, 0x05, 0xBD, 0xC9, 0x0D, 0x38, 0xFD, 193 200,96,162,2,189,72,5,240,5,222,72,5,16,99,189,75,
194 0xF9, 0x0D, 0x9D, 0xC9, 0x0D, 0x38, 0xA9, 0x00, 0xFD, 0xF9, 0x0D, 0x9D, 0x01, 0x0E, 0x4C, 0xDF, 194 5,208,94,188,66,5,192,64,176,87,173,116,5,133,252,173,
195 0x05, 0xBD, 0xFD, 0x0D, 0x18, 0x9D, 0x01, 0x0E, 0x7D, 0xC9, 0x0D, 0x9D, 0xC9, 0x0D, 0x18, 0xBD, 195 117,5,133,253,177,252,133,254,24,152,105,64,168,177,252,133,
196 0xFD, 0x0D, 0x7D, 0xF9, 0x0D, 0x9D, 0xFD, 0x0D, 0x4C, 0xDF, 0x05, 0xBD, 0xE1, 0x0D, 0x38, 0xFD, 196 255,37,254,201,255,240,58,188,69,5,177,254,41,192,208,12,
197 0xFD, 0x0D, 0x9D, 0xE1, 0x0D, 0x20, 0x75, 0x09, 0x4C, 0x05, 0x09, 0xA9, 0x00, 0x38, 0xFD, 0xFD, 197 177,254,41,63,157,15,5,254,69,5,16,235,201,64,208,19,
198 0x0D, 0x9D, 0x01, 0x0E, 0xBD, 0xC9, 0x0D, 0x38, 0xFD, 0xFD, 0x0D, 0x4C, 0x05, 0x09, 0xBD, 0xE1, 198 177,254,41,63,141,111,5,189,15,5,141,112,5,32,188,6,
199 0x0D, 0x18, 0x7D, 0xFD, 0x0D, 0x4C, 0x1C, 0x09, 0x20, 0x55, 0x09, 0x4C, 0xD0, 0x08, 0x20, 0x55, 199 76,72,9,201,128,208,10,177,254,41,63,157,72,5,254,69,
200 0x09, 0x18, 0x7D, 0xE1, 0x0D, 0x20, 0x9B, 0x09, 0x4C, 0xDF, 0x05, 0xBC, 0xFD, 0x0D, 0xBD, 0xF9, 200 5,202,16,144,174,103,5,232,224,48,144,2,162,0,142,103,
201 0x0D, 0x30, 0x02, 0xC8, 0xC8, 0x88, 0x98, 0x9D, 0xFD, 0x0D, 0xDD, 0xF9, 0x0D, 0xD0, 0x08, 0xBD, 201 5,206,109,5,208,14,173,108,5,141,109,5,173,103,5,208,
202 0xF9, 0x0D, 0x49, 0xFF, 0x9D, 0xF9, 0x0D, 0xBD, 0xFD, 0x0D, 0x60, 0x29, 0x3F, 0x1D, 0xCD, 0x0D, 202 3,238,104,5,172,48,5,173,82,5,41,7,201,5,240,4,
203 0xA8, 0xB9, 0xFF, 0xFF, 0x60, 0x94, 0x91, 0x98, 0xA5, 0xAD, 0xB4, 0xC0, 0x09, 0x09, 0x09, 0x09, 203 201,6,208,1,136,140,39,5,160,0,201,5,240,4,201,6,
204 0x09, 0x09, 0x09, 0x40, 0x00, 0x20, 0x00, 0x7D, 0xC9, 0x0D, 0x9D, 0xC9, 0x0D, 0x60, 0x7D, 0xD1, 204 208,2,160,2,201,7,208,2,160,40,140,44,5,162,2,189,
205 0x0D, 0x9D, 0xE1, 0x0D, 0x20, 0x75, 0x09, 0x9D, 0xC9, 0x0D, 0x60, 0x9D, 0xC9, 0x0D, 0xBD, 0x8D, 205 82,5,41,224,157,40,5,189,97,5,133,252,189,100,5,133,
206 0x09, 0x10, 0x0C, 0x9D, 0xC9, 0x0D, 0xA9, 0x80, 0xD0, 0x05, 0x9D, 0xC9, 0x0D, 0xA9, 0x01, 0x0D, 206 253,189,57,5,201,255,240,54,201,15,208,32,189,63,5,240,
207 0x1C, 0x0E, 0x8D, 0x1C, 0x0E, 0x60, 0x2D, 0x0A, 0xD2, 0x9D, 0xC9, 0x0D, 0x60, 0xF2, 0x33, 0x96, 207 45,222,63,5,189,63,5,208,37,188,9,5,240,1,136,152,
208 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 208 157,9,5,189,88,5,157,63,5,76,232,9,189,57,5,74,
209 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 209 168,177,252,144,4,74,74,74,74,41,15,157,9,5,188,45,
210 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 210 5,189,82,5,41,7,201,1,208,31,136,152,200,221,48,5,
211 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x0D, 0x0D, 0x0C, 0x0B, 211 8,169,1,40,208,2,10,10,61,60,5,240,12,188,48,5,
212 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 212 192,255,208,5,169,0,157,9,5,152,157,36,5,169,1,141,
213 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 213 110,5,189,57,5,201,15,240,56,41,7,168,185,208,12,133,
214 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 214 254,189,57,5,41,8,8,138,40,24,240,2,105,3,168,185,
215 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 215 91,5,37,254,240,27,189,51,5,157,36,5,142,110,5,202,
216 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x16, 0x16, 0x17, 0x17, 0x17, 216 16,8,141,39,5,169,0,141,44,5,232,189,54,5,157,40,
217 0x17, 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19, 0x1A, 0x15, 0x15, 0x16, 0x16, 0x16, 217 5,189,57,5,41,15,201,15,240,16,254,57,5,189,57,5,
218 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1A, 0x1B, 0x14, 0x15, 0x15, 0x16, 0x16, 218 201,15,208,6,189,88,5,157,63,5,189,75,5,16,10,189,
219 0x17, 0x17, 0x18, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x14, 0x14, 0x15, 0x15, 0x16, 219 9,5,208,5,169,64,157,75,5,254,60,5,160,0,189,82,
220 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x1C, 0x13, 0x14, 0x14, 0x15, 0x16, 220 5,74,74,74,74,144,1,136,74,144,1,200,24,152,125,45,
221 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1C, 0x13, 0x13, 0x14, 0x15, 0x15, 221 5,157,45,5,189,48,5,201,255,208,2,160,0,24,152,125,
222 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x12, 0x13, 0x14, 0x14, 0x15, 222 48,5,157,48,5,202,48,3,76,153,9,173,40,5,141,43,
223 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1B, 0x1C, 0x1C, 0x1D, 0x12, 0x13, 0x13, 0x14, 0x15, 223 5,173,82,5,41,7,170,160,3,173,110,5,240,3,188,216,
224 0x16, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1D, 0x1D, 0x12, 0x12, 0x13, 0x14, 0x15, 224 12,152,72,185,188,12,8,41,127,170,152,41,3,10,168,189,
225 0x16, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x14, 0x15, 225 36,5,153,0,210,200,189,9,5,224,3,208,3,173,9,5,
226 0x16, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x14, 0x15, 226 29,40,5,40,16,2,169,0,153,0,210,104,168,136,41,3,
227 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1B, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x14, 0x14, 227 208,207,160,8,173,44,5,153,0,210,24,104,133,255,104,133,
228 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1C, 0x1D, 0x1E, 0x11, 0x12, 0x13, 0x13, 0x14, 228 254,104,133,253,104,133,252,96,104,170,240,78,201,2,240,6,
229 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1D, 0x1E, 0x11, 0x12, 0x12, 0x13, 0x14, 229 104,104,202,208,251,96,165,20,197,20,240,252,173,36,2,201,
230 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1E, 0x10, 0x11, 0x12, 0x13, 0x14, 230 137,208,7,173,37,2,201,11,240,230,173,36,2,141,146,11,
231 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x22, 0x24, 0x26, 0x29, 231 173,37,2,141,147,11,169,137,141,36,2,169,11,141,37,2,
232 0x2B, 0x2E, 0x30, 0x33, 0x37, 0x3A, 0x3D, 0x41, 0x45, 0x49, 0x4D, 0x52, 0x57, 0x5C, 0x61, 0x67, 232 104,104,240,3,56,233,1,141,96,11,104,168,104,170,169,112,
233 0x6E, 0x74, 0x7B, 0x82, 0x8A, 0x92, 0x9B, 0xA4, 0xAE, 0xB8, 0xC3, 0xCF, 0xDC, 0xE9, 0xF6, 0x05, 233 32,120,5,169,0,162,0,76,120,5,165,20,197,20,240,252,
234 0x15, 0x25, 0x37, 0x49, 0x5D, 0x71, 0x87, 0x9F, 0xB8, 0xD2, 0xED, 0x0B, 0x2A, 0x4B, 0x6E, 0x93, 234 173,36,2,201,137,208,174,173,37,2,201,11,208,167,173,146,
235 0xBA, 0xE3, 0x0F, 0x3E, 0x70, 0xA4, 0xDB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 235 11,141,36,2,173,147,11,141,37,2,169,64,76,120,5,32,
236 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 236 203,7,144,3,32,120,11,76,255,255,178,5,221,5,168,6,
237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 237 59,6,123,6,148,6,159,6,82,6,147,8,153,8,157,8,
238 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 238 165,8,173,8,183,8,205,8,188,11,253,11,62,12,128,160,
239 0x03, 0x03, 0x03, 0xE5, 0x2A, 0x40, 0x59, 0x64, 0xEE, 0x08, 0xA6, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 239 32,64,255,241,228,215,203,192,181,170,161,152,143,135,127,120,
240 0x0C, 0x0D, 0x0D, 0x8E, 0x32, 0x07, 0x8C, 0x36, 0x07, 0x29, 0x07, 0xA8, 0xB9, 0xBD, 0x0B, 0x8D, 240 114,107,101,95,90,85,80,75,71,67,63,60,56,53,50,47,
241 0xE3, 0x0B, 0xB9, 0xC5, 0x0B, 0x8D, 0xE4, 0x0B, 0x4C, 0xFF, 0xFF, 0xAD, 0x36, 0x07, 0xAE, 0x32, 241 44,42,39,37,35,33,31,29,28,26,24,23,22,20,19,18,
242 0x07, 0x8D, 0x94, 0x07, 0x8D, 0x9B, 0x07, 0x8E, 0x95, 0x07, 0x8E, 0x9C, 0x07, 0x18, 0x69, 0x40, 242 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,
243 0x8D, 0x81, 0x05, 0x8D, 0x87, 0x05, 0x90, 0x01, 0xE8, 0x8E, 0x82, 0x05, 0x8E, 0x88, 0x05, 0x18, 243 1,0,0,0,0,0,0,242,233,218,206,191,182,170,161,152,
244 0x69, 0x80, 0x8D, 0x7C, 0x09, 0x90, 0x01, 0xE8, 0x8E, 0x7D, 0x09, 0xE8, 0x8D, 0x1F, 0x0C, 0x8E, 244 143,137,128,122,113,107,101,95,0,86,80,103,96,90,85,81,
245 0x20, 0x0C, 0xA2, 0x09, 0xBD, 0xFF, 0xFF, 0x9D, 0xB3, 0x0D, 0xCA, 0x10, 0xF7, 0xCE, 0xBC, 0x0D, 245 76,72,67,63,61,57,52,51,57,45,42,40,37,36,33,31,
246 0xA9, 0x00, 0x8D, 0x2E, 0x07, 0xA2, 0x62, 0x9D, 0xBD, 0x0D, 0xCA, 0x10, 0xFA, 0xA2, 0x08, 0x9D, 246 30,0,0,15,14,13,12,11,10,9,8,7,6,5,4,3,
247 0x00, 0xD2, 0xCA, 0x10, 0xFA, 0x60, 0x20, 0x2A, 0x0C, 0xAD, 0x32, 0x07, 0x0A, 0x8D, 0x16, 0x0E, 247 2,1,0,0,56,11,140,10,0,10,106,9,232,8,106,8,
248 0xAD, 0xBB, 0x0D, 0x8D, 0x17, 0x0E, 0xA9, 0x01, 0x8D, 0x15, 0x0E, 0x8D, 0x2E, 0x07, 0x60, 0xAD, 248 239,7,128,7,8,7,174,6,70,6,230,5,149,5,65,5,
249 0x36, 0x07, 0x85, 0xFE, 0xAD, 0x32, 0x07, 0x85, 0xFF, 0x60, 0xAD, 0x36, 0x07, 0x29, 0x03, 0xAA, 249 246,4,176,4,110,4,48,4,246,3,187,3,132,3,82,3,
250 0xAD, 0x32, 0x07, 0x20, 0xC6, 0x07, 0xAD, 0x1A, 0x0E, 0xF0, 0xEE, 0x0E, 0x36, 0x07, 0x20, 0xBE, 250 34,3,244,2,200,2,160,2,122,2,85,2,52,2,20,2,
251 0x0C, 0xA9, 0x01, 0x8D, 0x1B, 0x0E, 0xAD, 0x1A, 0x0E, 0xF0, 0xDE, 0xC9, 0x01, 0xD0, 0x05, 0xA0, 251 245,1,216,1,189,1,164,1,141,1,119,1,96,1,78,1,
252 0x00, 0xEE, 0x1A, 0x0E, 0xB1, 0xFC, 0xAE, 0x18, 0x0E, 0x4A, 0x4A, 0x4A, 0x4A, 0x09, 0x10, 0x8D, 252 56,1,39,1,21,1,6,1,247,0,232,0,219,0,207,0,
253 0x0A, 0xD4, 0x8D, 0x0A, 0xD4, 0x9D, 0x01, 0xD2, 0xB1, 0xFC, 0x09, 0x10, 0x8D, 0x0A, 0xD4, 0x8D, 253 195,0,184,0,172,0,162,0,154,0,144,0,136,0,127,0,
254 0x0A, 0xD4, 0x9D, 0x01, 0xD2, 0xC8, 0xD0, 0xCE, 0xE6, 0xFD, 0xA5, 0xFD, 0xC5, 0xF8, 0xD0, 0xC6, 254 120,0,112,0,106,0,100,0,94,0,87,0,82,0,50,0,
255 0x8C, 0x1A, 0x0E, 0x60, 0x90, 0x15, 0xA9, 0xEA, 0x8D, 0x99, 0x0C, 0x8D, 0x9A, 0x0C, 0x8D, 0x9B, 255 10,0,0,1,2,131,0,1,2,3,1,0,2,131,1,0,
256 0x0C, 0x8D, 0xA6, 0x0C, 0x8D, 0xA7, 0x0C, 0x8D, 0xA8, 0x0C, 0x60, 0xA9, 0x8D, 0x8D, 0x99, 0x0C, 256 2,3,1,2,128,3,128,64,32,16,8,4,2,1,3,3,
257 0x8D, 0xA6, 0x0C, 0xA9, 0x0A, 0x8D, 0x9A, 0x0C, 0x8D, 0xA7, 0x0C, 0xA9, 0xD4, 0x8D, 0x9B, 0x0C, 257 3,3,7,11,15,19
258 0x8D, 0xA8, 0x0C, 0x60, 0xA9, 0x00, 0x8D, 0x1A, 0x0E, 0xAD, 0x32, 0x07, 0x4A, 0x20, 0xBE, 0x0C, 258END_CONST_ARRAY;
259 0xA9, 0x01, 0x8D, 0x1B, 0x0E, 0x20, 0x80, 0x0C, 0xAD, 0x1B, 0x0E, 0xD0, 0xF8, 0x60, 0xA9, 0x02, 259CONST_ARRAY(byte, cms_obx)
260 0x8D, 0x1B, 0x0E, 0x8D, 0x19, 0x0E, 0xA9, 0x18, 0x8D, 0x07, 0xD2, 0xA9, 0x11, 0x85, 0xFA, 0xA9, 260 255,255,0,5,186,15,234,234,234,76,21,8,76,92,15,35,
261 0x0D, 0x85, 0xFB, 0xA9, 0xAD, 0x8D, 0x61, 0x0D, 0x8D, 0x38, 0x0D, 0xA0, 0x00, 0x8C, 0x79, 0x0D, 261 5,169,5,173,5,184,5,0,0,0,0,0,0,0,0,0,
262 0x8C, 0x7F, 0x0D, 0xAE, 0x0B, 0xD4, 0xB1, 0xFC, 0x4A, 0x4A, 0x4A, 0x4A, 0x09, 0x10, 0x8D, 0x07, 262 0,0,0,128,128,128,128,128,128,0,0,0,0,0,0,255,
263 0xD2, 0x20, 0x75, 0x0D, 0xEC, 0x0B, 0xD4, 0xF0, 0xFB, 0x8D, 0x05, 0xD2, 0xAE, 0x0B, 0xD4, 0xB1, 263 255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,
264 0xFC, 0xE6, 0xFC, 0xD0, 0x10, 0xE6, 0xFD, 0xC6, 0xF8, 0xD0, 0x0A, 0xA9, 0xAD, 0x8D, 0x61, 0x0D, 264 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
265 0x8D, 0x38, 0x0D, 0xA9, 0x08, 0x09, 0x10, 0x8D, 0x07, 0xD2, 0x20, 0x75, 0x0D, 0xEC, 0x0B, 0xD4, 265 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
266 0xF0, 0xFB, 0x8D, 0x05, 0xD2, 0xAD, 0x1B, 0x0E, 0xD0, 0xB9, 0x60, 0x18, 0xA5, 0xF9, 0x69, 0x00, 266 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
267 0x85, 0xF9, 0xA5, 0xFA, 0x69, 0x00, 0x85, 0xFA, 0x90, 0x0F, 0xE6, 0xFB, 0xA5, 0xFB, 0xC9, 0x00, 267 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
268 0xD0, 0x07, 0x8C, 0x79, 0x0D, 0x8C, 0x7F, 0x0D, 0x60, 0xB1, 0xFA, 0x24, 0xF9, 0x30, 0x04, 0x4A, 268 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
269 0x4A, 0x4A, 0x4A, 0x29, 0x0F, 0xA8, 0xB9, 0x45, 0x0A, 0xA0, 0x00, 0x60, 0xA0, 0x00, 0x8C, 0x1B, 269 0,0,0,0,0,0,0,0,0,0,130,0,0,6,6,0,
270 0x0E, 0x8C, 0x1A, 0x0E, 0x88, 0x8C, 0x19, 0x0E, 0x60 270 128,20,128,128,0,0,0,0,0,0,0,0,0,0,0,15,
271}; 271 15,0,0,0,0,0,0,0,0,255,0,0,0,0,0,0,
272static const unsigned char rmt4_obx[] = { 272 1,2,131,0,1,2,3,1,0,2,131,1,0,2,3,1,
273 0xFF, 0xFF, 0x90, 0x03, 0x60, 0x0B, 0x80, 0x00, 0x80, 0x20, 0x80, 0x40, 0x00, 0xC0, 0x80, 0x80, 273 2,128,3,128,64,32,16,8,4,2,1,75,8,118,8,133,
274 0x80, 0xA0, 0x00, 0xC0, 0x40, 0xC0, 0x00, 0x01, 0x05, 0x0B, 0x15, 0x00, 0x01, 0xFF, 0xFF, 0x01, 274 9,19,9,80,9,110,9,124,9,26,9,128,160,32,64,255,
275 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x01, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x01, 275 241,228,215,203,192,181,170,161,152,143,135,127,120,114,107,101,
276 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 276 95,90,85,80,75,71,67,63,60,56,53,50,47,44,42,39,
277 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 277 37,35,33,31,29,28,26,24,23,22,20,19,18,17,16,15,
278 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 278 14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,0,
279 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 279 0,0,0,0,242,233,218,206,191,182,170,161,152,143,137,128,
280 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x00, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0xF2, 0xE6, 280 122,113,107,101,95,0,86,80,103,96,90,85,81,76,72,67,
281 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x5C, 281 63,61,57,52,51,57,45,42,40,37,36,33,31,30,0,0,
282 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 0x38, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 282 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,
283 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 283 0,56,11,140,10,0,10,106,9,232,8,106,8,239,7,128,
284 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 0x99, 284 7,8,7,174,6,70,6,230,5,149,5,65,5,246,4,176,
285 0x8E, 0x87, 0x7F, 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 0x3C, 285 4,110,4,48,4,246,3,187,3,132,3,82,3,34,3,244,
286 0x39, 0x37, 0x33, 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 0x17, 286 2,200,2,160,2,122,2,85,2,52,2,20,2,245,1,216,
287 0x16, 0x15, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 287 1,189,1,164,1,141,1,119,1,96,1,78,1,56,1,39,
288 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 0x90, 288 1,21,1,6,1,247,0,232,0,219,0,207,0,195,0,184,
289 0x88, 0x80, 0x79, 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x39, 289 0,172,0,162,0,154,0,144,0,136,0,127,0,120,0,112,
290 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 290 0,106,0,100,0,94,0,87,0,82,0,50,0,10,0,0,
291 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 291 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
292 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 292 0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,
293 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 293 0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,0,
294 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 294 0,0,0,1,1,1,1,2,2,2,2,2,3,3,3,0,
295 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 295 0,1,1,1,2,2,2,2,2,3,3,3,3,4,4,0,
296 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 296 0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,0,
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 297 0,1,1,2,2,2,3,3,4,4,4,5,5,6,6,0,
298 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 298 0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,0,
299 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 299 1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,0,
300 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 300 1,1,2,2,3,4,4,5,5,6,7,7,8,8,9,0,
301 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 301 1,1,2,3,3,4,5,5,6,7,7,8,9,9,10,0,
302 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 302 1,1,2,3,4,4,5,6,7,7,8,9,10,10,11,0,
303 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 303 1,2,2,3,4,5,6,7,8,9,9,10,11,11,12,0,
304 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 304 1,2,3,4,5,5,6,7,8,9,10,10,11,12,13,0,
305 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05, 305 1,2,3,4,5,6,7,7,8,9,10,11,12,13,14,0,
306 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06, 306 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,
307 0x07, 0x07, 0x08, 0x09, 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07, 307 12,12,12,18,12,28,12,38,12,50,12,79,12,233,5,42,
308 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 308 6,107,6,161,11,196,11,185,11,0,0,0,0,0,0,0,
309 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 309 0,0,0,3,3,3,3,7,11,15,19,141,143,5,142,144,
310 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 310 5,140,145,5,41,112,74,74,74,170,169,3,141,15,210,189,
311 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 311 213,5,141,73,8,189,214,5,141,74,8,169,3,141,31,210,
312 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x4C, 0x0F, 0x06, 0x4C, 0xFC, 0x07, 0x4C, 0x21, 0x08, 0x4C, 312 169,1,141,146,5,172,145,5,174,144,5,173,143,5,76,72,
313 0x58, 0x06, 0x4C, 0x2B, 0x0B, 0x86, 0xD3, 0x84, 0xD4, 0x48, 0xA0, 0xA8, 0xA9, 0x00, 0x99, 0x7F, 313 8,173,147,5,133,252,173,148,5,133,253,160,0,138,240,28,
314 0x02, 0x88, 0xD0, 0xFA, 0xA0, 0x04, 0xB1, 0xD3, 0x8D, 0x15, 0x08, 0xC8, 0xB1, 0xD3, 0x8D, 0x24, 314 177,252,201,143,240,4,201,239,208,12,202,208,9,200,192,84,
315 0x03, 0xC8, 0xB1, 0xD3, 0x8D, 0x05, 0x08, 0x8D, 0x26, 0x03, 0xA0, 0x08, 0xB1, 0xD3, 0x99, 0xC3, 315 176,9,152,170,16,6,200,192,84,144,229,96,142,149,5,169,
316 0x00, 0xC8, 0xC0, 0x10, 0xD0, 0xF6, 0x68, 0x48, 0x0A, 0x0A, 0x18, 0x65, 0xD1, 0x85, 0xD1, 0x68, 316 0,162,5,157,17,5,157,23,5,157,29,5,202,16,244,141,
317 0x08, 0x29, 0xC0, 0x0A, 0x2A, 0x2A, 0x28, 0x65, 0xD2, 0x85, 0xD2, 0x20, 0x6E, 0x06, 0xA9, 0x00, 317 150,5,141,157,5,160,255,140,159,5,173,153,5,133,252,173,
318 0x8D, 0x08, 0xD2, 0xA0, 0x03, 0x8C, 0x0F, 0xD2, 0xA0, 0x08, 0x99, 0x00, 0xD2, 0x88, 0x10, 0xFA, 318 154,5,133,253,160,19,177,252,170,173,147,5,133,252,173,148,
319 0xAD, 0x05, 0x08, 0x60, 0xA2, 0x00, 0x8E, 0x27, 0x03, 0x8A, 0xA8, 0xB1, 0xD1, 0xC9, 0xFE, 0xB0, 319 5,133,253,172,149,5,152,72,169,15,141,169,5,141,170,5,
320 0x2D, 0xA8, 0xB1, 0xCD, 0x9D, 0x80, 0x02, 0xB1, 0xCF, 0x9D, 0x84, 0x02, 0xA9, 0x00, 0x9D, 0x88, 320 177,252,201,135,208,35,152,72,24,105,85,168,177,252,16,2,
321 0x02, 0xA9, 0x01, 0x9D, 0x8C, 0x02, 0xA9, 0x80, 0x9D, 0xB4, 0x02, 0xE8, 0xE0, 0x04, 0xD0, 0xD9, 321 169,15,41,15,141,169,5,152,24,105,85,168,177,252,16,3,
322 0xA5, 0xD1, 0x18, 0x69, 0x04, 0x85, 0xD1, 0x90, 0x1B, 0xE6, 0xD2, 0x4C, 0xBE, 0x06, 0xF0, 0x04, 322 173,169,5,41,15,141,170,5,104,76,243,8,177,252,201,143,
323 0xA9, 0x00, 0xF0, 0xDF, 0xA0, 0x02, 0xB1, 0xD1, 0xAA, 0xC8, 0xB1, 0xD1, 0x85, 0xD2, 0x86, 0xD1, 323 240,7,201,239,240,3,136,16,199,104,168,177,252,201,207,208,
324 0xA2, 0x00, 0xF0, 0xB5, 0xAD, 0x24, 0x03, 0x8D, 0x16, 0x07, 0xA2, 0xFF, 0xE8, 0xDE, 0x8C, 0x02, 324 13,152,24,105,85,168,177,252,48,15,170,76,19,9,201,143,
325 0xD0, 0x45, 0xBD, 0x80, 0x02, 0x85, 0xD3, 0xBD, 0x84, 0x02, 0x85, 0xD4, 0xBC, 0x88, 0x02, 0xFE, 325 240,7,201,239,240,3,136,16,226,142,151,5,142,152,5,96,
326 0x88, 0x02, 0xB1, 0xD3, 0x85, 0xD9, 0x29, 0x3F, 0xC9, 0x3D, 0xF0, 0x11, 0xB0, 0x38, 0x9D, 0x90, 326 142,153,5,134,252,140,154,5,132,253,24,138,105,20,141,155,
327 0x02, 0x9D, 0x10, 0x03, 0xC8, 0xB1, 0xD3, 0x4A, 0x29, 0x7E, 0x9D, 0xB4, 0x02, 0xA9, 0x01, 0x9D, 327 5,152,105,0,141,156,5,24,138,105,0,141,147,5,152,105,
328 0x8C, 0x02, 0xBC, 0x88, 0x02, 0xFE, 0x88, 0x02, 0xB1, 0xD3, 0x4A, 0x66, 0xD9, 0x4A, 0x66, 0xD9, 328 2,141,148,5,160,19,177,252,141,151,5,141,152,5,162,3,
329 0xA5, 0xD9, 0x29, 0xF0, 0x9D, 0x94, 0x02, 0xE0, 0x03, 0xD0, 0xB1, 0xA9, 0xFF, 0x8D, 0x24, 0x03, 329 142,31,210,142,15,210,169,0,141,146,5,160,8,169,0,153,
330 0x8D, 0x25, 0x03, 0x4C, 0x65, 0x07, 0xC9, 0x3F, 0xF0, 0x1B, 0xA5, 0xD9, 0x29, 0xC0, 0xF0, 0x09, 330 0,210,153,16,210,192,6,176,8,153,35,5,169,255,153,41,
331 0x0A, 0x2A, 0x2A, 0x9D, 0x8C, 0x02, 0x4C, 0x11, 0x07, 0xC8, 0xB1, 0xD3, 0x9D, 0x8C, 0x02, 0xFE, 331 5,136,16,233,169,128,162,5,157,29,5,202,16,250,141,157,
332 0x88, 0x02, 0x4C, 0x11, 0x07, 0xA5, 0xD9, 0x30, 0x0C, 0xC8, 0xB1, 0xD3, 0x8D, 0x16, 0x07, 0xFE, 332 5,96,169,0,240,240,141,157,5,240,11,173,143,5,41,7,
333 0x88, 0x02, 0x4C, 0xD6, 0x06, 0xC9, 0xFF, 0xF0, 0x09, 0xC8, 0xB1, 0xD3, 0x9D, 0x88, 0x02, 0x4C, 333 170,169,128,157,29,5,172,145,5,173,144,5,141,143,5,140,
334 0xD6, 0x06, 0x4C, 0x6E, 0x06, 0x4C, 0x21, 0x08, 0xCA, 0x30, 0xFA, 0xBC, 0xB4, 0x02, 0x30, 0xF8, 334 145,5,169,0,157,83,5,157,41,5,157,77,5,152,10,10,
335 0xB1, 0xCB, 0x9D, 0xB8, 0x02, 0x85, 0xD7, 0xC8, 0xB1, 0xCB, 0x9D, 0xBC, 0x02, 0x85, 0xD8, 0xA9, 335 10,133,254,24,173,153,5,105,48,72,173,154,5,105,1,168,
336 0x01, 0x9D, 0x14, 0x03, 0xA8, 0xB1, 0xD7, 0x9D, 0x04, 0x03, 0xC8, 0xB1, 0xD7, 0x9D, 0xC4, 0x02, 336 104,24,101,254,157,101,5,152,105,0,157,71,5,24,173,153,
337 0xC8, 0xB1, 0xD7, 0x9D, 0xC8, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0xF0, 0x02, 0x29, 0x3F, 0x9D, 0x08, 337 5,105,148,133,252,173,154,5,105,0,133,253,173,145,5,10,
338 0x03, 0xB1, 0xD7, 0x29, 0x40, 0x9D, 0xF4, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0x20, 0x03, 0xC8, 0xB1, 338 109,145,5,10,168,140,145,5,200,200,200,200,200,177,252,157,
339 0xD7, 0x9D, 0xD0, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0xD8, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0xDC, 0x02, 339 113,5,136,177,252,157,107,5,136,177,252,157,119,5,136,136,
340 0xC8, 0xB1, 0xD7, 0xA8, 0xB9, 0xA0, 0x03, 0x9D, 0xE0, 0x02, 0x9D, 0xE4, 0x02, 0xB9, 0xA1, 0x03, 340 177,252,157,59,5,160,0,41,7,201,3,208,2,160,2,201,
341 0x9D, 0xE8, 0x02, 0xA0, 0x0A, 0xB1, 0xD7, 0x9D, 0xEC, 0x02, 0xA9, 0x80, 0x9D, 0xD4, 0x02, 0x9D, 341 7,208,2,160,4,185,247,7,133,254,185,248,7,133,255,172,
342 0xB4, 0x02, 0x0A, 0x9D, 0xCC, 0x02, 0x9D, 0x9C, 0x02, 0xA8, 0xB1, 0xD7, 0x9D, 0x00, 0x03, 0x69, 342 145,5,200,200,177,252,74,74,74,74,24,109,143,5,141,143,
343 0x00, 0x9D, 0xC0, 0x02, 0xA9, 0x0C, 0x9D, 0xFC, 0x02, 0xA8, 0xB1, 0xD7, 0x9D, 0xF8, 0x02, 0x4C, 343 5,141,159,10,168,189,59,5,41,7,201,7,208,15,152,10,
344 0x62, 0x07, 0x20, 0x2B, 0x0B, 0xCE, 0x26, 0x03, 0xD0, 0x1D, 0xA9, 0xFF, 0x8D, 0x26, 0x03, 0xCE, 344 168,177,254,157,125,5,200,140,143,5,76,92,10,177,254,157,
345 0x25, 0x03, 0xD0, 0x13, 0xEE, 0x27, 0x03, 0xAD, 0x27, 0x03, 0xC9, 0xFF, 0xF0, 0x03, 0x4C, 0xBE, 345 125,5,172,145,5,200,200,177,252,41,15,24,109,143,5,141,
346 0x06, 0x4C, 0x6E, 0x06, 0x4C, 0x5F, 0x0A, 0xA9, 0x04, 0x85, 0xD6, 0xA2, 0x03, 0xBD, 0xBC, 0x02, 346 143,5,172,143,5,189,59,5,41,7,201,5,8,177,254,40,
347 0xF0, 0xF2, 0x85, 0xD4, 0xBD, 0xB8, 0x02, 0x85, 0xD3, 0xBC, 0xC0, 0x02, 0xB1, 0xD3, 0x85, 0xD9, 347 240,8,221,125,5,208,3,56,233,1,157,89,5,172,145,5,
348 0xC8, 0xB1, 0xD3, 0x85, 0xDA, 0xC8, 0xB1, 0xD3, 0x85, 0xDB, 0xC8, 0x98, 0xDD, 0xC4, 0x02, 0x90, 348 177,252,72,41,3,168,185,229,5,157,131,5,104,74,74,74,
349 0x0A, 0xF0, 0x08, 0xA9, 0x80, 0x9D, 0xCC, 0x02, 0xBD, 0xC8, 0x02, 0x9D, 0xC0, 0x02, 0xA5, 0xD9, 349 74,160,62,201,15,240,16,160,55,201,14,240,10,160,48,201,
350 0x29, 0x0F, 0x1D, 0x94, 0x02, 0xA8, 0xB9, 0x00, 0x05, 0x85, 0xDC, 0xA5, 0xDA, 0x29, 0x0E, 0xA8, 350 13,240,4,24,105,50,168,185,233,5,157,137,5,96,216,165,
351 0xB9, 0x90, 0x03, 0x85, 0xD5, 0xA5, 0xDC, 0x19, 0x91, 0x03, 0x9D, 0x1C, 0x03, 0xBD, 0xDC, 0x02, 351 252,72,165,253,72,165,254,72,165,255,72,173,146,5,208,3,
352 0xF0, 0x28, 0xC9, 0x01, 0xD0, 0x21, 0xBD, 0x9C, 0x02, 0x18, 0x7D, 0xEC, 0x02, 0x18, 0xBC, 0xE0, 352 76,47,15,173,157,5,240,3,76,225,12,173,152,5,205,151,
353 0x02, 0x79, 0xA5, 0x03, 0x9D, 0x9C, 0x02, 0xC8, 0x98, 0xDD, 0xE8, 0x02, 0xD0, 0x03, 0xBD, 0xE4, 353 5,176,3,76,206,12,173,150,5,240,3,76,158,11,162,5,
354 0x02, 0x9D, 0xE0, 0x02, 0x4C, 0xA4, 0x08, 0xDE, 0xDC, 0x02, 0xBC, 0x00, 0x03, 0xC0, 0x0D, 0x90, 354 169,0,188,29,5,48,3,157,29,5,157,17,5,202,16,242,
355 0x3C, 0xBD, 0x08, 0x03, 0x10, 0x31, 0x98, 0xDD, 0xFC, 0x02, 0xD0, 0x08, 0xBD, 0x04, 0x03, 0x9D, 355 173,147,5,133,252,173,148,5,133,253,172,149,5,140,161,5,
356 0xFC, 0x02, 0xD0, 0x03, 0xFE, 0xFC, 0x02, 0xBD, 0xB8, 0x02, 0x85, 0xD7, 0xBD, 0xBC, 0x02, 0x85, 356 204,159,5,208,25,173,160,5,240,20,173,149,5,172,158,5,
357 0xD8, 0xBC, 0xFC, 0x02, 0xB1, 0xD7, 0xBC, 0xF4, 0x02, 0xF0, 0x04, 0x18, 0x7D, 0xF8, 0x02, 0x9D, 357 140,149,5,206,160,5,208,232,141,149,5,168,16,226,162,0,
358 0xF8, 0x02, 0xBD, 0xF0, 0x02, 0x29, 0x3F, 0x38, 0xE9, 0x01, 0x9D, 0x08, 0x03, 0xBD, 0xCC, 0x02, 358 177,252,201,254,240,28,157,53,5,230,253,177,252,198,253,201,
359 0x10, 0x1F, 0xBD, 0x94, 0x02, 0xF0, 0x1A, 0xDD, 0xD8, 0x02, 0xF0, 0x15, 0x90, 0x13, 0xA8, 0xBD, 359 254,240,15,157,56,5,24,152,105,85,168,232,224,3,144,224,
360 0xD4, 0x02, 0x18, 0x7D, 0xD0, 0x02, 0x9D, 0xD4, 0x02, 0x90, 0x06, 0x98, 0xE9, 0x10, 0x9D, 0x94, 360 176,34,172,149,5,200,204,161,5,240,80,140,149,5,76,250,
361 0x02, 0xA9, 0x00, 0x85, 0xDD, 0xA5, 0xDA, 0x9D, 0x0C, 0x03, 0x29, 0x70, 0x4A, 0x4A, 0x8D, 0x1C, 361 10,104,41,14,170,189,253,7,141,135,11,189,254,7,141,136,
362 0x09, 0x90, 0xFE, 0x4C, 0xD2, 0x09, 0xEA, 0x4C, 0x3C, 0x09, 0xEA, 0x4C, 0x41, 0x09, 0xEA, 0x4C, 362 11,76,129,11,172,149,5,177,252,16,57,201,255,240,53,74,
363 0x4B, 0x09, 0xEA, 0x4C, 0x57, 0x09, 0xEA, 0x4C, 0x66, 0x09, 0xEA, 0x4C, 0xA9, 0x09, 0xEA, 0x4C, 363 74,74,72,41,1,240,218,104,41,14,170,189,233,7,141,135,
364 0xB8, 0x09, 0xA5, 0xDB, 0x4C, 0x15, 0x0A, 0xA5, 0xDB, 0x85, 0xDD, 0xBD, 0x90, 0x02, 0x4C, 0xD8, 364 11,189,234,7,141,136,11,173,54,5,133,254,32,134,11,140,
365 0x09, 0xBD, 0x90, 0x02, 0x18, 0x65, 0xDB, 0x9D, 0x90, 0x02, 0x4C, 0xD8, 0x09, 0xBD, 0x9C, 0x02, 365 149,5,192,85,176,5,204,161,5,208,179,172,161,5,140,149,
366 0x18, 0x65, 0xDB, 0x9D, 0x9C, 0x02, 0xBD, 0x90, 0x02, 0x4C, 0xD8, 0x09, 0xBD, 0xF0, 0x02, 0x10, 366 5,76,47,15,76,94,12,165,254,48,18,41,15,141,169,5,
367 0x0C, 0xBC, 0x90, 0x02, 0xB1, 0xD5, 0x18, 0x7D, 0xF8, 0x02, 0x4C, 0x87, 0x09, 0xBD, 0x90, 0x02, 367 173,55,5,16,3,173,169,5,41,15,141,170,5,200,96,165,
368 0x18, 0x7D, 0xF8, 0x02, 0xC9, 0x3D, 0x90, 0x02, 0xA9, 0x3F, 0xA8, 0xB1, 0xD5, 0x9D, 0xA0, 0x02, 368 254,48,250,41,1,141,184,5,200,96,173,179,5,48,20,206,
369 0xA4, 0xDB, 0xD0, 0x03, 0x9D, 0xA4, 0x02, 0x98, 0x4A, 0x4A, 0x4A, 0x4A, 0x9D, 0xA8, 0x02, 0x9D, 369 180,5,208,51,169,50,141,180,5,206,179,5,208,41,206,179,
370 0xAC, 0x02, 0xA5, 0xDB, 0x29, 0x0F, 0x9D, 0xB0, 0x02, 0xBD, 0x90, 0x02, 0x4C, 0xD8, 0x09, 0xA5, 370 5,200,96,165,254,48,214,141,180,5,238,180,5,165,254,48,
371 0xDB, 0x18, 0x7D, 0x14, 0x03, 0x9D, 0x14, 0x03, 0xBD, 0x90, 0x02, 0x4C, 0xD8, 0x09, 0xA5, 0xDB, 371 204,141,180,5,238,180,5,173,55,5,141,179,5,16,5,169,
372 0xC9, 0x80, 0xF0, 0x06, 0x9D, 0x90, 0x02, 0x4C, 0xD8, 0x09, 0xBD, 0x1C, 0x03, 0x09, 0xF0, 0x9D, 372 0,141,179,5,238,179,5,104,104,76,225,12,32,110,9,160,
373 0x1C, 0x03, 0xBD, 0x90, 0x02, 0x4C, 0xD8, 0x09, 0xBD, 0x90, 0x02, 0x18, 0x65, 0xDB, 0xBC, 0xF0, 373 255,96,165,254,48,249,168,96,165,254,48,243,56,152,229,254,
374 0x02, 0x30, 0x1F, 0x18, 0x7D, 0xF8, 0x02, 0xC9, 0x3D, 0x90, 0x07, 0xA9, 0x00, 0x9D, 0x1C, 0x03, 374 168,96,165,254,48,233,24,152,101,254,168,96,165,254,48,223,
375 0xA9, 0x3F, 0x9D, 0x10, 0x03, 0xA8, 0xB1, 0xD5, 0x18, 0x7D, 0x9C, 0x02, 0x18, 0x65, 0xDD, 0x4C, 375 141,151,5,141,152,5,200,96,165,254,48,211,173,55,5,48,
376 0x15, 0x0A, 0xC9, 0x3D, 0x90, 0x07, 0xA9, 0x00, 0x9D, 0x1C, 0x03, 0xA9, 0x3F, 0xA8, 0xBD, 0x9C, 376 206,200,140,158,5,24,152,101,254,141,159,5,173,55,5,141,
377 0x02, 0x18, 0x7D, 0xF8, 0x02, 0x18, 0x71, 0xD5, 0x18, 0x65, 0xDD, 0x9D, 0x18, 0x03, 0xBD, 0xAC, 377 160,5,192,84,96,136,48,10,177,252,201,143,240,4,201,239,
378 0x02, 0xF0, 0x32, 0xDE, 0xAC, 0x02, 0xD0, 0x2D, 0xBD, 0xA8, 0x02, 0x9D, 0xAC, 0x02, 0xBD, 0xA4, 378 208,243,200,96,162,5,189,23,5,240,5,222,23,5,16,87,
379 0x02, 0xDD, 0xA0, 0x02, 0xF0, 0x1F, 0xB0, 0x0D, 0x7D, 0xB0, 0x02, 0xB0, 0x12, 0xDD, 0xA0, 0x02, 379 189,29,5,208,82,188,53,5,201,64,176,75,173,155,5,133,
380 0xB0, 0x0D, 0x4C, 0x4C, 0x0A, 0xFD, 0xB0, 0x02, 0x90, 0x05, 0xDD, 0xA0, 0x02, 0xB0, 0x03, 0xBD, 380 252,173,156,5,133,253,177,252,133,254,24,152,105,64,168,177,
381 0xA0, 0x02, 0x9D, 0xA4, 0x02, 0xA5, 0xDA, 0x29, 0x01, 0xF0, 0x0A, 0xBD, 0xA4, 0x02, 0x18, 0x7D, 381 252,133,255,188,17,5,177,254,41,192,208,12,177,254,41,63,
382 0x9C, 0x02, 0x9D, 0x18, 0x03, 0xCA, 0x30, 0x03, 0x4C, 0x27, 0x08, 0xAD, 0x20, 0x03, 0x0D, 0x21, 382 157,47,5,254,17,5,16,235,201,64,208,13,177,254,41,63,
383 0x03, 0x0D, 0x22, 0x03, 0x0D, 0x23, 0x03, 0xAA, 0x8E, 0x2C, 0x0B, 0xAD, 0x0C, 0x03, 0x10, 0x21, 383 188,47,5,32,150,9,76,190,12,201,128,208,10,177,254,41,
384 0xAD, 0x1C, 0x03, 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x18, 0x03, 0x18, 0x6D, 0x14, 0x03, 0x8D, 0x1A, 384 63,157,23,5,254,17,5,202,16,156,174,150,5,232,138,41,
385 0x03, 0xAD, 0x1E, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x1E, 0x03, 0x8A, 0x09, 0x04, 385 63,141,150,5,206,152,5,208,14,173,151,5,141,152,5,173,
386 0xAA, 0xAD, 0x0D, 0x03, 0x10, 0x21, 0xAD, 0x1D, 0x03, 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x19, 0x03, 386 150,5,208,3,238,149,5,172,89,5,173,59,5,41,7,201,
387 0x18, 0x6D, 0x15, 0x03, 0x8D, 0x1B, 0x03, 0xAD, 0x1F, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 387 5,240,4,201,6,208,1,136,140,162,5,160,0,201,5,240,
388 0x8D, 0x1F, 0x03, 0x8A, 0x09, 0x02, 0xAA, 0xEC, 0x2C, 0x0B, 0xD0, 0x5E, 0xAD, 0x0D, 0x03, 0x29, 388 4,201,6,208,2,160,2,201,7,208,2,160,40,140,164,5,
389 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x1D, 0x03, 0x29, 0x0F, 0xF0, 0x1F, 0xAC, 0x11, 0x03, 0xB9, 389 172,92,5,173,62,5,41,7,201,5,240,4,201,6,208,1,
390 0xC0, 0x03, 0x8D, 0x18, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x19, 0x03, 0xAD, 0x1C, 0x03, 0x29, 0x10, 390 136,140,163,5,160,0,201,5,240,4,201,6,208,2,160,2,
391 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x1C, 0x03, 0x8A, 0x09, 0x50, 0xAA, 0xAD, 0x0F, 0x03, 0x29, 0x0E, 391 201,7,208,2,160,40,140,165,5,162,5,189,59,5,41,224,
392 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x1F, 0x03, 0x29, 0x0F, 0xF0, 0x1F, 0xAC, 0x13, 0x03, 0xB9, 0xC0, 392 157,65,5,189,101,5,133,252,189,71,5,133,253,189,41,5,
393 0x03, 0x8D, 0x1A, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x1B, 0x03, 0xAD, 0x1E, 0x03, 0x29, 0x10, 0xD0, 393 201,255,240,55,201,15,208,33,189,77,5,240,46,222,77,5,
394 0x05, 0xA9, 0x00, 0x8D, 0x1E, 0x03, 0x8A, 0x09, 0x28, 0xAA, 0x8E, 0x2C, 0x0B, 0xAD, 0x26, 0x03, 394 189,77,5,208,38,188,35,5,240,1,136,152,157,35,5,189,
395 0x60, 0xA0, 0xFF, 0xAD, 0x18, 0x03, 0xAE, 0x1C, 0x03, 0x8D, 0x00, 0xD2, 0x8E, 0x01, 0xD2, 0xAD, 395 119,5,157,77,5,136,76,133,13,189,41,5,74,168,177,252,
396 0x19, 0x03, 0xAE, 0x1D, 0x03, 0x8D, 0x02, 0xD2, 0x8E, 0x03, 0xD2, 0xAD, 0x1A, 0x03, 0xAE, 0x1E, 396 144,4,74,74,74,74,41,15,157,35,5,188,125,5,189,59,
397 0x03, 0x8D, 0x04, 0xD2, 0x8E, 0x05, 0xD2, 0xAD, 0x1B, 0x03, 0xAE, 0x1F, 0x03, 0x8D, 0x06, 0xD2, 397 5,41,7,201,1,208,31,136,152,200,221,89,5,8,169,1,
398 0x8E, 0x07, 0xD2, 0x8C, 0x08, 0xD2, 0x60 398 40,208,2,10,10,61,83,5,240,12,188,89,5,192,255,208,
399}; 399 5,169,0,157,35,5,152,157,95,5,169,1,141,168,5,189,
400static const unsigned char rmt8_obx[] = { 400 41,5,201,15,240,76,41,7,168,185,205,5,133,254,189,41,
401 0xFF, 0xFF, 0x90, 0x03, 0x6C, 0x0C, 0x80, 0x00, 0x80, 0x20, 0x80, 0x40, 0x00, 0xC0, 0x80, 0x80, 401 5,41,8,8,138,40,24,240,2,105,6,168,185,107,5,37,
402 0x80, 0xA0, 0x00, 0xC0, 0x40, 0xC0, 0x00, 0x01, 0x05, 0x0B, 0x15, 0x00, 0x01, 0xFF, 0xFF, 0x01, 402 254,240,47,189,137,5,157,95,5,142,168,5,202,224,2,240,
403 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x01, 0x01, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x01, 403 15,224,255,208,22,141,162,5,169,0,141,164,5,76,5,14,
404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 404 173,140,5,141,163,5,169,0,141,165,5,232,189,131,5,157,
405 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 405 65,5,189,41,5,41,15,201,15,240,18,254,41,5,189,41,
406 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 406 5,41,15,201,15,208,6,189,119,5,157,77,5,189,29,5,
407 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 407 16,10,189,35,5,208,5,169,64,157,29,5,254,83,5,160,
408 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x00, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0xF2, 0xE6, 408 0,189,59,5,74,74,74,74,144,1,136,74,144,1,200,24,
409 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x5C, 409 152,125,125,5,157,125,5,189,89,5,201,255,208,2,160,0,
410 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 0x38, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 410 24,152,125,89,5,157,89,5,202,48,3,76,53,13,32,123,
411 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 411 15,173,65,5,141,166,5,173,68,5,141,167,5,173,59,5,
412 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 0x99, 412 41,7,32,181,15,152,72,185,185,5,8,41,127,170,152,41,
413 0x8E, 0x87, 0x7F, 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 0x3C, 413 3,10,168,224,3,208,3,76,196,14,189,173,5,208,39,189,
414 0x39, 0x37, 0x33, 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 0x17, 414 95,5,153,0,210,189,35,5,29,65,5,40,16,2,169,0,
415 0x16, 0x15, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 415 153,1,210,104,168,136,41,3,240,3,76,127,14,173,164,5,
416 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 0x90, 416 141,8,210,76,228,14,40,76,173,14,173,173,5,208,23,173,
417 0x88, 0x80, 0x79, 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x39, 417 162,5,153,0,210,173,35,5,13,166,5,40,16,2,169,0,
418 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 418 153,1,210,76,173,14,40,76,173,14,173,62,5,41,7,32,
419 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 419 181,15,152,72,185,185,5,8,41,127,170,152,41,3,10,168,
420 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 420 224,3,208,3,76,60,15,189,176,5,208,30,189,98,5,153,
421 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 421 16,210,189,38,5,29,68,5,40,16,2,169,0,153,17,210,
422 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 422 104,168,136,41,3,240,7,76,236,14,40,76,26,15,173,165,
423 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 423 5,141,24,210,24,104,133,255,104,133,254,104,133,253,104,133,
424 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 424 252,96,173,176,5,208,23,173,163,5,153,16,210,173,38,5,
425 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 425 13,167,5,40,16,2,169,0,153,17,210,76,26,15,40,76,
426 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 426 26,15,32,168,10,176,25,173,184,5,240,20,173,157,5,141,
427 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 427 183,5,169,1,141,157,5,32,168,10,173,183,5,141,157,5,
428 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 428 96,173,169,5,10,10,10,10,141,171,5,173,170,5,10,10,
429 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 429 10,10,141,172,5,162,2,134,200,173,171,5,29,35,5,170,
430 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 430 189,233,6,166,200,157,35,5,173,172,5,29,38,5,170,189,
431 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 431 233,6,166,200,157,38,5,202,16,221,96,168,185,13,8,168,
432 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 432 96
433 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05, 433END_CONST_ARRAY;
434 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06, 434CONST_ARRAY(byte, dlt_obx)
435 0x07, 0x07, 0x08, 0x09, 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07, 435 255,255,0,4,70,12,255,241,228,215,203,192,181,170,161,152,
436 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 436 143,135,127,121,114,107,101,95,90,85,80,75,71,67,63,60,
437 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 437 56,53,50,47,44,42,39,37,35,33,31,29,28,26,24,23,
438 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 438 22,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
439 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 439 5,4,255,241,228,215,242,233,218,206,191,182,170,161,152,143,
440 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x4C, 0x0F, 0x06, 0x4C, 0x09, 0x08, 0x4C, 0x2E, 0x08, 0x4C, 440 137,128,122,113,107,101,95,92,86,80,103,96,90,85,81,76,
441 0x5C, 0x06, 0x4C, 0x02, 0x0C, 0x86, 0xD3, 0x84, 0xD4, 0x48, 0xA0, 0x00, 0x98, 0x99, 0x00, 0x02, 441 72,67,63,61,57,52,51,48,45,42,40,37,36,33,31,30,
442 0x99, 0x4C, 0x02, 0xC8, 0xD0, 0xF7, 0xA0, 0x04, 0xB1, 0xD3, 0x8D, 0x22, 0x08, 0xC8, 0xB1, 0xD3, 442 28,27,25,0,22,21,0,10,9,8,7,6,5,4,3,2,
443 0x8D, 0x48, 0x03, 0xC8, 0xB1, 0xD3, 0x8D, 0x12, 0x08, 0x8D, 0x4A, 0x03, 0xA0, 0x08, 0xB1, 0xD3, 443 1,0,242,233,218,206,242,233,218,206,191,182,170,161,152,143,
444 0x99, 0xC3, 0x00, 0xC8, 0xC0, 0x10, 0xD0, 0xF6, 0x68, 0x48, 0x0A, 0x0A, 0x0A, 0x18, 0x65, 0xD1, 444 137,128,122,113,107,101,95,92,86,80,103,96,90,85,81,76,
445 0x85, 0xD1, 0x68, 0x08, 0x29, 0xE0, 0x0A, 0x2A, 0x2A, 0x2A, 0x28, 0x65, 0xD2, 0x85, 0xD2, 0x20, 445 72,67,63,61,57,52,51,48,45,42,40,37,36,33,31,30,
446 0x7B, 0x06, 0xA9, 0x00, 0x8D, 0x08, 0xD2, 0x8D, 0x18, 0xD2, 0xA0, 0x03, 0x8C, 0x0F, 0xD2, 0x8C, 446 28,27,25,0,22,21,0,10,9,8,7,6,5,4,3,2,
447 0x1F, 0xD2, 0xA0, 0x08, 0x99, 0x00, 0xD2, 0x99, 0x10, 0xD2, 0x88, 0x10, 0xF7, 0xAD, 0x12, 0x08, 447 1,0,242,233,218,206,255,241,228,216,202,192,181,171,162,153,
448 0x60, 0xA2, 0x00, 0x8E, 0x4B, 0x03, 0x8A, 0xA8, 0xB1, 0xD1, 0xC9, 0xFE, 0xB0, 0x2D, 0xA8, 0xB1, 448 142,135,127,120,115,108,102,97,90,85,81,75,72,67,63,60,
449 0xCD, 0x9D, 0x00, 0x02, 0xB1, 0xCF, 0x9D, 0x08, 0x02, 0xA9, 0x00, 0x9D, 0x10, 0x02, 0xA9, 0x01, 449 57,52,51,48,45,42,40,37,36,33,31,30,28,27,25,23,
450 0x9D, 0x18, 0x02, 0xA9, 0x80, 0x9D, 0x68, 0x02, 0xE8, 0xE0, 0x08, 0xD0, 0xD9, 0xA5, 0xD1, 0x18, 450 22,21,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
451 0x69, 0x08, 0x85, 0xD1, 0x90, 0x1B, 0xE6, 0xD2, 0x4C, 0xCB, 0x06, 0xF0, 0x04, 0xA9, 0x00, 0xF0, 451 5,4,3,2,1,255,76,9,5,76,200,5,76,183,5,136,
452 0xDF, 0xA0, 0x02, 0xB1, 0xD1, 0xAA, 0xC8, 0xB1, 0xD1, 0x85, 0xD2, 0x86, 0xD1, 0xA2, 0x00, 0xF0, 452 140,54,3,169,126,141,53,3,162,6,142,51,3,162,1,142,
453 0xB5, 0xAD, 0x48, 0x03, 0x8D, 0x23, 0x07, 0xA2, 0xFF, 0xE8, 0xDE, 0x18, 0x02, 0xD0, 0x45, 0xBD, 453 52,3,32,51,5,32,95,5,32,163,5,32,139,5,169,1,
454 0x00, 0x02, 0x85, 0xD3, 0xBD, 0x08, 0x02, 0x85, 0xD4, 0xBC, 0x10, 0x02, 0xFE, 0x10, 0x02, 0xB1, 454 141,50,3,169,3,141,15,210,96,162,0,160,32,142,48,3,
455 0xD3, 0x85, 0xD9, 0x29, 0x3F, 0xC9, 0x3D, 0xF0, 0x11, 0xB0, 0x38, 0x9D, 0x20, 0x02, 0x9D, 0x20, 455 140,49,3,160,0,173,48,3,153,0,2,173,49,3,153,64,
456 0x03, 0xC8, 0xB1, 0xD3, 0x4A, 0x29, 0x7E, 0x9D, 0x68, 0x02, 0xA9, 0x01, 0x9D, 0x18, 0x02, 0xBC, 456 2,173,48,3,24,105,128,141,48,3,144,3,238,49,3,200,
457 0x10, 0x02, 0xFE, 0x10, 0x02, 0xB1, 0xD3, 0x4A, 0x66, 0xD9, 0x4A, 0x66, 0xD9, 0xA5, 0xD9, 0x29, 457 192,64,208,225,96,162,0,160,68,142,48,3,140,49,3,160,
458 0xF0, 0x9D, 0x28, 0x02, 0xE0, 0x07, 0xD0, 0xB1, 0xA9, 0xFF, 0x8D, 0x48, 0x03, 0x8D, 0x49, 0x03, 458 0,173,48,3,153,128,2,173,49,3,153,160,2,173,48,3,
459 0x4C, 0x72, 0x07, 0xC9, 0x3F, 0xF0, 0x1B, 0xA5, 0xD9, 0x29, 0xC0, 0xF0, 0x09, 0x0A, 0x2A, 0x2A, 459 24,105,64,141,48,3,144,3,238,49,3,200,192,32,208,225,
460 0x9D, 0x18, 0x02, 0x4C, 0x1E, 0x07, 0xC8, 0xB1, 0xD3, 0x9D, 0x18, 0x02, 0xFE, 0x10, 0x02, 0x4C, 460 96,173,0,76,41,1,74,106,106,168,162,0,185,128,4,157,
461 0x1E, 0x07, 0xA5, 0xD9, 0x30, 0x0C, 0xC8, 0xB1, 0xD3, 0x8D, 0x23, 0x07, 0xFE, 0x10, 0x02, 0x4C, 461 64,4,200,232,224,64,208,244,96,160,3,169,0,153,40,3,
462 0xE3, 0x06, 0xC9, 0xFF, 0xF0, 0x09, 0xC8, 0xB1, 0xD3, 0x9D, 0x10, 0x02, 0x4C, 0xE3, 0x06, 0x4C, 462 153,32,3,153,36,3,153,44,3,136,16,241,96,169,0,141,
463 0x7B, 0x06, 0x4C, 0x2E, 0x08, 0xCA, 0x30, 0xFA, 0xBC, 0x68, 0x02, 0x30, 0xF8, 0xB1, 0xCB, 0x9D, 463 50,3,160,7,169,0,153,0,210,136,16,250,96,96,173,50,
464 0x70, 0x02, 0x85, 0xD7, 0xC8, 0xB1, 0xCB, 0x9D, 0x78, 0x02, 0x85, 0xD8, 0xA9, 0x01, 0x9D, 0x28, 464 3,240,250,173,40,3,13,41,3,13,42,3,13,43,3,141,
465 0x03, 0xA8, 0xB1, 0xD7, 0x9D, 0x08, 0x03, 0xC8, 0xB1, 0xD7, 0x9D, 0x88, 0x02, 0xC8, 0xB1, 0xD7, 465 8,210,174,36,3,172,32,3,142,0,210,140,1,210,174,37,
466 0x9D, 0x90, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0xE0, 0x02, 0x29, 0x3F, 0x9D, 0x10, 0x03, 0xB1, 0xD7, 466 3,172,33,3,142,2,210,140,3,210,174,38,3,172,34,3,
467 0x29, 0x40, 0x9D, 0xE8, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0x40, 0x03, 0xC8, 0xB1, 0xD7, 0x9D, 0xA0, 467 142,4,210,140,5,210,174,39,3,172,35,3,142,6,210,140,
468 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0xB0, 0x02, 0xC8, 0xB1, 0xD7, 0x9D, 0xB8, 0x02, 0xC8, 0xB1, 0xD7, 468 7,210,206,52,3,208,74,173,51,3,141,52,3,238,53,3,
469 0xA8, 0xB9, 0xA0, 0x03, 0x9D, 0xC0, 0x02, 0x9D, 0xC8, 0x02, 0xB9, 0xA1, 0x03, 0x9D, 0xD0, 0x02, 469 238,53,3,16,28,238,54,3,169,0,141,53,3,32,199,6,
470 0xA0, 0x0A, 0xB1, 0xD7, 0x9D, 0xD8, 0x02, 0xA9, 0x80, 0x9D, 0xA8, 0x02, 0x9D, 0x68, 0x02, 0x0A, 470 173,4,3,13,5,3,13,6,3,13,7,3,208,3,76,183,
471 0x9D, 0x98, 0x02, 0x9D, 0x38, 0x02, 0xA8, 0xB1, 0xD7, 0x9D, 0x00, 0x03, 0x69, 0x00, 0x9D, 0x80, 471 5,173,4,3,240,3,32,97,7,173,5,3,240,3,32,192,
472 0x02, 0xA9, 0x0C, 0x9D, 0xF8, 0x02, 0xA8, 0xB1, 0xD7, 0x9D, 0xF0, 0x02, 0x4C, 0x6F, 0x07, 0x20, 472 7,173,6,3,240,3,32,31,8,173,7,3,240,3,32,126,
473 0x02, 0x0C, 0xCE, 0x4A, 0x03, 0xD0, 0x1D, 0xA9, 0xFF, 0x8D, 0x4A, 0x03, 0xCE, 0x49, 0x03, 0xD0, 473 8,173,4,3,240,8,173,44,3,240,3,32,221,8,173,5,
474 0x13, 0xEE, 0x4B, 0x03, 0xAD, 0x4B, 0x03, 0xC9, 0xFF, 0xF0, 0x03, 0x4C, 0xCB, 0x06, 0x4C, 0x7B, 474 3,240,8,173,45,3,240,3,32,206,9,173,6,3,240,8,
475 0x06, 0x4C, 0x74, 0x0A, 0xA9, 0x04, 0x85, 0xD6, 0xA2, 0x07, 0xBD, 0x78, 0x02, 0xF0, 0xF2, 0x85, 475 173,46,3,240,3,32,191,10,173,7,3,240,8,173,47,3,
476 0xD4, 0xBD, 0x70, 0x02, 0x85, 0xD3, 0xBC, 0x80, 0x02, 0xB1, 0xD3, 0x85, 0xD9, 0xC8, 0xB1, 0xD3, 476 240,3,32,131,11,96,192,67,144,14,169,0,141,4,3,141,
477 0x85, 0xDA, 0xC8, 0xB1, 0xD3, 0x85, 0xDB, 0xC8, 0x98, 0xDD, 0x88, 0x02, 0x90, 0x0A, 0xF0, 0x08, 477 32,3,141,40,3,76,230,6,192,66,208,15,189,128,64,141,
478 0xA9, 0x80, 0x9D, 0x98, 0x02, 0xBD, 0x90, 0x02, 0x9D, 0x80, 0x02, 0xA5, 0xD9, 0xE0, 0x04, 0x90, 478 51,3,141,52,3,238,54,3,76,199,6,192,65,208,9,189,
479 0x04, 0x4A, 0x4A, 0x4A, 0x4A, 0x29, 0x0F, 0x1D, 0x28, 0x02, 0xA8, 0xB9, 0x00, 0x05, 0x85, 0xDC, 479 128,64,141,54,3,76,199,6,104,104,76,183,5,174,54,3,
480 0xA5, 0xDA, 0x29, 0x0E, 0xA8, 0xB9, 0x90, 0x03, 0x85, 0xD5, 0xA5, 0xDC, 0x19, 0x91, 0x03, 0x9D, 480 188,0,64,192,64,176,191,189,128,64,141,24,3,185,0,2,
481 0x38, 0x03, 0xBD, 0xB8, 0x02, 0xF0, 0x28, 0xC9, 0x01, 0xD0, 0x21, 0xBD, 0x38, 0x02, 0x18, 0x7D, 481 133,224,185,64,2,133,225,169,1,141,4,3,188,0,65,192,
482 0xD8, 0x02, 0x18, 0xBC, 0xC0, 0x02, 0x79, 0xA5, 0x03, 0x9D, 0x38, 0x02, 0xC8, 0x98, 0xDD, 0xD0, 482 64,176,78,189,128,65,141,25,3,185,0,2,133,226,185,64,
483 0x02, 0xD0, 0x03, 0xBD, 0xC8, 0x02, 0x9D, 0xC0, 0x02, 0x4C, 0xB9, 0x08, 0xDE, 0xB8, 0x02, 0xBC, 483 2,133,227,169,1,141,5,3,188,0,66,192,64,176,63,189,
484 0x00, 0x03, 0xC0, 0x0D, 0x90, 0x3C, 0xBD, 0x10, 0x03, 0x10, 0x31, 0x98, 0xDD, 0xF8, 0x02, 0xD0, 484 128,66,141,26,3,185,0,2,133,228,185,64,2,133,229,169,
485 0x08, 0xBD, 0x08, 0x03, 0x9D, 0xF8, 0x02, 0xD0, 0x03, 0xFE, 0xF8, 0x02, 0xBD, 0x70, 0x02, 0x85, 485 1,141,6,3,188,0,67,192,64,176,48,189,128,67,141,27,
486 0xD7, 0xBD, 0x78, 0x02, 0x85, 0xD8, 0xBC, 0xF8, 0x02, 0xB1, 0xD7, 0xBC, 0xE8, 0x02, 0xF0, 0x04, 486 3,185,0,2,133,230,185,64,2,133,231,169,1,141,7,3,
487 0x18, 0x7D, 0xF0, 0x02, 0x9D, 0xF0, 0x02, 0xBD, 0xE0, 0x02, 0x29, 0x3F, 0x38, 0xE9, 0x01, 0x9D, 487 96,169,0,141,5,3,141,33,3,141,41,3,240,186,169,0,
488 0x10, 0x03, 0xBD, 0x98, 0x02, 0x10, 0x1F, 0xBD, 0x28, 0x02, 0xF0, 0x1A, 0xDD, 0xB0, 0x02, 0xF0, 488 141,6,3,141,34,3,141,42,3,240,201,169,0,141,7,3,
489 0x15, 0x90, 0x13, 0xA8, 0xBD, 0xA8, 0x02, 0x18, 0x7D, 0xA0, 0x02, 0x9D, 0xA8, 0x02, 0x90, 0x06, 489 141,35,3,141,43,3,96,172,53,3,177,224,48,11,200,177,
490 0x98, 0xE9, 0x10, 0x9D, 0x28, 0x02, 0xA9, 0x00, 0x85, 0xDD, 0xA5, 0xDA, 0x9D, 0x18, 0x03, 0x29, 490 224,48,1,96,104,104,76,31,6,24,109,24,3,41,127,141,
491 0x70, 0x4A, 0x4A, 0x8D, 0x31, 0x09, 0x90, 0xFE, 0x4C, 0xE7, 0x09, 0xEA, 0x4C, 0x51, 0x09, 0xEA, 491 8,3,169,15,141,0,3,141,44,3,200,177,224,170,189,160,
492 0x4C, 0x56, 0x09, 0xEA, 0x4C, 0x60, 0x09, 0xEA, 0x4C, 0x6C, 0x09, 0xEA, 0x4C, 0x7B, 0x09, 0xEA, 492 2,133,233,133,241,133,249,189,128,2,133,232,73,16,133,240,
493 0x4C, 0xBE, 0x09, 0xEA, 0x4C, 0xCD, 0x09, 0xA5, 0xDB, 0x4C, 0x2A, 0x0A, 0xA5, 0xDB, 0x85, 0xDD, 493 73,48,133,248,160,49,177,232,141,12,3,160,51,177,232,41,
494 0xBD, 0x20, 0x02, 0x4C, 0xED, 0x09, 0xBD, 0x20, 0x02, 0x18, 0x65, 0xDB, 0x9D, 0x20, 0x02, 0x4C, 494 127,141,16,3,169,0,141,20,3,141,28,3,160,48,177,232,
495 0xED, 0x09, 0xBD, 0x38, 0x02, 0x18, 0x65, 0xDB, 0x9D, 0x38, 0x02, 0xBD, 0x20, 0x02, 0x4C, 0xED, 495 41,213,141,40,3,96,172,53,3,177,226,48,11,200,177,226,
496 0x09, 0xBD, 0xE0, 0x02, 0x10, 0x0C, 0xBC, 0x20, 0x02, 0xB1, 0xD5, 0x18, 0x7D, 0xF0, 0x02, 0x4C, 496 48,1,96,104,104,76,31,6,24,109,25,3,41,127,141,9,
497 0x9C, 0x09, 0xBD, 0x20, 0x02, 0x18, 0x7D, 0xF0, 0x02, 0xC9, 0x3D, 0x90, 0x02, 0xA9, 0x3F, 0xA8, 497 3,169,15,141,1,3,141,45,3,200,177,226,170,189,160,2,
498 0xB1, 0xD5, 0x9D, 0x40, 0x02, 0xA4, 0xDB, 0xD0, 0x03, 0x9D, 0x48, 0x02, 0x98, 0x4A, 0x4A, 0x4A, 498 133,235,133,243,133,251,189,128,2,133,234,73,16,133,242,73,
499 0x4A, 0x9D, 0x50, 0x02, 0x9D, 0x58, 0x02, 0xA5, 0xDB, 0x29, 0x0F, 0x9D, 0x60, 0x02, 0xBD, 0x20, 499 48,133,250,160,49,177,234,141,13,3,160,51,177,234,41,127,
500 0x02, 0x4C, 0xED, 0x09, 0xA5, 0xDB, 0x18, 0x7D, 0x28, 0x03, 0x9D, 0x28, 0x03, 0xBD, 0x20, 0x02, 500 141,17,3,169,0,141,21,3,141,29,3,160,48,177,234,41,
501 0x4C, 0xED, 0x09, 0xA5, 0xDB, 0xC9, 0x80, 0xF0, 0x06, 0x9D, 0x20, 0x02, 0x4C, 0xED, 0x09, 0xBD, 501 131,141,41,3,96,172,53,3,177,228,48,11,200,177,228,48,
502 0x38, 0x03, 0x09, 0xF0, 0x9D, 0x38, 0x03, 0xBD, 0x20, 0x02, 0x4C, 0xED, 0x09, 0xBD, 0x20, 0x02, 502 1,96,104,104,76,31,6,24,109,26,3,41,127,141,10,3,
503 0x18, 0x65, 0xDB, 0xBC, 0xE0, 0x02, 0x30, 0x1F, 0x18, 0x7D, 0xF0, 0x02, 0xC9, 0x3D, 0x90, 0x07, 503 169,15,141,2,3,141,46,3,200,177,228,170,189,160,2,133,
504 0xA9, 0x00, 0x9D, 0x38, 0x03, 0xA9, 0x3F, 0x9D, 0x20, 0x03, 0xA8, 0xB1, 0xD5, 0x18, 0x7D, 0x38, 504 237,133,245,133,253,189,128,2,133,236,73,16,133,244,73,48,
505 0x02, 0x18, 0x65, 0xDD, 0x4C, 0x2A, 0x0A, 0xC9, 0x3D, 0x90, 0x07, 0xA9, 0x00, 0x9D, 0x38, 0x03, 505 133,252,160,49,177,236,141,14,3,160,51,177,236,41,127,141,
506 0xA9, 0x3F, 0xA8, 0xBD, 0x38, 0x02, 0x18, 0x7D, 0xF0, 0x02, 0x18, 0x71, 0xD5, 0x18, 0x65, 0xDD, 506 18,3,169,0,141,22,3,141,30,3,160,48,177,236,41,169,
507 0x9D, 0x30, 0x03, 0xBD, 0x58, 0x02, 0xF0, 0x32, 0xDE, 0x58, 0x02, 0xD0, 0x2D, 0xBD, 0x50, 0x02, 507 141,42,3,96,172,53,3,177,230,48,11,200,177,230,48,1,
508 0x9D, 0x58, 0x02, 0xBD, 0x48, 0x02, 0xDD, 0x40, 0x02, 0xF0, 0x1F, 0xB0, 0x0D, 0x7D, 0x60, 0x02, 508 96,104,104,76,31,6,24,109,27,3,41,127,141,11,3,169,
509 0xB0, 0x12, 0xDD, 0x40, 0x02, 0xB0, 0x0D, 0x4C, 0x61, 0x0A, 0xFD, 0x60, 0x02, 0x90, 0x05, 0xDD, 509 15,141,3,3,141,47,3,200,177,230,170,189,160,2,133,239,
510 0x40, 0x02, 0xB0, 0x03, 0xBD, 0x40, 0x02, 0x9D, 0x48, 0x02, 0xA5, 0xDA, 0x29, 0x01, 0xF0, 0x0A, 510 133,247,133,255,189,128,2,133,238,73,16,133,246,73,48,133,
511 0xBD, 0x48, 0x02, 0x18, 0x7D, 0x38, 0x02, 0x9D, 0x30, 0x03, 0xCA, 0x30, 0x03, 0x4C, 0x34, 0x08, 511 254,160,49,177,238,141,15,3,160,51,177,238,41,127,141,19,
512 0xAD, 0x40, 0x03, 0x0D, 0x41, 0x03, 0x0D, 0x42, 0x03, 0x0D, 0x43, 0x03, 0xAA, 0x8E, 0x65, 0x0C, 512 3,169,0,141,23,3,141,31,3,160,48,177,238,41,129,141,
513 0xAD, 0x18, 0x03, 0x10, 0x21, 0xAD, 0x38, 0x03, 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x30, 0x03, 0x18, 513 43,3,96,172,0,3,48,70,177,232,141,32,3,177,240,208,
514 0x6D, 0x28, 0x03, 0x8D, 0x32, 0x03, 0xAD, 0x3A, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 514 9,32,108,9,206,0,3,76,79,9,201,1,240,39,201,3,
515 0x3A, 0x03, 0x8A, 0x09, 0x04, 0xAA, 0xAD, 0x19, 0x03, 0x10, 0x21, 0xAD, 0x39, 0x03, 0x29, 0x0F, 515 208,16,173,8,3,24,113,248,170,173,28,3,141,55,3,76,
516 0xF0, 0x1A, 0xAD, 0x31, 0x03, 0x18, 0x6D, 0x29, 0x03, 0x8D, 0x33, 0x03, 0xAD, 0x3B, 0x03, 0x29, 516 24,9,173,28,3,24,113,248,141,55,3,174,8,3,32,150,
517 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3B, 0x03, 0x8A, 0x09, 0x02, 0xAA, 0xEC, 0x65, 0x0C, 0xD0, 517 9,206,0,3,96,177,248,141,36,3,206,0,3,96,32,108,
518 0x5E, 0xAD, 0x19, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x39, 0x03, 0x29, 0x0F, 0xF0, 518 9,160,49,177,232,240,30,206,12,3,240,3,76,79,9,173,
519 0x1F, 0xAC, 0x21, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x30, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x31, 0x03, 519 32,3,41,15,240,11,206,32,3,177,232,141,12,3,76,79,
520 0xAD, 0x38, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x38, 0x03, 0x8A, 0x09, 0x50, 0xAA, 520 9,141,44,3,96,173,28,3,24,160,50,113,232,141,28,3,
521 0xAD, 0x1B, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x3B, 0x03, 0x29, 0x0F, 0xF0, 0x1F, 521 206,16,3,208,12,238,20,3,160,51,177,232,41,127,141,16,
522 0xAC, 0x23, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x32, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x33, 0x03, 0xAD, 522 3,96,173,20,3,41,3,24,105,52,168,177,232,170,160,51,
523 0x3A, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3A, 0x03, 0x8A, 0x09, 0x28, 0xAA, 0x8E, 523 177,232,48,14,138,109,8,3,170,173,28,3,141,55,3,76,
524 0x65, 0x0C, 0xAD, 0x44, 0x03, 0x0D, 0x45, 0x03, 0x0D, 0x46, 0x03, 0x0D, 0x47, 0x03, 0xAA, 0x8E, 524 150,9,138,109,28,3,141,55,3,174,8,3,189,0,4,24,
525 0x03, 0x0C, 0xAD, 0x1C, 0x03, 0x10, 0x21, 0xAD, 0x3C, 0x03, 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x34, 525 109,55,3,141,36,3,173,40,3,41,4,208,1,96,172,0,
526 0x03, 0x18, 0x6D, 0x2C, 0x03, 0x8D, 0x36, 0x03, 0xAD, 0x3E, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 526 3,177,240,208,21,138,24,160,0,113,248,170,189,0,4,24,
527 0x00, 0x8D, 0x3E, 0x03, 0x8A, 0x09, 0x04, 0xAA, 0xAD, 0x1D, 0x03, 0x10, 0x21, 0xAD, 0x3D, 0x03, 527 109,55,3,24,105,255,141,38,3,96,173,36,3,24,105,255,
528 0x29, 0x0F, 0xF0, 0x1A, 0xAD, 0x35, 0x03, 0x18, 0x6D, 0x2D, 0x03, 0x8D, 0x37, 0x03, 0xAD, 0x3F, 528 141,38,3,96,172,1,3,48,70,177,234,141,33,3,177,242,
529 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3F, 0x03, 0x8A, 0x09, 0x02, 0xAA, 0xEC, 0x03, 529 208,9,32,93,10,206,1,3,76,64,10,201,1,240,39,201,
530 0x0C, 0xD0, 0x5E, 0xAD, 0x1D, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x3D, 0x03, 0x29, 530 3,208,16,173,9,3,24,113,250,170,173,29,3,141,55,3,
531 0x0F, 0xF0, 0x1F, 0xAC, 0x25, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x34, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 531 76,9,10,173,29,3,24,113,250,141,55,3,174,9,3,32,
532 0x35, 0x03, 0xAD, 0x3C, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3C, 0x03, 0x8A, 0x09, 532 135,10,206,1,3,96,177,250,141,37,3,206,1,3,96,32,
533 0x50, 0xAA, 0xAD, 0x1F, 0x03, 0x29, 0x0E, 0xC9, 0x06, 0xD0, 0x26, 0xAD, 0x3F, 0x03, 0x29, 0x0F, 533 93,10,160,49,177,234,240,30,206,13,3,240,3,76,64,10,
534 0xF0, 0x1F, 0xAC, 0x27, 0x03, 0xB9, 0xC0, 0x03, 0x8D, 0x36, 0x03, 0xB9, 0xC0, 0x04, 0x8D, 0x37, 534 173,33,3,41,15,240,11,206,33,3,177,234,141,13,3,76,
535 0x03, 0xAD, 0x3E, 0x03, 0x29, 0x10, 0xD0, 0x05, 0xA9, 0x00, 0x8D, 0x3E, 0x03, 0x8A, 0x09, 0x28, 535 64,10,141,45,3,96,173,29,3,24,160,50,113,234,141,29,
536 0xAA, 0x8E, 0x03, 0x0C, 0xAD, 0x4A, 0x03, 0x60, 0xA0, 0xFF, 0xAD, 0x34, 0x03, 0xAE, 0x30, 0x03, 536 3,206,17,3,208,12,238,21,3,160,51,177,234,41,127,141,
537 0x8D, 0x10, 0xD2, 0x8E, 0x00, 0xD2, 0xAD, 0x3C, 0x03, 0xAE, 0x38, 0x03, 0x8D, 0x11, 0xD2, 0x8E, 537 17,3,96,173,21,3,41,3,24,105,52,168,177,234,170,160,
538 0x01, 0xD2, 0xAD, 0x35, 0x03, 0xAE, 0x31, 0x03, 0x8D, 0x12, 0xD2, 0x8E, 0x02, 0xD2, 0xAD, 0x3D, 538 51,177,234,48,14,138,109,9,3,170,173,29,3,141,55,3,
539 0x03, 0xAE, 0x39, 0x03, 0x8D, 0x13, 0xD2, 0x8E, 0x03, 0xD2, 0xAD, 0x36, 0x03, 0xAE, 0x32, 0x03, 539 76,135,10,138,109,29,3,141,55,3,174,9,3,189,0,4,
540 0x8D, 0x14, 0xD2, 0x8E, 0x04, 0xD2, 0xAD, 0x3E, 0x03, 0xAE, 0x3A, 0x03, 0x8D, 0x15, 0xD2, 0x8E, 540 24,109,55,3,141,37,3,173,41,3,41,2,208,1,96,172,
541 0x05, 0xD2, 0xAD, 0x37, 0x03, 0xAE, 0x33, 0x03, 0x8D, 0x16, 0xD2, 0x8E, 0x06, 0xD2, 0xAD, 0x3F, 541 1,3,177,242,208,21,138,24,160,0,113,250,170,189,0,4,
542 0x03, 0xAE, 0x3B, 0x03, 0x8D, 0x17, 0xD2, 0x8E, 0x07, 0xD2, 0xA9, 0xFF, 0x8C, 0x18, 0xD2, 0x8D, 542 24,109,55,3,24,105,255,141,39,3,96,173,37,3,24,105,
543 0x08, 0xD2, 0x60 543 255,141,39,3,96,172,2,3,48,70,177,236,141,34,3,177,
544}; 544 244,208,9,32,78,11,206,2,3,76,49,11,201,1,240,39,
545static const unsigned char tmc_obx[] = { 545 201,3,208,16,173,10,3,24,113,252,170,173,30,3,141,55,
546 0xFF, 0xFF, 0x00, 0x05, 0x68, 0x0F, 0x4C, 0xCE, 0x0D, 0x4C, 0xD0, 0x08, 0x4C, 0xEF, 0x09, 0x0F, 546 3,76,250,10,173,30,3,24,113,252,141,55,3,174,10,3,
547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 547 32,120,11,206,2,3,96,177,252,141,38,3,206,2,3,96,
548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 548 32,78,11,160,49,177,236,240,30,206,14,3,240,3,76,49,
549 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 549 11,173,34,3,41,15,240,11,206,34,3,177,236,141,14,3,
550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 550 76,49,11,141,46,3,96,173,30,3,24,160,50,113,236,141,
551 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 551 30,3,206,18,3,208,12,238,22,3,160,51,177,236,41,127,
552 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 552 141,18,3,96,173,22,3,41,3,24,105,52,168,177,236,170,
553 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 553 160,51,177,236,48,14,138,109,10,3,170,173,30,3,141,55,
554 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 554 3,76,120,11,138,109,30,3,141,55,3,174,10,3,189,0,
555 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 555 4,24,109,55,3,141,38,3,96,172,3,3,48,70,177,238,
556 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 556 141,35,3,177,246,208,9,32,18,12,206,3,3,76,245,11,
557 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 557 201,1,240,39,201,3,208,16,173,11,3,24,113,254,170,173,
558 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x07, 558 31,3,141,55,3,76,190,11,173,31,3,24,113,254,141,55,
559 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08, 559 3,174,11,3,32,60,12,206,3,3,96,177,254,141,39,3,
560 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08, 0x09, 560 206,3,3,96,32,18,12,160,49,177,238,240,30,206,15,3,
561 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 561 240,3,76,245,11,173,35,3,41,15,240,11,206,35,3,177,
562 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0A, 562 238,141,15,3,76,245,11,141,47,3,96,173,31,3,24,160,
563 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 563 50,113,238,141,31,3,206,19,3,208,12,238,23,3,160,51,
564 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 564 177,238,41,127,141,19,3,96,173,23,3,41,3,24,105,52,
565 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 565 168,177,238,170,160,51,177,238,48,14,138,109,11,3,170,173,
566 0x0E, 0x0F, 0x00, 0xF1, 0xE4, 0xD7, 0xCB, 0xC0, 0xB5, 0xAA, 0xA1, 0x98, 0x8F, 0x87, 0x7F, 0x78, 566 31,3,141,55,3,76,60,12,138,109,31,3,141,55,3,174,
567 0x72, 0x6B, 0x65, 0x5F, 0x5A, 0x55, 0x50, 0x4B, 0x47, 0x43, 0x3F, 0x3C, 0x38, 0x35, 0x32, 0x2F, 567 11,3,189,0,4,24,109,55,3,141,39,3,96
568 0x2C, 0x2A, 0x27, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 568END_CONST_ARRAY;
569 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 569CONST_ARRAY(byte, mpt_obx)
570 0x01, 0x00, 0x00, 0xF2, 0xE6, 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 0x8F, 0x89, 0x80, 0x7A, 570 255,255,0,5,178,13,76,205,11,173,46,7,208,1,96,169,
571 0x71, 0x6B, 0x65, 0x5F, 0x5C, 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 0x38, 0x35, 0x32, 0x2F, 571 0,141,28,14,238,29,14,173,23,14,205,187,13,144,80,206,
572 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 572 21,14,240,3,76,197,5,162,0,142,23,14,169,0,157,237,
573 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 573 13,157,245,13,189,179,13,133,236,189,183,13,133,237,172,22,
574 0x01, 0x00, 0x00, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 0x99, 0x8E, 0x87, 0x7F, 574 14,177,236,200,201,255,240,7,201,254,208,15,76,42,12,177,
575 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 0x3C, 0x39, 0x37, 0x33, 575 236,48,249,10,168,140,22,14,76,59,5,157,233,13,177,236,
576 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 0x17, 0x16, 0x15, 0x13, 576 157,213,13,232,224,4,208,196,200,140,22,14,76,197,5,206,
577 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 577 21,14,16,87,173,188,13,141,21,14,162,3,222,245,13,16,
578 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 0x90, 0x88, 0x80, 0x79, 578 68,189,233,13,10,168,185,255,255,133,236,200,185,255,255,133,
579 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 0x39, 0x35, 0x32, 0x2F, 579 237,5,236,240,48,189,237,13,141,31,14,32,62,7,172,31,
580 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 0x16, 0x14, 0x13, 0x12, 580 14,200,152,157,237,13,189,241,13,157,245,13,224,2,208,21,
581 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 581 189,197,13,73,15,10,10,10,10,105,69,141,161,13,169,10,
582 0x01, 0x00, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 0xEF, 0x80, 0x08, 582 105,0,141,162,13,202,16,180,238,23,14,162,1,173,27,14,
583 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 0x22, 0xF4, 0xC8, 583 201,2,240,2,162,3,173,27,14,201,2,208,5,236,25,14,
584 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 0x38, 0x27, 0x15, 584 240,3,76,118,6,181,240,61,114,6,240,18,160,40,177,236,
585 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 0x78, 0x70, 0x6A, 585 24,125,225,13,32,117,9,56,125,1,14,157,203,13,202,16,
586 0x64, 0x5E, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, 586 213,169,3,141,15,210,165,241,41,16,240,15,172,226,13,185,
587 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 587 198,9,141,201,13,185,5,10,141,202,13,173,201,13,141,0,
588 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 588 210,173,202,13,141,2,210,173,203,13,141,4,210,173,204,13,
589 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 589 141,6,210,173,193,13,162,255,172,27,14,192,1,208,5,174,
590 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 590 25,14,240,3,141,1,210,173,194,13,224,1,240,3,141,3,
591 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 591 210,192,2,240,20,173,195,13,224,2,240,3,141,5,210,173,
592 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 592 196,13,224,3,240,3,141,7,210,165,240,5,241,5,242,5,
593 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 593 243,13,28,14,141,8,210,96,4,2,0,0,189,217,13,133,
594 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 594 236,189,221,13,133,237,5,236,208,8,157,193,13,149,240,76,
595 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 595 248,5,180,244,192,32,240,66,177,236,56,253,197,13,44,58,
596 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 596 7,240,2,41,240,157,193,13,200,177,236,141,30,14,200,148,
597 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 597 244,41,7,240,60,168,185,126,9,141,203,6,185,133,9,141,
598 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 598 204,6,173,30,14,74,74,74,74,74,9,40,168,177,236,24,
599 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 599 32,255,255,169,0,149,240,76,248,5,189,9,14,240,18,222,
600 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 600 13,14,208,13,157,13,14,189,193,13,41,15,240,3,222,193,
601 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 601 13,160,35,177,236,149,240,189,17,14,24,105,37,168,41,3,
602 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 602 157,17,14,136,177,236,125,209,13,157,225,13,32,119,9,157,
603 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 603 201,13,189,5,14,240,6,222,5,14,76,223,5,189,189,13,
604 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 604 141,30,7,16,254,76,194,8,0,76,229,8,0,76,251,8,
605 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 605 0,76,21,9,0,76,37,9,0,76,56,9,0,76,66,9,
606 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x10, 606 16,76,72,9,169,0,157,197,13,172,31,14,136,200,177,236,
607 0x00, 0x08, 0x00, 0x10, 0x00, 0x08, 0xAD, 0xB7, 0x08, 0xF0, 0x5E, 0xAD, 0xB6, 0x08, 0xC9, 0x40, 607 201,254,208,4,140,31,14,96,201,224,144,8,173,187,13,141,
608 0x90, 0x5A, 0xCE, 0xB5, 0x08, 0xF0, 0x03, 0x4C, 0xEF, 0x09, 0xA2, 0x07, 0xA9, 0x00, 0x9D, 0xC4, 608 23,14,208,233,201,208,144,10,41,15,141,188,13,141,21,14,
609 0x07, 0x9D, 0xCC, 0x07, 0xCA, 0x10, 0xF7, 0x8D, 0xB6, 0x08, 0xAA, 0xA0, 0x0F, 0xB1, 0xFE, 0x10, 609 16,219,201,192,144,9,41,15,73,15,157,197,13,16,206,201,
610 0x20, 0x88, 0xB1, 0xFE, 0x10, 0x03, 0x4C, 0x5F, 0x0E, 0x86, 0xFC, 0x0A, 0x0A, 0x26, 0xFC, 0x0A, 610 128,144,7,41,63,157,241,13,16,195,201,64,144,27,200,140,
611 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x69, 0x00, 0x85, 0xFE, 0xA5, 0xFC, 0x69, 0x00, 0x85, 0xFF, 0x90, 611 31,14,41,31,157,229,13,10,168,185,255,255,157,217,13,200,
612 0xDA, 0x9D, 0xD4, 0x07, 0x88, 0xB1, 0xFE, 0x9D, 0xDC, 0x07, 0xE8, 0x88, 0x10, 0xCF, 0x18, 0xA5, 612 185,255,255,157,221,13,76,62,7,140,31,14,141,30,14,24,
613 0xFE, 0x69, 0x10, 0x85, 0xFE, 0x90, 0x02, 0xE6, 0xFF, 0x4C, 0xEF, 0x09, 0xCE, 0xB5, 0x08, 0x10, 613 125,213,13,157,209,13,173,27,14,240,66,201,2,240,58,189,
614 0xF8, 0xEE, 0xB6, 0x08, 0xAD, 0xB4, 0x08, 0x8D, 0xB5, 0x08, 0xA2, 0x07, 0xDE, 0xCC, 0x07, 0x30, 614 229,13,201,31,208,55,173,30,14,56,233,1,41,15,168,177,
615 0x03, 0x4C, 0xE9, 0x09, 0xBC, 0xD4, 0x07, 0xB9, 0xFF, 0xFF, 0x85, 0xFC, 0xB9, 0xFF, 0xFF, 0x85, 615 254,133,253,152,9,16,168,177,254,133,248,160,1,5,253,208,
616 0xFD, 0xBC, 0xC4, 0x07, 0xB1, 0xFC, 0xD0, 0x06, 0x20, 0x6D, 0x0D, 0x4C, 0xE6, 0x09, 0xC9, 0x40, 616 2,160,0,140,26,14,169,0,133,252,157,217,13,157,221,13,
617 0xB0, 0x12, 0x7D, 0xDC, 0x07, 0x9D, 0xE4, 0x07, 0x20, 0x6D, 0x0D, 0xBC, 0x2A, 0x05, 0x20, 0xBC, 617 138,10,141,24,14,142,25,14,96,224,2,176,99,189,217,13,
618 0x0E, 0x4C, 0xE6, 0x09, 0xD0, 0x22, 0xC8, 0xFE, 0xC4, 0x07, 0xB1, 0xFC, 0x10, 0x07, 0x85, 0xFB, 618 133,238,189,221,13,133,239,5,238,240,74,160,32,177,238,41,
619 0x20, 0x6D, 0x0D, 0xA5, 0xFB, 0x29, 0x7F, 0xD0, 0x07, 0xA9, 0x40, 0x8D, 0xB6, 0x08, 0xD0, 0x4C, 619 15,157,249,13,177,238,41,112,74,74,157,189,13,200,177,238,
620 0x8D, 0xB4, 0x08, 0x8D, 0xB5, 0x08, 0xD0, 0x44, 0xC9, 0x80, 0xB0, 0x2B, 0x29, 0x3F, 0x7D, 0xDC, 620 10,10,72,41,63,157,5,14,104,41,192,157,205,13,200,177,
621 0x07, 0x9D, 0xE4, 0x07, 0xC8, 0xFE, 0xC4, 0x07, 0xB1, 0xFC, 0x29, 0x7F, 0xD0, 0x07, 0xA9, 0x40, 621 238,157,9,14,157,13,14,169,0,149,244,157,17,14,157,253,
622 0x8D, 0xB6, 0x08, 0xD0, 0x06, 0x8D, 0xB4, 0x08, 0x8D, 0xB5, 0x08, 0x20, 0x6D, 0x0D, 0xBC, 0x2A, 622 13,157,1,14,189,209,13,157,225,13,32,117,9,157,201,13,
623 0x05, 0x20, 0xBC, 0x0E, 0x4C, 0xE6, 0x09, 0xC9, 0xC0, 0xB0, 0x0C, 0x29, 0x3F, 0x9D, 0x2A, 0x05, 623 236,25,14,240,1,96,160,255,140,25,14,200,140,26,14,96,
624 0xC8, 0xFE, 0xC4, 0x07, 0x4C, 0x5E, 0x09, 0x29, 0x3F, 0x9D, 0xCC, 0x07, 0xFE, 0xC4, 0x07, 0xCA, 624 224,2,208,51,172,211,13,185,69,11,141,121,13,185,129,11,
625 0x30, 0x03, 0x4C, 0x46, 0x09, 0xA2, 0x07, 0xBD, 0xBC, 0x07, 0xF0, 0x21, 0x20, 0x2E, 0x0B, 0xBD, 625 141,127,13,169,0,133,249,133,250,173,231,13,41,15,168,177,
626 0x32, 0x05, 0x3D, 0xC0, 0x08, 0xF0, 0x16, 0xA0, 0x47, 0xB1, 0xFC, 0x18, 0x7D, 0x22, 0x05, 0x9D, 626 254,133,251,152,9,16,168,177,254,141,137,13,5,251,208,6,
627 0x24, 0x05, 0xA8, 0xB9, 0x3C, 0x06, 0x38, 0x7D, 0x64, 0x08, 0x9D, 0xF6, 0x07, 0xCA, 0x10, 0xD7, 627 141,121,13,141,127,13,96,173,232,13,41,15,168,177,254,133,
628 0x0E, 0x09, 0x05, 0x0E, 0x09, 0x05, 0x0E, 0x09, 0x05, 0x0E, 0x09, 0x05, 0xE8, 0x86, 0xFC, 0x86, 628 253,152,9,16,168,177,254,5,253,240,15,177,254,56,229,253,
629 0xFD, 0xA2, 0x07, 0x8A, 0xA8, 0xB9, 0xFC, 0x07, 0xD0, 0x0C, 0xBC, 0xB8, 0x08, 0xB9, 0x04, 0x08, 629 133,248,169,0,133,252,169,141,208,2,169,173,141,97,13,141,
630 0xD0, 0x04, 0x8A, 0xA8, 0xA9, 0x00, 0x85, 0xFA, 0x98, 0x9D, 0x1A, 0x05, 0xB9, 0xF4, 0x07, 0x9D, 630 56,13,169,24,141,7,210,96,173,29,14,41,7,74,74,144,
631 0x12, 0x05, 0xB9, 0x32, 0x05, 0x85, 0xFB, 0x05, 0xFD, 0x85, 0xFD, 0xA5, 0xFB, 0x3D, 0xC0, 0x08, 631 18,208,24,189,249,13,24,157,1,14,125,201,13,157,201,13,
632 0xF0, 0x06, 0xB9, 0xF6, 0x07, 0x9D, 0x14, 0x05, 0xA5, 0xFB, 0x3D, 0xC8, 0x08, 0xF0, 0x12, 0xB9, 632 76,223,5,169,0,157,1,14,76,223,5,189,201,13,56,253,
633 0x22, 0x05, 0x29, 0x3F, 0xA8, 0xC8, 0x84, 0xFC, 0xB9, 0x7B, 0x07, 0x9D, 0x12, 0x05, 0x4C, 0x89, 633 249,13,157,201,13,56,169,0,253,249,13,157,1,14,76,223,
634 0x0A, 0xA4, 0xFC, 0xF0, 0x0A, 0xB9, 0x3B, 0x07, 0x9D, 0x12, 0x05, 0xA9, 0x00, 0x85, 0xFC, 0xA5, 634 5,189,253,13,24,157,1,14,125,201,13,157,201,13,24,189,
635 0xFA, 0x0D, 0x09, 0x05, 0xA8, 0xB9, 0x3C, 0x05, 0xBC, 0x1A, 0x05, 0x19, 0xEC, 0x07, 0x9D, 0x0A, 635 253,13,125,249,13,157,253,13,76,223,5,189,225,13,56,253,
636 0x05, 0xE0, 0x04, 0xD0, 0x09, 0xA5, 0xFD, 0x8D, 0x3B, 0x05, 0xA9, 0x00, 0x85, 0xFD, 0xCA, 0x10, 636 253,13,157,225,13,32,117,9,76,5,9,169,0,56,253,253,
637 0x82, 0x4E, 0x09, 0x05, 0x4E, 0x09, 0x05, 0x4E, 0x09, 0x05, 0x4E, 0x09, 0x05, 0xA5, 0xFD, 0xA2, 637 13,157,1,14,189,201,13,56,253,253,13,76,5,9,189,225,
638 0x03, 0x8E, 0x1F, 0xD2, 0x8E, 0x0F, 0xD2, 0xAE, 0x16, 0x05, 0xAC, 0x12, 0x05, 0x8E, 0x10, 0xD2, 638 13,24,125,253,13,76,28,9,32,85,9,76,208,8,32,85,
639 0x8C, 0x00, 0xD2, 0xAE, 0x0E, 0x05, 0xAC, 0x0A, 0x05, 0x8E, 0x11, 0xD2, 0x8C, 0x01, 0xD2, 0xAE, 639 9,24,125,225,13,32,155,9,76,223,5,188,253,13,189,249,
640 0x17, 0x05, 0xAC, 0x13, 0x05, 0x8E, 0x12, 0xD2, 0x8C, 0x02, 0xD2, 0xAE, 0x0F, 0x05, 0xAC, 0x0B, 640 13,48,2,200,200,136,152,157,253,13,221,249,13,208,8,189,
641 0x05, 0x8E, 0x13, 0xD2, 0x8C, 0x03, 0xD2, 0xAE, 0x18, 0x05, 0xAC, 0x14, 0x05, 0x8E, 0x14, 0xD2, 641 249,13,73,255,157,249,13,189,253,13,96,41,63,29,205,13,
642 0x8C, 0x04, 0xD2, 0xAE, 0x10, 0x05, 0xAC, 0x0C, 0x05, 0x8E, 0x15, 0xD2, 0x8C, 0x05, 0xD2, 0xAE, 642 168,185,255,255,96,148,145,152,165,173,180,192,9,9,9,9,
643 0x19, 0x05, 0xAC, 0x15, 0x05, 0x8E, 0x16, 0xD2, 0x8C, 0x06, 0xD2, 0xAE, 0x11, 0x05, 0xAC, 0x0D, 643 9,9,9,64,0,32,0,125,201,13,157,201,13,96,125,209,
644 0x05, 0x8E, 0x17, 0xD2, 0x8C, 0x07, 0xD2, 0x8D, 0x3A, 0x05, 0xAE, 0x3B, 0x05, 0x8E, 0x18, 0xD2, 644 13,157,225,13,32,117,9,157,201,13,96,157,201,13,189,141,
645 0x8D, 0x08, 0xD2, 0x60, 0xBD, 0x1C, 0x08, 0x85, 0xFC, 0xBD, 0x24, 0x08, 0x85, 0xFD, 0xBC, 0x2C, 645 9,16,12,157,201,13,169,128,208,5,157,201,13,169,1,13,
646 0x08, 0xC0, 0x3F, 0xF0, 0x7B, 0xFE, 0x2C, 0x08, 0xFE, 0x2C, 0x08, 0xFE, 0x2C, 0x08, 0xB1, 0xFC, 646 28,14,141,28,14,96,45,10,210,157,201,13,96,242,51,150,
647 0x29, 0xF0, 0x9D, 0xEC, 0x07, 0xB1, 0xFC, 0x29, 0x0F, 0x38, 0xFD, 0x0C, 0x08, 0x10, 0x02, 0xA9, 647 226,56,140,0,106,232,106,239,128,8,174,70,230,149,65,246,
648 0x00, 0x9D, 0xFC, 0x07, 0xC8, 0xB1, 0xFC, 0x29, 0x0F, 0x38, 0xFD, 0x14, 0x08, 0x10, 0x02, 0xA9, 648 176,110,48,246,187,132,82,34,244,200,160,122,85,52,20,245,
649 0x00, 0x9D, 0x04, 0x08, 0xB1, 0xFC, 0x29, 0xF0, 0xF0, 0x74, 0x10, 0x0B, 0xA0, 0x49, 0xB1, 0xFC, 649 216,189,164,141,119,96,78,56,39,21,6,247,232,219,207,195,
650 0xBC, 0x2C, 0x08, 0x88, 0x88, 0x10, 0x02, 0xA9, 0x00, 0x9D, 0x32, 0x05, 0xB1, 0xFC, 0x29, 0x70, 650 184,172,162,154,144,136,127,120,112,106,100,94,13,13,12,11,
651 0xF0, 0x63, 0x4A, 0x4A, 0x8D, 0x9A, 0x0B, 0xA9, 0x00, 0x9D, 0x64, 0x08, 0xC8, 0xB1, 0xFC, 0x90, 651 11,10,10,9,8,8,7,7,7,6,6,5,5,5,4,4,
652 0xFE, 0xEA, 0xEA, 0xEA, 0xEA, 0x4C, 0x38, 0x0D, 0xEA, 0x4C, 0x35, 0x0D, 0xEA, 0x4C, 0x3C, 0x0D, 652 4,4,3,3,3,3,3,2,2,2,2,2,2,2,1,1,
653 0xEA, 0x4C, 0x4A, 0x0D, 0xEA, 0x4C, 0x54, 0x0D, 0xEA, 0x4C, 0x5F, 0x0D, 0xEA, 0x4C, 0x51, 0x0D, 653 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
654 0xBD, 0x34, 0x08, 0xF0, 0x12, 0xDE, 0x44, 0x08, 0xD0, 0x0D, 0x9D, 0x44, 0x08, 0xBD, 0xFC, 0x07, 654 0,0,0,0,0,0,0,0,0,0,0,24,24,24,24,24,
655 0x29, 0x0F, 0xF0, 0x03, 0xDE, 0xFC, 0x07, 0xBD, 0x3C, 0x08, 0xF0, 0x12, 0xDE, 0x4C, 0x08, 0xD0, 655 24,24,24,24,24,24,24,24,24,24,24,22,22,23,23,23,
656 0x0D, 0x9D, 0x4C, 0x08, 0xBD, 0x04, 0x08, 0x29, 0x0F, 0xF0, 0x03, 0xDE, 0x04, 0x08, 0xA0, 0x48, 656 23,24,24,24,24,24,25,25,25,25,26,21,21,22,22,22,
657 0xB1, 0xFC, 0x9D, 0x32, 0x05, 0xBD, 0x94, 0x08, 0x18, 0x69, 0x3F, 0xA8, 0xB1, 0xFC, 0x7D, 0xE4, 657 23,23,24,24,24,25,25,26,26,26,27,20,21,21,22,22,
658 0x07, 0x9D, 0x22, 0x05, 0xA8, 0xB9, 0x3C, 0x06, 0x9D, 0xF4, 0x07, 0xDE, 0xA4, 0x08, 0x10, 0x33, 658 23,23,24,24,24,25,25,26,26,27,27,20,20,21,21,22,
659 0xBD, 0x9C, 0x08, 0x9D, 0xA4, 0x08, 0xBD, 0xAC, 0x08, 0xF0, 0x18, 0x18, 0x7D, 0x94, 0x08, 0x9D, 659 22,23,23,24,25,25,26,26,27,27,28,19,20,20,21,22,
660 0x94, 0x08, 0xF0, 0x07, 0xDD, 0x8C, 0x08, 0xD0, 0x1A, 0xA9, 0xFE, 0x18, 0x69, 0x01, 0x9D, 0xAC, 660 22,23,23,24,25,25,26,26,27,28,28,19,19,20,21,21,
661 0x08, 0xD0, 0x10, 0xFE, 0x94, 0x08, 0xBD, 0x8C, 0x08, 0xDD, 0x94, 0x08, 0xB0, 0x05, 0xA9, 0x00, 661 22,23,23,24,25,25,26,27,27,28,29,18,19,20,20,21,
662 0x9D, 0x94, 0x08, 0xBD, 0x74, 0x08, 0xF0, 0x04, 0xDE, 0x74, 0x08, 0x60, 0xBD, 0x6C, 0x08, 0x85, 662 22,23,23,24,25,25,26,27,28,28,29,18,19,19,20,21,
663 0xFA, 0xBD, 0x5C, 0x08, 0x85, 0xFB, 0x20, 0x69, 0x0C, 0xDE, 0x84, 0x08, 0x10, 0x10, 0xA5, 0xFA, 663 22,22,23,24,25,26,26,27,28,29,29,18,18,19,20,21,
664 0x9D, 0x6C, 0x08, 0xA5, 0xFB, 0x9D, 0x5C, 0x08, 0xBD, 0x7C, 0x08, 0x9D, 0x84, 0x08, 0x60, 0xBD, 664 22,22,23,24,25,26,26,27,28,29,30,17,18,19,20,21,
665 0x54, 0x08, 0x8D, 0x70, 0x0C, 0x10, 0xFE, 0x4C, 0xA7, 0x0C, 0xEA, 0x4C, 0x90, 0x0C, 0xEA, 0x4C, 665 22,22,23,24,25,26,26,27,28,29,30,17,18,19,20,21,
666 0xAE, 0x0C, 0xEA, 0x4C, 0xB4, 0x0C, 0xEA, 0x4C, 0xBE, 0x0C, 0xEA, 0x4C, 0xD2, 0x0C, 0xEA, 0x4C, 666 21,22,23,24,25,26,27,27,28,29,30,17,18,19,20,20,
667 0xE2, 0x0C, 0xEA, 0x4C, 0xF4, 0x0C, 0xA5, 0xFA, 0xE6, 0xFA, 0x29, 0x03, 0x4A, 0x90, 0x0F, 0xD0, 667 21,22,23,24,25,26,27,28,28,29,30,17,18,19,19,20,
668 0x47, 0xA5, 0xFB, 0x9D, 0x64, 0x08, 0x18, 0x7D, 0xF4, 0x07, 0x9D, 0xF4, 0x07, 0x60, 0xA9, 0x00, 668 21,22,23,24,25,26,27,28,29,29,30,17,18,18,19,20,
669 0x9D, 0x64, 0x08, 0x60, 0x20, 0x1D, 0x0D, 0x4C, 0x9D, 0x0C, 0x20, 0x1D, 0x0D, 0x18, 0x7D, 0x22, 669 21,22,23,24,25,26,27,28,29,30,30,16,17,18,19,20,
670 0x05, 0x4C, 0x54, 0x0D, 0xA5, 0xFA, 0x9D, 0x64, 0x08, 0x18, 0x7D, 0xF4, 0x07, 0x9D, 0xF4, 0x07, 670 21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,41,
671 0xA5, 0xFA, 0x18, 0x65, 0xFB, 0x85, 0xFA, 0x60, 0xBD, 0x22, 0x05, 0x38, 0xE5, 0xFA, 0x9D, 0x22, 671 43,46,48,51,55,58,61,65,69,73,77,82,87,92,97,103,
672 0x05, 0xA8, 0xB9, 0x3C, 0x06, 0x4C, 0xC7, 0x0C, 0xBD, 0xF4, 0x07, 0x38, 0xE5, 0xFB, 0x9D, 0xF4, 672 110,116,123,130,138,146,155,164,174,184,195,207,220,233,246,5,
673 0x07, 0x38, 0xA9, 0x00, 0xE5, 0xFB, 0x9D, 0x64, 0x08, 0x60, 0xBD, 0x84, 0x08, 0xD0, 0xAE, 0xA5, 673 21,37,55,73,93,113,135,159,184,210,237,11,42,75,110,147,
674 0xFB, 0x10, 0x10, 0xBD, 0x04, 0x08, 0xF0, 0xA5, 0xBD, 0xFC, 0x07, 0xC9, 0x0F, 0xF0, 0x9E, 0xFE, 674 186,227,15,62,112,164,219,0,0,0,0,0,0,0,0,0,
675 0xFC, 0x07, 0x60, 0xBD, 0xFC, 0x07, 0xF0, 0x95, 0xBD, 0x04, 0x08, 0xC9, 0x0F, 0xF0, 0x8E, 0xFE, 675 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
676 0x04, 0x08, 0x60, 0xA4, 0xFA, 0xA5, 0xFB, 0x30, 0x02, 0xC8, 0xC8, 0x88, 0x98, 0x85, 0xFA, 0xC5, 676 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
677 0xFB, 0xD0, 0x06, 0xA5, 0xFB, 0x49, 0xFF, 0x85, 0xFB, 0x98, 0x60, 0x7D, 0xF4, 0x07, 0x9D, 0xF4, 677 1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,
678 0x07, 0x60, 0xBC, 0xE4, 0x07, 0x79, 0x3C, 0x06, 0x9D, 0xF4, 0x07, 0x98, 0x9D, 0x22, 0x05, 0x60, 678 3,3,3,229,42,64,89,100,238,8,166,11,12,12,12,12,
679 0x2D, 0x0A, 0xD2, 0x9D, 0xF4, 0x07, 0x60, 0x7D, 0xE4, 0x07, 0x9D, 0x22, 0x05, 0xA8, 0xB9, 0x3C, 679 12,13,13,142,50,7,140,54,7,41,7,168,185,189,11,141,
680 0x06, 0x9D, 0xF4, 0x07, 0x60, 0x9D, 0x22, 0x05, 0xA8, 0xBD, 0xF4, 0x07, 0x79, 0x3C, 0x06, 0x9D, 680 227,11,185,197,11,141,228,11,76,255,255,173,54,7,174,50,
681 0xF4, 0x07, 0x60, 0xC8, 0xFE, 0xC4, 0x07, 0xB1, 0xFC, 0x4A, 0x4A, 0x4A, 0x4A, 0x9D, 0x0C, 0x08, 681 7,141,148,7,141,155,7,142,149,7,142,156,7,24,105,64,
682 0xB1, 0xFC, 0x29, 0x0F, 0x9D, 0x14, 0x08, 0x60, 0x20, 0x5F, 0x0E, 0xA0, 0x0F, 0xA9, 0x00, 0x85, 682 141,129,5,141,135,5,144,1,232,142,130,5,142,136,5,24,
683 0xFE, 0xA9, 0x00, 0x85, 0xFF, 0x8A, 0xF0, 0x2E, 0xB1, 0xFE, 0x10, 0x01, 0xCA, 0x18, 0xA5, 0xFE, 683 105,128,141,124,9,144,1,232,142,125,9,232,141,31,12,142,
684 0x69, 0x10, 0x85, 0xFE, 0x90, 0xEF, 0xE6, 0xFF, 0xB0, 0xEB, 0x20, 0x5F, 0x0E, 0xA9, 0x00, 0x85, 684 32,12,162,9,189,255,255,157,179,13,202,16,247,206,188,13,
685 0xFC, 0x8A, 0x0A, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x69, 0x00, 0x85, 0xFE, 685 169,0,141,46,7,162,98,157,189,13,202,16,250,162,8,157,
686 0xA5, 0xFC, 0x69, 0x00, 0x85, 0xFF, 0xA9, 0x40, 0x8D, 0xB6, 0x08, 0xA9, 0x01, 0x8D, 0xB5, 0x08, 686 0,210,202,16,250,96,32,42,12,173,50,7,10,141,22,14,
687 0x8D, 0xB7, 0x08, 0x60, 0xC9, 0x10, 0x90, 0xB0, 0xC9, 0x20, 0x90, 0xCE, 0xC9, 0x30, 0xB0, 0x03, 687 173,187,13,141,23,14,169,1,141,21,14,141,46,7,96,173,
688 0x4C, 0xAE, 0x0E, 0xC9, 0x40, 0xB0, 0x09, 0x8A, 0x29, 0x0F, 0xF0, 0x03, 0x8D, 0xB4, 0x08, 0x60, 688 54,7,133,254,173,50,7,133,255,96,173,54,7,41,3,170,
689 0xC9, 0x50, 0x90, 0x71, 0xC9, 0x60, 0xB0, 0x06, 0xA9, 0x00, 0x8D, 0xB7, 0x08, 0x60, 0xC9, 0x70, 689 173,50,7,32,198,7,173,26,14,240,238,14,54,7,32,190,
690 0x90, 0xF8, 0xA9, 0x01, 0x8D, 0xB5, 0x08, 0xA9, 0x40, 0x8D, 0xB6, 0x08, 0x84, 0xFC, 0x86, 0xFD, 690 12,169,1,141,27,14,173,26,14,240,222,201,1,208,5,160,
691 0xA0, 0x1E, 0xB1, 0xFC, 0x8D, 0xB4, 0x08, 0xA5, 0xFC, 0x18, 0x69, 0x20, 0x8D, 0xC2, 0x0E, 0x90, 691 0,238,26,14,177,252,174,24,14,74,74,74,74,9,16,141,
692 0x01, 0xE8, 0x8E, 0xC3, 0x0E, 0x18, 0x69, 0x40, 0x8D, 0xCA, 0x0E, 0x90, 0x01, 0xE8, 0x8E, 0xCB, 692 10,212,141,10,212,157,1,210,177,252,9,16,141,10,212,141,
693 0x0E, 0x18, 0x69, 0x40, 0x8D, 0x52, 0x09, 0x90, 0x01, 0xE8, 0x8E, 0x53, 0x09, 0x18, 0x69, 0x80, 693 10,212,157,1,210,200,208,206,230,253,165,253,197,248,208,198,
694 0x8D, 0x57, 0x09, 0x90, 0x01, 0xE8, 0x8E, 0x58, 0x09, 0x18, 0x69, 0x80, 0x85, 0xFE, 0x8D, 0x10, 694 140,26,14,96,144,21,169,234,141,153,12,141,154,12,141,155,
695 0x09, 0x8D, 0x88, 0x0D, 0x8D, 0xB7, 0x0D, 0x90, 0x01, 0xE8, 0x86, 0xFF, 0x8E, 0x16, 0x09, 0x8E, 695 12,141,166,12,141,167,12,141,168,12,96,169,141,141,153,12,
696 0x8C, 0x0D, 0x8E, 0xBD, 0x0D, 0xA0, 0x07, 0xA9, 0x00, 0x8D, 0xB7, 0x08, 0x99, 0x00, 0xD2, 0x99, 696 141,166,12,169,10,141,154,12,141,167,12,169,212,141,155,12,
697 0x10, 0xD2, 0x99, 0x0A, 0x05, 0x99, 0xFC, 0x07, 0x99, 0x04, 0x08, 0x99, 0x32, 0x05, 0x99, 0xBC, 697 141,168,12,96,169,0,141,26,14,173,50,7,74,32,190,12,
698 0x07, 0x88, 0x10, 0xE8, 0x8D, 0x08, 0xD2, 0x8D, 0x18, 0xD2, 0x8D, 0x3A, 0x05, 0x8D, 0x3B, 0x05, 698 169,1,141,27,14,32,128,12,173,27,14,208,248,96,169,2,
699 0x60, 0x9D, 0xFC, 0x07, 0x9D, 0x04, 0x08, 0x9D, 0x32, 0x05, 0xBD, 0xE4, 0x07, 0x9D, 0x22, 0x05, 699 141,27,14,141,25,14,169,24,141,7,210,169,17,133,250,169,
700 0x60, 0x98, 0x49, 0xF0, 0x4A, 0x4A, 0x4A, 0x4A, 0x9D, 0x0C, 0x08, 0x98, 0x29, 0x0F, 0x49, 0x0F, 700 13,133,251,169,173,141,97,13,141,56,13,160,0,140,121,13,
701 0x9D, 0x14, 0x08, 0x60, 0x29, 0x07, 0x85, 0xFC, 0x8A, 0xA6, 0xFC, 0x29, 0x3F, 0xF0, 0xE2, 0x9D, 701 140,127,13,174,11,212,177,252,74,74,74,74,9,16,141,7,
702 0xE4, 0x07, 0xA9, 0x00, 0x9D, 0xBC, 0x07, 0xB9, 0xFF, 0xFF, 0x9D, 0x1C, 0x08, 0x85, 0xFC, 0xB9, 702 210,32,117,13,236,11,212,240,251,141,5,210,174,11,212,177,
703 0xFF, 0xFF, 0x9D, 0x24, 0x08, 0x85, 0xFD, 0x05, 0xFC, 0xF0, 0xB6, 0xA0, 0x4A, 0xB1, 0xFC, 0x9D, 703 252,230,252,208,16,230,253,198,248,208,10,169,173,141,97,13,
704 0x34, 0x08, 0x9D, 0x44, 0x08, 0xC8, 0xB1, 0xFC, 0x9D, 0x3C, 0x08, 0x9D, 0x4C, 0x08, 0xC8, 0xB1, 704 141,56,13,169,8,9,16,141,7,210,32,117,13,236,11,212,
705 0xFC, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0x54, 0x08, 0xB1, 0xFC, 0x29, 0x0F, 0x9D, 0x5C, 0x08, 0xB1, 705 240,251,141,5,210,173,27,14,208,185,96,24,165,249,105,0,
706 0xFC, 0x10, 0x0B, 0xBD, 0x5C, 0x08, 0x49, 0xFF, 0x18, 0x69, 0x01, 0x9D, 0x5C, 0x08, 0xC8, 0xB1, 706 133,249,165,250,105,0,133,250,144,15,230,251,165,251,201,0,
707 0xFC, 0x9D, 0x74, 0x08, 0xC8, 0xB1, 0xFC, 0x29, 0x3F, 0x9D, 0x7C, 0x08, 0x9D, 0x84, 0x08, 0xC8, 707 208,7,140,121,13,140,127,13,96,177,250,36,249,48,4,74,
708 0xB1, 0xFC, 0x29, 0x80, 0xF0, 0x02, 0xA9, 0x01, 0x9D, 0xAC, 0x08, 0xB1, 0xFC, 0x29, 0x70, 0x4A, 708 74,74,74,41,15,168,185,69,10,160,0,96,160,0,140,27,
709 0x4A, 0x4A, 0x4A, 0x9D, 0x8C, 0x08, 0xD0, 0x03, 0x9D, 0xAC, 0x08, 0xB1, 0xFC, 0x29, 0x0F, 0x9D, 709 14,140,26,14,136,140,25,14,96
710 0x9C, 0x08, 0x9D, 0xA4, 0x08, 0x88, 0xB1, 0xFC, 0x29, 0xC0, 0x18, 0x7D, 0xE4, 0x07, 0x9D, 0xE4, 710END_CONST_ARRAY;
711 0x07, 0x9D, 0x22, 0x05, 0xA8, 0xB9, 0x3C, 0x06, 0x9D, 0xF4, 0x07, 0xA9, 0x00, 0x9D, 0x2C, 0x08, 711CONST_ARRAY(byte, rmt4_obx)
712 0x9D, 0x64, 0x08, 0x9D, 0x6C, 0x08, 0x9D, 0x94, 0x08, 0xA9, 0x01, 0x9D, 0xBC, 0x07, 0x60 712 255,255,144,3,96,11,128,0,128,32,128,64,0,192,128,128,
713}; 713 128,160,0,192,64,192,0,1,5,11,21,0,1,255,255,1,
714static const unsigned char tm2_obx[] = { 714 1,0,255,255,0,1,1,1,0,255,255,255,255,0,1,1,
715 0xFF, 0xFF, 0x00, 0x02, 0x6B, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 715 0,0,0,0,0,0,242,51,150,226,56,140,0,106,232,106,
716 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 716 239,128,8,174,70,230,149,65,246,176,110,48,246,187,132,82,
717 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 717 34,244,200,160,122,85,52,20,245,216,189,164,141,119,96,78,
718 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 718 56,39,21,6,247,232,219,207,195,184,172,162,154,144,136,127,
719 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 719 120,112,106,100,94,0,191,182,170,161,152,143,137,128,242,230,
720 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 720 218,206,191,182,170,161,152,143,137,128,122,113,107,101,95,92,
721 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 721 86,80,77,71,68,62,60,56,53,50,47,45,42,40,37,35,
722 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 722 33,31,29,28,26,24,23,22,20,19,18,17,16,15,14,13,
723 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x04, 0x05, 723 12,11,10,9,8,7,255,241,228,216,202,192,181,171,162,153,
724 0x05, 0x06, 0x06, 0x07, 0x07, 0x08, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05, 724 142,135,127,121,115,112,102,97,90,85,82,75,72,67,63,60,
725 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x06, 725 57,55,51,48,45,42,40,37,36,33,31,30,28,27,25,23,
726 0x07, 0x07, 0x08, 0x09, 0x09, 0x0A, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x05, 0x06, 0x07, 726 22,21,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
727 0x07, 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 727 5,4,3,2,1,0,243,230,217,204,193,181,173,162,153,144,
728 0x08, 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x00, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 728 136,128,121,114,108,102,96,91,85,81,76,72,68,64,60,57,
729 0x09, 0x0A, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x07, 0x08, 729 53,50,47,45,42,40,37,35,33,31,29,28,26,24,23,22,
730 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 730 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,
731 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0xF1, 0xE4, 0xD7, 0xCB, 0xC0, 0xB5, 0xAA, 0xA1, 0x98, 731 4,3,2,1,0,0,13,13,12,11,11,10,10,9,8,8,
732 0x8F, 0x87, 0x7F, 0x78, 0x72, 0x6B, 0x65, 0x5F, 0x5A, 0x55, 0x50, 0x4B, 0x47, 0x43, 0x3F, 0x3C, 732 7,7,7,6,6,5,5,5,4,4,4,4,3,3,3,3,
733 0x38, 0x35, 0x32, 0x2F, 0x2C, 0x2A, 0x27, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 733 3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
734 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 734 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
735 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0xF2, 0xE9, 0xDA, 0xCE, 0xBF, 0xB6, 0xAA, 0xA1, 0x98, 735 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
736 0x8F, 0x89, 0x80, 0x7A, 0x71, 0x6B, 0x65, 0x5F, 0x5C, 0x56, 0x50, 0x4D, 0x47, 0x44, 0x3E, 0x3C, 736 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
737 0x38, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 737 1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
738 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 738 1,1,2,2,2,2,0,0,0,1,1,1,1,1,2,2,
739 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0xFF, 0xF1, 0xE4, 0xD8, 0xCA, 0xC0, 0xB5, 0xAB, 0xA2, 739 2,2,2,3,3,3,0,0,1,1,1,1,2,2,2,2,
740 0x99, 0x8E, 0x87, 0x7F, 0x79, 0x73, 0x70, 0x66, 0x61, 0x5A, 0x55, 0x52, 0x4B, 0x48, 0x43, 0x3F, 740 3,3,3,3,4,4,0,0,1,1,1,2,2,2,3,3,
741 0x3C, 0x39, 0x37, 0x33, 0x30, 0x2D, 0x2A, 0x28, 0x25, 0x24, 0x21, 0x1F, 0x1E, 0x1C, 0x1B, 0x19, 741 3,4,4,4,5,5,0,0,1,1,2,2,2,3,3,4,
742 0x17, 0x16, 0x15, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 742 4,4,5,5,6,6,0,0,1,1,2,2,3,3,4,4,
743 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xF3, 0xE6, 0xD9, 0xCC, 0xC1, 0xB5, 0xAD, 0xA2, 0x99, 743 5,5,6,6,7,7,0,1,1,2,2,3,3,4,4,5,
744 0x90, 0x88, 0x80, 0x79, 0x72, 0x6C, 0x66, 0x60, 0x5B, 0x55, 0x51, 0x4C, 0x48, 0x44, 0x40, 0x3C, 744 5,6,6,7,7,8,0,1,1,2,2,3,4,4,5,5,
745 0x39, 0x35, 0x32, 0x2F, 0x2D, 0x2A, 0x28, 0x25, 0x23, 0x21, 0x1F, 0x1D, 0x1C, 0x1A, 0x18, 0x17, 745 6,7,7,8,8,9,0,1,1,2,3,3,4,5,5,6,
746 0x16, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 746 7,7,8,9,9,10,0,1,1,2,3,4,4,5,6,7,
747 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 0x6A, 0xEF, 0x80, 0x08, 747 7,8,9,10,10,11,0,1,2,2,3,4,5,6,6,7,
748 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 0x52, 0x22, 0xF4, 0xC8, 748 8,9,10,10,11,12,0,1,2,3,3,4,5,6,7,8,
749 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 0x4E, 0x38, 0x27, 0x15, 749 9,10,10,11,12,13,0,1,2,3,4,5,6,7,7,8,
750 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 0x7F, 0x78, 0x70, 0x6A, 750 9,10,11,12,13,14,0,1,2,3,4,5,6,7,8,9,
751 0x64, 0x5E, 0x57, 0x52, 0x32, 0x0A, 0x00, 0xF2, 0x33, 0x96, 0xE2, 0x38, 0x8C, 0x00, 0x6A, 0xE8, 751 10,11,12,13,14,15,76,15,6,76,252,7,76,33,8,76,
752 0x6A, 0xEF, 0x80, 0x08, 0xAE, 0x46, 0xE6, 0x95, 0x41, 0xF6, 0xB0, 0x6E, 0x30, 0xF6, 0xBB, 0x84, 752 88,6,76,43,11,134,211,132,212,72,160,168,169,0,153,127,
753 0x52, 0x22, 0xF4, 0xC8, 0xA0, 0x7A, 0x55, 0x34, 0x14, 0xF5, 0xD8, 0xBD, 0xA4, 0x8D, 0x77, 0x60, 753 2,136,208,250,160,4,177,211,141,21,8,200,177,211,141,36,
754 0x4E, 0x38, 0x27, 0x15, 0x06, 0xF7, 0xE8, 0xDB, 0xCF, 0xC3, 0xB8, 0xAC, 0xA2, 0x9A, 0x90, 0x88, 754 3,200,177,211,141,5,8,141,38,3,160,8,177,211,153,195,
755 0x7F, 0x78, 0x70, 0x6A, 0x64, 0x5E, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, 755 0,200,192,16,208,246,104,72,10,10,24,101,209,133,209,104,
756 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 756 8,41,192,10,42,42,40,101,210,133,210,32,110,6,169,0,
757 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 757 141,8,210,160,3,140,15,210,160,8,153,0,210,136,16,250,
758 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 758 173,5,8,96,162,0,142,39,3,138,168,177,209,201,254,176,
759 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x0D, 0x0C, 0x0B, 0x0B, 0x0A, 0x0A, 0x09, 0x08, 759 45,168,177,205,157,128,2,177,207,157,132,2,169,0,157,136,
760 0x08, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 760 2,169,1,157,140,2,169,128,157,180,2,232,224,4,208,217,
761 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 761 165,209,24,105,4,133,209,144,27,230,210,76,190,6,240,4,
762 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 762 169,0,240,223,160,2,177,209,170,200,177,209,133,210,134,209,
763 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0xE4, 0x0D, 0x4C, 0xE3, 0x06, 0x4C, 0x9F, 0x08, 0x01, 763 162,0,240,181,173,36,3,141,22,7,162,255,232,222,140,2,
764 0x10, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 764 208,69,189,128,2,133,211,189,132,2,133,212,188,136,2,254,
765 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 765 136,2,177,211,133,217,41,63,201,61,240,17,176,56,157,144,
766 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 766 2,157,16,3,200,177,211,74,41,126,157,180,2,169,1,157,
767 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 767 140,2,188,136,2,254,136,2,177,211,74,102,217,74,102,217,
768 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 768 165,217,41,240,157,148,2,224,3,208,177,169,255,141,36,3,
769 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 769 141,37,3,76,101,7,201,63,240,27,165,217,41,192,240,9,
770 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 770 10,42,42,157,140,2,76,17,7,200,177,211,157,140,2,254,
771 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 771 136,2,76,17,7,165,217,48,12,200,177,211,141,22,7,254,
772 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 772 136,2,76,214,6,201,255,240,9,200,177,211,157,136,2,76,
773 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 773 214,6,76,110,6,76,33,8,202,48,250,188,180,2,48,248,
774 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 774 177,203,157,184,2,133,215,200,177,203,157,188,2,133,216,169,
775 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 775 1,157,20,3,168,177,215,157,4,3,200,177,215,157,196,2,
776 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 776 200,177,215,157,200,2,200,177,215,157,240,2,41,63,157,8,
777 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 777 3,177,215,41,64,157,244,2,200,177,215,157,32,3,200,177,
778 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 778 215,157,208,2,200,177,215,157,216,2,200,177,215,157,220,2,
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 779 200,177,215,168,185,160,3,157,224,2,157,228,2,185,161,3,
780 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 780 157,232,2,160,10,177,215,157,236,2,169,128,157,212,2,157,
781 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 781 180,2,10,157,204,2,157,156,2,168,177,215,157,0,3,105,
782 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 782 0,157,192,2,169,12,157,252,2,168,177,215,157,248,2,76,
783 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 783 98,7,32,43,11,206,38,3,208,29,169,255,141,38,3,206,
784 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 784 37,3,208,19,238,39,3,173,39,3,201,255,240,3,76,190,
785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 785 6,76,110,6,76,95,10,169,4,133,214,162,3,189,188,2,
786 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 786 240,242,133,212,189,184,2,133,211,188,192,2,177,211,133,217,
787 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 787 200,177,211,133,218,200,177,211,133,219,200,152,221,196,2,144,
788 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05, 788 10,240,8,169,128,157,204,2,189,200,2,157,192,2,165,217,
789 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x04, 0x02, 0x00, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x10, 789 41,15,29,148,2,168,185,0,5,133,220,165,218,41,14,168,
790 0x00, 0x08, 0x00, 0x10, 0x00, 0x08, 0x85, 0xD3, 0x81, 0xA9, 0x85, 0xD3, 0x81, 0xA9, 0x88, 0xB1, 790 185,144,3,133,213,165,220,25,145,3,157,28,3,189,220,2,
791 0xFA, 0x8D, 0x17, 0x05, 0xA2, 0x00, 0x86, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 791 240,40,201,1,208,33,189,156,2,24,125,236,2,24,188,224,
792 0xFC, 0x0A, 0x26, 0xFC, 0x6D, 0x17, 0x05, 0x90, 0x02, 0xE6, 0xFC, 0x18, 0x69, 0x00, 0x85, 0xFA, 792 2,121,165,3,157,156,2,200,152,221,232,2,208,3,189,228,
793 0xA5, 0xFC, 0x69, 0x00, 0x85, 0xFB, 0x4C, 0x07, 0x07, 0x20, 0xB5, 0x09, 0xAD, 0x16, 0x05, 0xF0, 793 2,157,224,2,76,164,8,222,220,2,188,0,3,192,13,144,
794 0x05, 0xCE, 0x1C, 0x05, 0x30, 0x03, 0x4C, 0xA2, 0x08, 0xCE, 0x1D, 0x05, 0xD0, 0x52, 0xA2, 0x00, 794 60,189,8,3,16,49,152,221,252,2,208,8,189,4,3,157,
795 0xEE, 0x17, 0x05, 0xAD, 0x19, 0x05, 0x85, 0xFA, 0xAD, 0x1A, 0x05, 0x85, 0xFB, 0xA0, 0x10, 0xB1, 795 252,2,208,3,254,252,2,189,184,2,133,215,189,188,2,133,
796 0xFA, 0x30, 0xAB, 0xD0, 0x03, 0x4C, 0x2C, 0x0F, 0x8D, 0x1D, 0x05, 0x88, 0xB1, 0xFA, 0x88, 0x84, 796 216,188,252,2,177,215,188,244,2,240,4,24,125,248,2,157,
797 0xFC, 0xA8, 0xB9, 0xFF, 0xFF, 0x9D, 0x50, 0x05, 0xB9, 0xFF, 0xFF, 0x9D, 0x58, 0x05, 0xA9, 0x00, 797 248,2,189,240,2,41,63,56,233,1,157,8,3,189,204,2,
798 0x9D, 0x70, 0x05, 0x9D, 0x60, 0x05, 0xA4, 0xFC, 0xB1, 0xFA, 0x9D, 0x68, 0x05, 0xE8, 0x88, 0x10, 798 16,31,189,148,2,240,26,221,216,2,240,21,144,19,168,189,
799 0xDB, 0xA9, 0x11, 0x18, 0x65, 0xFA, 0x8D, 0x19, 0x05, 0xA9, 0x00, 0x65, 0xFB, 0x8D, 0x1A, 0x05, 799 212,2,24,125,208,2,157,212,2,144,6,152,233,16,157,148,
800 0xAD, 0x1B, 0x05, 0x8D, 0x1C, 0x05, 0xA2, 0x07, 0xDE, 0x70, 0x05, 0x30, 0x06, 0xCA, 0x10, 0xF8, 800 2,169,0,133,221,165,218,157,12,3,41,112,74,74,141,28,
801 0x4C, 0xA2, 0x08, 0xBD, 0x50, 0x05, 0x85, 0xFA, 0xBD, 0x58, 0x05, 0x85, 0xFB, 0xBC, 0x60, 0x05, 801 9,144,254,76,210,9,234,76,60,9,234,76,65,9,234,76,
802 0xB1, 0xFA, 0xD0, 0x1C, 0xC8, 0xB1, 0xFA, 0x9D, 0xD0, 0x05, 0x29, 0xF0, 0x9D, 0xD8, 0x05, 0xB1, 802 75,9,234,76,87,9,234,76,102,9,234,76,169,9,234,76,
803 0xFA, 0x0A, 0x0A, 0x0A, 0x0A, 0x9D, 0xE0, 0x05, 0xC8, 0x98, 0x9D, 0x60, 0x05, 0x4C, 0x57, 0x07, 803 184,9,165,219,76,21,10,165,219,133,221,189,144,2,76,216,
804 0xC9, 0x40, 0xB0, 0x4F, 0x7D, 0x68, 0x05, 0x9D, 0x98, 0x05, 0xC8, 0xB1, 0xFA, 0x10, 0x25, 0x29, 804 9,189,144,2,24,101,219,157,144,2,76,216,9,189,156,2,
805 0x7F, 0x85, 0xFC, 0xC8, 0xB1, 0xFA, 0x9D, 0xD0, 0x05, 0x29, 0xF0, 0x9D, 0xD8, 0x05, 0xB1, 0xFA, 805 24,101,219,157,156,2,189,144,2,76,216,9,189,240,2,16,
806 0x0A, 0x0A, 0x0A, 0x0A, 0x9D, 0xE0, 0x05, 0xC8, 0x98, 0x9D, 0x60, 0x05, 0xA4, 0xFC, 0x20, 0x9C, 806 12,188,144,2,177,213,24,125,248,2,76,135,9,189,144,2,
807 0x0F, 0x4C, 0x57, 0x07, 0xA8, 0xFE, 0x60, 0x05, 0xFE, 0x60, 0x05, 0xBD, 0xD0, 0x05, 0x29, 0xF0, 807 24,125,248,2,201,61,144,2,169,63,168,177,213,157,160,2,
808 0x9D, 0xD8, 0x05, 0xBD, 0xD0, 0x05, 0x0A, 0x0A, 0x0A, 0x0A, 0x9D, 0xE0, 0x05, 0x20, 0x9C, 0x0F, 808 164,219,208,3,157,164,2,152,74,74,74,74,157,168,2,157,
809 0x4C, 0x57, 0x07, 0xC9, 0x80, 0xB0, 0x25, 0x29, 0x3F, 0x18, 0x7D, 0x68, 0x05, 0x9D, 0x98, 0x05, 809 172,2,165,219,41,15,157,176,2,189,144,2,76,216,9,165,
810 0xC8, 0xB1, 0xFA, 0x9D, 0xD0, 0x05, 0x29, 0xF0, 0x9D, 0xD8, 0x05, 0xB1, 0xFA, 0x0A, 0x0A, 0x0A, 810 219,24,125,20,3,157,20,3,189,144,2,76,216,9,165,219,
811 0x0A, 0x9D, 0xE0, 0x05, 0xC8, 0x98, 0x9D, 0x60, 0x05, 0x4C, 0x57, 0x07, 0xD0, 0x0E, 0xC8, 0xB1, 811 201,128,240,6,157,144,2,76,216,9,189,28,3,9,240,157,
812 0xFA, 0x9D, 0x70, 0x05, 0xC8, 0x98, 0x9D, 0x60, 0x05, 0x4C, 0x57, 0x07, 0xC9, 0xC0, 0xB0, 0x0F, 812 28,3,189,144,2,76,216,9,189,144,2,24,101,219,188,240,
813 0x29, 0x3F, 0x18, 0x7D, 0x68, 0x05, 0x9D, 0x98, 0x05, 0xFE, 0x60, 0x05, 0x4C, 0x57, 0x07, 0xC9, 813 2,48,31,24,125,248,2,201,61,144,7,169,0,157,28,3,
814 0xD0, 0xB0, 0x0F, 0xC8, 0xFE, 0x60, 0x05, 0x29, 0x0F, 0x8D, 0x1B, 0x05, 0x8D, 0x1C, 0x05, 0x4C, 814 169,63,157,16,3,168,177,213,24,125,156,2,24,101,221,76,
815 0x6A, 0x07, 0xC9, 0xE0, 0xB0, 0x16, 0xB1, 0xFA, 0x85, 0xFC, 0xC8, 0xB1, 0xFA, 0x85, 0xFD, 0xC8, 815 21,10,201,61,144,7,169,0,157,28,3,169,63,168,189,156,
816 0x98, 0x9D, 0x60, 0x05, 0xA5, 0xFC, 0x20, 0x0E, 0x0E, 0x4C, 0x57, 0x07, 0xC9, 0xF0, 0xB0, 0x2E, 816 2,24,125,248,2,24,113,213,24,101,221,157,24,3,189,172,
817 0xB1, 0xFA, 0x85, 0xFC, 0xC8, 0xB1, 0xFA, 0x85, 0xFD, 0xA5, 0xFC, 0x20, 0x0E, 0x0E, 0xBC, 0x60, 817 2,240,50,222,172,2,208,45,189,168,2,157,172,2,189,164,
818 0x05, 0xC8, 0xC8, 0xB1, 0xFA, 0x9D, 0xD0, 0x05, 0x29, 0xF0, 0x9D, 0xD8, 0x05, 0xB1, 0xFA, 0x0A, 818 2,221,160,2,240,31,176,13,125,176,2,176,18,221,160,2,
819 0x0A, 0x0A, 0x0A, 0x9D, 0xE0, 0x05, 0xC8, 0x98, 0x9D, 0x60, 0x05, 0x4C, 0x57, 0x07, 0xC9, 0xFF, 819 176,13,76,76,10,253,176,2,144,5,221,160,2,176,3,189,
820 0xB0, 0x0B, 0xE9, 0xEF, 0x9D, 0x70, 0x05, 0xFE, 0x60, 0x05, 0x4C, 0x57, 0x07, 0xA9, 0x40, 0x9D, 820 160,2,157,164,2,165,218,41,1,240,10,189,164,2,24,125,
821 0x70, 0x05, 0x4C, 0x57, 0x07, 0x20, 0xB5, 0x09, 0xA2, 0x07, 0xBD, 0x78, 0x05, 0xF0, 0x73, 0x4C, 821 156,2,157,24,3,202,48,3,76,39,8,173,32,3,13,33,
822 0xD9, 0x0A, 0xBD, 0x0E, 0x05, 0xF0, 0x0E, 0xA9, 0x00, 0x9D, 0x20, 0x05, 0x9D, 0x28, 0x05, 0xCA, 822 3,13,34,3,13,35,3,170,142,44,11,173,12,3,16,33,
823 0x10, 0xE8, 0x4C, 0x1F, 0x09, 0xA4, 0xFD, 0xB9, 0x00, 0x03, 0x18, 0x65, 0xFC, 0x9D, 0x38, 0x05, 823 173,28,3,41,15,240,26,173,24,3,24,109,20,3,141,26,
824 0x98, 0x9D, 0xA0, 0x05, 0xBD, 0xB0, 0x05, 0x3D, 0xA8, 0x06, 0xF0, 0x28, 0xA5, 0xFD, 0x29, 0x7F, 824 3,173,30,3,41,16,208,5,169,0,141,30,3,138,9,4,
825 0xA8, 0xB9, 0x00, 0x04, 0x18, 0x65, 0xFC, 0x9D, 0x37, 0x05, 0xB9, 0x80, 0x04, 0x69, 0x00, 0x9D, 825 170,173,13,3,16,33,173,29,3,41,15,240,26,173,25,3,
826 0x38, 0x05, 0xA9, 0x00, 0x9D, 0x1F, 0x05, 0xBC, 0x98, 0x06, 0x99, 0x27, 0x05, 0xCA, 0xCA, 0x10, 826 24,109,21,3,141,27,3,173,31,3,41,16,208,5,169,0,
827 0xA9, 0x4C, 0x1F, 0x09, 0xBD, 0xB0, 0x05, 0x3D, 0xA0, 0x06, 0xF0, 0x16, 0xBD, 0x68, 0x06, 0x18, 827 141,31,3,138,9,2,170,236,44,11,208,94,173,13,3,41,
828 0x65, 0xFD, 0x9D, 0xA2, 0x05, 0xA8, 0xB9, 0x00, 0x03, 0x18, 0x65, 0xFC, 0x38, 0x65, 0xFE, 0x9D, 828 14,201,6,208,38,173,29,3,41,15,240,31,172,17,3,185,
829 0x3A, 0x05, 0xCA, 0x10, 0x85, 0xE8, 0x86, 0xFC, 0xA2, 0x03, 0xAD, 0x09, 0x05, 0xF0, 0x06, 0x29, 829 192,3,141,24,3,185,192,4,141,25,3,173,28,3,41,16,
830 0x40, 0xD0, 0x3C, 0xA2, 0x07, 0x8A, 0xA8, 0xB9, 0x20, 0x05, 0xD0, 0x0C, 0xBC, 0x98, 0x06, 0xB9, 830 208,5,169,0,141,28,3,138,9,80,170,173,15,3,41,14,
831 0x28, 0x05, 0xD0, 0x04, 0x8A, 0xA8, 0xA9, 0x00, 0x19, 0xA8, 0x05, 0x9D, 0x30, 0x05, 0xB9, 0x38, 831 201,6,208,38,173,31,3,41,15,240,31,172,19,3,185,192,
832 0x05, 0x9D, 0x48, 0x05, 0xB9, 0xA0, 0x05, 0x9D, 0x40, 0x05, 0xB9, 0xB0, 0x05, 0x05, 0xFC, 0x85, 832 3,141,26,3,185,192,4,141,27,3,173,30,3,41,16,208,
833 0xFC, 0xE0, 0x04, 0xD0, 0x03, 0x8D, 0x1F, 0x05, 0xCA, 0x10, 0xCA, 0x8D, 0x1E, 0x05, 0x60, 0xBD, 833 5,169,0,141,30,3,138,9,40,170,142,44,11,173,38,3,
834 0x20, 0x05, 0x1D, 0xA8, 0x05, 0x9D, 0x30, 0x05, 0xBD, 0x2C, 0x05, 0x1D, 0xAC, 0x05, 0x9D, 0x34, 834 96,160,255,173,24,3,174,28,3,141,0,210,142,1,210,173,
835 0x05, 0xBD, 0x38, 0x05, 0x9D, 0x48, 0x05, 0xBD, 0x3C, 0x05, 0x9D, 0x4C, 0x05, 0xBD, 0xA0, 0x05, 835 25,3,174,29,3,141,2,210,142,3,210,173,26,3,174,30,
836 0x9D, 0x40, 0x05, 0xBD, 0xA4, 0x05, 0x9D, 0x44, 0x05, 0xCA, 0x10, 0xD3, 0xAD, 0xB0, 0x05, 0x0D, 836 3,141,4,210,142,5,210,173,27,3,174,31,3,141,6,210,
837 0xB1, 0x05, 0x0D, 0xB2, 0x05, 0x0D, 0xB3, 0x05, 0x8D, 0x1E, 0x05, 0xAD, 0xB4, 0x05, 0x0D, 0xB5, 837 142,7,210,140,8,210,96
838 0x05, 0x0D, 0xB6, 0x05, 0x0D, 0xB7, 0x05, 0x8D, 0x1F, 0x05, 0x60, 0xAD, 0x09, 0x05, 0xD0, 0x03, 838END_CONST_ARRAY;
839 0x4C, 0x90, 0x0A, 0x30, 0x03, 0x4C, 0x48, 0x0A, 0xAD, 0x0D, 0x05, 0xAA, 0x4A, 0x4A, 0x29, 0x01, 839CONST_ARRAY(byte, rmt8_obx)
840 0xA8, 0xB9, 0x1E, 0x05, 0x8D, 0x38, 0xD2, 0x8A, 0x29, 0x04, 0xA8, 0xB9, 0x38, 0x05, 0x8D, 0x30, 840 255,255,144,3,108,12,128,0,128,32,128,64,0,192,128,128,
841 0xD2, 0xBD, 0x20, 0x05, 0x8D, 0x31, 0xD2, 0xB9, 0x39, 0x05, 0x8D, 0x32, 0xD2, 0xBD, 0x21, 0x05, 841 128,160,0,192,64,192,0,1,5,11,21,0,1,255,255,1,
842 0x8D, 0x33, 0xD2, 0xB9, 0x3A, 0x05, 0x8D, 0x34, 0xD2, 0xBD, 0x22, 0x05, 0x8D, 0x35, 0xD2, 0xB9, 842 1,0,255,255,0,1,1,1,0,255,255,255,255,0,1,1,
843 0x3B, 0x05, 0x8D, 0x36, 0xD2, 0xBD, 0x23, 0x05, 0x8D, 0x37, 0xD2, 0xAD, 0x0C, 0x05, 0xAA, 0x4A, 843 0,0,0,0,0,0,242,51,150,226,56,140,0,106,232,106,
844 0x4A, 0x29, 0x01, 0xA8, 0xB9, 0x1E, 0x05, 0x8D, 0x28, 0xD2, 0x8A, 0x29, 0x04, 0xA8, 0xB9, 0x38, 844 239,128,8,174,70,230,149,65,246,176,110,48,246,187,132,82,
845 0x05, 0x8D, 0x20, 0xD2, 0xBD, 0x20, 0x05, 0x8D, 0x21, 0xD2, 0xB9, 0x39, 0x05, 0x8D, 0x22, 0xD2, 845 34,244,200,160,122,85,52,20,245,216,189,164,141,119,96,78,
846 0xBD, 0x21, 0x05, 0x8D, 0x23, 0xD2, 0xB9, 0x3A, 0x05, 0x8D, 0x24, 0xD2, 0xBD, 0x22, 0x05, 0x8D, 846 56,39,21,6,247,232,219,207,195,184,172,162,154,144,136,127,
847 0x25, 0xD2, 0xB9, 0x3B, 0x05, 0x8D, 0x26, 0xD2, 0xBD, 0x23, 0x05, 0x8D, 0x27, 0xD2, 0xAD, 0x0B, 847 120,112,106,100,94,0,191,182,170,161,152,143,137,128,242,230,
848 0x05, 0xAA, 0x4A, 0x4A, 0x29, 0x01, 0xA8, 0xB9, 0x1E, 0x05, 0x8D, 0x18, 0xD2, 0x8A, 0xAC, 0x09, 848 218,206,191,182,170,161,152,143,137,128,122,113,107,101,95,92,
849 0x05, 0x10, 0x02, 0x29, 0x04, 0xA8, 0xB9, 0x38, 0x05, 0x8D, 0x10, 0xD2, 0xBD, 0x20, 0x05, 0x8D, 849 86,80,77,71,68,62,60,56,53,50,47,45,42,40,37,35,
850 0x11, 0xD2, 0xB9, 0x39, 0x05, 0x8D, 0x12, 0xD2, 0xBD, 0x21, 0x05, 0x8D, 0x13, 0xD2, 0xB9, 0x3A, 850 33,31,29,28,26,24,23,22,20,19,18,17,16,15,14,13,
851 0x05, 0x8D, 0x14, 0xD2, 0xBD, 0x22, 0x05, 0x8D, 0x15, 0xD2, 0xB9, 0x3B, 0x05, 0x8D, 0x16, 0xD2, 851 12,11,10,9,8,7,255,241,228,216,202,192,181,171,162,153,
852 0xBD, 0x23, 0x05, 0x8D, 0x17, 0xD2, 0xAD, 0x0A, 0x05, 0xAA, 0x4A, 0x4A, 0x29, 0x01, 0xA8, 0xB9, 852 142,135,127,121,115,112,102,97,90,85,82,75,72,67,63,60,
853 0x1E, 0x05, 0x8D, 0x08, 0xD2, 0x8A, 0xAC, 0x09, 0x05, 0x10, 0x02, 0x29, 0x04, 0xA8, 0xB9, 0x38, 853 57,55,51,48,45,42,40,37,36,33,31,30,28,27,25,23,
854 0x05, 0x8D, 0x00, 0xD2, 0xBD, 0x20, 0x05, 0x8D, 0x01, 0xD2, 0xB9, 0x39, 0x05, 0x8D, 0x02, 0xD2, 854 22,21,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
855 0xBD, 0x21, 0x05, 0x8D, 0x03, 0xD2, 0xB9, 0x3A, 0x05, 0x8D, 0x04, 0xD2, 0xBD, 0x22, 0x05, 0x8D, 855 5,4,3,2,1,0,243,230,217,204,193,181,173,162,153,144,
856 0x05, 0xD2, 0xB9, 0x3B, 0x05, 0x8D, 0x06, 0xD2, 0xBD, 0x23, 0x05, 0x8D, 0x07, 0xD2, 0x60, 0xBD, 856 136,128,121,114,108,102,96,91,85,81,76,72,68,64,60,57,
857 0x80, 0x05, 0x85, 0xFA, 0xBD, 0x88, 0x05, 0x85, 0xFB, 0xBD, 0x80, 0x06, 0x85, 0xFC, 0xBD, 0x88, 857 53,50,47,45,42,40,37,35,33,31,29,28,26,24,23,22,
858 0x06, 0x85, 0xFD, 0xBD, 0x90, 0x06, 0x85, 0xFE, 0xBD, 0xB8, 0x05, 0xDD, 0xC0, 0x05, 0x90, 0x0C, 858 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,
859 0x9D, 0x08, 0x06, 0xBD, 0xC8, 0x05, 0x9D, 0xB8, 0x05, 0x4C, 0x0B, 0x0B, 0xBD, 0x08, 0x06, 0xF0, 859 4,3,2,1,0,0,13,13,12,11,11,10,10,9,8,8,
860 0x30, 0xBD, 0xE8, 0x05, 0xF0, 0x13, 0xDE, 0xF8, 0x05, 0xD0, 0x0E, 0x9D, 0xF8, 0x05, 0xBD, 0xD8, 860 7,7,7,6,6,5,5,5,4,4,4,4,3,3,3,3,
861 0x05, 0xF0, 0x06, 0x38, 0xE9, 0x10, 0x9D, 0xD8, 0x05, 0xBD, 0xF0, 0x05, 0xF0, 0x13, 0xDE, 0x00, 861 3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
862 0x06, 0xD0, 0x0E, 0x9D, 0x00, 0x06, 0xBD, 0xE0, 0x05, 0xF0, 0x06, 0x38, 0xE9, 0x10, 0x9D, 0xE0, 862 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
863 0x05, 0xBC, 0x48, 0x06, 0xB1, 0xFA, 0x18, 0x7D, 0x98, 0x05, 0x18, 0x65, 0xFD, 0x85, 0xFD, 0xDE, 863 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
864 0x58, 0x06, 0x10, 0x39, 0xBD, 0x50, 0x06, 0x9D, 0x58, 0x06, 0xBD, 0x60, 0x06, 0xF0, 0x1E, 0x18, 864 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
865 0x7D, 0x48, 0x06, 0x9D, 0x48, 0x06, 0xF0, 0x0D, 0xDD, 0x40, 0x06, 0x90, 0x20, 0xA9, 0xFF, 0x9D, 865 1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
866 0x60, 0x06, 0x4C, 0x87, 0x0B, 0xA9, 0x01, 0x9D, 0x60, 0x06, 0x4C, 0x87, 0x0B, 0xFE, 0x48, 0x06, 866 1,1,2,2,2,2,0,0,0,1,1,1,1,1,2,2,
867 0xBD, 0x40, 0x06, 0xDD, 0x48, 0x06, 0xB0, 0x05, 0xA9, 0x00, 0x9D, 0x48, 0x06, 0xA9, 0x13, 0x18, 867 2,2,2,3,3,3,0,0,1,1,1,1,2,2,2,2,
868 0x65, 0xFA, 0x85, 0xFA, 0x90, 0x02, 0xE6, 0xFB, 0xBC, 0xB8, 0x05, 0xB1, 0xFA, 0x29, 0xF0, 0x9D, 868 3,3,3,3,4,4,0,0,1,1,1,2,2,2,3,3,
869 0xA8, 0x05, 0xB1, 0xFA, 0x29, 0x0F, 0x1D, 0xD8, 0x05, 0xA8, 0xB9, 0x00, 0x02, 0x05, 0xFF, 0xA8, 869 3,4,4,4,5,5,0,0,1,1,2,2,2,3,3,4,
870 0xB9, 0x00, 0x02, 0x9D, 0x20, 0x05, 0xBC, 0xB8, 0x05, 0xC8, 0xB1, 0xFA, 0x29, 0x0F, 0x1D, 0xE0, 870 4,4,5,5,6,6,0,0,1,1,2,2,3,3,4,4,
871 0x05, 0xA8, 0xB9, 0x00, 0x02, 0x05, 0xFF, 0xA8, 0xB9, 0x00, 0x02, 0x9D, 0x28, 0x05, 0xBD, 0x28, 871 5,5,6,6,7,7,0,1,1,2,2,3,3,4,4,5,
872 0x06, 0xD0, 0x27, 0xBD, 0x10, 0x06, 0x8D, 0xD4, 0x0B, 0x10, 0xFE, 0x4C, 0xD1, 0x0C, 0xEA, 0x4C, 872 5,6,6,7,7,8,0,1,1,2,2,3,4,4,5,5,
873 0x6C, 0x0C, 0xEA, 0x4C, 0xA7, 0x0C, 0xEA, 0x4C, 0xD4, 0x0C, 0xEA, 0x4C, 0x01, 0x0D, 0xEA, 0x4C, 873 6,7,7,8,8,9,0,1,1,2,3,3,4,5,5,6,
874 0x21, 0x0D, 0xEA, 0x4C, 0x41, 0x0D, 0xEA, 0x4C, 0x49, 0x0D, 0xDE, 0x28, 0x06, 0xBC, 0xB8, 0x05, 874 7,7,8,9,9,10,0,1,1,2,3,4,4,5,6,7,
875 0xC8, 0xB1, 0xFA, 0x29, 0x70, 0x4A, 0x4A, 0x4A, 0x8D, 0x22, 0x0C, 0xB1, 0xFA, 0x30, 0x06, 0xBD, 875 7,8,9,10,10,11,0,1,2,2,3,4,5,6,6,7,
876 0x70, 0x06, 0x4C, 0x12, 0x0C, 0xBD, 0x78, 0x06, 0x3D, 0xB0, 0x06, 0x9D, 0xB0, 0x05, 0xC8, 0xC8, 876 8,9,10,10,11,12,0,1,2,3,3,4,5,6,7,8,
877 0x98, 0x9D, 0xB8, 0x05, 0x88, 0xB1, 0xFA, 0x90, 0xFE, 0x90, 0x16, 0x90, 0x0C, 0x90, 0x22, 0x90, 877 9,10,10,11,12,13,0,1,2,3,4,5,6,7,7,8,
878 0x18, 0x90, 0x2E, 0x90, 0x24, 0x90, 0x32, 0x90, 0x34, 0x7D, 0x80, 0x06, 0x9D, 0x80, 0x06, 0xB1, 878 9,10,11,12,13,14,0,1,2,3,4,5,6,7,8,9,
879 0xFA, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0x4C, 0xAC, 0x08, 0x7D, 0x88, 0x06, 0x9D, 0x88, 0x06, 0xB1, 879 10,11,12,13,14,15,76,15,6,76,9,8,76,46,8,76,
880 0xFA, 0x18, 0x65, 0xFD, 0x85, 0xFD, 0x4C, 0xAC, 0x08, 0x7D, 0x90, 0x06, 0x9D, 0x90, 0x06, 0xB1, 880 92,6,76,2,12,134,211,132,212,72,160,0,152,153,0,2,
881 0xFA, 0x18, 0x65, 0xFE, 0x85, 0xFE, 0x4C, 0xAC, 0x08, 0x85, 0xFC, 0xA9, 0x00, 0x85, 0xFD, 0x4C, 881 153,76,2,200,208,247,160,4,177,211,141,34,8,200,177,211,
882 0xAC, 0x08, 0xBD, 0x20, 0x06, 0x29, 0x03, 0x4A, 0x90, 0x0A, 0xD0, 0x19, 0xBD, 0x18, 0x06, 0x18, 882 141,72,3,200,177,211,141,18,8,141,74,3,160,8,177,211,
883 0x65, 0xFC, 0x85, 0xFC, 0xDE, 0x38, 0x06, 0x10, 0x4E, 0xFE, 0x20, 0x06, 0xBD, 0x30, 0x06, 0x9D, 883 153,195,0,200,192,16,208,246,104,72,10,10,10,24,101,209,
884 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xA5, 0xFC, 0xFD, 0x18, 0x06, 0x85, 0xFC, 0xDE, 0x38, 0x06, 0x10, 884 133,209,104,8,41,224,10,42,42,42,40,101,210,133,210,32,
885 0x36, 0xFE, 0x20, 0x06, 0xBD, 0x30, 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBC, 0x20, 0x06, 885 123,6,169,0,141,8,210,141,24,210,160,3,140,15,210,140,
886 0xBD, 0x18, 0x06, 0x30, 0x02, 0xC8, 0xC8, 0x88, 0x98, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0xDE, 0x38, 886 31,210,160,8,153,0,210,153,16,210,136,16,247,173,18,8,
887 0x06, 0x10, 0x14, 0x98, 0x9D, 0x20, 0x06, 0xDD, 0x18, 0x06, 0xD0, 0x05, 0x49, 0xFF, 0x9D, 0x18, 887 96,162,0,142,75,3,138,168,177,209,201,254,176,45,168,177,
888 0x06, 0xBD, 0x30, 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBC, 0x20, 0x06, 0xBD, 0x18, 0x06, 888 205,157,0,2,177,207,157,8,2,169,0,157,16,2,169,1,
889 0x30, 0x02, 0xC8, 0xC8, 0x88, 0x98, 0x18, 0x65, 0xFD, 0x85, 0xFD, 0xDE, 0x38, 0x06, 0x10, 0xE7, 889 157,24,2,169,128,157,104,2,232,224,8,208,217,165,209,24,
890 0x98, 0x9D, 0x20, 0x06, 0xDD, 0x18, 0x06, 0xD0, 0xD8, 0x49, 0xFF, 0x9D, 0x18, 0x06, 0xBD, 0x30, 890 105,8,133,209,144,27,230,210,76,203,6,240,4,169,0,240,
891 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBD, 0x20, 0x06, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0xDE, 891 223,160,2,177,209,170,200,177,209,133,210,134,209,162,0,240,
892 0x38, 0x06, 0x10, 0xC3, 0xBD, 0x18, 0x06, 0x18, 0x7D, 0x20, 0x06, 0x9D, 0x20, 0x06, 0xBD, 0x30, 892 181,173,72,3,141,35,7,162,255,232,222,24,2,208,69,189,
893 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xA5, 0xFD, 0x38, 0xFD, 0x20, 0x06, 0x85, 0xFD, 0xDE, 893 0,2,133,211,189,8,2,133,212,188,16,2,254,16,2,177,
894 0x38, 0x06, 0x10, 0xA3, 0xBD, 0x18, 0x06, 0x18, 0x7D, 0x20, 0x06, 0x9D, 0x20, 0x06, 0xBD, 0x30, 894 211,133,217,41,63,201,61,240,17,176,56,157,32,2,157,32,
895 0x06, 0x9D, 0x38, 0x06, 0x4C, 0xF7, 0x0B, 0xBD, 0x18, 0x06, 0x18, 0x65, 0xFC, 0x85, 0xFC, 0x4C, 895 3,200,177,211,74,41,126,157,104,2,169,1,157,24,2,188,
896 0xF7, 0x0B, 0xA0, 0x10, 0xA9, 0x00, 0x85, 0xFA, 0xA9, 0x00, 0x85, 0xFB, 0xA9, 0x00, 0x8D, 0x17, 896 16,2,254,16,2,177,211,74,102,217,74,102,217,165,217,41,
897 0x05, 0x8A, 0xF0, 0x3F, 0xB1, 0xFA, 0xF0, 0x02, 0x10, 0x01, 0xCA, 0xA9, 0x11, 0x18, 0x65, 0xFA, 897 240,157,40,2,224,7,208,177,169,255,141,72,3,141,73,3,
898 0x85, 0xFA, 0x90, 0x02, 0xE6, 0xFB, 0xEE, 0x17, 0x05, 0xD0, 0xE6, 0xA2, 0x00, 0xA9, 0x00, 0x85, 898 76,114,7,201,63,240,27,165,217,41,192,240,9,10,42,42,
899 0xFC, 0x8A, 0x8D, 0x17, 0x05, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 0xFC, 0x0A, 0x26, 899 157,24,2,76,30,7,200,177,211,157,24,2,254,16,2,76,
900 0xFC, 0x6D, 0x17, 0x05, 0x90, 0x02, 0xE6, 0xFC, 0x18, 0x69, 0x00, 0x85, 0xFA, 0xA5, 0xFC, 0x69, 900 30,7,165,217,48,12,200,177,211,141,35,7,254,16,2,76,
901 0x00, 0x85, 0xFB, 0x20, 0x2C, 0x0F, 0xA5, 0xFA, 0x8D, 0x19, 0x05, 0xA5, 0xFB, 0x8D, 0x1A, 0x05, 901 227,6,201,255,240,9,200,177,211,157,16,2,76,227,6,76,
902 0xA2, 0x07, 0xA9, 0xFF, 0x9D, 0xD0, 0x05, 0xA9, 0xF0, 0x9D, 0xD8, 0x05, 0x9D, 0xE0, 0x05, 0xCA, 902 123,6,76,46,8,202,48,250,188,104,2,48,248,177,203,157,
903 0x10, 0xF0, 0xA9, 0x03, 0x8D, 0x0F, 0xD2, 0x8D, 0x1F, 0xD2, 0x8D, 0x2F, 0xD2, 0x8D, 0x3F, 0xD2, 903 112,2,133,215,200,177,203,157,120,2,133,216,169,1,157,40,
904 0xCE, 0x17, 0x05, 0xE8, 0x8E, 0x1C, 0x05, 0xE8, 0x8E, 0x1D, 0x05, 0x8E, 0x16, 0x05, 0x60, 0x8A, 904 3,168,177,215,157,8,3,200,177,215,157,136,2,200,177,215,
905 0x29, 0x0F, 0x8D, 0x1B, 0x05, 0x60, 0x8E, 0x16, 0x05, 0x60, 0xC9, 0x10, 0xB0, 0x03, 0x4C, 0x4C, 905 157,144,2,200,177,215,157,224,2,41,63,157,16,3,177,215,
906 0x0D, 0xC9, 0x20, 0x90, 0x88, 0xC9, 0x30, 0xB0, 0x03, 0x4C, 0x85, 0x0F, 0xC9, 0x40, 0x90, 0xDF, 906 41,64,157,232,2,200,177,215,157,64,3,200,177,215,157,160,
907 0xC9, 0x50, 0xB0, 0x03, 0x4C, 0x2C, 0x0F, 0xC9, 0x60, 0x90, 0xDB, 0xC9, 0x70, 0x90, 0x03, 0x4C, 907 2,200,177,215,157,176,2,200,177,215,157,184,2,200,177,215,
908 0xB4, 0x0E, 0x84, 0xFD, 0x29, 0x0F, 0x0A, 0x8D, 0x17, 0x0E, 0xA5, 0xFD, 0x90, 0xFE, 0x90, 0x1E, 908 168,185,160,3,157,192,2,157,200,2,185,161,3,157,208,2,
909 0x90, 0x38, 0x90, 0x59, 0x90, 0x60, 0x90, 0x1A, 0x90, 0x1C, 0x90, 0x1E, 0x90, 0x20, 0x90, 0x22, 909 160,10,177,215,157,216,2,169,128,157,168,2,157,104,2,10,
910 0x90, 0x24, 0x90, 0x0D, 0x90, 0x0B, 0x90, 0x09, 0x90, 0x07, 0x90, 0x05, 0x90, 0x03, 0x8D, 0x18, 910 157,152,2,157,56,2,168,177,215,157,0,3,105,0,157,128,
911 0x05, 0x60, 0x9D, 0x68, 0x06, 0x60, 0x9D, 0x70, 0x06, 0x60, 0x9D, 0x78, 0x06, 0x60, 0x9D, 0x90, 911 2,169,12,157,248,2,168,177,215,157,240,2,76,111,7,32,
912 0x06, 0x60, 0x9D, 0x80, 0x06, 0x60, 0x9D, 0x88, 0x06, 0x60, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0x10, 912 2,12,206,74,3,208,29,169,255,141,74,3,206,73,3,208,
913 0x06, 0x29, 0x30, 0xD0, 0x03, 0x9D, 0x20, 0x06, 0xA5, 0xFD, 0x30, 0x06, 0x29, 0x0F, 0x9D, 0x18, 913 19,238,75,3,173,75,3,201,255,240,3,76,203,6,76,123,
914 0x06, 0x60, 0x29, 0x0F, 0x49, 0xFF, 0x18, 0x69, 0x01, 0x9D, 0x18, 0x06, 0x60, 0x29, 0x3F, 0x9D, 914 6,76,116,10,169,4,133,214,162,7,189,120,2,240,242,133,
915 0x30, 0x06, 0x9D, 0x38, 0x06, 0x60, 0x29, 0x80, 0x0A, 0x2A, 0x9D, 0x60, 0x06, 0xA5, 0xFD, 0x29, 915 212,189,112,2,133,211,188,128,2,177,211,133,217,200,177,211,
916 0x70, 0x4A, 0x4A, 0x4A, 0x4A, 0x9D, 0x40, 0x06, 0xD0, 0x03, 0x9D, 0x60, 0x06, 0xA5, 0xFD, 0x29, 916 133,218,200,177,211,133,219,200,152,221,136,2,144,10,240,8,
917 0x0F, 0x9D, 0x50, 0x06, 0x9D, 0x58, 0x06, 0xBD, 0x48, 0x06, 0xDD, 0x40, 0x06, 0x90, 0x8F, 0xBD, 917 169,128,157,152,2,189,144,2,157,128,2,165,217,224,4,144,
918 0x40, 0x06, 0xF0, 0x02, 0xE9, 0x01, 0x9D, 0x48, 0x06, 0x60, 0x84, 0xFA, 0x86, 0xFB, 0xA0, 0x19, 918 4,74,74,74,74,41,15,29,40,2,168,185,0,5,133,220,
919 0xB1, 0xFA, 0xC8, 0x8D, 0x09, 0x05, 0xB1, 0xFA, 0xC8, 0x8D, 0x0A, 0x05, 0xB1, 0xFA, 0xC8, 0x8D, 919 165,218,41,14,168,185,144,3,133,213,165,220,25,145,3,157,
920 0x0B, 0x05, 0xB1, 0xFA, 0xC8, 0x8D, 0x0C, 0x05, 0xB1, 0xFA, 0xC8, 0x8D, 0x0D, 0x05, 0xB1, 0xFA, 920 56,3,189,184,2,240,40,201,1,208,33,189,56,2,24,125,
921 0x8D, 0x1B, 0x05, 0xA5, 0xFA, 0x49, 0x80, 0x30, 0x01, 0xE8, 0x8D, 0xAC, 0x0F, 0x8E, 0xAD, 0x0F, 921 216,2,24,188,192,2,121,165,3,157,56,2,200,152,221,208,
922 0x49, 0x80, 0x30, 0x01, 0xE8, 0x8D, 0x1D, 0x07, 0x8E, 0x1E, 0x07, 0xE8, 0x8D, 0x23, 0x07, 0x8E, 922 2,208,3,189,200,2,157,192,2,76,185,8,222,184,2,188,
923 0x24, 0x07, 0xE8, 0x8D, 0xA2, 0x0F, 0x8E, 0xA3, 0x0F, 0x49, 0x80, 0x30, 0x01, 0xE8, 0x8D, 0x19, 923 0,3,192,13,144,60,189,16,3,16,49,152,221,248,2,208,
924 0x05, 0x8D, 0xD7, 0x06, 0x8D, 0x4F, 0x0D, 0x8D, 0x94, 0x0D, 0x8E, 0x1A, 0x05, 0x8E, 0xDD, 0x06, 924 8,189,8,3,157,248,2,208,3,254,248,2,189,112,2,133,
925 0x8E, 0x53, 0x0D, 0x8E, 0x9A, 0x0D, 0xA9, 0xF0, 0x85, 0xFF, 0xA9, 0x00, 0x8D, 0x16, 0x05, 0x8D, 925 215,189,120,2,133,216,188,248,2,177,215,188,232,2,240,4,
926 0x18, 0x05, 0xA2, 0x07, 0xA9, 0x00, 0x8D, 0x16, 0x05, 0x9D, 0x78, 0x05, 0x9D, 0xB0, 0x05, 0x9D, 926 24,125,240,2,157,240,2,189,224,2,41,63,56,233,1,157,
927 0x20, 0x05, 0x9D, 0x28, 0x05, 0x9D, 0x30, 0x05, 0x9D, 0x30, 0xD2, 0x9D, 0x20, 0xD2, 0x9D, 0x10, 927 16,3,189,152,2,16,31,189,40,2,240,26,221,176,2,240,
928 0xD2, 0x9D, 0x00, 0xD2, 0xCA, 0x10, 0xE2, 0x8D, 0x18, 0xD2, 0x8D, 0x08, 0xD2, 0x8D, 0x38, 0xD2, 928 21,144,19,168,189,168,2,24,125,160,2,157,168,2,144,6,
929 0x8D, 0x28, 0xD2, 0x8D, 0x1E, 0x05, 0x8D, 0x1F, 0x05, 0x60, 0x9D, 0x20, 0x05, 0x9D, 0x28, 0x05, 929 152,233,16,157,40,2,169,0,133,221,165,218,157,24,3,41,
930 0x9D, 0x30, 0x05, 0x9D, 0xB0, 0x05, 0x60, 0x98, 0x9D, 0xD0, 0x05, 0x29, 0xF0, 0x9D, 0xD8, 0x05, 930 112,74,74,141,49,9,144,254,76,231,9,234,76,81,9,234,
931 0xBD, 0xD0, 0x05, 0x0A, 0x0A, 0x0A, 0x0A, 0x9D, 0xE0, 0x05, 0x60, 0x29, 0x07, 0x85, 0xFA, 0x8A, 931 76,86,9,234,76,96,9,234,76,108,9,234,76,123,9,234,
932 0xA6, 0xFA, 0x29, 0x3F, 0xF0, 0xE1, 0x9D, 0x98, 0x05, 0x98, 0x30, 0xEE, 0xBD, 0xD0, 0x05, 0x20, 932 76,190,9,234,76,205,9,165,219,76,42,10,165,219,133,221,
933 0x75, 0x0F, 0xA9, 0x00, 0x9D, 0x78, 0x05, 0xB9, 0xFF, 0xFF, 0xF0, 0xBE, 0x9D, 0x88, 0x05, 0x85, 933 189,32,2,76,237,9,189,32,2,24,101,219,157,32,2,76,
934 0xFB, 0xB9, 0xFF, 0xFF, 0x9D, 0x80, 0x05, 0x85, 0xFA, 0x98, 0x9D, 0x90, 0x05, 0xA0, 0x08, 0xB1, 934 237,9,189,56,2,24,101,219,157,56,2,189,32,2,76,237,
935 0xFA, 0xC8, 0x9D, 0xC0, 0x05, 0xB1, 0xFA, 0xC8, 0x9D, 0xC8, 0x05, 0xB1, 0xFA, 0xC8, 0x9D, 0x68, 935 9,189,224,2,16,12,188,32,2,177,213,24,125,240,2,76,
936 0x06, 0xB1, 0xFA, 0xC8, 0x9D, 0x70, 0x06, 0xB1, 0xFA, 0xC8, 0x9D, 0x78, 0x06, 0xB1, 0xFA, 0xC8, 936 156,9,189,32,2,24,125,240,2,201,61,144,2,169,63,168,
937 0x9D, 0xE8, 0x05, 0x9D, 0xF8, 0x05, 0xB1, 0xFA, 0xC8, 0x9D, 0xF0, 0x05, 0x9D, 0x00, 0x06, 0xB1, 937 177,213,157,64,2,164,219,208,3,157,72,2,152,74,74,74,
938 0xFA, 0x29, 0x70, 0x4A, 0x4A, 0x9D, 0x10, 0x06, 0xB1, 0xFA, 0xC8, 0x30, 0x08, 0x29, 0x0F, 0x9D, 938 74,157,80,2,157,88,2,165,219,41,15,157,96,2,189,32,
939 0x18, 0x06, 0x4C, 0x09, 0x10, 0x29, 0x0F, 0x49, 0xFF, 0x18, 0x69, 0x01, 0x9D, 0x18, 0x06, 0xB1, 939 2,76,237,9,165,219,24,125,40,3,157,40,3,189,32,2,
940 0xFA, 0xC8, 0x9D, 0x28, 0x06, 0xB1, 0xFA, 0xC8, 0x29, 0x3F, 0x9D, 0x30, 0x06, 0x9D, 0x38, 0x06, 940 76,237,9,165,219,201,128,240,6,157,32,2,76,237,9,189,
941 0xB1, 0xFA, 0x29, 0x80, 0x0A, 0x2A, 0x9D, 0x60, 0x06, 0xB1, 0xFA, 0x29, 0x70, 0x4A, 0x4A, 0x4A, 941 56,3,9,240,157,56,3,189,32,2,76,237,9,189,32,2,
942 0x4A, 0x9D, 0x40, 0x06, 0xD0, 0x03, 0x9D, 0x60, 0x06, 0xB1, 0xFA, 0x88, 0x29, 0x0F, 0x9D, 0x50, 942 24,101,219,188,224,2,48,31,24,125,240,2,201,61,144,7,
943 0x06, 0x9D, 0x58, 0x06, 0xB1, 0xFA, 0x29, 0xC0, 0x1D, 0x98, 0x05, 0x9D, 0x98, 0x05, 0xA8, 0xB9, 943 169,0,157,56,3,169,63,157,32,3,168,177,213,24,125,56,
944 0x00, 0x03, 0x9D, 0x38, 0x05, 0xA9, 0x00, 0x9D, 0xB8, 0x05, 0x9D, 0x20, 0x06, 0x9D, 0x08, 0x06, 944 2,24,101,221,76,42,10,201,61,144,7,169,0,157,56,3,
945 0x9D, 0x48, 0x06, 0x9D, 0x80, 0x06, 0x9D, 0x88, 0x06, 0x9D, 0x90, 0x06, 0xA9, 0x01, 0x9D, 0x78, 945 169,63,168,189,56,2,24,125,240,2,24,113,213,24,101,221,
946 0x05, 0x60 946 157,48,3,189,88,2,240,50,222,88,2,208,45,189,80,2,
947}; 947 157,88,2,189,72,2,221,64,2,240,31,176,13,125,96,2,
948 176,18,221,64,2,176,13,76,97,10,253,96,2,144,5,221,
949 64,2,176,3,189,64,2,157,72,2,165,218,41,1,240,10,
950 189,72,2,24,125,56,2,157,48,3,202,48,3,76,52,8,
951 173,64,3,13,65,3,13,66,3,13,67,3,170,142,101,12,
952 173,24,3,16,33,173,56,3,41,15,240,26,173,48,3,24,
953 109,40,3,141,50,3,173,58,3,41,16,208,5,169,0,141,
954 58,3,138,9,4,170,173,25,3,16,33,173,57,3,41,15,
955 240,26,173,49,3,24,109,41,3,141,51,3,173,59,3,41,
956 16,208,5,169,0,141,59,3,138,9,2,170,236,101,12,208,
957 94,173,25,3,41,14,201,6,208,38,173,57,3,41,15,240,
958 31,172,33,3,185,192,3,141,48,3,185,192,4,141,49,3,
959 173,56,3,41,16,208,5,169,0,141,56,3,138,9,80,170,
960 173,27,3,41,14,201,6,208,38,173,59,3,41,15,240,31,
961 172,35,3,185,192,3,141,50,3,185,192,4,141,51,3,173,
962 58,3,41,16,208,5,169,0,141,58,3,138,9,40,170,142,
963 101,12,173,68,3,13,69,3,13,70,3,13,71,3,170,142,
964 3,12,173,28,3,16,33,173,60,3,41,15,240,26,173,52,
965 3,24,109,44,3,141,54,3,173,62,3,41,16,208,5,169,
966 0,141,62,3,138,9,4,170,173,29,3,16,33,173,61,3,
967 41,15,240,26,173,53,3,24,109,45,3,141,55,3,173,63,
968 3,41,16,208,5,169,0,141,63,3,138,9,2,170,236,3,
969 12,208,94,173,29,3,41,14,201,6,208,38,173,61,3,41,
970 15,240,31,172,37,3,185,192,3,141,52,3,185,192,4,141,
971 53,3,173,60,3,41,16,208,5,169,0,141,60,3,138,9,
972 80,170,173,31,3,41,14,201,6,208,38,173,63,3,41,15,
973 240,31,172,39,3,185,192,3,141,54,3,185,192,4,141,55,
974 3,173,62,3,41,16,208,5,169,0,141,62,3,138,9,40,
975 170,142,3,12,173,74,3,96,160,255,173,52,3,174,48,3,
976 141,16,210,142,0,210,173,60,3,174,56,3,141,17,210,142,
977 1,210,173,53,3,174,49,3,141,18,210,142,2,210,173,61,
978 3,174,57,3,141,19,210,142,3,210,173,54,3,174,50,3,
979 141,20,210,142,4,210,173,62,3,174,58,3,141,21,210,142,
980 5,210,173,55,3,174,51,3,141,22,210,142,6,210,173,63,
981 3,174,59,3,141,23,210,142,7,210,169,255,140,24,210,141,
982 8,210,96
983END_CONST_ARRAY;
984CONST_ARRAY(byte, tmc_obx)
985 255,255,0,5,104,15,76,206,13,76,208,8,76,239,9,15,
986 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
987 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
988 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
989 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
990 0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
991 1,1,0,0,0,0,1,1,1,1,1,1,1,1,2,2,
992 2,2,0,0,0,1,1,1,1,1,2,2,2,2,2,3,
993 3,3,0,0,1,1,1,1,2,2,2,2,3,3,3,3,
994 4,4,0,0,1,1,1,2,2,2,3,3,3,4,4,4,
995 5,5,0,0,1,1,2,2,2,3,3,4,4,4,5,5,
996 6,6,0,0,1,1,2,2,3,3,4,4,5,5,6,6,
997 7,7,0,1,1,2,2,3,3,4,4,5,5,6,6,7,
998 7,8,0,1,1,2,2,3,4,4,5,5,6,7,7,8,
999 8,9,0,1,1,2,3,3,4,5,5,6,7,7,8,9,
1000 9,10,0,1,1,2,3,4,4,5,6,7,7,8,9,10,
1001 10,11,0,1,2,2,3,4,5,6,6,7,8,9,10,10,
1002 11,12,0,1,2,3,3,4,5,6,7,8,9,10,10,11,
1003 12,13,0,1,2,3,4,5,6,7,7,8,9,10,11,12,
1004 13,14,0,1,2,3,4,5,6,7,8,9,10,11,12,13,
1005 14,15,0,241,228,215,203,192,181,170,161,152,143,135,127,120,
1006 114,107,101,95,90,85,80,75,71,67,63,60,56,53,50,47,
1007 44,42,39,37,35,33,31,29,28,26,24,23,22,20,19,18,
1008 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,
1009 1,0,0,242,230,218,206,191,182,170,161,152,143,137,128,122,
1010 113,107,101,95,92,86,80,77,71,68,62,60,56,53,50,47,
1011 45,42,40,37,35,33,31,29,28,26,24,23,22,20,19,18,
1012 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,
1013 1,0,0,255,241,228,216,202,192,181,171,162,153,142,135,127,
1014 121,115,112,102,97,90,85,82,75,72,67,63,60,57,55,51,
1015 48,45,42,40,37,36,33,31,30,28,27,25,23,22,21,19,
1016 18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,
1017 2,1,0,243,230,217,204,193,181,173,162,153,144,136,128,121,
1018 114,108,102,96,91,85,81,76,72,68,64,60,57,53,50,47,
1019 45,42,40,37,35,33,31,29,28,26,24,23,22,20,19,18,
1020 17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,
1021 1,0,0,242,51,150,226,56,140,0,106,232,106,239,128,8,
1022 174,70,230,149,65,246,176,110,48,246,187,132,82,34,244,200,
1023 160,122,85,52,20,245,216,189,164,141,119,96,78,56,39,21,
1024 6,247,232,219,207,195,184,172,162,154,144,136,127,120,112,106,
1025 100,94,0,13,13,12,11,11,10,10,9,8,8,7,7,7,
1026 6,6,5,5,5,4,4,4,4,3,3,3,3,3,2,2,
1027 2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,
1028 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1029 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1030 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1031 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1032 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1033 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1034 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1035 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1036 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1037 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1038 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1039 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1040 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1041 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1042 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1043 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1044 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,
1045 6,7,0,1,2,3,4,2,0,0,4,2,0,0,0,16,
1046 0,8,0,16,0,8,173,183,8,240,94,173,182,8,201,64,
1047 144,90,206,181,8,240,3,76,239,9,162,7,169,0,157,196,
1048 7,157,204,7,202,16,247,141,182,8,170,160,15,177,254,16,
1049 32,136,177,254,16,3,76,95,14,134,252,10,10,38,252,10,
1050 38,252,10,38,252,105,0,133,254,165,252,105,0,133,255,144,
1051 218,157,212,7,136,177,254,157,220,7,232,136,16,207,24,165,
1052 254,105,16,133,254,144,2,230,255,76,239,9,206,181,8,16,
1053 248,238,182,8,173,180,8,141,181,8,162,7,222,204,7,48,
1054 3,76,233,9,188,212,7,185,255,255,133,252,185,255,255,133,
1055 253,188,196,7,177,252,208,6,32,109,13,76,230,9,201,64,
1056 176,18,125,220,7,157,228,7,32,109,13,188,42,5,32,188,
1057 14,76,230,9,208,34,200,254,196,7,177,252,16,7,133,251,
1058 32,109,13,165,251,41,127,208,7,169,64,141,182,8,208,76,
1059 141,180,8,141,181,8,208,68,201,128,176,43,41,63,125,220,
1060 7,157,228,7,200,254,196,7,177,252,41,127,208,7,169,64,
1061 141,182,8,208,6,141,180,8,141,181,8,32,109,13,188,42,
1062 5,32,188,14,76,230,9,201,192,176,12,41,63,157,42,5,
1063 200,254,196,7,76,94,9,41,63,157,204,7,254,196,7,202,
1064 48,3,76,70,9,162,7,189,188,7,240,33,32,46,11,189,
1065 50,5,61,192,8,240,22,160,71,177,252,24,125,34,5,157,
1066 36,5,168,185,60,6,56,125,100,8,157,246,7,202,16,215,
1067 14,9,5,14,9,5,14,9,5,14,9,5,232,134,252,134,
1068 253,162,7,138,168,185,252,7,208,12,188,184,8,185,4,8,
1069 208,4,138,168,169,0,133,250,152,157,26,5,185,244,7,157,
1070 18,5,185,50,5,133,251,5,253,133,253,165,251,61,192,8,
1071 240,6,185,246,7,157,20,5,165,251,61,200,8,240,18,185,
1072 34,5,41,63,168,200,132,252,185,123,7,157,18,5,76,137,
1073 10,164,252,240,10,185,59,7,157,18,5,169,0,133,252,165,
1074 250,13,9,5,168,185,60,5,188,26,5,25,236,7,157,10,
1075 5,224,4,208,9,165,253,141,59,5,169,0,133,253,202,16,
1076 130,78,9,5,78,9,5,78,9,5,78,9,5,165,253,162,
1077 3,142,31,210,142,15,210,174,22,5,172,18,5,142,16,210,
1078 140,0,210,174,14,5,172,10,5,142,17,210,140,1,210,174,
1079 23,5,172,19,5,142,18,210,140,2,210,174,15,5,172,11,
1080 5,142,19,210,140,3,210,174,24,5,172,20,5,142,20,210,
1081 140,4,210,174,16,5,172,12,5,142,21,210,140,5,210,174,
1082 25,5,172,21,5,142,22,210,140,6,210,174,17,5,172,13,
1083 5,142,23,210,140,7,210,141,58,5,174,59,5,142,24,210,
1084 141,8,210,96,189,28,8,133,252,189,36,8,133,253,188,44,
1085 8,192,63,240,123,254,44,8,254,44,8,254,44,8,177,252,
1086 41,240,157,236,7,177,252,41,15,56,253,12,8,16,2,169,
1087 0,157,252,7,200,177,252,41,15,56,253,20,8,16,2,169,
1088 0,157,4,8,177,252,41,240,240,116,16,11,160,73,177,252,
1089 188,44,8,136,136,16,2,169,0,157,50,5,177,252,41,112,
1090 240,99,74,74,141,154,11,169,0,157,100,8,200,177,252,144,
1091 254,234,234,234,234,76,56,13,234,76,53,13,234,76,60,13,
1092 234,76,74,13,234,76,84,13,234,76,95,13,234,76,81,13,
1093 189,52,8,240,18,222,68,8,208,13,157,68,8,189,252,7,
1094 41,15,240,3,222,252,7,189,60,8,240,18,222,76,8,208,
1095 13,157,76,8,189,4,8,41,15,240,3,222,4,8,160,72,
1096 177,252,157,50,5,189,148,8,24,105,63,168,177,252,125,228,
1097 7,157,34,5,168,185,60,6,157,244,7,222,164,8,16,51,
1098 189,156,8,157,164,8,189,172,8,240,24,24,125,148,8,157,
1099 148,8,240,7,221,140,8,208,26,169,254,24,105,1,157,172,
1100 8,208,16,254,148,8,189,140,8,221,148,8,176,5,169,0,
1101 157,148,8,189,116,8,240,4,222,116,8,96,189,108,8,133,
1102 250,189,92,8,133,251,32,105,12,222,132,8,16,16,165,250,
1103 157,108,8,165,251,157,92,8,189,124,8,157,132,8,96,189,
1104 84,8,141,112,12,16,254,76,167,12,234,76,144,12,234,76,
1105 174,12,234,76,180,12,234,76,190,12,234,76,210,12,234,76,
1106 226,12,234,76,244,12,165,250,230,250,41,3,74,144,15,208,
1107 71,165,251,157,100,8,24,125,244,7,157,244,7,96,169,0,
1108 157,100,8,96,32,29,13,76,157,12,32,29,13,24,125,34,
1109 5,76,84,13,165,250,157,100,8,24,125,244,7,157,244,7,
1110 165,250,24,101,251,133,250,96,189,34,5,56,229,250,157,34,
1111 5,168,185,60,6,76,199,12,189,244,7,56,229,251,157,244,
1112 7,56,169,0,229,251,157,100,8,96,189,132,8,208,174,165,
1113 251,16,16,189,4,8,240,165,189,252,7,201,15,240,158,254,
1114 252,7,96,189,252,7,240,149,189,4,8,201,15,240,142,254,
1115 4,8,96,164,250,165,251,48,2,200,200,136,152,133,250,197,
1116 251,208,6,165,251,73,255,133,251,152,96,125,244,7,157,244,
1117 7,96,188,228,7,121,60,6,157,244,7,152,157,34,5,96,
1118 45,10,210,157,244,7,96,125,228,7,157,34,5,168,185,60,
1119 6,157,244,7,96,157,34,5,168,189,244,7,121,60,6,157,
1120 244,7,96,200,254,196,7,177,252,74,74,74,74,157,12,8,
1121 177,252,41,15,157,20,8,96,32,95,14,160,15,169,0,133,
1122 254,169,0,133,255,138,240,46,177,254,16,1,202,24,165,254,
1123 105,16,133,254,144,239,230,255,176,235,32,95,14,169,0,133,
1124 252,138,10,10,38,252,10,38,252,10,38,252,105,0,133,254,
1125 165,252,105,0,133,255,169,64,141,182,8,169,1,141,181,8,
1126 141,183,8,96,201,16,144,176,201,32,144,206,201,48,176,3,
1127 76,174,14,201,64,176,9,138,41,15,240,3,141,180,8,96,
1128 201,80,144,113,201,96,176,6,169,0,141,183,8,96,201,112,
1129 144,248,169,1,141,181,8,169,64,141,182,8,132,252,134,253,
1130 160,30,177,252,141,180,8,165,252,24,105,32,141,194,14,144,
1131 1,232,142,195,14,24,105,64,141,202,14,144,1,232,142,203,
1132 14,24,105,64,141,82,9,144,1,232,142,83,9,24,105,128,
1133 141,87,9,144,1,232,142,88,9,24,105,128,133,254,141,16,
1134 9,141,136,13,141,183,13,144,1,232,134,255,142,22,9,142,
1135 140,13,142,189,13,160,7,169,0,141,183,8,153,0,210,153,
1136 16,210,153,10,5,153,252,7,153,4,8,153,50,5,153,188,
1137 7,136,16,232,141,8,210,141,24,210,141,58,5,141,59,5,
1138 96,157,252,7,157,4,8,157,50,5,189,228,7,157,34,5,
1139 96,152,73,240,74,74,74,74,157,12,8,152,41,15,73,15,
1140 157,20,8,96,41,7,133,252,138,166,252,41,63,240,226,157,
1141 228,7,169,0,157,188,7,185,255,255,157,28,8,133,252,185,
1142 255,255,157,36,8,133,253,5,252,240,182,160,74,177,252,157,
1143 52,8,157,68,8,200,177,252,157,60,8,157,76,8,200,177,
1144 252,41,112,74,74,157,84,8,177,252,41,15,157,92,8,177,
1145 252,16,11,189,92,8,73,255,24,105,1,157,92,8,200,177,
1146 252,157,116,8,200,177,252,41,63,157,124,8,157,132,8,200,
1147 177,252,41,128,240,2,169,1,157,172,8,177,252,41,112,74,
1148 74,74,74,157,140,8,208,3,157,172,8,177,252,41,15,157,
1149 156,8,157,164,8,136,177,252,41,192,24,125,228,7,157,228,
1150 7,157,34,5,168,185,60,6,157,244,7,169,0,157,44,8,
1151 157,100,8,157,108,8,157,148,8,169,1,157,188,7,96
1152END_CONST_ARRAY;
1153CONST_ARRAY(byte, tm2_obx)
1154 255,255,0,2,107,16,0,0,0,0,0,0,0,0,0,0,
1155 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
1156 1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
1157 1,1,2,2,2,2,0,0,0,1,1,1,1,1,2,2,
1158 2,2,2,3,3,3,0,0,1,1,1,1,2,2,2,2,
1159 3,3,3,3,4,4,0,0,1,1,1,2,2,2,3,3,
1160 3,4,4,4,5,5,0,0,1,1,2,2,2,3,3,4,
1161 4,4,5,5,6,6,0,0,1,1,2,2,3,3,4,4,
1162 5,5,6,6,7,7,0,1,1,2,2,3,3,4,4,5,
1163 5,6,6,7,7,8,0,1,1,2,2,3,4,4,5,5,
1164 6,7,7,8,8,9,0,1,1,2,3,3,4,5,5,6,
1165 7,7,8,9,9,10,0,1,1,2,3,4,4,5,6,7,
1166 7,8,9,10,10,11,0,1,2,2,3,4,5,6,6,7,
1167 8,9,10,10,11,12,0,1,2,3,3,4,5,6,7,8,
1168 9,10,10,11,12,13,0,1,2,3,4,5,6,7,7,8,
1169 9,10,11,12,13,14,0,1,2,3,4,5,6,7,8,9,
1170 10,11,12,13,14,15,0,241,228,215,203,192,181,170,161,152,
1171 143,135,127,120,114,107,101,95,90,85,80,75,71,67,63,60,
1172 56,53,50,47,44,42,39,37,35,33,31,29,28,26,24,23,
1173 22,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
1174 5,4,3,2,1,0,0,242,233,218,206,191,182,170,161,152,
1175 143,137,128,122,113,107,101,95,92,86,80,77,71,68,62,60,
1176 56,53,50,47,45,42,40,37,35,33,31,29,28,26,24,23,
1177 22,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
1178 5,4,3,2,1,0,0,255,241,228,216,202,192,181,171,162,
1179 153,142,135,127,121,115,112,102,97,90,85,82,75,72,67,63,
1180 60,57,55,51,48,45,42,40,37,36,33,31,30,28,27,25,
1181 23,22,21,19,18,17,16,15,14,13,12,11,10,9,8,7,
1182 6,5,4,3,2,1,0,243,230,217,204,193,181,173,162,153,
1183 144,136,128,121,114,108,102,96,91,85,81,76,72,68,64,60,
1184 57,53,50,47,45,42,40,37,35,33,31,29,28,26,24,23,
1185 22,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,
1186 5,4,3,2,1,0,226,56,140,0,106,232,106,239,128,8,
1187 174,70,230,149,65,246,176,110,48,246,187,132,82,34,244,200,
1188 160,122,85,52,20,245,216,189,164,141,119,96,78,56,39,21,
1189 6,247,232,219,207,195,184,172,162,154,144,136,127,120,112,106,
1190 100,94,87,82,50,10,0,242,51,150,226,56,140,0,106,232,
1191 106,239,128,8,174,70,230,149,65,246,176,110,48,246,187,132,
1192 82,34,244,200,160,122,85,52,20,245,216,189,164,141,119,96,
1193 78,56,39,21,6,247,232,219,207,195,184,172,162,154,144,136,
1194 127,120,112,106,100,94,11,11,10,10,9,8,8,7,7,7,
1195 6,6,5,5,5,4,4,4,4,3,3,3,3,3,2,2,
1196 2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,
1197 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1198 0,0,0,0,0,0,0,13,13,12,11,11,10,10,9,8,
1199 8,7,7,7,6,6,5,5,5,4,4,4,4,3,3,3,
1200 3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,
1201 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
1202 0,0,0,0,0,0,76,228,13,76,227,6,76,159,8,1,
1203 16,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1204 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1205 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1206 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1207 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1208 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1209 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1210 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1211 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1212 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1213 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1214 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1215 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1216 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1217 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1218 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1219 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1220 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1221 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1222 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1223 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1224 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1225 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1226 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1227 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,
1228 6,7,0,1,2,3,4,2,0,0,4,2,0,0,0,16,
1229 0,8,0,16,0,8,133,211,129,169,133,211,129,169,136,177,
1230 250,141,23,5,162,0,134,252,10,38,252,10,38,252,10,38,
1231 252,10,38,252,109,23,5,144,2,230,252,24,105,0,133,250,
1232 165,252,105,0,133,251,76,7,7,32,181,9,173,22,5,240,
1233 5,206,28,5,48,3,76,162,8,206,29,5,208,82,162,0,
1234 238,23,5,173,25,5,133,250,173,26,5,133,251,160,16,177,
1235 250,48,171,208,3,76,44,15,141,29,5,136,177,250,136,132,
1236 252,168,185,255,255,157,80,5,185,255,255,157,88,5,169,0,
1237 157,112,5,157,96,5,164,252,177,250,157,104,5,232,136,16,
1238 219,169,17,24,101,250,141,25,5,169,0,101,251,141,26,5,
1239 173,27,5,141,28,5,162,7,222,112,5,48,6,202,16,248,
1240 76,162,8,189,80,5,133,250,189,88,5,133,251,188,96,5,
1241 177,250,208,28,200,177,250,157,208,5,41,240,157,216,5,177,
1242 250,10,10,10,10,157,224,5,200,152,157,96,5,76,87,7,
1243 201,64,176,79,125,104,5,157,152,5,200,177,250,16,37,41,
1244 127,133,252,200,177,250,157,208,5,41,240,157,216,5,177,250,
1245 10,10,10,10,157,224,5,200,152,157,96,5,164,252,32,156,
1246 15,76,87,7,168,254,96,5,254,96,5,189,208,5,41,240,
1247 157,216,5,189,208,5,10,10,10,10,157,224,5,32,156,15,
1248 76,87,7,201,128,176,37,41,63,24,125,104,5,157,152,5,
1249 200,177,250,157,208,5,41,240,157,216,5,177,250,10,10,10,
1250 10,157,224,5,200,152,157,96,5,76,87,7,208,14,200,177,
1251 250,157,112,5,200,152,157,96,5,76,87,7,201,192,176,15,
1252 41,63,24,125,104,5,157,152,5,254,96,5,76,87,7,201,
1253 208,176,15,200,254,96,5,41,15,141,27,5,141,28,5,76,
1254 106,7,201,224,176,22,177,250,133,252,200,177,250,133,253,200,
1255 152,157,96,5,165,252,32,14,14,76,87,7,201,240,176,46,
1256 177,250,133,252,200,177,250,133,253,165,252,32,14,14,188,96,
1257 5,200,200,177,250,157,208,5,41,240,157,216,5,177,250,10,
1258 10,10,10,157,224,5,200,152,157,96,5,76,87,7,201,255,
1259 176,11,233,239,157,112,5,254,96,5,76,87,7,169,64,157,
1260 112,5,76,87,7,32,181,9,162,7,189,120,5,240,115,76,
1261 217,10,189,14,5,240,14,169,0,157,32,5,157,40,5,202,
1262 16,232,76,31,9,164,253,185,0,3,24,101,252,157,56,5,
1263 152,157,160,5,189,176,5,61,168,6,240,40,165,253,41,127,
1264 168,185,0,4,24,101,252,157,55,5,185,128,4,105,0,157,
1265 56,5,169,0,157,31,5,188,152,6,153,39,5,202,202,16,
1266 169,76,31,9,189,176,5,61,160,6,240,22,189,104,6,24,
1267 101,253,157,162,5,168,185,0,3,24,101,252,56,101,254,157,
1268 58,5,202,16,133,232,134,252,162,3,173,9,5,240,6,41,
1269 64,208,60,162,7,138,168,185,32,5,208,12,188,152,6,185,
1270 40,5,208,4,138,168,169,0,25,168,5,157,48,5,185,56,
1271 5,157,72,5,185,160,5,157,64,5,185,176,5,5,252,133,
1272 252,224,4,208,3,141,31,5,202,16,202,141,30,5,96,189,
1273 32,5,29,168,5,157,48,5,189,44,5,29,172,5,157,52,
1274 5,189,56,5,157,72,5,189,60,5,157,76,5,189,160,5,
1275 157,64,5,189,164,5,157,68,5,202,16,211,173,176,5,13,
1276 177,5,13,178,5,13,179,5,141,30,5,173,180,5,13,181,
1277 5,13,182,5,13,183,5,141,31,5,96,173,9,5,208,3,
1278 76,144,10,48,3,76,72,10,173,13,5,170,74,74,41,1,
1279 168,185,30,5,141,56,210,138,41,4,168,185,56,5,141,48,
1280 210,189,32,5,141,49,210,185,57,5,141,50,210,189,33,5,
1281 141,51,210,185,58,5,141,52,210,189,34,5,141,53,210,185,
1282 59,5,141,54,210,189,35,5,141,55,210,173,12,5,170,74,
1283 74,41,1,168,185,30,5,141,40,210,138,41,4,168,185,56,
1284 5,141,32,210,189,32,5,141,33,210,185,57,5,141,34,210,
1285 189,33,5,141,35,210,185,58,5,141,36,210,189,34,5,141,
1286 37,210,185,59,5,141,38,210,189,35,5,141,39,210,173,11,
1287 5,170,74,74,41,1,168,185,30,5,141,24,210,138,172,9,
1288 5,16,2,41,4,168,185,56,5,141,16,210,189,32,5,141,
1289 17,210,185,57,5,141,18,210,189,33,5,141,19,210,185,58,
1290 5,141,20,210,189,34,5,141,21,210,185,59,5,141,22,210,
1291 189,35,5,141,23,210,173,10,5,170,74,74,41,1,168,185,
1292 30,5,141,8,210,138,172,9,5,16,2,41,4,168,185,56,
1293 5,141,0,210,189,32,5,141,1,210,185,57,5,141,2,210,
1294 189,33,5,141,3,210,185,58,5,141,4,210,189,34,5,141,
1295 5,210,185,59,5,141,6,210,189,35,5,141,7,210,96,189,
1296 128,5,133,250,189,136,5,133,251,189,128,6,133,252,189,136,
1297 6,133,253,189,144,6,133,254,189,184,5,221,192,5,144,12,
1298 157,8,6,189,200,5,157,184,5,76,11,11,189,8,6,240,
1299 48,189,232,5,240,19,222,248,5,208,14,157,248,5,189,216,
1300 5,240,6,56,233,16,157,216,5,189,240,5,240,19,222,0,
1301 6,208,14,157,0,6,189,224,5,240,6,56,233,16,157,224,
1302 5,188,72,6,177,250,24,125,152,5,24,101,253,133,253,222,
1303 88,6,16,57,189,80,6,157,88,6,189,96,6,240,30,24,
1304 125,72,6,157,72,6,240,13,221,64,6,144,32,169,255,157,
1305 96,6,76,135,11,169,1,157,96,6,76,135,11,254,72,6,
1306 189,64,6,221,72,6,176,5,169,0,157,72,6,169,19,24,
1307 101,250,133,250,144,2,230,251,188,184,5,177,250,41,240,157,
1308 168,5,177,250,41,15,29,216,5,168,185,0,2,5,255,168,
1309 185,0,2,157,32,5,188,184,5,200,177,250,41,15,29,224,
1310 5,168,185,0,2,5,255,168,185,0,2,157,40,5,189,40,
1311 6,208,39,189,16,6,141,212,11,16,254,76,209,12,234,76,
1312 108,12,234,76,167,12,234,76,212,12,234,76,1,13,234,76,
1313 33,13,234,76,65,13,234,76,73,13,222,40,6,188,184,5,
1314 200,177,250,41,112,74,74,74,141,34,12,177,250,48,6,189,
1315 112,6,76,18,12,189,120,6,61,176,6,157,176,5,200,200,
1316 152,157,184,5,136,177,250,144,254,144,22,144,12,144,34,144,
1317 24,144,46,144,36,144,50,144,52,125,128,6,157,128,6,177,
1318 250,24,101,252,133,252,76,172,8,125,136,6,157,136,6,177,
1319 250,24,101,253,133,253,76,172,8,125,144,6,157,144,6,177,
1320 250,24,101,254,133,254,76,172,8,133,252,169,0,133,253,76,
1321 172,8,189,32,6,41,3,74,144,10,208,25,189,24,6,24,
1322 101,252,133,252,222,56,6,16,78,254,32,6,189,48,6,157,
1323 56,6,76,247,11,165,252,253,24,6,133,252,222,56,6,16,
1324 54,254,32,6,189,48,6,157,56,6,76,247,11,188,32,6,
1325 189,24,6,48,2,200,200,136,152,24,101,252,133,252,222,56,
1326 6,16,20,152,157,32,6,221,24,6,208,5,73,255,157,24,
1327 6,189,48,6,157,56,6,76,247,11,188,32,6,189,24,6,
1328 48,2,200,200,136,152,24,101,253,133,253,222,56,6,16,231,
1329 152,157,32,6,221,24,6,208,216,73,255,157,24,6,189,48,
1330 6,157,56,6,76,247,11,189,32,6,24,101,252,133,252,222,
1331 56,6,16,195,189,24,6,24,125,32,6,157,32,6,189,48,
1332 6,157,56,6,76,247,11,165,253,56,253,32,6,133,253,222,
1333 56,6,16,163,189,24,6,24,125,32,6,157,32,6,189,48,
1334 6,157,56,6,76,247,11,189,24,6,24,101,252,133,252,76,
1335 247,11,160,16,169,0,133,250,169,0,133,251,169,0,141,23,
1336 5,138,240,63,177,250,240,2,16,1,202,169,17,24,101,250,
1337 133,250,144,2,230,251,238,23,5,208,230,162,0,169,0,133,
1338 252,138,141,23,5,10,38,252,10,38,252,10,38,252,10,38,
1339 252,109,23,5,144,2,230,252,24,105,0,133,250,165,252,105,
1340 0,133,251,32,44,15,165,250,141,25,5,165,251,141,26,5,
1341 162,7,169,255,157,208,5,169,240,157,216,5,157,224,5,202,
1342 16,240,169,3,141,15,210,141,31,210,141,47,210,141,63,210,
1343 206,23,5,232,142,28,5,232,142,29,5,142,22,5,96,138,
1344 41,15,141,27,5,96,142,22,5,96,201,16,176,3,76,76,
1345 13,201,32,144,136,201,48,176,3,76,133,15,201,64,144,223,
1346 201,80,176,3,76,44,15,201,96,144,219,201,112,144,3,76,
1347 180,14,132,253,41,15,10,141,23,14,165,253,144,254,144,30,
1348 144,56,144,89,144,96,144,26,144,28,144,30,144,32,144,34,
1349 144,36,144,13,144,11,144,9,144,7,144,5,144,3,141,24,
1350 5,96,157,104,6,96,157,112,6,96,157,120,6,96,157,144,
1351 6,96,157,128,6,96,157,136,6,96,41,112,74,74,157,16,
1352 6,41,48,208,3,157,32,6,165,253,48,6,41,15,157,24,
1353 6,96,41,15,73,255,24,105,1,157,24,6,96,41,63,157,
1354 48,6,157,56,6,96,41,128,10,42,157,96,6,165,253,41,
1355 112,74,74,74,74,157,64,6,208,3,157,96,6,165,253,41,
1356 15,157,80,6,157,88,6,189,72,6,221,64,6,144,143,189,
1357 64,6,240,2,233,1,157,72,6,96,132,250,134,251,160,25,
1358 177,250,200,141,9,5,177,250,200,141,10,5,177,250,200,141,
1359 11,5,177,250,200,141,12,5,177,250,200,141,13,5,177,250,
1360 141,27,5,165,250,73,128,48,1,232,141,172,15,142,173,15,
1361 73,128,48,1,232,141,29,7,142,30,7,232,141,35,7,142,
1362 36,7,232,141,162,15,142,163,15,73,128,48,1,232,141,25,
1363 5,141,215,6,141,79,13,141,148,13,142,26,5,142,221,6,
1364 142,83,13,142,154,13,169,240,133,255,169,0,141,22,5,141,
1365 24,5,162,7,169,0,141,22,5,157,120,5,157,176,5,157,
1366 32,5,157,40,5,157,48,5,157,48,210,157,32,210,157,16,
1367 210,157,0,210,202,16,226,141,24,210,141,8,210,141,56,210,
1368 141,40,210,141,30,5,141,31,5,96,157,32,5,157,40,5,
1369 157,48,5,157,176,5,96,152,157,208,5,41,240,157,216,5,
1370 189,208,5,10,10,10,10,157,224,5,96,41,7,133,250,138,
1371 166,250,41,63,240,225,157,152,5,152,48,238,189,208,5,32,
1372 117,15,169,0,157,120,5,185,255,255,240,190,157,136,5,133,
1373 251,185,255,255,157,128,5,133,250,152,157,144,5,160,8,177,
1374 250,200,157,192,5,177,250,200,157,200,5,177,250,200,157,104,
1375 6,177,250,200,157,112,6,177,250,200,157,120,6,177,250,200,
1376 157,232,5,157,248,5,177,250,200,157,240,5,157,0,6,177,
1377 250,41,112,74,74,157,16,6,177,250,200,48,8,41,15,157,
1378 24,6,76,9,16,41,15,73,255,24,105,1,157,24,6,177,
1379 250,200,157,40,6,177,250,200,41,63,157,48,6,157,56,6,
1380 177,250,41,128,10,42,157,96,6,177,250,41,112,74,74,74,
1381 74,157,64,6,208,3,157,96,6,177,250,136,41,15,157,80,
1382 6,157,88,6,177,250,41,192,29,152,5,157,152,5,168,185,
1383 0,3,157,56,5,169,0,157,184,5,157,32,6,157,8,6,
1384 157,72,6,157,128,6,157,136,6,157,144,6,169,1,157,120,
1385 5,96
1386END_CONST_ARRAY;