From: David Griffith Date: Tue, 27 Mar 2018 17:46:02 +0000 (-0700) Subject: Convert DOS-style line endings to Unix-style. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=f43679b82405a797e20d94ff50e6198251858352;p=liskon_frotz.git Convert DOS-style line endings to Unix-style. --- diff --git a/src/sdl/samplerate.h b/src/sdl/samplerate.h index a446fff..9232dc2 100644 --- a/src/sdl/samplerate.h +++ b/src/sdl/samplerate.h @@ -1,196 +1,196 @@ -/* -** Copyright (C) 2002-2004 Erik de Castro Lopo -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software -** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. -*/ - -/* -** API documentation is available here: -** http://www.mega-nerd.com/SRC/api.html -*/ - -#ifndef SAMPLERATE_H -#define SAMPLERATE_H - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -/* Opaque data type SRC_STATE. */ -typedef struct SRC_STATE_tag SRC_STATE ; - -/* SRC_DATA is used to pass data to src_simple() and src_process(). */ -typedef struct -{ float *data_in, *data_out ; - - long input_frames, output_frames ; - long input_frames_used, output_frames_gen ; - - int end_of_input ; - - double src_ratio ; -} SRC_DATA ; - -/* SRC_CB_DATA is used with callback based API. */ -typedef struct -{ long frames ; - float *data_in ; -} SRC_CB_DATA ; - -/* -** User supplied callback function type for use with src_callback_new() -** and src_callback_read(). First parameter is the same pointer that was -** passed into src_callback_new(). Second parameter is pointer to a -** pointer. The user supplied callback function must modify *data to -** point to the start of the user supplied float array. The user supplied -** function must return the number of frames that **data points to. -*/ - -typedef long (*src_callback_t) (void *cb_data, float **data) ; - -/* -** Standard initialisation function : return an anonymous pointer to the -** internal state of the converter. Choose a converter from the enums below. -** Error returned in *error. -*/ - -SRC_STATE* src_new (int converter_type, int channels, int *error) ; - -/* -** Initilisation for callback based API : return an anonymous pointer to the -** internal state of the converter. Choose a converter from the enums below. -** The cb_data pointer can point to any data or be set to NULL. Whatever the -** value, when processing, user supplied function "func" gets called with -** cb_data as first parameter. -*/ - -SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int channels, - int *error, void* cb_data) ; - -/* -** Cleanup all internal allocations. -** Always returns NULL. -*/ - -SRC_STATE* src_delete (SRC_STATE *state) ; - -/* -** Standard processing function. -** Returns non zero on error. -*/ - -int src_process (SRC_STATE *state, SRC_DATA *data) ; - -/* -** Callback based processing function. Read up to frames worth of data from -** the converter int *data and return frames read or -1 on error. -*/ -long src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) ; - -/* -** Simple interface for performing a single conversion from input buffer to -** output buffer at a fixed conversion ratio. -** Simple interface does not require initialisation as it can only operate on -** a single buffer worth of audio. -*/ - -int src_simple (SRC_DATA *data, int converter_type, int channels) ; - -/* -** This library contains a number of different sample rate converters, -** numbered 0 through N. -** -** Return a string giving either a name or a more full description of each -** sample rate converter or NULL if no sample rate converter exists for -** the given value. The converters are sequentially numbered from 0 to N. -*/ - -const char *src_get_name (int converter_type) ; -const char *src_get_description (int converter_type) ; -const char *src_get_version (void) ; - -/* -** Set a new SRC ratio. This allows step responses -** in the conversion ratio. -** Returns non zero on error. -*/ - -int src_set_ratio (SRC_STATE *state, double new_ratio) ; - -/* -** Reset the internal SRC state. -** Does not modify the quality settings. -** Does not free any memory allocations. -** Returns non zero on error. -*/ - -int src_reset (SRC_STATE *state) ; - -/* -** Return TRUE if ratio is a valid conversion ratio, FALSE -** otherwise. -*/ - -int src_is_valid_ratio (double ratio) ; - -/* -** Return an error number. -*/ - -int src_error (SRC_STATE *state) ; - -/* -** Convert the error number into a string. -*/ -const char* src_strerror (int error) ; - -/* -** The following enums can be used to set the interpolator type -** using the function src_set_converter(). -*/ - -enum -{ - SRC_SINC_BEST_QUALITY = 0, - SRC_SINC_MEDIUM_QUALITY = 1, - SRC_SINC_FASTEST = 2, - SRC_ZERO_ORDER_HOLD = 3, - SRC_LINEAR = 4 -} ; - -/* -** Extra helper functions for converting from short to float and -** back again. -*/ - -void src_short_to_float_array (const short *in, float *out, int len) ; -void src_float_to_short_array (const float *in, short *out, int len) ; - - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* SAMPLERATE_H */ - -/* -** Do not edit or modify anything in this comment block. -** The arch-tag line is a file identity tag for the GNU Arch -** revision control system. -** -** arch-tag: 5421ef3e-c898-4ec3-8671-ea03d943ee00 -*/ - +/* +** Copyright (C) 2002-2004 Erik de Castro Lopo +** +** This program is free software; you can redistribute it and/or modify +** it under the terms of the GNU General Public License as published by +** the Free Software Foundation; either version 2 of the License, or +** (at your option) any later version. +** +** This program is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +** GNU General Public License for more details. +** +** You should have received a copy of the GNU General Public License +** along with this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. +*/ + +/* +** API documentation is available here: +** http://www.mega-nerd.com/SRC/api.html +*/ + +#ifndef SAMPLERATE_H +#define SAMPLERATE_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + +/* Opaque data type SRC_STATE. */ +typedef struct SRC_STATE_tag SRC_STATE ; + +/* SRC_DATA is used to pass data to src_simple() and src_process(). */ +typedef struct +{ float *data_in, *data_out ; + + long input_frames, output_frames ; + long input_frames_used, output_frames_gen ; + + int end_of_input ; + + double src_ratio ; +} SRC_DATA ; + +/* SRC_CB_DATA is used with callback based API. */ +typedef struct +{ long frames ; + float *data_in ; +} SRC_CB_DATA ; + +/* +** User supplied callback function type for use with src_callback_new() +** and src_callback_read(). First parameter is the same pointer that was +** passed into src_callback_new(). Second parameter is pointer to a +** pointer. The user supplied callback function must modify *data to +** point to the start of the user supplied float array. The user supplied +** function must return the number of frames that **data points to. +*/ + +typedef long (*src_callback_t) (void *cb_data, float **data) ; + +/* +** Standard initialisation function : return an anonymous pointer to the +** internal state of the converter. Choose a converter from the enums below. +** Error returned in *error. +*/ + +SRC_STATE* src_new (int converter_type, int channels, int *error) ; + +/* +** Initilisation for callback based API : return an anonymous pointer to the +** internal state of the converter. Choose a converter from the enums below. +** The cb_data pointer can point to any data or be set to NULL. Whatever the +** value, when processing, user supplied function "func" gets called with +** cb_data as first parameter. +*/ + +SRC_STATE* src_callback_new (src_callback_t func, int converter_type, int channels, + int *error, void* cb_data) ; + +/* +** Cleanup all internal allocations. +** Always returns NULL. +*/ + +SRC_STATE* src_delete (SRC_STATE *state) ; + +/* +** Standard processing function. +** Returns non zero on error. +*/ + +int src_process (SRC_STATE *state, SRC_DATA *data) ; + +/* +** Callback based processing function. Read up to frames worth of data from +** the converter int *data and return frames read or -1 on error. +*/ +long src_callback_read (SRC_STATE *state, double src_ratio, long frames, float *data) ; + +/* +** Simple interface for performing a single conversion from input buffer to +** output buffer at a fixed conversion ratio. +** Simple interface does not require initialisation as it can only operate on +** a single buffer worth of audio. +*/ + +int src_simple (SRC_DATA *data, int converter_type, int channels) ; + +/* +** This library contains a number of different sample rate converters, +** numbered 0 through N. +** +** Return a string giving either a name or a more full description of each +** sample rate converter or NULL if no sample rate converter exists for +** the given value. The converters are sequentially numbered from 0 to N. +*/ + +const char *src_get_name (int converter_type) ; +const char *src_get_description (int converter_type) ; +const char *src_get_version (void) ; + +/* +** Set a new SRC ratio. This allows step responses +** in the conversion ratio. +** Returns non zero on error. +*/ + +int src_set_ratio (SRC_STATE *state, double new_ratio) ; + +/* +** Reset the internal SRC state. +** Does not modify the quality settings. +** Does not free any memory allocations. +** Returns non zero on error. +*/ + +int src_reset (SRC_STATE *state) ; + +/* +** Return TRUE if ratio is a valid conversion ratio, FALSE +** otherwise. +*/ + +int src_is_valid_ratio (double ratio) ; + +/* +** Return an error number. +*/ + +int src_error (SRC_STATE *state) ; + +/* +** Convert the error number into a string. +*/ +const char* src_strerror (int error) ; + +/* +** The following enums can be used to set the interpolator type +** using the function src_set_converter(). +*/ + +enum +{ + SRC_SINC_BEST_QUALITY = 0, + SRC_SINC_MEDIUM_QUALITY = 1, + SRC_SINC_FASTEST = 2, + SRC_ZERO_ORDER_HOLD = 3, + SRC_LINEAR = 4 +} ; + +/* +** Extra helper functions for converting from short to float and +** back again. +*/ + +void src_short_to_float_array (const short *in, float *out, int len) ; +void src_float_to_short_array (const float *in, short *out, int len) ; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* __cplusplus */ + +#endif /* SAMPLERATE_H */ + +/* +** Do not edit or modify anything in this comment block. +** The arch-tag line is a file identity tag for the GNU Arch +** revision control system. +** +** arch-tag: 5421ef3e-c898-4ec3-8671-ea03d943ee00 +*/ + diff --git a/src/sdl/sf_deffont.c b/src/sdl/sf_deffont.c index 340526f..012d4ce 100644 --- a/src/sdl/sf_deffont.c +++ b/src/sdl/sf_deffont.c @@ -1,668 +1,668 @@ -static unsigned char myfont[] = { - 0x00,0x00,0x00,0x00,0x20,0x00,0x53,0x01, - 0x20,0x00,0x0e,0x02,0xdc,0x04,0x00,0x00, - 0xf1,0x04,0x00,0x00,0x06,0x05,0x00,0x00, - 0x1b,0x05,0x00,0x00,0x30,0x05,0x00,0x00, - 0x45,0x05,0x00,0x00,0x5a,0x05,0x00,0x00, - 0x6f,0x05,0x00,0x00,0x84,0x05,0x00,0x00, - 0x99,0x05,0x00,0x00,0xae,0x05,0x00,0x00, - 0xc3,0x05,0x00,0x00,0xd8,0x05,0x00,0x00, - 0xed,0x05,0x00,0x00,0x02,0x06,0x00,0x00, - 0x17,0x06,0x00,0x00,0x2c,0x06,0x00,0x00, - 0x41,0x06,0x00,0x00,0x56,0x06,0x00,0x00, - 0x6b,0x06,0x00,0x00,0x80,0x06,0x00,0x00, - 0x95,0x06,0x00,0x00,0xaa,0x06,0x00,0x00, - 0xbf,0x06,0x00,0x00,0xd4,0x06,0x00,0x00, - 0xe9,0x06,0x00,0x00,0xfe,0x06,0x00,0x00, - 0x13,0x07,0x00,0x00,0x28,0x07,0x00,0x00, - 0x3d,0x07,0x00,0x00,0x52,0x07,0x00,0x00, - 0x67,0x07,0x00,0x00,0x7c,0x07,0x00,0x00, - 0x91,0x07,0x00,0x00,0xa6,0x07,0x00,0x00, - 0xbb,0x07,0x00,0x00,0xd0,0x07,0x00,0x00, - 0xe5,0x07,0x00,0x00,0xfa,0x07,0x00,0x00, - 0x0f,0x08,0x00,0x00,0x24,0x08,0x00,0x00, - 0x39,0x08,0x00,0x00,0x4e,0x08,0x00,0x00, - 0x63,0x08,0x00,0x00,0x78,0x08,0x00,0x00, - 0x8d,0x08,0x00,0x00,0xa2,0x08,0x00,0x00, - 0xb7,0x08,0x00,0x00,0xcc,0x08,0x00,0x00, - 0xe1,0x08,0x00,0x00,0xf6,0x08,0x00,0x00, - 0x0b,0x09,0x00,0x00,0x20,0x09,0x00,0x00, - 0x35,0x09,0x00,0x00,0x4a,0x09,0x00,0x00, - 0x5f,0x09,0x00,0x00,0x74,0x09,0x00,0x00, - 0x89,0x09,0x00,0x00,0x9e,0x09,0x00,0x00, - 0xb3,0x09,0x00,0x00,0xc8,0x09,0x00,0x00, - 0xdd,0x09,0x00,0x00,0xf2,0x09,0x00,0x00, - 0x07,0x0a,0x00,0x00,0x1c,0x0a,0x00,0x00, - 0x31,0x0a,0x00,0x00,0x46,0x0a,0x00,0x00, - 0x5b,0x0a,0x00,0x00,0x70,0x0a,0x00,0x00, - 0x85,0x0a,0x00,0x00,0x9a,0x0a,0x00,0x00, - 0xaf,0x0a,0x00,0x00,0xc4,0x0a,0x00,0x00, - 0xd9,0x0a,0x00,0x00,0xee,0x0a,0x00,0x00, - 0x03,0x0b,0x00,0x00,0x18,0x0b,0x00,0x00, - 0x2d,0x0b,0x00,0x00,0x42,0x0b,0x00,0x00, - 0x57,0x0b,0x00,0x00,0x6c,0x0b,0x00,0x00, - 0x81,0x0b,0x00,0x00,0x96,0x0b,0x00,0x00, - 0xab,0x0b,0x00,0x00,0xc0,0x0b,0x00,0x00, - 0xd5,0x0b,0x00,0x00,0xea,0x0b,0x00,0x00, - 0xff,0x0b,0x00,0x00,0x14,0x0c,0x00,0x00, - 0x29,0x0c,0x00,0x00,0x3e,0x0c,0x00,0x00, - 0x53,0x0c,0x00,0x00,0x68,0x0c,0x00,0x00, - 0x7d,0x0c,0x00,0x00,0x92,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xa7,0x0c,0x00,0x00, - 0xbc,0x0c,0x00,0x00,0xd1,0x0c,0x00,0x00, - 0xe6,0x0c,0x00,0x00,0xfb,0x0c,0x00,0x00, - 0x10,0x0d,0x00,0x00,0x25,0x0d,0x00,0x00, - 0x3a,0x0d,0x00,0x00,0x4f,0x0d,0x00,0x00, - 0x64,0x0d,0x00,0x00,0x79,0x0d,0x00,0x00, - 0x8e,0x0d,0x00,0x00,0xa3,0x0d,0x00,0x00, - 0xb8,0x0d,0x00,0x00,0xcd,0x0d,0x00,0x00, - 0xe2,0x0d,0x00,0x00,0xf7,0x0d,0x00,0x00, - 0x0c,0x0e,0x00,0x00,0x21,0x0e,0x00,0x00, - 0x36,0x0e,0x00,0x00,0x4b,0x0e,0x00,0x00, - 0x60,0x0e,0x00,0x00,0x75,0x0e,0x00,0x00, - 0x8a,0x0e,0x00,0x00,0x9f,0x0e,0x00,0x00, - 0xb4,0x0e,0x00,0x00,0xc9,0x0e,0x00,0x00, - 0xde,0x0e,0x00,0x00,0xf3,0x0e,0x00,0x00, - 0x08,0x0f,0x00,0x00,0x1d,0x0f,0x00,0x00, - 0x32,0x0f,0x00,0x00,0x47,0x0f,0x00,0x00, - 0x5c,0x0f,0x00,0x00,0x71,0x0f,0x00,0x00, - 0x86,0x0f,0x00,0x00,0x9b,0x0f,0x00,0x00, - 0xb0,0x0f,0x00,0x00,0xc5,0x0f,0x00,0x00, - 0xda,0x0f,0x00,0x00,0xef,0x0f,0x00,0x00, - 0x04,0x10,0x00,0x00,0x19,0x10,0x00,0x00, - 0x2e,0x10,0x00,0x00,0x43,0x10,0x00,0x00, - 0x58,0x10,0x00,0x00,0x6d,0x10,0x00,0x00, - 0x82,0x10,0x00,0x00,0x97,0x10,0x00,0x00, - 0xac,0x10,0x00,0x00,0xc1,0x10,0x00,0x00, - 0xd6,0x10,0x00,0x00,0xeb,0x10,0x00,0x00, - 0x00,0x11,0x00,0x00,0x15,0x11,0x00,0x00, - 0x2a,0x11,0x00,0x00,0x3f,0x11,0x00,0x00, - 0x54,0x11,0x00,0x00,0x69,0x11,0x00,0x00, - 0x7e,0x11,0x00,0x00,0x93,0x11,0x00,0x00, - 0xa8,0x11,0x00,0x00,0xbd,0x11,0x00,0x00, - 0xd2,0x11,0x00,0x00,0xe7,0x11,0x00,0x00, - 0xfc,0x11,0x00,0x00,0x11,0x12,0x00,0x00, - 0x26,0x12,0x00,0x00,0x3b,0x12,0x00,0x00, - 0x50,0x12,0x00,0x00,0x65,0x12,0x00,0x00, - 0x7a,0x12,0x00,0x00,0x8f,0x12,0x00,0x00, - 0xa4,0x12,0x00,0x00,0xb9,0x12,0x00,0x00, - 0xce,0x12,0x00,0x00,0xe3,0x12,0x00,0x00, - 0xf8,0x12,0x00,0x00,0x0d,0x13,0x00,0x00, - 0x22,0x13,0x00,0x00,0x37,0x13,0x00,0x00, - 0x4c,0x13,0x00,0x00,0x61,0x13,0x00,0x00, - 0x76,0x13,0x00,0x00,0x8b,0x13,0x00,0x00, - 0xa0,0x13,0x00,0x00,0xb5,0x13,0x00,0x00, - 0xca,0x13,0x00,0x00,0xdf,0x13,0x00,0x00, - 0xf4,0x13,0x00,0x00,0x09,0x14,0x00,0x00, - 0x1e,0x14,0x00,0x00,0x33,0x14,0x00,0x00, - 0x48,0x14,0x00,0x00,0x5d,0x14,0x00,0x00, - 0x72,0x14,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x87,0x14,0x00,0x00, - 0x9c,0x14,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08, - 0x08,0x00,0x08,0x08,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x22,0x22,0x22, - 0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x7e, - 0x24,0x24,0x7e,0x48,0x48,0x48,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x08,0x3e,0x49,0x48,0x38,0x0e,0x09, - 0x49,0x3e,0x08,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x31,0x4a, - 0x4a,0x34,0x08,0x08,0x16,0x29,0x29,0x46, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x1c,0x22,0x22,0x22,0x1c, - 0x39,0x45,0x42,0x46,0x39,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x08,0x08, - 0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x04,0x08,0x08,0x10, - 0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x20,0x10,0x10,0x08,0x08,0x08,0x08, - 0x08,0x08,0x10,0x10,0x20,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, - 0x00,0x08,0x49,0x2a,0x1c,0x2a,0x49,0x08, - 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, - 0x08,0x7f,0x08,0x08,0x08,0x00,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x18,0x08,0x08,0x10,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x02,0x02,0x04,0x08,0x08,0x10,0x10,0x20, - 0x40,0x40,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x18,0x24,0x42, - 0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x08,0x18,0x28,0x08,0x08,0x08, - 0x08,0x08,0x08,0x3e,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x3c, - 0x42,0x42,0x02,0x0c,0x10,0x20,0x40,0x40, - 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x02, - 0x1c,0x02,0x02,0x42,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x04,0x0c,0x14,0x24,0x44,0x44,0x7e, - 0x04,0x04,0x04,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x7e,0x40, - 0x40,0x40,0x7c,0x02,0x02,0x02,0x42,0x3c, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x1c,0x20,0x40,0x40,0x7c, - 0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x7e,0x02,0x02,0x04,0x04,0x04,0x08,0x08, - 0x08,0x08,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x3c,0x42,0x42, - 0x42,0x3c,0x42,0x42,0x42,0x42,0x3c,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x3c,0x42,0x42,0x42,0x3e,0x02, - 0x02,0x02,0x04,0x38,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, - 0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18, - 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, - 0x00,0x00,0x00,0x18,0x08,0x08,0x10,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x10, - 0x08,0x04,0x02,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7e,0x00,0x00,0x00,0x7e,0x00,0x00, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x40,0x20,0x10,0x08, - 0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x3c,0x42,0x42,0x02,0x04,0x08,0x08,0x00, - 0x08,0x08,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x1c,0x22,0x4a, - 0x56,0x52,0x52,0x52,0x4e,0x20,0x1e,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x18,0x24,0x24,0x42,0x42,0x7e, - 0x42,0x42,0x42,0x42,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x7c, - 0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0x42, - 0x7c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40, - 0x40,0x40,0x40,0x42,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42, - 0x42,0x44,0x78,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x7e,0x40, - 0x40,0x40,0x7c,0x40,0x40,0x40,0x40,0x7e, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x7e,0x40,0x40,0x40,0x7c, - 0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x3c,0x42,0x42,0x40,0x40,0x4e,0x42,0x42, - 0x46,0x3a,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x42,0x42,0x42, - 0x42,0x7e,0x42,0x42,0x42,0x42,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x3e,0x08,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x3e,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x1f, - 0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x44, - 0x38,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x50, - 0x60,0x60,0x50,0x48,0x44,0x42,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40, - 0x40,0x40,0x7e,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x42,0x42, - 0x66,0x66,0x5a,0x5a,0x42,0x42,0x42,0x42, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x42,0x62,0x62,0x52,0x52, - 0x4a,0x4a,0x46,0x46,0x42,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x7c,0x42,0x42, - 0x42,0x7c,0x40,0x40,0x40,0x40,0x40,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42, - 0x42,0x5a,0x66,0x3c,0x03,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x7c, - 0x42,0x42,0x42,0x7c,0x48,0x44,0x44,0x42, - 0x42,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40, - 0x30,0x0c,0x02,0x42,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x7f,0x08,0x08,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x41,0x41,0x41,0x22,0x22, - 0x22,0x14,0x14,0x08,0x08,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x42,0x42,0x42,0x42,0x5a,0x5a,0x66,0x66, - 0x42,0x42,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x42,0x42,0x24, - 0x24,0x18,0x18,0x24,0x24,0x42,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x41,0x41,0x22,0x22,0x14,0x08, - 0x08,0x08,0x08,0x08,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x7e, - 0x02,0x02,0x04,0x08,0x10,0x20,0x40,0x40, - 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x0e,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x0e,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x40,0x40,0x20,0x10,0x10,0x08,0x08, - 0x04,0x02,0x02,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x70,0x10,0x10, - 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, - 0x70,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x18,0x24,0x42,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x7f,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x18,0x10,0x10,0x08,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x00,0x00,0x3c,0x42,0x02,0x3e, - 0x42,0x42,0x46,0x3a,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x40,0x40, - 0x40,0x5c,0x62,0x42,0x42,0x42,0x42,0x62, - 0x5c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42, - 0x40,0x40,0x40,0x40,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x02,0x02,0x02,0x3a,0x46,0x42,0x42,0x42, - 0x42,0x46,0x3a,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, - 0x3c,0x42,0x42,0x7e,0x40,0x40,0x42,0x3c, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x0c,0x10,0x10,0x10,0x7c,0x10, - 0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x02,0x3a,0x44,0x44,0x44,0x38,0x20, - 0x3c,0x42,0x42,0x3c,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x40,0x40,0x40,0x5c, - 0x62,0x42,0x42,0x42,0x42,0x42,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08, - 0x08,0x08,0x08,0x3e,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x04,0x04, - 0x00,0x0c,0x04,0x04,0x04,0x04,0x04,0x04, - 0x04,0x48,0x30,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x40,0x40,0x44,0x48, - 0x50,0x60,0x50,0x48,0x44,0x42,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08, - 0x08,0x08,0x3e,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, - 0x76,0x49,0x49,0x49,0x49,0x49,0x49,0x49, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x5c,0x62,0x42, - 0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42, - 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x5c, - 0x62,0x42,0x42,0x42,0x42,0x62,0x5c,0x40, - 0x40,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x00,0x00,0x3a,0x46,0x42,0x42, - 0x42,0x42,0x46,0x3a,0x02,0x02,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, - 0x00,0x5c,0x62,0x42,0x40,0x40,0x40,0x40, - 0x40,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42, - 0x40,0x30,0x0c,0x02,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x10,0x10,0x7c,0x10,0x10,0x10,0x10, - 0x10,0x10,0x0c,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, - 0x42,0x42,0x42,0x42,0x42,0x42,0x46,0x3a, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42, - 0x24,0x24,0x24,0x18,0x18,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x00,0x41,0x49,0x49,0x49,0x49,0x49, - 0x49,0x36,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x42, - 0x42,0x24,0x18,0x18,0x24,0x42,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42, - 0x42,0x26,0x1a,0x02,0x02,0x3c,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, - 0x00,0x7e,0x02,0x04,0x08,0x10,0x20,0x40, - 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x0c,0x10,0x10,0x08,0x08, - 0x10,0x10,0x08,0x08,0x10,0x10,0x0c,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x30,0x08,0x08, - 0x10,0x10,0x08,0x08,0x10,0x10,0x08,0x08, - 0x30,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x31,0x49,0x46,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x08,0x08,0x00, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x00,0x00,0x08,0x08,0x3e,0x49,0x48,0x48, - 0x49,0x3e,0x08,0x08,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x0e, - 0x10,0x10,0x10,0x7c,0x10,0x10,0x10,0x3e, - 0x61,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x3c, - 0x24,0x24,0x3c,0x24,0x42,0x00,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x41,0x22,0x14,0x08,0x7f,0x08,0x7f, - 0x08,0x08,0x08,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x08,0x08, - 0x08,0x08,0x00,0x00,0x08,0x08,0x08,0x08, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x3c,0x42,0x40,0x3c,0x42, - 0x42,0x3c,0x02,0x42,0x3c,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x24,0x24,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x3c,0x42,0x99, - 0xa5,0xa1,0xa1,0xa5,0x99,0x42,0x3c,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x1c,0x02,0x1e,0x22,0x1e,0x00,0x3e,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, - 0x12,0x12,0x24,0x24,0x48,0x24,0x24,0x12, - 0x12,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x7e,0x02,0x02,0x02,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00, - 0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x3c,0x42, - 0xb9,0xa5,0xa5,0xb9,0xa9,0xa5,0x42,0x3c, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x10,0x28,0x28,0x10, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x08,0x08,0x08, - 0x7f,0x08,0x08,0x08,0x00,0x7f,0x00,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x1c,0x22,0x02,0x1c,0x20,0x20,0x3e,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x1c,0x22,0x02, - 0x1c,0x02,0x22,0x1c,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x0c,0x30,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x22,0x22,0x22, - 0x22,0x36,0x2a,0x20,0x20,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x3e,0x7a,0x7a, - 0x7a,0x7a,0x3a,0x0a,0x0a,0x0a,0x0a,0x0a, - 0x0e,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18, - 0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x08,0x30,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x08,0x18,0x28,0x08,0x08, - 0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x1c,0x22,0x22,0x22,0x1c,0x00,0x3e,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, - 0x48,0x48,0x24,0x24,0x12,0x24,0x24,0x48, - 0x48,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x00,0x00,0x22,0x62,0x24,0x28, - 0x28,0x12,0x16,0x2a,0x4e,0x42,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x22,0x62,0x24,0x28,0x28,0x14,0x1a, - 0x22,0x44,0x4e,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x62,0x12, - 0x24,0x18,0x68,0x12,0x16,0x2a,0x4e,0x42, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x08,0x08,0x00,0x08,0x08, - 0x30,0x42,0x42,0x42,0x3c,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x30,0x0c,0x00,0x00, - 0x18,0x24,0x24,0x42,0x42,0x7e,0x42,0x42, - 0x42,0x42,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x0c,0x30,0x00,0x00,0x18,0x24,0x24, - 0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x18,0x24, - 0x00,0x00,0x18,0x24,0x24,0x42,0x42,0x7e, - 0x42,0x42,0x42,0x42,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x32,0x4c,0x00,0x00,0x18, - 0x24,0x24,0x42,0x42,0x7e,0x42,0x42,0x42, - 0x42,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x24,0x24,0x00,0x00,0x18,0x24,0x24,0x42, - 0x42,0x7e,0x42,0x42,0x42,0x42,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x18,0x24,0x18, - 0x00,0x18,0x24,0x24,0x42,0x42,0x7e,0x42, - 0x42,0x42,0x42,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x1f,0x28, - 0x48,0x48,0x7f,0x48,0x48,0x48,0x48,0x4f, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x3c,0x42,0x42,0x40,0x40, - 0x40,0x40,0x42,0x42,0x3c,0x08,0x30,0x08, - 0x08,0x10,0x00,0xfe,0x30,0x0c,0x00,0x00, - 0x7e,0x40,0x40,0x40,0x7c,0x40,0x40,0x40, - 0x40,0x7e,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x0c,0x30,0x00,0x00,0x7e,0x40,0x40, - 0x40,0x7c,0x40,0x40,0x40,0x40,0x7e,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x18,0x24, - 0x00,0x00,0x7e,0x40,0x40,0x40,0x7c,0x40, - 0x40,0x40,0x40,0x7e,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x24,0x24,0x00,0x00,0x7e, - 0x40,0x40,0x40,0x7c,0x40,0x40,0x40,0x40, - 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x18,0x06,0x00,0x00,0x3e,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x08,0x3e,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x0c,0x30,0x00, - 0x00,0x3e,0x08,0x08,0x08,0x08,0x08,0x08, - 0x08,0x08,0x3e,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x18,0x24,0x00,0x00,0x3e,0x08, - 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3e, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x24, - 0x24,0x00,0x00,0x3e,0x08,0x08,0x08,0x08, - 0x08,0x08,0x08,0x08,0x3e,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x78,0x44,0x42,0x42,0xf2,0x42,0x42,0x42, - 0x44,0x78,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x32,0x4c,0x00,0x00,0x42,0x62,0x62, - 0x52,0x52,0x4a,0x4a,0x46,0x46,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x30,0x0c, - 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x3c,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x0c,0x30,0x00,0x00,0x3c, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x18,0x24,0x00,0x00,0x3c,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x32,0x4c,0x00, - 0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x3c,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x24,0x24,0x00,0x00,0x3c,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x24, - 0x18,0x24,0x42,0x00,0x00,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x02, - 0x3a,0x44,0x46,0x4a,0x4a,0x52,0x52,0x62, - 0x22,0x5c,0x40,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x30,0x0c,0x00,0x00,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x0c,0x30, - 0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x3c,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x18,0x24,0x00,0x00,0x42, - 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, - 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x24,0x24,0x00,0x00,0x42,0x42,0x42,0x42, - 0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x0c,0x30,0x00, - 0x00,0x41,0x41,0x22,0x22,0x14,0x08,0x08, - 0x08,0x08,0x08,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x40,0x40,0x78, - 0x44,0x42,0x42,0x44,0x78,0x40,0x40,0x40, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x7c, - 0x42,0x42,0x42,0x62,0x5c,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x30,0x0c, - 0x00,0x00,0x3c,0x42,0x02,0x3e,0x42,0x42, - 0x46,0x3a,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x0c,0x30,0x00,0x00,0x3c, - 0x42,0x02,0x3e,0x42,0x42,0x46,0x3a,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x18,0x24,0x00,0x00,0x3c,0x42,0x02,0x3e, - 0x42,0x42,0x46,0x3a,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x32,0x4c,0x00, - 0x00,0x3c,0x42,0x02,0x3e,0x42,0x42,0x46, - 0x3a,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x24,0x24,0x00,0x00,0x3c,0x42, - 0x02,0x3e,0x42,0x42,0x46,0x3a,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x18,0x24, - 0x18,0x00,0x00,0x3c,0x42,0x02,0x3e,0x42, - 0x42,0x46,0x3a,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, - 0x3e,0x49,0x09,0x3f,0x48,0x48,0x49,0x3e, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40, - 0x40,0x40,0x40,0x42,0x3c,0x08,0x30,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x30,0x0c, - 0x00,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40, - 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x0c,0x30,0x00,0x00,0x3c, - 0x42,0x42,0x7e,0x40,0x40,0x42,0x3c,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x18,0x24,0x00,0x00,0x3c,0x42,0x42,0x7e, - 0x40,0x40,0x42,0x3c,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x24,0x24,0x00, - 0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x42, - 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x30,0x0c,0x00,0x00,0x18,0x08, - 0x08,0x08,0x08,0x08,0x08,0x3e,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x0c, - 0x30,0x00,0x00,0x18,0x08,0x08,0x08,0x08, - 0x08,0x08,0x3e,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x18,0x24,0x00,0x00, - 0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x3e, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x24,0x24,0x00,0x00,0x18,0x08,0x08, - 0x08,0x08,0x08,0x08,0x3e,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x32,0x0c, - 0x14,0x22,0x02,0x3e,0x42,0x42,0x42,0x42, - 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x32,0x4c,0x00,0x00,0x5c, - 0x62,0x42,0x42,0x42,0x42,0x42,0x42,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x30,0x0c,0x00,0x00,0x3c,0x42,0x42,0x42, - 0x42,0x42,0x42,0x3c,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x0c,0x30,0x00, - 0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42, - 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x18,0x24,0x00,0x00,0x3c,0x42, - 0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x32, - 0x4c,0x00,0x00,0x3c,0x42,0x42,0x42,0x42, - 0x42,0x42,0x3c,0x00,0x00,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x24,0x24,0x00,0x00, - 0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, - 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00, - 0x7e,0x00,0x00,0x18,0x00,0x00,0x00,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x00,0x02,0x3c,0x46,0x4a,0x4a,0x52,0x52, - 0x62,0x3c,0x40,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x30,0x0c,0x00,0x00,0x42, - 0x42,0x42,0x42,0x42,0x42,0x46,0x3a,0x00, - 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, - 0x0c,0x30,0x00,0x00,0x42,0x42,0x42,0x42, - 0x42,0x42,0x46,0x3a,0x00,0x00,0x08,0x08, - 0x10,0x00,0xfe,0x00,0x00,0x18,0x24,0x00, - 0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x46, - 0x3a,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, - 0x00,0x00,0x24,0x24,0x00,0x00,0x42,0x42, - 0x42,0x42,0x42,0x42,0x46,0x3a,0x00,0x00, - 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x0c, - 0x30,0x00,0x00,0x42,0x42,0x42,0x42,0x42, - 0x26,0x1a,0x02,0x02,0x3c,0x08,0x08,0x10, - 0x00,0xfe,0x00,0x00,0x00,0x00,0x20,0x20, - 0x3c,0x22,0x22,0x22,0x24,0x28,0x30,0x20, - 0x20,0x20,0x08,0x08,0x10,0x00,0xfe,0x00, - 0x00,0x24,0x24,0x00,0x00,0x42,0x42,0x42, - 0x42,0x42,0x26,0x1a,0x02,0x02,0x3c,0x08, - 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, - 0x6e,0x90,0x90,0x90,0x9c,0x90,0x90,0x90, - 0x90,0x6e,0x00,0x00,0x08,0x08,0x10,0x00, - 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x6c, - 0x92,0x92,0x9e,0x90,0x90,0x92,0x6c,0x00, - 0x00}; - -unsigned char * SF_defaultfont = &(myfont[0]); -int SF_defaultfontsize = sizeof(myfont); - +static unsigned char myfont[] = { + 0x00,0x00,0x00,0x00,0x20,0x00,0x53,0x01, + 0x20,0x00,0x0e,0x02,0xdc,0x04,0x00,0x00, + 0xf1,0x04,0x00,0x00,0x06,0x05,0x00,0x00, + 0x1b,0x05,0x00,0x00,0x30,0x05,0x00,0x00, + 0x45,0x05,0x00,0x00,0x5a,0x05,0x00,0x00, + 0x6f,0x05,0x00,0x00,0x84,0x05,0x00,0x00, + 0x99,0x05,0x00,0x00,0xae,0x05,0x00,0x00, + 0xc3,0x05,0x00,0x00,0xd8,0x05,0x00,0x00, + 0xed,0x05,0x00,0x00,0x02,0x06,0x00,0x00, + 0x17,0x06,0x00,0x00,0x2c,0x06,0x00,0x00, + 0x41,0x06,0x00,0x00,0x56,0x06,0x00,0x00, + 0x6b,0x06,0x00,0x00,0x80,0x06,0x00,0x00, + 0x95,0x06,0x00,0x00,0xaa,0x06,0x00,0x00, + 0xbf,0x06,0x00,0x00,0xd4,0x06,0x00,0x00, + 0xe9,0x06,0x00,0x00,0xfe,0x06,0x00,0x00, + 0x13,0x07,0x00,0x00,0x28,0x07,0x00,0x00, + 0x3d,0x07,0x00,0x00,0x52,0x07,0x00,0x00, + 0x67,0x07,0x00,0x00,0x7c,0x07,0x00,0x00, + 0x91,0x07,0x00,0x00,0xa6,0x07,0x00,0x00, + 0xbb,0x07,0x00,0x00,0xd0,0x07,0x00,0x00, + 0xe5,0x07,0x00,0x00,0xfa,0x07,0x00,0x00, + 0x0f,0x08,0x00,0x00,0x24,0x08,0x00,0x00, + 0x39,0x08,0x00,0x00,0x4e,0x08,0x00,0x00, + 0x63,0x08,0x00,0x00,0x78,0x08,0x00,0x00, + 0x8d,0x08,0x00,0x00,0xa2,0x08,0x00,0x00, + 0xb7,0x08,0x00,0x00,0xcc,0x08,0x00,0x00, + 0xe1,0x08,0x00,0x00,0xf6,0x08,0x00,0x00, + 0x0b,0x09,0x00,0x00,0x20,0x09,0x00,0x00, + 0x35,0x09,0x00,0x00,0x4a,0x09,0x00,0x00, + 0x5f,0x09,0x00,0x00,0x74,0x09,0x00,0x00, + 0x89,0x09,0x00,0x00,0x9e,0x09,0x00,0x00, + 0xb3,0x09,0x00,0x00,0xc8,0x09,0x00,0x00, + 0xdd,0x09,0x00,0x00,0xf2,0x09,0x00,0x00, + 0x07,0x0a,0x00,0x00,0x1c,0x0a,0x00,0x00, + 0x31,0x0a,0x00,0x00,0x46,0x0a,0x00,0x00, + 0x5b,0x0a,0x00,0x00,0x70,0x0a,0x00,0x00, + 0x85,0x0a,0x00,0x00,0x9a,0x0a,0x00,0x00, + 0xaf,0x0a,0x00,0x00,0xc4,0x0a,0x00,0x00, + 0xd9,0x0a,0x00,0x00,0xee,0x0a,0x00,0x00, + 0x03,0x0b,0x00,0x00,0x18,0x0b,0x00,0x00, + 0x2d,0x0b,0x00,0x00,0x42,0x0b,0x00,0x00, + 0x57,0x0b,0x00,0x00,0x6c,0x0b,0x00,0x00, + 0x81,0x0b,0x00,0x00,0x96,0x0b,0x00,0x00, + 0xab,0x0b,0x00,0x00,0xc0,0x0b,0x00,0x00, + 0xd5,0x0b,0x00,0x00,0xea,0x0b,0x00,0x00, + 0xff,0x0b,0x00,0x00,0x14,0x0c,0x00,0x00, + 0x29,0x0c,0x00,0x00,0x3e,0x0c,0x00,0x00, + 0x53,0x0c,0x00,0x00,0x68,0x0c,0x00,0x00, + 0x7d,0x0c,0x00,0x00,0x92,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xa7,0x0c,0x00,0x00, + 0xbc,0x0c,0x00,0x00,0xd1,0x0c,0x00,0x00, + 0xe6,0x0c,0x00,0x00,0xfb,0x0c,0x00,0x00, + 0x10,0x0d,0x00,0x00,0x25,0x0d,0x00,0x00, + 0x3a,0x0d,0x00,0x00,0x4f,0x0d,0x00,0x00, + 0x64,0x0d,0x00,0x00,0x79,0x0d,0x00,0x00, + 0x8e,0x0d,0x00,0x00,0xa3,0x0d,0x00,0x00, + 0xb8,0x0d,0x00,0x00,0xcd,0x0d,0x00,0x00, + 0xe2,0x0d,0x00,0x00,0xf7,0x0d,0x00,0x00, + 0x0c,0x0e,0x00,0x00,0x21,0x0e,0x00,0x00, + 0x36,0x0e,0x00,0x00,0x4b,0x0e,0x00,0x00, + 0x60,0x0e,0x00,0x00,0x75,0x0e,0x00,0x00, + 0x8a,0x0e,0x00,0x00,0x9f,0x0e,0x00,0x00, + 0xb4,0x0e,0x00,0x00,0xc9,0x0e,0x00,0x00, + 0xde,0x0e,0x00,0x00,0xf3,0x0e,0x00,0x00, + 0x08,0x0f,0x00,0x00,0x1d,0x0f,0x00,0x00, + 0x32,0x0f,0x00,0x00,0x47,0x0f,0x00,0x00, + 0x5c,0x0f,0x00,0x00,0x71,0x0f,0x00,0x00, + 0x86,0x0f,0x00,0x00,0x9b,0x0f,0x00,0x00, + 0xb0,0x0f,0x00,0x00,0xc5,0x0f,0x00,0x00, + 0xda,0x0f,0x00,0x00,0xef,0x0f,0x00,0x00, + 0x04,0x10,0x00,0x00,0x19,0x10,0x00,0x00, + 0x2e,0x10,0x00,0x00,0x43,0x10,0x00,0x00, + 0x58,0x10,0x00,0x00,0x6d,0x10,0x00,0x00, + 0x82,0x10,0x00,0x00,0x97,0x10,0x00,0x00, + 0xac,0x10,0x00,0x00,0xc1,0x10,0x00,0x00, + 0xd6,0x10,0x00,0x00,0xeb,0x10,0x00,0x00, + 0x00,0x11,0x00,0x00,0x15,0x11,0x00,0x00, + 0x2a,0x11,0x00,0x00,0x3f,0x11,0x00,0x00, + 0x54,0x11,0x00,0x00,0x69,0x11,0x00,0x00, + 0x7e,0x11,0x00,0x00,0x93,0x11,0x00,0x00, + 0xa8,0x11,0x00,0x00,0xbd,0x11,0x00,0x00, + 0xd2,0x11,0x00,0x00,0xe7,0x11,0x00,0x00, + 0xfc,0x11,0x00,0x00,0x11,0x12,0x00,0x00, + 0x26,0x12,0x00,0x00,0x3b,0x12,0x00,0x00, + 0x50,0x12,0x00,0x00,0x65,0x12,0x00,0x00, + 0x7a,0x12,0x00,0x00,0x8f,0x12,0x00,0x00, + 0xa4,0x12,0x00,0x00,0xb9,0x12,0x00,0x00, + 0xce,0x12,0x00,0x00,0xe3,0x12,0x00,0x00, + 0xf8,0x12,0x00,0x00,0x0d,0x13,0x00,0x00, + 0x22,0x13,0x00,0x00,0x37,0x13,0x00,0x00, + 0x4c,0x13,0x00,0x00,0x61,0x13,0x00,0x00, + 0x76,0x13,0x00,0x00,0x8b,0x13,0x00,0x00, + 0xa0,0x13,0x00,0x00,0xb5,0x13,0x00,0x00, + 0xca,0x13,0x00,0x00,0xdf,0x13,0x00,0x00, + 0xf4,0x13,0x00,0x00,0x09,0x14,0x00,0x00, + 0x1e,0x14,0x00,0x00,0x33,0x14,0x00,0x00, + 0x48,0x14,0x00,0x00,0x5d,0x14,0x00,0x00, + 0x72,0x14,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x87,0x14,0x00,0x00, + 0x9c,0x14,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x08, + 0x08,0x00,0x08,0x08,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x22,0x22,0x22, + 0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x12,0x12,0x12,0x7e, + 0x24,0x24,0x7e,0x48,0x48,0x48,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x08,0x3e,0x49,0x48,0x38,0x0e,0x09, + 0x49,0x3e,0x08,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x31,0x4a, + 0x4a,0x34,0x08,0x08,0x16,0x29,0x29,0x46, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x1c,0x22,0x22,0x22,0x1c, + 0x39,0x45,0x42,0x46,0x39,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x08,0x08, + 0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x04,0x08,0x08,0x10, + 0x10,0x10,0x10,0x10,0x10,0x08,0x08,0x04, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x20,0x10,0x10,0x08,0x08,0x08,0x08, + 0x08,0x08,0x10,0x10,0x20,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, + 0x00,0x08,0x49,0x2a,0x1c,0x2a,0x49,0x08, + 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, + 0x08,0x7f,0x08,0x08,0x08,0x00,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x18,0x08,0x08,0x10,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x02,0x02,0x04,0x08,0x08,0x10,0x10,0x20, + 0x40,0x40,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x18,0x24,0x42, + 0x42,0x42,0x42,0x42,0x42,0x24,0x18,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x08,0x18,0x28,0x08,0x08,0x08, + 0x08,0x08,0x08,0x3e,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x3c, + 0x42,0x42,0x02,0x0c,0x10,0x20,0x40,0x40, + 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x02, + 0x1c,0x02,0x02,0x42,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x04,0x0c,0x14,0x24,0x44,0x44,0x7e, + 0x04,0x04,0x04,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x7e,0x40, + 0x40,0x40,0x7c,0x02,0x02,0x02,0x42,0x3c, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x1c,0x20,0x40,0x40,0x7c, + 0x42,0x42,0x42,0x42,0x3c,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x7e,0x02,0x02,0x04,0x04,0x04,0x08,0x08, + 0x08,0x08,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x3c,0x42,0x42, + 0x42,0x3c,0x42,0x42,0x42,0x42,0x3c,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x3c,0x42,0x42,0x42,0x3e,0x02, + 0x02,0x02,0x04,0x38,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, + 0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18, + 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18, + 0x00,0x00,0x00,0x18,0x08,0x08,0x10,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x10, + 0x08,0x04,0x02,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x7e,0x00,0x00,0x00,0x7e,0x00,0x00, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x40,0x20,0x10,0x08, + 0x04,0x08,0x10,0x20,0x40,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x3c,0x42,0x42,0x02,0x04,0x08,0x08,0x00, + 0x08,0x08,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x1c,0x22,0x4a, + 0x56,0x52,0x52,0x52,0x4e,0x20,0x1e,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x18,0x24,0x24,0x42,0x42,0x7e, + 0x42,0x42,0x42,0x42,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x7c, + 0x42,0x42,0x42,0x7c,0x42,0x42,0x42,0x42, + 0x7c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40, + 0x40,0x40,0x40,0x42,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x78,0x44,0x42,0x42,0x42,0x42,0x42, + 0x42,0x44,0x78,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x7e,0x40, + 0x40,0x40,0x7c,0x40,0x40,0x40,0x40,0x7e, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x7e,0x40,0x40,0x40,0x7c, + 0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x3c,0x42,0x42,0x40,0x40,0x4e,0x42,0x42, + 0x46,0x3a,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x42,0x42,0x42, + 0x42,0x7e,0x42,0x42,0x42,0x42,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x3e,0x08,0x08,0x08,0x08,0x08, + 0x08,0x08,0x08,0x3e,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x1f, + 0x04,0x04,0x04,0x04,0x04,0x04,0x44,0x44, + 0x38,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x42,0x44,0x48,0x50, + 0x60,0x60,0x50,0x48,0x44,0x42,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x40,0x40,0x7e,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x42,0x42, + 0x66,0x66,0x5a,0x5a,0x42,0x42,0x42,0x42, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x42,0x62,0x62,0x52,0x52, + 0x4a,0x4a,0x46,0x46,0x42,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x42, + 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x7c,0x42,0x42, + 0x42,0x7c,0x40,0x40,0x40,0x40,0x40,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42, + 0x42,0x5a,0x66,0x3c,0x03,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x7c, + 0x42,0x42,0x42,0x7c,0x48,0x44,0x44,0x42, + 0x42,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x3c,0x42,0x42,0x40, + 0x30,0x0c,0x02,0x42,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x7f,0x08,0x08,0x08,0x08,0x08,0x08, + 0x08,0x08,0x08,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x42,0x42, + 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x41,0x41,0x41,0x22,0x22, + 0x22,0x14,0x14,0x08,0x08,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x42,0x42,0x42,0x42,0x5a,0x5a,0x66,0x66, + 0x42,0x42,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x42,0x42,0x24, + 0x24,0x18,0x18,0x24,0x24,0x42,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x41,0x41,0x22,0x22,0x14,0x08, + 0x08,0x08,0x08,0x08,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x7e, + 0x02,0x02,0x04,0x08,0x10,0x20,0x40,0x40, + 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x0e,0x08,0x08,0x08,0x08, + 0x08,0x08,0x08,0x08,0x08,0x08,0x0e,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x40,0x40,0x20,0x10,0x10,0x08,0x08, + 0x04,0x02,0x02,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x70,0x10,0x10, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x70,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x18,0x24,0x42,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x7f,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x18,0x10,0x10,0x08,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x00,0x00,0x3c,0x42,0x02,0x3e, + 0x42,0x42,0x46,0x3a,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x40,0x40, + 0x40,0x5c,0x62,0x42,0x42,0x42,0x42,0x62, + 0x5c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42, + 0x40,0x40,0x40,0x40,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x02,0x02,0x02,0x3a,0x46,0x42,0x42,0x42, + 0x42,0x46,0x3a,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3c,0x42,0x42,0x7e,0x40,0x40,0x42,0x3c, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x0c,0x10,0x10,0x10,0x7c,0x10, + 0x10,0x10,0x10,0x10,0x10,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x02,0x3a,0x44,0x44,0x44,0x38,0x20, + 0x3c,0x42,0x42,0x3c,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x40,0x40,0x40,0x5c, + 0x62,0x42,0x42,0x42,0x42,0x42,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x08,0x08,0x00,0x18,0x08,0x08,0x08, + 0x08,0x08,0x08,0x3e,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x04,0x04, + 0x00,0x0c,0x04,0x04,0x04,0x04,0x04,0x04, + 0x04,0x48,0x30,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x40,0x40,0x44,0x48, + 0x50,0x60,0x50,0x48,0x44,0x42,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x18,0x08,0x08,0x08,0x08,0x08,0x08, + 0x08,0x08,0x3e,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, + 0x76,0x49,0x49,0x49,0x49,0x49,0x49,0x49, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x5c,0x62,0x42, + 0x42,0x42,0x42,0x42,0x42,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42, + 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x5c, + 0x62,0x42,0x42,0x42,0x42,0x62,0x5c,0x40, + 0x40,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x00,0x00,0x3a,0x46,0x42,0x42, + 0x42,0x42,0x46,0x3a,0x02,0x02,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, + 0x00,0x5c,0x62,0x42,0x40,0x40,0x40,0x40, + 0x40,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x42, + 0x40,0x30,0x0c,0x02,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x10,0x10,0x7c,0x10,0x10,0x10,0x10, + 0x10,0x10,0x0c,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, + 0x42,0x42,0x42,0x42,0x42,0x42,0x46,0x3a, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x42,0x42,0x42, + 0x24,0x24,0x24,0x18,0x18,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x00,0x41,0x49,0x49,0x49,0x49,0x49, + 0x49,0x36,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x42, + 0x42,0x24,0x18,0x18,0x24,0x42,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x00,0x00,0x42,0x42,0x42,0x42, + 0x42,0x26,0x1a,0x02,0x02,0x3c,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, + 0x00,0x7e,0x02,0x04,0x08,0x10,0x20,0x40, + 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x0c,0x10,0x10,0x08,0x08, + 0x10,0x10,0x08,0x08,0x10,0x10,0x0c,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08, + 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x30,0x08,0x08, + 0x10,0x10,0x08,0x08,0x10,0x10,0x08,0x08, + 0x30,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x31,0x49,0x46,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x08,0x08,0x00, + 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x00,0x00,0x08,0x08,0x3e,0x49,0x48,0x48, + 0x49,0x3e,0x08,0x08,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x0e, + 0x10,0x10,0x10,0x7c,0x10,0x10,0x10,0x3e, + 0x61,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x00,0x42,0x24,0x3c, + 0x24,0x24,0x3c,0x24,0x42,0x00,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x41,0x22,0x14,0x08,0x7f,0x08,0x7f, + 0x08,0x08,0x08,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x08,0x08, + 0x08,0x08,0x00,0x00,0x08,0x08,0x08,0x08, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x3c,0x42,0x40,0x3c,0x42, + 0x42,0x3c,0x02,0x42,0x3c,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x24,0x24,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x3c,0x42,0x99, + 0xa5,0xa1,0xa1,0xa5,0x99,0x42,0x3c,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x1c,0x02,0x1e,0x22,0x1e,0x00,0x3e,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, + 0x12,0x12,0x24,0x24,0x48,0x24,0x24,0x12, + 0x12,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x7e,0x02,0x02,0x02,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00, + 0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x3c,0x42, + 0xb9,0xa5,0xa5,0xb9,0xa9,0xa5,0x42,0x3c, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x10,0x28,0x28,0x10, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x08,0x08,0x08, + 0x7f,0x08,0x08,0x08,0x00,0x7f,0x00,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x1c,0x22,0x02,0x1c,0x20,0x20,0x3e,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x1c,0x22,0x02, + 0x1c,0x02,0x22,0x1c,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x0c,0x30,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x22,0x22,0x22, + 0x22,0x36,0x2a,0x20,0x20,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x3e,0x7a,0x7a, + 0x7a,0x7a,0x3a,0x0a,0x0a,0x0a,0x0a,0x0a, + 0x0e,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18, + 0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x08,0x30,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x08,0x18,0x28,0x08,0x08, + 0x08,0x08,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x1c,0x22,0x22,0x22,0x1c,0x00,0x3e,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, + 0x48,0x48,0x24,0x24,0x12,0x24,0x24,0x48, + 0x48,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x00,0x00,0x22,0x62,0x24,0x28, + 0x28,0x12,0x16,0x2a,0x4e,0x42,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x22,0x62,0x24,0x28,0x28,0x14,0x1a, + 0x22,0x44,0x4e,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x62,0x12, + 0x24,0x18,0x68,0x12,0x16,0x2a,0x4e,0x42, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x08,0x08,0x00,0x08,0x08, + 0x30,0x42,0x42,0x42,0x3c,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x30,0x0c,0x00,0x00, + 0x18,0x24,0x24,0x42,0x42,0x7e,0x42,0x42, + 0x42,0x42,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x0c,0x30,0x00,0x00,0x18,0x24,0x24, + 0x42,0x42,0x7e,0x42,0x42,0x42,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x18,0x24, + 0x00,0x00,0x18,0x24,0x24,0x42,0x42,0x7e, + 0x42,0x42,0x42,0x42,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x32,0x4c,0x00,0x00,0x18, + 0x24,0x24,0x42,0x42,0x7e,0x42,0x42,0x42, + 0x42,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x24,0x24,0x00,0x00,0x18,0x24,0x24,0x42, + 0x42,0x7e,0x42,0x42,0x42,0x42,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x18,0x24,0x18, + 0x00,0x18,0x24,0x24,0x42,0x42,0x7e,0x42, + 0x42,0x42,0x42,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x1f,0x28, + 0x48,0x48,0x7f,0x48,0x48,0x48,0x48,0x4f, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x3c,0x42,0x42,0x40,0x40, + 0x40,0x40,0x42,0x42,0x3c,0x08,0x30,0x08, + 0x08,0x10,0x00,0xfe,0x30,0x0c,0x00,0x00, + 0x7e,0x40,0x40,0x40,0x7c,0x40,0x40,0x40, + 0x40,0x7e,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x0c,0x30,0x00,0x00,0x7e,0x40,0x40, + 0x40,0x7c,0x40,0x40,0x40,0x40,0x7e,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x18,0x24, + 0x00,0x00,0x7e,0x40,0x40,0x40,0x7c,0x40, + 0x40,0x40,0x40,0x7e,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x24,0x24,0x00,0x00,0x7e, + 0x40,0x40,0x40,0x7c,0x40,0x40,0x40,0x40, + 0x7e,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x18,0x06,0x00,0x00,0x3e,0x08,0x08,0x08, + 0x08,0x08,0x08,0x08,0x08,0x3e,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x0c,0x30,0x00, + 0x00,0x3e,0x08,0x08,0x08,0x08,0x08,0x08, + 0x08,0x08,0x3e,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x18,0x24,0x00,0x00,0x3e,0x08, + 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x3e, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x24, + 0x24,0x00,0x00,0x3e,0x08,0x08,0x08,0x08, + 0x08,0x08,0x08,0x08,0x3e,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x78,0x44,0x42,0x42,0xf2,0x42,0x42,0x42, + 0x44,0x78,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x32,0x4c,0x00,0x00,0x42,0x62,0x62, + 0x52,0x52,0x4a,0x4a,0x46,0x46,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x30,0x0c, + 0x00,0x00,0x3c,0x42,0x42,0x42,0x42,0x42, + 0x42,0x42,0x42,0x3c,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x0c,0x30,0x00,0x00,0x3c, + 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, + 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x18,0x24,0x00,0x00,0x3c,0x42,0x42,0x42, + 0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x32,0x4c,0x00, + 0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42, + 0x42,0x42,0x3c,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x24,0x24,0x00,0x00,0x3c,0x42, + 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x24, + 0x18,0x24,0x42,0x00,0x00,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x02, + 0x3a,0x44,0x46,0x4a,0x4a,0x52,0x52,0x62, + 0x22,0x5c,0x40,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x30,0x0c,0x00,0x00,0x42,0x42,0x42, + 0x42,0x42,0x42,0x42,0x42,0x42,0x3c,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x0c,0x30, + 0x00,0x00,0x42,0x42,0x42,0x42,0x42,0x42, + 0x42,0x42,0x42,0x3c,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x18,0x24,0x00,0x00,0x42, + 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, + 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x24,0x24,0x00,0x00,0x42,0x42,0x42,0x42, + 0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x0c,0x30,0x00, + 0x00,0x41,0x41,0x22,0x22,0x14,0x08,0x08, + 0x08,0x08,0x08,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x40,0x40,0x78, + 0x44,0x42,0x42,0x44,0x78,0x40,0x40,0x40, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x38,0x44,0x44,0x44,0x7c, + 0x42,0x42,0x42,0x62,0x5c,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x30,0x0c, + 0x00,0x00,0x3c,0x42,0x02,0x3e,0x42,0x42, + 0x46,0x3a,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x0c,0x30,0x00,0x00,0x3c, + 0x42,0x02,0x3e,0x42,0x42,0x46,0x3a,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x18,0x24,0x00,0x00,0x3c,0x42,0x02,0x3e, + 0x42,0x42,0x46,0x3a,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x32,0x4c,0x00, + 0x00,0x3c,0x42,0x02,0x3e,0x42,0x42,0x46, + 0x3a,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x24,0x24,0x00,0x00,0x3c,0x42, + 0x02,0x3e,0x42,0x42,0x46,0x3a,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x18,0x24, + 0x18,0x00,0x00,0x3c,0x42,0x02,0x3e,0x42, + 0x42,0x46,0x3a,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3e,0x49,0x09,0x3f,0x48,0x48,0x49,0x3e, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x3c,0x42,0x40, + 0x40,0x40,0x40,0x42,0x3c,0x08,0x30,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x30,0x0c, + 0x00,0x00,0x3c,0x42,0x42,0x7e,0x40,0x40, + 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x0c,0x30,0x00,0x00,0x3c, + 0x42,0x42,0x7e,0x40,0x40,0x42,0x3c,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x18,0x24,0x00,0x00,0x3c,0x42,0x42,0x7e, + 0x40,0x40,0x42,0x3c,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x24,0x24,0x00, + 0x00,0x3c,0x42,0x42,0x7e,0x40,0x40,0x42, + 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x30,0x0c,0x00,0x00,0x18,0x08, + 0x08,0x08,0x08,0x08,0x08,0x3e,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x0c, + 0x30,0x00,0x00,0x18,0x08,0x08,0x08,0x08, + 0x08,0x08,0x3e,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x18,0x24,0x00,0x00, + 0x18,0x08,0x08,0x08,0x08,0x08,0x08,0x3e, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x24,0x24,0x00,0x00,0x18,0x08,0x08, + 0x08,0x08,0x08,0x08,0x3e,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x32,0x0c, + 0x14,0x22,0x02,0x3e,0x42,0x42,0x42,0x42, + 0x42,0x3c,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x32,0x4c,0x00,0x00,0x5c, + 0x62,0x42,0x42,0x42,0x42,0x42,0x42,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x30,0x0c,0x00,0x00,0x3c,0x42,0x42,0x42, + 0x42,0x42,0x42,0x3c,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x0c,0x30,0x00, + 0x00,0x3c,0x42,0x42,0x42,0x42,0x42,0x42, + 0x3c,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x18,0x24,0x00,0x00,0x3c,0x42, + 0x42,0x42,0x42,0x42,0x42,0x3c,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x32, + 0x4c,0x00,0x00,0x3c,0x42,0x42,0x42,0x42, + 0x42,0x42,0x3c,0x00,0x00,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x24,0x24,0x00,0x00, + 0x3c,0x42,0x42,0x42,0x42,0x42,0x42,0x3c, + 0x00,0x00,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00, + 0x7e,0x00,0x00,0x18,0x00,0x00,0x00,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x00,0x02,0x3c,0x46,0x4a,0x4a,0x52,0x52, + 0x62,0x3c,0x40,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x30,0x0c,0x00,0x00,0x42, + 0x42,0x42,0x42,0x42,0x42,0x46,0x3a,0x00, + 0x00,0x08,0x08,0x10,0x00,0xfe,0x00,0x00, + 0x0c,0x30,0x00,0x00,0x42,0x42,0x42,0x42, + 0x42,0x42,0x46,0x3a,0x00,0x00,0x08,0x08, + 0x10,0x00,0xfe,0x00,0x00,0x18,0x24,0x00, + 0x00,0x42,0x42,0x42,0x42,0x42,0x42,0x46, + 0x3a,0x00,0x00,0x08,0x08,0x10,0x00,0xfe, + 0x00,0x00,0x24,0x24,0x00,0x00,0x42,0x42, + 0x42,0x42,0x42,0x42,0x46,0x3a,0x00,0x00, + 0x08,0x08,0x10,0x00,0xfe,0x00,0x00,0x0c, + 0x30,0x00,0x00,0x42,0x42,0x42,0x42,0x42, + 0x26,0x1a,0x02,0x02,0x3c,0x08,0x08,0x10, + 0x00,0xfe,0x00,0x00,0x00,0x00,0x20,0x20, + 0x3c,0x22,0x22,0x22,0x24,0x28,0x30,0x20, + 0x20,0x20,0x08,0x08,0x10,0x00,0xfe,0x00, + 0x00,0x24,0x24,0x00,0x00,0x42,0x42,0x42, + 0x42,0x42,0x26,0x1a,0x02,0x02,0x3c,0x08, + 0x08,0x10,0x00,0xfe,0x00,0x00,0x00,0x00, + 0x6e,0x90,0x90,0x90,0x9c,0x90,0x90,0x90, + 0x90,0x6e,0x00,0x00,0x08,0x08,0x10,0x00, + 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x6c, + 0x92,0x92,0x9e,0x90,0x90,0x92,0x6c,0x00, + 0x00}; + +unsigned char * SF_defaultfont = &(myfont[0]); +int SF_defaultfontsize = sizeof(myfont); + diff --git a/src/sdl/sf_osfdlg.c b/src/sdl/sf_osfdlg.c index 384d9da..dc514c4 100644 --- a/src/sdl/sf_osfdlg.c +++ b/src/sdl/sf_osfdlg.c @@ -1,916 +1,916 @@ -#include -#include -#include - -#include -#include -#include - -#define STATIC static - -#include "sf_frotz.h" - -typedef struct { - void *left, *right; - char *value; - } ENTRY; - - -extern SFONT *sf_VGA_SFONT; - -#define FRAMECOLOR 222275 - -static char buffer[512]; -static char lastdir[FILENAME_MAX] = ""; -static char filename[FILENAME_MAX]; -static char pattern[64]; -static zword pushed = 0; -static int wentry; - -static ulong *sbuffer = NULL; -static int sbpitch; // in longs -static int ewidth, eheight; -static int X,Y,W,H, xdlg,ydlg,wdlg,hdlg; - -#define HTEXT 18 - -STATIC void cleanlist( ENTRY *t); -STATIC void drawlist(); -STATIC ENTRY * dodir( - char *dirname, char *pattern, char *resdir, int size, int *ndirs, int *ntot); -static int Numdirs, Numtot, First; -static ENTRY *curdir = NULL, *selected; - -STATIC void updatelist() - { - if (curdir) cleanlist(curdir); - curdir = dodir(lastdir,pattern,lastdir,FILENAME_MAX,&Numdirs,&Numtot); - First = 0; - selected = NULL; - drawlist(); - } - -STATIC void goright(); -STATIC void goleft(); -// assumes a / at end -STATIC void goup() - { - char *p; - if (strlen(lastdir) < 2) return; - lastdir[strlen(lastdir)-1] = 0; - p = strrchr(lastdir,'/'); - if (p){ p[1] = 0; updatelist();} - else strcat(lastdir,"/"); - } - -typedef struct { - int x,y,w,h; // internal - zword (*click)(int,int); - ulong back; - int isbutton; - } BAREA; - -#define MAXBAREA 20 -static BAREA bareas[MAXBAREA]; -static int nbareas=0; -static SF_textsetting *ts; - -#define BFRAME 2 -#define SPC 5 - -#define WDLG (63*8) -#define HDLG 208 - -#define HCURSOR 8 - -#define O_BLACK 0 -#define O_GRAY1 0x8a8a8a -#define O_GRAY2 0xd6d6d6 -#define O_GRAY3 0xe2e2e2 -#define O_WHITE 0xf5f5f5 - -STATIC void frame_upframe( int x, int y, int w, int h){ - ulong v = O_WHITE; - sf_chline(x,y,v,w); - sf_cvline(x,y,v,--h); - v = O_BLACK; - sf_chline(x,y+h,v,w--); - sf_cvline(x+w--,y,v,h--); - x++; y++; - v = O_GRAY3; - sf_chline(x,y,v,w); - sf_cvline(x,y,v,--h); - v = O_GRAY1; - sf_chline(x,y+h,v,w--); - sf_cvline(x+w,y,v,h); - } - -STATIC void frame_downframe( int x, int y, int w, int h){ - ulong v = O_BLACK; - sf_chline(x,y,v,w); - sf_cvline(x,y,v,--h); - v = O_WHITE; - sf_chline(x,y+h,v,w--); - sf_cvline(x+w--,y,v,h--); - x++; y++; - v = O_GRAY1; - sf_chline(x,y,v,w); - sf_cvline(x,y,v,--h); - v = O_GRAY3; - sf_chline(x,y+h,v,w--); - sf_cvline(x+w,y,v,h); - } - -// internal coords -STATIC int addarea( int x, int y, int w, int h, zword (*click)(int,int)) - { - BAREA *a = bareas+nbareas; - a->x = x; a->y = y; a->w = w; a->h = h; a->click = click; - a->back = O_GRAY2; - return nbareas++; - } - -STATIC void clarea( int n) - { - BAREA *a = bareas+n; - sf_fillrect(a->back,a->x,a->y,a->w,a->h); - } - -STATIC void writetext( ulong color, const char *s, int x, int y, int w, int center) - { - int ox,oy,ow,oh; -//printf("W %p [%s]\n",s,s ? s : "??"); - if (!s) return; - if (!s[0]) return; - sf_getclip(&ox,&oy,&ow,&oh); - sf_setclip(x,y,w,HTEXT); -//printf("1\n"); - if (center) - { - int wt = 8*strlen(s); - x += (w-wt)/2; - } -//printf("2 ts %p\n",ts); fflush(stdout); if (ts < 1000){sf_flushdisplay(); getchar();} - ts->cx = x; - ts->cy = y; - ts->fore = color; -//printf("3\n"); fflush(stdout); - while (*s) sf_writeglyph(ts->font->getglyph(ts->font,(*s++),1)); -//printf("4\n"); - sf_setclip(ox,oy,ow,oh); -//printf("5\n"); - } - -STATIC int addbutton( int x, int y, int w, int h, char *text, zword (*click)(int,int)) - { - int b = addarea(x,y,w,h,click); - bareas[b].isbutton = 1; - frame_upframe(x-2,y-2,w+4,h+4); - clarea(b); - if (text) writetext(0,text,x,y,w,1); - return b; - } - -static int B_up, B_ok, B_cancel; -static int A_dir, A_filter, A_entry, A_list; - -#define BUTTW 60 - -STATIC void showfilename( int pos) - { - BAREA *a = bareas+A_entry; - clarea(A_entry); - writetext(0,filename,a->x,a->y,a->w,0); - if (pos >= 0) - sf_cvline(a->x+8*pos,a->y,O_BLACK,HTEXT); - } - -STATIC void clicked( BAREA *a) - { - frame_downframe(a->x-2,a->y-2,a->w+4,a->h+4); - sf_flushdisplay(); - sf_sleep(100); - frame_upframe(a->x-2,a->y-2,a->w+4,a->h+4); - sf_flushdisplay(); - } - -STATIC zword checkmouse( int i0) - { - int x = mouse_x-1, y = mouse_y-1; - int i; - for (i=i0;i a->x && x < a->x+a->w && y > a->y && y < a->y+a->h) - { - if (a->click) - { - if (a->isbutton) clicked(a); - return a->click(x-a->x,y-a->y); - } - else return 0; - } - } - return 0; - } - -STATIC zword Zup( int x, int y) - { - goup(); - return 0; - } - -STATIC zword Zok( int x, int y) - { - return ZC_RETURN; - } - -STATIC zword Zcanc( int x, int y) - { - return ZC_ESCAPE; - } - -STATIC zword Zselect( int x, int y); -STATIC zword yesnoover( int xc, int yc); -STATIC zword Zentry( int x, int y); - -STATIC zword inputkey() - { - zword c = sf_read_key(0,0,1); - if (c == ZC_SINGLE_CLICK) - { - switch (mouse_button) - { - case 4: c = ZC_ARROW_LEFT; break; - case 5: c = ZC_ARROW_RIGHT; break; - case 1: break; - default: c = 0; break; - } - } -// if (os_read_mouse() != 1) c = 0; - return c; - } - -int (*sf_sysdialog)( bool existing, const char *def, const char *filt, const char *tit, char **res) = NULL; - -STATIC int myosdialog( bool existing, const char *def, const char *filt, const char *tit, char **res, ulong *sbuf, int sbp, int ew, int eh, int isfull) - { - char *pp; ulong *saved; int y0, y1, y2, x1; - zword c = 0; - - // allow system-specific dialog if not fullscreen - if (isfull == 0) if (sf_sysdialog) - return sf_sysdialog(existing,def,filt,tit,res); - - ts = sf_curtextsetting(); - if (!ts) return SF_NOTIMP; - -//printf("0 ts %p (%p)\n",ts,&ts); - - if (!def) def = ""; - strcpy(filename,def); - pp = strrchr(filename,'/'); - if (pp) - { - *pp = 0; - strcpy(lastdir,filename); - strcpy(filename,pp+1); - } - - if (!filt) filt = "*|All files"; - - if (!lastdir[0]) strcpy(lastdir,"./"); - - strcpy(buffer,filt); - pp = strchr(buffer,'|'); if (pp) *pp = 0; - strcpy(pattern,buffer); - - ewidth = ew; - eheight = eh; - sbuffer = sbuf; - sbpitch = sbp; - - wdlg = WDLG; - hdlg = HDLG; - - nbareas = 0; - - W = WDLG+4*BFRAME+2*SPC; - H = HDLG+4*BFRAME+6*SPC+6*BFRAME+3*(HTEXT+2)+HCURSOR+HTEXT; - - if (W > ew) return SF_NOTIMP; - if (H > eh) return SF_NOTIMP; - - X = (ew-W)/2; - Y = (eh-H)/2; - - // internal!! - xdlg = X+SPC+2*BFRAME; - ydlg = Y+2*SPC+4*BFRAME+HTEXT+HTEXT; - - wentry = wdlg - BUTTW - SPC - 2*BFRAME; - - saved = sf_savearea(X,Y,W,H); - if (!saved) return SF_NOTIMP; - -//printf("saved: %p %d %d %d %d\n",saved,saved[0],saved[1],saved[2],saved[3]); - sf_pushtextsettings(); - ts->font = sf_VGA_SFONT; - ts->style = 0; - ts->oh = 0; - ts->fore = 0; - ts->backTransparent = 1; - - sf_fillrect(O_GRAY2,X,Y,W,H); -// frame_upframe(X,Y,W,H); - sf_rect(FRAMECOLOR,X,Y,W,H); - sf_rect(FRAMECOLOR,X+1,Y+1,W-2,H-2); - sf_fillrect(FRAMECOLOR,X,Y+2,W,HTEXT); - if (tit) writetext(O_WHITE,tit,X+2+SPC,Y+2,W-4,0); - A_list = addarea(xdlg,ydlg,wdlg,hdlg,Zselect); - bareas[A_list].back = O_WHITE; - clarea(A_list); - frame_downframe(xdlg-2,ydlg-2,wdlg+4,hdlg+4); - - y0 = Y+SPC+2*BFRAME+HTEXT; - y2 = Y+H-SPC-2*BFRAME-HTEXT; - y1 = y2-SPC-HTEXT-2*BFRAME; - x1 = xdlg+wentry+2*BFRAME+SPC; - - A_dir = addarea(xdlg,y0,wentry,HTEXT,NULL); - A_entry = addarea(xdlg,y1,wentry,HTEXT,Zentry); - bareas[A_entry].back = O_WHITE; - clarea(A_entry); - frame_downframe(xdlg-2,y1-2,wentry+4,HTEXT+4); - B_up = addbutton(x1,y0,BUTTW,HTEXT,"^up^",Zup); - A_filter = addarea(xdlg,y2,wentry,HTEXT,NULL); - strcpy(buffer,"Filter: "); - strcat(buffer,filt); - writetext(0,buffer,xdlg,y2,wentry,0); - B_cancel = addbutton(x1,y2,BUTTW,HTEXT,"Cancel",Zcanc); - B_ok = addbutton(x1,y1,BUTTW,HTEXT,"OK",Zok); - - showfilename(-1); - updatelist(); - - for (;;) - { - if (pushed) { c = pushed; pushed = 0;} - else c = inputkey(); - if (c == ZC_SINGLE_CLICK) c = checkmouse(0); - if (c == VK_INS) c = Zentry(0,-1); - if (c == ZC_ARROW_LEFT) goleft(); - if (c == ZC_ARROW_RIGHT) goright(); - if (c == ZC_ESCAPE) break; - if (c == ZC_RETURN) - { - strcpy(buffer,lastdir); - strcat(buffer,filename); - *res = buffer; - if ((existing==0) && (access(buffer,F_OK)==0)) - c = yesnoover(xdlg+wdlg/2,ydlg+hdlg/2); - if (c == ZC_RETURN) break; - } - } - - sf_poptextsettings(); - - cleanlist(curdir); curdir = NULL; - -//printf("2saved: %p %d %d %d %d\n",saved,saved[0],saved[1],saved[2],saved[3]); - sf_restoreareaandfree(saved); - - if (c == ZC_ESCAPE) return -1; - - if (c == ZC_RETURN) - { - strcpy(buffer,lastdir); - strcat(buffer,filename); - *res = buffer; - return 0; - } - - return SF_NOTIMP; - } - -void sf_setdialog(void) -{ - sf_osdialog = myosdialog; -} - -/////////////////////////////////// - -#include -#include -#include -#include -#ifdef WIN32 -#define strcasecmp stricmp -#else -#include -#endif -#include -#include -//#include -#include - -// simplified fnmatch - only allows a single * at beginning -STATIC int myfnmatch( const char *pattern, const char *p, int dummy) - { - int lpat, lp; - if (!pattern) return -1; - if (!p) return -1; - if (pattern[0] != '*') return strcmp(pattern,p); - lpat = strlen(pattern); - if (lpat == 1) return 0; // * matches anything - lpat--; pattern++; - lp = strlen(p); - if (lp < lpat) return 1; // too short - return strcmp(pattern,p+lp-lpat); - } - -STATIC void cleanlist( ENTRY *t) - { - while (t) - { - ENTRY *n = t->right; - if (t->value) free(t->value); - free(t); - t = n; - } - } - -STATIC ENTRY * newentry( char *s) - { - ENTRY *r = calloc(1,sizeof(ENTRY)); - - if (r){ - r->value = strdup(s); - if (!r->value){ free(r); return NULL;} - } - return r; - } - -STATIC void addentry( char *s, ENTRY **ae) - { - ENTRY *t = *ae; - if (!t) - { - *ae = newentry(s); - return; - } - for (;;) - { - int k = strcasecmp(s,t->value); - if (!k) return; - if (k > 0) - { - if (t->right) t = t->right; - else - { - t->right = newentry(s); - return; - } - } - else - { - if (t->left) t = t->left; - else - { - t->left = newentry(s); - return; - } - } - } - } - -STATIC char *resolvedir( char *dir, char *res, int size) - { - char cwd[FILENAME_MAX], *p; int i; - if (!getcwd(cwd,FILENAME_MAX)) return NULL; - if (chdir(dir)) return NULL; - p = getcwd(res,size); - for (i=0;p[i];i++) if (p[i]=='\\') p[i] = '/'; - chdir(cwd); - if (p) - { - int n = strlen(p); - if (n) if (p[n-1] != '/') { p[n] = '/'; p[n+1] = 0;} - } - return p; - } - -STATIC ENTRY * dodir( - char *dirname, char *pattern, char *resdir, int size, int *ndirs, int *ntot) - { - DIR *dir; - ENTRY *dirs = NULL; - ENTRY *files = NULL, *res = NULL; - struct dirent *d; - char *p, *resdend; - struct stat fst; - int n; - - void exhaust( ENTRY *e) - { - if (!e) return; - exhaust(e->left); - e->left = res; - res = e; - n++; - exhaust(e->right); - } - -//printf("\ndodir\n"); - if (!resolvedir(dirname,resdir,size)) return NULL; - resdend = resdir+strlen(resdir); - -//printf("[%s]\n",resdir); - // MinGW opendir() does not like the final slash -#ifdef WIN32 - n = strlen(resdir); - if (n > 2 && (resdir[n-2] != ':')) - resdir[n-1] = 0; - dir = opendir(resdir); - resdir[n-1] = '/'; -#else - dir = opendir(resdir); -#endif - if (!dir) return NULL; - -//printf("opened [%s]\n",resdir); - for (;;) - { - d = readdir(dir); - if (!d) break; - p = d->d_name; - if (strcmp(p,".")==0) continue; - if (strcmp(p,"..")==0) continue; - strcpy(resdend,p); -//printf("-%s\n",resdir); - if (stat(resdir,&fst)) continue; -//printf("--mode %x\n",fst.st_mode); - if (S_ISDIR(fst.st_mode)) - addentry(p,&dirs); - else - { -//printf("--fnmatch: %d\n",fnmatch(pattern,p,0)); - if (myfnmatch(pattern,p,0)==0) addentry(p,&files); - } - } - - closedir(dir); - *resdend = 0; - - n = 0; - exhaust(dirs); - *ndirs = n; - exhaust(files); - *ntot = n; - - if (res) - while (res->left) - { - ((ENTRY *)(res->left))->right = res; - res = res->left; - } - - return res; - } - - -////////////////////////////////////////////// -// white,black,gray,yellow -static ulong bcolors[4] = {0xfcfcfc,0,0xa0a0a0,0xa0d0e0}; - -static unsigned char folderbmp[] = { - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,1,1,1,1,1,1, - 0,0,0,0,0,0,0,0, - 0,1,3,3,3,3,3,3, - 1,1,1,1,1,1,0,0, - 0,1,3,3,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,1,3,3,3,3,3,3, - 3,1,1,1,1,1,1,0, - 0,1,3,3,1,1,1,1, - 1,3,3,3,3,3,1,0, - 0,1,3,1,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,1,3,1,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,1,3,1,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,1,3,1,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,1,3,1,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,1,3,1,3,3,3,3, - 3,3,3,3,3,3,1,0, - 0,0,1,1,1,1,1,1, - 1,1,1,1,1,1,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0}; - - -static unsigned char docbmp[] = { - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,1,1,1,1,1,1, - 1,1,1,1,1,1,0,0, - 0,1,0,0,0,0,0,0, - 0,0,0,0,0,0,1,0, - 0,1,0,2,2,2,2,2, - 2,2,2,2,2,0,1,0, - 0,1,0,0,0,0,0,0, - 0,0,0,0,0,0,1,0, - 0,1,0,2,2,2,2,2, - 2,2,2,2,2,0,1,0, - 0,1,0,0,0,0,0,0, - 0,0,0,0,0,0,1,0, - 0,1,0,2,2,2,2,2, - 2,2,2,2,2,0,1,0, - 0,1,0,0,0,0,0,0, - 0,0,0,0,0,0,1,0, - 0,1,0,2,2,2,2,2, - 2,2,2,2,2,0,1,0, - 0,1,0,0,0,0,0,0, - 0,0,0,0,0,0,1,0, - 0,1,0,0,0,0,0,0, - 0,0,0,0,0,0,1,0, - 0,0,1,1,1,1,1,1, - 1,1,1,1,1,1,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0}; - -//////////////////////////////// - -STATIC void drawit( int x, int y, ENTRY *e, int w, int issub) - { - int i, j, n, color; - unsigned char *bmp; - char *s = e->value; - bmp = (issub ? folderbmp : docbmp); - for (i=0;i<16;i++) for (j=0;j<16;j++) sf_wpixel(x+j,y+i,bcolors[*bmp++]); - x += 17; - w -= 17; - n = w/8; - if (n < 1) return; - if (strlen(s) > n) - { - strcpy(buffer,s); - buffer[n] = 0; - buffer[n-1] = '>'; - s = buffer; - } - if (e == selected) - { - color = O_WHITE; - sf_fillrect(0,x,y,w,16); - } - else - color = O_BLACK; - writetext(color,s,x,y,w,0); - } - -static int Nrows, Ncols, Ewid, Fh; - -STATIC void drawnames( int x, int y, int w, int h, ENTRY *files, int first, int nsub, int ntot, int ewid) - { - int i; - - Fh = 16; - Ewid = ewid; - Ncols = w/ewid; - Nrows = h/Fh; - - sf_fillrect(O_WHITE,x,y,w,h); - if (!files) return; - if (first < 0) return; - if (nsub > ntot) nsub = ntot; - while (first > 0) - { - files = files->right; - if (!files) return; - nsub--; - ntot--; - first--; - } - if (ntot <= 0) return; - if (Ncols < 1) return; - if (Nrows < 1) return; - if (Nrows*Ncols < ntot) ntot = Nrows*Ncols; - for (i=0;iright; - } - } - -STATIC void drawlist() - { - BAREA *a = bareas+A_list, *b = bareas+A_dir; - - clarea(A_dir); - writetext(0,lastdir,b->x,b->y,b->w,0); - drawnames(a->x,a->y,a->w,a->h,curdir,First,Numdirs,Numtot,21*8); - - } - -STATIC void goright() - { - if (First+Nrows*Ncols > Numtot) return; - First += Nrows; - drawlist(); - } - -STATIC void goleft() - { - if (!First) return; - First -= Nrows; - drawlist(); - } - -STATIC ENTRY *filesat( int n){ - ENTRY *e = curdir; - while (n--) - { - if (e) e = e->right; - } - return e; - } - -STATIC zword Zselect( int x, int y) - { - int n; - x /= Ewid; - y /= Fh; - n = First + y + x*Nrows; - if (n >= Numtot) - { - if (selected) - { - selected = NULL; - drawlist(); - } - return 0; - } - if (n < Numdirs) - { - ENTRY *e = filesat(n); - if (!e) return 0; - strcat(lastdir,e->value); - updatelist(); - return 0; - } - selected = curdir; - while (n--) selected = selected->right; - strcpy(filename,selected->value); - showfilename(-1); - drawlist(); - return 0; - } - -extern void sf_videodata( ulong **sb, int *sp, int *ew, int *eh); -zword sf_yesnooverlay( int xc, int yc, char *t, int saverest) - { - zword c = ZC_RETURN; - int nsav = nbareas; - ulong *saved = NULL; - int hx = BUTTW+3*SPC, hy = HTEXT+2*SPC, heff; - - heff = 8*strlen(t); - if (heff > 2*hx) hx = (heff+3)/2; - if (saverest) - { - ts = sf_curtextsetting(); - if (!ts) return ZC_ESCAPE; - saved = sf_savearea(xc-hx-2,yc-hy-2,2*hx+4,2*hy+4); - if (!saved) return ZC_ESCAPE; - sf_pushtextsettings(); - ts->font = sf_VGA_SFONT; - ts->style = 0; - ts->oh = 0; - ts->fore = 0; - ts->backTransparent = 1; - sf_videodata(&sbuffer, &sbpitch, &ewidth, &eheight); - } - - sf_fillrect(FRAMECOLOR,xc-hx-2,yc-hy-2,2*hx+4,2*hy+4); - sf_fillrect(O_WHITE,xc-hx,yc-hy,2*hx,2*hy); - writetext(O_BLACK,t,xc-hx,yc-SPC-HTEXT,2*hx,1); - addbutton(xc-SPC-BUTTW,yc+SPC,BUTTW,HTEXT,"Yes",Zok); - addbutton(xc+SPC,yc+SPC,BUTTW,HTEXT,"No",Zcanc); - for (;;) - { - c = inputkey(); - if (c == 'n' || c == 'N') c = ZC_ESCAPE; - if (c == 'y' || c == 'Y') c = ZC_RETURN; - if (c == ZC_SINGLE_CLICK) c = checkmouse(nsav); - if (c == ZC_ESCAPE) break; - if (c == ZC_RETURN) break; - } - - if (saved) - { - sf_restoreareaandfree(saved); - sf_poptextsettings(); - } - - nbareas = nsav; - return c; - } - -STATIC zword yesnoover( int xc, int yc) - { - zword c; - - c = sf_yesnooverlay(xc,yc,"Overwrite file?",0); - - drawlist(); - return c; - } - -// this is needed for overlapping source and dest in Zentry -// (lib does not guarantee correct behaviour in that case) -static void mystrcpy( char *d, const char *s) - { - while ((*d++ = *s++)); - } - -STATIC zword Zentry( int x, int y) - { - static int pos = 10000; - int i,n,nmax; zword c; - - nmax = wentry/8; - if (nmax >= FILENAME_MAX) nmax = FILENAME_MAX-1; - n = strlen(filename); - if (n > nmax) { n = nmax; filename[n] = 0;} - if (y >= 0) - { - pos = x/4-1; if (pos < 0) pos = 0; - pos /= 2; - } - if (pos > n) pos = n; - showfilename(pos); - for (;;) - { - c = inputkey(); - if (c == ZC_SINGLE_CLICK) - { - pushed = c; - c = 0; - break; - } - if (c == ZC_ESCAPE || c == VK_INS) { c = 0; break; } - if (c == ZC_RETURN) break; - if (c == ZC_ARROW_LEFT) - { - if (pos){ pos--; showfilename(pos); } - continue; - } - if (c == ZC_ARROW_RIGHT) - { - if (pos < n){ pos++; showfilename(pos); } - continue; - } - if (c == ZC_BACKSPACE) - { - if (pos) - { - // needs mystrcpy() because overlapping src-dst - if (pos < n) mystrcpy(filename+pos-1,filename+pos); - n--; - filename[n] = 0; - pos--; - showfilename(pos); - } - continue; - } - if ((c >= 32 && c < 127) || (c >= 160 && c < 256)) - { - if (n >= nmax) continue; - if (n > pos) - for (i=n;i>pos;i--) filename[i] = filename[i-1]; - filename[pos] = c; - n++; - filename[n] = 0; - pos++; - showfilename(pos); - } - } - showfilename(-1); - return c; - } - - +#include +#include +#include + +#include +#include +#include + +#define STATIC static + +#include "sf_frotz.h" + +typedef struct { + void *left, *right; + char *value; + } ENTRY; + + +extern SFONT *sf_VGA_SFONT; + +#define FRAMECOLOR 222275 + +static char buffer[512]; +static char lastdir[FILENAME_MAX] = ""; +static char filename[FILENAME_MAX]; +static char pattern[64]; +static zword pushed = 0; +static int wentry; + +static ulong *sbuffer = NULL; +static int sbpitch; // in longs +static int ewidth, eheight; +static int X,Y,W,H, xdlg,ydlg,wdlg,hdlg; + +#define HTEXT 18 + +STATIC void cleanlist( ENTRY *t); +STATIC void drawlist(); +STATIC ENTRY * dodir( + char *dirname, char *pattern, char *resdir, int size, int *ndirs, int *ntot); +static int Numdirs, Numtot, First; +static ENTRY *curdir = NULL, *selected; + +STATIC void updatelist() + { + if (curdir) cleanlist(curdir); + curdir = dodir(lastdir,pattern,lastdir,FILENAME_MAX,&Numdirs,&Numtot); + First = 0; + selected = NULL; + drawlist(); + } + +STATIC void goright(); +STATIC void goleft(); +// assumes a / at end +STATIC void goup() + { + char *p; + if (strlen(lastdir) < 2) return; + lastdir[strlen(lastdir)-1] = 0; + p = strrchr(lastdir,'/'); + if (p){ p[1] = 0; updatelist();} + else strcat(lastdir,"/"); + } + +typedef struct { + int x,y,w,h; // internal + zword (*click)(int,int); + ulong back; + int isbutton; + } BAREA; + +#define MAXBAREA 20 +static BAREA bareas[MAXBAREA]; +static int nbareas=0; +static SF_textsetting *ts; + +#define BFRAME 2 +#define SPC 5 + +#define WDLG (63*8) +#define HDLG 208 + +#define HCURSOR 8 + +#define O_BLACK 0 +#define O_GRAY1 0x8a8a8a +#define O_GRAY2 0xd6d6d6 +#define O_GRAY3 0xe2e2e2 +#define O_WHITE 0xf5f5f5 + +STATIC void frame_upframe( int x, int y, int w, int h){ + ulong v = O_WHITE; + sf_chline(x,y,v,w); + sf_cvline(x,y,v,--h); + v = O_BLACK; + sf_chline(x,y+h,v,w--); + sf_cvline(x+w--,y,v,h--); + x++; y++; + v = O_GRAY3; + sf_chline(x,y,v,w); + sf_cvline(x,y,v,--h); + v = O_GRAY1; + sf_chline(x,y+h,v,w--); + sf_cvline(x+w,y,v,h); + } + +STATIC void frame_downframe( int x, int y, int w, int h){ + ulong v = O_BLACK; + sf_chline(x,y,v,w); + sf_cvline(x,y,v,--h); + v = O_WHITE; + sf_chline(x,y+h,v,w--); + sf_cvline(x+w--,y,v,h--); + x++; y++; + v = O_GRAY1; + sf_chline(x,y,v,w); + sf_cvline(x,y,v,--h); + v = O_GRAY3; + sf_chline(x,y+h,v,w--); + sf_cvline(x+w,y,v,h); + } + +// internal coords +STATIC int addarea( int x, int y, int w, int h, zword (*click)(int,int)) + { + BAREA *a = bareas+nbareas; + a->x = x; a->y = y; a->w = w; a->h = h; a->click = click; + a->back = O_GRAY2; + return nbareas++; + } + +STATIC void clarea( int n) + { + BAREA *a = bareas+n; + sf_fillrect(a->back,a->x,a->y,a->w,a->h); + } + +STATIC void writetext( ulong color, const char *s, int x, int y, int w, int center) + { + int ox,oy,ow,oh; +//printf("W %p [%s]\n",s,s ? s : "??"); + if (!s) return; + if (!s[0]) return; + sf_getclip(&ox,&oy,&ow,&oh); + sf_setclip(x,y,w,HTEXT); +//printf("1\n"); + if (center) + { + int wt = 8*strlen(s); + x += (w-wt)/2; + } +//printf("2 ts %p\n",ts); fflush(stdout); if (ts < 1000){sf_flushdisplay(); getchar();} + ts->cx = x; + ts->cy = y; + ts->fore = color; +//printf("3\n"); fflush(stdout); + while (*s) sf_writeglyph(ts->font->getglyph(ts->font,(*s++),1)); +//printf("4\n"); + sf_setclip(ox,oy,ow,oh); +//printf("5\n"); + } + +STATIC int addbutton( int x, int y, int w, int h, char *text, zword (*click)(int,int)) + { + int b = addarea(x,y,w,h,click); + bareas[b].isbutton = 1; + frame_upframe(x-2,y-2,w+4,h+4); + clarea(b); + if (text) writetext(0,text,x,y,w,1); + return b; + } + +static int B_up, B_ok, B_cancel; +static int A_dir, A_filter, A_entry, A_list; + +#define BUTTW 60 + +STATIC void showfilename( int pos) + { + BAREA *a = bareas+A_entry; + clarea(A_entry); + writetext(0,filename,a->x,a->y,a->w,0); + if (pos >= 0) + sf_cvline(a->x+8*pos,a->y,O_BLACK,HTEXT); + } + +STATIC void clicked( BAREA *a) + { + frame_downframe(a->x-2,a->y-2,a->w+4,a->h+4); + sf_flushdisplay(); + sf_sleep(100); + frame_upframe(a->x-2,a->y-2,a->w+4,a->h+4); + sf_flushdisplay(); + } + +STATIC zword checkmouse( int i0) + { + int x = mouse_x-1, y = mouse_y-1; + int i; + for (i=i0;i a->x && x < a->x+a->w && y > a->y && y < a->y+a->h) + { + if (a->click) + { + if (a->isbutton) clicked(a); + return a->click(x-a->x,y-a->y); + } + else return 0; + } + } + return 0; + } + +STATIC zword Zup( int x, int y) + { + goup(); + return 0; + } + +STATIC zword Zok( int x, int y) + { + return ZC_RETURN; + } + +STATIC zword Zcanc( int x, int y) + { + return ZC_ESCAPE; + } + +STATIC zword Zselect( int x, int y); +STATIC zword yesnoover( int xc, int yc); +STATIC zword Zentry( int x, int y); + +STATIC zword inputkey() + { + zword c = sf_read_key(0,0,1); + if (c == ZC_SINGLE_CLICK) + { + switch (mouse_button) + { + case 4: c = ZC_ARROW_LEFT; break; + case 5: c = ZC_ARROW_RIGHT; break; + case 1: break; + default: c = 0; break; + } + } +// if (os_read_mouse() != 1) c = 0; + return c; + } + +int (*sf_sysdialog)( bool existing, const char *def, const char *filt, const char *tit, char **res) = NULL; + +STATIC int myosdialog( bool existing, const char *def, const char *filt, const char *tit, char **res, ulong *sbuf, int sbp, int ew, int eh, int isfull) + { + char *pp; ulong *saved; int y0, y1, y2, x1; + zword c = 0; + + // allow system-specific dialog if not fullscreen + if (isfull == 0) if (sf_sysdialog) + return sf_sysdialog(existing,def,filt,tit,res); + + ts = sf_curtextsetting(); + if (!ts) return SF_NOTIMP; + +//printf("0 ts %p (%p)\n",ts,&ts); + + if (!def) def = ""; + strcpy(filename,def); + pp = strrchr(filename,'/'); + if (pp) + { + *pp = 0; + strcpy(lastdir,filename); + strcpy(filename,pp+1); + } + + if (!filt) filt = "*|All files"; + + if (!lastdir[0]) strcpy(lastdir,"./"); + + strcpy(buffer,filt); + pp = strchr(buffer,'|'); if (pp) *pp = 0; + strcpy(pattern,buffer); + + ewidth = ew; + eheight = eh; + sbuffer = sbuf; + sbpitch = sbp; + + wdlg = WDLG; + hdlg = HDLG; + + nbareas = 0; + + W = WDLG+4*BFRAME+2*SPC; + H = HDLG+4*BFRAME+6*SPC+6*BFRAME+3*(HTEXT+2)+HCURSOR+HTEXT; + + if (W > ew) return SF_NOTIMP; + if (H > eh) return SF_NOTIMP; + + X = (ew-W)/2; + Y = (eh-H)/2; + + // internal!! + xdlg = X+SPC+2*BFRAME; + ydlg = Y+2*SPC+4*BFRAME+HTEXT+HTEXT; + + wentry = wdlg - BUTTW - SPC - 2*BFRAME; + + saved = sf_savearea(X,Y,W,H); + if (!saved) return SF_NOTIMP; + +//printf("saved: %p %d %d %d %d\n",saved,saved[0],saved[1],saved[2],saved[3]); + sf_pushtextsettings(); + ts->font = sf_VGA_SFONT; + ts->style = 0; + ts->oh = 0; + ts->fore = 0; + ts->backTransparent = 1; + + sf_fillrect(O_GRAY2,X,Y,W,H); +// frame_upframe(X,Y,W,H); + sf_rect(FRAMECOLOR,X,Y,W,H); + sf_rect(FRAMECOLOR,X+1,Y+1,W-2,H-2); + sf_fillrect(FRAMECOLOR,X,Y+2,W,HTEXT); + if (tit) writetext(O_WHITE,tit,X+2+SPC,Y+2,W-4,0); + A_list = addarea(xdlg,ydlg,wdlg,hdlg,Zselect); + bareas[A_list].back = O_WHITE; + clarea(A_list); + frame_downframe(xdlg-2,ydlg-2,wdlg+4,hdlg+4); + + y0 = Y+SPC+2*BFRAME+HTEXT; + y2 = Y+H-SPC-2*BFRAME-HTEXT; + y1 = y2-SPC-HTEXT-2*BFRAME; + x1 = xdlg+wentry+2*BFRAME+SPC; + + A_dir = addarea(xdlg,y0,wentry,HTEXT,NULL); + A_entry = addarea(xdlg,y1,wentry,HTEXT,Zentry); + bareas[A_entry].back = O_WHITE; + clarea(A_entry); + frame_downframe(xdlg-2,y1-2,wentry+4,HTEXT+4); + B_up = addbutton(x1,y0,BUTTW,HTEXT,"^up^",Zup); + A_filter = addarea(xdlg,y2,wentry,HTEXT,NULL); + strcpy(buffer,"Filter: "); + strcat(buffer,filt); + writetext(0,buffer,xdlg,y2,wentry,0); + B_cancel = addbutton(x1,y2,BUTTW,HTEXT,"Cancel",Zcanc); + B_ok = addbutton(x1,y1,BUTTW,HTEXT,"OK",Zok); + + showfilename(-1); + updatelist(); + + for (;;) + { + if (pushed) { c = pushed; pushed = 0;} + else c = inputkey(); + if (c == ZC_SINGLE_CLICK) c = checkmouse(0); + if (c == VK_INS) c = Zentry(0,-1); + if (c == ZC_ARROW_LEFT) goleft(); + if (c == ZC_ARROW_RIGHT) goright(); + if (c == ZC_ESCAPE) break; + if (c == ZC_RETURN) + { + strcpy(buffer,lastdir); + strcat(buffer,filename); + *res = buffer; + if ((existing==0) && (access(buffer,F_OK)==0)) + c = yesnoover(xdlg+wdlg/2,ydlg+hdlg/2); + if (c == ZC_RETURN) break; + } + } + + sf_poptextsettings(); + + cleanlist(curdir); curdir = NULL; + +//printf("2saved: %p %d %d %d %d\n",saved,saved[0],saved[1],saved[2],saved[3]); + sf_restoreareaandfree(saved); + + if (c == ZC_ESCAPE) return -1; + + if (c == ZC_RETURN) + { + strcpy(buffer,lastdir); + strcat(buffer,filename); + *res = buffer; + return 0; + } + + return SF_NOTIMP; + } + +void sf_setdialog(void) +{ + sf_osdialog = myosdialog; +} + +/////////////////////////////////// + +#include +#include +#include +#include +#ifdef WIN32 +#define strcasecmp stricmp +#else +#include +#endif +#include +#include +//#include +#include + +// simplified fnmatch - only allows a single * at beginning +STATIC int myfnmatch( const char *pattern, const char *p, int dummy) + { + int lpat, lp; + if (!pattern) return -1; + if (!p) return -1; + if (pattern[0] != '*') return strcmp(pattern,p); + lpat = strlen(pattern); + if (lpat == 1) return 0; // * matches anything + lpat--; pattern++; + lp = strlen(p); + if (lp < lpat) return 1; // too short + return strcmp(pattern,p+lp-lpat); + } + +STATIC void cleanlist( ENTRY *t) + { + while (t) + { + ENTRY *n = t->right; + if (t->value) free(t->value); + free(t); + t = n; + } + } + +STATIC ENTRY * newentry( char *s) + { + ENTRY *r = calloc(1,sizeof(ENTRY)); + + if (r){ + r->value = strdup(s); + if (!r->value){ free(r); return NULL;} + } + return r; + } + +STATIC void addentry( char *s, ENTRY **ae) + { + ENTRY *t = *ae; + if (!t) + { + *ae = newentry(s); + return; + } + for (;;) + { + int k = strcasecmp(s,t->value); + if (!k) return; + if (k > 0) + { + if (t->right) t = t->right; + else + { + t->right = newentry(s); + return; + } + } + else + { + if (t->left) t = t->left; + else + { + t->left = newentry(s); + return; + } + } + } + } + +STATIC char *resolvedir( char *dir, char *res, int size) + { + char cwd[FILENAME_MAX], *p; int i; + if (!getcwd(cwd,FILENAME_MAX)) return NULL; + if (chdir(dir)) return NULL; + p = getcwd(res,size); + for (i=0;p[i];i++) if (p[i]=='\\') p[i] = '/'; + chdir(cwd); + if (p) + { + int n = strlen(p); + if (n) if (p[n-1] != '/') { p[n] = '/'; p[n+1] = 0;} + } + return p; + } + +STATIC ENTRY * dodir( + char *dirname, char *pattern, char *resdir, int size, int *ndirs, int *ntot) + { + DIR *dir; + ENTRY *dirs = NULL; + ENTRY *files = NULL, *res = NULL; + struct dirent *d; + char *p, *resdend; + struct stat fst; + int n; + + void exhaust( ENTRY *e) + { + if (!e) return; + exhaust(e->left); + e->left = res; + res = e; + n++; + exhaust(e->right); + } + +//printf("\ndodir\n"); + if (!resolvedir(dirname,resdir,size)) return NULL; + resdend = resdir+strlen(resdir); + +//printf("[%s]\n",resdir); + // MinGW opendir() does not like the final slash +#ifdef WIN32 + n = strlen(resdir); + if (n > 2 && (resdir[n-2] != ':')) + resdir[n-1] = 0; + dir = opendir(resdir); + resdir[n-1] = '/'; +#else + dir = opendir(resdir); +#endif + if (!dir) return NULL; + +//printf("opened [%s]\n",resdir); + for (;;) + { + d = readdir(dir); + if (!d) break; + p = d->d_name; + if (strcmp(p,".")==0) continue; + if (strcmp(p,"..")==0) continue; + strcpy(resdend,p); +//printf("-%s\n",resdir); + if (stat(resdir,&fst)) continue; +//printf("--mode %x\n",fst.st_mode); + if (S_ISDIR(fst.st_mode)) + addentry(p,&dirs); + else + { +//printf("--fnmatch: %d\n",fnmatch(pattern,p,0)); + if (myfnmatch(pattern,p,0)==0) addentry(p,&files); + } + } + + closedir(dir); + *resdend = 0; + + n = 0; + exhaust(dirs); + *ndirs = n; + exhaust(files); + *ntot = n; + + if (res) + while (res->left) + { + ((ENTRY *)(res->left))->right = res; + res = res->left; + } + + return res; + } + + +////////////////////////////////////////////// +// white,black,gray,yellow +static ulong bcolors[4] = {0xfcfcfc,0,0xa0a0a0,0xa0d0e0}; + +static unsigned char folderbmp[] = { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,1,1,1,1,1,1, + 0,0,0,0,0,0,0,0, + 0,1,3,3,3,3,3,3, + 1,1,1,1,1,1,0,0, + 0,1,3,3,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,1,3,3,3,3,3,3, + 3,1,1,1,1,1,1,0, + 0,1,3,3,1,1,1,1, + 1,3,3,3,3,3,1,0, + 0,1,3,1,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,1,3,1,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,1,3,1,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,1,3,1,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,1,3,1,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,1,3,1,3,3,3,3, + 3,3,3,3,3,3,1,0, + 0,0,1,1,1,1,1,1, + 1,1,1,1,1,1,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0}; + + +static unsigned char docbmp[] = { + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,1,1,1,1,1,1, + 1,1,1,1,1,1,0,0, + 0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0, + 0,1,0,2,2,2,2,2, + 2,2,2,2,2,0,1,0, + 0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0, + 0,1,0,2,2,2,2,2, + 2,2,2,2,2,0,1,0, + 0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0, + 0,1,0,2,2,2,2,2, + 2,2,2,2,2,0,1,0, + 0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0, + 0,1,0,2,2,2,2,2, + 2,2,2,2,2,0,1,0, + 0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0, + 0,1,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0, + 0,0,1,1,1,1,1,1, + 1,1,1,1,1,1,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0}; + +//////////////////////////////// + +STATIC void drawit( int x, int y, ENTRY *e, int w, int issub) + { + int i, j, n, color; + unsigned char *bmp; + char *s = e->value; + bmp = (issub ? folderbmp : docbmp); + for (i=0;i<16;i++) for (j=0;j<16;j++) sf_wpixel(x+j,y+i,bcolors[*bmp++]); + x += 17; + w -= 17; + n = w/8; + if (n < 1) return; + if (strlen(s) > n) + { + strcpy(buffer,s); + buffer[n] = 0; + buffer[n-1] = '>'; + s = buffer; + } + if (e == selected) + { + color = O_WHITE; + sf_fillrect(0,x,y,w,16); + } + else + color = O_BLACK; + writetext(color,s,x,y,w,0); + } + +static int Nrows, Ncols, Ewid, Fh; + +STATIC void drawnames( int x, int y, int w, int h, ENTRY *files, int first, int nsub, int ntot, int ewid) + { + int i; + + Fh = 16; + Ewid = ewid; + Ncols = w/ewid; + Nrows = h/Fh; + + sf_fillrect(O_WHITE,x,y,w,h); + if (!files) return; + if (first < 0) return; + if (nsub > ntot) nsub = ntot; + while (first > 0) + { + files = files->right; + if (!files) return; + nsub--; + ntot--; + first--; + } + if (ntot <= 0) return; + if (Ncols < 1) return; + if (Nrows < 1) return; + if (Nrows*Ncols < ntot) ntot = Nrows*Ncols; + for (i=0;iright; + } + } + +STATIC void drawlist() + { + BAREA *a = bareas+A_list, *b = bareas+A_dir; + + clarea(A_dir); + writetext(0,lastdir,b->x,b->y,b->w,0); + drawnames(a->x,a->y,a->w,a->h,curdir,First,Numdirs,Numtot,21*8); + + } + +STATIC void goright() + { + if (First+Nrows*Ncols > Numtot) return; + First += Nrows; + drawlist(); + } + +STATIC void goleft() + { + if (!First) return; + First -= Nrows; + drawlist(); + } + +STATIC ENTRY *filesat( int n){ + ENTRY *e = curdir; + while (n--) + { + if (e) e = e->right; + } + return e; + } + +STATIC zword Zselect( int x, int y) + { + int n; + x /= Ewid; + y /= Fh; + n = First + y + x*Nrows; + if (n >= Numtot) + { + if (selected) + { + selected = NULL; + drawlist(); + } + return 0; + } + if (n < Numdirs) + { + ENTRY *e = filesat(n); + if (!e) return 0; + strcat(lastdir,e->value); + updatelist(); + return 0; + } + selected = curdir; + while (n--) selected = selected->right; + strcpy(filename,selected->value); + showfilename(-1); + drawlist(); + return 0; + } + +extern void sf_videodata( ulong **sb, int *sp, int *ew, int *eh); +zword sf_yesnooverlay( int xc, int yc, char *t, int saverest) + { + zword c = ZC_RETURN; + int nsav = nbareas; + ulong *saved = NULL; + int hx = BUTTW+3*SPC, hy = HTEXT+2*SPC, heff; + + heff = 8*strlen(t); + if (heff > 2*hx) hx = (heff+3)/2; + if (saverest) + { + ts = sf_curtextsetting(); + if (!ts) return ZC_ESCAPE; + saved = sf_savearea(xc-hx-2,yc-hy-2,2*hx+4,2*hy+4); + if (!saved) return ZC_ESCAPE; + sf_pushtextsettings(); + ts->font = sf_VGA_SFONT; + ts->style = 0; + ts->oh = 0; + ts->fore = 0; + ts->backTransparent = 1; + sf_videodata(&sbuffer, &sbpitch, &ewidth, &eheight); + } + + sf_fillrect(FRAMECOLOR,xc-hx-2,yc-hy-2,2*hx+4,2*hy+4); + sf_fillrect(O_WHITE,xc-hx,yc-hy,2*hx,2*hy); + writetext(O_BLACK,t,xc-hx,yc-SPC-HTEXT,2*hx,1); + addbutton(xc-SPC-BUTTW,yc+SPC,BUTTW,HTEXT,"Yes",Zok); + addbutton(xc+SPC,yc+SPC,BUTTW,HTEXT,"No",Zcanc); + for (;;) + { + c = inputkey(); + if (c == 'n' || c == 'N') c = ZC_ESCAPE; + if (c == 'y' || c == 'Y') c = ZC_RETURN; + if (c == ZC_SINGLE_CLICK) c = checkmouse(nsav); + if (c == ZC_ESCAPE) break; + if (c == ZC_RETURN) break; + } + + if (saved) + { + sf_restoreareaandfree(saved); + sf_poptextsettings(); + } + + nbareas = nsav; + return c; + } + +STATIC zword yesnoover( int xc, int yc) + { + zword c; + + c = sf_yesnooverlay(xc,yc,"Overwrite file?",0); + + drawlist(); + return c; + } + +// this is needed for overlapping source and dest in Zentry +// (lib does not guarantee correct behaviour in that case) +static void mystrcpy( char *d, const char *s) + { + while ((*d++ = *s++)); + } + +STATIC zword Zentry( int x, int y) + { + static int pos = 10000; + int i,n,nmax; zword c; + + nmax = wentry/8; + if (nmax >= FILENAME_MAX) nmax = FILENAME_MAX-1; + n = strlen(filename); + if (n > nmax) { n = nmax; filename[n] = 0;} + if (y >= 0) + { + pos = x/4-1; if (pos < 0) pos = 0; + pos /= 2; + } + if (pos > n) pos = n; + showfilename(pos); + for (;;) + { + c = inputkey(); + if (c == ZC_SINGLE_CLICK) + { + pushed = c; + c = 0; + break; + } + if (c == ZC_ESCAPE || c == VK_INS) { c = 0; break; } + if (c == ZC_RETURN) break; + if (c == ZC_ARROW_LEFT) + { + if (pos){ pos--; showfilename(pos); } + continue; + } + if (c == ZC_ARROW_RIGHT) + { + if (pos < n){ pos++; showfilename(pos); } + continue; + } + if (c == ZC_BACKSPACE) + { + if (pos) + { + // needs mystrcpy() because overlapping src-dst + if (pos < n) mystrcpy(filename+pos-1,filename+pos); + n--; + filename[n] = 0; + pos--; + showfilename(pos); + } + continue; + } + if ((c >= 32 && c < 127) || (c >= 160 && c < 256)) + { + if (n >= nmax) continue; + if (n > pos) + for (i=n;i>pos;i--) filename[i] = filename[i-1]; + filename[pos] = c; + n++; + filename[n] = 0; + pos++; + showfilename(pos); + } + } + showfilename(-1); + return c; + } + + diff --git a/src/sdl/sf_video.c b/src/sdl/sf_video.c index dd7023b..e976e5a 100644 --- a/src/sdl/sf_video.c +++ b/src/sdl/sf_video.c @@ -1,1134 +1,1134 @@ -#include -#include -#include -//#include - -//#define STATIC - -#include - -#include "generic.h" - -#include "../common/defines.h" -#include "sf_frotz.h" - -static SDL_Rect blitrect = {0,0,0,0}; -static char banner[256]; -static int isfullscreen; -static ulong *sbuffer = NULL; -static int sbpitch; // in longs -static int dirty = 0; -static int bitsperpixel = 32; -static int RBswap = 0; -static int ewidth, eheight; -static SDL_Surface *screen, *off = NULL; -static int mustlockscreen = 0; -int m_timerinterval = 100; - -static void sf_quitconf(); - -// clipping region -static int xmin,xmax,ymin,ymax; - -void sf_setclip( int x, int y, int w, int h) - { - if (x < 0){ w += x; x = 0;} - if (x+w > ewidth) w = ewidth-x; - if (y < 0){ h += y; y = 0;} - if (y+h > eheight) h = eheight-y; - xmin = x; xmax = x+w; - ymin = y; ymax = y+h; - } - -void sf_getclip( int *x, int *y, int *w, int *h) - { - *x = xmin; *y = ymin; - *w = xmax-xmin; *h = ymax-ymin; - } - -static int mywcslen( zchar *b) - { - int n=0; - while (*b++) n++; - return n; - } - -static void myGrefresh(){ - if (off) { - if (mustlockscreen) SDL_LockSurface(screen); - SDL_BlitSurface(off,NULL,screen,&blitrect); - if (mustlockscreen) SDL_UnlockSurface(screen); - } - SDL_UpdateRect(screen,0,0,0,0); - } - -void sf_wpixel( int x, int y, ulong c) - { - if (x < xmin || x >= xmax || y < ymin || y >= ymax) return; - sbuffer[x+sbpitch*y] = c; - dirty = 1; - } - -ulong sf_rpixel( int x, int y) - { - if (x < 0 || x >= ewidth || y < 0 || y >= eheight) return 0; - return sbuffer[x+sbpitch*y]; - } - -#define MAXCUR 64 -static ulong savedcur[MAXCUR]; - -static void drawthecursor( int x, int y, int onoff) - { - SF_textsetting * ts = sf_curtextsetting(); - int i, h = ts->font->height(ts->font); - if (h > MAXCUR) h = MAXCUR; - if (onoff) - { - for (i=0;ifore); - } - } - else - { - for (i=0;i= ZC_ASCII_MIN && c <= ZC_ASCII_MAX) - return true; - if (c >= ZC_LATIN1_MIN && c <= ZC_LATIN1_MAX) - return true; - if (c >= 0x100) - return true; - return false; - } - -void sf_drawcursor( bool c) - { - SF_textsetting * ts = sf_curtextsetting(); - drawthecursor(ts->cx,ts->cy,c); - } - -void sf_chline( int x, int y, ulong c, int n) - { - ulong *s; - if (y < ymin || y >= ymax) return; - if (x < xmin){ n += x-xmin; x = xmin;} - if (x+n > xmax) n = xmax-x; - if (n <= 0) return; - s = sbuffer+x+sbpitch*y; - while (n--) *s++ = c; - dirty = 1; - } - -void sf_cvline( int x, int y, ulong c, int n) - { - ulong *s; - if (x < xmin || x >= xmax) return; - if (y < xmin){ n += y-ymin; y = ymin;} - if (y+n > ymax) n = ymax-y; - if (n <= 0) return; - s = sbuffer+x+sbpitch*y; - while (n--) { *s = c; s += sbpitch;} - dirty = 1; - } - - -ulong sf_blendlinear( int a, ulong s, ulong d){ - ulong r; - r = ((s & 0xff)*a + (d & 0xff)*(256-a))>>8; - s >>= 8; d >>= 8; - r |= (((s & 0xff)*a + (d & 0xff)*(256-a))>>8)<<8; - s >>= 8; d >>= 8; - r |= (((s & 0xff)*a + (d & 0xff)*(256-a))>>8)<<16; - return r; - } - -void sf_writeglyph( SF_glyph *g) - { - SF_textsetting *ts = sf_curtextsetting(); - - int i,j,m; - - int w = g->dx; - int weff = g->xof+g->w; - byte * bmp = (byte *)(&(g->bitmap[0])); - int h = g->h; - int nby = (g->w+7)/8; - int byw = g->w; - - int x = ts->cx; - int y = ts->cy; - - int dxpre = g->xof; - int dypre = ts->font->ascent(ts->font)-h-(int)g->yof; - - int height = ts->font->height(ts->font); - int width; - - ulong color, bc; - - if ((ts->style & REVERSE_STYLE) != 0) - { - bc = ts->fore; - color = ts->back; - } - else - { - color = ts->fore; - bc = ts->back; - } - - // compute size and position of background rect - - if (weff < w) weff = w; - width = weff - ts->oh; - if ((width > 0) && (ts->backTransparent == 0)) - sf_fillrect(bc,x+ts->oh,y,width,height); - - x += dxpre; - y += dypre; - -//printf("\n"); - for (i=0;ifont->antialiased) - for (m=0;m>7)),sval,sf_rpixel(x+xx,y)); - sf_wpixel( x+xx, y, sval); - } - } - xx++; - } - else - for (m=0;mcx += (w); - ts->oh = (weff > w) ? weff-w : 0; - } - - -void sf_fillrect( unsigned long color, int x, int y, int w, int h) - { - ulong *dst; - int i; -//printf("fillrect %x %d %d %d %d\n",color,x,y,w,h); -//printf("dst%p sbpitch%d\n",dst,sbpitch); - if (x < xmin){ w += x-xmin; x = xmin;} - if (x+w > xmax) w = xmax-x; - if (w <= 0) return; - if (y < ymin){ h += y-ymin; y = ymin;} - if (y+h > ymax) h = ymax-y; - if (h <= 0) return; - dst = sbuffer+x+sbpitch*y; - while (h--) - { - for (i=0;icx += ts->oh; - ts->oh = 0; - } - -/* - * os_erase_area - * - * Fill a rectangular area of the screen with the current background - * colour. Top left coordinates are (1,1). The cursor does not move. - * - * The final argument gives the window being changed, -1 if only a - * portion of a window is being erased, or -2 if the whole screen is - * being erased. - * - */ -void os_erase_area(int top, int left, int bottom, int right, int win) - { - sf_flushtext(); - sf_fillrect((sf_curtextsetting())->back,left-1,top-1,right-left+1,bottom-top+1); -// theWnd->FillBackground(CRect(left-1,top-1,right,bottom)); - } - -/* - * os_peek_colour - * - * Return the colour of the screen unit below the cursor. (If the - * interface uses a text mode, it may return the background colour - * of the character at the cursor position instead.) This is used - * when text is printed on top of pictures. Note that this coulor - * need not be in the standard set of Z-machine colours. To handle - * this situation, Frotz entends the colour scheme: Colours above - * 15 (and below 256) may be used by the interface to refer to non - * standard colours. Of course, os_set_colour must be able to deal - * with these colours. - * - */ -int os_peek_colour(void) - { - SF_textsetting *ts = sf_curtextsetting(); - sf_flushtext(); - return sf_GetColourIndex(sf_rpixel(ts->cx,ts->cy)); - } - -static void scroll( int x, int y, int w, int h, int n) - { - ulong *src, *dst; - int nmove, step; - if (n > 0) - { - dst = sbuffer+x+sbpitch*y; - src = dst + n*sbpitch; - nmove = h-n; - step = sbpitch; - } - else if (n < 0) - { - n = -n; - nmove = h-n; - step = -sbpitch; - src = sbuffer+x+sbpitch*(y+nmove-1); - dst = src + n*sbpitch; - } - else - return; - if (nmove > 0) - { - while (nmove--) - { - memcpy(dst,src,w*sizeof(ulong)); - dst += step; - src += step; - } - dirty = 1; - } - } - -void sf_flushdisplay() - { - if (dirty) myGrefresh(); - dirty = 0; - } - -/* - * os_scroll_area - * - * Scroll a rectangular area of the screen up (units > 0) or down - * (units < 0) and fill the empty space with the current background - * colour. Top left coordinates are (1,1). The cursor stays put. - * - */ -void os_scroll_area(int top, int left, int bottom, int right, int units) - { - sf_flushtext(); -// theWnd->ResetOverhang(); - - scroll(left-1,top-1,right-left+1,bottom-top+1,units); - if (units > 0) - sf_fillrect((sf_curtextsetting())->back,left-1,bottom-units,right-left+1,units); - else if (units < 0) - sf_fillrect((sf_curtextsetting())->back,left-1,top-1,right-left+1,units); - -// if (theApp.GetFastScrolling() == false) -// sf_flushdisplay(); -// theWnd->FlushDisplay(); - } - -bool os_repaint_window(int win, int ypos_old, int ypos_new, int xpos, - int ysize, int xsize) -{ - //TODO - return FALSE; -} - - -int SFdticks = 200; -volatile bool SFticked = 0; -static SDL_TimerID timerid = 0; - -static Uint32 mytimer( Uint32 inter, void *parm) - { - SFticked = true; - return inter; - } - -static void cleanvideo() - { - if (timerid) SDL_RemoveTimer(timerid); - SDL_Quit(); - } - -#define RM 0x0000ff -#define GM 0x00ff00 -#define BM 0xff0000 - -static int check( int R, int G, int B){ - if (R==RM && G==GM && B==BM) return 0; - if (R==BM && G==GM && B==RM) return -1; - return 1; - } - -extern char stripped_story_name[]; - -void sf_initvideo( int W, int H, int full) - { - int desired_bpp, needoff, reqW, reqH; - Uint32 video_flags; - SDL_PixelFormat *format; - Uint32 initflags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE | SDL_INIT_TIMER | - SDL_INIT_AUDIO; - - sprintf(banner,"SDL Frotz v%s - %s (z%d)",VERSION, - f_setup.story_name,h_version); - desired_bpp = 32; - video_flags = 0; - - if ( SDL_Init(initflags) < 0 ) { - os_fatal("Couldn't initialize SDL: %s", SDL_GetError()); - } - - CLEANREG(cleanvideo); - - isfullscreen = full; - if (full) video_flags = SDL_FULLSCREEN; - reqW = W; reqH = H; - if (full) - { - if (m_reqW == -1) - { - const SDL_VideoInfo * v = SDL_GetVideoInfo(); - if (v) { m_reqW = v->current_w; m_reqH = v->current_h;} - } - if (m_reqW > reqW) reqW = m_reqW; - if (m_reqH > reqH) reqH = m_reqH; - } - screen = SDL_SetVideoMode( reqW, reqH, desired_bpp, video_flags); - if ( screen == NULL ) { - os_fatal("Couldn't set %dx%dx%d video mode: %s", - reqW, reqH, desired_bpp, SDL_GetError()); - } - SDL_WM_SetCaption(banner,NULL); - bitsperpixel = 32; - - mustlockscreen = SDL_MUSTLOCK(screen); - format = screen->format; - - needoff = (mustlockscreen) || (screen->w != W) || (screen->h != H) || - (format->BitsPerPixel != 24) || - (screen->pitch != 3*W); - - RBswap = 0; - if (!needoff) { - needoff = check(format->Rmask,format->Gmask,format->Bmask); - if ((needoff == -1)){ - RBswap = 1; - needoff = 0; - } - else - needoff = 1; - } -// printf("setvideo: gm %dx%d rq %dx%d(f%d) got %dx%d needoff %d\n", W,H,reqW,reqH,full,screen->w,screen->h,needoff); - - if (needoff) { - sbuffer = calloc(W*H,sizeof(ulong)); - if (!sbuffer){ - os_fatal("Could not create gc"); - } - off = SDL_CreateRGBSurfaceFrom(sbuffer, - W,H,32,4*W,0xff,0xff00,0xff0000,0); -// off = SDL_CreateRGBSurfaceFrom(sbuffer, -// W,H,32,4*screen->w,0xff,0xff00,0xff0000,0); - if (!off){ - os_fatal("Could not create offscreen surface"); - } - } - else { - sbuffer = (ulong *)screen->pixels; - } - - blitrect.w = W; blitrect.h = H; - blitrect.x = (screen->w - W)/2; - blitrect.y = (screen->h - H)/2; - SDL_EnableUNICODE(1); - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); - - SDL_AddTimer(SFdticks,mytimer,NULL); - - xmin = ymin = 0; - xmax = ewidth = W; - ymax = eheight = H; - sbpitch = W; - dirty = 1; - } - -/* - * os_draw_picture - * - * Display a picture at the given coordinates. - * - */ -void os_draw_picture(int picture, int y, int x) - { - int ew, eh, xx, yy, ix, iy, d; - int ox, oy, ow, oh; - Zwindow * winpars; - sf_picture * pic = sf_getpic(picture); - ulong *src, *dst, sval, dval, alpha; - - sf_flushtext(); - - if (!pic) return; - if (!pic->pixels) return; // TODO: rect - src = (ulong *) pic->pixels; - - x--; y--; - ew = m_gfxScale*pic->width; - eh = m_gfxScale*pic->height; - - // this takes care of the fact taht x, y are really 16 bit values - if (x & 0x8000) x |= 0xffff0000; - if (y & 0x8000) y |= 0xffff0000; - - // get current window rect - sf_getclip(&ox,&oy,&ow,&oh); - winpars = curwinrec(); - sf_setclip( winpars->x_pos-1, winpars->y_pos-1, winpars->x_size, winpars->y_size); - - // clip taking into account possible origin - // outside the clipping rect - if (x < xmin) { d = xmin-x; ew -= d; x = xmin; src += d;} - if (x+ew > xmax) ew = xmax - x; - ew /= m_gfxScale; - - if (y < ymin) { d = ymin-y; eh -= d; y = ymin; src += d*pic->width;} - if (y+eh > ymax) eh = ymax-y; - eh /= m_gfxScale; - - sf_setclip(ox,oy,ow,oh); - - if (ew <= 0) return; - if (eh <= 0) return; - - for (yy=0;yy> 24); - if (alpha == 255) - dval = sval & 0xffffff; - else - dval = sf_blend((int)(alpha + (alpha>>7)),sval,dst[0]); - for (iy=0;iywidth; - } - - dirty = 1; - } - -static ulong mytimeout; -int mouse_button; -static int numAltQ = 0; - -static zword goodzkey( SDL_Event *e, int allowed) - { - zword c; - if (e->type == SDL_QUIT) - { - sf_quitconf(); -// if (allowed) return ZC_HKEY_QUIT; - return 0; - } - if (e->type == SDL_MOUSEBUTTONDOWN) - { -//printf("down %d\n",e->button.button); - if (true) //(e->button.button == SDL_BUTTON_LEFT) - { - mouse_button = e->button.button; - mouse_x = e->button.x+1-blitrect.x; - mouse_y = e->button.y+1-blitrect.y; - return ZC_SINGLE_CLICK; - } - return 0; - } - if (e->type != SDL_KEYDOWN) return 0; - // emergency exit - if (((e->key.keysym.mod & 0xfff) == (KMOD_LALT | KMOD_LCTRL)) && (e->key.keysym.sym == 'x')) - os_fatal("Emergency exit!\n\n(Control-Alt-X pressed)"); - if (((e->key.keysym.mod & KMOD_LALT) == KMOD_LALT) || - ((e->key.keysym.mod & KMOD_RALT) == KMOD_RALT)) - { - if (e->key.keysym.sym == 'q') - { - numAltQ++; - if (numAltQ > 2) - os_fatal("Emergency exit!\n\n(Alt-Q pressed 3 times in succession)"); - } - else numAltQ = 0; - if (!allowed) return 0; - switch (e->key.keysym.sym) - { - case 'x': return ZC_HKEY_QUIT; - case 'p': return ZC_HKEY_PLAYBACK; - case 'r': return ZC_HKEY_RECORD; - case 's': return ZC_HKEY_SEED; - case 'u': return ZC_HKEY_UNDO; - case 'n': return ZC_HKEY_RESTART; - case 'd': return ZC_HKEY_DEBUG; - case 'h': return ZC_HKEY_HELP; - default: return 0; - } - } - else numAltQ = 0; - switch (e->key.keysym.sym) - { - case SDLK_INSERT: return (allowed ? VK_INS : 0); - case SDLK_BACKSPACE: return ZC_BACKSPACE; - case SDLK_ESCAPE: return ZC_ESCAPE; - case SDLK_RETURN: return ZC_RETURN; - case SDLK_UP: return ZC_ARROW_UP; - case SDLK_DOWN: return ZC_ARROW_DOWN; - case SDLK_LEFT: return ZC_ARROW_LEFT; - case SDLK_RIGHT: return ZC_ARROW_RIGHT; - case SDLK_TAB: return (allowed ? VK_TAB : 0); - case SDLK_PAGEUP: return (allowed ? VK_PAGE_UP : 0); - case SDLK_PAGEDOWN: return (allowed ? VK_PAGE_DOWN : 0); - case SDLK_KP0: return ZC_NUMPAD_MIN+0; - case SDLK_KP1: return ZC_NUMPAD_MIN+1; - case SDLK_KP2: return ZC_NUMPAD_MIN+2; - case SDLK_KP3: return ZC_NUMPAD_MIN+3; - case SDLK_KP4: return ZC_NUMPAD_MIN+4; - case SDLK_KP5: return ZC_NUMPAD_MIN+5; - case SDLK_KP6: return ZC_NUMPAD_MIN+6; - case SDLK_KP7: return ZC_NUMPAD_MIN+7; - case SDLK_KP8: return ZC_NUMPAD_MIN+8; - case SDLK_KP9: return ZC_NUMPAD_MIN+9; - case SDLK_F1: return ZC_FKEY_MIN+0; - case SDLK_F2: return ZC_FKEY_MIN+1; - case SDLK_F3: return ZC_FKEY_MIN+2; - case SDLK_F4: return ZC_FKEY_MIN+3; - case SDLK_F5: return ZC_FKEY_MIN+4; - case SDLK_F6: return ZC_FKEY_MIN+5; - case SDLK_F7: return ZC_FKEY_MIN+6; - case SDLK_F8: return ZC_FKEY_MIN+7; - case SDLK_F9: return ZC_FKEY_MIN+8; - case SDLK_F10: return ZC_FKEY_MIN+9; - case SDLK_F11: return ZC_FKEY_MIN+10; - case SDLK_F12: return ZC_FKEY_MIN+11; - default: break; - } - c = e->key.keysym.unicode; - if ((c >= 32 && c <= 126) || (c >= 160)) return c; - return 0; - } - -zword sf_read_key( int timeout, int cursor, int allowed) - { - SDL_Event event; - zword inch = 0; - - sf_flushtext(); -// theWnd->ResetOverhang(); -// theWnd->UpdateMenus(); - if (cursor) - sf_drawcursor(true); - sf_flushdisplay(); - - if (timeout) mytimeout = sf_ticks() + m_timerinterval*timeout; -// InputTimer timer(timeout); -// FrotzWnd::Input input; - while (true) - { - // Get the next input - while (SDL_PollEvent(&event)) - { -//if (event.type == SDL_QUIT) printf("got SDL_QUIT\n"); - if ((inch = goodzkey(&event,allowed))) - break; - } - if (inch) break; - if ((timeout) && (sf_ticks() >= mytimeout)) - { - inch = ZC_TIME_OUT; - break; - } - sf_checksound(); - sf_sleep(10); - } - - if (cursor) - sf_drawcursor(false); - - return inch; - } - - -/* - * os_read_key - * - * Read a single character from the keyboard (or a mouse click) and - * return it. Input aborts after timeout/10 seconds. - * - */ -zchar os_read_key(int timeout, int cursor) - { - return sf_read_key(timeout,cursor,0); - } - - -/* - * os_read_line - * - * Read a line of input from the keyboard into a buffer. The buffer - * may already be primed with some text. In this case, the "initial" - * text is already displayed on the screen. After the input action - * is complete, the function returns with the terminating key value. - * The length of the input should not exceed "max" characters plus - * an extra 0 terminator. - * - * Terminating keys are the return key (13) and all function keys - * (see the Specification of the Z-machine) which are accepted by - * the is_terminator function. Mouse clicks behave like function - * keys except that the mouse position is stored in global variables - * "mouse_x" and "mouse_y" (top left coordinates are (1,1)). - * - * Furthermore, Frotz introduces some special terminating keys: - * - * ZC_HKEY_PLAYBACK (Alt-P) - * ZC_HKEY_RECORD (Alt-R) - * ZC_HKEY_SEED (Alt-S) - * ZC_HKEY_UNDO (Alt-U) - * ZC_HKEY_RESTART (Alt-N, "new game") - * ZC_HKEY_QUIT (Alt-X, "exit game") - * ZC_HKEY_DEBUG (Alt-D) - * ZC_HKEY_HELP (Alt-H) - * - * If the timeout argument is not zero, the input gets interrupted - * after timeout/10 seconds (and the return value is 0). - * - * The complete input line including the cursor must fit in "width" - * screen units. - * - * The function may be called once again to continue after timeouts, - * misplaced mouse clicks or hot keys. In this case the "continued" - * flag will be set. This information can be useful if the interface - * implements input line history. - * - * The screen is not scrolled after the return key was pressed. The - * cursor is at the end of the input line when the function returns. - * - * Since Frotz 2.2 the helper function "completion" can be called - * to implement word completion (similar to tcsh under Unix). - * - */ -zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued) -{ - static int pos = 0, searchpos = -1; - int ptx,pty; - int len = mywcslen(buf); - SF_textsetting * ts = sf_curtextsetting(); - SDL_Event event; - - //printf("os_read_line mx%d buf[0]%d tm%d w%d c%d\n",max,buf[0],timeout,width,continued); - // LineInput line; - sf_flushtext(); - // theWnd->ResetOverhang(); - // theWnd->UpdateMenus(); - // theWnd->RecaseInput(buf); - - /* Better be careful here or it might segv. I wonder if we should just - ignore 'continued' and check for len > 0 instead? Might work better - with Beyond Zork. */ - if (!continued || pos > len || searchpos > len) { - pos = len; - gen_history_reset(); /* Reset user's history view. */ - searchpos = -1; /* -1 means initialize from len. */ - } - - // Draw the input line - ptx = ts->cx; - pty = ts->cy; - // CPoint point = theWnd->GetTextPoint(); - ptx -= os_string_width(buf); //theWnd->GetTextWidth(buf,mywcslen(buf)); - sf_DrawInput(buf,pos,ptx,pty,width,true); - - if (timeout) mytimeout = sf_ticks() + m_timerinterval*timeout; - // InputTimer timer(timeout); - while (true) { - // Get the next input - while (SDL_PollEvent(&event)) { - zword c; - if ((c = goodzkey(&event,1))) { - //printf("goodzk %4x\n",c); - switch (c) { - case ZC_BACKSPACE: - // Delete the character to the left of the cursor - if (pos > 0) { - memmove(buf+pos-1,buf+pos,sizeof(zword)*(mywcslen(buf)-pos+1)); - pos--; - sf_DrawInput(buf,pos,ptx,pty,width,true); - } - continue; - case ZC_ESCAPE: /* Delete whole line */ - pos = 0; - buf[0] = '\0'; - searchpos = -1; - gen_history_reset(); - sf_DrawInput(buf,pos,ptx,pty,width,true); - continue; - case VK_TAB: - if (pos == (int)mywcslen(buf)) { - zchar extension[10], *s; - completion(buf,extension); - - // Add the completion to the input stream - for (s = extension; *s != 0; s++) - if (sf_IsValidChar(*s)) - buf[pos++] = (*s); - buf[pos] = 0; - sf_DrawInput(buf,pos,ptx,pty,width,true); - } - continue; - case ZC_ARROW_LEFT: - // Move the cursor left - if (pos > 0) - pos--; - sf_DrawInput(buf,pos,ptx,pty,width,true); - continue; - case ZC_ARROW_RIGHT: - // Move the cursor right - if (pos < (int)mywcslen(buf)) - pos++; - sf_DrawInput(buf,pos,ptx,pty,width,true); - continue; - case ZC_ARROW_UP: - case ZC_ARROW_DOWN: - if (searchpos < 0) - searchpos = mywcslen(buf); - if ((c == ZC_ARROW_UP - ? gen_history_back : gen_history_forward)( - buf, searchpos, max)) { - pos = mywcslen(buf); - sf_DrawInput(buf,pos,ptx,pty,width,true); - } - continue; - /* Pass through as up/down arrows for Beyond Zork. */ - case VK_PAGE_UP: c = ZC_ARROW_UP; break; - case VK_PAGE_DOWN: c = ZC_ARROW_DOWN; break; - default: - if (sf_IsValidChar(c) && mywcslen(buf) < max) { - // Add a valid character to the input line - // Get the width of the new input line - int len = os_string_width(buf); - len += os_char_width(c); - len += os_char_width('0'); - - //printf("l%d w%d p%d\n",len,width,pos); - // Only allow if the width limit is not exceeded - if (len <= width) { - memmove(buf+pos+1,buf+pos,sizeof(zword)*(mywcslen(buf)-pos+1)); - *(buf+pos) = c; - pos++; - sf_DrawInput(buf,pos,ptx,pty,width,true); - } - continue; - } - } - if (is_terminator(c)) { - // Terminate the current input - m_exitPause = false; - sf_DrawInput(buf,pos,ptx,pty,width,false); - - if ((c == ZC_SINGLE_CLICK) || (c == ZC_DOUBLE_CLICK)) { - /* mouse_x = input.mousex+1; - mouse_y = input.mousey+1;*/ - } else if (c == ZC_RETURN) - gen_add_to_history(buf); - // theWnd->SetLastInput(buf); - return c; - } - } - } - if ((timeout) && (sf_ticks() >= mytimeout)) { - return ZC_TIME_OUT; - } - sf_checksound(); - sf_sleep(10); - } - - return 0; -} - -// Draw the current input line -void sf_DrawInput(zchar * buffer, int pos, int ptx, int pty, int width, bool cursor) - { - int height; - SF_textsetting * ts = sf_curtextsetting(); - -//printf("DrawInput (%d)[%d] %d x%d y%d w%d %d\n",mywcslen(buffer),os_string_width(buffer),pos,ptx,pty,width,cursor); - - height = ts->font->height(ts->font); - - // Remove any previous input - sf_fillrect(ts->back,ptx,pty,width,height); - - // Display the input -// sf_pushtextsettings(); - ts->cx = ptx; ts->cy = pty; - os_display_string(buffer); - - if (cursor) - { - int wid=0, i=0, oh; - while (iGetMenuClick(); -//printf("%04x\n",c); - // Get the mouse buttons - if (c & SDL_BUTTON_LMASK) - btn |= 1; - if (c & SDL_BUTTON_RMASK) - btn |= 2; - if (c & SDL_BUTTON_MMASK) - btn |= 4; - - return btn; - } - -/* - * os_more_prompt - * - * Display a MORE prompt, wait for a keypress and remove the MORE - * prompt from the screen. - * - */ -void os_more_prompt(void) - { - if (m_morePrompts) - { - SF_textsetting * ts; int x,y,h; - const char *p = sf_msgstring(IDS_MORE); - sf_flushtext(); -// theWnd->ResetOverhang(); - - // Save the current text position - sf_pushtextsettings(); - ts = sf_curtextsetting(); - x = ts->cx; y = ts->cy; - h = ts->font->height(ts->font); - // Show a [More] prompt - while (*p) os_display_char((zword)(*p++)); -// theWnd->WriteText(CResString(IDS_MORE)); -// sf_drawcursor(true); -// sf_flushdisplay(); - - // Wait for a key press - os_read_key(0,1); - // Remove the [More] prompt - sf_fillrect(ts->back,x,y,ts->cx-x,h); -// sf_drawcursor(false); - - // Restore the current text position - sf_poptextsettings(); - } -} - -ulong * sf_savearea( int x, int y, int w, int h) - { - ulong *r, *p, *s; int i; - - if (x < 0){ w += x; x = 0;} - if (x+w > ewidth) w = ewidth-x; - if (w <= 0) return NULL; - - if (y < 0){ h += y; y = 0;} - if (y+h > eheight) h = eheight-y; - if (h <= 0) return NULL; - - r = p = malloc((w*h+4)*sizeof(ulong)); - if (!r) return NULL; - - *p++ = x; - *p++ = y; - *p++ = w; - *p++ = h; - - s = sbuffer+x+y*sbpitch; - for (i=0;i +#include +#include +//#include + +//#define STATIC + +#include + +#include "generic.h" + +#include "../common/defines.h" +#include "sf_frotz.h" + +static SDL_Rect blitrect = {0,0,0,0}; +static char banner[256]; +static int isfullscreen; +static ulong *sbuffer = NULL; +static int sbpitch; // in longs +static int dirty = 0; +static int bitsperpixel = 32; +static int RBswap = 0; +static int ewidth, eheight; +static SDL_Surface *screen, *off = NULL; +static int mustlockscreen = 0; +int m_timerinterval = 100; + +static void sf_quitconf(); + +// clipping region +static int xmin,xmax,ymin,ymax; + +void sf_setclip( int x, int y, int w, int h) + { + if (x < 0){ w += x; x = 0;} + if (x+w > ewidth) w = ewidth-x; + if (y < 0){ h += y; y = 0;} + if (y+h > eheight) h = eheight-y; + xmin = x; xmax = x+w; + ymin = y; ymax = y+h; + } + +void sf_getclip( int *x, int *y, int *w, int *h) + { + *x = xmin; *y = ymin; + *w = xmax-xmin; *h = ymax-ymin; + } + +static int mywcslen( zchar *b) + { + int n=0; + while (*b++) n++; + return n; + } + +static void myGrefresh(){ + if (off) { + if (mustlockscreen) SDL_LockSurface(screen); + SDL_BlitSurface(off,NULL,screen,&blitrect); + if (mustlockscreen) SDL_UnlockSurface(screen); + } + SDL_UpdateRect(screen,0,0,0,0); + } + +void sf_wpixel( int x, int y, ulong c) + { + if (x < xmin || x >= xmax || y < ymin || y >= ymax) return; + sbuffer[x+sbpitch*y] = c; + dirty = 1; + } + +ulong sf_rpixel( int x, int y) + { + if (x < 0 || x >= ewidth || y < 0 || y >= eheight) return 0; + return sbuffer[x+sbpitch*y]; + } + +#define MAXCUR 64 +static ulong savedcur[MAXCUR]; + +static void drawthecursor( int x, int y, int onoff) + { + SF_textsetting * ts = sf_curtextsetting(); + int i, h = ts->font->height(ts->font); + if (h > MAXCUR) h = MAXCUR; + if (onoff) + { + for (i=0;ifore); + } + } + else + { + for (i=0;i= ZC_ASCII_MIN && c <= ZC_ASCII_MAX) + return true; + if (c >= ZC_LATIN1_MIN && c <= ZC_LATIN1_MAX) + return true; + if (c >= 0x100) + return true; + return false; + } + +void sf_drawcursor( bool c) + { + SF_textsetting * ts = sf_curtextsetting(); + drawthecursor(ts->cx,ts->cy,c); + } + +void sf_chline( int x, int y, ulong c, int n) + { + ulong *s; + if (y < ymin || y >= ymax) return; + if (x < xmin){ n += x-xmin; x = xmin;} + if (x+n > xmax) n = xmax-x; + if (n <= 0) return; + s = sbuffer+x+sbpitch*y; + while (n--) *s++ = c; + dirty = 1; + } + +void sf_cvline( int x, int y, ulong c, int n) + { + ulong *s; + if (x < xmin || x >= xmax) return; + if (y < xmin){ n += y-ymin; y = ymin;} + if (y+n > ymax) n = ymax-y; + if (n <= 0) return; + s = sbuffer+x+sbpitch*y; + while (n--) { *s = c; s += sbpitch;} + dirty = 1; + } + + +ulong sf_blendlinear( int a, ulong s, ulong d){ + ulong r; + r = ((s & 0xff)*a + (d & 0xff)*(256-a))>>8; + s >>= 8; d >>= 8; + r |= (((s & 0xff)*a + (d & 0xff)*(256-a))>>8)<<8; + s >>= 8; d >>= 8; + r |= (((s & 0xff)*a + (d & 0xff)*(256-a))>>8)<<16; + return r; + } + +void sf_writeglyph( SF_glyph *g) + { + SF_textsetting *ts = sf_curtextsetting(); + + int i,j,m; + + int w = g->dx; + int weff = g->xof+g->w; + byte * bmp = (byte *)(&(g->bitmap[0])); + int h = g->h; + int nby = (g->w+7)/8; + int byw = g->w; + + int x = ts->cx; + int y = ts->cy; + + int dxpre = g->xof; + int dypre = ts->font->ascent(ts->font)-h-(int)g->yof; + + int height = ts->font->height(ts->font); + int width; + + ulong color, bc; + + if ((ts->style & REVERSE_STYLE) != 0) + { + bc = ts->fore; + color = ts->back; + } + else + { + color = ts->fore; + bc = ts->back; + } + + // compute size and position of background rect + + if (weff < w) weff = w; + width = weff - ts->oh; + if ((width > 0) && (ts->backTransparent == 0)) + sf_fillrect(bc,x+ts->oh,y,width,height); + + x += dxpre; + y += dypre; + +//printf("\n"); + for (i=0;ifont->antialiased) + for (m=0;m>7)),sval,sf_rpixel(x+xx,y)); + sf_wpixel( x+xx, y, sval); + } + } + xx++; + } + else + for (m=0;mcx += (w); + ts->oh = (weff > w) ? weff-w : 0; + } + + +void sf_fillrect( unsigned long color, int x, int y, int w, int h) + { + ulong *dst; + int i; +//printf("fillrect %x %d %d %d %d\n",color,x,y,w,h); +//printf("dst%p sbpitch%d\n",dst,sbpitch); + if (x < xmin){ w += x-xmin; x = xmin;} + if (x+w > xmax) w = xmax-x; + if (w <= 0) return; + if (y < ymin){ h += y-ymin; y = ymin;} + if (y+h > ymax) h = ymax-y; + if (h <= 0) return; + dst = sbuffer+x+sbpitch*y; + while (h--) + { + for (i=0;icx += ts->oh; + ts->oh = 0; + } + +/* + * os_erase_area + * + * Fill a rectangular area of the screen with the current background + * colour. Top left coordinates are (1,1). The cursor does not move. + * + * The final argument gives the window being changed, -1 if only a + * portion of a window is being erased, or -2 if the whole screen is + * being erased. + * + */ +void os_erase_area(int top, int left, int bottom, int right, int win) + { + sf_flushtext(); + sf_fillrect((sf_curtextsetting())->back,left-1,top-1,right-left+1,bottom-top+1); +// theWnd->FillBackground(CRect(left-1,top-1,right,bottom)); + } + +/* + * os_peek_colour + * + * Return the colour of the screen unit below the cursor. (If the + * interface uses a text mode, it may return the background colour + * of the character at the cursor position instead.) This is used + * when text is printed on top of pictures. Note that this coulor + * need not be in the standard set of Z-machine colours. To handle + * this situation, Frotz entends the colour scheme: Colours above + * 15 (and below 256) may be used by the interface to refer to non + * standard colours. Of course, os_set_colour must be able to deal + * with these colours. + * + */ +int os_peek_colour(void) + { + SF_textsetting *ts = sf_curtextsetting(); + sf_flushtext(); + return sf_GetColourIndex(sf_rpixel(ts->cx,ts->cy)); + } + +static void scroll( int x, int y, int w, int h, int n) + { + ulong *src, *dst; + int nmove, step; + if (n > 0) + { + dst = sbuffer+x+sbpitch*y; + src = dst + n*sbpitch; + nmove = h-n; + step = sbpitch; + } + else if (n < 0) + { + n = -n; + nmove = h-n; + step = -sbpitch; + src = sbuffer+x+sbpitch*(y+nmove-1); + dst = src + n*sbpitch; + } + else + return; + if (nmove > 0) + { + while (nmove--) + { + memcpy(dst,src,w*sizeof(ulong)); + dst += step; + src += step; + } + dirty = 1; + } + } + +void sf_flushdisplay() + { + if (dirty) myGrefresh(); + dirty = 0; + } + +/* + * os_scroll_area + * + * Scroll a rectangular area of the screen up (units > 0) or down + * (units < 0) and fill the empty space with the current background + * colour. Top left coordinates are (1,1). The cursor stays put. + * + */ +void os_scroll_area(int top, int left, int bottom, int right, int units) + { + sf_flushtext(); +// theWnd->ResetOverhang(); + + scroll(left-1,top-1,right-left+1,bottom-top+1,units); + if (units > 0) + sf_fillrect((sf_curtextsetting())->back,left-1,bottom-units,right-left+1,units); + else if (units < 0) + sf_fillrect((sf_curtextsetting())->back,left-1,top-1,right-left+1,units); + +// if (theApp.GetFastScrolling() == false) +// sf_flushdisplay(); +// theWnd->FlushDisplay(); + } + +bool os_repaint_window(int win, int ypos_old, int ypos_new, int xpos, + int ysize, int xsize) +{ + //TODO + return FALSE; +} + + +int SFdticks = 200; +volatile bool SFticked = 0; +static SDL_TimerID timerid = 0; + +static Uint32 mytimer( Uint32 inter, void *parm) + { + SFticked = true; + return inter; + } + +static void cleanvideo() + { + if (timerid) SDL_RemoveTimer(timerid); + SDL_Quit(); + } + +#define RM 0x0000ff +#define GM 0x00ff00 +#define BM 0xff0000 + +static int check( int R, int G, int B){ + if (R==RM && G==GM && B==BM) return 0; + if (R==BM && G==GM && B==RM) return -1; + return 1; + } + +extern char stripped_story_name[]; + +void sf_initvideo( int W, int H, int full) + { + int desired_bpp, needoff, reqW, reqH; + Uint32 video_flags; + SDL_PixelFormat *format; + Uint32 initflags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE | SDL_INIT_TIMER | + SDL_INIT_AUDIO; + + sprintf(banner,"SDL Frotz v%s - %s (z%d)",VERSION, + f_setup.story_name,h_version); + desired_bpp = 32; + video_flags = 0; + + if ( SDL_Init(initflags) < 0 ) { + os_fatal("Couldn't initialize SDL: %s", SDL_GetError()); + } + + CLEANREG(cleanvideo); + + isfullscreen = full; + if (full) video_flags = SDL_FULLSCREEN; + reqW = W; reqH = H; + if (full) + { + if (m_reqW == -1) + { + const SDL_VideoInfo * v = SDL_GetVideoInfo(); + if (v) { m_reqW = v->current_w; m_reqH = v->current_h;} + } + if (m_reqW > reqW) reqW = m_reqW; + if (m_reqH > reqH) reqH = m_reqH; + } + screen = SDL_SetVideoMode( reqW, reqH, desired_bpp, video_flags); + if ( screen == NULL ) { + os_fatal("Couldn't set %dx%dx%d video mode: %s", + reqW, reqH, desired_bpp, SDL_GetError()); + } + SDL_WM_SetCaption(banner,NULL); + bitsperpixel = 32; + + mustlockscreen = SDL_MUSTLOCK(screen); + format = screen->format; + + needoff = (mustlockscreen) || (screen->w != W) || (screen->h != H) || + (format->BitsPerPixel != 24) || + (screen->pitch != 3*W); + + RBswap = 0; + if (!needoff) { + needoff = check(format->Rmask,format->Gmask,format->Bmask); + if ((needoff == -1)){ + RBswap = 1; + needoff = 0; + } + else + needoff = 1; + } +// printf("setvideo: gm %dx%d rq %dx%d(f%d) got %dx%d needoff %d\n", W,H,reqW,reqH,full,screen->w,screen->h,needoff); + + if (needoff) { + sbuffer = calloc(W*H,sizeof(ulong)); + if (!sbuffer){ + os_fatal("Could not create gc"); + } + off = SDL_CreateRGBSurfaceFrom(sbuffer, + W,H,32,4*W,0xff,0xff00,0xff0000,0); +// off = SDL_CreateRGBSurfaceFrom(sbuffer, +// W,H,32,4*screen->w,0xff,0xff00,0xff0000,0); + if (!off){ + os_fatal("Could not create offscreen surface"); + } + } + else { + sbuffer = (ulong *)screen->pixels; + } + + blitrect.w = W; blitrect.h = H; + blitrect.x = (screen->w - W)/2; + blitrect.y = (screen->h - H)/2; + SDL_EnableUNICODE(1); + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + + SDL_AddTimer(SFdticks,mytimer,NULL); + + xmin = ymin = 0; + xmax = ewidth = W; + ymax = eheight = H; + sbpitch = W; + dirty = 1; + } + +/* + * os_draw_picture + * + * Display a picture at the given coordinates. + * + */ +void os_draw_picture(int picture, int y, int x) + { + int ew, eh, xx, yy, ix, iy, d; + int ox, oy, ow, oh; + Zwindow * winpars; + sf_picture * pic = sf_getpic(picture); + ulong *src, *dst, sval, dval, alpha; + + sf_flushtext(); + + if (!pic) return; + if (!pic->pixels) return; // TODO: rect + src = (ulong *) pic->pixels; + + x--; y--; + ew = m_gfxScale*pic->width; + eh = m_gfxScale*pic->height; + + // this takes care of the fact taht x, y are really 16 bit values + if (x & 0x8000) x |= 0xffff0000; + if (y & 0x8000) y |= 0xffff0000; + + // get current window rect + sf_getclip(&ox,&oy,&ow,&oh); + winpars = curwinrec(); + sf_setclip( winpars->x_pos-1, winpars->y_pos-1, winpars->x_size, winpars->y_size); + + // clip taking into account possible origin + // outside the clipping rect + if (x < xmin) { d = xmin-x; ew -= d; x = xmin; src += d;} + if (x+ew > xmax) ew = xmax - x; + ew /= m_gfxScale; + + if (y < ymin) { d = ymin-y; eh -= d; y = ymin; src += d*pic->width;} + if (y+eh > ymax) eh = ymax-y; + eh /= m_gfxScale; + + sf_setclip(ox,oy,ow,oh); + + if (ew <= 0) return; + if (eh <= 0) return; + + for (yy=0;yy> 24); + if (alpha == 255) + dval = sval & 0xffffff; + else + dval = sf_blend((int)(alpha + (alpha>>7)),sval,dst[0]); + for (iy=0;iywidth; + } + + dirty = 1; + } + +static ulong mytimeout; +int mouse_button; +static int numAltQ = 0; + +static zword goodzkey( SDL_Event *e, int allowed) + { + zword c; + if (e->type == SDL_QUIT) + { + sf_quitconf(); +// if (allowed) return ZC_HKEY_QUIT; + return 0; + } + if (e->type == SDL_MOUSEBUTTONDOWN) + { +//printf("down %d\n",e->button.button); + if (true) //(e->button.button == SDL_BUTTON_LEFT) + { + mouse_button = e->button.button; + mouse_x = e->button.x+1-blitrect.x; + mouse_y = e->button.y+1-blitrect.y; + return ZC_SINGLE_CLICK; + } + return 0; + } + if (e->type != SDL_KEYDOWN) return 0; + // emergency exit + if (((e->key.keysym.mod & 0xfff) == (KMOD_LALT | KMOD_LCTRL)) && (e->key.keysym.sym == 'x')) + os_fatal("Emergency exit!\n\n(Control-Alt-X pressed)"); + if (((e->key.keysym.mod & KMOD_LALT) == KMOD_LALT) || + ((e->key.keysym.mod & KMOD_RALT) == KMOD_RALT)) + { + if (e->key.keysym.sym == 'q') + { + numAltQ++; + if (numAltQ > 2) + os_fatal("Emergency exit!\n\n(Alt-Q pressed 3 times in succession)"); + } + else numAltQ = 0; + if (!allowed) return 0; + switch (e->key.keysym.sym) + { + case 'x': return ZC_HKEY_QUIT; + case 'p': return ZC_HKEY_PLAYBACK; + case 'r': return ZC_HKEY_RECORD; + case 's': return ZC_HKEY_SEED; + case 'u': return ZC_HKEY_UNDO; + case 'n': return ZC_HKEY_RESTART; + case 'd': return ZC_HKEY_DEBUG; + case 'h': return ZC_HKEY_HELP; + default: return 0; + } + } + else numAltQ = 0; + switch (e->key.keysym.sym) + { + case SDLK_INSERT: return (allowed ? VK_INS : 0); + case SDLK_BACKSPACE: return ZC_BACKSPACE; + case SDLK_ESCAPE: return ZC_ESCAPE; + case SDLK_RETURN: return ZC_RETURN; + case SDLK_UP: return ZC_ARROW_UP; + case SDLK_DOWN: return ZC_ARROW_DOWN; + case SDLK_LEFT: return ZC_ARROW_LEFT; + case SDLK_RIGHT: return ZC_ARROW_RIGHT; + case SDLK_TAB: return (allowed ? VK_TAB : 0); + case SDLK_PAGEUP: return (allowed ? VK_PAGE_UP : 0); + case SDLK_PAGEDOWN: return (allowed ? VK_PAGE_DOWN : 0); + case SDLK_KP0: return ZC_NUMPAD_MIN+0; + case SDLK_KP1: return ZC_NUMPAD_MIN+1; + case SDLK_KP2: return ZC_NUMPAD_MIN+2; + case SDLK_KP3: return ZC_NUMPAD_MIN+3; + case SDLK_KP4: return ZC_NUMPAD_MIN+4; + case SDLK_KP5: return ZC_NUMPAD_MIN+5; + case SDLK_KP6: return ZC_NUMPAD_MIN+6; + case SDLK_KP7: return ZC_NUMPAD_MIN+7; + case SDLK_KP8: return ZC_NUMPAD_MIN+8; + case SDLK_KP9: return ZC_NUMPAD_MIN+9; + case SDLK_F1: return ZC_FKEY_MIN+0; + case SDLK_F2: return ZC_FKEY_MIN+1; + case SDLK_F3: return ZC_FKEY_MIN+2; + case SDLK_F4: return ZC_FKEY_MIN+3; + case SDLK_F5: return ZC_FKEY_MIN+4; + case SDLK_F6: return ZC_FKEY_MIN+5; + case SDLK_F7: return ZC_FKEY_MIN+6; + case SDLK_F8: return ZC_FKEY_MIN+7; + case SDLK_F9: return ZC_FKEY_MIN+8; + case SDLK_F10: return ZC_FKEY_MIN+9; + case SDLK_F11: return ZC_FKEY_MIN+10; + case SDLK_F12: return ZC_FKEY_MIN+11; + default: break; + } + c = e->key.keysym.unicode; + if ((c >= 32 && c <= 126) || (c >= 160)) return c; + return 0; + } + +zword sf_read_key( int timeout, int cursor, int allowed) + { + SDL_Event event; + zword inch = 0; + + sf_flushtext(); +// theWnd->ResetOverhang(); +// theWnd->UpdateMenus(); + if (cursor) + sf_drawcursor(true); + sf_flushdisplay(); + + if (timeout) mytimeout = sf_ticks() + m_timerinterval*timeout; +// InputTimer timer(timeout); +// FrotzWnd::Input input; + while (true) + { + // Get the next input + while (SDL_PollEvent(&event)) + { +//if (event.type == SDL_QUIT) printf("got SDL_QUIT\n"); + if ((inch = goodzkey(&event,allowed))) + break; + } + if (inch) break; + if ((timeout) && (sf_ticks() >= mytimeout)) + { + inch = ZC_TIME_OUT; + break; + } + sf_checksound(); + sf_sleep(10); + } + + if (cursor) + sf_drawcursor(false); + + return inch; + } + + +/* + * os_read_key + * + * Read a single character from the keyboard (or a mouse click) and + * return it. Input aborts after timeout/10 seconds. + * + */ +zchar os_read_key(int timeout, int cursor) + { + return sf_read_key(timeout,cursor,0); + } + + +/* + * os_read_line + * + * Read a line of input from the keyboard into a buffer. The buffer + * may already be primed with some text. In this case, the "initial" + * text is already displayed on the screen. After the input action + * is complete, the function returns with the terminating key value. + * The length of the input should not exceed "max" characters plus + * an extra 0 terminator. + * + * Terminating keys are the return key (13) and all function keys + * (see the Specification of the Z-machine) which are accepted by + * the is_terminator function. Mouse clicks behave like function + * keys except that the mouse position is stored in global variables + * "mouse_x" and "mouse_y" (top left coordinates are (1,1)). + * + * Furthermore, Frotz introduces some special terminating keys: + * + * ZC_HKEY_PLAYBACK (Alt-P) + * ZC_HKEY_RECORD (Alt-R) + * ZC_HKEY_SEED (Alt-S) + * ZC_HKEY_UNDO (Alt-U) + * ZC_HKEY_RESTART (Alt-N, "new game") + * ZC_HKEY_QUIT (Alt-X, "exit game") + * ZC_HKEY_DEBUG (Alt-D) + * ZC_HKEY_HELP (Alt-H) + * + * If the timeout argument is not zero, the input gets interrupted + * after timeout/10 seconds (and the return value is 0). + * + * The complete input line including the cursor must fit in "width" + * screen units. + * + * The function may be called once again to continue after timeouts, + * misplaced mouse clicks or hot keys. In this case the "continued" + * flag will be set. This information can be useful if the interface + * implements input line history. + * + * The screen is not scrolled after the return key was pressed. The + * cursor is at the end of the input line when the function returns. + * + * Since Frotz 2.2 the helper function "completion" can be called + * to implement word completion (similar to tcsh under Unix). + * + */ +zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued) +{ + static int pos = 0, searchpos = -1; + int ptx,pty; + int len = mywcslen(buf); + SF_textsetting * ts = sf_curtextsetting(); + SDL_Event event; + + //printf("os_read_line mx%d buf[0]%d tm%d w%d c%d\n",max,buf[0],timeout,width,continued); + // LineInput line; + sf_flushtext(); + // theWnd->ResetOverhang(); + // theWnd->UpdateMenus(); + // theWnd->RecaseInput(buf); + + /* Better be careful here or it might segv. I wonder if we should just + ignore 'continued' and check for len > 0 instead? Might work better + with Beyond Zork. */ + if (!continued || pos > len || searchpos > len) { + pos = len; + gen_history_reset(); /* Reset user's history view. */ + searchpos = -1; /* -1 means initialize from len. */ + } + + // Draw the input line + ptx = ts->cx; + pty = ts->cy; + // CPoint point = theWnd->GetTextPoint(); + ptx -= os_string_width(buf); //theWnd->GetTextWidth(buf,mywcslen(buf)); + sf_DrawInput(buf,pos,ptx,pty,width,true); + + if (timeout) mytimeout = sf_ticks() + m_timerinterval*timeout; + // InputTimer timer(timeout); + while (true) { + // Get the next input + while (SDL_PollEvent(&event)) { + zword c; + if ((c = goodzkey(&event,1))) { + //printf("goodzk %4x\n",c); + switch (c) { + case ZC_BACKSPACE: + // Delete the character to the left of the cursor + if (pos > 0) { + memmove(buf+pos-1,buf+pos,sizeof(zword)*(mywcslen(buf)-pos+1)); + pos--; + sf_DrawInput(buf,pos,ptx,pty,width,true); + } + continue; + case ZC_ESCAPE: /* Delete whole line */ + pos = 0; + buf[0] = '\0'; + searchpos = -1; + gen_history_reset(); + sf_DrawInput(buf,pos,ptx,pty,width,true); + continue; + case VK_TAB: + if (pos == (int)mywcslen(buf)) { + zchar extension[10], *s; + completion(buf,extension); + + // Add the completion to the input stream + for (s = extension; *s != 0; s++) + if (sf_IsValidChar(*s)) + buf[pos++] = (*s); + buf[pos] = 0; + sf_DrawInput(buf,pos,ptx,pty,width,true); + } + continue; + case ZC_ARROW_LEFT: + // Move the cursor left + if (pos > 0) + pos--; + sf_DrawInput(buf,pos,ptx,pty,width,true); + continue; + case ZC_ARROW_RIGHT: + // Move the cursor right + if (pos < (int)mywcslen(buf)) + pos++; + sf_DrawInput(buf,pos,ptx,pty,width,true); + continue; + case ZC_ARROW_UP: + case ZC_ARROW_DOWN: + if (searchpos < 0) + searchpos = mywcslen(buf); + if ((c == ZC_ARROW_UP + ? gen_history_back : gen_history_forward)( + buf, searchpos, max)) { + pos = mywcslen(buf); + sf_DrawInput(buf,pos,ptx,pty,width,true); + } + continue; + /* Pass through as up/down arrows for Beyond Zork. */ + case VK_PAGE_UP: c = ZC_ARROW_UP; break; + case VK_PAGE_DOWN: c = ZC_ARROW_DOWN; break; + default: + if (sf_IsValidChar(c) && mywcslen(buf) < max) { + // Add a valid character to the input line + // Get the width of the new input line + int len = os_string_width(buf); + len += os_char_width(c); + len += os_char_width('0'); + + //printf("l%d w%d p%d\n",len,width,pos); + // Only allow if the width limit is not exceeded + if (len <= width) { + memmove(buf+pos+1,buf+pos,sizeof(zword)*(mywcslen(buf)-pos+1)); + *(buf+pos) = c; + pos++; + sf_DrawInput(buf,pos,ptx,pty,width,true); + } + continue; + } + } + if (is_terminator(c)) { + // Terminate the current input + m_exitPause = false; + sf_DrawInput(buf,pos,ptx,pty,width,false); + + if ((c == ZC_SINGLE_CLICK) || (c == ZC_DOUBLE_CLICK)) { + /* mouse_x = input.mousex+1; + mouse_y = input.mousey+1;*/ + } else if (c == ZC_RETURN) + gen_add_to_history(buf); + // theWnd->SetLastInput(buf); + return c; + } + } + } + if ((timeout) && (sf_ticks() >= mytimeout)) { + return ZC_TIME_OUT; + } + sf_checksound(); + sf_sleep(10); + } + + return 0; +} + +// Draw the current input line +void sf_DrawInput(zchar * buffer, int pos, int ptx, int pty, int width, bool cursor) + { + int height; + SF_textsetting * ts = sf_curtextsetting(); + +//printf("DrawInput (%d)[%d] %d x%d y%d w%d %d\n",mywcslen(buffer),os_string_width(buffer),pos,ptx,pty,width,cursor); + + height = ts->font->height(ts->font); + + // Remove any previous input + sf_fillrect(ts->back,ptx,pty,width,height); + + // Display the input +// sf_pushtextsettings(); + ts->cx = ptx; ts->cy = pty; + os_display_string(buffer); + + if (cursor) + { + int wid=0, i=0, oh; + while (iGetMenuClick(); +//printf("%04x\n",c); + // Get the mouse buttons + if (c & SDL_BUTTON_LMASK) + btn |= 1; + if (c & SDL_BUTTON_RMASK) + btn |= 2; + if (c & SDL_BUTTON_MMASK) + btn |= 4; + + return btn; + } + +/* + * os_more_prompt + * + * Display a MORE prompt, wait for a keypress and remove the MORE + * prompt from the screen. + * + */ +void os_more_prompt(void) + { + if (m_morePrompts) + { + SF_textsetting * ts; int x,y,h; + const char *p = sf_msgstring(IDS_MORE); + sf_flushtext(); +// theWnd->ResetOverhang(); + + // Save the current text position + sf_pushtextsettings(); + ts = sf_curtextsetting(); + x = ts->cx; y = ts->cy; + h = ts->font->height(ts->font); + // Show a [More] prompt + while (*p) os_display_char((zword)(*p++)); +// theWnd->WriteText(CResString(IDS_MORE)); +// sf_drawcursor(true); +// sf_flushdisplay(); + + // Wait for a key press + os_read_key(0,1); + // Remove the [More] prompt + sf_fillrect(ts->back,x,y,ts->cx-x,h); +// sf_drawcursor(false); + + // Restore the current text position + sf_poptextsettings(); + } +} + +ulong * sf_savearea( int x, int y, int w, int h) + { + ulong *r, *p, *s; int i; + + if (x < 0){ w += x; x = 0;} + if (x+w > ewidth) w = ewidth-x; + if (w <= 0) return NULL; + + if (y < 0){ h += y; y = 0;} + if (y+h > eheight) h = eheight-y; + if (h <= 0) return NULL; + + r = p = malloc((w*h+4)*sizeof(ulong)); + if (!r) return NULL; + + *p++ = x; + *p++ = y; + *p++ = w; + *p++ = h; + + s = sbuffer+x+y*sbpitch; + for (i=0;i