onscripter-20150820/0000755017777601777760000000000012565174244014000 5ustar nobodynogrouponscripter-20150820/ONScripter_text.cpp0000644017777601777760000010771212565174244017610 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_text.cpp - Text parser of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" extern unsigned short convSJIS2UTF16( unsigned short in ); #define IS_ROTATION_REQUIRED(x) \ (!IS_TWO_BYTE(*(x)) || \ (*(x) == (char)0x81 && *((x)+1) == (char)0x50) || \ (*(x) == (char)0x81 && *((x)+1) == (char)0x51) || \ (*(x) == (char)0x81 && *((x)+1) >= 0x5b && *((x)+1) <= 0x5d) || \ (*(x) == (char)0x81 && *((x)+1) >= 0x60 && *((x)+1) <= 0x64) || \ (*(x) == (char)0x81 && *((x)+1) >= 0x69 && *((x)+1) <= 0x7a) || \ (*(x) == (char)0x81 && *((x)+1) == (char)0x80) ) #define IS_TRANSLATION_REQUIRED(x) \ ( *(x) == (char)0x81 && *((x)+1) >= 0x41 && *((x)+1) <= 0x44 ) void ONScripter::shiftHalfPixelX(SDL_Surface *surface) { SDL_LockSurface( surface ); unsigned char *buf = (unsigned char*)surface->pixels; for (int i=surface->h ; i!=0 ; i--){ unsigned char c = buf[0]; for (int j=1 ; jw ; j++){ buf[j-1] = (buf[j]+c)>>1; c = buf[j]; } buf[surface->w-1] = c>>1; buf += surface->pitch; } SDL_UnlockSurface( surface ); } void ONScripter::shiftHalfPixelY(SDL_Surface *surface) { SDL_LockSurface( surface ); for (int j=surface->w-1 ; j>=0 ; j--){ unsigned char *buf = (unsigned char*)surface->pixels + j; unsigned char c = buf[0]; for (int i=1 ; ih ; i++){ buf += surface->pitch; *(buf-surface->pitch) = (*buf+c)>>1; c = *buf; } *buf = c>>1; } SDL_UnlockSurface( surface ); } void ONScripter::drawGlyph( SDL_Surface *dst_surface, FontInfo *info, SDL_Color &color, char* text, int xy[2], bool shadow_flag, AnimationInfo *cache_info, SDL_Rect *clip, SDL_Rect &dst_rect ) { unsigned short unicode; if (IS_TWO_BYTE(text[0])){ unsigned index = ((unsigned char*)text)[0]; index = index << 8 | ((unsigned char*)text)[1]; unicode = convSJIS2UTF16( index ); } else{ if ((text[0] & 0xe0) == 0xa0 || (text[0] & 0xe0) == 0xc0) unicode = ((unsigned char*)text)[0] - 0xa0 + 0xff60; else unicode = text[0]; } int minx, maxx, miny, maxy, advanced; #if 0 if (TTF_GetFontStyle( (TTF_Font*)info->ttf_font[0] ) != (info->is_bold?TTF_STYLE_BOLD:TTF_STYLE_NORMAL) ) TTF_SetFontStyle( (TTF_Font*)info->ttf_font[0], (info->is_bold?TTF_STYLE_BOLD:TTF_STYLE_NORMAL)); #endif TTF_GlyphMetrics( (TTF_Font*)info->ttf_font[0], unicode, &minx, &maxx, &miny, &maxy, &advanced ); //printf("min %d %d %d %d %d %d\n", minx, maxx, miny, maxy, advanced,TTF_FontAscent((TTF_Font*)info->ttf_font[0]) ); static SDL_Color fcol={0xff, 0xff, 0xff}, bcol={0, 0, 0}; SDL_Surface *tmp_surface = TTF_RenderGlyph_Shaded((TTF_Font*)info->ttf_font[0], unicode, fcol, bcol); SDL_Surface *tmp_surface_s = tmp_surface; if (shadow_flag && render_font_outline){ tmp_surface_s = TTF_RenderGlyph_Shaded((TTF_Font*)info->ttf_font[1], unicode, fcol, bcol); if (tmp_surface && tmp_surface_s){ if ((tmp_surface_s->w-tmp_surface->w) & 1) shiftHalfPixelX(tmp_surface_s); if ((tmp_surface_s->h-tmp_surface->h) & 1) shiftHalfPixelY(tmp_surface_s); } } bool rotate_flag = false; if ( info->getTateyokoMode() == FontInfo::TATE_MODE && IS_ROTATION_REQUIRED(text) ) rotate_flag = true; dst_rect.x = xy[0] + minx; dst_rect.y = xy[1] + TTF_FontAscent((TTF_Font*)info->ttf_font[0]) - maxy; dst_rect.y -= (TTF_FontHeight((TTF_Font*)info->ttf_font[0]) - info->font_size_xy[1]*screen_ratio1/screen_ratio2)/2; if ( rotate_flag ) dst_rect.x += miny - minx; if ( info->getTateyokoMode() == FontInfo::TATE_MODE && IS_TRANSLATION_REQUIRED(text) ){ dst_rect.x += info->font_size_xy[0]/2; dst_rect.y -= info->font_size_xy[0]/2; } if (shadow_flag && tmp_surface_s){ SDL_Rect dst_rect_s = dst_rect; if (render_font_outline){ dst_rect_s.x -= (tmp_surface_s->w - tmp_surface->w)/2; dst_rect_s.y -= (tmp_surface_s->h - tmp_surface->h)/2; } else{ dst_rect_s.x += shade_distance[0]; dst_rect_s.y += shade_distance[1]; } if (rotate_flag){ dst_rect_s.w = tmp_surface_s->h; dst_rect_s.h = tmp_surface_s->w; } else{ dst_rect_s.w = tmp_surface_s->w; dst_rect_s.h = tmp_surface_s->h; } if (cache_info) cache_info->blendText( tmp_surface_s, dst_rect_s.x, dst_rect_s.y, bcol, clip, rotate_flag ); if (dst_surface) alphaBlendText( dst_surface, dst_rect_s, tmp_surface_s, bcol, clip, rotate_flag ); } if ( tmp_surface ){ if (rotate_flag){ dst_rect.w = tmp_surface->h; dst_rect.h = tmp_surface->w; } else{ dst_rect.w = tmp_surface->w; dst_rect.h = tmp_surface->h; } if (cache_info) cache_info->blendText( tmp_surface, dst_rect.x, dst_rect.y, color, clip, rotate_flag ); if (dst_surface) alphaBlendText( dst_surface, dst_rect, tmp_surface, color, clip, rotate_flag ); } if (tmp_surface_s && tmp_surface_s != tmp_surface) SDL_FreeSurface(tmp_surface_s); if (tmp_surface) SDL_FreeSurface(tmp_surface); } void ONScripter::drawChar( char* text, FontInfo *info, bool flush_flag, bool lookback_flag, SDL_Surface *surface, AnimationInfo *cache_info, SDL_Rect *clip ) { //printf("draw %x-%x[%s] %d, %d\n", text[0], text[1], text, info->xy[0], info->xy[1] ); if ( info->ttf_font[0] == NULL ){ if ( info->openFont( font_file, screen_ratio1, screen_ratio2 ) == NULL ){ fprintf( stderr, "can't open font file: %s\n", font_file ); quit(); exit(-1); } } #if defined(PSP) else info->openFont( font_file, screen_ratio1, screen_ratio2 ); #endif if ( info->isEndOfLine() ){ info->newLine(); for (int i=0 ; iadd(0x81); current_page->add(0x40); } info->advanceCharInHankaku(2); } } info->old_xy[0] = info->x(); info->old_xy[1] = info->y(); char text2[2] = {text[0], 0}; if (IS_TWO_BYTE(text[0])) text2[1] = text[1]; for (int i=0 ; i<2 ; i++){ int xy[2]; xy[0] = info->x() * screen_ratio1 / screen_ratio2; xy[1] = info->y() * screen_ratio1 / screen_ratio2; SDL_Color color = {info->color[0], info->color[1], info->color[2]}; SDL_Rect dst_rect; drawGlyph( surface, info, color, text2, xy, info->is_shadow, cache_info, clip, dst_rect ); if ( surface == accumulation_surface && !flush_flag && (!clip || AnimationInfo::doClipping( &dst_rect, clip ) == 0) ){ dirty_rect.add( dst_rect ); } else if ( flush_flag ){ if (info->is_shadow){ if (render_font_outline) info->addShadeArea(dst_rect, -1, -1, 2, 2); else info->addShadeArea(dst_rect, 0, 0, shade_distance[0], shade_distance[1]); } flushDirect( dst_rect, REFRESH_NONE_MODE ); } if (IS_TWO_BYTE(text[0])){ info->advanceCharInHankaku(2); break; } info->advanceCharInHankaku(1); text2[0] = text[1]; if (text2[0] == 0) break; } if ( lookback_flag ){ current_page->add( text[0] ); if (text[1]) current_page->add( text[1] ); } } void ONScripter::drawString( const char *str, uchar3 color, FontInfo *info, bool flush_flag, SDL_Surface *surface, SDL_Rect *rect, AnimationInfo *cache_info ) { int i; int start_xy[2]; start_xy[0] = info->xy[0]; start_xy[1] = info->xy[1]; /* ---------------------------------------- */ /* Draw selected characters */ uchar3 org_color; for ( i=0 ; i<3 ; i++ ) org_color[i] = info->color[i]; for ( i=0 ; i<3 ; i++ ) info->color[i] = color[i]; bool skip_whitespace_flag = true; char text[3] = { '\0', '\0', '\0' }; while( *str ){ while (*str == ' ' && skip_whitespace_flag) str++; #ifdef ENABLE_1BYTE_CHAR if ( *str == '`' ){ str++; skip_whitespace_flag = false; continue; } #endif #ifndef FORCE_1BYTE_CHAR if (cache_info && !cache_info->is_tight_region){ if (*str == '('){ startRuby(str+1, *info); str++; continue; } else if (*str == '/' && ruby_struct.stage == RubyStruct::BODY ){ info->addLineOffset(ruby_struct.margin); str = ruby_struct.ruby_end; if (*ruby_struct.ruby_end == ')'){ endRuby(false, false, NULL, cache_info); str++; } continue; } else if (*str == ')' && ruby_struct.stage == RubyStruct::BODY ){ ruby_struct.stage = RubyStruct::NONE; str++; continue; } else if (*str == '<'){ str++; int no = 0; while(*str>='0' && *str<='9') no=no*10+(*str++)-'0'; in_textbtn_flag = true; continue; } else if (*str == '>' && in_textbtn_flag){ str++; in_textbtn_flag = false; continue; } } #endif if ( IS_TWO_BYTE(*str) ){ if ( checkLineBreak( str, info ) ){ info->newLine(); for (int i=0 ; iadvanceCharInHankaku(2); } text[0] = *str++; text[1] = *str++; drawChar( text, info, false, false, surface, cache_info ); } else if (*str == 0x0a || (*str == '\\' && info->is_newline_accepted)){ info->newLine(); str++; } else if (*str){ text[0] = *str++; if (*str && *str != 0x0a) text[1] = *str++; else text[1] = 0; drawChar( text, info, false, false, surface, cache_info ); } } for ( i=0 ; i<3 ; i++ ) info->color[i] = org_color[i]; /* ---------------------------------------- */ /* Calculate the area of selection */ SDL_Rect clipped_rect = info->calcUpdatedArea(start_xy, screen_ratio1, screen_ratio2); SDL_Rect scaled_clipped_rect; scaled_clipped_rect.x = clipped_rect.x * screen_ratio1 / screen_ratio2; scaled_clipped_rect.y = clipped_rect.y * screen_ratio1 / screen_ratio2; scaled_clipped_rect.w = clipped_rect.w * screen_ratio1 / screen_ratio2; scaled_clipped_rect.h = clipped_rect.h * screen_ratio1 / screen_ratio2; if (info->is_shadow){ if (render_font_outline) info->addShadeArea(scaled_clipped_rect, -1, -1, 2, 2); else info->addShadeArea(scaled_clipped_rect, 0, 0, shade_distance[0], shade_distance[1]); } if ( flush_flag ) flush( refresh_shadow_text_mode, &scaled_clipped_rect ); if ( rect ) *rect = clipped_rect; } void ONScripter::restoreTextBuffer(SDL_Surface *surface) { text_info.fill( 0, 0, 0, 0 ); char out_text[3] = { '\0','\0','\0' }; FontInfo f_info = sentence_font; f_info.clear(); for ( int i=0 ; itext_count ; i++ ){ if ( current_page->text[i] == 0x0a ){ f_info.newLine(); } else{ out_text[0] = current_page->text[i]; #ifndef FORCE_1BYTE_CHAR if (out_text[0] == '('){ startRuby(current_page->text + i + 1, f_info); continue; } else if (out_text[0] == '/' && ruby_struct.stage == RubyStruct::BODY ){ f_info.addLineOffset(ruby_struct.margin); i = ruby_struct.ruby_end - current_page->text - 1; if (*ruby_struct.ruby_end == ')'){ endRuby(false, false, surface, &text_info); i++; } continue; } else if (out_text[0] == ')' && ruby_struct.stage == RubyStruct::BODY ){ ruby_struct.stage = RubyStruct::NONE; continue; } else if (out_text[0] == '<'){ int no = 0; while(current_page->text[i+1]>='0' && current_page->text[i+1]<='9') no=no*10+current_page->text[(i++)+1]-'0'; in_textbtn_flag = true; continue; } else if (out_text[0] == '>' && in_textbtn_flag){ in_textbtn_flag = false; continue; } #endif if (IS_TWO_BYTE(out_text[0])){ out_text[1] = current_page->text[i+1]; if ( checkLineBreak( current_page->text+i, &f_info ) ) f_info.newLine(); i++; } else{ out_text[1] = 0; if (i+1 != current_page->text_count && current_page->text[i+1] != 0x0a){ out_text[1] = current_page->text[i+1]; i++; } } drawChar( out_text, &f_info, false, false, surface, &text_info ); } } } void ONScripter::enterTextDisplayMode(bool text_flag) { if (line_enter_status <= 1 && (!pretextgosub_label || saveon_flag) && internal_saveon_flag && text_flag){ saveSaveFile(false); internal_saveon_flag = false; } if (!(display_mode & DISPLAY_MODE_TEXT)){ refreshSurface( effect_dst_surface, NULL, refresh_shadow_text_mode ); dirty_rect.clear(); dirty_rect.add( sentence_font_info.pos ); if (setEffect(&window_effect, false, true)) return; while(doEffect(&window_effect, false)); display_mode = DISPLAY_MODE_TEXT; text_on_flag = true; } } void ONScripter::leaveTextDisplayMode(bool force_leave_flag) { if (display_mode & DISPLAY_MODE_TEXT && (force_leave_flag || erase_text_window_mode != 0)){ SDL_BlitSurface(backup_surface, NULL, effect_dst_surface, NULL); dirty_rect.add(sentence_font_info.pos); if (setEffect(&window_effect, false, false)) return; while(doEffect(&window_effect, false)); display_mode = DISPLAY_MODE_NORMAL; } } bool ONScripter::doClickEnd() { bool ret = false; draw_cursor_flag = true; if ( automode_flag ){ event_mode = WAIT_TEXT_MODE | WAIT_INPUT_MODE | WAIT_VOICE_MODE | WAIT_TIMER_MODE; if ( automode_time < 0 ) ret = waitEvent( -automode_time * num_chars_in_sentence ); else ret = waitEvent( automode_time ); } else if ( autoclick_time > 0 ){ event_mode = WAIT_TIMER_MODE; ret = waitEvent( autoclick_time ); } else{ event_mode = WAIT_TEXT_MODE | WAIT_INPUT_MODE | WAIT_TIMER_MODE; ret = waitEvent(-1); } num_chars_in_sentence = 0; draw_cursor_flag = false; return ret; } bool ONScripter::clickWait( char *out_text ) { flush( REFRESH_NONE_MODE ); skip_mode &= ~SKIP_TO_EOL; if (script_h.checkClickstr(script_h.getStringBuffer() + string_buffer_offset) != 1) string_buffer_offset++; string_buffer_offset++; if ( (skip_mode & (SKIP_NORMAL | SKIP_TO_EOP) || ctrl_pressed_status) && !textgosub_label ){ clickstr_state = CLICK_NONE; if ( out_text ){ drawChar( out_text, &sentence_font, false, true, accumulation_surface, &text_info ); } else{ // called on '@' flush(refreshMode()); } num_chars_in_sentence = 0; event_mode = IDLE_EVENT_MODE; if ( waitEvent(0) ) return false; } else{ if ( out_text ){ drawChar( out_text, &sentence_font, true, true, accumulation_surface, &text_info ); num_chars_in_sentence++; } while( (!(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) && script_h.getStringBuffer()[ string_buffer_offset ] == ' ') || script_h.getStringBuffer()[ string_buffer_offset ] == '\t' ) string_buffer_offset ++; if ( textgosub_label ){ saveon_flag = false; textgosub_clickstr_state = CLICK_WAIT; if (script_h.getStringBuffer()[string_buffer_offset] == 0x0) textgosub_clickstr_state |= CLICK_EOL; gosubReal( textgosub_label, script_h.getNext(), true ); event_mode = IDLE_EVENT_MODE; waitEvent(0); return false; } // if this is the end of the line, pretext becomes enabled if (script_h.getStringBuffer()[string_buffer_offset] == 0x0) line_enter_status = 0; clickstr_state = CLICK_WAIT; if (doClickEnd()) return false; clickstr_state = CLICK_NONE; if (pagetag_flag) processEOT(); page_enter_status = 0; } return true; } bool ONScripter::clickNewPage( char *out_text ) { if ( out_text ){ drawChar( out_text, &sentence_font, true, true, accumulation_surface, &text_info ); num_chars_in_sentence++; } flush( REFRESH_NONE_MODE ); skip_mode &= ~SKIP_TO_EOL; if (script_h.checkClickstr(script_h.getStringBuffer() + string_buffer_offset) != 1) string_buffer_offset++; string_buffer_offset++; if ( (skip_mode & SKIP_NORMAL || ctrl_pressed_status) && !textgosub_label ){ num_chars_in_sentence = 0; clickstr_state = CLICK_NEWPAGE; event_mode = IDLE_EVENT_MODE; if (waitEvent(0)) return false; } else{ while( (!(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) && script_h.getStringBuffer()[ string_buffer_offset ] == ' ') || script_h.getStringBuffer()[ string_buffer_offset ] == '\t' ) string_buffer_offset ++; if ( textgosub_label ){ saveon_flag = false; textgosub_clickstr_state = CLICK_NEWPAGE; gosubReal( textgosub_label, script_h.getNext(), true ); event_mode = IDLE_EVENT_MODE; waitEvent(0); return false; } // if this is the end of the line, pretext becomes enabled if (script_h.getStringBuffer()[string_buffer_offset] == 0x0) line_enter_status = 0; clickstr_state = CLICK_NEWPAGE; if (doClickEnd()) return false; } newPage(); clickstr_state = CLICK_NONE; return true; } void ONScripter::startRuby(const char *buf, FontInfo &info) { ruby_struct.stage = RubyStruct::BODY; ruby_font = info; ruby_font.ttf_font[0] = NULL; ruby_font.ttf_font[1] = NULL; if ( ruby_struct.font_size_xy[0] != -1 ) ruby_font.font_size_xy[0] = ruby_struct.font_size_xy[0]; else ruby_font.font_size_xy[0] = info.font_size_xy[0]/2; if ( ruby_struct.font_size_xy[1] != -1 ) ruby_font.font_size_xy[1] = ruby_struct.font_size_xy[1]; else ruby_font.font_size_xy[1] = info.font_size_xy[1]/2; ruby_struct.body_count = 0; ruby_struct.ruby_count = 0; while(1){ if ( *buf == '/' ){ ruby_struct.stage = RubyStruct::RUBY; ruby_struct.ruby_start = buf+1; } else if ( *buf == ')' || *buf == '\0' ){ break; } else{ if ( ruby_struct.stage == RubyStruct::BODY ) ruby_struct.body_count++; else if ( ruby_struct.stage == RubyStruct::RUBY ) ruby_struct.ruby_count++; } buf++; } ruby_struct.ruby_end = buf; ruby_struct.stage = RubyStruct::BODY; ruby_struct.margin = ruby_font.initRuby(info, ruby_struct.body_count/2, ruby_struct.ruby_count/2); } void ONScripter::endRuby(bool flush_flag, bool lookback_flag, SDL_Surface *surface, AnimationInfo *cache_info) { char out_text[3]= {'\0', '\0', '\0'}; if ( sentence_font.rubyon_flag ){ ruby_font.clear(); const char *buf = ruby_struct.ruby_start; while( buf < ruby_struct.ruby_end ){ out_text[0] = *buf; out_text[1] = *(buf+1); drawChar( out_text, &ruby_font, flush_flag, lookback_flag, surface, cache_info ); buf+=2; } } ruby_struct.stage = RubyStruct::NONE; } int ONScripter::textCommand() { if (line_enter_status <= 1 && (!pretextgosub_label || saveon_flag) && internal_saveon_flag){ saveSaveFile(false); internal_saveon_flag = false; } char *buf = script_h.getStringBuffer(); bool tag_flag = true; if (buf[string_buffer_offset] == '[') string_buffer_offset++; else if (zenkakko_flag && buf[string_buffer_offset ] == "y"[0] && buf[string_buffer_offset+1] == "y"[1]) string_buffer_offset += 2; else tag_flag = false; int start_offset = string_buffer_offset; int end_offset = start_offset; while (tag_flag && buf[string_buffer_offset]){ if (zenkakko_flag && buf[string_buffer_offset ] == "z"[0] && buf[string_buffer_offset+1] == "z"[1]){ end_offset = string_buffer_offset; string_buffer_offset += 2; break; } else if (buf[string_buffer_offset] == ']'){ end_offset = string_buffer_offset; string_buffer_offset++; break; } else if (IS_TWO_BYTE(buf[string_buffer_offset])) string_buffer_offset += 2; else string_buffer_offset++; } if (pretextgosub_label && (!pagetag_flag || page_enter_status == 0) && line_enter_status == 0){ if (current_page->tag) delete[] current_page->tag; if (end_offset > start_offset){ int len = end_offset - start_offset; current_page->tag = new char[len+1]; memcpy(current_page->tag, buf + start_offset, len); current_page->tag[len] = 0; } else{ current_page->tag = NULL; } saveon_flag = false; pretext_buf = script_h.getCurrent(); gosubReal( pretextgosub_label, script_h.getCurrent() ); line_enter_status = 1; return RET_CONTINUE; } enterTextDisplayMode(); line_enter_status = 2; if (pagetag_flag) page_enter_status = 1; while(processText()); return RET_CONTINUE; } bool ONScripter::checkLineBreak(const char *buf, FontInfo *fi) { if (!is_kinsoku) return false; // check start kinsoku if (isStartKinsoku( buf+2 ) || buf[2]=='_' && isStartKinsoku( buf+3 )){ const char *buf2 = buf; if (buf2[2] == '_') buf2++; int i = 2; while (!fi->isEndOfLine(i)){ if ( buf2[i+2] == 0x0a || buf2[i+2] == 0 ) break; else if ( !IS_TWO_BYTE( buf2[i+2] ) ) buf2++; else if ( isStartKinsoku( buf2+i+2 ) ) i += 2; else break; } if (fi->isEndOfLine(i)) return true; } // check end kinsoku if (isEndKinsoku( buf )){ const char *buf2 = buf; int i = 2; while (!fi->isEndOfLine(i)){ if ( buf2[i+2] == 0x0a || buf2[i+2] == 0 ) break; else if ( !IS_TWO_BYTE( buf2[i+2] ) ) buf2++; else if ( isEndKinsoku( buf2+i ) ) i += 2; else break; } if (fi->isEndOfLine(i)) return true; } return false; } void ONScripter::processEOT() { if ( skip_mode & SKIP_TO_EOL ){ flush( refreshMode() ); skip_mode &= ~SKIP_TO_EOL; } if (!sentence_font.isLineEmpty() && !new_line_skip_flag){ // if sentence_font.isLineEmpty() is true, newPage() might be already issued if (!sentence_font.isEndOfLine()) current_page->add( 0x0a ); sentence_font.newLine(); } if (!new_line_skip_flag && !pagetag_flag) line_enter_status = 0; } bool ONScripter::processText() { //printf("textCommand %c %d %d %d\n", script_h.getStringBuffer()[ string_buffer_offset ], string_buffer_offset, event_mode, line_enter_status); char out_text[3]= {'\0', '\0', '\0'}; //printf("*** textCommand %d (%d,%d)\n", string_buffer_offset, sentence_font.xy[0], sentence_font.xy[1]); while( (!(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) && script_h.getStringBuffer()[ string_buffer_offset ] == ' ') || script_h.getStringBuffer()[ string_buffer_offset ] == '\t' ) string_buffer_offset ++; if (script_h.getStringBuffer()[string_buffer_offset] == 0x00){ processEOT(); return false; } new_line_skip_flag = false; char ch = script_h.getStringBuffer()[string_buffer_offset]; if ( IS_TWO_BYTE(ch) ){ // Shift jis /* ---------------------------------------- */ /* Kinsoku process */ if ( checkLineBreak( script_h.getStringBuffer() + string_buffer_offset, &sentence_font ) ){ sentence_font.newLine(); for (int i=0 ; iadd(0x81); current_page->add(0x40); sentence_font.advanceCharInHankaku(2); } } out_text[0] = script_h.getStringBuffer()[string_buffer_offset]; out_text[1] = script_h.getStringBuffer()[string_buffer_offset+1]; if (script_h.checkClickstr(&script_h.getStringBuffer()[string_buffer_offset]) > 0){ if (sentence_font.getRemainingLine() <= clickstr_line) return clickNewPage( out_text ); else return clickWait( out_text ); } else{ clickstr_state = CLICK_NONE; } if ( skip_mode || ctrl_pressed_status ){ drawChar( out_text, &sentence_font, false, true, accumulation_surface, &text_info ); } else{ drawChar( out_text, &sentence_font, true, true, accumulation_surface, &text_info ); event_mode = WAIT_TIMER_MODE | WAIT_INPUT_MODE; if ( sentence_font.wait_time == -1 ) waitEvent( default_text_speed[text_speed_no] ); else waitEvent( sentence_font.wait_time ); } num_chars_in_sentence++; string_buffer_offset += 2; return true; } else if ( ch == '@' ){ // wait for click return clickWait( NULL ); } else if ( ch == '\\' ){ // new page return clickNewPage( NULL ); } else if ( ch == '_' ){ // Ignore an immediate click wait string_buffer_offset++; int matched_len = script_h.checkClickstr(script_h.getStringBuffer() + string_buffer_offset, true); if (matched_len > 0){ out_text[0] = script_h.getStringBuffer()[string_buffer_offset]; if (out_text[0] != '@' && out_text[0] != '\\'){ if (matched_len == 2) out_text[1] = script_h.getStringBuffer()[string_buffer_offset+1]; bool flush_flag = true; if ( skip_mode || ctrl_pressed_status ) flush_flag = false; drawChar( out_text, &sentence_font, flush_flag, true, accumulation_surface, &text_info ); } string_buffer_offset += matched_len; } return true; } else if ( ch == '!' && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) ){ string_buffer_offset++; if ( script_h.getStringBuffer()[ string_buffer_offset ] == 's' ){ string_buffer_offset++; if ( script_h.getStringBuffer()[ string_buffer_offset ] == 'd' ){ sentence_font.wait_time = -1; string_buffer_offset++; } else{ int t = 0; while( script_h.getStringBuffer()[ string_buffer_offset ] >= '0' && script_h.getStringBuffer()[ string_buffer_offset ] <= '9' ){ t = t*10 + script_h.getStringBuffer()[ string_buffer_offset ] - '0'; string_buffer_offset++; } sentence_font.wait_time = t; while (script_h.getStringBuffer()[ string_buffer_offset ] == ' ' || script_h.getStringBuffer()[ string_buffer_offset ] == '\t') string_buffer_offset++; } } else if ( script_h.getStringBuffer()[ string_buffer_offset ] == 'w' || script_h.getStringBuffer()[ string_buffer_offset ] == 'd' ){ bool flag = false; if ( script_h.getStringBuffer()[ string_buffer_offset ] == 'd' ) flag = true; string_buffer_offset++; int t = 0; while( script_h.getStringBuffer()[ string_buffer_offset ] >= '0' && script_h.getStringBuffer()[ string_buffer_offset ] <= '9' ){ t = t*10 + script_h.getStringBuffer()[ string_buffer_offset ] - '0'; string_buffer_offset++; } while (script_h.getStringBuffer()[ string_buffer_offset ] == ' ' || script_h.getStringBuffer()[ string_buffer_offset ] == '\t') string_buffer_offset++; if (!skip_mode && !ctrl_pressed_status){ event_mode = WAIT_TIMER_MODE; if (flag) event_mode |= WAIT_INPUT_MODE; waitEvent(t); } } return true; } else if ( ch == '#' && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) ){ readColor( &sentence_font.color, script_h.getStringBuffer() + string_buffer_offset ); readColor( &ruby_font.color, script_h.getStringBuffer() + string_buffer_offset ); string_buffer_offset += 7; return true; } else if ( ch == '(' && (!english_mode || !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)) ){ current_page->add('('); startRuby( script_h.getStringBuffer() + string_buffer_offset + 1, sentence_font ); string_buffer_offset++; return true; } else if ( ch == '/' && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) ){ if ( ruby_struct.stage == RubyStruct::BODY ){ current_page->add('/'); sentence_font.addLineOffset(ruby_struct.margin); string_buffer_offset = ruby_struct.ruby_end - script_h.getStringBuffer(); if (*ruby_struct.ruby_end == ')'){ if ( skip_mode || ctrl_pressed_status ) endRuby(false, true, accumulation_surface, &text_info); else endRuby(true, true, accumulation_surface, &text_info); current_page->add(')'); string_buffer_offset++; } return true; } else{ // skip new line new_line_skip_flag = true; string_buffer_offset++; if (script_h.getStringBuffer()[string_buffer_offset] != 0x00) errorAndExit( "'new line' must follow '/'." ); return true; // skip the following eol } } else if ( ch == ')' && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) && ruby_struct.stage == RubyStruct::BODY ){ current_page->add(')'); string_buffer_offset++; ruby_struct.stage = RubyStruct::NONE; return true; } else if ( ch == '<' && (!english_mode || !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)) ){ current_page->add('<'); string_buffer_offset++; int no = 0; while(script_h.getStringBuffer()[string_buffer_offset]>='0' && script_h.getStringBuffer()[string_buffer_offset]<='9'){ current_page->add(script_h.getStringBuffer()[string_buffer_offset]); no=no*10+script_h.getStringBuffer()[string_buffer_offset++]-'0'; } in_textbtn_flag = true; return true; } else if ( ch == '>' && in_textbtn_flag && (!english_mode || !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)) ){ current_page->add('>'); string_buffer_offset++; in_textbtn_flag = false; return true; } else{ out_text[0] = ch; int matched_len = script_h.checkClickstr(script_h.getStringBuffer() + string_buffer_offset); if (matched_len > 0){ if (matched_len == 2) out_text[1] = script_h.getStringBuffer()[ string_buffer_offset + 1 ]; if (sentence_font.getRemainingLine() <= clickstr_line) return clickNewPage( out_text ); else return clickWait( out_text ); } else if (script_h.getStringBuffer()[ string_buffer_offset + 1 ] && script_h.checkClickstr(&script_h.getStringBuffer()[string_buffer_offset+1]) == 1 && script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR){ if ( script_h.getStringBuffer()[ string_buffer_offset + 2 ] && script_h.checkClickstr(&script_h.getStringBuffer()[string_buffer_offset+2]) > 0){ clickstr_state = CLICK_NONE; } else if (script_h.getStringBuffer()[ string_buffer_offset + 1 ] == '@'){ return clickWait( out_text ); } else if (script_h.getStringBuffer()[ string_buffer_offset + 1 ] == '\\'){ return clickNewPage( out_text ); } else{ out_text[1] = script_h.getStringBuffer()[ string_buffer_offset + 1 ]; if (sentence_font.getRemainingLine() <= clickstr_line) return clickNewPage( out_text ); else return clickWait( out_text ); } } else{ clickstr_state = CLICK_NONE; } bool flush_flag = true; if ( skip_mode || ctrl_pressed_status ) flush_flag = false; if ( script_h.getStringBuffer()[ string_buffer_offset + 1 ] && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)){ out_text[1] = script_h.getStringBuffer()[ string_buffer_offset + 1 ]; drawChar( out_text, &sentence_font, flush_flag, true, accumulation_surface, &text_info ); num_chars_in_sentence++; } else if (script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR){ drawChar( out_text, &sentence_font, flush_flag, true, accumulation_surface, &text_info ); num_chars_in_sentence++; } if (!skip_mode && !ctrl_pressed_status){ event_mode = WAIT_TIMER_MODE | WAIT_INPUT_MODE; if ( sentence_font.wait_time == -1 ) waitEvent( default_text_speed[text_speed_no] ); else waitEvent( sentence_font.wait_time ); } if ( script_h.getStringBuffer()[ string_buffer_offset + 1 ] && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)) string_buffer_offset++; string_buffer_offset++; return true; } return false; } onscripter-20150820/Makefile.onscripter0000644017777601777760000000740212565174244017632 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.onscripter - General makefile rules for ONScripter # GUI_OBJS = ONScripter$(OBJSUFFIX) \ ONScripter_animation$(OBJSUFFIX) \ ONScripter_command$(OBJSUFFIX) \ ONScripter_effect$(OBJSUFFIX) \ ONScripter_effect_breakup$(OBJSUFFIX) \ ONScripter_event$(OBJSUFFIX) \ ONScripter_file$(OBJSUFFIX) \ ONScripter_file2$(OBJSUFFIX) \ ONScripter_image$(OBJSUFFIX) \ ONScripter_lut$(OBJSUFFIX) \ ONScripter_rmenu$(OBJSUFFIX) \ ONScripter_sound$(OBJSUFFIX) \ ONScripter_text$(OBJSUFFIX) \ AnimationInfo$(OBJSUFFIX) \ FontInfo$(OBJSUFFIX) \ DirtyRect$(OBJSUFFIX) \ resize_image$(OBJSUFFIX) DECODER_OBJS = DirectReader$(OBJSUFFIX) \ SarReader$(OBJSUFFIX) \ NsaReader$(OBJSUFFIX) \ sjis2utf16$(OBJSUFFIX) SARDEC_OBJS = sardec$(OBJSUFFIX) \ DirectReader$(OBJSUFFIX) \ SarReader$(OBJSUFFIX) \ sjis2utf16$(OBJSUFFIX) SARCONV_OBJS = sarconv$(OBJSUFFIX) \ conv_shared$(OBJSUFFIX) \ resize_image$(OBJSUFFIX) \ DirectReader$(OBJSUFFIX) \ SarReader$(OBJSUFFIX) \ sjis2utf16$(OBJSUFFIX) NSADEC_OBJS = nsadec$(OBJSUFFIX) \ $(DECODER_OBJS) NSACONV_OBJS = nsaconv$(OBJSUFFIX) \ conv_shared$(OBJSUFFIX) \ resize_image$(OBJSUFFIX) \ $(DECODER_OBJS) ONSCRIPTER_OBJS = onscripter_main$(OBJSUFFIX) \ $(DECODER_OBJS) \ ScriptHandler$(OBJSUFFIX) \ ScriptParser$(OBJSUFFIX) \ ScriptParser_command$(OBJSUFFIX) \ $(GUI_OBJS) $(EXT_OBJS) PARSER_HEADER = BaseReader.h \ ButtonLink.h \ DirectReader.h \ SarReader.h \ NsaReader.h \ ScriptHandler.h \ ScriptParser.h \ AnimationInfo.h \ FontInfo.h \ DirtyRect.h \ LUAHandler.h ONSCRIPTER_HEADER = ONScripter.h $(PARSER_HEADER) ALL: $(TARGET) sardec$(EXESUFFIX): $(SARDEC_OBJS) $(LD) $(LDOUT)$@ $(SARDEC_OBJS) $(LIBS) sarconv$(EXESUFFIX): $(SARCONV_OBJS) $(LD) $(LDOUT)$@ $(SARCONV_OBJS) $(LIBS) nsadec$(EXESUFFIX): $(NSADEC_OBJS) $(LD) $(LDOUT)$@ $(NSADEC_OBJS) $(LIBS) nsaconv$(EXESUFFIX): $(NSACONV_OBJS) $(LD) $(LDOUT)$@ $(NSACONV_OBJS) $(LIBS) simple_aviplay$(EXESUFFIX): simple_aviplay$(OBJSUFFIX) AVIWrapper$(OBJSUFFIX) $(LD) $(LDOUT)$@ simple_aviplay$(OBJSUFFIX) AVIWrapper$(OBJSUFFIX) $(LIBS) onscripter$(EXESUFFIX): $(ONSCRIPTER_OBJS) $(LD) $(LDOUT)$@ $(ONSCRIPTER_OBJS) $(LIBS) clean: -$(RM) $(TARGET) -$(RM) *$(OBJSUFFIX) .cpp$(OBJSUFFIX): $(CC) $(CFLAGS) $< SarReader$(OBJSUFFIX): BaseReader.h SarReader.h NsaReader$(OBJSUFFIX): BaseReader.h SarReader.h NsaReader.h DirectReader$(OBJSUFFIX): BaseReader.h DirectReader.h ScriptHandler$(OBJSUFFIX): ScriptHandler.h ScriptParser$(OBJSUFFIX): $(PARSER_HEADER) ScriptParser_command$(OBJSUFFIX): $(PARSER_HEADER) sardec$(OBJSUFFIX): BaseReader.h SarReader.h sarconv$(OBJSUFFIX): BaseReader.h SarReader.h nsadec$(OBJSUFFIX): BaseReader.h SarReader.h NsaReader.h nsaconv$(OBJSUFFIX): BaseReader.h SarReader.h NsaReader.h simple_aviplay$(OBJSUFFIX): AVIWrapper.h conv_shared$(OBJSUFFIX): resize_image.h onscripter_main$(OBJSUFFIX): $(ONSCRIPTER_HEADER) version.h ONScripter$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_command$(OBJSUFFIX): $(ONSCRIPTER_HEADER) version.h ONScripter_text$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_effect$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_effect_breakup$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_event$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_rmenu$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_animation$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_sound$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_file$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_file2$(OBJSUFFIX): $(ONSCRIPTER_HEADER) ONScripter_image$(OBJSUFFIX): $(ONSCRIPTER_HEADER) resize_image.h ONScripter_lut$(OBJSUFFIX): $(ONSCRIPTER_HEADER) AnimationInfo$(OBJSUFFIX): AnimationInfo.h FontInfo$(OBJSUFFIX): FontInfo.h DirtyRect$(OBJSUFFIX) : DirtyRect.h AVIWrapper$(OBJSUFFIX): AVIWrapper.h LUAHandler$(OBJSUFFIX): $(ONSCRIPTER_HEADER) LUAHandler.h onscripter-20150820/ONScripter_event.cpp0000644017777601777760000013604412565174244017745 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_event.cpp - Event handler of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #if defined(LINUX) #include #include #endif #define ONS_TIMER_EVENT (SDL_USEREVENT) #define ONS_MUSIC_EVENT (SDL_USEREVENT+1) #define ONS_CDAUDIO_EVENT (SDL_USEREVENT+2) #define ONS_MIDI_EVENT (SDL_USEREVENT+3) #define ONS_CHUNK_EVENT (SDL_USEREVENT+4) #define ONS_BREAK_EVENT (SDL_USEREVENT+5) #define ONS_BGMFADE_EVENT (SDL_USEREVENT+6) // This sets up the fade event flag for use in bgm fadeout and fadein. #define BGM_FADEOUT 0 #define BGM_FADEIN 1 #define EDIT_MODE_PREFIX "[EDIT MODE] " #define EDIT_SELECT_STRING "MP3 vol (m) SE vol (s) Voice vol (v) Numeric variable (n)" static SDL_TimerID timer_id = NULL; SDL_TimerID timer_cdaudio_id = NULL; SDL_TimerID timer_bgmfade_id = NULL; bool ext_music_play_once_flag = false; /* **************************************** * * Callback functions * **************************************** */ extern "C" void musicFinishCallback() { SDL_Event event; event.type = ONS_MUSIC_EVENT; SDL_PushEvent(&event); } extern "C" Uint32 SDLCALL timerCallback( Uint32 interval, void *param ) { SDL_RemoveTimer( timer_id ); timer_id = NULL; SDL_Event event; event.type = ONS_TIMER_EVENT; SDL_PushEvent( &event ); return 0; } extern "C" Uint32 cdaudioCallback( Uint32 interval, void *param ) { SDL_RemoveTimer( timer_cdaudio_id ); timer_cdaudio_id = NULL; SDL_Event event; event.type = ONS_CDAUDIO_EVENT; SDL_PushEvent( &event ); return interval; } extern "C" Uint32 SDLCALL bgmfadeCallback( Uint32 interval, void *param ) { SDL_Event event; event.type = ONS_BGMFADE_EVENT; event.user.code = (param == NULL) ? BGM_FADEOUT : BGM_FADEIN; SDL_PushEvent( &event ); return interval; } /* **************************************** * * OS Dependent Input Translation * **************************************** */ SDLKey transKey(SDLKey key) { #if defined(IPODLINUX) switch(key){ case SDLK_m: key = SDLK_UP; break; /* Menu */ case SDLK_d: key = SDLK_DOWN; break; /* Play/Pause */ case SDLK_f: key = SDLK_RIGHT; break; /* Fast forward */ case SDLK_w: key = SDLK_LEFT; break; /* Rewind */ case SDLK_RETURN: key = SDLK_RETURN; break; /* Action */ case SDLK_h: key = SDLK_ESCAPE; break; /* Hold */ case SDLK_r: key = SDLK_UNKNOWN; break; /* Wheel clockwise */ case SDLK_l: key = SDLK_UNKNOWN; break; /* Wheel counterclockwise */ default: break; } #endif #if defined(WINCE) switch(key){ case SDLK_UP: key = SDLK_UP; break; /* vkUP */ case SDLK_DOWN: key = SDLK_DOWN; break; /* vkDOWN */ case SDLK_LEFT: key = SDLK_LCTRL; break; /* vkLEFT */ case SDLK_RIGHT: key = SDLK_RETURN; break; /* vkRIGHT */ case SDLK_KP0: key = SDLK_q; break; /* vkStart */ case SDLK_KP1: key = SDLK_RETURN; break; /* vkA */ case SDLK_KP2: key = SDLK_SPACE; break; /* vkB */ case SDLK_KP3: key = SDLK_ESCAPE; break; /* vkC */ default: break; } #endif return key; } SDLKey transJoystickButton(Uint8 button) { #if defined(PSP) SDLKey button_map[] = { SDLK_ESCAPE, /* TRIANGLE */ SDLK_RETURN, /* CIRCLE */ SDLK_SPACE, /* CROSS */ SDLK_RCTRL, /* SQUARE */ SDLK_o, /* LTRIGGER */ SDLK_s, /* RTRIGGER */ SDLK_DOWN, /* DOWN */ SDLK_LEFT, /* LEFT */ SDLK_UP, /* UP */ SDLK_RIGHT, /* RIGHT */ SDLK_0, /* SELECT */ SDLK_a, /* START */ SDLK_UNKNOWN,/* HOME */ /* kernel mode only */ SDLK_UNKNOWN,/* HOLD */}; return button_map[button]; #elif defined(__PS3__) SDLKey button_map[] = { SDLK_0, /* SELECT */ SDLK_UNKNOWN,/* L3 */ SDLK_UNKNOWN,/* R3 */ SDLK_a, /* START */ SDLK_UP, /* UP */ SDLK_RIGHT, /* RIGHT */ SDLK_DOWN, /* DOWN */ SDLK_LEFT, /* LEFT */ SDLK_SPACE, /* L2 */ SDLK_RETURN, /* R2 */ SDLK_o, /* L1 */ SDLK_s, /* R1 */ SDLK_ESCAPE, /* TRIANGLE */ SDLK_RETURN, /* CIRCLE */ SDLK_SPACE, /* CROSS */ SDLK_RCTRL, /* SQUARE */ SDLK_UNKNOWN,/* PS */ SDLK_UNKNOWN, SDLK_UNKNOWN, }; return button_map[button]; #elif defined(GP2X) SDLKey button_map[] = { SDLK_UP, /* UP */ SDLK_UNKNOWN, /* UPLEFT */ SDLK_LEFT, /* LEFT */ SDLK_UNKNOWN, /* DOWNLEFT */ SDLK_DOWN, /* DOWN */ SDLK_UNKNOWN, /* DOWNRIGHT */ SDLK_RIGHT, /* RIGHT */ SDLK_UNKNOWN, /* UPRIGHT */ SDLK_a, /* START */ SDLK_0, /* SELECT */ SDLK_o, /* L */ SDLK_s, /* R */ SDLK_RCTRL, /* A */ SDLK_RETURN, /* B */ SDLK_SPACE, /* X */ SDLK_ESCAPE, /* Y */ SDLK_UNKNOWN, /* VOLUP */ SDLK_UNKNOWN, /* VOLDOWN */ SDLK_UNKNOWN, /* STICK */ }; return button_map[button]; #endif return SDLK_UNKNOWN; } SDL_KeyboardEvent transJoystickAxis(SDL_JoyAxisEvent &jaxis) { static int old_axis=-1; SDL_KeyboardEvent event; SDLKey axis_map[] = {SDLK_LEFT, /* AL-LEFT */ SDLK_RIGHT, /* AL-RIGHT */ SDLK_UP, /* AL-UP */ SDLK_DOWN /* AL-DOWN */}; int axis = -1; /* rerofumi: Jan.15.2007 */ /* ps3's pad has 0x1b axis (with analog button) */ if (jaxis.axis < 2){ axis = ((3200 > jaxis.value) && (jaxis.value > -3200) ? -1 : (jaxis.axis * 2 + (jaxis.value>0 ? 1 : 0) )); } if (axis != old_axis){ if (axis == -1){ event.type = SDL_KEYUP; event.keysym.sym = axis_map[old_axis]; } else{ event.type = SDL_KEYDOWN; event.keysym.sym = axis_map[axis]; } old_axis = axis; } else{ event.keysym.sym = SDLK_UNKNOWN; } return event; } void ONScripter::flushEventSub( SDL_Event &event ) { if ( event.type == ONS_MUSIC_EVENT ){ if ( music_play_loop_flag || (cd_play_loop_flag && !cdaudio_flag ) ){ stopBGM( true ); if (music_file_name){ playSound(music_file_name, SOUND_MUSIC, true); Mix_SetMusicPosition( music_loopback_offset ); } else playCDAudio(); } else{ stopBGM( false ); } } else if ((event.type == ONS_BGMFADE_EVENT) && (event.user.code == BGM_FADEOUT)){ Uint32 cur_fade_duration = mp3fadeout_duration_internal; if (skip_mode & (SKIP_NORMAL | SKIP_TO_EOP) || ctrl_pressed_status) { cur_fade_duration = 0; Mix_VolumeMusic( 0 ); } Uint32 tmp = SDL_GetTicks() - mp3fade_start; if ( tmp < cur_fade_duration ) { tmp = cur_fade_duration - tmp; tmp *= music_volume; tmp /= cur_fade_duration; Mix_VolumeMusic( tmp * MIX_MAX_VOLUME / 100 ); } else { char *ext = NULL; if (fadeout_music_file_name) ext = strrchr(fadeout_music_file_name, '.'); if (ext && (strcmp(ext+1, "OGG") && strcmp(ext+1, "ogg"))){ // set break event to return to script processing when playing music other than ogg SDL_Event event; event.type = ONS_BREAK_EVENT; SDL_PushEvent( &event ); } stopBGM( false ); } } else if ((event.type == ONS_BGMFADE_EVENT) && (event.user.code == BGM_FADEIN)){ Uint32 cur_fade_duration = mp3fadein_duration_internal; if (skip_mode & (SKIP_NORMAL | SKIP_TO_EOP) || ctrl_pressed_status) { cur_fade_duration = 0; Mix_VolumeMusic( music_volume * MIX_MAX_VOLUME / 100 ); } Uint32 tmp = SDL_GetTicks() - mp3fade_start; if ( tmp < cur_fade_duration ) { tmp *= music_volume; tmp /= cur_fade_duration; Mix_VolumeMusic( tmp * MIX_MAX_VOLUME / 100 ); } else { if (timer_bgmfade_id) SDL_RemoveTimer( timer_bgmfade_id ); timer_bgmfade_id = NULL; mp3fadeout_duration_internal = 0; char *ext = NULL; if (music_file_name) ext = strrchr(music_file_name, '.'); if (ext && (strcmp(ext+1, "OGG") && strcmp(ext+1, "ogg"))){ // set break event to return to script processing when playing music other than ogg SDL_Event event; event.type = ONS_BREAK_EVENT; SDL_PushEvent( &event ); } } } else if ( event.type == ONS_CDAUDIO_EVENT ){ if ( cd_play_loop_flag ){ stopBGM( true ); playCDAudio(); } else{ stopBGM( false ); } } else if ( event.type == ONS_MIDI_EVENT ){ ext_music_play_once_flag = !midi_play_loop_flag; Mix_FreeMusic( midi_info ); playMIDI(midi_play_loop_flag); } else if ( event.type == ONS_CHUNK_EVENT ){ // for processing btntim2 and automode correctly if ( wave_sample[event.user.code] ){ Mix_FreeChunk( wave_sample[event.user.code] ); wave_sample[event.user.code] = NULL; if (event.user.code == MIX_LOOPBGM_CHANNEL0 && loop_bgm_name[1] && wave_sample[MIX_LOOPBGM_CHANNEL1]) Mix_PlayChannel(MIX_LOOPBGM_CHANNEL1, wave_sample[MIX_LOOPBGM_CHANNEL1], -1); } } } void ONScripter::flushEvent() { SDL_Event event; while( SDL_PollEvent( &event ) ) flushEventSub( event ); } void ONScripter::removeEvent(int type) { SDL_Event event; #if SDL_VERSION_ATLEAST(1, 3, 0) while(SDL_PeepEvents( &event, 1, SDL_GETEVENT, type, type) > 0); #else while(SDL_PeepEvents( &event, 1, SDL_GETEVENT, SDL_EVENTMASK(type) ) > 0 ); #endif } void ONScripter::removeBGMFadeEvent() { removeEvent(ONS_BGMFADE_EVENT); } void ONScripter::waitEventSub(int count) { remaining_time = count; timerEvent(); runEventLoop(); removeEvent( ONS_BREAK_EVENT ); } bool ONScripter::waitEvent( int count ) { while(1){ waitEventSub( count ); if ( system_menu_mode == SYSTEM_NULL ) break; int ret = executeSystemCall(); if (ret == 1) return true; else if (ret == 2) return false; } return false; } void midiCallback( int sig ) { #if defined(LINUX) int status; wait( &status ); #endif if ( !ext_music_play_once_flag ){ SDL_Event event; event.type = ONS_MIDI_EVENT; SDL_PushEvent(&event); } } extern "C" void waveCallback( int channel ) { SDL_Event event; event.type = ONS_CHUNK_EVENT; event.user.code = channel; SDL_PushEvent(&event); } bool ONScripter::trapHandler() { if (event_mode & WAIT_BUTTON_MODE || event_mode & WAIT_TEXT_MODE) return false; if (trap_mode & TRAP_STOP){ trap_mode |= TRAP_CLICKED; return false; } trap_mode = TRAP_NONE; stopAnimation( clickstr_state ); setCurrentLabel( trap_dist ); current_button_state.button = 0; // to escape from screen effect return true; } /* **************************************** * * Event handlers * **************************************** */ bool ONScripter::mouseMoveEvent( SDL_MouseMotionEvent *event ) { current_button_state.x = event->x * screen_width / screen_device_width; current_button_state.y = event->y * screen_width / screen_device_width; if ( event_mode & WAIT_BUTTON_MODE ){ mouseOverCheck( current_button_state.x, current_button_state.y ); if (getmouseover_flag && current_over_button >= getmouseover_lower && current_over_button <= getmouseover_upper){ current_button_state.button = current_over_button; return true; } } return false; } bool ONScripter::mousePressEvent( SDL_MouseButtonEvent *event ) { if ( variable_edit_mode ) return false; if ( automode_flag ){ automode_flag = false; return false; } if ( (event->button == SDL_BUTTON_RIGHT && trap_mode & TRAP_RIGHT_CLICK) || (event->button == SDL_BUTTON_LEFT && trap_mode & TRAP_LEFT_CLICK) ){ if (trapHandler()) return true; } current_button_state.x = event->x * screen_width / screen_device_width; current_button_state.y = event->y * screen_width / screen_device_width; current_button_state.down_flag = false; skip_mode &= ~SKIP_NORMAL; if ( event->button == SDL_BUTTON_RIGHT && event->type == SDL_MOUSEBUTTONUP && ((rmode_flag && event_mode & WAIT_TEXT_MODE) || (event_mode & (WAIT_BUTTON_MODE | WAIT_RCLICK_MODE))) ){ current_button_state.button = -1; sprintf(current_button_state.str, "RCLICK"); if (event_mode & WAIT_TEXT_MODE){ if (root_rmenu_link.next) system_menu_mode = SYSTEM_MENU; else system_menu_mode = SYSTEM_WINDOWERASE; } } else if ( event->button == SDL_BUTTON_LEFT && ( event->type == SDL_MOUSEBUTTONUP || btndown_flag ) ){ current_button_state.button = current_over_button; if (current_over_button == -1){ if (!bexec_flag) current_button_state.button = 0; sprintf(current_button_state.str, "LCLICK"); } else{ sprintf(current_button_state.str, "S%d", current_over_button); if (bexec_flag && current_button_link){ ButtonLink *cbl = current_button_link; if ( current_button_link->exbtn_ctl[2] ){ SDL_Rect check_src_rect = cbl->image_rect; SDL_Rect check_dst_rect = {0, 0, 0, 0}; decodeExbtnControl( cbl->exbtn_ctl[2], &check_src_rect, &check_dst_rect ); } else{ sprite_info[ cbl->sprite_no ].visible = true; sprite_info[ cbl->sprite_no ].setCell(2); dirty_rect.add( cbl->image_rect ); } flush( refreshMode() ); } } if ( event->type == SDL_MOUSEBUTTONDOWN ) current_button_state.down_flag = true; } #if SDL_VERSION_ATLEAST(1, 2, 5) else if (event->button == SDL_BUTTON_WHEELUP && (bexec_flag || (event_mode & WAIT_TEXT_MODE) || (usewheel_flag && event_mode & WAIT_BUTTON_MODE) || system_menu_mode == SYSTEM_LOOKBACK)){ current_button_state.button = -2; sprintf(current_button_state.str, "WHEELUP"); if (event_mode & WAIT_TEXT_MODE) system_menu_mode = SYSTEM_LOOKBACK; } else if ( event->button == SDL_BUTTON_WHEELDOWN && (bexec_flag || (enable_wheeldown_advance_flag && event_mode & WAIT_TEXT_MODE) || (usewheel_flag && event_mode & WAIT_BUTTON_MODE) || system_menu_mode == SYSTEM_LOOKBACK ) ){ if (event_mode & WAIT_TEXT_MODE) current_button_state.button = 0; else current_button_state.button = -3; sprintf(current_button_state.str, "WHEELDOWN"); } #endif else if ( getmclick_flag && event->button == SDL_BUTTON_MIDDLE ){ current_button_state.button = -70; sprintf(current_button_state.str, "MCLICK"); } else return false; if ( event_mode & (WAIT_INPUT_MODE | WAIT_BUTTON_MODE) ){ if (!(event_mode & (WAIT_TEXT_MODE))) skip_mode |= SKIP_TO_EOL; playClickVoice(); stopAnimation( clickstr_state ); return true; } return false; } void ONScripter::variableEditMode( SDL_KeyboardEvent *event ) { int i; const char *var_name; char var_index[12]; switch ( event->keysym.sym ) { case SDLK_m: if ( variable_edit_mode != EDIT_SELECT_MODE ) return; variable_edit_mode = EDIT_MP3_VOLUME_MODE; variable_edit_num = music_volume; break; case SDLK_s: if ( variable_edit_mode != EDIT_SELECT_MODE ) return; variable_edit_mode = EDIT_SE_VOLUME_MODE; variable_edit_num = se_volume; break; case SDLK_v: if ( variable_edit_mode != EDIT_SELECT_MODE ) return; variable_edit_mode = EDIT_VOICE_VOLUME_MODE; variable_edit_num = voice_volume; break; case SDLK_n: if ( variable_edit_mode != EDIT_SELECT_MODE ) return; variable_edit_mode = EDIT_VARIABLE_INDEX_MODE; variable_edit_num = 0; break; case SDLK_9: case SDLK_KP9: variable_edit_num = variable_edit_num * 10 + 9; break; case SDLK_8: case SDLK_KP8: variable_edit_num = variable_edit_num * 10 + 8; break; case SDLK_7: case SDLK_KP7: variable_edit_num = variable_edit_num * 10 + 7; break; case SDLK_6: case SDLK_KP6: variable_edit_num = variable_edit_num * 10 + 6; break; case SDLK_5: case SDLK_KP5: variable_edit_num = variable_edit_num * 10 + 5; break; case SDLK_4: case SDLK_KP4: variable_edit_num = variable_edit_num * 10 + 4; break; case SDLK_3: case SDLK_KP3: variable_edit_num = variable_edit_num * 10 + 3; break; case SDLK_2: case SDLK_KP2: variable_edit_num = variable_edit_num * 10 + 2; break; case SDLK_1: case SDLK_KP1: variable_edit_num = variable_edit_num * 10 + 1; break; case SDLK_0: case SDLK_KP0: variable_edit_num = variable_edit_num * 10 + 0; break; case SDLK_MINUS: case SDLK_KP_MINUS: if ( variable_edit_mode == EDIT_VARIABLE_NUM_MODE && variable_edit_num == 0 ) variable_edit_sign = -1; break; case SDLK_BACKSPACE: if ( variable_edit_num ) variable_edit_num /= 10; else if ( variable_edit_sign == -1 ) variable_edit_sign = 1; break; case SDLK_RETURN: case SDLK_KP_ENTER: switch( variable_edit_mode ){ case EDIT_VARIABLE_INDEX_MODE: variable_edit_index = variable_edit_num; variable_edit_num = script_h.getVariableData(variable_edit_index).num; if ( variable_edit_num < 0 ){ variable_edit_num = -variable_edit_num; variable_edit_sign = -1; } else{ variable_edit_sign = 1; } break; case EDIT_VARIABLE_NUM_MODE: script_h.setNumVariable( variable_edit_index, variable_edit_sign * variable_edit_num ); break; case EDIT_MP3_VOLUME_MODE: music_volume = variable_edit_num; Mix_VolumeMusic( music_volume * MIX_MAX_VOLUME / 100 ); break; case EDIT_SE_VOLUME_MODE: se_volume = variable_edit_num; for ( i=1 ; i= EDIT_VARIABLE_NUM_MODE ){ int p=0; switch( variable_edit_mode ){ case EDIT_VARIABLE_NUM_MODE: sprintf( var_index, "%%%d", variable_edit_index ); var_name = var_index; p = script_h.getVariableData(variable_edit_index).num; break; case EDIT_MP3_VOLUME_MODE: var_name = "MP3 Volume"; p = music_volume; break; case EDIT_VOICE_VOLUME_MODE: var_name = "Voice Volume"; p = voice_volume; break; case EDIT_SE_VOLUME_MODE: var_name = "Sound effect Volume"; p = se_volume; break; default: var_name = ""; } sprintf( wm_edit_string, "%sCurrent %s=%d New value? %s%d", EDIT_MODE_PREFIX, var_name, p, (variable_edit_sign==1)?"":"-", variable_edit_num ); } SDL_WM_SetCaption( wm_edit_string, wm_icon_string ); } void ONScripter::shiftCursorOnButton( int diff ) { int num; ButtonLink *button = root_button_link.next; for (num=0 ; button ; num++) button = button->next; shortcut_mouse_line += diff; if (shortcut_mouse_line < 0) shortcut_mouse_line = num-1; else if (shortcut_mouse_line >= num) shortcut_mouse_line = 0; button = root_button_link.next; for (int i=0 ; inext; if (button){ int x = button->select_rect.x + button->select_rect.w/2; int y = button->select_rect.y + button->select_rect.h/2; if (x < 0) x = 0; else if (x >= screen_width) x = screen_width-1; if (y < 0) y = 0; else if (y >= screen_height) y = screen_height-1; x = x * screen_device_width / screen_width; y = y * screen_device_width / screen_width; shift_over_button = button->no; SDL_WarpMouse(x, y); } } bool ONScripter::keyDownEvent( SDL_KeyboardEvent *event ) { if (event->keysym.sym == SDLK_ESCAPE){ current_button_state.event_type = SDL_MOUSEBUTTONDOWN; current_button_state.event_button = SDL_BUTTON_RIGHT; } else if (event->keysym.sym == SDLK_KP_ENTER){ current_button_state.event_type = SDL_MOUSEBUTTONDOWN; current_button_state.event_button = SDL_BUTTON_LEFT; } else if (event->keysym.sym == SDLK_LEFT){ current_button_state.event_type = SDL_MOUSEBUTTONDOWN; current_button_state.event_button = SDL_BUTTON_WHEELUP; } else if (event->keysym.sym == SDLK_RIGHT){ current_button_state.event_type = SDL_MOUSEBUTTONDOWN; current_button_state.event_button = SDL_BUTTON_WHEELDOWN; } switch ( event->keysym.sym ) { case SDLK_RCTRL: ctrl_pressed_status |= 0x01; sprintf(current_button_state.str, "CTRL"); goto ctrl_pressed; case SDLK_LCTRL: ctrl_pressed_status |= 0x02; sprintf(current_button_state.str, "CTRL"); goto ctrl_pressed; case SDLK_RSHIFT: shift_pressed_status |= 0x01; break; case SDLK_LSHIFT: shift_pressed_status |= 0x02; break; default: break; } return false; ctrl_pressed: current_button_state.button = 0; playClickVoice(); stopAnimation( clickstr_state ); return true; } void ONScripter::keyUpEvent( SDL_KeyboardEvent *event ) { if (event->keysym.sym == SDLK_ESCAPE){ current_button_state.event_type = SDL_MOUSEBUTTONUP; current_button_state.event_button = SDL_BUTTON_RIGHT; } else if (event->keysym.sym == SDLK_KP_ENTER){ current_button_state.event_type = SDL_MOUSEBUTTONUP; current_button_state.event_button = SDL_BUTTON_LEFT; } else if (event->keysym.sym == SDLK_LEFT){ current_button_state.event_type = SDL_MOUSEBUTTONUP; current_button_state.event_button = SDL_BUTTON_WHEELUP; } else if (event->keysym.sym == SDLK_RIGHT){ current_button_state.event_type = SDL_MOUSEBUTTONUP; current_button_state.event_button = SDL_BUTTON_WHEELDOWN; } switch ( event->keysym.sym ) { case SDLK_RCTRL: ctrl_pressed_status &= ~0x01; break; case SDLK_LCTRL: ctrl_pressed_status &= ~0x02; break; case SDLK_RSHIFT: shift_pressed_status &= ~0x01; break; case SDLK_LSHIFT: shift_pressed_status &= ~0x02; break; default: break; } } bool ONScripter::keyPressEvent( SDL_KeyboardEvent *event ) { current_button_state.button = 0; current_button_state.down_flag = false; if ( automode_flag ){ automode_flag = false; return false; } if ( event->type == SDL_KEYUP ){ if ( variable_edit_mode ){ variableEditMode( event ); return false; } if ( edit_flag && event->keysym.sym == SDLK_z ){ variable_edit_mode = EDIT_SELECT_MODE; variable_edit_sign = 1; variable_edit_num = 0; sprintf( wm_edit_string, "%s%s", EDIT_MODE_PREFIX, EDIT_SELECT_STRING ); SDL_WM_SetCaption( wm_edit_string, wm_icon_string ); } } if (event->type == SDL_KEYUP) skip_mode &= ~SKIP_NORMAL; if ( shift_pressed_status && event->keysym.sym == SDLK_q && current_mode == NORMAL_MODE ){ endCommand(); } if ( (trap_mode & TRAP_LEFT_CLICK) && (event->keysym.sym == SDLK_RETURN || event->keysym.sym == SDLK_KP_ENTER || event->keysym.sym == SDLK_SPACE ) ){ if (trapHandler()) return true; } else if ( (trap_mode & TRAP_RIGHT_CLICK) && (event->keysym.sym == SDLK_ESCAPE) ){ if (trapHandler()) return true; } if ( event_mode & WAIT_BUTTON_MODE && (((event->type == SDL_KEYUP || btndown_flag) && ((!getenter_flag && event->keysym.sym == SDLK_RETURN) || (!getenter_flag && event->keysym.sym == SDLK_KP_ENTER))) || ((spclclk_flag || !useescspc_flag) && event->keysym.sym == SDLK_SPACE)) ){ if ( event->keysym.sym == SDLK_RETURN || event->keysym.sym == SDLK_KP_ENTER || (spclclk_flag && event->keysym.sym == SDLK_SPACE) ){ current_button_state.button = current_over_button; if (current_over_button == -1){ if (!bexec_flag) current_button_state.button = 0; sprintf(current_button_state.str, "RETURN"); } else{ sprintf(current_button_state.str, "S%d", current_over_button); if (bexec_flag && current_button_link){ ButtonLink *cbl = current_button_link; if ( current_button_link->exbtn_ctl[2] ){ SDL_Rect check_src_rect = cbl->image_rect; SDL_Rect check_dst_rect = {0, 0, 0, 0}; decodeExbtnControl( cbl->exbtn_ctl[2], &check_src_rect, &check_dst_rect ); } else{ sprite_info[ cbl->sprite_no ].visible = true; sprite_info[ cbl->sprite_no ].setCell(2); dirty_rect.add( cbl->image_rect ); } flush( refreshMode() ); } } if ( event->type == SDL_KEYDOWN ) current_button_state.down_flag = true; } else{ current_button_state.button = -1; if (!bexec_flag) current_button_state.button = 0; sprintf(current_button_state.str, "SPACE"); } playClickVoice(); stopAnimation( clickstr_state ); return true; } if ( event->type == SDL_KEYDOWN ) return false; if ( ( event_mode & (WAIT_INPUT_MODE | WAIT_BUTTON_MODE) ) && ( autoclick_time == 0 || (event_mode & WAIT_BUTTON_MODE)) ){ if ( !useescspc_flag && event->keysym.sym == SDLK_ESCAPE){ current_button_state.button = -1; sprintf(current_button_state.str, "RCLICK"); if (rmode_flag && event_mode & WAIT_TEXT_MODE){ if (root_rmenu_link.next) system_menu_mode = SYSTEM_MENU; else system_menu_mode = SYSTEM_WINDOWERASE; } } else if ( useescspc_flag && event->keysym.sym == SDLK_ESCAPE ){ current_button_state.button = -10; } else if ( !spclclk_flag && useescspc_flag && event->keysym.sym == SDLK_SPACE ){ current_button_state.button = -11; } else if (((!getcursor_flag && event->keysym.sym == SDLK_LEFT) || event->keysym.sym == SDLK_h) && (event_mode & WAIT_TEXT_MODE || (usewheel_flag && !getcursor_flag && event_mode & WAIT_BUTTON_MODE) || system_menu_mode == SYSTEM_LOOKBACK)){ current_button_state.button = -2; if (event_mode & WAIT_TEXT_MODE) system_menu_mode = SYSTEM_LOOKBACK; } else if (((!getcursor_flag && event->keysym.sym == SDLK_RIGHT) || event->keysym.sym == SDLK_l) && ((enable_wheeldown_advance_flag && event_mode & WAIT_TEXT_MODE) || (usewheel_flag && event_mode & WAIT_BUTTON_MODE) || system_menu_mode == SYSTEM_LOOKBACK)){ if (event_mode & WAIT_TEXT_MODE) current_button_state.button = 0; else current_button_state.button = -3; } else if (((!getcursor_flag && event->keysym.sym == SDLK_UP) || event->keysym.sym == SDLK_k || event->keysym.sym == SDLK_p) && event_mode & WAIT_BUTTON_MODE){ shiftCursorOnButton(1); return false; } else if (((!getcursor_flag && event->keysym.sym == SDLK_DOWN) || event->keysym.sym == SDLK_j || event->keysym.sym == SDLK_n) && event_mode & WAIT_BUTTON_MODE){ shiftCursorOnButton(-1); return false; } else if ( getpageup_flag && event->keysym.sym == SDLK_PAGEUP ){ current_button_state.button = -12; sprintf(current_button_state.str, "PAGEUP"); } else if ( getpagedown_flag && event->keysym.sym == SDLK_PAGEDOWN ){ current_button_state.button = -13; sprintf(current_button_state.str, "PAGEDOWN"); } else if ( (getenter_flag && event->keysym.sym == SDLK_RETURN) || (getenter_flag && event->keysym.sym == SDLK_KP_ENTER) ){ current_button_state.button = -19; } else if ( gettab_flag && event->keysym.sym == SDLK_TAB ){ current_button_state.button = -20; } else if ( getcursor_flag && event->keysym.sym == SDLK_UP ){ current_button_state.button = -40; sprintf(current_button_state.str, "UP"); } else if ( getcursor_flag && event->keysym.sym == SDLK_RIGHT ){ current_button_state.button = -41; sprintf(current_button_state.str, "RIGHT"); } else if ( getcursor_flag && event->keysym.sym == SDLK_DOWN ){ current_button_state.button = -42; sprintf(current_button_state.str, "DOWN"); } else if ( getcursor_flag && event->keysym.sym == SDLK_LEFT ){ current_button_state.button = -43; sprintf(current_button_state.str, "LEFT"); } else if ( getinsert_flag && event->keysym.sym == SDLK_INSERT ){ current_button_state.button = -50; } else if ( getzxc_flag && event->keysym.sym == SDLK_z ){ current_button_state.button = -51; } else if ( getzxc_flag && event->keysym.sym == SDLK_x ){ current_button_state.button = -52; } else if ( getzxc_flag && event->keysym.sym == SDLK_c ){ current_button_state.button = -53; } else if ( getfunction_flag && event->keysym.sym >= SDLK_F1 && event->keysym.sym <= SDLK_F12 ){ current_button_state.button = -21-(event->keysym.sym - SDLK_F1); sprintf(current_button_state.str, "F%d", event->keysym.sym - SDLK_F1+1); } else if ( bexec_flag && event->keysym.sym >= SDLK_0 && event->keysym.sym <= SDLK_9 ){ current_button_state.button = -1; // dummy sprintf(current_button_state.str, "%d", event->keysym.sym - SDLK_0); } else if ( bexec_flag && event->keysym.sym >= SDLK_a && event->keysym.sym <= SDLK_z ){ current_button_state.button = -1; // dummy sprintf(current_button_state.str, "%c", 'A' + event->keysym.sym - SDLK_a); } else if ( bexec_flag && (event->keysym.sym == SDLK_RSHIFT || event->keysym.sym == SDLK_LSHIFT) ){ current_button_state.button = -1; // dummy sprintf(current_button_state.str, "SHIFT"); } if ( current_button_state.button != 0 ){ stopAnimation( clickstr_state ); return true; } } if ( event_mode & WAIT_INPUT_MODE && ( autoclick_time == 0 || (event_mode & WAIT_BUTTON_MODE)) ){ if (event->keysym.sym == SDLK_RETURN || event->keysym.sym == SDLK_KP_ENTER || event->keysym.sym == SDLK_SPACE ){ if (!(event_mode & WAIT_TEXT_MODE)) skip_mode |= SKIP_TO_EOL; playClickVoice(); stopAnimation( clickstr_state ); return true; } } if ( event_mode & WAIT_INPUT_MODE ){ if (event->keysym.sym == SDLK_s && !automode_flag ){ skip_mode |= SKIP_NORMAL; printf("toggle skip to true\n"); stopAnimation( clickstr_state ); return true; } else if (event->keysym.sym == SDLK_o){ if (skip_mode & SKIP_TO_EOP) skip_mode &= ~SKIP_TO_EOP; else skip_mode |= SKIP_TO_EOP; printf("toggle draw one page flag to %s\n", (skip_mode & SKIP_TO_EOP?"true":"false") ); if ( skip_mode & SKIP_TO_EOP ){ stopAnimation( clickstr_state ); return true; } } else if ( event->keysym.sym == SDLK_a && !automode_flag ){ automode_flag = true; skip_mode &= ~SKIP_NORMAL; printf("change to automode\n"); stopAnimation( clickstr_state ); return true; } else if ( event->keysym.sym == SDLK_0 ){ if (++text_speed_no > 2) text_speed_no = 0; sentence_font.wait_time = -1; } else if ( event->keysym.sym == SDLK_1 ){ text_speed_no = 0; sentence_font.wait_time = -1; } else if ( event->keysym.sym == SDLK_2 ){ text_speed_no = 1; sentence_font.wait_time = -1; } else if ( event->keysym.sym == SDLK_3 ){ text_speed_no = 2; sentence_font.wait_time = -1; } } if ( event_mode & ( WAIT_INPUT_MODE | WAIT_BUTTON_MODE ) ){ if ( event->keysym.sym == SDLK_f ){ if ( fullscreen_mode ) menu_windowCommand(); else menu_fullCommand(); } } return false; } void ONScripter::timerEvent() { if (remaining_time == 0){ SDL_Event event; event.type = ONS_BREAK_EVENT; SDL_PushEvent(&event); return; } int duration = 0; if (event_mode & WAIT_TIMER_MODE){ proceedAnimation(); duration = calcDurationToNextAnimation(); } if (duration > 0){ if (remaining_time > duration){ remaining_time -= duration; } else if (remaining_time > 0){ duration = remaining_time; remaining_time = 0; } stepAnimation(duration); if (timer_id) SDL_RemoveTimer(timer_id); timer_id = SDL_AddTimer(duration, timerCallback, NULL); } else if (remaining_time > 0){ if (timer_id) SDL_RemoveTimer(timer_id); timer_id = SDL_AddTimer(remaining_time, timerCallback, NULL); remaining_time = 0; } } void ONScripter::runEventLoop() { SDL_Event event, tmp_event; while ( SDL_WaitEvent(&event) ) { bool ret = false; // ignore continous SDL_MOUSEMOTION while (event.type == SDL_MOUSEMOTION){ #if SDL_VERSION_ATLEAST(1, 3, 0) if ( SDL_PeepEvents( &tmp_event, 1, SDL_PEEKEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT ) == 0 ) break; if (tmp_event.type != SDL_MOUSEMOTION) break; SDL_PeepEvents( &tmp_event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT ); #else if ( SDL_PeepEvents( &tmp_event, 1, SDL_PEEKEVENT, SDL_ALLEVENTS ) == 0 ) break; if (tmp_event.type != SDL_MOUSEMOTION) break; SDL_PeepEvents( &tmp_event, 1, SDL_GETEVENT, SDL_ALLEVENTS ); #endif event = tmp_event; } switch (event.type) { #if defined(IOS) // || defined(ANDROID) case SDL_FINGERMOTION: { SDL_Touch *touch = SDL_GetTouch(event.tfinger.touchId); tmp_event.motion.x = device_width *event.tfinger.x/touch->xres - (device_width -screen_device_width)/2; tmp_event.motion.y = device_height*event.tfinger.y/touch->yres - (device_height-screen_device_height)/2; if (mouseMoveEvent( &tmp_event.motion )) return; if (btndown_flag){ event.button.type = SDL_MOUSEBUTTONDOWN; event.button.button = SDL_BUTTON_LEFT; if (touch->num_fingers >= 2) event.button.button = SDL_BUTTON_RIGHT; event.button.x = tmp_event.motion.x; event.button.y = tmp_event.motion.y; ret = mousePressEvent( &event.button ); if (ret) return; } } break; case SDL_FINGERDOWN: { SDL_Touch *touch = SDL_GetTouch(event.tfinger.touchId); tmp_event.motion.x = device_width *event.tfinger.x/touch->xres - (device_width -screen_device_width)/2; tmp_event.motion.y = device_height*event.tfinger.y/touch->yres - (device_height-screen_device_height)/2; if (mouseMoveEvent( &tmp_event.motion )) return; } if ( btndown_flag ){ SDL_Touch *touch = SDL_GetTouch(event.tfinger.touchId); tmp_event.button.type = SDL_MOUSEBUTTONDOWN; tmp_event.button.button = SDL_BUTTON_LEFT; if (touch->num_fingers >= 2) tmp_event.button.button = SDL_BUTTON_RIGHT; tmp_event.button.x = device_width *event.tfinger.x/touch->xres - (device_width -screen_device_width)/2; tmp_event.button.y = device_height*event.tfinger.y/touch->yres - (device_height-screen_device_height)/2; ret = mousePressEvent( &tmp_event.button ); } { SDL_Touch *touch = SDL_GetTouch(event.tfinger.touchId); num_fingers = touch->num_fingers; if (num_fingers >= 3){ tmp_event.key.keysym.sym = SDLK_LCTRL; ret |= keyDownEvent( &tmp_event.key ); } } if (ret) return; break; case SDL_FINGERUP: if (num_fingers == 0) break; { SDL_Touch *touch = SDL_GetTouch(event.tfinger.touchId); tmp_event.button.type = SDL_MOUSEBUTTONUP; tmp_event.button.button = SDL_BUTTON_LEFT; if (touch->num_fingers >= 1) tmp_event.button.button = SDL_BUTTON_RIGHT; tmp_event.button.x = device_width *event.tfinger.x/touch->xres - (device_width -screen_device_width)/2; tmp_event.button.y = device_height*event.tfinger.y/touch->yres - (device_height-screen_device_height)/2; ret = mousePressEvent( &tmp_event.button ); } tmp_event.key.keysym.sym = SDLK_LCTRL; keyUpEvent( &tmp_event.key ); num_fingers = 0; if (ret) return; break; #else case SDL_MOUSEMOTION: if (mouseMoveEvent( &event.motion )) return; if (btndown_flag){ if (event.motion.state & SDL_BUTTON(SDL_BUTTON_LEFT)) tmp_event.button.button = SDL_BUTTON_LEFT; else if (event.motion.state & SDL_BUTTON(SDL_BUTTON_RIGHT)) tmp_event.button.button = SDL_BUTTON_RIGHT; else break; tmp_event.button.type = SDL_MOUSEBUTTONDOWN; tmp_event.button.x = event.motion.x; tmp_event.button.y = event.motion.y; ret = mousePressEvent( &tmp_event.button ); if (ret) return; } break; case SDL_MOUSEBUTTONDOWN: current_button_state.event_type = event.type; current_button_state.event_button = event.button.button; if ( !btndown_flag ) break; case SDL_MOUSEBUTTONUP: current_button_state.event_type = event.type; current_button_state.event_button = event.button.button; ret = mousePressEvent( &event.button ); if (ret) return; break; #endif case SDL_JOYBUTTONDOWN: event.key.type = SDL_KEYDOWN; event.key.keysym.sym = transJoystickButton(event.jbutton.button); if(event.key.keysym.sym == SDLK_UNKNOWN) break; case SDL_KEYDOWN: event.key.keysym.sym = transKey(event.key.keysym.sym); ret = keyDownEvent( &event.key ); if ( btndown_flag ) ret |= keyPressEvent( &event.key ); if (ret) return; break; case SDL_JOYBUTTONUP: event.key.type = SDL_KEYUP; event.key.keysym.sym = transJoystickButton(event.jbutton.button); if(event.key.keysym.sym == SDLK_UNKNOWN) break; case SDL_KEYUP: event.key.keysym.sym = transKey(event.key.keysym.sym); keyUpEvent( &event.key ); ret = keyPressEvent( &event.key ); if (ret) return; break; case SDL_JOYAXISMOTION: { SDL_KeyboardEvent ke = transJoystickAxis(event.jaxis); if (ke.keysym.sym != SDLK_UNKNOWN){ if (ke.type == SDL_KEYDOWN){ keyDownEvent( &ke ); if (btndown_flag) keyPressEvent( &ke ); } else if (ke.type == SDL_KEYUP){ keyUpEvent( &ke ); keyPressEvent( &ke ); } } break; } case ONS_TIMER_EVENT: timerEvent(); break; case ONS_MUSIC_EVENT: case ONS_BGMFADE_EVENT: case ONS_CDAUDIO_EVENT: case ONS_MIDI_EVENT: flushEventSub( event ); break; case ONS_CHUNK_EVENT: flushEventSub( event ); //printf("ONS_CHUNK_EVENT %d: %x %d %x\n", event.user.code, wave_sample[0], automode_flag, event_mode); if ( event.user.code != 0 || !(event_mode & WAIT_VOICE_MODE) ) break; event_mode &= ~WAIT_VOICE_MODE; case ONS_BREAK_EVENT: if (event_mode & WAIT_VOICE_MODE && wave_sample[0]){ remaining_time = -1; timerEvent(); break; } if (automode_flag || autoclick_time > 0) current_button_state.button = 0; else if ( usewheel_flag ){ current_button_state.button = -5; sprintf(current_button_state.str, "TIMEOUT"); } else{ current_button_state.button = -2; sprintf(current_button_state.str, "TIMEOUT"); } if (event_mode & (WAIT_INPUT_MODE | WAIT_BUTTON_MODE) && ( clickstr_state == CLICK_WAIT || clickstr_state == CLICK_NEWPAGE ) ){ playClickVoice(); stopAnimation( clickstr_state ); } return; case SDL_ACTIVEEVENT: if ( !event.active.gain ){ // the mouse cursor leaves the window SDL_MouseMotionEvent mevent; mevent.x = screen_device_width; mevent.y = screen_device_height; mouseMoveEvent( &mevent ); break; } #ifdef ANDROID if (event.active.state == SDL_APPACTIVE){ screen_surface = SDL_SetVideoMode( screen_width, screen_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG ); repaintCommand(); break; } #endif case SDL_VIDEOEXPOSE: #ifdef USE_SDL_RENDERER SDL_RenderPresent(renderer); #else SDL_UpdateRect( screen_surface, 0, 0, screen_width, screen_height ); #endif break; case SDL_QUIT: endCommand(); break; default: break; } } } onscripter-20150820/AnimationInfo.cpp0000644017777601777760000007663312565174244017256 0ustar nobodynogroup/* -*- C++ -*- * * AnimationInfo.cpp - General image storage class of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "AnimationInfo.h" #include #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #if defined(BPP16) #define RMASK 0xf800 #define GMASK 0x07e0 #define BMASK 0x001f #define AMASK 0 #else #define RMASK 0x00ff0000 #define GMASK 0x0000ff00 #define BMASK 0x000000ff #define AMASK 0xff000000 #define RBMASK (RMASK|BMASK) #endif #if !defined(BPP16) static bool is_inv_alpha_lut_initialized = false; static Uint32 inv_alpha_lut[256]; #endif AnimationInfo::AnimationInfo() { is_copy = false; image_name = NULL; surface_name = NULL; mask_surface_name = NULL; image_surface = NULL; alpha_buf = NULL; duration_list = NULL; color_list = NULL; file_name = NULL; mask_file_name = NULL; trans_mode = TRANS_TOPLEFT; affine_flag = false; #if !defined(BPP16) if (!is_inv_alpha_lut_initialized){ inv_alpha_lut[0] = 255; for (int i=1; i<255; i++) inv_alpha_lut[i] = (Uint32)(0xffff / i); is_inv_alpha_lut_initialized = true; } #endif reset(); } AnimationInfo::AnimationInfo(const AnimationInfo &anim) { memcpy(this, &anim, sizeof(AnimationInfo)); is_copy = true; } AnimationInfo::~AnimationInfo() { if (!is_copy) reset(); } AnimationInfo& AnimationInfo::operator =(const AnimationInfo &anim) { if (this != &anim){ memcpy(this, &anim, sizeof(AnimationInfo)); is_copy = true; } return *this; } void AnimationInfo::reset() { remove(); trans = -1; orig_pos.x = orig_pos.y = 0; pos.x = pos.y = 0; visible = false; abs_flag = true; scale_x = scale_y = rot = 0; blending_mode = BLEND_NORMAL; font_size_xy[0] = font_size_xy[1] = -1; font_pitch[0] = font_pitch[1] = -1; mat[0][0] = 1024; mat[0][1] = 0; mat[1][0] = 0; mat[1][1] = 1024; } void AnimationInfo::deleteImageName(){ if ( image_name ) delete[] image_name; image_name = NULL; } void AnimationInfo::setImageName( const char *name ){ deleteImageName(); image_name = new char[ strlen(name) + 1 ]; strcpy( image_name, name ); } void AnimationInfo::deleteSurface(bool delete_surface_name) { if (delete_surface_name){ if ( surface_name ) delete[] surface_name; surface_name = NULL; if ( mask_surface_name ) delete[] mask_surface_name; mask_surface_name = NULL; } if ( image_surface ) SDL_FreeSurface( image_surface ); image_surface = NULL; if (alpha_buf) delete[] alpha_buf; alpha_buf = NULL; } void AnimationInfo::remove(){ deleteImageName(); deleteSurface(); removeTag(); } void AnimationInfo::removeTag(){ if ( duration_list ){ delete[] duration_list; duration_list = NULL; } if ( color_list ){ delete[] color_list; color_list = NULL; } if ( file_name ){ delete[] file_name; file_name = NULL; } if ( mask_file_name ){ delete[] mask_file_name; mask_file_name = NULL; } current_cell = 0; num_of_cells = 0; remaining_time = 0; is_animatable = false; is_single_line = true; is_tight_region = true; is_ruby_drawable = false; direction = 1; color[0] = color[1] = color[2] = 0; } // 0 ... restart at the end // 1 ... stop at the end // 2 ... reverse at the end // 3 ... no animation void AnimationInfo::stepAnimation(int t) { if (visible && is_animatable) remaining_time -= t; } bool AnimationInfo::proceedAnimation() { if (!visible || !is_animatable || remaining_time > 0) return false; bool is_changed = false; if ( loop_mode != 3 && num_of_cells > 1 ){ current_cell += direction; is_changed = true; } if ( current_cell < 0 ){ // loop_mode must be 2 current_cell = 1; direction = 1; } else if ( current_cell >= num_of_cells ){ if ( loop_mode == 0 ){ current_cell = 0; } else if ( loop_mode == 1 ){ current_cell = num_of_cells - 1; is_changed = false; } else{ current_cell = num_of_cells - 2; direction = -1; } } remaining_time = duration_list[ current_cell ]; return is_changed; } void AnimationInfo::setCell(int cell) { if (cell < 0) cell = 0; else if (cell >= num_of_cells) cell = num_of_cells - 1; current_cell = cell; } int AnimationInfo::doClipping( SDL_Rect *dst, SDL_Rect *clip, SDL_Rect *clipped ) { if ( clipped ) clipped->x = clipped->y = 0; if ( !dst || dst->x >= clip->x + clip->w || dst->x + dst->w <= clip->x || dst->y >= clip->y + clip->h || dst->y + dst->h <= clip->y ) return -1; if ( dst->x < clip->x ){ dst->w -= clip->x - dst->x; if ( clipped ) clipped->x = clip->x - dst->x; dst->x = clip->x; } if ( clip->x + clip->w < dst->x + dst->w ){ dst->w = clip->x + clip->w - dst->x; } if ( dst->y < clip->y ){ dst->h -= clip->y - dst->y; if ( clipped ) clipped->y = clip->y - dst->y; dst->y = clip->y; } if ( clip->y + clip->h < dst->y + dst->h ){ dst->h = clip->y + clip->h - dst->y; } if ( clipped ){ clipped->w = dst->w; clipped->h = dst->h; } return 0; } #if defined(BPP16) #define BLEND_PIXEL(){\ if ((*alphap == 255) && (alpha == 255)){\ *dst_buffer = *src_buffer;\ }\ else if (*alphap != 0){\ mask2 = (*alphap * alpha) >> 11;\ Uint32 s1 = (*src_buffer | *src_buffer << 16) & 0x07e0f81f;\ Uint32 d1 = (*dst_buffer | *dst_buffer << 16) & 0x07e0f81f;\ Uint32 mask1 = (d1 + ((s1-d1) * mask2 >> 5)) & 0x07e0f81f;\ *dst_buffer = mask1 | mask1 >> 16;\ }\ alphap++;\ } #else #define BLEND_PIXEL(){\ if ((*alphap == 255) && (alpha == 255)){\ *dst_buffer = *src_buffer;\ }\ else if (*alphap != 0){\ mask2 = (*alphap * alpha) >> 8;\ Uint32 temp = *dst_buffer & 0xff00ff;\ Uint32 mask_rb = (((((*src_buffer & 0xff00ff) - temp ) * mask2 ) >> 8 ) + temp ) & 0xff00ff;\ temp = *dst_buffer & 0x00ff00;\ Uint32 mask_g = (((((*src_buffer & 0x00ff00) - temp ) * mask2 ) >> 8 ) + temp ) & 0x00ff00;\ *dst_buffer = mask_rb | mask_g | 0xff000000;\ } \ alphap += 4;\ } // Originally, the above looks like this. // mask1 = mask2 ^ 0xff; // Uint32 mask_rb = (((*dst_buffer & 0xff00ff) * mask1 + // (*src_buffer & 0xff00ff) * mask2) >> 8) & 0xff00ff; // Uint32 mask_g = (((*dst_buffer & 0x00ff00) * mask1 + // (*src_buffer & 0x00ff00) * mask2) >> 8) & 0x00ff00; #endif #if defined(BPP16) #define ADDBLEND_PIXEL(){\ mask2 = (*alphap * alpha) >> 11;\ Uint32 s1 = (*src_buffer | *src_buffer << 16) & 0x07e0f81f;\ Uint32 d1 = (*dst_buffer | *dst_buffer << 16) & 0x07e0f81f;\ Uint32 mask1 = d1 + (((s1 * mask2) >> 5) & 0x07e0f81f);\ mask1 |= ((mask1 & 0xf8000000) ? 0x07e00000 : 0) |\ ((mask1 & 0x001f0000) ? 0x0000f800 : 0) |\ ((mask1 & 0x000007e0) ? 0x0000001f : 0);\ mask1 &= 0x07e0f81f;\ *dst_buffer = mask1 | mask1 >> 16;\ alphap++;\ } #else #define ADDBLEND_PIXEL(){\ mask2 = (*alphap * alpha) >> 8;\ Uint32 mask_rb = (*dst_buffer & RBMASK) +\ ((((*src_buffer & RBMASK) * mask2) >> 8) & RBMASK);\ mask_rb |= ((mask_rb & AMASK) ? RMASK : 0) |\ ((mask_rb & GMASK) ? BMASK : 0);\ Uint32 mask_g = (*dst_buffer & GMASK) +\ ((((*src_buffer & GMASK) * mask2) >> 8) & GMASK);\ mask_g |= ((mask_g & RMASK) ? GMASK : 0);\ *dst_buffer = (mask_rb & RBMASK) | (mask_g & GMASK) | 0xff000000;\ alphap += 4;\ } #endif #if defined(BPP16) #define SUBBLEND_PIXEL(){\ mask2 = (*alphap * alpha) >> 11;\ Uint32 mask_r = (*dst_buffer & RMASK) -\ ((((*src_buffer & RMASK) * mask2) >> 5) & RMASK);\ mask_r &= ((mask_r & 0x001f0000) ? 0 : RMASK);\ Uint32 mask_g = (*dst_buffer & GMASK) -\ ((((*src_buffer & GMASK) * mask2) >> 5) & GMASK);\ mask_g &= ((mask_g & ~(GMASK | BMASK)) ? 0 : GMASK);\ Uint32 mask_b = (*dst_buffer & BMASK) -\ ((((*src_buffer & BMASK) * mask2) >> 5) & BMASK);\ mask_b &= ((mask_b & ~BMASK) ? 0 : BMASK);\ *dst_buffer = (mask_r & RMASK) | (mask_g & GMASK) | (mask_b & BMASK);\ alphap++;\ } #else #define SUBBLEND_PIXEL(){\ mask2 = (*alphap * alpha) >> 8;\ Uint32 mask_r = (*dst_buffer & RMASK) -\ ((((*src_buffer & RMASK) * mask2) >> 8) & RMASK);\ mask_r &= ((mask_r & AMASK) ? 0 : RMASK);\ Uint32 mask_g = (*dst_buffer & GMASK) -\ ((((*src_buffer & GMASK) * mask2) >> 8) & GMASK);\ mask_g &= ((mask_g & ~(GMASK | BMASK)) ? 0 : GMASK);\ Uint32 mask_b = (*dst_buffer & BMASK) -\ ((((*src_buffer & BMASK) * mask2) >> 8) & BMASK);\ mask_b &= ((mask_b & ~BMASK) ? 0 : BMASK);\ *dst_buffer = (mask_r & RMASK) | (mask_g & GMASK) | (mask_b & BMASK) | 0xff000000;\ alphap += 4;\ } #endif void AnimationInfo::blendOnSurface( SDL_Surface *dst_surface, int dst_x, int dst_y, SDL_Rect &clip, int alpha ) { if ( image_surface == NULL ) return; SDL_Rect dst_rect, src_rect; dst_rect.x = dst_x; dst_rect.y = dst_y; dst_rect.w = pos.w; dst_rect.h = pos.h; if ( doClipping( &dst_rect, &clip, &src_rect ) ) return; /* ---------------------------------------- */ SDL_LockSurface( dst_surface ); SDL_LockSurface( image_surface ); alpha &= 0xff; int pitch = image_surface->pitch / sizeof(ONSBuf); ONSBuf *src_buffer = (ONSBuf *)image_surface->pixels + pitch * src_rect.y + image_surface->w*current_cell/num_of_cells + src_rect.x; ONSBuf *dst_buffer = (ONSBuf *)dst_surface->pixels + dst_surface->w * dst_rect.y + dst_rect.x; #if defined(BPP16) unsigned char *alphap = alpha_buf + image_surface->w * src_rect.y + image_surface->w*current_cell/num_of_cells + src_rect.x; #else #if SDL_BYTEORDER == SDL_LIL_ENDIAN unsigned char *alphap = (unsigned char *)src_buffer + 3; #else unsigned char *alphap = (unsigned char *)src_buffer; #endif #endif Uint32 mask2; for (int i=0 ; iw - dst_rect.w; #else alphap += (image_surface->w - dst_rect.w)*4; #endif dst_buffer += dst_surface->w - dst_rect.w; } SDL_UnlockSurface( image_surface ); SDL_UnlockSurface( dst_surface ); } void AnimationInfo::blendOnSurface2( SDL_Surface *dst_surface, int dst_x, int dst_y, SDL_Rect &clip, int alpha ) { if ( image_surface == NULL ) return; if (scale_x == 0 || scale_y == 0) return; int i, x, y; // project corner point and calculate bounding box int min_xy[2]={bounding_rect.x, bounding_rect.y}; int max_xy[2]={bounding_rect.x+bounding_rect.w-1, bounding_rect.y+bounding_rect.h-1}; // clip bounding box if (max_xy[0] < clip.x) return; if (max_xy[0] >= clip.x + clip.w) max_xy[0] = clip.x + clip.w - 1; if (min_xy[0] >= clip.x + clip.w) return; if (min_xy[0] < clip.x) min_xy[0] = clip.x; if (max_xy[1] < clip.y) return; if (max_xy[1] >= clip.y + clip.h) max_xy[1] = clip.y + clip.h - 1; if (min_xy[1] >= clip.y + clip.h) return; if (min_xy[1] < clip.y) min_xy[1] = clip.y; if (min_xy[1] < 0) min_xy[1] = 0; if (max_xy[1] >= dst_surface->h) max_xy[1] = dst_surface->h - 1; SDL_LockSurface( dst_surface ); SDL_LockSurface( image_surface ); Uint32 mask2; alpha &= 0xff; int pitch = image_surface->pitch / sizeof(ONSBuf); // set pixel by inverse-projection with raster scan for (y=min_xy[1] ; y<= max_xy[1] ; y++){ // calculate the start and end point for each raster scan int raster_min = min_xy[0], raster_max = max_xy[0]; for (i=0 ; i<4 ; i++){ int i2 = (i+1)&3; // = (i+1)%4 if (corner_xy[i][1] == corner_xy[i2][1]) continue; x = (corner_xy[i2][0] - corner_xy[i][0])*(y-corner_xy[i][1])/(corner_xy[i2][1] - corner_xy[i][1]) + corner_xy[i][0]; if (corner_xy[i2][1] - corner_xy[i][1] > 0){ if (raster_min < x) raster_min = x; } else{ if (raster_max > x) raster_max = x; } } if (raster_min < 0) raster_min = 0; if (raster_max >= dst_surface->w) raster_max = dst_surface->w - 1; ONSBuf *dst_buffer = (ONSBuf *)dst_surface->pixels + dst_surface->w * y + raster_min; // inverse-projection int x_offset2 = (inv_mat[0][1] * (y-dst_y) >> 9) + pos.w; int y_offset2 = (inv_mat[1][1] * (y-dst_y) >> 9) + pos.h; for (x=raster_min-dst_x ; x<=raster_max-dst_x ; x++, dst_buffer++){ int x2 = ((inv_mat[0][0] * x >> 9) + x_offset2) >> 1; int y2 = ((inv_mat[1][0] * x >> 9) + y_offset2) >> 1; if (x2 < 0 || x2 >= pos.w || y2 < 0 || y2 >= pos.h) continue; ONSBuf *src_buffer = (ONSBuf *)image_surface->pixels + pitch * y2 + x2 + pos.w*current_cell; #if defined(BPP16) unsigned char *alphap = alpha_buf + image_surface->w * y2 + x2 + pos.w*current_cell; #else #if SDL_BYTEORDER == SDL_LIL_ENDIAN unsigned char *alphap = (unsigned char *)src_buffer + 3; #else unsigned char *alphap = (unsigned char *)src_buffer; #endif #endif if (blending_mode == BLEND_NORMAL) BLEND_PIXEL() else if (blending_mode == BLEND_ADD) ADDBLEND_PIXEL() else SUBBLEND_PIXEL(); } } // unlock surface SDL_UnlockSurface( image_surface ); SDL_UnlockSurface( dst_surface ); } #if defined(BPP16) #define BLEND_TEXT_ALPHA()\ {\ Uint32 mask2 = *src_buffer; \ if (mask2 != 0){ \ *alphap = 0xff ^ ((0xff ^ *alphap)*(0xff ^ mask2) >> 8); \ mask2 = (mask2 << 5) / *alphap; \ Uint32 d1 = (*dst_buffer | *dst_buffer << 16) & 0x07e0f81f; \ Uint32 mask = (d1 + ((src_color - d1) * mask2 >> 5)) & 0x07e0f81f; \ *dst_buffer = mask | mask >> 16; \ } \ alphap++; \ } #else #define BLEND_TEXT_ALPHA()\ {\ Uint32 mask2 = *src_buffer; \ if (mask2 == 255){ \ *dst_buffer = src_color; \ } \ else if (mask2 != 0){ \ Uint32 alpha = *dst_buffer >> 24; \ Uint32 mask1 = ((0xff ^ mask2)*alpha) >> 8; \ alpha = inv_alpha_lut[ mask1+mask2 ]; \ Uint32 mask_rb = ((*dst_buffer & 0xff00ff) * mask1 + \ src_color1 * mask2); \ mask_rb = (((mask_rb >> 16) * alpha) & 0x00ff0000) | \ (((mask_rb & 0xffff) * alpha >> 16) & 0xff); \ Uint32 mask_g = (((*dst_buffer & 0x00ff00) * mask1 + \ src_color2 * mask2) * alpha >> 16) & 0x00ff00; \ *dst_buffer = mask_rb | mask_g | ((mask1+mask2) << 24); \ } \ } // Originally, the above looks like this. // Uint32 alpha = *dst_buffer >> 24; // Uint32 mask1 = ((0xff ^ mask2)*alpha) >> 8; // alpha = 0xff ^ ((0xff ^ alpha)*(0xff ^ mask2) >> 8); // Uint32 mask_rb = ((*dst_buffer & 0xff00ff) * mask1 + // src_color1 * mask2); // mask_rb = ((mask_rb / alpha) & 0x00ff0000) | // (((mask_rb & 0xffff) / alpha) & 0xff); // Uint32 mask_g = (((*dst_buffer & 0x00ff00) * mask1 + // src_color2 * mask2) / alpha) & 0x00ff00; // *dst_buffer = mask_rb | mask_g | (alpha << 24); #endif // used to draw characters on text_surface // Alpha = 1 - (1-Da)(1-Sa) // Color = (DaSaSc + Da(1-Sa)Dc + Sa(1-Da)Sc)/A void AnimationInfo::blendText( SDL_Surface *surface, int dst_x, int dst_y, SDL_Color &color, SDL_Rect *clip, bool rotate_flag ) { if (image_surface == NULL || surface == NULL) return; SDL_Rect dst_rect; dst_rect.x = dst_x; dst_rect.y = dst_y; dst_rect.w = surface->w; dst_rect.h = surface->h; if (rotate_flag){ dst_rect.w = surface->h; dst_rect.h = surface->w; } SDL_Rect src_rect = {0, 0, 0, 0}; SDL_Rect clipped_rect; /* ---------------------------------------- */ /* 1st clipping */ if ( clip ){ if ( doClipping( &dst_rect, clip, &clipped_rect ) ) return; src_rect.x += clipped_rect.x; src_rect.y += clipped_rect.y; } /* ---------------------------------------- */ /* 2nd clipping */ SDL_Rect clip_rect; clip_rect.x = clip_rect.y = 0; clip_rect.w = image_surface->w; clip_rect.h = image_surface->h; if ( doClipping( &dst_rect, &clip_rect, &clipped_rect ) ) return; src_rect.x += clipped_rect.x; src_rect.y += clipped_rect.y; /* ---------------------------------------- */ SDL_LockSurface( surface ); SDL_LockSurface( image_surface ); SDL_PixelFormat *fmt = image_surface->format; int pitch = image_surface->pitch / sizeof(ONSBuf); Uint32 src_color1 = (((color.r >> fmt->Rloss) << fmt->Rshift) | ((color.b >> fmt->Bloss) << fmt->Bshift)); Uint32 src_color2 = ((color.g >> fmt->Gloss) << fmt->Gshift); Uint32 src_color = src_color1 | src_color2 | fmt->Amask; #if defined(BPP16) src_color = (src_color | src_color << 16) & 0x07e0f81f; #endif ONSBuf *dst_buffer = (ONSBuf *)image_surface->pixels + pitch * dst_rect.y + image_surface->w*current_cell/num_of_cells + dst_rect.x; #if defined(BPP16) unsigned char *alphap = alpha_buf + image_surface->w * dst_rect.y + image_surface->w*current_cell/num_of_cells + dst_rect.x; #endif if (!rotate_flag){ unsigned char *src_buffer = (unsigned char*)surface->pixels + surface->pitch*src_rect.y + src_rect.x; for (int i=dst_rect.h ; i!=0 ; i--){ for (int j=dst_rect.w ; j!=0 ; j--){ BLEND_TEXT_ALPHA(); src_buffer++; dst_buffer++; } dst_buffer += pitch - dst_rect.w; #if defined(BPP16) alphap += image_surface->w - dst_rect.w; #endif src_buffer += surface->pitch - dst_rect.w; } } else{ for (int i=0 ; ipixels + surface->pitch*(surface->h - src_rect.x - 1) + src_rect.y + i; for (int j=dst_rect.w ; j!=0 ; j--){ BLEND_TEXT_ALPHA(); src_buffer -= surface->pitch; dst_buffer++; } dst_buffer += pitch - dst_rect.w; #if defined(BPP16) alphap += image_surface->w - dst_rect.w; #endif } } SDL_UnlockSurface( image_surface ); SDL_UnlockSurface( surface ); } void AnimationInfo::calcAffineMatrix() { // calculate forward matrix // |mat[0][0] mat[0][1]| // |mat[1][0] mat[1][1]| int cos_i = 1024, sin_i = 0; if (rot != 0){ cos_i = (int)(1024.0 * cos(-M_PI*rot/180)); sin_i = (int)(1024.0 * sin(-M_PI*rot/180)); } mat[0][0] = cos_i*scale_x/100; mat[0][1] = -sin_i*scale_y/100; mat[1][0] = sin_i*scale_x/100; mat[1][1] = cos_i*scale_y/100; // calculate bounding box int min_xy[2] = { 0, 0 }, max_xy[2] = { 0, 0 }; for (int i=0 ; i<4 ; i++){ int c_x = (i<2)?(-pos.w/2):(pos.w/2); int c_y = ((i+1)&2)?(pos.h/2):(-pos.h/2); if (scale_x < 0) c_x = -c_x; if (scale_y < 0) c_y = -c_y; corner_xy[i][0] = (mat[0][0] * c_x + mat[0][1] * c_y) / 1024 + pos.x; corner_xy[i][1] = (mat[1][0] * c_x + mat[1][1] * c_y) / 1024 + pos.y; if (i==0 || min_xy[0] > corner_xy[i][0]) min_xy[0] = corner_xy[i][0]; if (i==0 || max_xy[0] < corner_xy[i][0]) max_xy[0] = corner_xy[i][0]; if (i==0 || min_xy[1] > corner_xy[i][1]) min_xy[1] = corner_xy[i][1]; if (i==0 || max_xy[1] < corner_xy[i][1]) max_xy[1] = corner_xy[i][1]; } bounding_rect.x = min_xy[0]; bounding_rect.y = min_xy[1]; bounding_rect.w = max_xy[0]-min_xy[0]+1; bounding_rect.h = max_xy[1]-min_xy[1]+1; // calculate inverse matrix int denom = scale_x*scale_y; if (denom == 0) return; inv_mat[0][0] = mat[1][1] * 10000 / denom; inv_mat[0][1] = -mat[0][1] * 10000 / denom; inv_mat[1][0] = -mat[1][0] * 10000 / denom; inv_mat[1][1] = mat[0][0] * 10000 / denom; } SDL_Surface *AnimationInfo::allocSurface( int w, int h, Uint32 texture_format ) { SDL_Surface *surface; if (texture_format == SDL_PIXELFORMAT_RGB565) surface = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 16, 0xf800, 0x07e0, 0x001f, 0); else if (texture_format == SDL_PIXELFORMAT_ABGR8888) surface = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000); else // texture_format == SDL_PIXELFORMAT_ARGB8888 surface = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); SDL_SetAlpha(surface, 0, SDL_ALPHA_OPAQUE); #if defined(USE_SDL_RENDERER) || defined(ANDROID) SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE); #endif return surface; } SDL_Surface *AnimationInfo::alloc32bitSurface( int w, int h, Uint32 texture_format ) { if (texture_format == SDL_PIXELFORMAT_RGB565) return allocSurface(w, h, SDL_PIXELFORMAT_ARGB8888); else return allocSurface(w, h, texture_format); } void AnimationInfo::allocImage( int w, int h, Uint32 texture_format ) { if (!image_surface || image_surface->w != w || image_surface->h != h){ deleteSurface(false); image_surface = allocSurface( w, h, texture_format ); #if defined(BPP16) alpha_buf = new unsigned char[w*h]; #endif } abs_flag = true; pos.w = w / num_of_cells; pos.h = h; } void AnimationInfo::copySurface( SDL_Surface *surface, SDL_Rect *src_rect, SDL_Rect *dst_rect ) { if (!image_surface || !surface) return; SDL_Rect _dst_rect = {0, 0}; if (dst_rect) _dst_rect = *dst_rect; SDL_Rect _src_rect; _src_rect.x = _src_rect.y = 0; _src_rect.w = surface->w; _src_rect.h = surface->h; if (src_rect) _src_rect = *src_rect; if (_src_rect.x >= surface->w) return; if (_src_rect.y >= surface->h) return; if (_src_rect.x+_src_rect.w >= surface->w) _src_rect.w = surface->w - _src_rect.x; if (_src_rect.y+_src_rect.h >= surface->h) _src_rect.h = surface->h - _src_rect.y; if (_dst_rect.x+_src_rect.w > image_surface->w) _src_rect.w = image_surface->w - _dst_rect.x; if (_dst_rect.y+_src_rect.h > image_surface->h) _src_rect.h = image_surface->h - _dst_rect.y; SDL_LockSurface( surface ); SDL_LockSurface( image_surface ); int i; for (i=0 ; i<_src_rect.h ; i++) memcpy( (ONSBuf*)((unsigned char*)image_surface->pixels + image_surface->pitch * (_dst_rect.y+i)) + _dst_rect.x, (ONSBuf*)((unsigned char*)surface->pixels + surface->pitch * (_src_rect.y+i)) + _src_rect.x, _src_rect.w*sizeof(ONSBuf) ); #if defined(BPP16) for (i=0 ; i<_src_rect.h ; i++) memset( alpha_buf + image_surface->w * (_dst_rect.y+i) + _dst_rect.x, 0xff, _src_rect.w ); #endif SDL_UnlockSurface( image_surface ); SDL_UnlockSurface( surface ); } void AnimationInfo::fill( Uint8 r, Uint8 g, Uint8 b, Uint8 a ) { if (!image_surface) return; SDL_LockSurface( image_surface ); SDL_PixelFormat *fmt = image_surface->format; Uint32 rgb = (((r >> fmt->Rloss) << fmt->Rshift) | ((g >> fmt->Gloss) << fmt->Gshift) | ((b >> fmt->Bloss) << fmt->Bshift) | ((a >> fmt->Aloss) << fmt->Ashift)); int pitch = image_surface->pitch / sizeof(ONSBuf); for (int i=0 ; ih ; i++){ ONSBuf *dst_buffer = (ONSBuf *)image_surface->pixels + pitch*i; #if defined(BPP16) unsigned char *alphap = alpha_buf + image_surface->w*i; #endif for (int j=0 ; jw ; j++){ *dst_buffer++ = rgb; #if defined(BPP16) *alphap++ = a; #endif } } SDL_UnlockSurface( image_surface ); } SDL_Surface *AnimationInfo::setupImageAlpha( SDL_Surface *surface, SDL_Surface *surface_m, bool has_alpha ) { if (surface == NULL) return NULL; SDL_LockSurface( surface ); Uint32 *buffer = (Uint32 *)surface->pixels; SDL_PixelFormat *fmt = surface->format; int w = surface->w; int h = surface->h; int w2 = w / num_of_cells; orig_pos.w = w; orig_pos.h = h; #if SDL_BYTEORDER == SDL_LIL_ENDIAN unsigned char *alphap = (unsigned char *)buffer + 3; #else unsigned char *alphap = (unsigned char *)buffer; #endif Uint32 ref_color = 0; if ( trans_mode == TRANS_TOPLEFT ){ ref_color = *buffer; } else if ( trans_mode == TRANS_TOPRIGHT ){ ref_color = *(buffer + surface->w - 1); } else if ( trans_mode == TRANS_DIRECT ) { ref_color = direct_color[0] << fmt->Rshift | direct_color[1] << fmt->Gshift | direct_color[2] << fmt->Bshift; } ref_color &= 0xffffff; int i, j, c; if ( trans_mode == TRANS_ALPHA && !has_alpha ){ const int w22 = w2/2; const int w3 = w22 * num_of_cells; orig_pos.w = w3; SDL_PixelFormat *fmt = surface->format; SDL_Surface *surface2 = SDL_CreateRGBSurface( SDL_SWSURFACE, w3, h, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask ); SDL_LockSurface( surface2 ); Uint32 *buffer2 = (Uint32 *)surface2->pixels; #if SDL_BYTEORDER == SDL_LIL_ENDIAN alphap = (unsigned char *)buffer2 + 3; #else alphap = (unsigned char *)buffer2; #endif for (i=h ; i!=0 ; i--){ for (c=num_of_cells ; c!=0 ; c--){ for (j=w22 ; j!=0 ; j--, buffer++, alphap+=4){ *buffer2++ = *buffer; *alphap = (*(buffer + w22) & 0xff) ^ 0xff; } buffer += (w2 - w22); } buffer += surface->w - w2 *num_of_cells; buffer2 += surface2->w - w22*num_of_cells; alphap += (surface2->w - w22*num_of_cells)*4; } SDL_UnlockSurface( surface ); SDL_FreeSurface( surface ); surface = surface2; } else if ( trans_mode == TRANS_MASK ){ if (surface_m){ SDL_LockSurface( surface_m ); const int mw = surface_m->w; const int mwh = surface_m->w * surface_m->h; int i2 = 0; for (i=h ; i!=0 ; i--){ Uint32 *buffer_m = (Uint32 *)surface_m->pixels + i2; for (c=num_of_cells ; c!=0 ; c--){ int j2 = 0; for (j=w2 ; j!=0 ; j--, buffer++, alphap+=4){ *alphap = (*(buffer_m + j2) & 0xff) ^ 0xff; if (j2 >= mw) j2 = 0; else j2++; } } if (i2 >= mwh) i2 = 0; else i2 += mw; } SDL_UnlockSurface( surface_m ); } } else if ( trans_mode == TRANS_TOPLEFT || trans_mode == TRANS_TOPRIGHT || trans_mode == TRANS_DIRECT ){ for (i=h ; i!=0 ; i--){ for (j=w ; j!=0 ; j--, buffer++, alphap+=4){ if ( (*buffer & 0xffffff) == ref_color ) *alphap = 0x00; else *alphap = 0xff; } } } else if ( trans_mode == TRANS_STRING ){ for (i=h ; i!=0 ; i--){ for (j=w ; j!=0 ; j--, buffer++, alphap+=4) *alphap = *buffer >> 24; } } else if ( trans_mode != TRANS_ALPHA ){ // TRANS_COPY for (i=h ; i!=0 ; i--){ for (j=w ; j!=0 ; j--, buffer++, alphap+=4) *alphap = 0xff; } } SDL_UnlockSurface( surface ); return surface; } void AnimationInfo::setImage( SDL_Surface *surface, Uint32 texture_format ) { if (surface == NULL) return; #if !defined(BPP16) image_surface = surface; // deleteSurface() should be called beforehand #endif allocImage(surface->w, surface->h, texture_format); #if defined(BPP16) SDL_LockSurface( surface ); unsigned char *alphap = alpha_buf; for (int i=0 ; ih ; i++){ ONSBuf *dst_buffer = (ONSBuf *)((unsigned char*)image_surface->pixels + image_surface->pitch*i); Uint32 *buffer = (Uint32 *)((unsigned char*)surface->pixels + surface->pitch*i); for (int j=0 ; jw ; j++, buffer++){ // ARGB8888 -> RGB565 + alpha *dst_buffer++ = ((((*buffer)&0xf80000) >> 8) | (((*buffer)&0x00fc00) >> 5) | (((*buffer)&0x0000f8) >> 3)); *alphap++ = ((*buffer) >> 24); } } SDL_UnlockSurface( surface ); SDL_FreeSurface( surface ); #endif } unsigned char AnimationInfo::getAlpha(int x, int y) { if (image_surface == NULL) return 0; x -= pos.x; y -= pos.y; int offset_x = (image_surface->w/num_of_cells)*current_cell; unsigned char alpha = 0; #if defined(BPP16) alpha = alpha_buf[image_surface->w*y+offset_x+x]; #else int pitch = image_surface->pitch / 4; SDL_LockSurface( image_surface ); ONSBuf *buf = (ONSBuf *)image_surface->pixels + pitch*y + offset_x + x; #if SDL_BYTEORDER == SDL_LIL_ENDIAN alpha = *((unsigned char *)buf + 3); #else alpha = *((unsigned char *)buf); #endif SDL_UnlockSurface( image_surface ); #endif return alpha; } onscripter-20150820/SarReader.cpp0000644017777601777760000003122512565174244016357 0ustar nobodynogroup/* -*- C++ -*- * * SarReader.cpp - Reader from a SAR archive * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "SarReader.h" #define WRITE_LENGTH 4096 #if defined(PSP) extern int psp_power_resume_number; #endif SarReader::SarReader( const char *path, const unsigned char *key_table ) :DirectReader( path, key_table ) { root_archive_info = last_archive_info = &archive_info; num_of_sar_archives = 0; } SarReader::~SarReader() { close(); } int SarReader::open( const char *name ) { ArchiveInfo* info = new ArchiveInfo(); if ( (info->file_handle = fopen( name, "rb" ) ) == NULL ){ delete info; return -1; } info->file_name = new char[strlen(name)+1]; memcpy(info->file_name, name, strlen(name)+1); readArchive( info ); last_archive_info->next = info; last_archive_info = last_archive_info->next; num_of_sar_archives++; return 0; } void SarReader::readArchive( ArchiveInfo *ai, int archive_type, unsigned int offset ) { unsigned int i; /* Read header */ for (i=0; ifile_handle ); // for commands "ns2" and "ns3" if ( archive_type == ARCHIVE_TYPE_NS2 ) { // new archive type since NScr2.91 // - header starts with base_offset (byte-swapped), followed by // filename data - doesn't tell how many files! // - filenames are surrounded by ""s // - new NS2 filename def: "filename", length (4bytes, swapped) // - no compression type? really, no compression. // - not sure if NS2 uses key_table or not, using default funcs for now ai->base_offset = swapLong( readLong( ai->file_handle ) ); ai->base_offset += offset; // need to parse the whole header to see how many files there are ai->num_of_files = 0; long unsigned int cur_offset = offset + 4; // there's an extra byte at the end of the header, not sure what for while(1){ unsigned char ch = key_table[fgetc( ai->file_handle )]; if (ch != '"') break; cur_offset++; do cur_offset++; while( (ch = key_table[fgetc( ai->file_handle )] ) != '"' ); cur_offset += 4; readLong( ai->file_handle ); ai->num_of_files++; } ai->fi_list = new FileInfo[ ai->num_of_files ]; // now go back to the beginning and read the file info cur_offset = ai->base_offset; fseek( ai->file_handle, 4 + offset, SEEK_SET ); for ( i=0 ; inum_of_files ; i++ ){ unsigned int count = 0; //skip the beginning double-quote unsigned char ch = key_table[fgetc( ai->file_handle )]; while( (ch = key_table[fgetc( ai->file_handle )] ) != '"' ){ if ( 'a' <= ch && ch <= 'z' ) ch += 'A' - 'a'; ai->fi_list[i].name[count++] = ch; } ai->fi_list[i].name[count] = '\0'; ai->fi_list[i].compression_type = getRegisteredCompressionType( ai->fi_list[i].name ); ai->fi_list[i].offset = cur_offset; ai->fi_list[i].length = swapLong( readLong( ai->file_handle ) ); ai->fi_list[i].original_length = ai->fi_list[i].length; cur_offset += ai->fi_list[i].length; } } else { // old NSA filename def: filename, ending '\0' byte , compr-type byte, // start (4byte), length (4byte)) ai->num_of_files = readShort( ai->file_handle ); ai->fi_list = new FileInfo[ ai->num_of_files ]; ai->base_offset = readLong( ai->file_handle ); ai->base_offset += offset; for ( i=0 ; inum_of_files ; i++ ){ unsigned char ch; int count = 0; while( (ch = key_table[fgetc( ai->file_handle )] ) ){ if ( 'a' <= ch && ch <= 'z' ) ch += 'A' - 'a'; ai->fi_list[i].name[count++] = ch; } ai->fi_list[i].name[count] = ch; if ( archive_type == ARCHIVE_TYPE_NSA ) ai->fi_list[i].compression_type = readChar( ai->file_handle ); else ai->fi_list[i].compression_type = NO_COMPRESSION; ai->fi_list[i].offset = readLong( ai->file_handle ) + ai->base_offset; ai->fi_list[i].length = readLong( ai->file_handle ); if ( archive_type == ARCHIVE_TYPE_NSA ){ ai->fi_list[i].original_length = readLong( ai->file_handle ); } else{ ai->fi_list[i].original_length = ai->fi_list[i].length; } /* Registered Plugin check */ if ( ai->fi_list[i].compression_type == NO_COMPRESSION ) ai->fi_list[i].compression_type = getRegisteredCompressionType( ai->fi_list[i].name ); if ( ai->fi_list[i].compression_type == NBZ_COMPRESSION || ai->fi_list[i].compression_type == SPB_COMPRESSION ){ // Delaying checking decompressed file length to prevent // massive random access in the archives at the start-up. ai->fi_list[i].original_length = 0; } } } } int SarReader::writeHeaderSub( ArchiveInfo *ai, FILE *fp, int archive_type, int nsa_offset ) { unsigned int i, j; fseek( fp, 0L, SEEK_SET ); for (int k=0 ; knum_of_files ); writeLong( fp, ai->base_offset-nsa_offset ); for ( i=0 ; inum_of_files ; i++ ){ for ( j=0 ; ai->fi_list[i].name[j] ; j++ ) fputc( ai->fi_list[i].name[j], fp ); fputc( ai->fi_list[i].name[j], fp ); if ( archive_type >= ARCHIVE_TYPE_NSA ) writeChar( fp, ai->fi_list[i].compression_type ); writeLong( fp, ai->fi_list[i].offset - ai->base_offset ); writeLong( fp, ai->fi_list[i].length ); if ( archive_type >= ARCHIVE_TYPE_NSA ){ writeLong( fp, ai->fi_list[i].original_length ); } } return 0; } int SarReader::writeHeader( FILE *fp ) { ArchiveInfo *ai = archive_info.next; return writeHeaderSub( ai, fp ); } size_t SarReader::putFileSub( ArchiveInfo *ai, FILE *fp, int no, size_t offset, size_t length, size_t original_length, int compression_type, bool modified_flag, unsigned char *buffer ) { ai->fi_list[no].compression_type = compression_type; ai->fi_list[no].length = length; ai->fi_list[no].original_length = original_length; fseek( fp, offset, SEEK_SET ); if ( modified_flag ){ if ( ai->fi_list[no].compression_type == NBZ_COMPRESSION ){ writeLong( fp, ai->fi_list[no].original_length ); fseek( ai->file_handle, ai->fi_list[no].offset+2, SEEK_SET ); if ( readChar( ai->file_handle ) != 'B' || readChar( ai->file_handle ) != 'Z' ){ // in case the original is not compressed in NBZ ai->fi_list[no].length = encodeNBZ( fp, length, buffer ) + 4; ai->fi_list[no].offset = offset; return ai->fi_list[no].length; } } else{ ai->fi_list[no].compression_type = NO_COMPRESSION; } } else{ fseek( ai->file_handle, ai->fi_list[no].offset, SEEK_SET ); fread( buffer, 1, ai->fi_list[no].length, ai->file_handle ); } size_t len = ai->fi_list[no].length, c; while( len > 0 ){ if ( len > WRITE_LENGTH ) c = WRITE_LENGTH; else c = len; len -= c; fwrite( buffer, 1, c, fp ); buffer += c; } ai->fi_list[no].offset = offset; return ai->fi_list[no].length; } size_t SarReader::putFile( FILE *fp, int no, size_t offset, size_t length, size_t original_length, bool modified_flag, unsigned char *buffer ) { ArchiveInfo *ai = archive_info.next; return putFileSub( ai, fp, no, offset, length, original_length, ai->fi_list[no].compression_type, modified_flag, buffer ); } int SarReader::close() { ArchiveInfo *info = archive_info.next; for ( int i=0 ; inext; delete last_archive_info; } return 0; } const char *SarReader::getArchiveName() const { return "sar"; } int SarReader::getNumFiles(){ ArchiveInfo *info = archive_info.next; int num = 0; for ( int i=0 ; inum_of_files; info = info->next; } return num; } int SarReader::getIndexFromFile( ArchiveInfo *ai, const char *file_name ) { unsigned int i, len; len = strlen( file_name ); if ( len > MAX_FILE_NAME_LENGTH ) len = MAX_FILE_NAME_LENGTH; memcpy( capital_name, file_name, len ); capital_name[ len ] = '\0'; for ( i=0 ; inum_of_files ; i++ ){ if ( !strcmp( capital_name, ai->fi_list[i].name ) ) break; } return i; } size_t SarReader::getFileLength( const char *file_name ) { size_t ret; if ( ( ret = DirectReader::getFileLength( file_name ) ) ) return ret; ArchiveInfo *info = archive_info.next; unsigned int j = 0; for ( int i=0 ; inum_of_files ) break; info = info->next; } if ( !info ) return 0; if ( info->fi_list[j].original_length != 0 ) return info->fi_list[j].original_length; int type = info->fi_list[j].compression_type; if ( type == NO_COMPRESSION ) type = getRegisteredCompressionType( file_name ); if ( type == NBZ_COMPRESSION || type == SPB_COMPRESSION ) { info->fi_list[j].original_length = getDecompressedFileLength( type, info->file_handle, info->fi_list[j].offset ); } return info->fi_list[j].original_length; } size_t SarReader::getFileSub( ArchiveInfo *ai, const char *file_name, unsigned char *buf ) { unsigned int i = getIndexFromFile( ai, file_name ); if ( i == ai->num_of_files ) return 0; #if defined(PSP) if (ai->power_resume_number != psp_power_resume_number){ FILE *fp = fopen(ai->file_name, "rb"); ai->file_handle = fp; ai->power_resume_number = psp_power_resume_number; } #endif int type = ai->fi_list[i].compression_type; if ( type == NO_COMPRESSION ) type = getRegisteredCompressionType( file_name ); if ( type == NBZ_COMPRESSION ){ return decodeNBZ( ai->file_handle, ai->fi_list[i].offset, buf ); } else if ( type == LZSS_COMPRESSION ){ return decodeLZSS( ai, i, buf ); } else if ( type == SPB_COMPRESSION ){ return decodeSPB( ai->file_handle, ai->fi_list[i].offset, buf ); } fseek( ai->file_handle, ai->fi_list[i].offset, SEEK_SET ); size_t ret = fread( buf, 1, ai->fi_list[i].length, ai->file_handle ); if (key_table_flag) for (size_t j=0 ; j 0 ) break; info = info->next; } if ( location ) *location = ARCHIVE_TYPE_SAR; return j; } SarReader::FileInfo SarReader::getFileByIndex( unsigned int index ) { ArchiveInfo *info = archive_info.next; for ( int i=0 ; inum_of_files ) return info->fi_list[index]; index -= info->num_of_files; info = info->next; } fprintf( stderr, "SarReader::getFileByIndex Index %d is out of range\n", index ); return archive_info.fi_list[index]; } onscripter-20150820/sardec.cpp0000644017777601777760000000540512565174244015751 0ustar nobodynogroup/* -*- C++ -*- * * sardec.cpp - SAR archive decoder * * Copyright (c) 2001-2004 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include #include #include #include #include #include #include "SarReader.h" extern int errno; int main( int argc, char **argv ) { SarReader cSR; unsigned long length, buffer_length = 0; unsigned char *buffer = NULL; char file_name[256], dir_name[256]; unsigned int i, j, count; FILE *fp; struct stat file_stat; if ( argc != 2 ){ fprintf( stderr, "Usage: sardec arc_file\n"); exit(-1); } if (cSR.open( argv[1] ) != 0){ fprintf( stderr, "can't open file %s\n", argv[1] ); exit(-1); } count = cSR.getNumFiles(); SarReader::FileInfo sFI; for ( i=0 ; i buffer_length ){ if ( buffer ) delete[] buffer; buffer = new unsigned char[length]; buffer_length = length; } if ( cSR.getFile( sFI.name, buffer ) != length ){ fprintf( stderr, "file %s can't be retrieved\n", sFI.name ); continue; } strcpy( file_name, sFI.name ); for ( j=0 ; j #include "resize_image.h" SDL_Surface *ONScripter::loadImage(char *filename, bool *has_alpha, int *location) { if (!filename) return NULL; SDL_Surface *tmp = NULL; if (location) *location = BaseReader::ARCHIVE_TYPE_NONE; if (filename[0] == '>') tmp = createRectangleSurface(filename, has_alpha); else tmp = createSurfaceFromFile(filename, has_alpha, location); if (tmp == NULL) return NULL; SDL_Surface *ret; if((tmp->w * tmp->format->BytesPerPixel == tmp->pitch) && (tmp->format->BitsPerPixel == image_surface->format->BitsPerPixel) && (tmp->format->Rmask == image_surface->format->Rmask) && (tmp->format->Gmask == image_surface->format->Gmask) && (tmp->format->Bmask == image_surface->format->Bmask) && (tmp->format->Amask == image_surface->format->Amask)){ ret = tmp; } else{ ret = SDL_ConvertSurface(tmp, image_surface->format, SDL_SWSURFACE); SDL_FreeSurface(tmp); } return ret; } SDL_Surface *ONScripter::createRectangleSurface(char *filename, bool *has_alpha) { int c=1, w=0, h=0; bool decimal_flag = false; while (filename[c] != 0x0a && filename[c] != 0x00){ if (!decimal_flag && filename[c] >= '0' && filename[c] <= '9') w = w*10 + filename[c]-'0'; if (filename[c] == '.') decimal_flag = true; if (filename[c] == ','){ c++; break; } c++; } decimal_flag = false; while (filename[c] != 0x0a && filename[c] != 0x00){ if (!decimal_flag && filename[c] >= '0' && filename[c] <= '9') h = h*10 + filename[c]-'0'; if (filename[c] == '.') decimal_flag = true; if (filename[c] == ','){ c++; break; } c++; } while (filename[c] == ' ' || filename[c] == '\t') c++; int n=0, c2 = c; while(filename[c] == '#'){ uchar3 col; readColor(&col, filename+c); n++; c += 7; while (filename[c] == ' ' || filename[c] == '\t') c++; } SDL_PixelFormat *fmt = image_surface->format; SDL_Surface *tmp = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask); c = c2; for (int i=0 ; iformat, col[0], col[1], col[2], 0xff)); } if (has_alpha) *has_alpha = false; return tmp; } SDL_Surface *ONScripter::createSurfaceFromFile(char *filename, bool *has_alpha, int *location) { unsigned long length = script_h.cBR->getFileLength( filename ); if (length == 0){ fprintf( stderr, " *** can't find file [%s] ***\n", filename ); return NULL; } if (filelog_flag) script_h.findAndAddLog(script_h.log_info[ScriptHandler::FILE_LOG], filename, true); //printf(" ... loading %s length %ld\n", filename, length ); mean_size_of_loaded_images += length*6/5; // reserve 20% larger size num_loaded_images++; if (tmp_image_buf_length < mean_size_of_loaded_images/num_loaded_images){ tmp_image_buf_length = mean_size_of_loaded_images/num_loaded_images; if (tmp_image_buf) delete[] tmp_image_buf; tmp_image_buf = NULL; } unsigned char *buffer = NULL; if (length > tmp_image_buf_length){ buffer = new(std::nothrow) unsigned char[length]; if (buffer == NULL){ fprintf( stderr, "failed to load [%s] because file size [%lu] is too large.\n", filename, length); return NULL; } } else{ if (!tmp_image_buf) tmp_image_buf = new unsigned char[tmp_image_buf_length]; buffer = tmp_image_buf; } script_h.cBR->getFile(filename, buffer, location); char *ext = strrchr(filename, '.'); SDL_RWops *src = SDL_RWFromMem(buffer, length); int is_png = IMG_isPNG(src); SDL_Surface *tmp = IMG_Load_RW(src, 0); if (!tmp && ext && (!strcmp(ext+1, "JPG") || !strcmp(ext+1, "jpg"))){ fprintf(stderr, " *** force-loading a JPG image [%s]\n", filename); tmp = IMG_LoadJPG_RW(src); } if (tmp && has_alpha){ if (tmp->format->Amask || is_png) *has_alpha = true; else *has_alpha = false; } SDL_RWclose(src); if (buffer != tmp_image_buf) delete[] buffer; if (!tmp) fprintf( stderr, " *** can't load file [%s] %s ***\n", filename, IMG_GetError() ); return tmp; } // resize 32bit surface to 32bit surface int ONScripter::resizeSurface( SDL_Surface *src, SDL_Surface *dst ) { SDL_LockSurface( dst ); SDL_LockSurface( src ); Uint32 *src_buffer = (Uint32 *)src->pixels; Uint32 *dst_buffer = (Uint32 *)dst->pixels; /* size of tmp_buffer must be larger than 16 bytes */ size_t len = src->w * (src->h+1) * 4 + 4; if (resize_buffer_size < len){ delete[] resize_buffer; resize_buffer = new unsigned char[len]; resize_buffer_size = len; } resizeImage( (unsigned char*)dst_buffer, dst->w, dst->h, dst->w * 4, (unsigned char*)src_buffer, src->w, src->h, src->w * 4, 4, resize_buffer, src->w * 4, false ); SDL_UnlockSurface( src ); SDL_UnlockSurface( dst ); return 0; } #if defined(BPP16) #define BLEND_PIXEL_MASK(){\ Uint32 s1 = (*src1_buffer | *src1_buffer << 16) & 0x07e0f81f; \ Uint32 s2 = (*src2_buffer | *src2_buffer << 16) & 0x07e0f81f; \ Uint32 mask_rb = (s1 + ((s2-s1) * mask2 >> 5)) & 0x07e0f81f; \ *dst_buffer = mask_rb | mask_rb >> 16; \ } #else #define BLEND_PIXEL_MASK(){\ Uint32 temp = *src1_buffer & 0xff00ff;\ Uint32 mask_rb = (((((*src2_buffer & 0xff00ff) - temp ) * mask2 ) >> 8 ) + temp ) & 0xff00ff;\ temp = *src1_buffer & 0x00ff00;\ Uint32 mask_g = (((((*src2_buffer & 0x00ff00) - temp ) * mask2 ) >> 8 ) + temp ) & 0x00ff00;\ *dst_buffer = mask_rb | mask_g;\ } // Originally, the above looks like this. // mask1 = mask2 ^ 0xff; // Uint32 mask_rb = (((*src1_buffer & 0xff00ff) * mask1 + // (*src2_buffer & 0xff00ff) * mask2) >> 8) & 0xff00ff; // Uint32 mask_g = (((*src1_buffer & 0x00ff00) * mask1 + // (*src2_buffer & 0x00ff00) * mask2) >> 8) & 0x00ff00; #endif // alphaBlend // dst: accumulation_surface // src1: effect_src_surface // src2: effect_dst_surface void ONScripter::alphaBlend( SDL_Surface *mask_surface, int trans_mode, Uint32 mask_value, SDL_Rect *clip ) { SDL_Rect rect = screen_rect; int i, j; /* ---------------------------------------- */ /* clipping */ if ( clip ){ if ( AnimationInfo::doClipping( &rect, clip ) ) return; } /* ---------------------------------------- */ SDL_LockSurface( effect_src_surface ); SDL_LockSurface( effect_dst_surface ); SDL_LockSurface( accumulation_surface ); if ( mask_surface ) SDL_LockSurface( mask_surface ); ONSBuf *src1_buffer = (ONSBuf *)effect_src_surface->pixels + effect_src_surface->w * rect.y + rect.x; ONSBuf *src2_buffer = (ONSBuf *)effect_dst_surface->pixels + effect_dst_surface->w * rect.y + rect.x; ONSBuf *dst_buffer = (ONSBuf *)accumulation_surface->pixels + accumulation_surface->w * rect.y + rect.x; SDL_PixelFormat *fmt = accumulation_surface->format; Uint32 lowest_mask; Uint8 lowest_loss; if (fmt->Rmask < fmt->Bmask){ lowest_mask = fmt->Rmask; // ABGR8888 lowest_loss = fmt->Rloss; } else{ lowest_mask = fmt->Bmask; // ARGB8888 or RGB565 lowest_loss = fmt->Bloss; } Uint32 overflow_mask; if ( trans_mode == ALPHA_BLEND_FADE_MASK ) overflow_mask = 0xffffffff; else overflow_mask = ~lowest_mask; mask_value >>= lowest_loss; if ( (trans_mode == ALPHA_BLEND_FADE_MASK || trans_mode == ALPHA_BLEND_CROSSFADE_MASK) && mask_surface ){ for ( i=0; ipixels + mask_surface->w * ((rect.y+i)%mask_surface->h); int j2 = rect.x; for ( j=0 ; j mask ){ mask2 = mask_value - mask; if ( mask2 & overflow_mask ) mask2 = lowest_mask; } BLEND_PIXEL_MASK(); src1_buffer++; src2_buffer++; dst_buffer++; if (j2 >= mask_surface->w) j2 = 0; else j2++; } src1_buffer += screen_width - rect.w; src2_buffer += screen_width - rect.w; dst_buffer += screen_width - rect.w; } }else{ // ALPHA_BLEND_CONST Uint32 mask2 = mask_value & lowest_mask; for ( i=0; i> 3; \ if (mask2 != 0){ \ Uint32 d1 = (*dst_buffer | *dst_buffer << 16) & 0x07e0f81f; \ Uint32 mask = (d1 + ((src_color-d1) * mask2 >> 5)) & 0x07e0f81f; \ *dst_buffer = mask | mask >> 16; \ } \ } #define BLEND_PIXEL_TEXT()\ {\ Uint32 mask2 = *src_buffer; \ if (mask2 == 255){\ *dst_buffer = src_color3;\ }\ else if (mask2 != 0){ \ Uint32 mask1 = mask2 ^ 0xff; \ Uint32 mask_rb = (((*dst_buffer & 0xff00ff) * mask1 + \ src_color1 * mask2) >> 8) & 0xff00ff; \ Uint32 mask_g = (((*dst_buffer & 0x00ff00) * mask1 + \ src_color2 * mask2) >> 8) & 0x00ff00; \ *dst_buffer = 0xff000000 | mask_rb | mask_g; \ } \ } // alphaBlendText // dst: ONSBuf surface (accumulation_surface) // src: 8bit surface (TTF_RenderGlyph_Shaded()) void ONScripter::alphaBlendText( SDL_Surface *dst_surface, SDL_Rect dst_rect, SDL_Surface *src_surface, SDL_Color &color, SDL_Rect *clip, bool rotate_flag ) { int x2=0, y2=0; SDL_Rect clipped_rect; /* ---------------------------------------- */ /* 1st clipping */ if ( clip ){ if ( AnimationInfo::doClipping( &dst_rect, clip, &clipped_rect ) ) return; x2 += clipped_rect.x; y2 += clipped_rect.y; } /* ---------------------------------------- */ /* 2nd clipping */ SDL_Rect clip_rect; clip_rect.x = clip_rect.y = 0; clip_rect.w = dst_surface->w; clip_rect.h = dst_surface->h; if ( AnimationInfo::doClipping( &dst_rect, &clip_rect, &clipped_rect ) ) return; x2 += clipped_rect.x; y2 += clipped_rect.y; /* ---------------------------------------- */ SDL_LockSurface( dst_surface ); SDL_LockSurface( src_surface ); SDL_PixelFormat *fmt = dst_surface->format; if (fmt->BitsPerPixel == 16){ Uint32 src_color = (((color.r >> fmt->Rloss) << fmt->Rshift) | ((color.g >> fmt->Gloss) << fmt->Gshift) | ((color.b >> fmt->Bloss) << fmt->Bshift)); src_color = (src_color | src_color << 16) & 0x07e0f81f; Uint16 *dst_buffer = (Uint16*)dst_surface->pixels + dst_surface->w * dst_rect.y + dst_rect.x; if (!rotate_flag){ unsigned char *src_buffer = (unsigned char*)src_surface->pixels + src_surface->pitch * y2 + x2; for ( int i=0 ; ipitch - dst_rect.w; dst_buffer += dst_surface->w - dst_rect.w; } } else{ for ( int i=0 ; ipixels + src_surface->pitch*(src_surface->h - x2 - 1) + y2 + i; for ( int j=dst_rect.w ; j!=0 ; j-- ){ BLEND_PIXEL_TEXT_BPP16(); src_buffer -= src_surface->pitch; dst_buffer++; } dst_buffer += dst_surface->w - dst_rect.w; } } } else{ Uint32 src_color1 = (color.r << fmt->Rshift) | (color.b << fmt->Bshift); Uint32 src_color2 = (color.g << fmt->Gshift); Uint32 src_color3 = (0xff << fmt->Ashift) | src_color1 | src_color2; Uint32 *dst_buffer = (Uint32*)dst_surface->pixels + dst_surface->w * dst_rect.y + dst_rect.x; if (!rotate_flag){ unsigned char *src_buffer = (unsigned char*)src_surface->pixels + src_surface->pitch * y2 + x2; for ( int i=0 ; ipitch - dst_rect.w; dst_buffer += dst_surface->w - dst_rect.w; } } else{ for ( int i=0 ; ipixels + src_surface->pitch*(src_surface->h - x2 - 1) + y2 + i; for ( int j=dst_rect.w ; j!=0 ; j-- ){ BLEND_PIXEL_TEXT(); src_buffer -= src_surface->pitch; dst_buffer++; } dst_buffer += dst_surface->w - dst_rect.w; } } } SDL_UnlockSurface( src_surface ); SDL_UnlockSurface( dst_surface ); } void ONScripter::makeNegaSurface( SDL_Surface *surface, SDL_Rect &clip ) { SDL_LockSurface( surface ); ONSBuf *buf = (ONSBuf *)surface->pixels + clip.y * surface->w + clip.x; ONSBuf mask = surface->format->Rmask | surface->format->Gmask | surface->format->Bmask; for ( int i=clip.y ; iw - clip.w; } SDL_UnlockSurface( surface ); } void ONScripter::makeMonochromeSurface( SDL_Surface *surface, SDL_Rect &clip ) { SDL_LockSurface( surface ); ONSBuf *buf = (ONSBuf *)surface->pixels + clip.y * surface->w + clip.x, c; SDL_PixelFormat *fmt = surface->format; for ( int i=clip.y ; iRmask) >> fmt->Rshift) << fmt->Rloss) * 77 + (((*buf & fmt->Gmask) >> fmt->Gshift) << fmt->Gloss) * 151 + (((*buf & fmt->Bmask) >> fmt->Bshift) << fmt->Bloss) * 28 ) >> 8; *buf++ = ((monocro_color_lut[c][0] >> fmt->Rloss) << surface->format->Rshift | (monocro_color_lut[c][1] >> fmt->Gloss) << surface->format->Gshift | (monocro_color_lut[c][2] >> fmt->Bloss) << surface->format->Bshift); } buf += surface->w - clip.w; } SDL_UnlockSurface( surface ); } void ONScripter::refreshSurface( SDL_Surface *surface, SDL_Rect *clip_src, int refresh_mode ) { if (refresh_mode == REFRESH_NONE_MODE) return; SDL_Rect clip; clip.x = clip.y = 0; clip.w = surface->w; clip.h = surface->h; if (clip_src) if ( AnimationInfo::doClipping( &clip, clip_src ) ) return; int i, top; SDL_BlitSurface( bg_info.image_surface, &clip, surface, &clip ); if ( !all_sprite_hide_flag ){ if ( z_order < 10 && refresh_mode & REFRESH_SAYA_MODE ) top = 9; else top = z_order; for ( i=MAX_SPRITE_NUM-1 ; i>top ; i-- ){ if ( sprite_info[i].image_surface && sprite_info[i].visible ) drawTaggedSurface( surface, &sprite_info[i], clip ); } } if ( !all_sprite_hide_flag ){ for ( i=0 ; i<3 ; i++ ){ if (human_order[2-i] >= 0 && tachi_info[human_order[2-i]].image_surface) drawTaggedSurface( surface, &tachi_info[human_order[2-i]], clip ); } } if ( windowback_flag ){ if ( nega_mode == 1 ) makeNegaSurface( surface, clip ); if ( monocro_flag ) makeMonochromeSurface( surface, clip ); if ( nega_mode == 2 ) makeNegaSurface( surface, clip ); if (!all_sprite2_hide_flag){ for ( i=MAX_SPRITE2_NUM-1 ; i>=0 ; i-- ){ if ( sprite2_info[i].image_surface && sprite2_info[i].visible ) drawTaggedSurface( surface, &sprite2_info[i], clip ); } } if (refresh_mode & REFRESH_SHADOW_MODE) shadowTextDisplay( surface, clip ); if (refresh_mode & REFRESH_TEXT_MODE) text_info.blendOnSurface( surface, 0, 0, clip ); } if ( !all_sprite_hide_flag ){ if ( refresh_mode & REFRESH_SAYA_MODE ) top = 10; else top = 0; for ( i=z_order ; i>=top ; i-- ){ if ( sprite_info[i].image_surface && sprite_info[i].visible ) drawTaggedSurface( surface, &sprite_info[i], clip ); } } if ( !windowback_flag ){ if (!all_sprite2_hide_flag){ for ( i=MAX_SPRITE2_NUM-1 ; i>=0 ; i-- ){ if ( sprite2_info[i].image_surface && sprite2_info[i].visible ) drawTaggedSurface( surface, &sprite2_info[i], clip ); } } if ( nega_mode == 1 ) makeNegaSurface( surface, clip ); if ( monocro_flag ) makeMonochromeSurface( surface, clip ); if ( nega_mode == 2 ) makeNegaSurface( surface, clip ); } if ( !( refresh_mode & REFRESH_SAYA_MODE ) ){ for ( i=0 ; ishow_flag > 0) drawTaggedSurface( surface, bl->anim[bl->show_flag-1], clip ); bl = bl->next; } } void ONScripter::refreshSprite( int sprite_no, bool active_flag, int cell_no, SDL_Rect *check_src_rect, SDL_Rect *check_dst_rect ) { if ( sprite_info[sprite_no].image_surface && ( sprite_info[ sprite_no ].visible != active_flag || (cell_no >= 0 && sprite_info[ sprite_no ].current_cell != cell_no ) || AnimationInfo::doClipping(check_src_rect, &sprite_info[ sprite_no ].pos) == 0 || AnimationInfo::doClipping(check_dst_rect, &sprite_info[ sprite_no ].pos) == 0) ) { if ( cell_no >= 0 ) sprite_info[ sprite_no ].setCell(cell_no); sprite_info[ sprite_no ].visible = active_flag; dirty_rect.add( sprite_info[ sprite_no ].pos ); } } void ONScripter::createBackground() { bg_info.num_of_cells = 1; bg_info.trans_mode = AnimationInfo::TRANS_COPY; bg_info.pos.x = 0; bg_info.pos.y = 0; bg_info.allocImage( screen_width, screen_height, texture_format ); if ( !strcmp( bg_info.file_name, "white" ) ){ bg_info.color[0] = bg_info.color[1] = bg_info.color[2] = 0xff; } else if ( !strcmp( bg_info.file_name, "black" ) || !strcmp( bg_info.file_name, "*bgcpy" ) ){ bg_info.color[0] = bg_info.color[1] = bg_info.color[2] = 0x00; } else if ( bg_info.file_name[0] == '#' ){ readColor( &bg_info.color, bg_info.file_name ); } else{ AnimationInfo anim; setStr( &anim.image_name, bg_info.file_name ); parseTaggedString( &anim ); anim.trans_mode = AnimationInfo::TRANS_COPY; setupAnimationInfo( &anim ); bg_info.fill(0, 0, 0, 0xff); if (anim.image_surface){ SDL_Rect src_rect; src_rect.x = src_rect.y = 0; src_rect.w = anim.image_surface->w; src_rect.h = anim.image_surface->h; SDL_Rect dst_rect = {0, 0}; if (screen_width >= anim.image_surface->w){ dst_rect.x = (screen_width - anim.image_surface->w) / 2; } else{ src_rect.x = (anim.image_surface->w - screen_width) / 2; src_rect.w = screen_width; } if (screen_height >= anim.image_surface->h){ dst_rect.y = (screen_height - anim.image_surface->h) / 2; } else{ src_rect.y = (anim.image_surface->h - screen_height) / 2; src_rect.h = screen_height; } bg_info.copySurface(anim.image_surface, &src_rect, &dst_rect); } return; } bg_info.fill(bg_info.color[0], bg_info.color[1], bg_info.color[2], 0xff); } onscripter-20150820/ScriptHandler.cpp0000644017777601777760000012773512565174244017265 0ustar nobodynogroup/* -*- C++ -*- * * ScriptHandler.cpp - Script manipulation class * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ScriptHandler.h" #define TMP_SCRIPT_BUF_LEN 4096 #define STRING_BUFFER_LENGTH 2048 #define SKIP_SPACE(p) while ( *(p) == ' ' || *(p) == '\t' ) (p)++ ScriptHandler::ScriptHandler() { save_dir = NULL; num_of_labels = 0; script_buffer = NULL; kidoku_buffer = NULL; log_info[LABEL_LOG].filename = "NScrllog.dat"; log_info[FILE_LOG].filename = "NScrflog.dat"; clickstr_list = NULL; string_buffer = new char[STRING_BUFFER_LENGTH]; str_string_buffer = new char[STRING_BUFFER_LENGTH]; saved_string_buffer = new char[STRING_BUFFER_LENGTH]; variable_data = NULL; extended_variable_data = NULL; num_extended_variable_data = 0; max_extended_variable_data = 1; root_array_variable = NULL; screen_width = 640; screen_height = 480; variable_range = 0; global_variable_border = 0; } ScriptHandler::~ScriptHandler() { reset(); if ( script_buffer ) delete[] script_buffer; if ( kidoku_buffer ) delete[] kidoku_buffer; delete[] string_buffer; delete[] str_string_buffer; delete[] saved_string_buffer; if (variable_data) delete[] variable_data; } void ScriptHandler::reset() { for (int i=0 ; inext; delete tmp; } root_array_variable = current_array_variable = NULL; // reset log info resetLog( log_info[LABEL_LOG] ); resetLog( log_info[FILE_LOG] ); // reset number alias Alias *alias; alias = root_num_alias.next; while (alias){ Alias *tmp = alias; alias = alias->next; delete tmp; }; last_num_alias = &root_num_alias; last_num_alias->next = NULL; // reset string alias alias = root_str_alias.next; while (alias){ Alias *tmp = alias; alias = alias->next; delete tmp; }; last_str_alias = &root_str_alias; last_str_alias->next = NULL; // reset misc. variables end_status = END_NONE; kidokuskip_flag = false; text_flag = true; linepage_flag = false; english_mode = false; textgosub_flag = false; skip_enabled = false; if (clickstr_list){ delete[] clickstr_list; clickstr_list = NULL; } internal_current_script = NULL; } void ScriptHandler::setSaveDir(const char *path) { if (save_dir) delete[] save_dir; save_dir = new char[ strlen(path)+1 ]; strcpy(save_dir, path); } FILE *ScriptHandler::fopen( const char *path, const char *mode, bool use_save_dir ) { char *filename; if (use_save_dir && save_dir){ filename = new char[strlen(save_dir)+strlen(path)+1]; sprintf( filename, "%s%s", save_dir, path ); } else{ filename = new char[strlen(archive_path)+strlen(path)+1]; sprintf( filename, "%s%s", archive_path, path ); } FILE *fp = ::fopen( filename, mode ); delete[] filename; return fp; } void ScriptHandler::setKeyTable( const unsigned char *key_table ) { int i; if (key_table){ key_table_flag = true; for (i=0 ; i<256 ; i++) this->key_table[i] = key_table[i]; } else{ key_table_flag = false; for (i=0 ; i<256 ; i++) this->key_table[i] = i; } } // basic parser function const char *ScriptHandler::readToken() { current_script = next_script; wait_script = NULL; char *buf = current_script; end_status = END_NONE; current_variable.type = VAR_NONE; text_flag = false; SKIP_SPACE( buf ); markAsKidoku( buf ); readTokenTop: string_counter = 0; char ch = *buf; if (ch == ';'){ // comment addStringBuffer( ch ); do{ ch = *++buf; addStringBuffer( ch ); } while ( ch != 0x0a && ch != '\0' ); } else if (ch & 0x80 || (ch >= '0' && ch <= '9') || ch == '@' || ch == '\\' || ch == '/' || ch == '%' || ch == '?' || ch == '$' || ch == '[' || ch == '(' || ch == '<' || #ifndef ENABLE_1BYTE_CHAR ch == '`' || #endif (!english_mode && ch == '>') || ch == '!' || ch == '#' || ch == ',' || ch == '"'){ // text bool ignore_clickstr_flag = false; while(1){ if ( IS_TWO_BYTE(ch) ){ addStringBuffer( ch ); ch = *++buf; if (ch == 0x0a || ch == '\0') break; addStringBuffer( ch ); buf++; if (!wait_script && !ignore_clickstr_flag && checkClickstr(buf-2) > 0) wait_script = buf; ignore_clickstr_flag = false; } else{ ignore_clickstr_flag = false; if (ch == '%' || ch == '?'){ addIntVariable(&buf); SKIP_SPACE(buf); } else if (ch == '$'){ addStrVariable(&buf); SKIP_SPACE(buf); } else{ if (ch == 0x0a || ch == '\0') break; addStringBuffer( ch ); buf++; if (ch == '_') ignore_clickstr_flag = true; if (!wait_script && ch == '@') wait_script = buf; } } ch = *buf; } text_flag = true; } #ifdef ENABLE_1BYTE_CHAR else if (ch == '`'){ ch = *++buf; while (ch != '`' && ch != 0x0a && ch !='\0'){ if ( IS_TWO_BYTE(ch) ){ addStringBuffer( ch ); ch = *++buf; } addStringBuffer( ch ); ch = *++buf; } if (ch == '`') buf++; text_flag = true; end_status |= END_1BYTE_CHAR; } #endif else if (english_mode && ch == '>'){ ch = *++buf; while (1){ if (ch == 0x0a || ch =='\0') break; if (ch != '\t') addStringBuffer( ch ); ch = *++buf; } text_flag = true; end_status |= END_1BYTE_CHAR; } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_'){ // command do{ if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; addStringBuffer( ch ); ch = *++buf; } while((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_'); } else if (ch == '*'){ // label return readLabel(); } else if (ch == '~' || ch == 0x0a || ch == ':'){ addStringBuffer( ch ); markAsKidoku( buf++ ); } else if (ch != '\0'){ fprintf(stderr, "readToken: skip unknown heading character %c (%x)\n", ch, ch); buf++; goto readTokenTop; } next_script = checkComma(buf); //printf("readToken [%s] len=%d [%c(%x)] %p\n", string_buffer, strlen(string_buffer), ch, ch, next_script); return string_buffer; } const char *ScriptHandler::readLabel() { end_status = END_NONE; current_variable.type = VAR_NONE; current_script = next_script; SKIP_SPACE( current_script ); char *buf = current_script; string_counter = 0; char ch = *buf; if (ch == '$'){ addStrVariable(&buf); } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_' || ch == '*'){ if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; addStringBuffer( ch ); buf++; if (ch == '*') SKIP_SPACE(buf); ch = *buf; while((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_'){ if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; addStringBuffer( ch ); ch = *++buf; } } addStringBuffer( '\0' ); next_script = checkComma(buf); return string_buffer; } const char *ScriptHandler::readStr() { end_status = END_NONE; current_variable.type = VAR_NONE; current_script = next_script; SKIP_SPACE( current_script ); char *buf = current_script; string_buffer[0] = '\0'; string_counter = 0; while(1){ parseStr(&buf); buf = checkComma(buf); string_counter += strlen(str_string_buffer); if (string_counter+1 >= STRING_BUFFER_LENGTH) errorAndExit("readStr: string length exceeds 2048 bytes."); strcat(string_buffer, str_string_buffer); if (buf[0] != '+') break; buf++; } next_script = buf; return string_buffer; } int ScriptHandler::readInt() { string_counter = 0; string_buffer[string_counter] = '\0'; end_status = END_NONE; current_variable.type = VAR_NONE; current_script = next_script; SKIP_SPACE( current_script ); char *buf = current_script; int ret = parseIntExpression(&buf); next_script = checkComma(buf); return ret; } void ScriptHandler::skipToken() { SKIP_SPACE( current_script ); char *buf = current_script; bool quat_flag = false; bool text_flag = false; while(1){ if ( *buf == 0x0a || *buf == 0 || (!quat_flag && !text_flag && (*buf == ':' || *buf == ';') ) ) break; if ( *buf == '"' ) quat_flag = !quat_flag; if ( IS_TWO_BYTE(*buf) ){ buf += 2; if ( !quat_flag ) text_flag = true; } else buf++; } if (text_flag && *buf == 0x0a) buf++; next_script = buf; } // string access function char *ScriptHandler::saveStringBuffer() { strcpy( saved_string_buffer, string_buffer ); return saved_string_buffer; } // script address direct manipulation function void ScriptHandler::setCurrent(char *pos) { current_script = next_script = pos; } void ScriptHandler::pushCurrent( char *pos ) { pushed_current_script = current_script; pushed_next_script = next_script; current_script = pos; next_script = pos; } void ScriptHandler::popCurrent() { current_script = pushed_current_script; next_script = pushed_next_script; } void ScriptHandler::enterExternalScript(char *pos) { internal_current_script = current_script; current_script = pos; internal_next_script = next_script; next_script = pos; internal_end_status = end_status; internal_current_variable = current_variable; internal_pushed_variable = pushed_variable; } void ScriptHandler::leaveExternalScript() { current_script = internal_current_script; internal_current_script = NULL; next_script = internal_next_script; end_status = internal_end_status; current_variable = internal_current_variable; pushed_variable = internal_pushed_variable; } bool ScriptHandler::isExternalScript() { return (internal_current_script != NULL); } int ScriptHandler::getOffset( char *pos ) { return pos - script_buffer; } char *ScriptHandler::getAddress( int offset ) { return script_buffer + offset; } int ScriptHandler::getLineByAddress( char *address ) { LabelInfo label = getLabelByAddress( address ); char *addr = label.label_header; int line = 0; while ( address > addr ){ if ( *addr == 0x0a ) line++; addr++; } return line; } char *ScriptHandler::getAddressByLine( int line ) { LabelInfo label = getLabelByLine( line ); int l = line - label.start_line; char *addr = label.label_header; while ( l > 0 ){ while( *addr != 0x0a ) addr++; addr++; l--; } return addr; } ScriptHandler::LabelInfo ScriptHandler::getLabelByAddress( char *address ) { int i; for ( i=0 ; i address ) return label_info[i]; } return label_info[i]; } ScriptHandler::LabelInfo ScriptHandler::getLabelByLine( int line ) { int i; for ( i=0 ; i line ) return label_info[i]; } return label_info[i]; } bool ScriptHandler::isName( const char *name ) { if (string_buffer[0] == '_') return (strncmp( name, string_buffer+1, strlen(name) )==0)?true:false; return (strncmp( name, string_buffer, strlen(name) )==0)?true:false; } bool ScriptHandler::isText() { return text_flag; } bool ScriptHandler::compareString(const char *buf) { SKIP_SPACE(next_script); unsigned int i, num = strlen(buf); for (i=0 ; i= ch) ch += 'a' - 'A'; if (ch != buf[i]) break; } return (i==num)?true:false; } void ScriptHandler::skipLine( int no ) { for ( int i=0 ; ikidokuskip_flag = kidokuskip_flag; } void ScriptHandler::saveKidokuData() { FILE *fp; if ( ( fp = fopen( "kidoku.dat", "wb", true ) ) == NULL ){ fprintf( stderr, "can't write kidoku.dat\n" ); return; } fwrite( kidoku_buffer, 1, script_buffer_length/8, fp ); fclose( fp ); } void ScriptHandler::loadKidokuData() { FILE *fp; setKidokuskip( true ); kidoku_buffer = new char[ script_buffer_length/8 + 1 ]; memset( kidoku_buffer, 0, script_buffer_length/8 + 1 ); if ( ( fp = fopen( "kidoku.dat", "rb", true ) ) != NULL ){ fread( kidoku_buffer, 1, script_buffer_length/8, fp ); fclose( fp ); } } void ScriptHandler::addIntVariable(char **buf) { char num_buf[20]; int no = parseInt(buf); int len = getStringFromInteger( num_buf, no, -1 ); for (int i=0 ; i 0) return 0; return 2; } click_buf += 2; } else{ if ( click_buf[0] == buf[0] ){ if (!recursive_flag && checkClickstr(buf+1, true) > 0) return 0; return 1; } click_buf++; } } return 0; } int ScriptHandler::getIntVariable( VariableInfo *var_info ) { if ( var_info == NULL ) var_info = ¤t_variable; if ( var_info->type == VAR_INT ) return getVariableData(var_info->var_no).num; else if ( var_info->type == VAR_ARRAY ) return *getArrayPtr( var_info->var_no, var_info->array, 0 ); return 0; } void ScriptHandler::readVariable( bool reread_flag ) { end_status = END_NONE; current_variable.type = VAR_NONE; if ( reread_flag ) next_script = current_script; current_script = next_script; char *buf = current_script; SKIP_SPACE(buf); bool ptr_flag = false; if ( *buf == 'i' || *buf == 's' ){ ptr_flag = true; buf++; } if ( *buf == '%' ){ buf++; current_variable.var_no = parseInt(&buf); current_variable.type = VAR_INT; } else if ( *buf == '?' ){ ArrayVariable av; current_variable.var_no = parseArray( &buf, av ); current_variable.type = VAR_ARRAY; current_variable.array = av; } else if ( *buf == '$' ){ buf++; current_variable.var_no = parseInt(&buf); current_variable.type = VAR_STR; } if (ptr_flag) current_variable.type |= VAR_PTR; next_script = checkComma(buf); } void ScriptHandler::setInt( VariableInfo *var_info, int val, int offset ) { if ( var_info->type & VAR_INT ){ setNumVariable( var_info->var_no + offset, val ); } else if ( var_info->type & VAR_ARRAY ){ *getArrayPtr( var_info->var_no, var_info->array, offset ) = val; } else{ errorAndExit( "setInt: no variables." ); } } void ScriptHandler::pushVariable() { pushed_variable = current_variable; } void ScriptHandler::setNumVariable( int no, int val ) { VariableData &vd = getVariableData(no); if ( vd.num_limit_flag ){ if ( val < vd.num_limit_lower ) val = vd.num_limit_lower; else if ( val > vd.num_limit_upper ) val = vd.num_limit_upper; } vd.num = val; } int ScriptHandler::getStringFromInteger( char *buffer, int no, int num_column, bool is_zero_inserted ) { int i, num_space=0, num_minus = 0; if (no < 0){ num_minus = 1; no = -no; } int num_digit=1, no2 = no; while(no2 >= 10){ no2 /= 10; num_digit++; } if (num_column < 0) num_column = num_digit+num_minus; if (num_digit+num_minus <= num_column) num_space = num_column - (num_digit+num_minus); else{ for (i=0 ; iname, capital_name ) ) break; cur = cur->next; } if ( !add_flag || cur ) return cur; LogLink *link = new LogLink(); link->name = new char[strlen(capital_name)+1]; strcpy( link->name, capital_name ); info.current_log->next = link; info.current_log = info.current_log->next; info.num_logs++; return link; } void ScriptHandler::resetLog( LogInfo &info ) { LogLink *link = info.root_log.next; while( link ){ LogLink *tmp = link; link = link->next; delete tmp; } info.root_log.next = NULL; info.current_log = &info.root_log; info.num_logs = 0; } ScriptHandler::ArrayVariable *ScriptHandler::getRootArrayVariable(){ return root_array_variable; } void ScriptHandler::addNumAlias( const char *str, int no ) { Alias *p_num_alias = new Alias( str, no ); last_num_alias->next = p_num_alias; last_num_alias = last_num_alias->next; } void ScriptHandler::addStrAlias( const char *str1, const char *str2 ) { Alias *p_str_alias = new Alias( str1, str2 ); last_str_alias->next = p_str_alias; last_str_alias = last_str_alias->next; } void ScriptHandler::errorAndExit( const char *str ) { fprintf( stderr, " **** Script error, %s [%s] ***\n", str, string_buffer ); exit(-1); } void ScriptHandler::addStringBuffer( char ch ) { if (string_counter+1 == STRING_BUFFER_LENGTH) errorAndExit("addStringBuffer: string length exceeds 2048."); string_buffer[string_counter++] = ch; string_buffer[string_counter] = '\0'; } ScriptHandler::VariableData &ScriptHandler::getVariableData(int no) { if (no >= 0 && no < variable_range) return variable_data[no]; for (int i=0 ; i 0){ fseek( fp, 0, SEEK_SET ); readScriptSub( fp, &p_script_buffer, encrypt_mode ); fclose( fp ); } else{ for (i=0 ; i<100 ; i++){ sprintf(filename, "%d.txt", i); if ((fp = fopen(filename, "rb")) == NULL){ sprintf(filename, "%02d.txt", i); fp = fopen(filename, "rb"); } if (fp){ readScriptSub( fp, &p_script_buffer, 0 ); fclose(fp); } } } delete[] tmp_script_buf; script_buffer_length = p_script_buffer - script_buffer; return 0; } int ScriptHandler::readScriptSub( FILE *fp, char **buf, int encrypt_mode ) { unsigned char magic[5] = {0x79, 0x57, 0x0d, 0x80, 0x04 }; int magic_counter = 0; bool newline_flag = true; bool cr_flag = false; bool newlabel_flag = false; if (encrypt_mode == 3 && !key_table_flag) errorAndExit("readScriptSub: the EXE file must be specified with --key-exe option."); size_t len=0, count=0; while(1){ if (len == count){ len = fread(tmp_script_buf, 1, TMP_SCRIPT_BUF_LEN, fp); if (len == 0){ if (cr_flag) *(*buf)++ = 0x0a; break; } count = 0; } unsigned char ch = tmp_script_buf[count++]; if ( encrypt_mode == 1 ) ch ^= 0x84; else if ( encrypt_mode == 2 ){ ch = (ch ^ magic[magic_counter++]) & 0xff; if ( magic_counter == 5 ) magic_counter = 0; } else if ( encrypt_mode == 3){ ch = key_table[(unsigned char)ch] ^ 0x84; } if ( cr_flag && ch != 0x0a ){ *(*buf)++ = 0x0a; newline_flag = true; cr_flag = false; } if ( ch == '*' && newline_flag && !newlabel_flag){ num_of_labels++; newlabel_flag = true; } else newlabel_flag = false; if ( ch == 0x0d ){ cr_flag = true; continue; } if ( ch == 0x0a ){ *(*buf)++ = 0x0a; newline_flag = true; cr_flag = false; } else{ *(*buf)++ = ch; if ( ch != ' ' && ch != '\t' ) newline_flag = false; } } *(*buf)++ = 0x0a; return 0; } void ScriptHandler::readConfiguration() { variable_range = 4096; global_variable_border = 200; char *buf = script_buffer; while ( buf < script_buffer + script_buffer_length ){ if (*buf == ';') break; if (IS_TWO_BYTE(*buf)) buf++; buf++; } while ( ++buf >= script_buffer + script_buffer_length ) return; SKIP_SPACE(buf); bool config_flag = false; if (buf[0] == '$'){ config_flag = true; buf++; } while (*buf && *buf != 0x0a){ SKIP_SPACE(buf); if (!strncmp( buf, "mode", 4 )){ buf += 4; if (!strncmp( buf, "800", 3 )){ screen_width = 800; screen_height = 600; buf += 3; } else if (!strncmp( buf, "400", 3 )){ screen_width = 400; screen_height = 300; buf += 3; } else if (!strncmp( buf, "320", 3 )){ screen_width = 320; screen_height = 240; buf += 3; } else break; } else if (!strncmp( buf, "value", 5 ) || *buf == 'g' || *buf == 'G'){ if (*buf == 'g' || *buf == 'G') buf++; else buf += 5; SKIP_SPACE(buf); global_variable_border = 0; while ( *buf >= '0' && *buf <= '9' ) global_variable_border = global_variable_border*10 + *buf++ - '0'; } else if (*buf == 'v' || *buf == 'V'){ buf++; SKIP_SPACE(buf); variable_range = 0; while (*buf >= '0' && *buf <= '9') variable_range = variable_range*10 + *buf++ - '0'; } else if (*buf == 's' || *buf == 'S'){ buf++; if (!(*buf >= '0' && *buf <= '9')) break; screen_width = 0; while (*buf >= '0' && *buf <= '9') screen_width = screen_width*10 + *buf++ - '0'; while (*buf == ',' || *buf == ' ' || *buf == '\t') buf++; screen_height = 0; while (*buf >= '0' && *buf <= '9') screen_height = screen_height*10 + *buf++ - '0'; } else if (*buf == 'l' || *buf == 'L'){ buf++; SKIP_SPACE(buf); while (*buf >= '0' && *buf <= '9') buf++; } else if (*buf != ',') break; SKIP_SPACE(buf); if (!config_flag && *buf != ',') break; if (*buf == ',') buf++; } } int ScriptHandler::labelScript() { int label_counter = -1; int current_line = 0; char *buf = script_buffer; label_info = new LabelInfo[ num_of_labels+1 ]; while ( buf < script_buffer + script_buffer_length ){ SKIP_SPACE( buf ); if ( *buf == '*' ){ while (*(buf+1) == '*') buf++; setCurrent( buf ); readLabel(); label_info[ ++label_counter ].name = new char[ strlen(string_buffer) ]; strcpy( label_info[ label_counter ].name, string_buffer+1 ); label_info[ label_counter ].label_header = buf; label_info[ label_counter ].num_of_lines = 1; label_info[ label_counter ].start_line = current_line; buf = getNext(); if ( *buf == 0x0a ){ buf++; current_line++; } SKIP_SPACE( buf ); label_info[ label_counter ].start_address = buf; } else{ if ( label_counter >= 0 ) label_info[ label_counter ].num_of_lines++; while( *buf != 0x0a ) buf++; buf++; current_line++; } } label_info[num_of_labels].start_address = NULL; return 0; } int ScriptHandler::findLabel( const char *label ) { int i; char capital_label[256]; for ( i=0 ; i<(int)strlen( label )+1 ; i++ ){ capital_label[i] = label[i]; if ( 'A' <= capital_label[i] && capital_label[i] <= 'Z' ) capital_label[i] += 'a' - 'A'; } for ( i=0 ; i= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || ch == '_'){ if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; str_string_buffer[c++] = ch; ch = *++(*buf); } str_string_buffer[c] = '\0'; current_variable.type |= VAR_CONST; } else{ // str alias char ch, alias_buf[512]; int alias_buf_len = 0; bool first_flag = true; while(1){ if ( alias_buf_len == 511 ) break; ch = **buf; if ( (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_' ){ if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; first_flag = false; alias_buf[ alias_buf_len++ ] = ch; } else if ( ch >= '0' && ch <= '9' ){ if ( first_flag ) errorAndExit("parseStr: number is not allowed for the first letter of str alias."); first_flag = false; alias_buf[ alias_buf_len++ ] = ch; } else break; (*buf)++; } alias_buf[alias_buf_len] = '\0'; if ( alias_buf_len == 0 ){ str_string_buffer[0] = '\0'; current_variable.type = VAR_NONE; return; } Alias *p_str_alias = root_str_alias.next; while( p_str_alias ){ if ( !strcmp( p_str_alias->alias, (const char*)alias_buf ) ){ strcpy( str_string_buffer, p_str_alias->str ); break; } p_str_alias = p_str_alias->next; } if ( !p_str_alias ){ printf("can't find str alias for %s...\n", alias_buf ); exit(-1); } current_variable.type |= VAR_CONST; } } int ScriptHandler::parseInt( char **buf ) { int ret = 0; SKIP_SPACE( *buf ); if ( **buf == '%' ){ (*buf)++; current_variable.var_no = parseInt(buf); current_variable.type = VAR_INT; return getVariableData(current_variable.var_no).num; } else if ( **buf == '?' ){ ArrayVariable av; current_variable.var_no = parseArray( buf, av ); current_variable.type = VAR_ARRAY; current_variable.array = av; return *getArrayPtr( current_variable.var_no, current_variable.array, 0 ); } else{ char ch, alias_buf[256]; int alias_buf_len = 0, alias_no = 0; bool direct_num_flag = false; bool num_alias_flag = false; char *buf_start = *buf; while( 1 ){ ch = **buf; if ( (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || ch == '_' ){ if (ch >= 'A' && ch <= 'Z') ch += 'a' - 'A'; if ( direct_num_flag ) break; num_alias_flag = true; alias_buf[ alias_buf_len++ ] = ch; } else if ( ch >= '0' && ch <= '9' ){ if ( !num_alias_flag ) direct_num_flag = true; if ( direct_num_flag ) alias_no = alias_no * 10 + ch - '0'; else alias_buf[ alias_buf_len++ ] = ch; } else break; (*buf)++; } if ( *buf - buf_start == 0 ){ current_variable.type = VAR_NONE; return 0; } /* ---------------------------------------- */ /* Solve num aliases */ if ( num_alias_flag ){ alias_buf[ alias_buf_len ] = '\0'; Alias *p_num_alias = root_num_alias.next; while( p_num_alias ){ if ( !strcmp( p_num_alias->alias, (const char*)alias_buf ) ){ alias_no = p_num_alias->num; break; } p_num_alias = p_num_alias->next; } if ( !p_num_alias ){ //printf("can't find num alias for %s... assume 0.\n", alias_buf ); current_variable.type = VAR_NONE; *buf = buf_start; return 0; } } current_variable.type = VAR_INT | VAR_CONST; ret = alias_no; } SKIP_SPACE( *buf ); return ret; } int ScriptHandler::parseIntExpression( char **buf ) { int num[3], op[2]; // internal buffer SKIP_SPACE( *buf ); readNextOp( buf, NULL, &num[0] ); readNextOp( buf, &op[0], &num[1] ); if ( op[0] == OP_INVALID ) return num[0]; while(1){ readNextOp( buf, &op[1], &num[2] ); if ( op[1] == OP_INVALID ) break; if ( !(op[0] & 0x04) && (op[1] & 0x04) ){ // if priority of op[1] is higher than op[0] num[1] = calcArithmetic( num[1], op[1], num[2] ); } else{ num[0] = calcArithmetic( num[0], op[0], num[1] ); op[0] = op[1]; num[1] = num[2]; } } return calcArithmetic( num[0], op[0], num[1] ); } /* * Internal buffer looks like this. * num[0] op[0] num[1] op[1] num[2] * If priority of op[0] is higher than op[1], (num[0] op[0] num[1]) is computed, * otherwise (num[1] op[1] num[2]) is computed. * Then, the next op and num is read from the script. * Num is an immediate value, a variable or a bracketed expression. */ void ScriptHandler::readNextOp( char **buf, int *op, int *num ) { bool minus_flag = false; SKIP_SPACE(*buf); char *buf_start = *buf; if ( op ){ if ( (*buf)[0] == '+' ) *op = OP_PLUS; else if ( (*buf)[0] == '-' ) *op = OP_MINUS; else if ( (*buf)[0] == '*' ) *op = OP_MULT; else if ( (*buf)[0] == '/' ) *op = OP_DIV; else if ( (*buf)[0] == 'm' && (*buf)[1] == 'o' && (*buf)[2] == 'd' && ( (*buf)[3] == ' ' || (*buf)[3] == '\t' || (*buf)[3] == '$' || (*buf)[3] == '%' || (*buf)[3] == '?' || ( (*buf)[3] >= '0' && (*buf)[3] <= '9') )) *op = OP_MOD; else{ *op = OP_INVALID; return; } if ( *op == OP_MOD ) *buf += 3; else (*buf)++; SKIP_SPACE(*buf); } else{ if ( (*buf)[0] == '-' ){ minus_flag = true; (*buf)++; SKIP_SPACE(*buf); } } if ( (*buf)[0] == '(' ){ (*buf)++; *num = parseIntExpression( buf ); if (minus_flag) *num = -*num; SKIP_SPACE(*buf); if ( (*buf)[0] != ')' ) errorAndExit("Missing ')' in expression"); (*buf)++; } else{ *num = parseInt( buf ); if (minus_flag) *num = -*num; if ( current_variable.type == VAR_NONE ){ if (op) *op = OP_INVALID; *buf = buf_start; } } } int ScriptHandler::calcArithmetic( int num1, int op, int num2 ) { int ret=0; if ( op == OP_PLUS ) ret = num1+num2; else if ( op == OP_MINUS ) ret = num1-num2; else if ( op == OP_MULT ) ret = num1*num2; else if ( op == OP_DIV ) ret = num1/num2; else if ( op == OP_MOD ) ret = num1%num2; current_variable.type = VAR_INT | VAR_CONST; return ret; } int ScriptHandler::parseArray( char **buf, struct ArrayVariable &array ) { SKIP_SPACE( *buf ); (*buf)++; // skip '?' int no = parseInt( buf ); SKIP_SPACE( *buf ); array.num_dim = 0; while ( **buf == '[' ){ (*buf)++; array.dim[array.num_dim] = parseIntExpression(buf); array.num_dim++; SKIP_SPACE( *buf ); if ( **buf != ']' ) errorAndExit( "parseArray: missing ']'." ); (*buf)++; } for ( int i=array.num_dim ; i<20 ; i++ ) array.dim[i] = 0; return no; } int *ScriptHandler::getArrayPtr( int no, ArrayVariable &array, int offset ) { ArrayVariable *av = root_array_variable; while(av){ if (av->no == no) break; av = av->next; } if (av == NULL) errorAndExit( "Array No. is not declared." ); int dim = 0, i; for ( i=0 ; inum_dim ; i++ ){ if ( av->dim[i] <= array.dim[i] ) errorAndExit( "dim[i] <= array.dim[i]." ); dim = dim * av->dim[i] + array.dim[i]; } if ( av->dim[i-1] <= array.dim[i-1] + offset ) errorAndExit( "dim[i-1] <= array.dim[i-1] + offset." ); return &av->data[dim+offset]; } void ScriptHandler::declareDim() { current_script = next_script; char *buf = current_script; if (current_array_variable){ current_array_variable->next = new ArrayVariable(); current_array_variable = current_array_variable->next; } else{ root_array_variable = new ArrayVariable(); current_array_variable = root_array_variable; } ArrayVariable array; current_array_variable->no = parseArray( &buf, array ); int dim = 1; current_array_variable->num_dim = array.num_dim; for ( int i=0 ; idim[i] = array.dim[i]+1; dim *= (array.dim[i]+1); } current_array_variable->data = new int[dim]; memset( current_array_variable->data, 0, sizeof(int) * dim ); next_script = buf; } onscripter-20150820/LUAHandler.h0000644017777601777760000000360012565174244016067 0ustar nobodynogroup/* -*- C++ -*- * * LUAHandler.h - LUA handler for ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #if !defined(__LUA_HANDLER_H__) && defined(USE_LUA) #define __LUA_HANDLER_H__ #include class ONScripter; class ScriptHandler; class LUAHandler{ public: enum { LUA_TAG, LUA_TEXT0, LUA_TEXT, LUA_ANIMATION, LUA_CLOSE, LUA_END, LUA_SAVEPOINT, LUA_SAVE, LUA_LOAD, LUA_RESET, MAX_CALLBACK }; LUAHandler(); ~LUAHandler(); void init(ONScripter *ons, ScriptHandler *sh, int screen_ratio1, int screen_ratio2); void loadInitScript(); void addCallback(const char *label); int callFunction(bool is_callback, const char *cmd); bool isCallbackEnabled(int val); bool is_animatable; int duration_time; int remaining_time; //private: ONScripter *ons; lua_State *state; ScriptHandler *sh; int screen_ratio1, screen_ratio2; char error_str[256]; bool callback_state[MAX_CALLBACK]; }; #endif // __LUA_HANDLER_H__ onscripter-20150820/conv_shared.cpp0000644017777601777760000002766112565174244017013 0ustar nobodynogroup/* -*- C++ -*- * * conv_shared.cpp - Shared code of sarconv and nsaconv * * Copyright (c) 2001-2006 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include #include #include extern "C"{ #include }; #include #include "resize_image.h" int scale_ratio_upper; int scale_ratio_lower; unsigned char *rescaled_tmp2_buffer = NULL; size_t rescaled_tmp2_length = 0; unsigned char *rescaled_tmp_buffer = NULL; size_t rescaled_tmp_length = 0; static unsigned char *restored_buffer = NULL; static size_t restored_length = 0; #define INPUT_BUFFER_SIZE 4096 typedef struct { struct jpeg_source_mgr pub; unsigned char *buf; size_t left; } my_source_mgr; typedef struct { struct jpeg_destination_mgr pub; unsigned char *buf; size_t left; } my_destination_mgr; void rescaleImage( unsigned char *original_buffer, int width, int height, int byte_per_pixel, bool src_pad_flag, bool dst_pad_flag, bool palette_flag ) { size_t width_pad = 0; if ( src_pad_flag ) width_pad = (4 - width * byte_per_pixel % 4) % 4; size_t w = (int)(width * scale_ratio_upper / scale_ratio_lower); size_t h = (int)(height * scale_ratio_upper / scale_ratio_lower); if ( w==0 ) w=1; if ( h==0 ) h=1; size_t w_pad = 0; if ( dst_pad_flag ) w_pad = (4 - w * byte_per_pixel % 4) % 4; if ( (w * byte_per_pixel + w_pad) * h > rescaled_tmp_length ){ int len = (w * byte_per_pixel + w_pad) * h; if ( rescaled_tmp_buffer ) delete[] rescaled_tmp_buffer; rescaled_tmp_buffer = new unsigned char[ len ]; rescaled_tmp_length = len; } size_t len = (width * byte_per_pixel + width_pad) * (height+1) + byte_per_pixel; if ( len<16 ) len = 16; if ( len > rescaled_tmp2_length ){ if ( rescaled_tmp2_buffer ) delete[] rescaled_tmp2_buffer; rescaled_tmp2_buffer = new unsigned char[ len ]; rescaled_tmp2_length = len; } resizeImage( rescaled_tmp_buffer, w, h, w*byte_per_pixel+w_pad, original_buffer, width, height, width*byte_per_pixel+width_pad, byte_per_pixel, rescaled_tmp2_buffer, width*byte_per_pixel+width_pad, palette_flag ); } void init_source (j_decompress_ptr cinfo) { } boolean fill_input_buffer (j_decompress_ptr cinfo) { my_source_mgr *src = (my_source_mgr *)cinfo->src; src->pub.next_input_byte = src->buf; src->pub.bytes_in_buffer = src->left; return TRUE; } void skip_input_data (j_decompress_ptr cinfo, long num_bytes) { my_source_mgr *src = (my_source_mgr *)cinfo->src; src->pub.next_input_byte += (size_t) num_bytes; src->pub.bytes_in_buffer -= (size_t) num_bytes; } void term_source (j_decompress_ptr cinfo) { } void init_destination (j_compress_ptr cinfo) { my_destination_mgr * dest = (my_destination_mgr *) cinfo->dest; dest->pub.next_output_byte = dest->buf; dest->pub.free_in_buffer = dest->left; } boolean empty_output_buffer (j_compress_ptr cinfo) { my_destination_mgr * dest = (my_destination_mgr *) cinfo->dest; dest->pub.next_output_byte = dest->buf; dest->pub.free_in_buffer = dest->left; return TRUE; } void term_destination (j_compress_ptr cinfo) { } size_t rescaleJPEGWrite( unsigned int width, unsigned int height, int byte_per_pixel, unsigned char **rescaled_buffer, int quality, bool bmp2jpeg_flag ) { jpeg_error_mgr jerr; struct jpeg_compress_struct cinfo2; JSAMPROW row_pointer[1]; cinfo2.err = jpeg_std_error(&jerr); jpeg_create_compress(&cinfo2); cinfo2.dest = (struct jpeg_destination_mgr *) (*cinfo2.mem->alloc_small) ((j_common_ptr) &cinfo2, JPOOL_PERMANENT, sizeof(my_destination_mgr)); my_destination_mgr * dest = (my_destination_mgr *) cinfo2.dest; dest->buf = *rescaled_buffer; dest->left = restored_length; dest->pub.init_destination = init_destination; dest->pub.empty_output_buffer = empty_output_buffer; dest->pub.term_destination = term_destination; cinfo2.image_width = (int)(width * scale_ratio_upper / scale_ratio_lower); if ( cinfo2.image_width == 0 ) cinfo2.image_width = 1; cinfo2.image_height = (int)(height * scale_ratio_upper / scale_ratio_lower); if ( cinfo2.image_height == 0 ) cinfo2.image_height = 1; cinfo2.input_components = byte_per_pixel; if ( cinfo2.input_components == 1 ) cinfo2.in_color_space = JCS_GRAYSCALE; else cinfo2.in_color_space = JCS_RGB; jpeg_set_defaults(&cinfo2); jpeg_set_quality(&cinfo2, quality, TRUE ); cinfo2.optimize_coding = true; //jpeg_simple_progression (&cinfo2); jpeg_start_compress(&cinfo2, TRUE); int row_stride = cinfo2.image_width * byte_per_pixel; while (cinfo2.next_scanline < cinfo2.image_height) { if (bmp2jpeg_flag){ unsigned char *src = row_pointer[0] = &rescaled_tmp_buffer[(cinfo2.image_height - 1 - cinfo2.next_scanline) * row_stride]; for(unsigned int i=0 ; ileft - dest->pub.free_in_buffer; jpeg_destroy_compress(&cinfo2); return datacount; } size_t rescaleJPEG( unsigned char *original_buffer, size_t length, unsigned char **rescaled_buffer, int quality ) { struct jpeg_decompress_struct cinfo; jpeg_error_mgr jerr; cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); cinfo.src = (struct jpeg_source_mgr *) (*cinfo.mem->alloc_small) ((j_common_ptr) &cinfo, JPOOL_PERMANENT, sizeof(my_source_mgr)); my_source_mgr * src = (my_source_mgr *) cinfo.src; src->buf = original_buffer; src->left = length; src->pub.init_source = init_source; src->pub.fill_input_buffer = fill_input_buffer; src->pub.skip_input_data = skip_input_data; src->pub.resync_to_restart = jpeg_resync_to_restart; src->pub.term_source = term_source; src->pub.bytes_in_buffer = 0; src->pub.next_input_byte = NULL; jpeg_read_header(&cinfo, TRUE); jpeg_start_decompress(&cinfo); if ( cinfo.output_width * cinfo.output_height * cinfo.output_components + 0x400 > restored_length ){ restored_length = cinfo.output_width * cinfo.output_height * cinfo.output_components + 0x400; if ( restored_buffer ) delete[] restored_buffer; restored_buffer = new unsigned char[ restored_length ]; if ( *rescaled_buffer ) delete[] *rescaled_buffer; *rescaled_buffer = new unsigned char[ restored_length ]; } int row_stride = cinfo.output_width * cinfo.output_components; JSAMPARRAY buf = (*cinfo.mem->alloc_sarray) ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); unsigned char *buf_p = restored_buffer; while (cinfo.output_scanline < cinfo.output_height) { jpeg_read_scanlines(&cinfo, buf, 1); memcpy( buf_p, buf[0], row_stride ); buf_p += cinfo.output_width * cinfo.output_components; } rescaleImage( restored_buffer, cinfo.output_width, cinfo.output_height, cinfo.output_components, false, false, false ); size_t datacount = rescaleJPEGWrite(cinfo.output_width, cinfo.output_height, cinfo.output_components, rescaled_buffer, quality, false); jpeg_destroy_decompress(&cinfo); return datacount; } void rescaleBMPWrite( unsigned char *original_buffer, size_t total_size, int width, int height, unsigned char **rescaled_buffer ) { int buffer_offset = original_buffer[10] + (original_buffer[11] << 8); memcpy( *rescaled_buffer, original_buffer, buffer_offset ); memcpy( *rescaled_buffer + buffer_offset, rescaled_tmp_buffer, total_size - buffer_offset ); *(*rescaled_buffer + 2) = total_size & 0xff; *(*rescaled_buffer + 3) = (total_size >> 8) & 0xff; *(*rescaled_buffer + 4) = (total_size >> 16) & 0xff; *(*rescaled_buffer + 5) = (total_size >> 24) & 0xff; *(*rescaled_buffer + 18) = width & 0xff; *(*rescaled_buffer + 19) = (width >> 8) & 0xff; *(*rescaled_buffer + 20) = (width >> 16) & 0xff; *(*rescaled_buffer + 21) = (width >> 24) & 0xff; *(*rescaled_buffer + 22) = height & 0xff; *(*rescaled_buffer + 23) = (height >> 8) & 0xff; *(*rescaled_buffer + 24) = (height >> 16) & 0xff; *(*rescaled_buffer + 25) = (height >> 24) & 0xff; *(*rescaled_buffer + 34) = 0; *(*rescaled_buffer + 35) = 0; *(*rescaled_buffer + 36) = 0; *(*rescaled_buffer + 37) = 0; #if 0 FILE *fp = fopen( "test.bmp", "wb" ); fwrite( *rescaled_buffer, 1, width2 * height2 * byte_per_pixel + 54 + color_num*4, fp ); fclose(fp); getchar(); #endif } size_t rescaleBMP( unsigned char *original_buffer, unsigned char **rescaled_buffer, bool output_jpeg_flag, int quality ) { if (original_buffer[14] != 40){ if (original_buffer[14] == 12) fprintf( stderr, " OS/2 format is not supported.\n"); else fprintf( stderr, " this bitmap can't be handled.\n"); exit(-1); } int buffer_offset = original_buffer[10] + (original_buffer[11] << 8); int width = original_buffer[18] + (original_buffer[19] << 8); int height = original_buffer[22] + (original_buffer[23] << 8); int bit_per_pixel = original_buffer[28]; if (bit_per_pixel == 1 || bit_per_pixel == 4){ fprintf( stderr, " bit_per_pixel %d is not supported.\n", bit_per_pixel); exit(-1); } int byte_per_pixel = bit_per_pixel / 8; int color_num = original_buffer[46] + ((int)original_buffer[47] << 8) + (original_buffer[48] << 16) + (original_buffer[49] << 24); if (bit_per_pixel == 8 && color_num == 0) color_num = 256; bool palette_flag = false; if (bit_per_pixel == 8) palette_flag = true; if (palette_flag) output_jpeg_flag = false; size_t width2 = (int)(width * scale_ratio_upper / scale_ratio_lower); if ( width2 == 0 ) width2 = 1; size_t width2_pad = (4 - width2 * byte_per_pixel % 4) % 4; size_t height2 = (int)(height * scale_ratio_upper / scale_ratio_lower); if ( height2 == 0 ) height2 = 1; size_t total_size = (width2 * byte_per_pixel + width2_pad) * height2 + buffer_offset; if ( total_size+0x400 > restored_length ){ restored_length = total_size+0x400; if ( restored_buffer ) delete[] restored_buffer; restored_buffer = new unsigned char[ restored_length ]; if ( *rescaled_buffer ) delete[] *rescaled_buffer; *rescaled_buffer = new unsigned char[ restored_length ]; } if (output_jpeg_flag){ rescaleImage( original_buffer+buffer_offset, width, height, byte_per_pixel, true, false, palette_flag ); total_size = rescaleJPEGWrite(width, height, byte_per_pixel, rescaled_buffer, quality, true); } else { rescaleImage( original_buffer+buffer_offset, width, height, byte_per_pixel, true, true, palette_flag ); rescaleBMPWrite(original_buffer, total_size, width2, height2, rescaled_buffer); } return total_size; } onscripter-20150820/ONScripter_file2.cpp0000644017777601777760000005726312565174244017632 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_file2.cpp - FILE I/O of ONScripter * * Copyright (c) 2001-2013 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" int ONScripter::loadSaveFile2( int file_version ) { deleteNestInfo(); int i, j; readInt(); // 1 ... < 2.96, 2 ... >= 2.96 if ( readInt() == 1 ) sentence_font.is_bold = true; else sentence_font.is_bold = false; if ( readInt() == 1 ) sentence_font.is_shadow = true; else sentence_font.is_shadow = false; readInt(); // 0 rmode_flag = (readInt()==1)?true:false; sentence_font.color[0] = readInt(); sentence_font.color[1] = readInt(); sentence_font.color[2] = readInt(); cursor_info[0].remove(); char *tmp_name = NULL; readStr( &tmp_name ); loadCursor(0, tmp_name, 0, 0); readStr( &tmp_name ); loadCursor(1, tmp_name, 0, 0); if (tmp_name) delete[] tmp_name; window_effect.effect = readInt(); window_effect.duration = readInt(); readStr( &window_effect.anim.image_name ); // probably sentence_font.clear(); sentence_font.ttf_font[0] = NULL; sentence_font.ttf_font[1] = NULL; sentence_font.top_xy[0] = readInt(); sentence_font.top_xy[1] = readInt(); sentence_font.num_xy[0] = readInt(); sentence_font.num_xy[1] = readInt(); sentence_font.font_size_xy[0] = readInt(); sentence_font.font_size_xy[1] = readInt(); sentence_font.pitch_xy[0] = readInt(); sentence_font.pitch_xy[1] = readInt(); for ( i=0 ; i<3 ; i++ ) sentence_font.window_color[2-i] = readChar(); if ( readChar() == 0x00 ) sentence_font.is_transparent = true; else sentence_font.is_transparent = false; sentence_font.wait_time = readInt(); AnimationInfo *ai = &sentence_font_info; ai->remove(); ai->orig_pos.x = readInt(); ai->orig_pos.y = readInt(); ai->orig_pos.w = readInt() + 1 - ai->orig_pos.x; ai->orig_pos.h = readInt() + 1 - ai->orig_pos.y; ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->scalePosWH( screen_ratio1, screen_ratio2 ); readStr( &ai->image_name ); if ( !sentence_font.is_transparent && ai->image_name ){ parseTaggedString( ai ); setupAnimationInfo( ai ); } if ( readInt() == 1 ) cursor_info[0].abs_flag = false; else cursor_info[0].abs_flag = true; if ( readInt() == 1 ) cursor_info[1].abs_flag = false; else cursor_info[1].abs_flag = true; cursor_info[0].orig_pos.x = readInt(); cursor_info[1].orig_pos.x = readInt(); cursor_info[0].orig_pos.y = readInt(); cursor_info[1].orig_pos.y = readInt(); cursor_info[0].scalePosXY( screen_ratio1, screen_ratio2 ); cursor_info[1].scalePosXY( screen_ratio1, screen_ratio2 ); // load background surface bg_info.remove(); readStr( &bg_info.file_name ); createBackground(); for ( i=0 ; i<3 ; i++ ){ tachi_info[i].remove(); readStr( &tachi_info[i].image_name ); if ( tachi_info[i].image_name ){ parseTaggedString( &tachi_info[i] ); setupAnimationInfo( &tachi_info[i] ); } } for ( i=0 ; i<3 ; i++ ) tachi_info[i].orig_pos.x = readInt(); for ( i=0 ; i<3 ; i++ ) tachi_info[i].orig_pos.y = readInt(); for ( i=0 ; i<3 ; i++ ) tachi_info[i].scalePosXY( screen_ratio1, screen_ratio2 ); readInt(); // 0 readInt(); // 0 readInt(); // 0 if (file_version >= 203){ readInt(); // -1 readInt(); // -1 readInt(); // -1 } for ( i=0 ; iremove(); readStr( &ai->image_name ); if ( ai->image_name ){ parseTaggedString( ai ); setupAnimationInfo( ai ); } ai->orig_pos.x = readInt(); ai->orig_pos.y = readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); if ( readInt() == 1 ) ai->visible = true; else ai->visible = false; ai->current_cell = readInt(); if (file_version >= 203) ai->trans = readInt(); } readVariables( 0, script_h.global_variable_border ); // nested info int num_nest =readInt(); last_nest_info = &root_nest_info; if (num_nest > 0){ file_io_buf_ptr += (num_nest-1)*4; while( num_nest > 0 ){ NestInfo *info = new NestInfo(); if (last_nest_info == &root_nest_info) last_nest_info = info; i = readInt(); if (i > 0){ info->nest_mode = NestInfo::LABEL; info->next_script = script_h.getAddress( i ); file_io_buf_ptr -= 8; num_nest--; } else{ info->nest_mode = NestInfo::FOR; info->next_script = script_h.getAddress( -i ); file_io_buf_ptr -= 16; info->var_no = readInt(); info->to = readInt(); info->step = readInt(); file_io_buf_ptr -= 16; num_nest -= 4; } info->next = root_nest_info.next; if (root_nest_info.next) root_nest_info.next->previous = info; root_nest_info.next = info; info->previous = &root_nest_info; } num_nest = readInt(); file_io_buf_ptr += num_nest*4; } if (readInt() == 1) monocro_flag = true; else monocro_flag = false; for ( i=0 ; i<3 ; i++ ) monocro_color[2-i] = readInt(); for ( i=0 ; i<256 ; i++ ){ monocro_color_lut[i][0] = (monocro_color[0] * i) >> 8; monocro_color_lut[i][1] = (monocro_color[1] * i) >> 8; monocro_color_lut[i][2] = (monocro_color[2] * i) >> 8; } nega_mode = readInt(); // ---------------------------------------- // Sound stopCommand(); loopbgmstopCommand(); stopAllDWAVE(); readStr( &midi_file_name ); // MIDI file readStr( &wave_file_name ); // wave, waveloop i = readInt(); if ( i >= 0 ) current_cd_track = i; // play, playonce MIDI if ( readInt() == 1 ){ midi_play_loop_flag = true; current_cd_track = -2; playSound(midi_file_name, SOUND_MIDI, midi_play_loop_flag); } else midi_play_loop_flag = false; // wave, waveloop if ( readInt() == 1 ) wave_play_loop_flag = true; else wave_play_loop_flag = false; if ( wave_file_name && wave_play_loop_flag ) playSound(wave_file_name, SOUND_CHUNK, wave_play_loop_flag, MIX_WAVE_CHANNEL); // play, playonce if ( readInt() == 1 ) cd_play_loop_flag = true; else cd_play_loop_flag = false; if ( current_cd_track >= 0 ) playCDAudio(); // bgm, mp3, mp3loop if ( readInt() == 1 ) music_play_loop_flag = true; else music_play_loop_flag = false; if ( readInt() == 1 ) mp3save_flag = true; else mp3save_flag = false; readStr( &music_file_name ); if ( music_file_name ){ playSound(music_file_name, SOUND_MUSIC | SOUND_MIDI, music_play_loop_flag, MIX_BGM_CHANNEL); } erase_text_window_mode = readInt(); readInt(); // 1 barclearCommand(); for ( i=0 ; itrans_mode = AnimationInfo::TRANS_COPY; ai->num_of_cells = 1; ai->param = j; ai->orig_pos.x = readInt(); ai->orig_pos.y = readInt(); ai->max_width = readInt(); ai->orig_pos.w = 0; ai->orig_pos.h = readInt(); ai->max_param = readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); for ( j=0 ; j<3 ; j++ ) ai->color[2-j] = readChar(); readChar(); // 0x00 int w = ai->max_width * ai->param / ai->max_param; if ( ai->max_width > 0 && w > 0 ) ai->orig_pos.w = w; ai->scalePosWH( screen_ratio1, screen_ratio2 ); ai->allocImage( ai->pos.w, ai->pos.h, texture_format ); ai->fill( ai->color[0], ai->color[1], ai->color[2], 0xff ); } else{ readInt(); // -1 readInt(); // 0 readInt(); // 0 readInt(); // 0 readInt(); // 0 readInt(); // 0 } } prnumclearCommand(); for ( i=0 ; itrans_mode = AnimationInfo::TRANS_STRING; ai->num_of_cells = 1; ai->color_list = new uchar3[1]; ai->param = j; ai->orig_pos.x = readInt(); ai->orig_pos.y = readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->font_size_xy[0] = readInt(); ai->font_size_xy[1] = readInt(); ai->font_pitch[0] = ai->font_size_xy[0]; ai->font_pitch[1] = ai->font_size_xy[1]; for ( j=0 ; j<3 ; j++ ) ai->color_list[0][2-j] = readChar(); readChar(); // 0x00 char num_buf[7]; script_h.getStringFromInteger( num_buf, ai->param, 3 ); setStr( &ai->file_name, num_buf ); setupAnimationInfo( ai ); } else{ readInt(); // -1 readInt(); // 0 readInt(); // 0 readInt(); // 0 readInt(); // 0 } } readInt(); // 1 readInt(); // 0 readInt(); // 1 btndef_info.remove(); readStr( &btndef_info.image_name ); if ( btndef_info.image_name && btndef_info.image_name[0] != '\0' ){ parseTaggedString( &btndef_info ); setupAnimationInfo( &btndef_info ); SDL_SetAlpha( btndef_info.image_surface, DEFAULT_BLIT_FLAG, SDL_ALPHA_OPAQUE ); } if ( file_version >= 202 ) readArrayVariable(); readInt(); // 0 if ( readChar() == 1 ) erase_text_window_mode = 2; readChar(); // 0 readChar(); // 0 readChar(); // 0 readStr( &loop_bgm_name[0] ); readStr( &loop_bgm_name[1] ); if ( loop_bgm_name[0] ) { if ( loop_bgm_name[1] ) playSound(loop_bgm_name[1], SOUND_PRELOAD|SOUND_CHUNK, false, MIX_LOOPBGM_CHANNEL1); playSound(loop_bgm_name[0], SOUND_CHUNK, false, MIX_LOOPBGM_CHANNEL0); } if ( file_version >= 201 ){ if ( readInt() == 1 ) sentence_font.rubyon_flag = true; else sentence_font.rubyon_flag = false; ruby_struct.font_size_xy[0] = readInt(); ruby_struct.font_size_xy[1] = readInt(); readStr( &ruby_struct.font_name ); } if (file_version >= 204){ readInt(); for ( i=0 ; iremove(); readStr( &ai->image_name ); if ( ai->image_name ){ parseTaggedString( ai ); setupAnimationInfo( ai ); } ai->orig_pos.x = readInt(); ai->orig_pos.y = readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->scale_x = readInt(); ai->scale_y = readInt(); ai->rot = readInt(); if ( readInt() == 1 ) ai->visible = true; else ai->visible = false; ai->trans = readInt(); ai->blending_mode = readInt(); ai->calcAffineMatrix(); } readInt(); readInt(); if (file_version >= 205) readInt(); // 1 readInt(); readInt(); readInt(); readInt(); if (file_version >= 205) readChar(); // 0 } if (file_version >= 206){ readInt(); // 0 readInt(); // 160 readInt(); // 320 readInt(); // 480 if (file_version >= 207) underline_value = readInt(); else readInt(); // 480 } int text_num = readInt(); start_page = current_page; for ( i=0 ; iadd(readChar())); if (file_version == 203) readChar(); // 0 current_page->text_count--; current_page = current_page->next; } clearCurrentPage(); if (file_version >= 205){ Page *page = start_page; j = readInt(); for (i=0 ; itag); page = page->next; } } else if (file_version >= 204){ readInt(); readInt(); } i = readInt(); current_label_info = script_h.getLabelByLine( i ); current_line = i - current_label_info.start_line; //printf("load %d:%d(%d-%d)\n", current_label_info.start_line, current_line, i, current_label_info.start_line); char *buf = script_h.getAddressByLine( i ); j = readInt(); for ( i=0 ; iimage_name, output_flag ); writeInt( ai->orig_pos.x, output_flag ); writeInt( ai->orig_pos.y, output_flag ); writeInt( ai->visible?1:0, output_flag ); writeInt( ai->current_cell, output_flag ); writeInt( ai->trans, output_flag ); } writeVariables( 0, script_h.global_variable_border, output_flag ); // nested info int num_nest = 0; NestInfo *info = root_nest_info.next; while( info ){ if (info->nest_mode == NestInfo::LABEL) num_nest++; else if (info->nest_mode == NestInfo::FOR) num_nest+=4; info = info->next; } writeInt( num_nest, output_flag ); info = root_nest_info.next; while( info ){ if (info->nest_mode == NestInfo::LABEL){ writeInt( script_h.getOffset( info->next_script ), output_flag ); } else if (info->nest_mode == NestInfo::FOR){ writeInt( info->var_no, output_flag ); writeInt( info->to, output_flag ); writeInt( info->step, output_flag ); writeInt( -script_h.getOffset( info->next_script ), output_flag ); } info = info->next; } writeInt( (monocro_flag)?1:0, output_flag ); for ( i=0 ; i<3 ; i++ ) writeInt( monocro_color[2-i], output_flag ); writeInt( nega_mode, output_flag ); // sound writeStr( midi_file_name, output_flag ); // MIDI file writeStr( wave_file_name, output_flag ); // wave, waveloop if ( current_cd_track >= 0 ) // play CD writeInt( current_cd_track, output_flag ); else writeInt( -1, output_flag ); writeInt( (midi_play_loop_flag)?1:0, output_flag ); // play, playonce MIDI writeInt( (wave_play_loop_flag)?1:0, output_flag ); // wave, waveloop writeInt( (cd_play_loop_flag)?1:0, output_flag ); // play, playonce writeInt( (music_play_loop_flag)?1:0, output_flag ); // bgm, mp3, mp3loop writeInt( (mp3save_flag)?1:0, output_flag ); if (mp3save_flag) writeStr( music_file_name, output_flag ); else writeStr( NULL, output_flag ); writeInt( (erase_text_window_mode>0)?1:0, output_flag ); writeInt( 1, output_flag ); for ( i=0 ; iparam, output_flag ); writeInt( bar_info[i]->orig_pos.x, output_flag ); writeInt( bar_info[i]->orig_pos.y, output_flag ); writeInt( bar_info[i]->max_width, output_flag ); writeInt( bar_info[i]->orig_pos.h, output_flag ); writeInt( bar_info[i]->max_param, output_flag ); for ( j=0 ; j<3 ; j++ ) writeChar( bar_info[i]->color[2-j], output_flag ); writeChar( 0x00, output_flag ); } else{ writeInt( 0, output_flag ); writeInt( -1, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); } } for ( i=0 ; iparam, output_flag ); writeInt( prnum_info[i]->orig_pos.x, output_flag ); writeInt( prnum_info[i]->orig_pos.y, output_flag ); writeInt( prnum_info[i]->font_size_xy[0], output_flag ); writeInt( prnum_info[i]->font_size_xy[1], output_flag ); for ( j=0 ; j<3 ; j++ ) writeChar( prnum_info[i]->color_list[0][2-j], output_flag ); writeChar( 0x00, output_flag ); } else{ writeInt( 0, output_flag ); writeInt( -1, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); } } writeInt( 1, output_flag ); // unidentified (not 1) data in version 205 writeInt( 0, output_flag ); writeInt( 1, output_flag ); writeStr( btndef_info.image_name, output_flag ); writeArrayVariable(output_flag); writeInt( 0, output_flag ); writeChar( (erase_text_window_mode==2)?1:0, output_flag ); writeChar( 0, output_flag ); writeChar( 0, output_flag ); writeChar( 0, output_flag ); writeStr( loop_bgm_name[0], output_flag ); writeStr( loop_bgm_name[1], output_flag ); writeInt( (sentence_font.rubyon_flag)?1:0, output_flag ); writeInt( ruby_struct.font_size_xy[0], output_flag ); writeInt( ruby_struct.font_size_xy[1], output_flag ); writeStr( ruby_struct.font_name, output_flag ); writeInt( 0, output_flag ); for ( i=0 ; iimage_name, output_flag ); writeInt( ai->orig_pos.x, output_flag ); writeInt( ai->orig_pos.y, output_flag ); writeInt( ai->scale_x, output_flag ); writeInt( ai->scale_y, output_flag ); writeInt( ai->rot, output_flag ); writeInt( ai->visible?1:0, output_flag ); writeInt( ai->trans, output_flag ); writeInt( ai->blending_mode, output_flag ); } writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 1, output_flag ); // added in version 205 writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeInt( 0, output_flag ); writeChar( 0, output_flag ); // added in version 205 writeInt( 0, output_flag ); // added in version 206 writeInt( script_h.screen_width/4, output_flag ); // added in version 206, changed in version 208 writeInt( script_h.screen_width/2, output_flag ); // added in version 206, changed in version 208 writeInt( script_h.screen_width*3/4, output_flag ); // added in version 206, changed in version 208 writeInt( underline_value, output_flag ); // changed in version 207 Page *page = current_page; int num_page = 0; while( page != start_page ){ page = page->previous; num_page++; } writeInt( num_page, output_flag ); for ( i=0 ; itext_count ; j++ ) writeChar( page->text[j], output_flag ); writeChar( 0, output_flag ); page = page->next; } page = start_page; writeInt(num_page, output_flag); for (i=0 ; itag) for ( j=0 ; j<(int)strlen(page->tag) ; j++ ) writeChar( page->tag[j], output_flag ); writeChar( 0, output_flag ); page = page->next; } writeInt( current_label_info.start_line + current_line, output_flag ); char *buf = script_h.getAddressByLine( current_label_info.start_line + current_line ); //printf("save %d:%d\n", current_label_info.start_line, current_line); i = 0; if (!script_h.isText()){ while( buf != script_h.getCurrent(true) ){ if ( *buf == ':' ) i++; buf++; } } writeInt( i, output_flag ); } onscripter-20150820/ScriptParser.h0000644017777601777760000003374712565174244016610 0ustar nobodynogroup/* -*- C++ -*- * * ScriptParser.h - Define block parser of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __SCRIPT_PARSER_H__ #define __SCRIPT_PARSER_H__ #include #include #include #include #include #include "ScriptHandler.h" #include "NsaReader.h" #include "DirectReader.h" #include "AnimationInfo.h" #include "FontInfo.h" #ifdef USE_LUA #include "LUAHandler.h" #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #define DEFAULT_FONT_SIZE 26 #define DEFAULT_DIALOG_FONT_SIZE 18 #define DEFAULT_LOOKBACK_NAME0 "uoncur.bmp" #define DEFAULT_LOOKBACK_NAME1 "uoffcur.bmp" #define DEFAULT_LOOKBACK_NAME2 "doncur.bmp" #define DEFAULT_LOOKBACK_NAME3 "doffcur.bmp" #define DEFAULT_START_KINSOKU "vxjnpABCDEHIRSTUX[" #define DEFAULT_END_KINSOKU "uwimo" typedef unsigned char uchar3[3]; class ScriptParser { public: ScriptParser(); ~ScriptParser(); void reset(); int openScript(); void setCurrentLabel( const char *label ); void gosubReal( const char *label, char *next_script, bool textgosub_flag=false ); FILE *fopen(const char *path, const char *mode, bool use_save_dir=false); void saveGlovalData(); /* Command */ int zenkakkoCommand(); int windowchipCommand(); int windowbackCommand(); int versionstrCommand(); int usewheelCommand(); int useescspcCommand(); int underlineCommand(); int transmodeCommand(); int timeCommand(); int textgosubCommand(); int tanCommand(); int subCommand(); int straliasCommand(); int soundpressplginCommand(); int skipCommand(); int sinCommand(); int shadedistanceCommand(); int setkinsokuCommand(); int selectvoiceCommand(); int selectcolorCommand(); int savenumberCommand(); int savenameCommand(); int savedirCommand(); int rubyonCommand(); int rubyoffCommand(); int roffCommand(); int rmenuCommand(); int returnCommand(); int pretextgosubCommand(); int pagetagCommand(); int numaliasCommand(); int nsadirCommand(); int nsaCommand(); int nextCommand(); int mulCommand(); int movCommand(); int mode_sayaCommand(); int mode_extCommand(); int modCommand(); int midCommand(); int menusetwindowCommand(); int menuselectvoiceCommand(); int menuselectcolorCommand(); int maxkaisoupageCommand(); int luasubCommand(); int luacallCommand(); int lookbackspCommand(); int lookbackcolorCommand(); //int lookbackbuttonCommand(); int loadgosubCommand(); int linepageCommand(); int lenCommand(); int labellogCommand(); int kidokuskipCommand(); int kidokumodeCommand(); int itoaCommand(); int intlimitCommand(); int incCommand(); int ifCommand(); int humanzCommand(); int gotoCommand(); int gosubCommand(); int globalonCommand(); int getparamCommand(); //int gameCommand(); int forCommand(); int filelogCommand(); int englishCommand(); int effectcutCommand(); int effectblankCommand(); int effectCommand(); int divCommand(); int dimCommand(); int defvoicevolCommand(); int defsubCommand(); int defsevolCommand(); int defmp3volCommand(); int defaultspeedCommand(); int defaultfontCommand(); int decCommand(); int dateCommand(); int cosCommand(); int cmpCommand(); int clickvoiceCommand(); int clickstrCommand(); int breakCommand(); int atoiCommand(); int arcCommand(); int addkinsokuCommand(); int addCommand(); protected: struct UserFuncLUT{ struct UserFuncLUT *next; char *command; bool lua_flag; UserFuncLUT(){ next = NULL; command = NULL; lua_flag = false; }; ~UserFuncLUT(){ if (command) delete[] command; }; }; struct UserFuncHash{ UserFuncLUT root; UserFuncLUT *last; } user_func_hash['z'-'a'+1]; struct NestInfo{ enum { LABEL = 0, FOR = 1 }; struct NestInfo *previous, *next; int nest_mode; char *next_script; // used in gosub and for int var_no, to, step; // used in for bool textgosub_flag; // used in textgosub and pretextgosub char *wait_script; // used in gosub with textgosub NestInfo(){ previous = next = NULL; nest_mode = LABEL; textgosub_flag = false; wait_script = NULL; }; } last_tilde; enum { SYSTEM_NULL = 0, SYSTEM_SKIP = 1, SYSTEM_RESET = 2, SYSTEM_SAVE = 3, SYSTEM_LOAD = 4, SYSTEM_LOOKBACK = 5, SYSTEM_WINDOWERASE = 6, SYSTEM_MENU = 7, SYSTEM_YESNO = 8, SYSTEM_AUTOMODE = 9, SYSTEM_END = 10 }; enum { RET_NOMATCH = 0, RET_SKIP_LINE = 1, RET_CONTINUE = 2, RET_NO_READ = 4, RET_EOL = 8 // end of line (0x0a is found) }; enum { CLICK_NONE = 0, CLICK_WAIT = 1, CLICK_NEWPAGE = 2, CLICK_EOL = 4 }; enum{ NORMAL_MODE, DEFINE_MODE }; int current_mode; int debug_level; char *archive_path; char *save_dir; char *nsa_path; unsigned int nsa_offset; bool globalon_flag; bool labellog_flag; bool filelog_flag; bool kidokuskip_flag; bool kidokumode_flag; int z_order; bool rmode_flag; bool windowback_flag; bool usewheel_flag; bool useescspc_flag; bool mode_saya_flag; bool mode_ext_flag; bool force_button_shortcut_flag; bool zenkakko_flag; bool pagetag_flag; int windowchip_sprite_no; int string_buffer_offset; NestInfo root_nest_info, *last_nest_info; ScriptHandler::LabelInfo current_label_info; int current_line; #ifdef USE_LUA LUAHandler lua_handler; #endif /* ---------------------------------------- */ /* Global definitions */ int screen_ratio1, screen_ratio2; int screen_width, screen_height; int screen_device_width, screen_device_height; int device_width, device_height; SDL_Rect screen_rect; int screen_bpp; char *version_str; int underline_value; char *save_dir_envdata; void deleteNestInfo(); void setStr( char **dst, const char *src, int num=-1 ); void readToken(); /* ---------------------------------------- */ /* Effect related variables */ struct EffectLink{ struct EffectLink *next; int no; int effect; int duration; AnimationInfo anim; EffectLink(){ next = NULL; effect = 10; duration = 0; }; }; EffectLink root_effect_link, *last_effect_link, window_effect, tmp_effect; int effect_blank; bool effect_cut_flag; int readEffect( EffectLink *effect ); EffectLink *parseEffect(bool init_flag); /* ---------------------------------------- */ /* Lookback related variables */ //char *lookback_image_name[4]; int lookback_sp[2]; uchar3 lookback_color; /* ---------------------------------------- */ /* For loop related variables */ bool break_flag; /* ---------------------------------------- */ /* Transmode related variables */ int trans_mode; /* ---------------------------------------- */ /* Save/Load related variables */ struct SaveFileInfo{ bool valid; int month, day, hour, minute; char sjis_no[5]; char sjis_month[5]; char sjis_day[5]; char sjis_hour[5]; char sjis_minute[5]; }; unsigned int num_save_file; char *save_menu_name; char *load_menu_name; char *save_item_name; unsigned char *save_data_buf; unsigned char *file_io_buf; size_t file_io_buf_ptr; size_t file_io_buf_len; size_t save_data_len; /* ---------------------------------------- */ /* Text related variables */ bool render_font_outline; char *default_env_font; int default_text_speed[3]; struct Page{ struct Page *next, *previous; char *text; int max_text; int text_count; char *tag; Page(){ text = NULL; text_count = 0; tag = NULL; } ~Page(){ if (text) delete[] text; if (tag) delete[] tag; } char add(char ch){ if (text_count >= max_text){ char *text2 = new char[max_text*2]; memcpy(text2, text, max_text); delete[] text; text = text2; max_text *= 2; } text[text_count++] = ch; return ch; }; } *page_list, *start_page, *current_page; // ring buffer int max_page_list; int clickstr_line; int clickstr_state; int linepage_mode; int num_chars_in_sentence; int line_enter_status; // 0 ... no enter, 1 ... pretext, 2 ... body int page_enter_status; // 0 ... no enter, 1 ... body until @,\ used when pagetag is enabled bool in_textbtn_flag; bool english_mode; struct Kinsoku { char chr[2]; } *start_kinsoku, *end_kinsoku; bool is_kinsoku; int num_start_kinsoku, num_end_kinsoku; void setKinsoku(const char *start_chrs, const char *end_chrs, bool add); bool isStartKinsoku(const char *str); bool isEndKinsoku(const char *str); /* ---------------------------------------- */ /* Sound related variables */ int music_volume; int voice_volume; int se_volume; enum { CLICKVOICE_NORMAL = 0, CLICKVOICE_NEWPAGE = 1, CLICKVOICE_NUM = 2 }; char *clickvoice_file_name[CLICKVOICE_NUM]; enum { SELECTVOICE_OPEN = 0, SELECTVOICE_OVER = 1, SELECTVOICE_SELECT = 2, SELECTVOICE_NUM = 3 }; char *selectvoice_file_name[SELECTVOICE_NUM]; enum { MENUSELECTVOICE_OPEN = 0, MENUSELECTVOICE_CANCEL = 1, MENUSELECTVOICE_OVER = 2, MENUSELECTVOICE_CLICK = 3, MENUSELECTVOICE_WARN = 4, MENUSELECTVOICE_YES = 5, MENUSELECTVOICE_NO = 6, MENUSELECTVOICE_NUM = 7 }; char *menuselectvoice_file_name[MENUSELECTVOICE_NUM]; /* ---------------------------------------- */ /* Font related variables */ FontInfo *current_font, sentence_font, menu_font, ruby_font, dialog_font; struct RubyStruct{ enum { NONE, BODY, RUBY }; int stage; int body_count; const char *ruby_start; const char *ruby_end; int ruby_count; int margin; int font_size_xy[2]; char *font_name; RubyStruct(){ stage = NONE; font_size_xy[0] = 0; font_size_xy[1] = 0; font_name = NULL; }; ~RubyStruct(){ if ( font_name ) delete[] font_name; }; } ruby_struct; int shade_distance[2]; /* ---------------------------------------- */ /* RMenu related variables */ struct RMenuLink{ RMenuLink *next; char *label; int system_call_no; RMenuLink(){ next = NULL; label = NULL; }; ~RMenuLink(){ if (label) delete[] label; }; } root_rmenu_link; unsigned int rmenu_link_num, rmenu_link_width; void deleteRMenuLink(); int getSystemCallNo( const char *buffer ); unsigned char convHexToDec( char ch ); void readColor( uchar3 *color, const char *buf ); void errorAndExit( const char *str, const char *reason=NULL ); void allocFileIOBuf(); int saveFileIOBuf( const char *filename, int offset=0, const char *savestr=NULL ); size_t loadFileIOBuf( const char *filename ); void writeChar( char c, bool output_flag ); char readChar(); void writeInt( int i, bool output_flag ); int readInt(); void writeStr( char *s, bool output_flag ); void readStr( char **s ); void writeVariables( int from, int to, bool output_flag ); void readVariables( int from, int to ); void writeArrayVariable( bool output_flag ); void readArrayVariable(); void writeLog( ScriptHandler::LogInfo &info ); void readLog( ScriptHandler::LogInfo &info ); /* ---------------------------------------- */ /* System customize related variables */ char *textgosub_label; char *pretextgosub_label; char *pretext_buf; char *loadgosub_label; ScriptHandler script_h; unsigned char *key_table; void createKeyTable( const char *key_exe ); }; #endif // __SCRIPT_PARSER_H__ onscripter-20150820/NsaReader.cpp0000644017777601777760000001636112565174244016357 0ustar nobodynogroup/* -*- C++ -*- * * NsaReader.cpp - Reader from a NSA archive * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "NsaReader.h" #include #define NSA_ARCHIVE_NAME "arc" #define NSA_ARCHIVE_NAME2 "arc%d" NsaReader::NsaReader( unsigned int nsa_offset, char *path, int archive_type, const unsigned char *key_table ) :SarReader( path, key_table ) { sar_flag = true; this->nsa_offset = nsa_offset; this->archive_type = archive_type; num_of_nsa_archives = 0; num_of_ns2_archives = 0; if (key_table) nsa_archive_ext = "___"; else nsa_archive_ext = "nsa"; ns2_archive_ext = "ns2"; } NsaReader::~NsaReader() { } int NsaReader::open( const char *nsa_path ) { int i; bool archive_found = false; char archive_name[256], archive_name2[256]; if ( !SarReader::open( "arc.sar" ) ) return 0; sar_flag = false; if (archive_type & ARCHIVE_TYPE_NS2){ for ( i=0 ; ifile_handle = fopen( archive_name, "rb" ) ) == NULL ) break; archive_found = true; ai->file_name = new char[strlen(archive_name)+1]; memcpy(ai->file_name, archive_name, strlen(archive_name)+1); readArchive( ai, ARCHIVE_TYPE_NSA, nsa_offset ); num_of_nsa_archives = i+1; } } if (!archive_found) return -1; return 0; } int NsaReader::openForConvert( char *nsa_name, int archive_type, unsigned int nsa_offset ) { sar_flag = false; if ( ( archive_info.file_handle = ::fopen( nsa_name, "rb" ) ) == NULL ){ fprintf( stderr, "can't open file %s\n", nsa_name ); return -1; } readArchive( &archive_info, archive_type, nsa_offset ); return 0; } int NsaReader::writeHeader( FILE *fp, int archive_type, int nsa_offset ) { ArchiveInfo *ai = &archive_info; return writeHeaderSub( ai, fp, archive_type, nsa_offset ); } size_t NsaReader::putFile( FILE *fp, int no, size_t offset, size_t length, size_t original_length, int compression_type, bool modified_flag, unsigned char *buffer ) { ArchiveInfo *ai = &archive_info; return putFileSub( ai, fp, no, offset, length, original_length , compression_type, modified_flag, buffer ); } const char *NsaReader::getArchiveName() const { return "nsa"; } int NsaReader::getNumFiles(){ int total = archive_info.num_of_files, i; for ( i=0 ; inum_of_files ) return 0; if ( ai->fi_list[i].original_length != 0 ) return ai->fi_list[i].original_length; int type = ai->fi_list[i].compression_type; if ( type == NO_COMPRESSION ) type = getRegisteredCompressionType( file_name ); if ( type == NBZ_COMPRESSION || type == SPB_COMPRESSION ) { ai->fi_list[i].original_length = getDecompressedFileLength( type, ai->file_handle, ai->fi_list[i].offset ); } return ai->fi_list[i].original_length; } size_t NsaReader::getFileLength( const char *file_name ) { if ( sar_flag ) return SarReader::getFileLength( file_name ); size_t ret; int i; if ( ( ret = DirectReader::getFileLength( file_name ) ) ) return ret; for ( i=0 ; i static int osprintf(char *str, const char *format, ...) { str[0] = 0; va_list list; va_start( list, format ); while(*format){ if (IS_TWO_BYTE(*format)){ strncat(str, format, 2); format += 2; } else if (format[0] == '%' && format[1] == 's'){ strcat(str, va_arg(list, char*)); format += 2; } else{ strncat(str, format++, 1); } } va_end( list ); } #define sprintf osprintf #endif void ONScripter::enterSystemCall() { shelter_button_link = root_button_link.next; root_button_link.next = NULL; shelter_select_link = root_select_link.next; root_select_link.next = NULL; shelter_event_mode = event_mode; shelter_mouse_state.x = last_mouse_state.x; shelter_mouse_state.y = last_mouse_state.y; event_mode = IDLE_EVENT_MODE; shelter_display_mode = display_mode; display_mode = DISPLAY_MODE_TEXT; shelter_draw_cursor_flag = draw_cursor_flag; draw_cursor_flag = false; } void ONScripter::leaveSystemCall( bool restore_flag ) { current_font = &sentence_font; display_mode = shelter_display_mode; if ( restore_flag ){ current_page = cached_page; SDL_BlitSurface( backup_surface, NULL, text_info.image_surface, NULL ); root_button_link.next = shelter_button_link; root_select_link.next = shelter_select_link; event_mode = shelter_event_mode; draw_cursor_flag = shelter_draw_cursor_flag; if ( event_mode & WAIT_BUTTON_MODE ){ int x = shelter_mouse_state.x * screen_device_width / screen_width; int y = shelter_mouse_state.y * screen_device_width / screen_width; SDL_WarpMouse(x, y); } } dirty_rect.fill( screen_width, screen_height ); flush( refreshMode() ); //printf("leaveSystemCall %d %d\n",event_mode, clickstr_state); refreshMouseOverButton(); system_menu_mode = SYSTEM_NULL; } int ONScripter::executeSystemCall() { SDL_BlitSurface( text_info.image_surface, NULL, backup_surface, NULL ); enterSystemCall(); while(system_menu_mode != SYSTEM_NULL){ dirty_rect.fill( screen_width, screen_height ); switch(system_menu_mode){ case SYSTEM_SKIP: executeSystemSkip(); return 2; // continue parsing text break; case SYSTEM_RESET: if (executeSystemReset()) return 1; // stop parsing text break; case SYSTEM_SAVE: executeSystemSave(); break; case SYSTEM_LOAD: if (executeSystemLoad()) return 1; // stop parsing text break; case SYSTEM_LOOKBACK: executeSystemLookback(); break; case SYSTEM_WINDOWERASE: executeWindowErase(); break; case SYSTEM_MENU: executeSystemMenu(); break; case SYSTEM_AUTOMODE: executeSystemAutomode(); return 2; // continue parsing text break; case SYSTEM_END: executeSystemEnd(); break; default: leaveSystemCall(); } } return 0; } void ONScripter::executeSystemMenu() { current_font = &menu_font; if ( menuselectvoice_file_name[MENUSELECTVOICE_OPEN] ) playSound(menuselectvoice_file_name[MENUSELECTVOICE_OPEN], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); text_info.fill( 0, 0, 0, 0 ); flush( refreshMode() ); menu_font.num_xy[0] = rmenu_link_width; menu_font.num_xy[1] = rmenu_link_num; menu_font.top_xy[0] = (screen_width * screen_ratio2 / screen_ratio1 - menu_font.num_xy[0] * menu_font.pitch_xy[0]) / 2; menu_font.top_xy[1] = (screen_height * screen_ratio2 / screen_ratio1 - menu_font.num_xy[1] * menu_font.pitch_xy[1]) / 2; menu_font.setXY( (menu_font.num_xy[0] - rmenu_link_width) / 2, (menu_font.num_xy[1] - rmenu_link_num) / 2 ); RMenuLink *link = root_rmenu_link.next; int counter = 1; while( link ){ ButtonLink *button = getSelectableSentence( link->label, &menu_font, false ); root_button_link.insert( button ); button->no = counter++; link = link->next; flush( refreshMode() ); } flushEvent(); refreshMouseOverButton(); event_mode = WAIT_BUTTON_MODE; do waitEventSub(-1); while (current_button_state.button == 0); deleteButtonLink(); if ( current_button_state.button == -1 ){ if ( menuselectvoice_file_name[MENUSELECTVOICE_CANCEL] ) playSound(menuselectvoice_file_name[MENUSELECTVOICE_CANCEL], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); leaveSystemCall(); return; } if ( menuselectvoice_file_name[MENUSELECTVOICE_CLICK] ) playSound(menuselectvoice_file_name[MENUSELECTVOICE_CLICK], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); link = root_rmenu_link.next; counter = 1; while ( link ){ if ( current_button_state.button == counter++ ){ system_menu_mode = link->system_call_no; break; } link = link->next; } } void ONScripter::executeSystemSkip() { skip_mode |= SKIP_NORMAL; leaveSystemCall(); } void ONScripter::executeSystemAutomode() { automode_flag = true; skip_mode &= ~SKIP_NORMAL; printf("systemcall_automode: change to automode\n"); leaveSystemCall(); } bool ONScripter::executeSystemReset() { if ( executeSystemYesNo( SYSTEM_RESET ) ){ resetCommand(); leaveSystemCall( false ); return true; } leaveSystemCall(); return false; } void ONScripter::executeSystemEnd() { if ( executeSystemYesNo( SYSTEM_END ) ) endCommand(); else leaveSystemCall(); } void ONScripter::executeWindowErase() { if (windowchip_sprite_no >= 0) sprite_info[windowchip_sprite_no].visible = false; display_mode = DISPLAY_MODE_NORMAL; flush(mode_saya_flag ? REFRESH_SAYA_MODE : REFRESH_NORMAL_MODE); event_mode = WAIT_TIMER_MODE | WAIT_BUTTON_MODE; waitEventSub(-1); if (windowchip_sprite_no >= 0) sprite_info[windowchip_sprite_no].visible = true; leaveSystemCall(); } bool ONScripter::executeSystemLoad() { current_font = &menu_font; text_info.fill( 0, 0, 0, 0 ); menu_font.num_xy[0] = (strlen(save_item_name)+1)/2+2+13; menu_font.num_xy[1] = num_save_file+2; menu_font.top_xy[0] = (screen_width * screen_ratio2 / screen_ratio1 - menu_font.num_xy[0] * menu_font.pitch_xy[0]) / 2; menu_font.top_xy[1] = (screen_height * screen_ratio2 / screen_ratio1 - menu_font.num_xy[1] * menu_font.pitch_xy[1]) / 2; menu_font.setXY( (menu_font.num_xy[0] - strlen( load_menu_name ) / 2) / 2, 0 ); uchar3 color = {0xff, 0xff, 0xff}; drawString( load_menu_name, color, &menu_font, true, accumulation_surface, NULL, &text_info ); menu_font.newLine(); menu_font.newLine(); flush( refreshMode() ); bool nofile_flag; char *buffer = new char[ strlen( save_item_name ) + 31 + 1 ]; SaveFileInfo save_file_info; for ( unsigned int i=1 ; i<=num_save_file ; i++ ){ searchSaveFile( save_file_info, i ); menu_font.setXY( (menu_font.num_xy[0] - (strlen( save_item_name ) / 2 + 15) ) / 2 ); if ( save_file_info.valid ){ sprintf( buffer, MESSAGE_SAVE_EXIST, save_item_name, save_file_info.sjis_no, save_file_info.sjis_month, save_file_info.sjis_day, save_file_info.sjis_hour, save_file_info.sjis_minute ); nofile_flag = false; } else{ sprintf( buffer, MESSAGE_SAVE_EMPTY, save_item_name, save_file_info.sjis_no ); nofile_flag = true; } ButtonLink *button = getSelectableSentence( buffer, &menu_font, false, nofile_flag ); root_button_link.insert( button ); button->no = i; flush( refreshMode() ); } delete[] buffer; refreshMouseOverButton(); event_mode = WAIT_BUTTON_MODE; int file_no = 0; while(1){ waitEventSub(-1); if ( current_button_state.button > 0 ){ file_no = current_button_state.button; searchSaveFile( save_file_info, file_no ); if ( !save_file_info.valid ) continue; } if (current_button_state.button != 0) break; } if ( current_button_state.button > 0 ){ deleteButtonLink(); if (executeSystemYesNo( SYSTEM_LOAD, file_no )){ current_font = &sentence_font; system_menu_mode = 0; // for fadeout in mp3stopCommand() if ( loadSaveFile( file_no ) ) return false; leaveSystemCall( false ); refreshSurface(backup_surface, NULL, REFRESH_NORMAL_MODE); saveon_flag = true; internal_saveon_flag = true; text_on_flag = false; indent_offset = 0; line_enter_status = 0; page_enter_status = 0; string_buffer_offset = 0; break_flag = false; flushEvent(); if (loadgosub_label) gosubReal( loadgosub_label, script_h.getCurrent() ); return true; } return false; } deleteButtonLink(); leaveSystemCall(); return false; } void ONScripter::executeSystemSave() { current_font = &menu_font; text_info.fill( 0, 0, 0, 0 ); menu_font.num_xy[0] = (strlen(save_item_name)+1)/2+2+13; menu_font.num_xy[1] = num_save_file+2; menu_font.top_xy[0] = (screen_width * screen_ratio2 / screen_ratio1 - menu_font.num_xy[0] * menu_font.pitch_xy[0]) / 2; menu_font.top_xy[1] = (screen_height * screen_ratio2 / screen_ratio1 - menu_font.num_xy[1] * menu_font.pitch_xy[1]) / 2; menu_font.setXY((menu_font.num_xy[0] - strlen( save_menu_name ) / 2 ) / 2, 0); uchar3 color = {0xff, 0xff, 0xff}; drawString( save_menu_name, color, &menu_font, true, accumulation_surface, NULL, &text_info ); menu_font.newLine(); menu_font.newLine(); flush( refreshMode() ); bool nofile_flag; char *buffer = new char[ strlen( save_item_name ) + 31 + 1 ]; for ( unsigned int i=1 ; i<=num_save_file ; i++ ){ SaveFileInfo save_file_info; searchSaveFile( save_file_info, i ); menu_font.setXY( (menu_font.num_xy[0] - (strlen( save_item_name ) / 2 + 15) ) / 2 ); if ( save_file_info.valid ){ sprintf( buffer, MESSAGE_SAVE_EXIST, save_item_name, save_file_info.sjis_no, save_file_info.sjis_month, save_file_info.sjis_day, save_file_info.sjis_hour, save_file_info.sjis_minute ); nofile_flag = false; } else{ sprintf( buffer, MESSAGE_SAVE_EMPTY, save_item_name, save_file_info.sjis_no ); nofile_flag = true; } ButtonLink *button = getSelectableSentence( buffer, &menu_font, false, nofile_flag ); root_button_link.insert( button ); button->no = i; flush( refreshMode() ); } delete[] buffer; refreshMouseOverButton(); event_mode = WAIT_BUTTON_MODE; do waitEventSub(-1); while (current_button_state.button == 0); deleteButtonLink(); if ( current_button_state.button > 0 ){ int file_no = current_button_state.button; if (executeSystemYesNo( SYSTEM_SAVE, file_no )){ if (saveon_flag && internal_saveon_flag) saveSaveFile(false); saveSaveFile( true, file_no ); leaveSystemCall(); } return; } leaveSystemCall(); } bool ONScripter::executeSystemYesNo( int caller, int file_no ) { current_font = &menu_font; text_info.fill( 0, 0, 0, 0 ); dirty_rect.fill( screen_width, screen_height ); char name[64] = {'\0'}; if ( caller == SYSTEM_SAVE ){ SaveFileInfo save_file_info; searchSaveFile( save_file_info, file_no ); sprintf( name, MESSAGE_SAVE_CONFIRM, save_item_name, save_file_info.sjis_no ); } else if ( caller == SYSTEM_LOAD ){ SaveFileInfo save_file_info; searchSaveFile( save_file_info, file_no ); sprintf( name, MESSAGE_LOAD_CONFIRM, save_item_name, save_file_info.sjis_no ); } else if ( caller == SYSTEM_RESET ) strcpy( name, MESSAGE_RESET_CONFIRM ); else if ( caller == SYSTEM_END ) strcpy( name, MESSAGE_END_CONFIRM ); menu_font.num_xy[0] = strlen(name)/2; menu_font.num_xy[1] = 3; menu_font.top_xy[0] = (screen_width * screen_ratio2 / screen_ratio1 - menu_font.num_xy[0] * menu_font.pitch_xy[0]) / 2; menu_font.top_xy[1] = (screen_height * screen_ratio2 / screen_ratio1 - menu_font.num_xy[1] * menu_font.pitch_xy[1]) / 2; menu_font.setXY(0, 0); uchar3 color = {0xff, 0xff, 0xff}; drawString( name, color, &menu_font, true, accumulation_surface, NULL, &text_info ); flush( refreshMode() ); int offset1 = strlen(name)/5; int offset2 = strlen(name)/2 - offset1; strcpy( name, MESSAGE_YES ); menu_font.setXY(offset1-2, 2); ButtonLink *button = getSelectableSentence( name, &menu_font, false ); root_button_link.insert( button ); button->no = 1; strcpy( name, MESSAGE_NO ); menu_font.setXY(offset2, 2); button = getSelectableSentence( name, &menu_font, false ); root_button_link.insert( button ); button->no = 2; flush( refreshMode() ); refreshMouseOverButton(); event_mode = WAIT_BUTTON_MODE; do waitEventSub(-1); while (current_button_state.button == 0); deleteButtonLink(); if ( current_button_state.button == 1 ){ // yes is selected if ( menuselectvoice_file_name[MENUSELECTVOICE_YES] ) playSound(menuselectvoice_file_name[MENUSELECTVOICE_YES], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); return true; } else{ if ( menuselectvoice_file_name[MENUSELECTVOICE_NO] ) playSound(menuselectvoice_file_name[MENUSELECTVOICE_NO], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); return false; } } void ONScripter::setupLookbackButton() { deleteButtonLink(); /* ---------------------------------------- */ /* Previous button check */ if ( (current_page->previous->text_count > 0 ) && current_page != start_page ){ ButtonLink *button = new ButtonLink(); root_button_link.insert( button ); button->no = 1; if ( lookback_sp[0] >= 0 ){ button->button_type = ButtonLink::SPRITE_BUTTON; button->sprite_no = lookback_sp[0]; AnimationInfo &si = sprite_info[ button->sprite_no ]; si.visible = true; button->select_rect = si.pos; button->image_rect = si.pos; } else{ button->button_type = ButtonLink::LOOKBACK_BUTTON; button->select_rect = sentence_font_info.pos; button->select_rect.h /= 3; button->show_flag = 2; button->anim[0] = &lookback_info[0]; button->anim[1] = &lookback_info[1]; button->image_rect.x = sentence_font_info.pos.x + sentence_font_info.pos.w - button->anim[0]->pos.w; button->image_rect.y = sentence_font_info.pos.y; button->image_rect.w = button->anim[0]->pos.w; button->image_rect.h = button->anim[0]->pos.h; button->anim[0]->pos.x = button->anim[1]->pos.x = button->image_rect.x; button->anim[0]->pos.y = button->anim[1]->pos.y = button->image_rect.y; } } else if (lookback_sp[0] >= 0){ sprite_info[ lookback_sp[0] ].visible = false; } /* ---------------------------------------- */ /* Next button check */ if ( current_page->next != cached_page ){ ButtonLink *button = new ButtonLink(); root_button_link.insert( button ); button->no = 2; if ( lookback_sp[1] >= 0 ){ button->button_type = ButtonLink::SPRITE_BUTTON; button->sprite_no = lookback_sp[1]; AnimationInfo &si = sprite_info[ button->sprite_no ]; si.visible = true; button->select_rect = si.pos; button->image_rect = si.pos; } else{ button->button_type = ButtonLink::LOOKBACK_BUTTON; button->select_rect = sentence_font_info.pos; button->select_rect.y += sentence_font_info.pos.h*2/3; button->select_rect.h /= 3; button->show_flag = 2; button->anim[0] = &lookback_info[2]; button->anim[1] = &lookback_info[3]; button->image_rect.x = sentence_font_info.pos.x + sentence_font_info.pos.w - button->anim[0]->pos.w; button->image_rect.y = sentence_font_info.pos.y + sentence_font_info.pos.h - button->anim[0]->pos.h; button->image_rect.w = button->anim[0]->pos.w; button->image_rect.h = button->anim[0]->pos.h; button->anim[0]->pos.x = button->anim[1]->pos.x = button->image_rect.x; button->anim[0]->pos.y = button->anim[1]->pos.y = button->image_rect.y; } } else if (lookback_sp[1] >= 0){ sprite_info[ lookback_sp[1] ].visible = false; } } void ONScripter::executeSystemLookback() { int i; uchar3 color; current_font = &sentence_font; current_page = current_page->previous; if ( current_page->text_count == 0 ){ if ( lookback_sp[0] >= 0 ) sprite_info[ lookback_sp[0] ].visible = false; if ( lookback_sp[1] >= 0 ) sprite_info[ lookback_sp[1] ].visible = false; leaveSystemCall(); return; } while(1){ setupLookbackButton(); refreshMouseOverButton(); dirty_rect.fill( screen_width, screen_height ); flush( refreshMode() & ~REFRESH_TEXT_MODE); for ( i=0 ; i<3 ; i++ ){ color[i] = sentence_font.color[i]; sentence_font.color[i] = lookback_color[i]; } restoreTextBuffer(accumulation_surface); for ( i=0 ; i<3 ; i++ ) sentence_font.color[i] = color[i]; flush( REFRESH_NONE_MODE ); event_mode = WAIT_BUTTON_MODE; waitEventSub(-1); if ( current_button_state.button == 0 || ( current_page == start_page && current_button_state.button == -2 ) ){ continue; } if ( current_button_state.button == -1 || ( current_button_state.button == -3 && current_page->next == cached_page ) || current_button_state.button <= -4 ) { event_mode = IDLE_EVENT_MODE; deleteButtonLink(); if ( lookback_sp[0] >= 0 ) sprite_info[ lookback_sp[0] ].visible = false; if ( lookback_sp[1] >= 0 ) sprite_info[ lookback_sp[1] ].visible = false; leaveSystemCall(); return; } if ( current_button_state.button == 1 || current_button_state.button == -2 ){ current_page = current_page->previous; } else current_page = current_page->next; } } void ONScripter::buildDialog(bool yesno_flag, const char *mes1, const char *mes2) { SDL_PixelFormat *fmt = image_surface->format; SDL_Surface *s = SDL_CreateRGBSurface( SDL_SWSURFACE, DIALOG_W, DIALOG_H, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask ); SDL_Rect rect; unsigned char col = 255; SDL_FillRect(s, NULL, SDL_MapRGBA(s->format, col, col, col, 0xff)); rect.x = 2; rect.y = DIALOG_HEADER; rect.w = DIALOG_W-4; rect.h = DIALOG_H-rect.y-2; col = 105; SDL_FillRect(s, &rect, SDL_MapRGBA(s->format, col, col, col, 0xff)); rect.x++; rect.y++; rect.w-=2; rect.h-=2; col = 255; SDL_FillRect(s, &rect, SDL_MapRGBA(s->format, col, col, col, 0xff)); rect.h = DIALOG_FOOTER; rect.y = DIALOG_H-3-rect.h; col = 240; SDL_FillRect(s, &rect, SDL_MapRGBA(s->format, col, col, col, 0xff)); SDL_Surface *s2 = s; if (screen_ratio2 != screen_ratio1){ s2 = SDL_CreateRGBSurface( SDL_SWSURFACE, DIALOG_W*screen_ratio1/screen_ratio2, DIALOG_H*screen_ratio1/screen_ratio2, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask ); resizeSurface(s, s2); SDL_FreeSurface(s); } uchar3 col3={0, 0, 0}; dialog_font.top_xy[0] = 7; dialog_font.top_xy[1] = DIALOG_HEADER+5; dialog_font.num_xy[0] = (DIALOG_W-7*2)/dialog_font.pitch_xy[0]; dialog_font.num_xy[1] = 3; dialog_font.clear(); drawString( mes1, col3, &dialog_font, false, s2, NULL, NULL ); dialog_font.top_xy[0] = 5; dialog_font.top_xy[1] = (DIALOG_HEADER-dialog_font.font_size_xy[1])/2; dialog_font.setLineArea( strlen(mes2)/2+1 ); dialog_font.clear(); drawString( mes2, col3, &dialog_font, false, s2, NULL, NULL ); dialog_info.deleteSurface(); dialog_info.num_of_cells = 1; dialog_info.setImage(s2, texture_format); dialog_info.pos.x = (screen_width - dialog_info.pos.w)/2; dialog_info.pos.y = (screen_height - dialog_info.pos.h)/2; // buttons const char* mes[2]; if (yesno_flag){ mes[0] = MESSAGE_YES; mes[1] = MESSAGE_NO; } else{ mes[0] = MESSAGE_OK; mes[1] = MESSAGE_CANCEL; } for (int i=0 ; i<2 ; i++){ SDL_Surface *bs = SDL_CreateRGBSurface( SDL_SWSURFACE, DIALOG_BUTTON_W*2, DIALOG_BUTTON_H, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask ); for (int j=0 ; j<2 ; j++){ rect.x = DIALOG_BUTTON_W*j; rect.y = 0; rect.w = DIALOG_BUTTON_W; rect.h = DIALOG_BUTTON_H; col = 105; SDL_FillRect(bs, &rect, SDL_MapRGBA(bs->format, col, col, col, 0xff)); rect.w--; rect.h--; col = 255; SDL_FillRect(bs, &rect, SDL_MapRGBA(bs->format, col, col, col, 0xff)); rect.x++; rect.y++; rect.w--; rect.h--; col = 227; SDL_FillRect(bs, &rect, SDL_MapRGBA(bs->format, col, col, col, 0xff)); rect.x++; rect.y++; rect.w-=2; rect.h-=2; col = 240; if (j==1) col = 214; SDL_FillRect(bs, &rect, SDL_MapRGBA(bs->format, col, col, col, 0xff)); } SDL_Surface *bs2 = bs; if (screen_ratio2 != screen_ratio1){ bs2 = SDL_CreateRGBSurface( SDL_SWSURFACE, DIALOG_BUTTON_W*2*screen_ratio1/screen_ratio2, DIALOG_BUTTON_H*screen_ratio1/screen_ratio2, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask ); resizeSurface(bs, bs2); SDL_FreeSurface(bs); } for (int j=0 ; j<2 ; j++){ rect.x = DIALOG_BUTTON_W*j+2; rect.y = 2; rect.w = DIALOG_BUTTON_W-4; rect.h = DIALOG_BUTTON_H-4; dialog_font.top_xy[0] = rect.x+(rect.w-dialog_font.pitch_xy[0]*strlen(mes[i])/2)/2; dialog_font.top_xy[1] = rect.y+(rect.h-dialog_font.font_size_xy[1])/2; dialog_font.setLineArea( strlen(mes[i])/2+1 ); dialog_font.clear(); drawString( mes[i], col3, &dialog_font, false, bs2, NULL, NULL ); } ButtonLink *btn = new ButtonLink(); btn->no = i+1; btn->button_type = ButtonLink::TMP_SPRITE_BUTTON; btn->anim[0] = new AnimationInfo(); btn->anim[0]->num_of_cells = 2; btn->anim[0]->setImage(bs2, texture_format); btn->show_flag = 1; btn->anim[0]->pos.x = dialog_info.pos.x + (DIALOG_W-3-(DIALOG_BUTTON_W+8)*(2-i))*screen_ratio1/screen_ratio2; btn->anim[0]->pos.y = dialog_info.pos.y + (DIALOG_H-3-(DIALOG_FOOTER+DIALOG_BUTTON_H)/2)*screen_ratio1/screen_ratio2; btn->anim[0]->visible = true; btn->select_rect = btn->image_rect = btn->anim[0]->pos; root_button_link.insert( btn ); } } onscripter-20150820/Makefile.iPhone0000644017777601777760000000215612565174244016665 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.iPhone - Makefile rules for iPhone & iPod touch # PREF = /usr/local/arm-apple-darwin INCS = `$(PREF)/bin/sdl-config --cflags` `$(PREF)/bin/freetype-config --cflags` #LIBS = `$(PREF)/bin/sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL -lvorbisidec -lfreetype -ljpeg -lpng -lbz2 -lz LIBS = `$(PREF)/bin/sdl-config --libs` \ $(PREF)/lib/libSDL_ttf.a \ $(PREF)/lib/libSDL_image.a \ $(PREF)/lib/libSDL_mixer.a \ $(PREF)/lib/libSDL.a \ $(PREF)/lib/libvorbisidec.a \ $(PREF)/lib/libfreetype.a \ $(PREF)/lib/libjpeg.a \ $(PREF)/lib/libpng.a \ -lz -lbz2 DEFS = -DIPHONE -DMACOSX -DPDA_WIDTH=424 -DBPP16 -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS -DUTF8_CAPTION -DUTF8_FILESYSTEM EXESUFFIX = OBJSUFFIX = .o .SUFFIXES: .SUFFIXES: $(OBJSUFFIX) .cpp .h CC = arm-apple-darwin-g++ LD = arm-apple-darwin-g++ -o #CFLAGS = -g -Wall -Wpointer-arith -pipe -c $(INCS) $(DEFS) CFLAGS = -O3 -Wall -Wpointer-arith -pipe -c $(INCS) $(DEFS) RM = rm -f TARGET = onscripter$(EXESUFFIX) sardec$(EXESUFFIX) nsadec$(EXESUFFIX) sarconv$(EXESUFFIX) nsaconv$(EXESUFFIX) EXT_OBJS = include Makefile.onscripter onscripter-20150820/ONScripter_effect_breakup.cpp0000644017777601777760000003106112565174244021562 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_effect_breakup.cpp * - Emulation of Takashi Toyama's "breakup.dll" NScripter plugin effect * * Copyright (c) 2008-2012 "Uncle" Mion Sonozaki * * UncleMion@gmail.com * * Copyright (c) 2001-2012 Ogapee * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #define BREAKUP_CELLWIDTH 24 #define BREAKUP_CELLFORMS 16 #define BREAKUP_MAX_CELL_X ((screen_width + BREAKUP_CELLWIDTH - 1)/BREAKUP_CELLWIDTH) #define BREAKUP_MAX_CELL_Y ((screen_height + BREAKUP_CELLWIDTH - 1)/BREAKUP_CELLWIDTH) #define BREAKUP_MAX_CELLS (BREAKUP_MAX_CELL_X * BREAKUP_MAX_CELL_Y) #define BREAKUP_DIRECTIONS 8 #define BREAKUP_MOVE_FRAMES 40 #define BREAKUP_STILL_STATE (BREAKUP_CELLFORMS - BREAKUP_CELLWIDTH/2) #define BREAKUP_MODE_LOWER 1 #define BREAKUP_MODE_LEFT 2 #define BREAKUP_MODE_PILEUP 4 #define BREAKUP_MODE_JUMBLE 8 const int breakup_disp_x[BREAKUP_DIRECTIONS] = { -7,-7,-5,-4,-2,1,3,5 }; const int breakup_disp_y[BREAKUP_DIRECTIONS] = { 0, 2, 4, 6, 7,7,6,5 }; int n_cells, tot_frames, last_frame; int breakup_mode; SDL_Rect breakup_window; // window of _cells_, not pixels void ONScripter::buildBreakupCellforms() { // build the 32x32 mask for each cellform if (breakup_cellforms) return; int w = BREAKUP_CELLWIDTH * BREAKUP_CELLFORMS; int h = BREAKUP_CELLWIDTH; breakup_cellforms = new bool[w*h]; for (int n=0, rad2=1; npixels; ONSBuf *buffer2 = (ONSBuf *)effect_dst_surface->pixels; SDL_PixelFormat *fmt = effect_dst_surface->format; int surf_w = effect_src_surface->w; int surf_h = effect_src_surface->h; int x1=w, y1=-1, x2=0, y2=0; for (int i=0; i= surf_w) || (i >= surf_h)) { breakup_mask[i*w+j] = false; continue; } ONSBuf pix1 = buffer1[i*surf_w+j]; ONSBuf pix2 = buffer2[i*surf_w+j]; int pix1c = ((pix1 & fmt->Bmask) >> fmt->Bshift) << fmt->Bloss; int pix2c = ((pix2 & fmt->Bmask) >> fmt->Bshift) << fmt->Bloss; breakup_mask[i*w+j] = true; if (abs(pix1c - pix2c) > 8) { if (y1 < 0) y1 = i; if (j < x1) x1 = j; if (j > x2) x2 = j; y2 = i; continue; } pix1c = ((pix1 & fmt->Gmask) >> fmt->Gshift) << fmt->Gloss; pix2c = ((pix2 & fmt->Gmask) >> fmt->Gshift) << fmt->Gloss; if (abs(pix1c - pix2c) > 8) { if (y1 < 0) y1 = i; if (j < x1) x1 = j; if (j > x2) x2 = j; y2 = i; continue; } pix1c = ((pix1 & fmt->Rmask) >> fmt->Rshift) << fmt->Rloss; pix2c = ((pix2 & fmt->Rmask) >> fmt->Rshift) << fmt->Rloss; if (abs(pix1c - pix2c) > 8) { if (y1 < 0) y1 = i; if (j < x1) x1 = j; if (j > x2) x2 = j; y2 = i; continue; } pix1c = ((pix1 & fmt->Amask) >> fmt->Ashift) << fmt->Aloss; pix2c = ((pix2 & fmt->Amask) >> fmt->Ashift) << fmt->Aloss; if (abs(pix1c - pix2c) > 8) { if (y1 < 0) y1 = i; if (j < x1) x1 = j; if (j > x2) x2 = j; y2 = i; continue; } breakup_mask[i*w+j] = false; } } if (breakup_mode & BREAKUP_MODE_LEFT) x1 = 0; else x2 = surf_w-1; if (breakup_mode & BREAKUP_MODE_LOWER) y2 = surf_h-1; else y1 = 0; breakup_window.x = x1 / BREAKUP_CELLWIDTH; breakup_window.y = y1 / BREAKUP_CELLWIDTH; breakup_window.w = x2/BREAKUP_CELLWIDTH - breakup_window.x + 1; breakup_window.h = y2/BREAKUP_CELLWIDTH - breakup_window.y + 1; SDL_UnlockSurface( effect_dst_surface ); SDL_UnlockSurface( effect_src_surface ); } void ONScripter::initBreakup( char *params ) { while (*params != 0 && *params != '/') params++; if (*params == '/') params++; buildBreakupCellforms(); breakup_mode = 0; if (params[0] == 'l') breakup_mode |= BREAKUP_MODE_LOWER; if (params[1] == 'l') breakup_mode |= BREAKUP_MODE_LEFT; if ((params[2] >= 'A') && (params[2] <= 'Z')) breakup_mode |= BREAKUP_MODE_JUMBLE; if ((params[2] == 'p') || (params[2] == 'P')) breakup_mode |= BREAKUP_MODE_PILEUP; if (!breakup_cells) breakup_cells = new BreakupCell[BREAKUP_MAX_CELLS]; buildBreakupMask(); int n_cell_x = breakup_window.w; int n_cell_y = breakup_window.h; int n_cell_diags = n_cell_x + n_cell_y; n_cells = n_cell_x * n_cell_y; tot_frames = BREAKUP_MOVE_FRAMES + n_cell_diags + BREAKUP_CELLFORMS - BREAKUP_CELLWIDTH/2 + 1; last_frame = 0; int n = 0, dir = 1, i = 0, diag_n = 0; for (i=0; i=0) && (k=0); j--, k++) { breakup_cells[n].cell_x = j + breakup_window.x; breakup_cells[n].cell_y = k + breakup_window.y; if (!(breakup_mode & BREAKUP_MODE_LEFT)) breakup_cells[n].cell_x = breakup_window.x + n_cell_x - j - 1; if (breakup_mode & BREAKUP_MODE_LOWER) breakup_cells[n].cell_y = breakup_window.y + n_cell_y - k - 1; breakup_cells[n].dir = dir; breakup_cells[n].state = state; breakup_cells[n].radius = 0; ++dir &= (BREAKUP_DIRECTIONS-1); ++n; } ++diag_n; } } void ONScripter::effectBreakup( char *params, int duration ) { while (*params != 0 && *params != '/') params++; if (*params == '/') params++; int x_dir = -1; int y_dir = -1; int frame = tot_frames * effect_counter / duration; int frame_diff = frame - last_frame; if (frame_diff == 0) return; SDL_Surface *bg = effect_dst_surface; SDL_Surface *chr = effect_src_surface; last_frame += frame_diff; frame_diff = -frame_diff; if (breakup_mode & BREAKUP_MODE_PILEUP) { bg = effect_src_surface; chr = effect_dst_surface; frame_diff = -frame_diff; x_dir = -x_dir; y_dir = -y_dir; } SDL_BlitSurface(bg, NULL, accumulation_surface, NULL); SDL_Surface *dst = accumulation_surface; if (breakup_mode & BREAKUP_MODE_JUMBLE) { x_dir = -x_dir; y_dir = -y_dir; } if (!(breakup_mode & BREAKUP_MODE_LEFT)) { x_dir = -x_dir; } if (breakup_mode & BREAKUP_MODE_LOWER) { y_dir = -y_dir; } SDL_LockSurface( chr ); SDL_LockSurface( dst ); ONSBuf *chr_buf = (ONSBuf *)chr->pixels; ONSBuf *buffer = (ONSBuf *)dst->pixels; bool *msk_buf = breakup_cellforms; for (int n=0; n= (BREAKUP_MOVE_FRAMES + BREAKUP_STILL_STATE)) { for (int i=0; i= dst->w) || (x >= chr->w) || (y < 0) || (y >= dst->h) || (y >= chr->h)) continue; if ( breakup_mask[y*BREAKUP_CELLWIDTH*BREAKUP_MAX_CELL_X + x] ) buffer[y*dst->w + x] = chr_buf[y*chr->w + x]; } } } else if (breakup_cells[n].state >= BREAKUP_MOVE_FRAMES) { breakup_cells[n].radius = breakup_cells[n].state - (BREAKUP_MOVE_FRAMES*3/4) + 1; for (int i=0; i= dst->w) || (x >= chr->w) || (y < 0) || (y >= dst->h) || (y >= chr->h)) continue; int msk_off = BREAKUP_CELLWIDTH*breakup_cells[n].radius; if ( msk_buf[BREAKUP_CELLWIDTH * BREAKUP_CELLFORMS * i + msk_off + j] && breakup_mask[y*BREAKUP_CELLWIDTH*BREAKUP_MAX_CELL_X + x] ) buffer[y*dst->w + x] = chr_buf[y*chr->w + x]; } } } else if (breakup_cells[n].state >= 0) { int state = breakup_cells[n].state; int disp_x = x_dir * breakup_disp_x[breakup_cells[n].dir] * (state-BREAKUP_MOVE_FRAMES); int disp_y = y_dir * breakup_disp_y[breakup_cells[n].dir] * (BREAKUP_MOVE_FRAMES-state); breakup_cells[n].radius = 0; if (breakup_cells[n].state >= (BREAKUP_MOVE_FRAMES/2)) breakup_cells[n].radius = (breakup_cells[n].state/2) - (BREAKUP_MOVE_FRAMES/4) + 1; for (int i=0; i= dst->w) || (y < 0) || (y >= dst->h)) continue; if (((rect.x+j)<0) || ((rect.x+j) >= chr->w) || ((rect.y+i)<0) || ((rect.y+i) >= chr->h)) continue; int msk_off = BREAKUP_CELLWIDTH*breakup_cells[n].radius; if ( msk_buf[BREAKUP_CELLWIDTH * BREAKUP_CELLFORMS * i + msk_off + j] && breakup_mask[(rect.y+i)*BREAKUP_CELLWIDTH*BREAKUP_MAX_CELL_X + rect.x + j] ) buffer[y*dst->w + x] = chr_buf[(rect.y+i)*chr->w + rect.x + j]; } } } } SDL_UnlockSurface( accumulation_surface ); SDL_UnlockSurface( chr ); } onscripter-20150820/sarconv.cpp0000644017777601777760000001110512565174244016155 0ustar nobodynogroup/* -*- C++ -*- * * sarconv.cpp - Images in SAR archive are re-scaled to 320x240 size * * Copyright (c) 2001-2006 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include #include #include #include #include #include "SarReader.h" extern int scale_ratio_upper; extern int scale_ratio_lower; extern size_t rescaleJPEG( unsigned char *original_buffer, size_t length, unsigned char **rescaled_buffer, int quality ); extern size_t rescaleBMP( unsigned char *original_buffer, unsigned char **rescaled_buffer, bool output_jpeg_flag, int quality ); #ifdef main #undef main #endif void help() { fprintf(stderr, "Usage: sarconv [-j] [-q quality] src_width dst_width src_archive_file dst_archive_file\n"); fprintf(stderr, " quality ... 0 to 100\n"); fprintf(stderr, " src_width ... 640 or 800\n"); fprintf(stderr, " dst_width ... 176, 220, 320, 360, 384, 640, etc.\n"); exit(-1); } int main( int argc, char **argv ) { SarReader cSR; unsigned long length, offset = 0, buffer_length = 0; unsigned char *buffer = NULL, *rescaled_buffer = NULL; unsigned int i, count; bool bmp2jpeg_flag = false; int quality = 75; FILE *fp; argc--; // skip command name argv++; while (argc > 4){ if ( !strcmp( argv[0], "-j" ) ) bmp2jpeg_flag = true; else if ( !strcmp( argv[0], "-q" ) ){ argc--; argv++; quality = atoi(argv[0]); } argc--; argv++; } if (argc != 4) help(); scale_ratio_lower = atoi(argv[0]); // src width if (scale_ratio_lower!=640 && scale_ratio_lower!=800) help(); scale_ratio_upper = atoi(argv[1]); // dst width if ( (fp = fopen( argv[3], "wb" ) ) == NULL ){ fprintf( stderr, "can't open file %s for writing.\n", argv[3] ); exit(-1); } if (cSR.open( argv[2] ) != 0){ fprintf( stderr, "can't open file %s\n", argv[2] ); exit(-1); } count = cSR.getNumFiles(); SarReader::FileInfo sFI; for ( i=0 ; i buffer_length ){ if ( buffer ) delete[] buffer; buffer = new unsigned char[length]; buffer_length = length; } sFI.offset = offset; if ( (strlen( sFI.name ) > 3 && !strcmp( sFI.name + strlen( sFI.name ) - 3, "JPG")) || (strlen( sFI.name ) > 4 && !strcmp( sFI.name + strlen( sFI.name ) - 4, "JPEG")) ){ if ( cSR.getFile( sFI.name, buffer ) != length ){ fprintf( stderr, "file %s can't be retrieved %ld\n", sFI.name, length ); continue; } sFI.length = rescaleJPEG( buffer, length, &rescaled_buffer, quality ); cSR.putFile( fp, i, sFI.offset, sFI.length, sFI.length, true, rescaled_buffer ); } else if ( strlen( sFI.name ) > 3 && !strcmp( sFI.name + strlen( sFI.name ) - 3, "BMP") ){ if ( cSR.getFile( sFI.name, buffer ) != length ){ fprintf( stderr, "file %s can't be retrieved %ld\n", sFI.name, length ); continue; } sFI.length = rescaleBMP( buffer, &rescaled_buffer, bmp2jpeg_flag, quality ); cSR.putFile( fp, i, sFI.offset, sFI.length, sFI.length, true, rescaled_buffer ); } else{ cSR.putFile( fp, i, sFI.offset, sFI.length, sFI.original_length, false, buffer ); } offset += sFI.length; } cSR.writeHeader( fp ); fclose(fp); if ( rescaled_buffer ) delete[] rescaled_buffer; if ( buffer ) delete[] buffer; return 0; } onscripter-20150820/COPYING0000644017777601777760000004311012565174244015032 0ustar nobodynogroup GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. onscripter-20150820/AVIWrapper.h0000644017777601777760000000375012565174244016136 0ustar nobodynogroup/* -*- C++ -*- * * AVIWrapper.h - avifile library wrapper class to play AVI video & audio stream * * Copyright (c) 2001-2008 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __AVI_WRAPPER_H__ #define __AVI_WRAPPER_H__ #include #include #include #include #include class AVIWrapper { public: enum { AVI_STOP = 0, AVI_PLAYING = 1 }; AVIWrapper(); ~AVIWrapper(); int init( char *filename, bool debug_flag ); int initAV( SDL_Surface *surface, bool audio_open_flag ); int play( bool click_flag ); void audioCallback( void *userdata, Uint8 *stream, int len ); int playVideo( void *userdata ); unsigned int getWidth(){ return width; }; unsigned int getHeight(){ return height; }; private: double getAudioTime(); int drawFrame( avm::CImage *image ); SDL_Overlay *screen_overlay; SDL_Rect screen_rect; unsigned int width; unsigned int height; IAviReadFile *i_avi; IAviReadStream *v_stream; IAviReadStream *a_stream; int remaining_count; char *remaining_buffer; bool debug_flag; int status; SDL_Thread *thread_id; int64_t time_start; double frame_start; }; #endif // __AVI_WRAPPER_H__ onscripter-20150820/README0000644017777601777760000000323012565174244014656 0ustar nobodynogroupONScripter 0. ¤Ï¤¸¤á¤Ë ¹â¶¶Ä¾¼ù»áºî¤Î NScripter ÍѤ˺îÀ®¤µ¤ì¤¿¥¹¥¯¥ê¥×¥È¤òÆÈ¼«¤Ë²ò¼á¤·¤Æ¼Â¹Ô¤·¤Þ¤¹¡£ 1. ưºî´Ä¶­ libjpeg 6b, bzip2-1.0.5, SDL-1.2.14, SDL_image-1.2.10, SDL_mixer-1.2.8, SDL_ttf-2.0.9, µÚ¤Ó SMPEG-0.4.5 ¤¬Æ°ºî¤¹¤ë´Ä¶­¤Ç¤¹¡£ Linux 2.6.32 + Xvnc4 + g++ (gcc 4.4.4) ¤Ç³«È¯¤·¤Æ¤¤¤Þ¤¹¡£ Linux, Windows Vista (Visual Studio 2008 C++), Android (HTC Desire), iPad2 ¾å¤Çưºî³Îǧ¤ò¤·¤Æ¤¤¤Þ¤¹¡£ ¤½¤Î¾¡¢MacOS X, MacOS 9, Android(Nexus One, Emulator), iPhone, iPad, PSP, FreeBSD, Solaris(on SPARC), Tru64 UNIX, OS/Warp, iPod, PocketPC, Playstation3, Wii, GP2X, NetWalker, Dreamcast ¾å¤Ç¤ÎưºîÊó¹ð¤ò¤¤¤¿¤À¤¤¤Æ¤¤¤Þ¤¹¡£ 2. ¥³¥ó¥Ñ¥¤¥ë¡¦µ¯Æ°ÊýË¡ ¥³¥ó¥Ñ¥¤¥ë¡¦µ¯Æ°ÊýË¡¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ ¤¿¤À¤·¡¢onscripter ¤ò¼Â¹Ô¤¹¤ë¾ì½ê¤Ë default.ttf, ¥¹¥¯¥ê¥×¥È, ¥¢¡¼¥«¥¤¥Ö¤¬¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£ ¾Ü¤·¤¯¤ÏƱº­¤Î www/onscripter.html ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ Linux ¤â¤·¤¯¤Ï FreeBSD, Solaris ¤Î¾ì¹ç $ make -f Makefile.Linux $ onscripter Windows ¤Î¾ì¹ç (DOS ¥×¥í¥ó¥×¥È¤Ç) $ libjpeg 6b, bzip2, SDL ¤È SMPEG ¤Î¥¤¥ó¥¹¥È¡¼¥ë¾ì½ê¤Ë¹ç¤ï¤»¤Æ Makefile.Win ¤ò½¤Àµ $ nmake -f Makefile.Win $ onscripter.exe MacOS X ¤Î¾ì¹ç $ make -f Makefile.MacOSX $ onscripter Zaurus (SL-5500, SL-A300, SL-B500, SL-C700) ¤Î¾ì¹ç Ê̤Υޥ·¥ó(Linux Åù)¾å¤Ç¥¯¥í¥¹¥³¥ó¥Ñ¥¤¥ë $ make -f Makefile.ARMLinux Zaurus ¤Î Qtopia ¾å¤«¤é¼Â¹Ô $ onscripter ¤½¤ì°Ê³°¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï¡¢Makefile.Linux ¤ò¿÷·Á¤Ë¤·¤Æ Makefile.### ¤òºî¤Ã¤Æ¤¯¤À¤µ¤¤¡£ ONScripter ¤Ï¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î 0.txt ¤â¤·¤¯¤Ï nscript.dat ¤ò¼«Æ°Åª¤ËÆÉ¤ß¹þ¤ß¡¢¤½¤ì¤Ë¤·¤¿¤¬¤Ã¤Æ¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î arc.sar ¤â¤·¤¯¤Ï arc.nsa ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ 3. Ï¢ÍíÀè ËÜ¥½¥Õ¥È¥¦¥§¥¢¤Ë´Ø¤¹¤ëÌ䤤¹ç¤ï¤»¤Ï ogapee@aqua.dti2.ne.jp ¤Þ¤ÇÅŻҥ᡼¥ë¤Ë¤Æ¤ª´ê¤¤¤·¤Þ¤¹¡£ onscripter-20150820/onscripter_main.cpp0000644017777601777760000002332312565174244017703 0ustar nobodynogroup/* -*- C++ -*- * * onscripter_main.cpp -- main function of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #include "version.h" ONScripter ons; #if defined(IOS) #import #import #import "DataCopier.h" #import "DataDownloader.h" #import "ScriptSelector.h" #import "MoviePlayer.h" #endif #if defined(PSP) #include #include #include #include PSP_HEAP_SIZE_KB(-1); int psp_power_resume_number = 0; int exit_callback(int arg1, int arg2, void *common) { ons.endCommand(); sceKernelExitGame(); return 0; } int power_callback(int unknown, int pwrflags, void *common) { if (pwrflags & PSP_POWER_CB_RESUMING) psp_power_resume_number++; return 0; } int CallbackThread(SceSize args, void *argp) { int cbid; cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); sceKernelRegisterExitCallback(cbid); cbid = sceKernelCreateCallback("Power Callback", power_callback, NULL); scePowerRegisterCallback(0, cbid); sceKernelSleepThreadCB(); return 0; } int SetupCallbacks(void) { int thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if (thid >= 0) sceKernelStartThread(thid, 0, 0); return thid; } #endif void optionHelp() { printf( "Usage: onscripter [option ...]\n" ); printf( " --cdaudio\t\tuse CD audio if available\n"); printf( " --cdnumber no\tchoose the CD-ROM drive number\n"); printf( " -f, --font file\tset a TTF font file\n"); printf( " --registry file\tset a registry file\n"); printf( " --dll file\tset a dll file\n"); printf( " -r, --root path\tset the root path to the archives\n"); printf( " --fullscreen\tstart in fullscreen mode\n"); printf( " --window\t\tstart in windowed mode\n"); printf( " --force-button-shortcut\tignore useescspc and getenter command\n"); printf( " --enable-wheeldown-advance\tadvance the text on mouse wheel down\n"); printf( " --disable-rescale\tdo not rescale the images in the archives\n"); printf( " --render-font-outline\trender the outline of a text instead of casting a shadow\n"); printf( " --edit\t\tenable online modification of the volume and variables when 'z' is pressed\n"); printf( " --key-exe file\tset a file (*.EXE) that includes a key table\n"); printf( " -h, --help\t\tshow this help and exit\n"); printf( " -v, --version\t\tshow the version information and exit\n"); exit(0); } void optionVersion() { printf("Written by Ogapee \n\n"); printf("Copyright (c) 2001-2014 Ogapee.\n"); printf("This is free software; see the source for copying conditions.\n"); exit(0); } #ifdef ANDROID extern "C" { #include #ifndef SDL_JAVA_PACKAGE_PATH #error You have to define SDL_JAVA_PACKAGE_PATH to your package path with dots replaced with underscores, for example "com_example_SanAngeles" #endif #define JAVA_EXPORT_NAME2(name,package) Java_##package##_##name #define JAVA_EXPORT_NAME1(name,package) JAVA_EXPORT_NAME2(name,package) #define JAVA_EXPORT_NAME(name) JAVA_EXPORT_NAME1(name,SDL_JAVA_PACKAGE_PATH) JNIEXPORT jint JNICALL JAVA_EXPORT_NAME(ONScripter_nativeGetWidth) ( JNIEnv* env, jobject thiz ) { return ons.getWidth(); } JNIEXPORT jint JNICALL JAVA_EXPORT_NAME(ONScripter_nativeGetHeight) ( JNIEnv* env, jobject thiz ) { return ons.getHeight(); } } #endif #if defined(IOS) extern "C" void playVideoIOS(const char *filename, bool click_flag, bool loop_flag) { NSString *str = [[NSString alloc] initWithUTF8String:filename]; id obj = [MoviePlayer alloc]; [[obj init] play:str click:click_flag loop:loop_flag]; [obj release]; } #endif #if defined(QWS) || defined(ANDROID) int SDL_main( int argc, char **argv ) #elif defined(PSP) extern "C" int main( int argc, char **argv ) #else int main( int argc, char **argv ) #endif { printf("ONScripter version %s(%d.%02d)\n", ONS_VERSION, NSC_VERSION/100, NSC_VERSION%100 ); #if defined(PSP) ons.disableRescale(); ons.enableButtonShortCut(); SetupCallbacks(); #elif defined(WINCE) char currentDir[256]; strcpy(currentDir, argv[0]); char* cptr = currentDir; int i, len = strlen(currentDir); for(i=len-1; i>0; i--){ if(cptr[i] == '\\' || cptr[i] == '/') break; } cptr[i] = '\0'; ons.setArchivePath(currentDir); ons.disableRescale(); ons.enableButtonShortCut(); #elif defined(ANDROID) ons.enableButtonShortCut(); #endif #if defined(IOS) #if defined(HAVE_CONTENTS) if ([[[DataCopier alloc] init] copy]) exit(-1); #endif // scripts and archives are stored under /Library/Caches NSArray* cpaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSString* cpath = [[cpaths objectAtIndex:0] stringByAppendingPathComponent:@"ONS"]; char filename[256]; strcpy(filename, [cpath UTF8String]); ons.setArchivePath(filename); // output files are stored under /Documents NSArray* dpaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString* dpath = [[dpaths objectAtIndex:0] stringByAppendingPathComponent:@"ONS"]; strcpy(filename, [dpath UTF8String]); ons.setSaveDir(filename); #if defined(ZIP_URL) if ([[[DataDownloader alloc] init] download]) exit(-1); #endif #if defined(USE_SELECTOR) // scripts and archives are stored under /Library/Caches cpath = [[[ScriptSelector alloc] initWithStyle:UITableViewStylePlain] select]; strcpy(filename, [cpath UTF8String]); ons.setArchivePath(filename); // output files are stored under /Documents dpath = [[dpaths objectAtIndex:0] stringByAppendingPathComponent:[cpath lastPathComponent]]; NSFileManager *fm = [NSFileManager defaultManager]; [fm createDirectoryAtPath:dpath withIntermediateDirectories: YES attributes: nil error:nil]; strcpy(filename, [dpath UTF8String]); ons.setSaveDir(filename); #endif #if defined(RENDER_FONT_OUTLINE) ons.renderFontOutline(); #endif #endif // ---------------------------------------- // Parse options argv++; while( argc > 1 ){ if ( argv[0][0] == '-' ){ if ( !strcmp( argv[0]+1, "h" ) || !strcmp( argv[0]+1, "-help" ) ){ optionHelp(); } else if ( !strcmp( argv[0]+1, "v" ) || !strcmp( argv[0]+1, "-version" ) ){ optionVersion(); } else if ( !strcmp( argv[0]+1, "-cdaudio" ) ){ ons.enableCDAudio(); } else if ( !strcmp( argv[0]+1, "-cdnumber" ) ){ argc--; argv++; ons.setCDNumber(atoi(argv[0])); } else if ( !strcmp( argv[0]+1, "f" ) || !strcmp( argv[0]+1, "-font" ) ){ argc--; argv++; ons.setFontFile(argv[0]); } else if ( !strcmp( argv[0]+1, "-registry" ) ){ argc--; argv++; ons.setRegistryFile(argv[0]); } else if ( !strcmp( argv[0]+1, "-dll" ) ){ argc--; argv++; ons.setDLLFile(argv[0]); } else if ( !strcmp( argv[0]+1, "r" ) || !strcmp( argv[0]+1, "-root" ) ){ argc--; argv++; ons.setArchivePath(argv[0]); } else if ( !strcmp( argv[0]+1, "-fullscreen" ) ){ ons.setFullscreenMode(); } else if ( !strcmp( argv[0]+1, "-window" ) ){ ons.setWindowMode(); } else if ( !strcmp( argv[0]+1, "-force-button-shortcut" ) ){ ons.enableButtonShortCut(); } else if ( !strcmp( argv[0]+1, "-enable-wheeldown-advance" ) ){ ons.enableWheelDownAdvance(); } else if ( !strcmp( argv[0]+1, "-disable-rescale" ) ){ ons.disableRescale(); } else if ( !strcmp( argv[0]+1, "-render-font-outline" ) ){ ons.renderFontOutline(); } else if ( !strcmp( argv[0]+1, "-edit" ) ){ ons.enableEdit(); } else if ( !strcmp( argv[0]+1, "-key-exe" ) ){ argc--; argv++; ons.setKeyEXE(argv[0]); } #if defined(ANDROID) else if ( !strcmp( argv[0]+1, "-open-only" ) ){ argc--; argv++; if (ons.openScript()) exit(-1); return 0; } #endif else{ printf(" unknown option %s\n", argv[0] ); } } else{ optionHelp(); } argc--; argv++; } // ---------------------------------------- // Run ONScripter if (ons.openScript()) exit(-1); if (ons.init()) exit(-1); ons.executeLabel(); exit(0); } onscripter-20150820/LUAHandler.cpp0000644017777601777760000005454612565174244016441 0ustar nobodynogroup/* -*- C++ -*- * * LUAHandler.cpp - LUA handler for ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "LUAHandler.h" #include "ONScripter.h" #include "ScriptHandler.h" #define ONS_LUA_HANDLER_PTR "ONS_LUA_HANDLER_PTR" #define INIT_SCRIPT "system.lua" static char cmd_buf[256]; int NL_dofile(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); const char *str = luaL_checkstring( state, 1 ); unsigned long length = lh->sh->cBR->getFileLength(str); if (length == 0){ printf("cannot open %s\n", str); return 0; } unsigned char *buffer = new unsigned char[length+1]; int location; lh->sh->cBR->getFile(str, buffer, &location); buffer[length] = 0; unsigned char *buffer2 = new unsigned char[length*3/2]; unsigned char *p = buffer; unsigned char *p2 = buffer2; while(*p){ if (IS_TWO_BYTE(*p)){ *p2++ = *p++; if (*p == '\\') *p2++ = '\\'; } *p2++ = *p++; } if (luaL_loadbuffer(state, (const char*)buffer2, p2 - buffer2, str) || lua_pcall(state, 0, 0, 0)){ printf("cannot parse %s %s\n", str, lua_tostring(state,-1)); } delete[] buffer; delete[] buffer2; return 0; } int NSPopInt(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)){ lua_pushstring( state, "LUAHandler::NSPopInt() no integer." ); lua_error( state ); } lua_pushnumber( state, lh->sh->readInt() ); return 1; } int NSPopIntRef(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)){ lua_pushstring( state, "LUAHandler::NSPopIntRef() no integer variable." ); lua_error( state ); } lh->sh->readVariable(); if (lh->sh->current_variable.type != ScriptHandler::VAR_INT){ lua_pushstring( state, "LUAHandler::NSPopIntRef() no integer variable." ); lua_error( state ); } lua_pushnumber( state, lh->sh->current_variable.var_no ); return 1; } int NSPopStr(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)){ lua_pushstring( state, "LUAHandler::NSPopStr() no string." ); lua_error( state ); } lua_pushstring( state, lh->sh->readStr() ); return 1; } int NSPopStrRef(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)){ lua_pushstring( state, "LUAHandler::NSPopStrRef() no string variable." ); lua_error( state ); } lh->sh->readVariable(); if (lh->sh->current_variable.type != ScriptHandler::VAR_STR){ lua_pushstring( state, "LUAHandler::NSPopStrRef() no string variable." ); lua_error( state ); } lua_pushnumber( state, lh->sh->current_variable.var_no ); return 1; } int NSPopLabel(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)){ lua_pushstring( state, "LUAHandler::NSPopLabel() no label." ); lua_error( state ); } const char *str = lh->sh->readLabel(); if (str[0] != '*'){ lua_pushstring( state, "LUAHandler::NSPopLabel() no label." ); lua_error( state ); } lua_pushstring( state, str+1 ); return 1; } int NSPopID(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)){ lua_pushstring( state, "LUAHandler::NSPopID() no ID." ); lua_error( state ); } lua_pushstring( state, lh->sh->readLabel() ); return 1; } int NSPopComma(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (!(val & ScriptHandler::END_COMMA) || val & ScriptHandler::END_COMMA_READ){ lua_pushstring( state, "LUAHandler::NSPopComma() no comma." ); lua_error( state ); } lh->sh->setEndStatus( ScriptHandler::END_COMMA_READ ); return 0; } int NSCheckComma(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int val = lh->sh->getEndStatus(); if (val & ScriptHandler::END_COMMA && !(val & ScriptHandler::END_COMMA_READ)) lua_pushboolean( state, 1 ); else lua_pushboolean( state, 0 ); return 1; } int NSSetIntValue(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int no = luaL_checkint( state, 1 ); int val = luaL_checkint( state, 2 ); lh->sh->setNumVariable( no, val ); return 0; } int NSSetStrValue(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int no = luaL_checkint( state, 1 ); const char *str = luaL_checkstring( state, 2 ); if (lh->sh->getVariableData(no).str) delete[] lh->sh->getVariableData(no).str; lh->sh->getVariableData(no).str = NULL; if (str){ lh->sh->getVariableData(no).str = new char[strlen(str) + 1]; strcpy(lh->sh->getVariableData(no).str, str); } return 0; } int NSGetIntValue(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int no = luaL_checkint( state, 1 ); lua_pushnumber( state, lh->sh->getVariableData(no).num ); return 1; } int NSGetStrValue(lua_State *state) { lua_getglobal( state, ONS_LUA_HANDLER_PTR ); LUAHandler *lh = (LUAHandler*)lua_topointer( state, -1 ); int no = luaL_checkint( state, 1 ); lua_pushstring( state, lh->sh->getVariableData(no).str ); return 1; } int NSExec(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); strcpy(cmd_buf, lua_tostring(state, 1)); //printf("NSExec [%s]\n", cmd_buf); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSGoto(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); const char *str = luaL_checkstring( state, 1 ); lh->ons->setCurrentLabel( str+1 ); return 0; } int NSGosub(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); const char *str = luaL_checkstring( state, 1 ); lh->ons->gosubReal( str+1, lh->sh->getNext() ); return 0; } int NSReturn(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); lh->ons->returnCommand(); return 0; } int NSLuaAnimationInterval(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int val = lua_tointeger(state, 1); lh->duration_time = val; return 0; } int NSLuaAnimationMode(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int val = lua_toboolean(state, 1); lh->is_animatable = (val==1); return 0; } int NSGetClick(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); ONScripter::ButtonState &bs = lh->ons->getCurrentButtonState(); if (bs.event_type == SDL_MOUSEBUTTONUP && bs.event_button == SDL_BUTTON_LEFT) lua_pushboolean( state, true ); else lua_pushboolean( state, false ); if (bs.event_type == SDL_MOUSEBUTTONUP && bs.event_button == SDL_BUTTON_RIGHT) lua_pushboolean( state, true ); else lua_pushboolean( state, false ); #if SDL_VERSION_ATLEAST(1, 2, 5) if (bs.event_button == SDL_BUTTON_WHEELUP) lua_pushinteger( state, 1 ); else if (bs.event_button == SDL_BUTTON_WHEELDOWN) lua_pushinteger( state, -1 ); else #endif lua_pushinteger( state, 0 ); if (bs.event_type == SDL_MOUSEBUTTONDOWN && bs.event_button == SDL_BUTTON_LEFT) lua_pushboolean( state, true ); else lua_pushboolean( state, false ); if (bs.event_type == SDL_MOUSEBUTTONDOWN && bs.event_button == SDL_BUTTON_RIGHT) lua_pushboolean( state, true ); else lua_pushboolean( state, false ); bs.event_type = 0; bs.event_button = 0; return 5; } int NSGetMouse(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); ONScripter::ButtonState bs = lh->ons->getCurrentButtonState(); if (bs.x == lh->ons->getWidth() && bs.y == lh->ons->getHeight()){ lua_pushinteger( state, -1 ); lua_pushinteger( state, -1 ); } else{ lua_pushinteger( state, bs.x*lh->screen_ratio2/lh->screen_ratio1 ); lua_pushinteger( state, bs.y*lh->screen_ratio2/lh->screen_ratio1 ); } return 2; } int NSGetSkip(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); lua_pushinteger( state, lh->ons->getSkip() ); return 1; } int NSGetWindowSize(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); lua_pushinteger( state, lh->ons->getWidth() ); lua_pushinteger( state, lh->ons->getHeight() ); return 2; } int NSDoEvents(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); sprintf(cmd_buf, "wait 0"); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); lua_pushboolean( state, false ); return 1; } int NSTimer(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); lua_pushinteger( state, SDL_GetTicks() ); return 1; } int NSGetKey(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); const char *str = luaL_checkstring( state, 1 ); ONScripter::ButtonState bs = lh->ons->getCurrentButtonState(); if ( strcmp(str, bs.str) == 0 || (strcmp(str, "ESC") == 0 && strcmp(bs.str, "RCLICK") == 0)) lua_pushboolean( state, 1 ); else lua_pushboolean( state, 0 ); return 1; } int NSSleep(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int val = luaL_checkint( state, 1 ); sprintf(cmd_buf, "wait %d", val); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSUpdate(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); sprintf(cmd_buf, "print 1"); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSpCell(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); int cell = luaL_checkint( state, 2 ); sprintf(cmd_buf, "cell %d, %d", no, cell); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSpClear(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); sprintf(cmd_buf, "csp %d", no); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSpGetInfo(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); AnimationInfo *ai = lh->ons->getSpriteInfo(no); lua_pushinteger( state, ai->orig_pos.w / ai->num_of_cells ); lua_pushinteger( state, ai->orig_pos.h ); lua_pushinteger( state, ai->num_of_cells ); return 3; } int NSSpGetPos(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); AnimationInfo *ai = lh->ons->getSpriteInfo(no); lua_pushinteger( state, ai->orig_pos.x ); lua_pushinteger( state, ai->orig_pos.y ); lua_pushinteger( state, ai->trans ); return 3; } int NSSpLoad(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); const char *str = luaL_checkstring( state, 2 ); sprintf(cmd_buf, "lsp %d, \"%s\", %d, 0", no, str, lh->ons->getWidth()+1); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSpMove(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); int x = luaL_checkint( state, 2 ); int y = luaL_checkint( state, 3 ); int alpha = luaL_checkint( state, 4 ); sprintf(cmd_buf, "amsp %d, %d, %d, %d", no, x, y, alpha); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSpVisible(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); int v = lua_toboolean( state, 2 ); sprintf(cmd_buf, "vsp %d, %d", no, v); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSp2GetInfo(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); AnimationInfo *ai = lh->ons->getSprite2Info(no); lua_pushinteger( state, ai->orig_pos.w / ai->num_of_cells ); lua_pushinteger( state, ai->orig_pos.h ); lua_pushinteger( state, ai->num_of_cells ); return 3; } int NSSp2GetPos(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); AnimationInfo *ai = lh->ons->getSprite2Info(no); lua_pushinteger( state, ai->orig_pos.x ); lua_pushinteger( state, ai->orig_pos.y ); lua_pushinteger( state, ai->scale_x ); lua_pushinteger( state, ai->scale_y ); lua_pushinteger( state, ai->rot ); lua_pushinteger( state, ai->trans ); lua_pushinteger( state, ai->blending_mode ); return 7; } int NSSp2Load(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); const char *str = luaL_checkstring( state, 2 ); sprintf(cmd_buf, "lsp2 %d, \"%s\", %d, 0, 100, 100, 0", no, str, lh->ons->getWidth()*2); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } int NSSp2Move(lua_State *state) { lua_getglobal(state, ONS_LUA_HANDLER_PTR); LUAHandler *lh = (LUAHandler*)lua_topointer(state, -1); int no = luaL_checkint( state, 1 ); int x = luaL_checkint( state, 2 ); int y = luaL_checkint( state, 3 ); int sx = luaL_checkint( state, 4 ); int sy = luaL_checkint( state, 5 ); int r = luaL_checkint( state, 6 ); int alpha = luaL_checkint( state, 7 ); int opt = luaL_checkint( state, 8 ); // opt is not handled properly yet sprintf(cmd_buf, "amsp2 %d, %d, %d, %d, %d, %d, %d", no, x, y, sx, sy, r, alpha); lh->sh->enterExternalScript(cmd_buf); lh->ons->runScript(); lh->sh->leaveExternalScript(); return 0; } #define LUA_FUNC_LUT(s) {#s, s} static const struct luaL_Reg lua_lut[] = { LUA_FUNC_LUT(NL_dofile), LUA_FUNC_LUT(NSPopInt), LUA_FUNC_LUT(NSPopIntRef), LUA_FUNC_LUT(NSPopStr), LUA_FUNC_LUT(NSPopStrRef), LUA_FUNC_LUT(NSPopLabel), LUA_FUNC_LUT(NSPopID), LUA_FUNC_LUT(NSPopComma), LUA_FUNC_LUT(NSCheckComma), LUA_FUNC_LUT(NSSetIntValue), LUA_FUNC_LUT(NSSetStrValue), LUA_FUNC_LUT(NSGetIntValue), LUA_FUNC_LUT(NSGetStrValue), LUA_FUNC_LUT(NSExec), LUA_FUNC_LUT(NSGoto), LUA_FUNC_LUT(NSGosub), LUA_FUNC_LUT(NSReturn), LUA_FUNC_LUT(NSLuaAnimationInterval), LUA_FUNC_LUT(NSLuaAnimationMode), LUA_FUNC_LUT(NSGetClick), LUA_FUNC_LUT(NSGetMouse), LUA_FUNC_LUT(NSGetSkip), LUA_FUNC_LUT(NSGetWindowSize), LUA_FUNC_LUT(NSDoEvents), LUA_FUNC_LUT(NSTimer), LUA_FUNC_LUT(NSGetKey), LUA_FUNC_LUT(NSSleep), LUA_FUNC_LUT(NSUpdate), LUA_FUNC_LUT(NSSpCell), LUA_FUNC_LUT(NSSpClear), LUA_FUNC_LUT(NSSpGetInfo), LUA_FUNC_LUT(NSSpGetPos), LUA_FUNC_LUT(NSSpLoad), LUA_FUNC_LUT(NSSpMove), LUA_FUNC_LUT(NSSpVisible), LUA_FUNC_LUT(NSSp2GetInfo), LUA_FUNC_LUT(NSSp2GetPos), LUA_FUNC_LUT(NSSp2Load), LUA_FUNC_LUT(NSSp2Move), {NULL, NULL} }; //LUAHandler::LUAHandler(ONScripter *ons) LUAHandler::LUAHandler() { state = NULL; is_animatable = false; duration_time = 15; remaining_time = 15; screen_ratio1 = 1; screen_ratio2 = 1; error_str[0] = 0; for (unsigned int i=0 ; ions = ons; this->sh = sh; state = luaL_newstate(); luaL_openlibs(state); #if LUA_VERSION_NUM >= 502 lua_pushglobaltable(state); luaL_setfuncs(state, lua_lut, 0); #else lua_pushvalue(state, LUA_GLOBALSINDEX); luaL_register(state, NULL, lua_lut); #endif lua_pushlightuserdata(state, this); lua_setglobal(state, ONS_LUA_HANDLER_PTR); } void LUAHandler::loadInitScript() { unsigned long length = sh->cBR->getFileLength(INIT_SCRIPT); if (length == 0){ printf("cannot open %s\n", INIT_SCRIPT); return; } unsigned char *buffer = new unsigned char[length+1]; int location; sh->cBR->getFile(INIT_SCRIPT, buffer, &location); buffer[length] = 0; unsigned char *buffer2 = new unsigned char[length*3/2]; unsigned char *p = buffer; unsigned char *p2 = buffer2; while(*p){ if (IS_TWO_BYTE(*p)){ *p2++ = *p++; if (*p == '\\') *p2++ = '\\'; } *p2++ = *p++; } if (luaL_loadbuffer(state, (const char*)buffer2, p2 - buffer2, INIT_SCRIPT) || lua_pcall(state, 0, 0, 0)){ printf("cannot parse %s %s\n", INIT_SCRIPT, lua_tostring(state,-1)); } delete[] buffer; delete[] buffer2; } void LUAHandler::addCallback(const char *label) { if (strcmp(label, "tag") == 0) callback_state[LUA_TAG] = true; if (strcmp(label, "text0") == 0) callback_state[LUA_TEXT0] = true; if (strcmp(label, "text") == 0) callback_state[LUA_TEXT] = true; if (strcmp(label, "animation") == 0) callback_state[LUA_ANIMATION] = true; if (strcmp(label, "close") == 0) callback_state[LUA_CLOSE] = true; if (strcmp(label, "end") == 0) callback_state[LUA_END] = true; if (strcmp(label, "savepoint") == 0) callback_state[LUA_SAVEPOINT] = true; if (strcmp(label, "save") == 0) callback_state[LUA_SAVE] = true; if (strcmp(label, "load") == 0) callback_state[LUA_LOAD] = true; if (strcmp(label, "reset") == 0) callback_state[LUA_RESET] = true; } int LUAHandler::callFunction(bool is_callback, const char *cmd) { char cmd2[256]; if (is_callback) sprintf(cmd2, "NSCALL_%s", cmd); else sprintf(cmd2, "NSCOM_%s", cmd); int num_return_value = 0; if (strcmp(cmd2, "NSCALL_animation") == 0) num_return_value = 1; lua_getglobal(state, cmd2); if (lua_pcall(state, 0, num_return_value, 0) != 0){ strcpy( error_str, lua_tostring(state, -1) ); return -1; } if (strcmp(cmd2, "NSCALL_animation") == 0){ if (lua_isboolean(state, -1) && lua_toboolean(state, -1)){ sprintf(cmd2, "NSUpdate"); lua_getglobal(state, cmd2); if (lua_pcall(state, 0, 0, 0) != 0){ strcpy( error_str, lua_tostring(state, -1) ); return -1; } } } return 0; } bool LUAHandler::isCallbackEnabled(int val) { return callback_state[val]; } onscripter-20150820/Makefile.MacOSX0000644017777601777760000000140212565174244016526 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.MacOSX - Makefile rules for MacOS X # Thanks adas-san, Takano-san and tmkk-san # INCS = `sdl-config --cflags` `smpeg-config --cflags` LIBS = `sdl-config --libs` `smpeg-config --libs` `freetype-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -lm -ljpeg -framework QuickTime -framework CoreFoundation DEFS = -DMACOSX -DUSE_CDROM -DUTF8_CAPTION -DUTF8_FILESYSTEM EXESUFFIX = OBJSUFFIX = .o .SUFFIXES: .SUFFIXES: $(OBJSUFFIX) .cpp .h CC = c++ LD = c++ -o #CFLAGS = -g -Wall -Wpointer-arith -pipe -c $(INCS) $(DEFS) CFLAGS = -O3 -Wall -Wpointer-arith -pipe -c $(INCS) $(DEFS) RM = rm -f TARGET = onscripter$(EXESUFFIX) sardec$(EXESUFFIX) nsadec$(EXESUFFIX) sarconv$(EXESUFFIX) nsaconv$(EXESUFFIX) include Makefile.onscripter onscripter-20150820/nscriptdecode.cpp0000644017777601777760000000012712565174244017332 0ustar nobodynogroup#include main(){int ch; while ((ch = getchar()) != EOF) putchar(ch ^ 0x84);} onscripter-20150820/AVIWrapper.cpp0000644017777601777760000002673212565174244016476 0ustar nobodynogroup/* -*- C++ -*- * * AVIWrapper.cpp - avifile library wrapper class to play AVI video & audio stream * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "AVIWrapper.h" #include #include #include #include #include #include #include #include #include #define DEFAULT_AUDIOBUF 4096 #define AVI_FINISH_EVENT 12345 #define AVIFILE_VERSION 747 AVIWrapper::AVIWrapper() { screen_overlay = NULL; i_avi = NULL; v_stream = NULL; a_stream = NULL; remaining_buffer = new char[DEFAULT_AUDIOBUF*4]; remaining_count = 0; } AVIWrapper::~AVIWrapper() { if ( v_stream ) v_stream->StopStreaming(); if ( a_stream ) a_stream->StopStreaming(); if ( i_avi ) delete i_avi; if ( screen_overlay ) SDL_FreeYUVOverlay( screen_overlay ); if ( remaining_buffer ) delete[] remaining_buffer; } int AVIWrapper::init( char *filename, bool debug_flag ) { this->debug_flag = debug_flag; #if AVIFILE_VERSION >= 747 if ( !debug_flag ) avm::AvmOutput::singleton()->resetDebugLevels(-1); #else if ( !debug_flag ) avm::out.resetDebugLevels(-1); #endif i_avi = CreateIAviReadFile( filename ); if ( i_avi == NULL || i_avi->IsValid() == false ){ fprintf( stderr, "can't CreateIAviReadFile from %s\n", filename ); return -1; } v_stream = i_avi->GetStream(0, AviStream::Video ); if ( v_stream == NULL ){ fprintf( stderr, "Video Stream is NULL\n" ); return -1; } width = v_stream->GetStreamInfo()->GetVideoWidth(); height = v_stream->GetStreamInfo()->GetVideoHeight(); if ( debug_flag ) fprintf( stderr, "width %d height %d\n", width, height ); return 0; } int AVIWrapper::initAV( SDL_Surface *surface, bool audio_open_flag ) { screen_rect.x = screen_rect.y = 0; screen_rect.w = surface->w; screen_rect.h = surface->h; v_stream->StartStreaming(); if ( v_stream->GetVideoDecoder() == NULL ){ if ( debug_flag ) fprintf( stderr, "GetVideoDecoder() return 0.\n" ); return -1; } avm::IVideoDecoder::CAPS cap = v_stream->GetVideoDecoder()->GetCapabilities(); if ( debug_flag ) printf("cap %x\n", cap ); if ( cap & avm::IVideoDecoder::CAP_YV12 ){ v_stream->GetVideoDecoder()->SetDestFmt( 0, fccYV12 ); screen_overlay = SDL_CreateYUVOverlay( width, height, SDL_YV12_OVERLAY, surface ); } else if ( cap & avm::IVideoDecoder::CAP_YUY2 ){ v_stream->GetVideoDecoder()->SetDestFmt( 0, fccYUY2 ); screen_overlay = SDL_CreateYUVOverlay( width, height, SDL_YUY2_OVERLAY, surface ); } else{ screen_overlay = SDL_CreateYUVOverlay( width, height, SDL_YV12_OVERLAY, surface ); } if ( !audio_open_flag ) return 0; a_stream = i_avi->GetStream(0, AviStream::Audio); if ( a_stream == NULL ){ if ( debug_flag ) fprintf( stderr, "Audio Stream is NULL\n" ); return 0; } a_stream->StartStreaming(); WAVEFORMATEX wave_fmt; a_stream->GetAudioDecoder()->GetOutputFormat( &wave_fmt ); if ( debug_flag ) printf(" format %d ch %d sample %d bit %d avg Bps %d\n", wave_fmt.wFormatTag, wave_fmt.nChannels, wave_fmt.nSamplesPerSec, wave_fmt.wBitsPerSample, wave_fmt.nAvgBytesPerSec ); if ( Mix_OpenAudio( wave_fmt.nSamplesPerSec, MIX_DEFAULT_FORMAT, wave_fmt.nChannels, DEFAULT_AUDIOBUF ) < 0 ){ fprintf( stderr, "can't open audio device\n" ); a_stream->StopStreaming(); delete a_stream; a_stream = NULL; } return 0; } static void audioCallback( void *userdata, Uint8 *stream, int len ) { AVIWrapper &avi = *(AVIWrapper*)userdata; avi.audioCallback( userdata, stream, len ); } void AVIWrapper::audioCallback( void *userdata, Uint8 *stream, int len ) { if ( len == 0 ) status = AVI_STOP; size_t ocnt; size_t samples; size_t count = 0; if ( remaining_count > 0 ){ if ( remaining_count <= len ){ memcpy( stream, remaining_buffer, remaining_count ); count = remaining_count; len -= remaining_count; remaining_count = 0; } else{ memmove( stream, remaining_buffer, len ); count = len; len = 0; remaining_count -= len; return; } } while ( len > 0 && !a_stream->Eof() ){ a_stream->ReadFrames( remaining_buffer, (size_t)len, (size_t)len, samples, ocnt ); if ( (int)ocnt <= len ){ memcpy( stream+count, remaining_buffer, ocnt ); len -= ocnt; } else{ memcpy( stream+count, remaining_buffer, len ); if ( (int)ocnt-len < DEFAULT_AUDIOBUF*4 - len ){ memmove( remaining_buffer, remaining_buffer+len, ocnt-len ); remaining_count = ocnt-len; } else{ remaining_count = 0; } len = 0; } count += ocnt; } } double AVIWrapper::getAudioTime() { if ( time_start == 0 ) { frame_start = (v_stream) ? v_stream->GetTime() : 0.; #if AVIFILE_VERSION >= 747 time_start = avm_get_time_us(); #else time_start = longcount(); #endif } if ( a_stream ) return a_stream->GetTime(); else #if AVIFILE_VERSION >= 747 return frame_start + to_float(avm_get_time_us(), time_start); #else return frame_start + to_float(longcount(), time_start); #endif } static int playVideo( void *userdata ) { AVIWrapper &avi = *(AVIWrapper*)userdata; return avi.playVideo( userdata ); } #define NUM_CACHES 3 int AVIWrapper::playVideo( void *userdata ) { int i; struct{ bool valid; avm::CImage *image; double time; } cache[NUM_CACHES]; for ( i=0 ; iEof() ){ avm::CImage *image = v_stream->GetFrame( true ); if ( image == NULL ) break; double current_time = v_stream->GetTime(); double minimum_time = current_time; // look for the nearest in the cache int nearest_cache=-1; for ( i=0 ; i= 0 && cache[i].time < cache[nearest_cache].time) ){ nearest_cache = i; if ( minimum_time > cache[nearest_cache].time ) minimum_time = cache[nearest_cache].time; } } } double async = getAudioTime() - minimum_time; //printf("audio %f (%f - %f) minimum %d %f cur %f\n", async, getAudioTime(), minimum_time, nearest_cache, minimum_time, current_time ); if ( async < -0.01 ){ if ( remaining_cache == 0 ){ //printf("sync0 %f %f %f %f\n", async, (a_stream)?a_stream->GetTime():0.0, v_stream->GetTime(), minimum_time ); SDL_Delay( (int)(-async*1000) ); } } if ( (async < -0.01 && remaining_cache > 0) || nearest_cache >= 0 ){ // add cache for ( i=0 ; iRelease(); continue; } } if ( nearest_cache >= 0 && minimum_time == cache[nearest_cache].time ){ //printf("draw cache %d %f\n", nearest_cache, cache[nearest_cache].time ); //if ( async <= 0.033 ) // drop frame if necessary drawFrame( cache[nearest_cache].image ); cache[nearest_cache].image->Release(); cache[nearest_cache].valid = false; remaining_cache++; } else{ //printf("draw real %f\n", current_time ); //if ( async <= 0.033 ) // drop frame if necessary drawFrame( image ); } image->Release(); } status = AVI_STOP; for ( i=0 ; iRelease(); return 0; } int AVIWrapper::play( bool click_flag ) { int ret = 0; time_start = 0; status = AVI_PLAYING; if ( v_stream ) thread_id = SDL_CreateThread( ::playVideo, this ); if ( a_stream ) Mix_HookMusic( ::audioCallback, this ); bool done_flag = false; while( !(done_flag & click_flag) && status == AVI_PLAYING ){ SDL_Event event; while( SDL_PollEvent( &event ) ){ switch (event.type){ case SDL_KEYUP: if ( ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_RETURN || ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_KP_ENTER || ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_SPACE || ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_ESCAPE ) done_flag = true; break; case SDL_QUIT: ret = 1; case SDL_MOUSEBUTTONUP: done_flag = true; break; default: break; } } SDL_Delay( 10 ); } status = AVI_STOP; if ( v_stream ) SDL_WaitThread( thread_id, NULL ); if ( a_stream ) Mix_HookMusic( NULL, NULL ); return ret; } int AVIWrapper::drawFrame( avm::CImage *image ) { if ( image == NULL ) return -1; unsigned int i, j; uint32_t comp = image->GetFmt()->biCompression; unsigned char *buf = image->Data(); SDL_LockYUVOverlay( screen_overlay ); Uint8 *dst_y = screen_overlay->pixels[0]; Uint8 *dst_u = screen_overlay->pixels[1]; Uint8 *dst_v = screen_overlay->pixels[2]; if ( comp == 0 ){ // BGR image->ToYUV(); for ( i=0 ; i EBOOT.PBP for PSP Firmware version 1.0 FIXUP_IMPORTS = psp-fixup-imports STRIP = psp-strip MKSFO = mksfo PACK_PBP = pack-pbp PSP_TARGET = onscripter$(EXESUFFIX) PSP_TARGET_FIXUP = onscripter_fixup$(EXESUFFIX) PSP_TARGET_STRIP = onscripter_strip$(EXESUFFIX) PSP_EBOOT_TITLE = ONScripter for PSP PSP_EBOOT_SFO = PARAM.SFO PSP_EBOOT_ICON = NULL PSP_EBOOT_ICON1 = NULL PSP_EBOOT_UNKPNG = NULL PSP_EBOOT_PIC1 = NULL PSP_EBOOT_SND0 = NULL PSP_EBOOT_PSAR = NULL EBOOT.PBP : $(PSP_TARGET_STRIP) $(PSP_EBOOT_SFO) $(PACK_PBP) EBOOT.PBP $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \ $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \ $(PSP_EBOOT_SND0) $(PSP_TARGET_STRIP) $(PSP_EBOOT_PSAR) $(PSP_EBOOT_SFO) : $(MKSFO) '$(PSP_EBOOT_TITLE)' $(PSP_EBOOT_SFO) $(PSP_TARGET_FIXUP) : $(PSP_TARGET) $(FIXUP_IMPORTS) $(PSP_TARGET) -o $(PSP_TARGET_FIXUP) $(PSP_TARGET_STRIP) : $(PSP_TARGET_FIXUP) $(STRIP) $(PSP_TARGET_FIXUP) -o $(PSP_TARGET_STRIP) include Makefile.onscripter # overriding clean : $(RM) $(TARGET) $(RM) $(PSP_TARGET) $(PSP_TARGET_FIXUP) $(PSP_TARGET_STRIP) $(PSP_EBOOT_SFO) $(RM) *.o onscripter-20150820/ONScripter_file.cpp0000644017777601777760000002050712565174244017537 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_file.cpp - FILE I/O of ONScripter * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #if defined(LINUX) || defined(MACOSX) || defined(IOS) #include #include #include #include #elif defined(WIN32) #include #elif defined(MACOS9) #include #include extern "C" void c2pstrcpy(Str255 dst, const char *src); //#include #elif defined(PSP) #include #endif #define SAVEFILE_MAGIC_NUMBER "ONS" #define SAVEFILE_VERSION_MAJOR 2 #define SAVEFILE_VERSION_MINOR 8 #define READ_LENGTH 4096 void ONScripter::searchSaveFile( SaveFileInfo &save_file_info, int no ) { char file_name[256]; script_h.getStringFromInteger( save_file_info.sjis_no, no, (num_save_file >= 10)?2:1 ); #if defined(LINUX) || defined(MACOSX) || defined(IOS) sprintf( file_name, "%ssave%d.dat", save_dir?save_dir:archive_path, no ); struct stat buf; struct tm *tm; if ( stat( file_name, &buf ) != 0 ){ save_file_info.valid = false; return; } time_t mtime = buf.st_mtime; tm = localtime( &mtime ); save_file_info.month = tm->tm_mon + 1; save_file_info.day = tm->tm_mday; save_file_info.hour = tm->tm_hour; save_file_info.minute = tm->tm_min; #elif defined(WIN32) sprintf( file_name, "%ssave%d.dat", save_dir?save_dir:archive_path, no ); HANDLE handle; FILETIME tm, ltm; SYSTEMTIME stm; #if defined(WINCE) WCHAR file_nameW[256]; MultiByteToWideChar(CP_ACP, 0, file_name, -1, file_nameW, 256); handle = CreateFile( file_nameW, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); #else handle = CreateFile( file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); #endif if ( handle == INVALID_HANDLE_VALUE ){ save_file_info.valid = false; return; } GetFileTime( handle, NULL, NULL, &tm ); FileTimeToLocalFileTime( &tm, <m ); FileTimeToSystemTime( <m, &stm ); CloseHandle( handle ); save_file_info.month = stm.wMonth; save_file_info.day = stm.wDay; save_file_info.hour = stm.wHour; save_file_info.minute = stm.wMinute; #elif defined(MACOS9) sprintf( file_name, "%ssave%d.dat", save_dir?save_dir:archive_path, no ); CInfoPBRec pb; Str255 p_file_name; FSSpec file_spec; DateTimeRec tm; c2pstrcpy( p_file_name, file_name ); if ( FSMakeFSSpec(0, 0, p_file_name, &file_spec) != noErr ){ save_file_info.valid = false; return; } pb.hFileInfo.ioNamePtr = file_spec.name; pb.hFileInfo.ioVRefNum = file_spec.vRefNum; pb.hFileInfo.ioFDirIndex = 0; pb.hFileInfo.ioDirID = file_spec.parID; if (PBGetCatInfoSync(&pb) != noErr) { save_file_info.valid = false; return; } SecondsToDate( pb.hFileInfo.ioFlMdDat, &tm ); save_file_info.month = tm.month; save_file_info.day = tm.day; save_file_info.hour = tm.hour; save_file_info.minute = tm.minute; #elif defined(PSP) sprintf( file_name, "%ssave%d.dat", save_dir?save_dir:archive_path, no ); SceIoStat buf; if ( sceIoGetstat(file_name, &buf)<0 ){ save_file_info.valid = false; return; } save_file_info.month = buf.st_mtime.month; save_file_info.day = buf.st_mtime.day; save_file_info.hour = buf.st_mtime.hour; save_file_info.minute = buf.st_mtime.minute; #else sprintf( file_name, "save%d.dat", no ); FILE *fp; if ( (fp = fopen( file_name, "rb", true )) == NULL ){ save_file_info.valid = false; return; } fclose( fp ); save_file_info.month = 1; save_file_info.day = 1; save_file_info.hour = 0; save_file_info.minute = 0; #endif save_file_info.valid = true; script_h.getStringFromInteger( save_file_info.sjis_month, save_file_info.month, 2 ); script_h.getStringFromInteger( save_file_info.sjis_day, save_file_info.day, 2 ); script_h.getStringFromInteger( save_file_info.sjis_hour, save_file_info.hour, 2 ); script_h.getStringFromInteger( save_file_info.sjis_minute, save_file_info.minute, 2, true ); } char *ONScripter::readSaveStrFromFile( int no ) { char filename[32]; sprintf( filename, "save%d.dat", no ); size_t len = loadFileIOBuf( filename ); if (len == 0){ fprintf( stderr, "readSaveStrFromFile: can't open save file %s\n", filename ); return NULL; } int p = len - 1; if ( p < 3 || file_io_buf[p] != '*' || file_io_buf[p-1] != '"' ) return NULL; p -= 2; while( file_io_buf[p] != '"' && p>0 ) p--; if ( file_io_buf[p] != '"' ) return NULL; len = len - p - 3; char *buf = new char[len+1]; unsigned int i; for (i=0 ; i SAVEFILE_VERSION_MAJOR*100 + SAVEFILE_VERSION_MINOR ){ fprintf( stderr, "Save file is newer than %d.%d, please use the latest ONScripter.\n", SAVEFILE_VERSION_MAJOR, SAVEFILE_VERSION_MINOR ); return -1; } if ( file_version >= 200 ) return loadSaveFile2( file_version ); fprintf( stderr, "Save file is too old.\n"); return -1; } void ONScripter::saveMagicNumber( bool output_flag ) { for ( unsigned int i=0 ; inext = this->next; this->next = button; }; void removeSprite( int no ){ ButtonLink *bl = this; while( bl->next ){ if ( bl->next->sprite_no == no && bl->next->button_type == SPRITE_BUTTON ){ ButtonLink *bl2 = bl->next; bl->next = bl->next->next; delete bl2; } else{ bl = bl->next; } } }; }; #endif // __BUTTON_LINK_H__ onscripter-20150820/resize_image.cpp0000644017777601777760000002007612565174244017154 0ustar nobodynogroup/* -*- C++ -*- * * resize_image.cpp - resize image using smoothing and resampling * * Copyright (c) 2001-2012 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include #include static unsigned long *pixel_accum=NULL; static unsigned long *pixel_accum_num=NULL; static int pixel_accum_size=0; static unsigned long tmp_acc[4]; static unsigned long tmp_acc_num[4]; static void calcWeightedSumColumnInit(unsigned char **src, int interpolation_height, int image_width, int image_height, int image_pixel_width, int byte_per_pixel) { int y_end = -interpolation_height/2+interpolation_height; memset(pixel_accum, 0, image_width*byte_per_pixel*sizeof(unsigned long)); memset(pixel_accum_num, 0, image_width*byte_per_pixel*sizeof(unsigned long)); for (int s=0 ; s= image_height) break; unsigned long *pa = pixel_accum + image_width*s; unsigned long *pan = pixel_accum_num + image_width*s; unsigned char *p = *src+image_pixel_width*i+s; for (int j=image_width ; j!=0 ; j--, p+=byte_per_pixel){ *pa++ += *p; (*pan++)++; } } } } static void calcWeightedSumColumn(unsigned char **src, int y, int interpolation_height, int image_width, int image_height, int image_pixel_width, int byte_per_pixel) { int y_start = y-interpolation_height/2; int y_end = y-interpolation_height/2+interpolation_height; for (int s=0 ; s=0 && (y_start-1)=0 && (y_end-1)=0 && (x_start-1)=0 && (x_end-1) 1 ) mx = 1; else mx = 0; if ( src_height > 1 ) my = 1; else my = 0; int interpolation_width = src_width / dst_width; if ( interpolation_width == 0 ) interpolation_width = 1; int interpolation_height = src_height / dst_height; if ( interpolation_height == 0 ) interpolation_height = 1; if (pixel_accum_size < src_width*byte_per_pixel){ pixel_accum_size = src_width*byte_per_pixel; if (pixel_accum) delete[] pixel_accum; pixel_accum = new unsigned long[pixel_accum_size]; if (pixel_accum_num) delete[] pixel_accum_num; pixel_accum_num = new unsigned long[pixel_accum_size]; } /* smoothing */ if ( byte_per_pixel >= 3 ){ calcWeightedSumColumnInit(&src_buf, interpolation_height, src_width, src_height, src_total_width, byte_per_pixel ); for ( i=0 ; i= src_width) break; tmp_acc[s] += pixel_accum[src_width*s+j]; tmp_acc_num[s] += pixel_accum_num[src_width*s+j]; } } for ( j=0 ; j>= 3; for ( j=0 ; j>= 3; int k = tmp_total_width * y + x * byte_per_pixel; if (palette_flag){ //assuming byte_per_pixel=1 *dst_buf++ = tmp_buffer[k]; } else{ for ( s=0 ; s>6); } } } for ( j=0 ; j= 1208) #include #endif extern SDL_TimerID timer_bgmfade_id; extern "C" Uint32 SDLCALL bgmfadeCallback( Uint32 interval, void *param ); #define CONTINUOUS_PLAY int ONScripter::yesnoboxCommand() { bool yesno_flag = true; if ( script_h.isName( "okcancelbox" ) ) yesno_flag = false; script_h.readInt(); script_h.pushVariable(); script_h.readStr(); const char *mes1 = script_h.saveStringBuffer(); const char *mes2 = script_h.readStr(); ButtonLink *tmp_button_link = root_button_link.next; root_button_link.next = NULL; buildDialog(yesno_flag, mes1, mes2); show_dialog_flag = true; dirty_rect.add(dialog_info.pos); flush(refreshMode()); while(1){ event_mode = WAIT_BUTTON_MODE; waitEvent(-1); if (current_button_state.button == -1 || current_button_state.button == 2){ script_h.setInt(&script_h.pushed_variable, 0); break; } else if (current_button_state.button == 1){ script_h.setInt(&script_h.pushed_variable, 1); break; } } show_dialog_flag = false; delete root_button_link.next->next; delete root_button_link.next; root_button_link.next = tmp_button_link; dirty_rect.add(dialog_info.pos); flush(refreshMode()); return RET_CONTINUE; } int ONScripter::wavestopCommand() { if ( wave_sample[MIX_WAVE_CHANNEL] ){ Mix_Pause( MIX_WAVE_CHANNEL ); Mix_FreeChunk( wave_sample[MIX_WAVE_CHANNEL] ); wave_sample[MIX_WAVE_CHANNEL] = NULL; } setStr( &wave_file_name, NULL ); return RET_CONTINUE; } int ONScripter::waveCommand() { wave_play_loop_flag = false; if (script_h.isName( "waveloop" )) wave_play_loop_flag = true; wavestopCommand(); setStr(&wave_file_name, script_h.readStr()); playSound(wave_file_name, SOUND_CHUNK, wave_play_loop_flag, MIX_WAVE_CHANNEL); return RET_CONTINUE; } int ONScripter::waittimerCommand() { int count = script_h.readInt() + internal_timer - SDL_GetTicks(); if (count < 0) count = 0; event_mode = WAIT_TIMER_MODE; waitEvent( count ); return RET_CONTINUE; } int ONScripter::waitCommand() { event_mode = WAIT_TIMER_MODE; waitEvent( script_h.readInt() ); return RET_CONTINUE; } int ONScripter::vspCommand() { leaveTextDisplayMode(); bool vsp2_flag = false; if (script_h.isName("vsp2")) vsp2_flag = true; int no = script_h.readInt(); int v = script_h.readInt(); if (vsp2_flag){ sprite2_info[no].visible = (v==1)?true:false; dirty_rect.add( sprite2_info[no].bounding_rect ); } else{ sprite_info[no].visible = (v==1)?true:false; dirty_rect.add( sprite_info[no].pos ); } return RET_CONTINUE; } int ONScripter::voicevolCommand() { voice_volume = script_h.readInt(); if ( wave_sample[0] ) Mix_Volume( 0, voice_volume * MIX_MAX_VOLUME / 100 ); return RET_CONTINUE; } int ONScripter::vCommand() { char buf[256]; sprintf(buf, RELATIVEPATH "wav%c%s.wav", DELIMITER, script_h.getStringBuffer()+1); playSound(buf, SOUND_CHUNK, false, MIX_WAVE_CHANNEL); return RET_CONTINUE; } int ONScripter::trapCommand() { bool is_clicked = trap_mode & TRAP_CLICKED; if ( script_h.isName( "lr_trap" ) ){ trap_mode = TRAP_LEFT_CLICK | TRAP_RIGHT_CLICK; } else if ( script_h.isName( "r_trap" ) ){ trap_mode = TRAP_RIGHT_CLICK; } else if ( script_h.isName( "trap" ) ){ trap_mode = TRAP_LEFT_CLICK; } if ( script_h.compareString("off") ){ script_h.readLabel(); trap_mode = TRAP_NONE; return RET_CONTINUE; } else if ( script_h.compareString("stop") ){ script_h.readLabel(); trap_mode |= TRAP_STOP; return RET_CONTINUE; } else if ( script_h.compareString("resume") ){ script_h.readLabel(); if (is_clicked) trapHandler(); return RET_CONTINUE; } const char *buf = script_h.readStr(); if ( buf[0] == '*' ){ setStr(&trap_dist, buf+1); } else{ printf("trapCommand: [%s] is not supported\n", buf ); } return RET_CONTINUE; } int ONScripter::transbtnCommand() { transbtn_flag = true; return RET_CONTINUE; } int ONScripter::textspeeddefaultCommand() { sentence_font.wait_time = -1; return RET_CONTINUE; } int ONScripter::textspeedCommand() { sentence_font.wait_time = script_h.readInt(); return RET_CONTINUE; } int ONScripter::textshowCommand() { dirty_rect.fill( screen_width, screen_height ); refresh_shadow_text_mode = REFRESH_NORMAL_MODE | REFRESH_SHADOW_MODE | REFRESH_TEXT_MODE; flush(refreshMode()); return RET_CONTINUE; } int ONScripter::textonCommand() { if (windowchip_sprite_no >= 0) sprite_info[windowchip_sprite_no].visible = true; enterTextDisplayMode(); text_on_flag = true; return RET_CONTINUE; } int ONScripter::textoffCommand() { if (windowchip_sprite_no >= 0) sprite_info[windowchip_sprite_no].visible = false; refreshSurface(backup_surface, NULL, REFRESH_NORMAL_MODE); leaveTextDisplayMode(true); text_on_flag = false; return RET_CONTINUE; } int ONScripter::texthideCommand() { dirty_rect.fill( screen_width, screen_height ); refresh_shadow_text_mode = REFRESH_NORMAL_MODE | REFRESH_SHADOW_MODE; flush(refreshMode()); return RET_CONTINUE; } int ONScripter::textcolorCommand() { readColor( &sentence_font.color, script_h.readStr() ); return RET_CONTINUE; } int ONScripter::textclearCommand() { newPage(); return RET_CONTINUE; } int ONScripter::texecCommand() { if ( textgosub_clickstr_state == CLICK_NEWPAGE ) newPage(); else if ( textgosub_clickstr_state == (CLICK_WAIT|CLICK_EOL) ){ processEOT(); page_enter_status = 0; } return RET_CONTINUE; } int ONScripter::tateyokoCommand() { sentence_font.setTateyokoMode( script_h.readInt() ); return RET_CONTINUE; } int ONScripter::talCommand() { leaveTextDisplayMode(); char loc = script_h.readLabel()[0]; int no = -1, trans = 0; if ( loc == 'l' ) no = 0; else if ( loc == 'c' ) no = 1; else if ( loc == 'r' ) no = 2; if (no >= 0) trans = script_h.readInt(); if (no >= 0){ tachi_info[ no ].trans = trans; dirty_rect.add( tachi_info[ no ].pos ); } EffectLink *el = parseEffect(true); if (setEffect(el, true, true)) return RET_CONTINUE; while (doEffect(el)); return RET_CONTINUE; } int ONScripter::tablegotoCommand() { int count = 0; int no = script_h.readInt(); while( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ const char *buf = script_h.readStr(); if ( count++ == no ){ setCurrentLabel( buf+1 ); break; } } return RET_CONTINUE; } int ONScripter::systemcallCommand() { system_menu_mode = getSystemCallNo( script_h.readLabel() ); executeSystemCall(); return RET_CONTINUE; } int ONScripter::strspCommand() { leaveTextDisplayMode(); bool v = true; if ( script_h.isName( "strsph" ) ) v = false; int sprite_no = script_h.readInt(); AnimationInfo *ai = &sprite_info[sprite_no]; ai->font_size_xy[0] = -1; if (ai->image_surface && ai->visible) dirty_rect.add( ai->pos ); ai->removeTag(); setStr(&ai->file_name, script_h.readStr()); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); FontInfo fi; fi.is_newline_accepted = true; fi.num_xy[0] = script_h.readInt(); fi.num_xy[1] = script_h.readInt(); fi.font_size_xy[0] = script_h.readInt(); fi.font_size_xy[1] = script_h.readInt(); fi.pitch_xy[0] = script_h.readInt() + fi.font_size_xy[0]; fi.pitch_xy[1] = script_h.readInt() + fi.font_size_xy[1]; fi.is_bold = script_h.readInt()?true:false; fi.is_shadow = script_h.readInt()?true:false; char *buffer = script_h.getNext(); while(script_h.getEndStatus() & ScriptHandler::END_COMMA){ ai->num_of_cells++; script_h.readStr(); } if (ai->num_of_cells == 0){ ai->num_of_cells = 1; ai->color_list = new uchar3[ai->num_of_cells]; ai->color_list[0][0] = ai->color_list[0][1] = ai->color_list[0][2] = 0xff; } else{ ai->color_list = new uchar3[ai->num_of_cells]; script_h.setCurrent(buffer); for (int i=0 ; inum_of_cells ; i++) readColor(&ai->color_list[i], script_h.readStr()); } ai->trans_mode = AnimationInfo::TRANS_STRING; ai->trans = -1; ai->visible = v; ai->is_single_line = false; ai->is_tight_region = false; ai->is_ruby_drawable = sentence_font.rubyon_flag; setupAnimationInfo(ai, &fi); if ( ai->visible ) dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::stopCommand() { mp3stopCommand(); wavestopCommand(); return RET_CONTINUE; } int ONScripter::sp_rgb_gradationCommand() { int no = script_h.readInt(); int upper_r = script_h.readInt(); int upper_g = script_h.readInt(); int upper_b = script_h.readInt(); int lower_r = script_h.readInt(); int lower_g = script_h.readInt(); int lower_b = script_h.readInt(); ONSBuf key_r = script_h.readInt(); ONSBuf key_g = script_h.readInt(); ONSBuf key_b = script_h.readInt(); Uint32 alpha = script_h.readInt(); AnimationInfo *ai; if (no == -1) ai = &sentence_font_info; else ai = &sprite_info[no]; SDL_Surface *surface = ai->image_surface; if (surface == NULL) return RET_CONTINUE; SDL_PixelFormat *fmt = surface->format; ONSBuf key_mask = (((key_r >> fmt->Rloss) << fmt->Rshift) | ((key_g >> fmt->Gloss) << fmt->Gshift) | ((key_b >> fmt->Bloss) << fmt->Bshift)); ONSBuf rgb_mask = fmt->Rmask | fmt->Gmask | fmt->Bmask; SDL_LockSurface(surface); // check upper and lower bound int i, j; int upper_bound=0, lower_bound=0; bool is_key_found = false; for (i=0 ; ih ; i++){ ONSBuf *buf = (ONSBuf *)surface->pixels + surface->w * i; for (j=0 ; jw ; j++, buf++){ if ((*buf & rgb_mask) == key_mask){ if (is_key_found == false){ is_key_found = true; upper_bound = lower_bound = i; } else{ lower_bound = i; } break; } } } // replace pixels of the key-color with the specified color in gradation for (i=upper_bound ; i<=lower_bound ; i++){ ONSBuf *buf = (ONSBuf *)surface->pixels + surface->w * i; #if defined(BPP16) unsigned char *alphap = ai->alpha_buf + surface->w * i; #else #if SDL_BYTEORDER == SDL_LIL_ENDIAN unsigned char *alphap = (unsigned char *)buf + 3; #else unsigned char *alphap = (unsigned char *)buf; #endif #endif Uint32 color = alpha << surface->format->Ashift; if (upper_bound != lower_bound){ color |= (((lower_r - upper_r) * (i-upper_bound) / (lower_bound - upper_bound) + upper_r) >> fmt->Rloss) << fmt->Rshift; color |= (((lower_g - upper_g) * (i-upper_bound) / (lower_bound - upper_bound) + upper_g) >> fmt->Gloss) << fmt->Gshift; color |= (((lower_b - upper_b) * (i-upper_bound) / (lower_bound - upper_bound) + upper_b) >> fmt->Bloss) << fmt->Bshift; } else{ color |= (upper_r >> fmt->Rloss) << fmt->Rshift; color |= (upper_g >> fmt->Gloss) << fmt->Gshift; color |= (upper_b >> fmt->Bloss) << fmt->Bshift; } for (j=0 ; jw ; j++, buf++){ if ((*buf & rgb_mask) == key_mask){ *buf = color; *alphap = alpha; } #if defined(BPP16) alphap++; #else alphap += 4; #endif } } SDL_UnlockSurface(surface); if ( ai->visible ) dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::spstrCommand() { decodeExbtnControl( script_h.readStr() ); return RET_CONTINUE; } int ONScripter::spreloadCommand() { int no = script_h.readInt(); AnimationInfo *ai; if (no == -1) ai = &sentence_font_info; else ai = &sprite_info[no]; parseTaggedString( ai ); setupAnimationInfo( ai ); if ( ai->visible ) dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::splitCommand() { script_h.readStr(); const char *save_buf = script_h.saveStringBuffer(); char delimiter = script_h.readStr()[0]; char token256[256], *token=NULL; while( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ unsigned int c=0; while(save_buf[c] != delimiter && save_buf[c] != '\0'){ if (IS_TWO_BYTE(save_buf[c])) c += 2; else c++; } if (c < 256) token = token256; else token = new char[c+1]; memcpy( token, save_buf, c ); token[c] = '\0'; script_h.readVariable(); if ( script_h.current_variable.type & ScriptHandler::VAR_INT || script_h.current_variable.type & ScriptHandler::VAR_ARRAY ){ script_h.setInt( &script_h.current_variable, atoi(token) ); } else if ( script_h.current_variable.type & ScriptHandler::VAR_STR ){ setStr( &script_h.getVariableData(script_h.current_variable.var_no).str, token ); } if (c >= 256) delete[] token; save_buf += c; if (save_buf[0] != '\0') save_buf++; } return RET_CONTINUE; } int ONScripter::spclclkCommand() { if ( !force_button_shortcut_flag ) spclclk_flag = true; return RET_CONTINUE; } int ONScripter::spbtnCommand() { bool cellcheck_flag = false; if ( script_h.isName( "cellcheckspbtn" ) ) cellcheck_flag = true; int sprite_no = script_h.readInt(); int no = script_h.readInt(); if (no < 1 || sprite_no < 0 || sprite_no >= MAX_SPRITE_NUM || sprite_info[sprite_no].image_surface == NULL) return RET_CONTINUE; if ( cellcheck_flag ){ if ( sprite_info[ sprite_no ].num_of_cells < 2 ) return RET_CONTINUE; } else{ if ( sprite_info[ sprite_no ].num_of_cells == 0 ) return RET_CONTINUE; } ButtonLink *button = new ButtonLink(); root_button_link.insert( button ); button->button_type = ButtonLink::SPRITE_BUTTON; button->sprite_no = sprite_no; button->no = no; if ( sprite_info[ sprite_no ].image_surface || sprite_info[ sprite_no ].trans_mode == AnimationInfo::TRANS_STRING ) button->image_rect = button->select_rect = sprite_info[ sprite_no ].pos; return RET_CONTINUE; } int ONScripter::skipoffCommand() { skip_mode &= ~SKIP_NORMAL; return RET_CONTINUE; } int ONScripter::sevolCommand() { se_volume = script_h.readInt(); for ( int i=1 ; iremove(); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->orig_pos.w = script_h.readInt() - ai->orig_pos.x + 1; ai->orig_pos.h = script_h.readInt() - ai->orig_pos.y + 1; ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->scalePosWH( screen_ratio1, screen_ratio2 ); } else{ ai->setImageName( buf ); parseTaggedString( ai ); setupAnimationInfo( ai ); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); sentence_font.is_transparent = false; sentence_font.window_color[0] = sentence_font.window_color[1] = sentence_font.window_color[2] = 0xff; } sentence_font.old_xy[0] = sentence_font.x(); sentence_font.old_xy[1] = sentence_font.y(); } int ONScripter::setwindow3Command() { setwindowCore(); clearCurrentPage(); indent_offset = 0; line_enter_status = 0; page_enter_status = 0; display_mode = DISPLAY_MODE_NORMAL; flush( refreshMode(), &sentence_font_info.pos ); return RET_CONTINUE; } int ONScripter::setwindow2Command() { const char *buf = script_h.readStr(); if ( buf[0] == '#' ){ sentence_font.is_transparent = true; readColor( &sentence_font.window_color, buf ); sentence_font_info.remove(); } else{ sentence_font.is_transparent = false; sentence_font_info.setImageName( buf ); parseTaggedString( &sentence_font_info ); setupAnimationInfo( &sentence_font_info ); } repaintCommand(); return RET_CONTINUE; } int ONScripter::setwindowCommand() { setwindowCore(); lookbackflushCommand(); indent_offset = 0; line_enter_status = 0; page_enter_status = 0; display_mode = DISPLAY_MODE_NORMAL; flush( refreshMode(), &sentence_font_info.pos ); return RET_CONTINUE; } int ONScripter::setcursorCommand() { bool abs_flag; if ( script_h.isName( "abssetcursor" ) ){ abs_flag = true; } else{ abs_flag = false; } int no = script_h.readInt(); script_h.readStr(); const char* buf = script_h.saveStringBuffer(); int x = script_h.readInt(); int y = script_h.readInt(); loadCursor( no, buf, x, y, abs_flag ); return RET_CONTINUE; } int ONScripter::selectCommand() { enterTextDisplayMode(); int select_mode = SELECT_GOTO_MODE; SelectLink *last_select_link; if ( script_h.isName( "selnum" ) ) select_mode = SELECT_NUM_MODE; else if ( script_h.isName( "selgosub" ) ) select_mode = SELECT_GOSUB_MODE; else if ( script_h.isName( "select" ) ) select_mode = SELECT_GOTO_MODE; else if ( script_h.isName( "csel" ) ) select_mode = SELECT_CSEL_MODE; if ( select_mode == SELECT_NUM_MODE ){ script_h.readVariable(); script_h.pushVariable(); } bool comma_flag = true; if ( select_mode == SELECT_CSEL_MODE ){ saveoffCommand(); } shortcut_mouse_line = -1; int xy[2]; xy[0] = sentence_font.xy[0]; xy[1] = sentence_font.xy[1]; if ( selectvoice_file_name[SELECTVOICE_OPEN] ) playSound(selectvoice_file_name[SELECTVOICE_OPEN], SOUND_CHUNK, false, MIX_WAVE_CHANNEL ); last_select_link = &root_select_link; while(1){ if ( script_h.getNext()[0] != 0x0a && comma_flag == true ){ const char *buf = script_h.readStr(); comma_flag = (script_h.getEndStatus() & ScriptHandler::END_COMMA); if ( select_mode != SELECT_NUM_MODE && !comma_flag ) errorAndExit( "select: missing comma." ); // Text part SelectLink *slink = new SelectLink(); setStr( &slink->text, buf ); //printf("Select text %s\n", slink->text); // Label part if (select_mode != SELECT_NUM_MODE){ script_h.readStr(); setStr( &slink->label, script_h.getStringBuffer()+1 ); //printf("Select label %s\n", slink->label ); } last_select_link->next = slink; last_select_link = last_select_link->next; comma_flag = (script_h.getEndStatus() & ScriptHandler::END_COMMA); //printf("2 comma %d %c %x\n", comma_flag, script_h.getCurrent()[0], script_h.getCurrent()[0]); } else if (script_h.getNext()[0] == 0x0a){ //printf("comma %d\n", comma_flag); char *buf = script_h.getNext() + 1; // consume eol while ( *buf == ' ' || *buf == '\t' ) buf++; if (comma_flag && *buf == ',') errorAndExit( "select: double comma." ); bool comma2_flag = false; if (*buf == ','){ comma2_flag = true; buf++; while ( *buf == ' ' || *buf == '\t' ) buf++; } script_h.setCurrent(buf); if (*buf == 0x0a){ comma_flag |= comma2_flag; continue; } if (!comma_flag && !comma2_flag){ select_label_info.next_script = buf; //printf("select: stop at the end of line\n"); break; } //printf("continue\n"); comma_flag = true; } else{ // if select ends at the middle of the line select_label_info.next_script = script_h.getNext(); //printf("select: stop at the middle of the line\n"); break; } } if ( select_mode != SELECT_CSEL_MODE ){ last_select_link = root_select_link.next; int counter = 1; while( last_select_link ){ if ( *last_select_link->text ){ ButtonLink *button = getSelectableSentence( last_select_link->text, &sentence_font ); root_button_link.insert( button ); button->no = counter; } counter++; last_select_link = last_select_link->next; } } if ( select_mode == SELECT_CSEL_MODE ){ setCurrentLabel( "customsel" ); return RET_CONTINUE; } automode_flag = false; sentence_font.xy[0] = xy[0]; sentence_font.xy[1] = xy[1]; flush( refreshMode() ); refreshMouseOverButton(); event_mode = WAIT_TEXT_MODE | WAIT_BUTTON_MODE | WAIT_TIMER_MODE; do{ skip_mode &= ~SKIP_NORMAL; if (waitEvent(-1)) return RET_CONTINUE; } while(current_button_state.button <= 0 || skip_mode & SKIP_NORMAL); if ( selectvoice_file_name[SELECTVOICE_SELECT] ) playSound(selectvoice_file_name[SELECTVOICE_SELECT], SOUND_CHUNK, false, MIX_WAVE_CHANNEL ); deleteButtonLink(); int counter = 1; last_select_link = root_select_link.next; while ( last_select_link ){ if ( current_button_state.button == counter++ ) break; last_select_link = last_select_link->next; } if ( select_mode == SELECT_GOTO_MODE ){ setCurrentLabel( last_select_link->label ); } else if ( select_mode == SELECT_GOSUB_MODE ){ gosubReal( last_select_link->label, select_label_info.next_script ); } else{ // selnum script_h.setInt( &script_h.pushed_variable, current_button_state.button - 1 ); current_label_info = script_h.getLabelByAddress( select_label_info.next_script ); current_line = script_h.getLineByAddress( select_label_info.next_script ); script_h.setCurrent( select_label_info.next_script ); } deleteSelectLink(); newPage(); return RET_CONTINUE; } int ONScripter::savetimeCommand() { int no = script_h.readInt(); SaveFileInfo info; searchSaveFile( info, no ); script_h.readVariable(); if ( !info.valid ){ script_h.setInt( &script_h.current_variable, 0 ); for ( int i=0 ; i<3 ; i++ ) script_h.readVariable(); return RET_CONTINUE; } script_h.setInt( &script_h.current_variable, info.month ); script_h.readInt(); script_h.setInt( &script_h.current_variable, info.day ); script_h.readInt(); script_h.setInt( &script_h.current_variable, info.hour ); script_h.readInt(); script_h.setInt( &script_h.current_variable, info.minute ); return RET_CONTINUE; } int ONScripter::savescreenshotCommand() { if ( script_h.isName( "savescreenshot" ) ){ } else if ( script_h.isName( "savescreenshot2" ) ){ } const char *buf = script_h.readStr(); char filename[256]; sprintf( filename, "%s%s", archive_path, buf ); for ( unsigned int i=0 ; ipos ); delete prnum_info[i]; prnum_info[i] = NULL; } } return RET_CONTINUE; } int ONScripter::prnumCommand() { leaveTextDisplayMode(); int no = script_h.readInt(); if (no < 0 || no >= MAX_PARAM_NUM){ script_h.readInt(); script_h.readInt(); script_h.readInt(); script_h.readInt(); script_h.readInt(); script_h.readStr(); return RET_CONTINUE; } if ( prnum_info[no] ){ dirty_rect.add( prnum_info[no]->pos ); delete prnum_info[no]; } AnimationInfo *ai = prnum_info[no] = new AnimationInfo(); ai->trans_mode = AnimationInfo::TRANS_STRING; ai->num_of_cells = 1; ai->setCell(0); ai->color_list = new uchar3[ ai->num_of_cells ]; ai->param = script_h.readInt(); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->font_size_xy[0] = script_h.readInt(); ai->font_size_xy[1] = script_h.readInt(); ai->font_pitch[0] = ai->font_size_xy[0]; ai->font_pitch[1] = ai->font_size_xy[1]; const char *buf = script_h.readStr(); readColor( &ai->color_list[0], buf ); char num_buf[7]; script_h.getStringFromInteger( num_buf, ai->param, 3 ); setStr( &ai->file_name, num_buf ); setupAnimationInfo( ai ); dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::printCommand() { leaveTextDisplayMode(); EffectLink *el = parseEffect(true); if (setEffect(el, true, true)) return RET_CONTINUE; while (doEffect(el)); return RET_CONTINUE; } int ONScripter::playstopCommand() { stopBGM( false ); return RET_CONTINUE; } int ONScripter::playCommand() { bool loop_flag = true; if ( script_h.isName( "playonce" ) ) loop_flag = false; const char *buf = script_h.readStr(); if ( buf[0] == '*' ){ cd_play_loop_flag = loop_flag; int new_cd_track = atoi( buf + 1 ); #ifdef CONTINUOUS_PLAY if ( current_cd_track != new_cd_track ) { #endif stopBGM( false ); current_cd_track = new_cd_track; playCDAudio(); #ifdef CONTINUOUS_PLAY } #endif } else{ // play MIDI stopBGM( false ); setStr(&midi_file_name, buf); midi_play_loop_flag = loop_flag; if (playSound(midi_file_name, SOUND_MIDI, midi_play_loop_flag) != SOUND_MIDI){ fprintf(stderr, "can't play MIDI file %s\n", midi_file_name); } } return RET_CONTINUE; } int ONScripter::ofscopyCommand() { #ifdef USE_SDL_RENDERER SDL_Surface *tmp_surface = AnimationInfo::alloc32bitSurface( screen_device_width, screen_device_height, texture_format ); SDL_Rect rect = {(device_width -screen_device_width)/2, (device_height-screen_device_height)/2, screen_device_width, screen_device_height}; SDL_LockSurface(tmp_surface); SDL_RenderReadPixels(renderer, &rect, tmp_surface->format->format, tmp_surface->pixels, tmp_surface->pitch); SDL_UnlockSurface(tmp_surface); resizeSurface( tmp_surface, accumulation_surface ); SDL_FreeSurface(tmp_surface); #else SDL_BlitSurface(screen_surface, NULL, accumulation_surface, NULL); #endif return RET_CONTINUE; } int ONScripter::negaCommand() { nega_mode = script_h.readInt(); dirty_rect.fill( screen_width, screen_height ); return RET_CONTINUE; } int ONScripter::mspCommand() { leaveTextDisplayMode(); bool msp2_flag = false; if (script_h.isName("msp2")) msp2_flag = true; int no = script_h.readInt(); AnimationInfo *ai = NULL; if (msp2_flag) { ai = &sprite2_info[no]; dirty_rect.add( ai->bounding_rect ); } else{ ai = &sprite_info[no]; dirty_rect.add( ai->pos ); } ai->orig_pos.x += script_h.readInt(); ai->orig_pos.y += script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); if (msp2_flag){ ai->scale_x += script_h.readInt(); ai->scale_y += script_h.readInt(); ai->rot += script_h.readInt(); ai->calcAffineMatrix(); dirty_rect.add( ai->bounding_rect ); } else{ dirty_rect.add( ai->pos ); } if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ if (ai->trans == -1) ai->trans = 255 + script_h.readInt(); else ai->trans += script_h.readInt(); if (ai->trans < 0) ai->trans = 0; else if (ai->trans > 255) ai->trans = 255; } return RET_CONTINUE; } int ONScripter::mpegplayCommand() { script_h.readStr(); const char *save_buf = script_h.saveStringBuffer(); bool click_flag = (script_h.readInt()==1)?true:false; stopBGM( false ); if (playMPEG( save_buf, click_flag )) endCommand(); repaintCommand(); return RET_CONTINUE; } int ONScripter::mp3volCommand() { music_volume = script_h.readInt(); Mix_VolumeMusic( music_volume * MIX_MAX_VOLUME / 100 ); return RET_CONTINUE; } int ONScripter::mp3stopCommand() { if (Mix_PlayingMusic() == 1 && timer_bgmfade_id && mp3fadeout_duration_internal > 0) // already in fadeout return RET_CONTINUE; if (Mix_PlayingMusic() == 1 && mp3fadeout_duration > 0){ // do a bgm fadeout Mix_HookMusicFinished( NULL ); mp3fadeout_duration_internal = mp3fadeout_duration; mp3fade_start = SDL_GetTicks(); timer_bgmfade_id = SDL_AddTimer(20, bgmfadeCallback, 0); setStr(&fadeout_music_file_name, music_file_name); char *ext = NULL; if (music_file_name) ext = strrchr(music_file_name, '.'); if (ext && (!strcmp(ext+1, "OGG") || !strcmp(ext+1, "ogg"))){ // do not wait until fadout is finished when playing ogg event_mode = IDLE_EVENT_MODE; waitEvent(0); setStr( &music_file_name, NULL ); // to ensure not to play music during fadeout return RET_CONTINUE; } else{ // wait until fadout is finished when playing music other than ogg event_mode = WAIT_TIMER_MODE; waitEvent(-1); } } stopBGM( false ); return RET_CONTINUE; } int ONScripter::mp3fadeoutCommand() { mp3fadeout_duration = script_h.readInt(); return RET_CONTINUE; } int ONScripter::mp3fadeinCommand() { mp3fadein_duration = script_h.readInt(); return RET_CONTINUE; } int ONScripter::mp3Command() { bool loop_flag = false; if ( script_h.isName( "mp3save" ) ){ mp3save_flag = true; } else if ( script_h.isName( "bgmonce" ) ){ mp3save_flag = false; } else if ( script_h.isName( "mp3loop" ) || script_h.isName( "bgm" ) ){ mp3save_flag = true; loop_flag = true; } else{ mp3save_flag = false; } mp3stopCommand(); stopBGM( false ); music_play_loop_flag = loop_flag; music_loopback_offset = 0.0; const char *buf = script_h.readStr(); if (buf[0] != '\0'){ if (buf[0]=='('){ buf++; bool integer_flag = true; double decimal = 0.1; while (*buf != ')' && *buf != '\0'){ if (*buf >= '0' && *buf <= '9'){ if (integer_flag) music_loopback_offset = music_loopback_offset*10.0 + *buf - '0'; else{ music_loopback_offset += decimal*(*buf - '0'); decimal *= 0.1; } } else if (*buf == '.') integer_flag = false; buf++; } if (*buf == ')') buf++; } int tmp = music_volume; setStr(&music_file_name, buf); if (mp3fadein_duration > 0) music_volume = 0; playSound(music_file_name, SOUND_MUSIC | SOUND_MIDI | SOUND_CHUNK, music_play_loop_flag, MIX_BGM_CHANNEL); music_volume = tmp; if (mp3fadein_duration > 0) { // do a bgm fadein mp3fadein_duration_internal = mp3fadein_duration; mp3fade_start = SDL_GetTicks(); timer_bgmfade_id = SDL_AddTimer(20, bgmfadeCallback, (void*)&timer_bgmfade_id); char *ext = NULL; if (music_file_name) ext = strrchr(music_file_name, '.'); if (ext && (!strcmp(ext+1, "OGG") || !strcmp(ext+1, "ogg"))){ // do not wait until fadin is finished when playing ogg event_mode = IDLE_EVENT_MODE; waitEvent(0); } else{ // wait until fadin is finished when playing music other than ogg event_mode = WAIT_TIMER_MODE; waitEvent(-1); } } } return RET_CONTINUE; } int ONScripter::movieCommand() { if (script_h.compareString("stop")){ script_h.readLabel(); fprintf(stderr, " [movie stop] is not supported yet!!\n"); return RET_CONTINUE; } script_h.readStr(); const char *filename = script_h.saveStringBuffer(); stopBGM(false); bool click_flag = false; bool loop_flag = false; while (script_h.getEndStatus() & ScriptHandler::END_COMMA){ if (script_h.compareString("pos")){ // not supported yet script_h.readLabel(); script_h.readInt(); script_h.readInt(); script_h.readInt(); script_h.readInt(); fprintf(stderr, " [movie pos] is not supported yet!!\n"); } else if (script_h.compareString("click")){ script_h.readLabel(); click_flag = true; } else if (script_h.compareString("loop")){ script_h.readLabel(); loop_flag = true; } else if (script_h.compareString("async")){ // not supported yet script_h.readLabel(); fprintf(stderr, " [movie async] is not supported yet!!\n"); } else{ script_h.readLabel(); } } if (playMPEG(filename, click_flag, loop_flag)) endCommand(); return RET_CONTINUE; } int ONScripter::movemousecursorCommand() { int x = script_h.readInt() * screen_ratio1 / screen_ratio2; int y = script_h.readInt() * screen_ratio1 / screen_ratio2; x = x * screen_device_width / screen_width; y = y * screen_device_width / screen_width; SDL_WarpMouse(x, y); return RET_CONTINUE; } int ONScripter::monocroCommand() { if ( script_h.compareString( "off" ) ){ script_h.readLabel(); monocro_flag = false; } else{ monocro_flag = true; readColor( &monocro_color, script_h.readStr() ); for (int i=0 ; i<256 ; i++){ monocro_color_lut[i][0] = (monocro_color[0] * i) >> 8; monocro_color_lut[i][1] = (monocro_color[1] * i) >> 8; monocro_color_lut[i][2] = (monocro_color[2] * i) >> 8; } } dirty_rect.fill( screen_width, screen_height ); return RET_CONTINUE; } int ONScripter::menu_windowCommand() { if ( fullscreen_mode ){ #if !defined(PSP) if ( !SDL_WM_ToggleFullScreen( screen_surface ) ){ screen_surface = SDL_SetVideoMode( screen_device_width, screen_device_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG ); flushDirect( screen_rect, refreshMode() ); } #endif fullscreen_mode = false; } return RET_CONTINUE; } int ONScripter::menu_fullCommand() { if ( !fullscreen_mode ){ #if !defined(PSP) if ( !SDL_WM_ToggleFullScreen( screen_surface ) ){ screen_surface = SDL_SetVideoMode( screen_device_width, screen_device_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG|SDL_FULLSCREEN ); flushDirect( screen_rect, refreshMode() ); } #endif fullscreen_mode = true; } return RET_CONTINUE; } int ONScripter::menu_click_pageCommand() { skip_mode |= SKIP_TO_EOP; return RET_CONTINUE; } int ONScripter::menu_click_defCommand() { skip_mode &= ~SKIP_TO_EOP; return RET_CONTINUE; } int ONScripter::menu_automodeCommand() { automode_flag = true; skip_mode &= ~SKIP_NORMAL; printf("menu_automode: change to automode\n"); return RET_CONTINUE; } int ONScripter::lsp2Command() { leaveTextDisplayMode(); bool v=true; if ( script_h.isName( "lsph2" ) || script_h.isName( "lsph2add" ) || script_h.isName( "lsph2sub" )) v = false; int blend_mode = AnimationInfo::BLEND_NORMAL; if ( script_h.isName( "lsp2add" ) || script_h.isName( "lsph2add" )) blend_mode = AnimationInfo::BLEND_ADD; else if ( script_h.isName( "lsp2sub" ) || script_h.isName( "lsph2sub" )) blend_mode = AnimationInfo::BLEND_SUB; int no = script_h.readInt(); AnimationInfo *ai = &sprite2_info[no]; if (ai->image_surface && ai->visible) dirty_rect.add( ai->bounding_rect ); ai->visible = v; ai->blending_mode = blend_mode; const char *buf = script_h.readStr(); ai->setImageName( buf ); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->scale_x = script_h.readInt(); ai->scale_y = script_h.readInt(); ai->rot = script_h.readInt(); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ) ai->trans = script_h.readInt(); else ai->trans = -1; parseTaggedString( ai ); setupAnimationInfo( ai ); ai->calcAffineMatrix(); if ( ai->visible ) dirty_rect.add( ai->bounding_rect ); return RET_CONTINUE; } int ONScripter::lspCommand() { leaveTextDisplayMode(); bool v=true; if ( script_h.isName( "lsph" ) ) v = false; int no = script_h.readInt(); AnimationInfo *ai = &sprite_info[no]; if (ai->image_surface && ai->visible) dirty_rect.add( ai->pos ); ai->visible = v; const char *buf = script_h.readStr(); ai->setImageName( buf ); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ) ai->trans = script_h.readInt(); else ai->trans = -1; parseTaggedString( ai ); setupAnimationInfo( ai ); if ( ai->visible ) dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::loopbgmstopCommand() { if ( wave_sample[MIX_LOOPBGM_CHANNEL0] ){ Mix_Pause(MIX_LOOPBGM_CHANNEL0); Mix_FreeChunk( wave_sample[MIX_LOOPBGM_CHANNEL0] ); wave_sample[MIX_LOOPBGM_CHANNEL0] = NULL; } if ( wave_sample[MIX_LOOPBGM_CHANNEL1] ){ Mix_Pause(MIX_LOOPBGM_CHANNEL1); Mix_FreeChunk( wave_sample[MIX_LOOPBGM_CHANNEL1] ); wave_sample[MIX_LOOPBGM_CHANNEL1] = NULL; } setStr(&loop_bgm_name[0], NULL); return RET_CONTINUE; } int ONScripter::loopbgmCommand() { const char *buf = script_h.readStr(); setStr( &loop_bgm_name[0], buf ); buf = script_h.readStr(); setStr( &loop_bgm_name[1], buf ); playSound(loop_bgm_name[1], SOUND_PRELOAD|SOUND_CHUNK, false, MIX_LOOPBGM_CHANNEL1); playSound(loop_bgm_name[0], SOUND_CHUNK, false, MIX_LOOPBGM_CHANNEL0); return RET_CONTINUE; } int ONScripter::lookbackflushCommand() { current_page = current_page->next; for ( int i=0 ; itext_count = 0; current_page = current_page->next; } clearCurrentPage(); start_page = current_page; return RET_CONTINUE; } int ONScripter::lookbackbuttonCommand() { for ( int i=0 ; i<4 ; i++ ){ const char *buf = script_h.readStr(); setStr( &lookback_info[i].image_name, buf ); parseTaggedString( &lookback_info[i] ); setupAnimationInfo( &lookback_info[i] ); } return RET_CONTINUE; } int ONScripter::logspCommand() { leaveTextDisplayMode(); bool logsp2_flag = false; if ( script_h.isName( "logsp2" ) ) logsp2_flag = true; int no = script_h.readInt(); AnimationInfo *ai = &sprite_info[no]; if (ai->image_surface && ai->visible) dirty_rect.add( ai->pos ); ai->remove(); setStr( &ai->file_name, script_h.readStr() ); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->trans_mode = AnimationInfo::TRANS_STRING; if (logsp2_flag){ ai->font_size_xy[0] = script_h.readInt(); ai->font_size_xy[1] = script_h.readInt(); ai->font_pitch[0] = script_h.readInt() + ai->font_size_xy[0]; ai->font_pitch[1] = script_h.readInt() + ai->font_size_xy[1]; } else{ ai->font_size_xy[0] = sentence_font.font_size_xy[0]; ai->font_size_xy[1] = sentence_font.font_size_xy[1]; ai->font_pitch[0] = sentence_font.pitch_xy[0]; ai->font_pitch[1] = sentence_font.pitch_xy[1]; } char *current = script_h.getNext(); int num = 0; while(script_h.getEndStatus() & ScriptHandler::END_COMMA){ script_h.readStr(); num++; } script_h.setCurrent(current); if (num == 0){ ai->num_of_cells = 1; ai->color_list = new uchar3[ ai->num_of_cells ]; readColor( &ai->color_list[0], "#ffffff" ); } else{ ai->num_of_cells = num; ai->color_list = new uchar3[ ai->num_of_cells ]; for (int i=0 ; icolor_list[i], script_h.readStr() ); } } ai->is_single_line = false; ai->is_tight_region = false; ai->is_ruby_drawable = sentence_font.rubyon_flag; sentence_font.is_newline_accepted = true; setupAnimationInfo( ai ); sentence_font.is_newline_accepted = false; ai->visible = true; dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::locateCommand() { int x = script_h.readInt(); int y = script_h.readInt(); sentence_font.setXY( x, y ); return RET_CONTINUE; } int ONScripter::loadgameCommand() { int no = script_h.readInt(); int fadeout = mp3fadeout_duration; mp3fadeout_duration = 0; //don't use fadeout during a load if ( !loadSaveFile( no ) ){ dirty_rect.fill( screen_width, screen_height ); refreshSurface(backup_surface, &dirty_rect.bounding_box, REFRESH_NORMAL_MODE); flush( refreshMode() ); saveon_flag = true; internal_saveon_flag = true; skip_mode &= ~SKIP_NORMAL; automode_flag = false; deleteButtonLink(); deleteSelectLink(); text_on_flag = false; indent_offset = 0; line_enter_status = 0; page_enter_status = 0; string_buffer_offset = 0; break_flag = false; flushEvent(); if (loadgosub_label) gosubReal( loadgosub_label, script_h.getCurrent() ); } mp3fadeout_duration = fadeout; return RET_CONTINUE; } int ONScripter::ldCommand() { leaveTextDisplayMode(); char loc = script_h.readLabel()[0]; int no = -1; if (loc == 'l') no = 0; else if (loc == 'c') no = 1; else if (loc == 'r') no = 2; const char *buf = NULL; if (no >= 0) buf = script_h.readStr(); if (no >= 0){ AnimationInfo *ai = &tachi_info[no]; if (ai->image_surface) dirty_rect.add( ai->pos ); ai->setImageName( buf ); parseTaggedString( ai ); setupAnimationInfo( ai ); if ( ai->image_surface ){ ai->visible = true; ai->orig_pos.x = screen_width * (no+1) * screen_ratio2 / (4 * screen_ratio1) - ai->orig_pos.w / 2; ai->orig_pos.y = underline_value - ai->image_surface->h * screen_ratio2 / screen_ratio1; ai->scalePosXY( screen_ratio1, screen_ratio2 ); dirty_rect.add( ai->pos ); } } EffectLink *el = parseEffect(true); if (setEffect(el, true, true)) return RET_CONTINUE; while (doEffect(el)); return RET_CONTINUE; } int ONScripter::kinsokuCommand() { if (script_h.compareString("on")){ is_kinsoku = true; script_h.readLabel(); } else if (script_h.compareString("off")){ is_kinsoku = false; script_h.readLabel(); } return RET_CONTINUE; } int ONScripter::jumpfCommand() { char *buf = script_h.getNext(); while(*buf != '\0' && *buf != '~') buf++; if (*buf == '~') buf++; script_h.setCurrent(buf); current_label_info = script_h.getLabelByAddress(buf); current_line = script_h.getLineByAddress(buf); return RET_CONTINUE; } int ONScripter::jumpbCommand() { script_h.setCurrent( last_tilde.next_script ); current_label_info = script_h.getLabelByAddress( last_tilde.next_script ); current_line = script_h.getLineByAddress( last_tilde.next_script ); return RET_CONTINUE; } int ONScripter::ispageCommand() { script_h.readInt(); if ( textgosub_clickstr_state == CLICK_NEWPAGE ) script_h.setInt( &script_h.current_variable, 1 ); else script_h.setInt( &script_h.current_variable, 0 ); return RET_CONTINUE; } int ONScripter::isfullCommand() { script_h.readInt(); script_h.setInt( &script_h.current_variable, fullscreen_mode?1:0 ); return RET_CONTINUE; } int ONScripter::isskipCommand() { script_h.readInt(); if ( automode_flag ) script_h.setInt( &script_h.current_variable, 2 ); else if ( skip_mode & SKIP_NORMAL ) script_h.setInt( &script_h.current_variable, 1 ); else script_h.setInt( &script_h.current_variable, 0 ); return RET_CONTINUE; } int ONScripter::isdownCommand() { script_h.readInt(); if ( current_button_state.down_flag ) script_h.setInt( &script_h.current_variable, 1 ); else script_h.setInt( &script_h.current_variable, 0 ); return RET_CONTINUE; } int ONScripter::inputCommand() { script_h.readStr(); if ( script_h.current_variable.type != ScriptHandler::VAR_STR ) errorAndExit( "input: no string variable." ); int no = script_h.current_variable.var_no; script_h.readStr(); // description const char *buf = script_h.readStr(); // default value setStr( &script_h.getVariableData(no).str, buf ); printf( "*** inputCommand(): $%d is set to the default value: %s\n", no, buf ); script_h.readInt(); // maxlen script_h.readInt(); // widechar flag if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ script_h.readInt(); // window width script_h.readInt(); // window height script_h.readInt(); // text box width script_h.readInt(); // text box height } return RET_CONTINUE; } int ONScripter::indentCommand() { indent_offset = script_h.readInt(); return RET_CONTINUE; } int ONScripter::humanorderCommand() { leaveTextDisplayMode(); const char *buf = script_h.readStr(); int i; for (i=0 ; i<3 ; i++){ if (buf[i] == 'l') human_order[i] = 0; else if (buf[i] == 'c') human_order[i] = 1; else if (buf[i] == 'r') human_order[i] = 2; else human_order[i] = -1; } for ( i=0 ; i<3 ; i++ ) if (tachi_info[i].image_surface) dirty_rect.add( tachi_info[i].pos ); EffectLink *el = parseEffect(true); if (setEffect(el, true, true)) return RET_CONTINUE; while (doEffect(el)); return RET_CONTINUE; } int ONScripter::getzxcCommand() { getzxc_flag = true; return RET_CONTINUE; } int ONScripter::getvoicevolCommand() { script_h.readInt(); script_h.setInt( &script_h.current_variable, voice_volume ); return RET_CONTINUE; } int ONScripter::getversionCommand() { script_h.readInt(); script_h.setInt( &script_h.current_variable, NSC_VERSION ); return RET_CONTINUE; } int ONScripter::gettimerCommand() { bool gettimer_flag=false; if ( script_h.isName( "gettimer" ) ){ gettimer_flag = true; } else if ( script_h.isName( "getbtntimer" ) ){ } script_h.readInt(); if ( gettimer_flag ){ script_h.setInt( &script_h.current_variable, SDL_GetTicks() - internal_timer ); } else{ script_h.setInt( &script_h.current_variable, btnwait_time ); } return RET_CONTINUE; } int ONScripter::gettextCommand() { script_h.readStr(); int no = script_h.current_variable.var_no; char *buf = new char[ current_page->text_count + 1 ]; int i, j; for ( i=0, j=0 ; itext_count ; i++ ){ if ( current_page->text[i] != 0x0a ) buf[j++] = current_page->text[i]; } buf[j] = '\0'; setStr( &script_h.getVariableData(no).str, buf ); delete[] buf; return RET_CONTINUE; } int ONScripter::gettaglogCommand() { script_h.readVariable(); script_h.pushVariable(); int page_no = script_h.readInt(); Page *page = current_page; while(page != start_page && page_no > 0){ page_no--; page = page->previous; } if (page->tag) setStr(&script_h.getVariableData(script_h.pushed_variable.var_no).str, page->tag); else setStr(&script_h.getVariableData(script_h.pushed_variable.var_no).str, NULL); return RET_CONTINUE; } int ONScripter::gettagCommand() { if ( !last_nest_info->previous || last_nest_info->nest_mode != NestInfo::LABEL ) errorAndExit( "gettag: not in a subroutine, i.e. pretextgosub" ); char *buf = pretext_buf; if (buf[0] == '[') buf++; else if (zenkakko_flag && buf[0] == "¡Ú"[0] && buf[1] == "¡Ú"[1]) buf += 2; else buf = NULL; int end_status; do{ script_h.readVariable(); end_status = script_h.getEndStatus(); script_h.pushVariable(); if ( script_h.pushed_variable.type & ScriptHandler::VAR_INT || script_h.pushed_variable.type & ScriptHandler::VAR_ARRAY ){ if (buf) script_h.setInt( &script_h.pushed_variable, script_h.parseIntExpression(&buf)); else script_h.setInt( &script_h.pushed_variable, 0); } else if ( script_h.pushed_variable.type & ScriptHandler::VAR_STR ){ if (buf){ const char *buf_start = buf; while(*buf != '/' && *buf != 0 && *buf != ']' && (!zenkakko_flag || buf[0] != "¡Û"[0] || buf[1] != "¡Û"[1])){ if (IS_TWO_BYTE(*buf)) buf += 2; else buf++; } setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, buf_start, buf-buf_start ); } else{ setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, NULL); } } if (buf) pretext_buf = buf; if (buf && *buf == '/') buf++; else buf = NULL; } while(end_status & ScriptHandler::END_COMMA); if (pretext_buf[0] == ']') pretext_buf++; else if (zenkakko_flag && pretext_buf[0] == "¡Û"[0] && pretext_buf[1] == "¡Û"[1]) pretext_buf += 2; return RET_CONTINUE; } int ONScripter::gettabCommand() { gettab_flag = true; return RET_CONTINUE; } int ONScripter::getspsizeCommand() { int no = script_h.readInt(); script_h.readVariable(); script_h.setInt( &script_h.current_variable, sprite_info[no].orig_pos.w ); script_h.readVariable(); script_h.setInt( &script_h.current_variable, sprite_info[no].orig_pos.h ); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ script_h.readVariable(); script_h.setInt( &script_h.current_variable, sprite_info[no].num_of_cells ); } return RET_CONTINUE; } int ONScripter::getspposCommand() { int no = script_h.readInt(); script_h.readVariable(); script_h.setInt( &script_h.current_variable, sprite_info[no].orig_pos.x ); script_h.readVariable(); script_h.setInt( &script_h.current_variable, sprite_info[no].orig_pos.y ); return RET_CONTINUE; } int ONScripter::getspmodeCommand() { script_h.readVariable(); script_h.pushVariable(); int no = script_h.readInt(); script_h.setInt( &script_h.pushed_variable, sprite_info[no].visible?1:0 ); return RET_CONTINUE; } int ONScripter::getsevolCommand() { script_h.readInt(); script_h.setInt( &script_h.current_variable, se_volume ); return RET_CONTINUE; } int ONScripter::getscreenshotCommand() { int w = script_h.readInt(); if (disable_rescale_flag) w = w * screen_ratio1 / screen_ratio2; int h = script_h.readInt(); if (disable_rescale_flag) h = h * screen_ratio1 / screen_ratio2; if ( w == 0 ) w = 1; if ( h == 0 ) h = 1; screenshot_w = w; screenshot_h = h; #ifdef USE_SDL_RENDERER SDL_Rect rect = {(device_width -screen_device_width)/2, (device_height-screen_device_height)/2, screen_device_width, screen_device_height}; SDL_LockSurface(screenshot_surface); SDL_RenderReadPixels(renderer, &rect, screenshot_surface->format->format, screenshot_surface->pixels, screenshot_surface->pitch); SDL_UnlockSurface(screenshot_surface); #else SDL_BlitSurface(screen_surface, NULL, screenshot_surface, NULL); #endif return RET_CONTINUE; } int ONScripter::getsavestrCommand() { script_h.readVariable(); if ( script_h.current_variable.type != ScriptHandler::VAR_STR ) errorAndExit( "getsavestr: no string variable." ); script_h.pushVariable(); int no = script_h.readInt(); char *buf = readSaveStrFromFile( no ); setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, buf ); if (buf) delete[] buf; return RET_CONTINUE; } int ONScripter::getpageupCommand() { getpageup_flag = true; return RET_CONTINUE; } int ONScripter::getpageCommand() { getpageup_flag = true; getpagedown_flag = true; return RET_CONTINUE; } int ONScripter::getretCommand() { script_h.readVariable(); if ( script_h.current_variable.type == ScriptHandler::VAR_INT || script_h.current_variable.type == ScriptHandler::VAR_ARRAY ){ script_h.setInt( &script_h.current_variable, getret_int ); } else if ( script_h.current_variable.type == ScriptHandler::VAR_STR ){ int no = script_h.current_variable.var_no; setStr( &script_h.getVariableData(no).str, getret_str ); } else errorAndExit( "getret: no variable." ); return RET_CONTINUE; } int ONScripter::getregCommand() { script_h.readVariable(); if ( script_h.current_variable.type != ScriptHandler::VAR_STR ) errorAndExit( "getreg: no string variable." ); int no = script_h.current_variable.var_no; const char *buf = script_h.readStr(); char path[256], key[256]; strcpy( path, buf ); buf = script_h.readStr(); strcpy( key, buf ); printf(" reading Registry file for [%s] %s\n", path, key ); FILE *fp; if ( ( fp = fopen( registry_file, "r" ) ) == NULL ){ fprintf( stderr, "Cannot open file [%s]\n", registry_file ); return RET_CONTINUE; } char reg_buf[256], reg_buf2[256]; bool found_flag = false; while( fgets( reg_buf, 256, fp) && !found_flag ){ if ( reg_buf[0] == '[' ){ unsigned int c=0; while ( reg_buf[c] != ']' && reg_buf[c] != '\0' ) c++; if ( !strncmp( reg_buf + 1, path, (c-1>strlen(path))?(c-1):strlen(path) ) ){ while( fgets( reg_buf2, 256, fp) ){ script_h.pushCurrent( reg_buf2 ); buf = script_h.readStr(); if ( strncmp( buf, key, (strlen(buf)>strlen(key))?strlen(buf):strlen(key) ) ){ script_h.popCurrent(); continue; } if ( !script_h.compareString("=") ){ script_h.popCurrent(); continue; } script_h.setCurrent(script_h.getNext()+1); buf = script_h.readStr(); setStr( &script_h.getVariableData(no).str, buf ); script_h.popCurrent(); printf(" $%d = %s\n", no, script_h.getVariableData(no).str ); found_flag = true; break; } } } } if ( !found_flag ) fprintf( stderr, " The key is not found.\n" ); fclose(fp); return RET_CONTINUE; } int ONScripter::getmclickCommand() { getmclick_flag = true; return RET_CONTINUE; } int ONScripter::getmp3volCommand() { script_h.readInt(); script_h.setInt( &script_h.current_variable, music_volume ); return RET_CONTINUE; } int ONScripter::getmouseposCommand() { script_h.readInt(); script_h.setInt( &script_h.current_variable, current_button_state.x * screen_ratio2 / screen_ratio1 ); script_h.readInt(); script_h.setInt( &script_h.current_variable, current_button_state.y * screen_ratio2 / screen_ratio1 ); return RET_CONTINUE; } int ONScripter::getmouseoverCommand() { getmouseover_flag = true; getmouseover_lower = script_h.readInt(); getmouseover_upper = script_h.readInt(); return RET_CONTINUE; } int ONScripter::getlogCommand() { script_h.readVariable(); script_h.pushVariable(); int page_no = script_h.readInt(); Page *page = current_page; while(page != start_page && page_no > 0){ page_no--; page = page->previous; } if (page_no > 0) setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, NULL ); else setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, page->text, page->text_count ); return RET_CONTINUE; } int ONScripter::getinsertCommand() { getinsert_flag = true; return RET_CONTINUE; } int ONScripter::getfunctionCommand() { getfunction_flag = true; return RET_CONTINUE; } int ONScripter::getenterCommand() { if ( !force_button_shortcut_flag ) getenter_flag = true; return RET_CONTINUE; } int ONScripter::getcursorpos2Command() { script_h.readInt(); script_h.setInt( &script_h.current_variable, sentence_font.old_xy[0] ); script_h.readInt(); script_h.setInt( &script_h.current_variable, sentence_font.old_xy[1] ); return RET_CONTINUE; } int ONScripter::getcursorposCommand() { FontInfo fi = sentence_font; if ( fi.isEndOfLine() ){ fi.newLine(); for (int i=0 ; inext; } setStr(&script_h.getVariableData(script_h.pushed_variable.var_no).str, link?(link->text):NULL); return RET_CONTINUE; } int ONScripter::getcselnumCommand() { int count = 0; SelectLink *link = root_select_link.next; while ( link ) { count++; link = link->next; } script_h.readInt(); script_h.setInt( &script_h.current_variable, count ); return RET_CONTINUE; } int ONScripter::gameCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "game: not in the define section" ); int i; current_mode = NORMAL_MODE; /* ---------------------------------------- */ if ( !lookback_info[0].image_surface ){ setStr( &lookback_info[0].image_name, DEFAULT_LOOKBACK_NAME0 ); parseTaggedString( &lookback_info[0] ); setupAnimationInfo( &lookback_info[0] ); } if ( !lookback_info[1].image_surface ){ setStr( &lookback_info[1].image_name, DEFAULT_LOOKBACK_NAME1 ); parseTaggedString( &lookback_info[1] ); setupAnimationInfo( &lookback_info[1] ); } if ( !lookback_info[2].image_surface ){ setStr( &lookback_info[2].image_name, DEFAULT_LOOKBACK_NAME2 ); parseTaggedString( &lookback_info[2] ); setupAnimationInfo( &lookback_info[2] ); } if ( !lookback_info[3].image_surface ){ setStr( &lookback_info[3].image_name, DEFAULT_LOOKBACK_NAME3 ); parseTaggedString( &lookback_info[3] ); setupAnimationInfo( &lookback_info[3] ); } /* ---------------------------------------- */ /* Initialize text buffer */ page_list = new Page[max_page_list]; for ( i=0 ; igetFileLength(buf)>0)?1:0 ); return RET_CONTINUE; } int ONScripter::exec_dllCommand() { const char *buf = script_h.readStr(); char dll_name[256]; unsigned int c=0; while(buf[c] != '/'){ dll_name[c] = buf[c]; c++; } dll_name[c] = '\0'; printf(" reading %s for %s\n", dll_file, dll_name ); FILE *fp; if ( ( fp = fopen( dll_file, "r" ) ) == NULL ){ fprintf( stderr, "Cannot open file [%s]\n", dll_file ); return RET_CONTINUE; } char dll_buf[256], dll_buf2[256]; bool found_flag = false; while( fgets( dll_buf, 256, fp) && !found_flag ){ if ( dll_buf[0] == '[' ){ c=0; while ( dll_buf[c] != ']' && dll_buf[c] != '\0' ) c++; if ( !strncmp( dll_buf + 1, dll_name, (c-1>strlen(dll_name))?(c-1):strlen(dll_name) ) ){ found_flag = true; while( fgets( dll_buf2, 256, fp) ){ c=0; while ( dll_buf2[c] == ' ' || dll_buf2[c] == '\t' ) c++; if ( !strncmp( &dll_buf2[c], "str", 3 ) ){ c+=3; while ( dll_buf2[c] == ' ' || dll_buf2[c] == '\t' ) c++; if ( dll_buf2[c] != '=' ) continue; c++; while ( dll_buf2[c] != '"' ) c++; unsigned int c2 = ++c; while ( dll_buf2[c2] != '"' && dll_buf2[c2] != '\0' ) c2++; dll_buf2[c2] = '\0'; setStr( &getret_str, &dll_buf2[c] ); printf(" getret_str = %s\n", getret_str ); } else if ( !strncmp( &dll_buf2[c], "ret", 3 ) ){ c+=3; while ( dll_buf2[c] == ' ' || dll_buf2[c] == '\t' ) c++; if ( dll_buf2[c] != '=' ) continue; c++; while ( dll_buf2[c] == ' ' || dll_buf2[c] == '\t' ) c++; getret_int = atoi( &dll_buf2[c] ); printf(" getret_int = %d\n", getret_int ); } else if ( dll_buf2[c] == '[' ) break; } } } } if ( !found_flag ) fprintf( stderr, " The DLL is not found in %s.\n", dll_file ); fclose( fp ); return RET_CONTINUE; } int ONScripter::exbtnCommand() { int sprite_no=-1, no=0; ButtonLink *bl; if ( script_h.isName( "exbtn_d" ) || script_h.isName( "bdef" )){ bl = &exbtn_d_button_link; for (int i=0 ; i<3 ; i++){ if ( bl->exbtn_ctl[i] ){ delete[] bl->exbtn_ctl[i]; bl->exbtn_ctl[i] = NULL; } } } else{ bool cellcheck_flag = false; if ( script_h.isName( "cellcheckexbtn" ) ) cellcheck_flag = true; sprite_no = script_h.readInt(); no = script_h.readInt(); if (no < 1 || sprite_no < 0 || sprite_no >= MAX_SPRITE_NUM || sprite_info[sprite_no].image_surface == NULL || ( cellcheck_flag && sprite_info[ sprite_no ].num_of_cells < 2) || (!cellcheck_flag && sprite_info[ sprite_no ].num_of_cells == 0)){ script_h.readStr(); return RET_CONTINUE; } bl = new ButtonLink(); root_button_link.insert( bl ); is_exbtn_enabled = true; } const char *buf = script_h.readStr(); bl->button_type = ButtonLink::SPRITE_BUTTON; bl->sprite_no = sprite_no; bl->no = no; setStr( &bl->exbtn_ctl[1], buf ); if ( sprite_no >= 0 && ( sprite_info[ sprite_no ].image_surface || sprite_info[ sprite_no ].trans_mode == AnimationInfo::TRANS_STRING ) ) bl->image_rect = bl->select_rect = sprite_info[ sprite_no ].pos; return RET_CONTINUE; } int ONScripter::erasetextwindowCommand() { erase_text_window_mode = script_h.readInt(); return RET_CONTINUE; } int ONScripter::endCommand() { quit(); exit(0); return RET_CONTINUE; // dummy } int ONScripter::dwavestopCommand() { int ch = script_h.readInt(); if (ch < 0) ch = 0; else if (ch >= ONS_MIX_CHANNELS) ch = ONS_MIX_CHANNELS-1; if ( wave_sample[ch] ){ Mix_Pause( ch ); Mix_FreeChunk( wave_sample[ch] ); wave_sample[ch] = NULL; } return RET_CONTINUE; } int ONScripter::dwaveCommand() { int play_mode = WAVE_PLAY; bool loop_flag = false; if ( script_h.isName( "dwaveloop" ) ){ loop_flag = true; } else if ( script_h.isName( "dwaveload" ) ){ play_mode = WAVE_PRELOAD; } else if ( script_h.isName( "dwaveplayloop" ) ){ play_mode = WAVE_PLAY_LOADED; loop_flag = true; } else if ( script_h.isName( "dwaveplay" ) ){ play_mode = WAVE_PLAY_LOADED; loop_flag = false; } int ch = script_h.readInt(); if (ch < 0) ch = 0; else if (ch >= ONS_MIX_CHANNELS) ch = ONS_MIX_CHANNELS-1; if (play_mode == WAVE_PLAY_LOADED){ Mix_PlayChannel(ch, wave_sample[ch], loop_flag?-1:0); } else{ const char *buf = script_h.readStr(); int fmt = SOUND_CHUNK; if (play_mode == WAVE_PRELOAD) fmt |= SOUND_PRELOAD; playSound(buf, fmt, loop_flag, ch); } return RET_CONTINUE; } int ONScripter::dvCommand() { char buf[256]; sprintf(buf, RELATIVEPATH "voice%c%s.wav", DELIMITER, script_h.getStringBuffer()+2); playSound(buf, SOUND_CHUNK, false, 0); return RET_CONTINUE; } int ONScripter::drawtextCommand() { SDL_Rect clip; clip.x = clip.y = 0; clip.w = accumulation_surface->w; clip.h = accumulation_surface->h; text_info.blendOnSurface( accumulation_surface, 0, 0, clip ); return RET_CONTINUE; } int ONScripter::drawsp3Command() { int sprite_no = script_h.readInt(); int cell_no = script_h.readInt(); int alpha = script_h.readInt(); int x = script_h.readInt() * screen_ratio1 / screen_ratio2; int y = script_h.readInt() * screen_ratio1 / screen_ratio2; AnimationInfo *ai = &sprite_info[sprite_no]; int old_cell_no = ai->current_cell; ai->setCell(cell_no); ai->mat[0][0] = script_h.readInt(); ai->mat[0][1] = script_h.readInt(); ai->mat[1][0] = script_h.readInt(); ai->mat[1][1] = script_h.readInt(); int denom = (ai->mat[0][0]*ai->mat[1][1]-ai->mat[0][1]*ai->mat[1][0])/1000; if (denom != 0){ ai->inv_mat[0][0] = ai->mat[1][1] * 1000 / denom; ai->inv_mat[0][1] = -ai->mat[0][1] * 1000 / denom; ai->inv_mat[1][0] = -ai->mat[1][0] * 1000 / denom; ai->inv_mat[1][1] = ai->mat[0][0] * 1000 / denom; } ai->blendOnSurface2( accumulation_surface, x, y, screen_rect, alpha ); ai->setCell(old_cell_no); return RET_CONTINUE; } int ONScripter::drawsp2Command() { int sprite_no = script_h.readInt(); int cell_no = script_h.readInt(); int alpha = script_h.readInt(); AnimationInfo *ai = &sprite_info[sprite_no]; ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->scale_x = script_h.readInt(); ai->scale_y = script_h.readInt(); ai->rot = script_h.readInt(); ai->calcAffineMatrix(); ai->setCell(cell_no); ai->blendOnSurface2( accumulation_surface, ai->pos.x, ai->pos.y, screen_rect, alpha ); return RET_CONTINUE; } int ONScripter::drawspCommand() { int sprite_no = script_h.readInt(); int cell_no = script_h.readInt(); int alpha = script_h.readInt(); int x = script_h.readInt() * screen_ratio1 / screen_ratio2; int y = script_h.readInt() * screen_ratio1 / screen_ratio2; AnimationInfo *ai = &sprite_info[sprite_no]; int old_cell_no = ai->current_cell; ai->setCell(cell_no); SDL_Rect clip; clip.x = clip.y = 0; clip.w = accumulation_surface->w; clip.h = accumulation_surface->h; ai->blendOnSurface( accumulation_surface, x, y, clip, alpha ); ai->setCell(old_cell_no); return RET_CONTINUE; } int ONScripter::drawfillCommand() { int r = script_h.readInt(); int g = script_h.readInt(); int b = script_h.readInt(); SDL_FillRect( accumulation_surface, NULL, SDL_MapRGBA( accumulation_surface->format, r, g, b, 0xff) ); return RET_CONTINUE; } int ONScripter::drawclearCommand() { SDL_FillRect( accumulation_surface, NULL, SDL_MapRGBA( accumulation_surface->format, 0, 0, 0, 0xff) ); return RET_CONTINUE; } int ONScripter::drawbgCommand() { SDL_Rect clip; clip.x = clip.y = 0; clip.w = accumulation_surface->w; clip.h = accumulation_surface->h; bg_info.blendOnSurface( accumulation_surface, bg_info.pos.x, bg_info.pos.y, clip ); return RET_CONTINUE; } int ONScripter::drawbg2Command() { AnimationInfo bi = bg_info; bi.orig_pos.x = script_h.readInt(); bi.orig_pos.y = script_h.readInt(); bi.scalePosXY( screen_ratio1, screen_ratio2 ); bi.scale_x = script_h.readInt(); bi.scale_y = script_h.readInt(); bi.rot = script_h.readInt(); bi.calcAffineMatrix(); bi.blendOnSurface2( accumulation_surface, bi.pos.x, bi.pos.y, screen_rect, 255 ); return RET_CONTINUE; } int ONScripter::drawCommand() { flushDirect( screen_rect, REFRESH_NONE_MODE ); dirty_rect.clear(); return RET_CONTINUE; } int ONScripter::delayCommand() { int val = script_h.readInt(); if (skip_mode & SKIP_NORMAL || ctrl_pressed_status) return RET_CONTINUE; event_mode = WAIT_TIMER_MODE | WAIT_INPUT_MODE; waitEvent( val ); return RET_CONTINUE; } int ONScripter::defineresetCommand() { saveGlovalData(); script_h.reset(); ScriptParser::reset(); reset(); setCurrentLabel( "define" ); if ( loadFileIOBuf( "gloval.sav" ) > 0 ) readVariables( script_h.global_variable_border, script_h.variable_range ); #ifdef USE_LUA lua_handler.init(this, &script_h, screen_ratio1, screen_ratio2); #endif current_mode = DEFINE_MODE; return RET_CONTINUE; } int ONScripter::cspCommand() { leaveTextDisplayMode(); bool csp2_flag = false; if (script_h.isName("csp2")) csp2_flag = true; int no = script_h.readInt(); AnimationInfo *si = NULL; int num = 0; if (csp2_flag) { num = MAX_SPRITE2_NUM; si = sprite2_info; } else{ num = MAX_SPRITE_NUM; si = sprite_info; } if ( no == -1 ) for ( int i=0 ; i= 0 && no < MAX_SPRITE_NUM){ if ( si[no].visible ){ if (csp2_flag) dirty_rect.add( si[no].bounding_rect ); else dirty_rect.add( si[no].pos ); } if (!csp2_flag) root_button_link.removeSprite(no); si[no].remove(); } return RET_CONTINUE; } int ONScripter::cselgotoCommand() { int csel_no = script_h.readInt(); int counter = 0; SelectLink *link = root_select_link.next; while( link ){ if ( csel_no == counter++ ) break; link = link->next; } if ( !link ) errorAndExit( "cselgoto: no select link" ); setCurrentLabel( link->label ); deleteSelectLink(); newPage(); return RET_CONTINUE; } int ONScripter::cselbtnCommand() { int csel_no = script_h.readInt(); int button_no = script_h.readInt(); FontInfo csel_info = sentence_font; csel_info.rubyon_flag = false; csel_info.top_xy[0] = script_h.readInt(); csel_info.top_xy[1] = script_h.readInt(); int counter = 0; SelectLink *link = root_select_link.next; while ( link ){ if ( csel_no == counter++ ) break; link = link->next; } if ( link == NULL || link->text == NULL || *link->text == '\0' ) return RET_CONTINUE; csel_info.setLineArea( strlen(link->text)/2+1 ); csel_info.clear(); ButtonLink *button = getSelectableSentence( link->text, &csel_info ); root_button_link.insert( button ); button->no = button_no; button->sprite_no = csel_no; sentence_font.ttf_font[0] = csel_info.ttf_font[0]; sentence_font.ttf_font[1] = csel_info.ttf_font[1]; return RET_CONTINUE; } int ONScripter::clickCommand() { bool lrclick_flag = false; if ( script_h.isName( "lrclick" ) ) lrclick_flag = true; skip_mode &= ~SKIP_NORMAL; event_mode = WAIT_TIMER_MODE | WAIT_INPUT_MODE; if (lrclick_flag) event_mode |= WAIT_RCLICK_MODE; waitEvent(-1); if (lrclick_flag) getret_int = (current_button_state.button == -1)?0:1; return RET_CONTINUE; } int ONScripter::clCommand() { leaveTextDisplayMode(); char loc = script_h.readLabel()[0]; if ( loc == 'l' || loc == 'a' ){ dirty_rect.add( tachi_info[0].pos ); tachi_info[0].remove(); } if ( loc == 'c' || loc == 'a' ){ dirty_rect.add( tachi_info[1].pos ); tachi_info[1].remove(); } if ( loc == 'r' || loc == 'a' ){ dirty_rect.add( tachi_info[2].pos ); tachi_info[2].remove(); } EffectLink *el = parseEffect(true); if (setEffect(el, true, true)) return RET_CONTINUE; while (doEffect(el)); return RET_CONTINUE; } int ONScripter::chvolCommand() { int ch = script_h.readInt(); if (ch < 0) ch = 0; else if (ch >= ONS_MIX_CHANNELS) ch = ONS_MIX_CHANNELS-1; int vol = script_h.readInt(); if ( wave_sample[ch] ) Mix_Volume( ch, vol * MIX_MAX_VOLUME / 100 ); return RET_CONTINUE; } int ONScripter::checkpageCommand() { script_h.readVariable(); script_h.pushVariable(); if ( script_h.pushed_variable.type != ScriptHandler::VAR_INT && script_h.pushed_variable.type != ScriptHandler::VAR_ARRAY ) errorAndExit( "checkpage: no integer variable." ); int page_no = script_h.readInt(); Page *page = current_page; while(page != start_page && page_no > 0){ page_no--; page = page->previous; } if (page_no > 0) script_h.setInt( &script_h.pushed_variable, 0 ); else script_h.setInt( &script_h.pushed_variable, 1 ); return RET_CONTINUE; } int ONScripter::checkkeyCommand() { script_h.readVariable(); script_h.pushVariable(); const char *str = script_h.readStr(); if (strcmp(current_button_state.str, str) == 0) script_h.setInt( &script_h.pushed_variable, 1 ); else script_h.setInt( &script_h.pushed_variable, 0 ); return RET_CONTINUE; } int ONScripter::cellCommand() { int sprite_no = script_h.readInt(); int no = script_h.readInt(); sprite_info[sprite_no].setCell(no); dirty_rect.add( sprite_info[sprite_no].pos ); return RET_CONTINUE; } int ONScripter::captionCommand() { const char* buf = script_h.readStr(); size_t len = strlen(buf); char *buf2 = new char[len*3+1]; #if defined(MACOSX) && (SDL_COMPILEDVERSION >= 1208) /* convert sjis to utf-8 */ DirectReader::convertFromSJISToUTF8(buf2, buf); #elif defined(LINUX) || (defined(WIN32) && defined(UTF8_CAPTION)) #if defined(UTF8_CAPTION) DirectReader::convertFromSJISToUTF8(buf2, buf); #else strcpy(buf2, buf); DirectReader::convertFromSJISToEUC(buf2); #endif #else strcpy(buf2, buf); #endif setStr( &wm_title_string, buf2 ); setStr( &wm_icon_string, buf2 ); delete[] buf2; SDL_WM_SetCaption( wm_title_string, wm_icon_string ); return RET_CONTINUE; } int ONScripter::btnwaitCommand() { bool del_flag=false, textbtn_flag=false; bool bexec_int_flag=false; bexec_flag = false; if ( script_h.isName( "btnwait2" ) ){ leaveTextDisplayMode(); } else if ( script_h.isName( "btnwait" ) ){ del_flag = true; leaveTextDisplayMode(); } else if ( script_h.isName( "textbtnwait" ) ){ textbtn_flag = true; } else if ( script_h.isName( "bexec" ) ){ bexec_flag = true; } if (bexec_flag){ script_h.readStr(); script_h.pushVariable(); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ bexec_int_flag = true; script_h.readInt(); } getpageup_flag = true; getpagedown_flag = true; getmclick_flag = true; getfunction_flag = true; } else{ script_h.readInt(); } ButtonLink *bl = root_button_link.next; while( bl ){ bl->show_flag = 0; if ( bl->button_type == ButtonLink::SPRITE_BUTTON ){ if ( bl->exbtn_ctl[0] ){ SDL_Rect check_src_rect = bl->image_rect; SDL_Rect check_dst_rect = {0, 0, 0, 0}; decodeExbtnControl( bl->exbtn_ctl[0], &check_src_rect, &check_dst_rect ); } else{ sprite_info[ bl->sprite_no ].visible = true; sprite_info[ bl->sprite_no ].setCell(0); } } else if ( bl->button_type == ButtonLink::TMP_SPRITE_BUTTON ){ bl->show_flag = 1; sprite_info[ bl->sprite_no ].visible = true; sprite_info[ bl->sprite_no ].setCell(0); } else if ( bl->anim[1] != NULL ){ bl->show_flag = 2; } dirty_rect.add( bl->image_rect ); bl = bl->next; } if (is_exbtn_enabled && exbtn_d_button_link.exbtn_ctl[1]){ SDL_Rect check_src_rect = screen_rect; if (is_exbtn_enabled) decodeExbtnControl( exbtn_d_button_link.exbtn_ctl[1], &check_src_rect ); } if ((textbtn_flag || bexec_flag) && (skip_mode & SKIP_NORMAL || (skip_mode & SKIP_TO_EOP && (textgosub_clickstr_state & 0x03) == CLICK_WAIT) || ctrl_pressed_status) ){ waitEventSub(0); // for checking keyup event current_button_state.button = 0; if (bexec_flag) current_button_state.button = -1; if (skip_mode & SKIP_NORMAL || (skip_mode & SKIP_TO_EOP && (textgosub_clickstr_state & 0x03) == CLICK_WAIT)) sprintf(current_button_state.str, "SKIP"); else sprintf(current_button_state.str, "CTRL"); } else{ shortcut_mouse_line = 0; skip_mode &= ~SKIP_NORMAL; flush( refreshMode() ); event_mode = WAIT_BUTTON_MODE; refreshMouseOverButton(); int t = -1; if ( btntime_value >= 0 ){ if ( btntime2_flag ) event_mode |= WAIT_VOICE_MODE; t = btntime_value; //if ( usewheel_flag ) current_button_state.button = -5; //else current_button_state.button = -2; } internal_button_timer = SDL_GetTicks(); if ( textbtn_flag ){ event_mode |= WAIT_INPUT_MODE; if ( btntime_value == -1 ){ if ( automode_flag ){ event_mode |= WAIT_VOICE_MODE; if ( automode_time < 0 ){ if (t == -1 || t > -automode_time * num_chars_in_sentence) t = -automode_time * num_chars_in_sentence; } else{ if (t == -1 || t > automode_time) t = automode_time; } //current_button_state.button = 0; } else if (autoclick_time > 0) if (t == -1 || t > autoclick_time){ t = autoclick_time; } } } event_mode |= WAIT_TIMER_MODE; waitEvent(t); skip_mode &= ~SKIP_TO_EOL; } btnwait_time = SDL_GetTicks() - internal_button_timer; num_chars_in_sentence = 0; if (bexec_flag){ setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, current_button_state.str ); if (bexec_int_flag){ if (current_button_state.button >= 0) script_h.setInt( &script_h.current_variable, current_button_state.button ); else script_h.setInt( &script_h.current_variable, -1); } } else{ script_h.setInt( &script_h.current_variable, current_button_state.button ); } if ( current_button_state.button >= 1 && del_flag ){ deleteButtonLink(); } event_mode = IDLE_EVENT_MODE; disableGetButtonFlag(); bl = root_button_link.next; while( bl ){ bl->show_flag = 0; bl = bl->next; } return RET_CONTINUE; } int ONScripter::btntimeCommand() { bool btime_flag = false; if ( script_h.isName( "btime" )){ btime_flag = true; btntime2_flag = false; } else if ( script_h.isName( "btntime2" ) ) btntime2_flag = true; else btntime2_flag = false; btntime_value = script_h.readInt(); if ( btime_flag && script_h.getEndStatus() & ScriptHandler::END_COMMA ) if (script_h.readInt() == 1) btntime2_flag = true; return RET_CONTINUE; } int ONScripter::btndownCommand() { btndown_flag = (script_h.readInt()==1)?true:false; return RET_CONTINUE; } int ONScripter::btndefCommand() { if (script_h.isName( "bclear" )){ } else if (script_h.compareString("clear")){ script_h.readLabel(); } else{ const char *buf = script_h.readStr(); btndef_info.remove(); if ( buf[0] != '\0' ){ btndef_info.setImageName( buf ); parseTaggedString( &btndef_info ); btndef_info.trans_mode = AnimationInfo::TRANS_COPY; setupAnimationInfo( &btndef_info ); SDL_SetAlpha( btndef_info.image_surface, DEFAULT_BLIT_FLAG, SDL_ALPHA_OPAQUE ); } } btntime_value = -1; transbtn_flag = false; deleteButtonLink(); disableGetButtonFlag(); return RET_CONTINUE; } int ONScripter::btnCommand() { SDL_Rect src_rect; ButtonLink *button = new ButtonLink(); button->no = script_h.readInt(); button->image_rect.x = script_h.readInt() * screen_ratio1 / screen_ratio2; button->image_rect.y = script_h.readInt() * screen_ratio1 / screen_ratio2; button->image_rect.w = script_h.readInt() * screen_ratio1 / screen_ratio2; button->image_rect.h = script_h.readInt() * screen_ratio1 / screen_ratio2; button->select_rect = button->image_rect; src_rect.x = script_h.readInt() * screen_ratio1 / screen_ratio2; src_rect.y = script_h.readInt() * screen_ratio1 / screen_ratio2; if (btndef_info.image_surface && src_rect.x + button->image_rect.w > btndef_info.image_surface->w){ button->image_rect.w = btndef_info.image_surface->w - src_rect.x; } if (btndef_info.image_surface && src_rect.y + button->image_rect.h > btndef_info.image_surface->h){ button->image_rect.h = btndef_info.image_surface->h - src_rect.y; } src_rect.w = button->image_rect.w; src_rect.h = button->image_rect.h; AnimationInfo *ai = button->anim[0] = new AnimationInfo(); ai->num_of_cells = 1; ai->trans_mode = AnimationInfo::TRANS_COPY; ai->pos.x = button->image_rect.x; ai->pos.y = button->image_rect.y; ai->allocImage( button->image_rect.w, button->image_rect.h, texture_format ); ai->fill( 0, 0, 0, 0 ); ai->copySurface( btndef_info.image_surface, &src_rect ); root_button_link.insert( button ); return RET_CONTINUE; } int ONScripter::bspCommand() { int no = script_h.readInt(); if (no < 0 || no >= MAX_SPRITE_NUM || sprite_info[no].image_surface == NULL) return RET_CONTINUE; ButtonLink *bl = new ButtonLink(); root_button_link.insert( bl ); bl->button_type = ButtonLink::SPRITE_BUTTON; bl->sprite_no = no; bl->no = no; if ( sprite_info[no].image_surface || sprite_info[no].trans_mode == AnimationInfo::TRANS_STRING ) bl->image_rect = bl->select_rect = sprite_info[no].pos; for (int i=0 ; i<3 ; i++) if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ) setStr( &bl->exbtn_ctl[i], script_h.readStr() ); return RET_CONTINUE; } int ONScripter::brCommand() { enterTextDisplayMode(); sentence_font.newLine(); current_page->add( 0x0a ); return RET_CONTINUE; } int ONScripter::bltCommand() { Sint16 dx,dy,sx,sy; Uint16 dw,dh,sw,sh; dx = script_h.readInt() * screen_ratio1 / screen_ratio2; dy = script_h.readInt() * screen_ratio1 / screen_ratio2; dw = script_h.readInt() * screen_ratio1 / screen_ratio2; dh = script_h.readInt() * screen_ratio1 / screen_ratio2; sx = script_h.readInt() * screen_ratio1 / screen_ratio2; sy = script_h.readInt() * screen_ratio1 / screen_ratio2; sw = script_h.readInt() * screen_ratio1 / screen_ratio2; sh = script_h.readInt() * screen_ratio1 / screen_ratio2; if (btndef_info.image_surface == NULL) return RET_CONTINUE; if (dw == 0 || dh == 0 || sw == 0 || sh == 0) return RET_CONTINUE; if ( sw == dw && sw > 0 && sh == dh && sh > 0 ){ SDL_Rect src_rect = {sx,sy,sw,sh}; SDL_Rect dst_rect = {dx,dy,dw,dh}; #ifdef USE_SDL_RENDERER dst_rect.x = dst_rect.x * screen_device_width / screen_width + (device_width -screen_device_width )/2; dst_rect.y = dst_rect.y * screen_device_width / screen_width + (device_height-screen_device_height)/2; dst_rect.w = dst_rect.w * screen_device_width / screen_width; dst_rect.h = dst_rect.h * screen_device_width / screen_width; SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, btndef_info.image_surface); SDL_RenderCopy(renderer, texture, &src_rect, &dst_rect); SDL_RenderPresent(renderer); SDL_DestroyTexture(texture); #else SDL_BlitSurface( btndef_info.image_surface, &src_rect, screen_surface, &dst_rect ); SDL_UpdateRect( screen_surface, dst_rect.x, dst_rect.y, dst_rect.w, dst_rect.h ); #endif dirty_rect.clear(); } else{ SDL_LockSurface(accumulation_surface); SDL_LockSurface(btndef_info.image_surface); ONSBuf *dst_buf = (ONSBuf*)accumulation_surface->pixels; ONSBuf *src_buf = (ONSBuf*)btndef_info.image_surface->pixels; #if defined(BPP16) int dst_width = accumulation_surface->pitch / 2; int src_width = btndef_info.image_surface->pitch / 2; #else int dst_width = accumulation_surface->pitch / 4; int src_width = btndef_info.image_surface->pitch / 4; #endif int start_y = dy, end_y = dy+dh; if (dh < 0){ start_y = dy+dh; end_y = dy; } if (start_y < 0) start_y = 0; if (end_y > screen_height) end_y = screen_height; int start_x = dx, end_x = dx+dw; if (dw < 0){ start_x = dx+dw; end_x = dx; } if (start_x < 0) start_x = 0; if (end_x >= screen_width) end_x = screen_width; dst_buf += start_y*dst_width; for (int i=start_y ; i=btndef_info.image_surface->w || y<0 || y>=btndef_info.image_surface->h) *(dst_buf+j) = 0; else *(dst_buf+j) = *(src_buf+y*src_width+x); } dst_buf += dst_width; } SDL_UnlockSurface(btndef_info.image_surface); SDL_UnlockSurface(accumulation_surface); SDL_Rect dst_rect; dst_rect.x = start_x; dst_rect.y = start_y; dst_rect.w = end_x-start_x; dst_rect.h = end_y-start_y; flushDirect( dst_rect, REFRESH_NONE_MODE ); } return RET_CONTINUE; } int ONScripter::bgcopyCommand() { ofscopyCommand(); setStr( &bg_info.file_name, "*bgcpy" ); bg_info.num_of_cells = 1; bg_info.trans_mode = AnimationInfo::TRANS_COPY; bg_info.pos.x = 0; bg_info.pos.y = 0; bg_info.copySurface( accumulation_surface, NULL ); return RET_CONTINUE; } int ONScripter::bgCommand() { leaveTextDisplayMode(); const char *buf; if (script_h.compareString("white")){ buf = "white"; script_h.readLabel(); } else if (script_h.compareString("black")){ buf = "black"; script_h.readLabel(); } else{ buf = script_h.readStr(); } for ( int i=0 ; i<3 ; i++ ) tachi_info[i].remove(); bg_info.remove(); setStr( &bg_info.file_name, buf ); createBackground(); dirty_rect.fill( screen_width, screen_height ); EffectLink *el = parseEffect(true); if (setEffect(el, true, true)) return RET_CONTINUE; while (doEffect(el)); return RET_CONTINUE; } int ONScripter::bdownCommand() { btndown_flag = true; return RET_CONTINUE; } int ONScripter::barclearCommand() { for ( int i=0 ; ipos ); delete bar_info[i]; bar_info[i] = NULL; } } return RET_CONTINUE; } int ONScripter::barCommand() { int no = script_h.readInt(); AnimationInfo *ai = bar_info[no]; if ( ai ){ dirty_rect.add( ai->pos ); ai->remove(); } else{ ai = bar_info[no] = new AnimationInfo(); } ai->trans_mode = AnimationInfo::TRANS_COPY; ai->num_of_cells = 1; ai->setCell(0); ai->param = script_h.readInt(); ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->max_width = script_h.readInt(); ai->orig_pos.w = 0; ai->orig_pos.h = script_h.readInt(); ai->max_param = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); const char *buf = script_h.readStr(); readColor( &ai->color, buf ); int w = ai->max_width * ai->param / ai->max_param; if ( ai->max_width > 0 && w > 0 ) ai->orig_pos.w = w; ai->scalePosWH( screen_ratio1, screen_ratio2 ); ai->allocImage( ai->pos.w, ai->pos.h, texture_format ); ai->fill( ai->color[0], ai->color[1], ai->color[2], 0xff ); dirty_rect.add( ai->pos ); return RET_CONTINUE; } int ONScripter::aviCommand() { script_h.readStr(); const char *save_buf = script_h.saveStringBuffer(); bool click_flag = (script_h.readInt()==1)?true:false; stopBGM( false ); if (playAVI( save_buf, click_flag )) endCommand(); // should be commented out //repaintCommand(); return RET_CONTINUE; } int ONScripter::automode_timeCommand() { automode_time = script_h.readInt(); return RET_CONTINUE; } int ONScripter::autoclickCommand() { autoclick_time = script_h.readInt(); return RET_CONTINUE; } int ONScripter::amspCommand() { leaveTextDisplayMode(); bool amsp2_flag = false; if (script_h.isName("amsp2")) amsp2_flag = true; int no = script_h.readInt(); AnimationInfo *ai = NULL; if (amsp2_flag){ ai = &sprite2_info[no]; dirty_rect.add( ai->bounding_rect ); } else{ ai = &sprite_info[no]; dirty_rect.add( ai->pos ); } ai->orig_pos.x = script_h.readInt(); ai->orig_pos.y = script_h.readInt(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); if (amsp2_flag){ ai->scale_x = script_h.readInt(); ai->scale_y = script_h.readInt(); ai->rot = script_h.readInt(); ai->calcAffineMatrix(); dirty_rect.add( ai->bounding_rect ); } else{ dirty_rect.add( ai->pos ); } if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ ai->trans = script_h.readInt(); if (ai->trans < 0) ai->trans = 0; else if (ai->trans > 255) ai->trans = 255; } return RET_CONTINUE; } int ONScripter::allsp2resumeCommand() { all_sprite2_hide_flag = false; for ( int i=0 ; iimage_surface && ai->visible) dirty_rect.add( ai->bounding_rect ); } return RET_CONTINUE; } int ONScripter::allsphideCommand() { all_sprite_hide_flag = true; for ( int i=0 ; i<3 ; i++ ){ AnimationInfo &ai = tachi_info[i]; if (ai.image_surface && ai.visible) dirty_rect.add( ai.pos ); } for ( int i=0 ; i #include #include #include "BaseReader.h" #define IS_TWO_BYTE(x) \ ( ((x) & 0xe0) == 0xe0 || ((x) & 0xe0) == 0x80 ) typedef unsigned char uchar3[3]; class ScriptHandler { public: enum { END_NONE = 0, END_COMMA = 1, END_1BYTE_CHAR = 2, END_COMMA_READ = 4 // for LUA }; struct LabelInfo{ char *name; char *label_header; char *start_address; int start_line; int num_of_lines; }; struct ArrayVariable{ struct ArrayVariable* next; int no; int num_dim; int dim[20]; int *data; ArrayVariable(){ next = NULL; data = NULL; }; ~ArrayVariable(){ if (data) delete[] data; }; ArrayVariable& operator=(const ArrayVariable& av){ no = av.no; num_dim = av.num_dim; int total_dim = 1; for (int i=0 ; i<20 ; i++){ dim[i] = av.dim[i]; total_dim *= dim[i]; } if (data) delete[] data; data = NULL; if (av.data){ data = new int[total_dim]; memcpy(data, av.data, sizeof(int)*total_dim); } return *this; }; }; enum { VAR_NONE = 0, VAR_INT = 1, // integer VAR_ARRAY = 2, // array VAR_STR = 4, // string VAR_CONST = 8, // direct value or alias, not variable VAR_PTR = 16 // pointer to a variable, e.g. i%0, s%0 }; struct VariableInfo{ int type; int var_no; // for integer(%), array(?), string($) variable ArrayVariable array; // for array(?) }; ScriptHandler(); ~ScriptHandler(); void reset(); void setSaveDir(const char *path); FILE *fopen( const char *path, const char *mode, bool use_save_dir=false ); void setKeyTable( const unsigned char *key_table ); // basic parser function const char *readToken(); const char *readLabel(); const char *readStr(); int readInt(); void skipToken(); int parseInt( char **buf ); int parseIntExpression( char **buf ); void readVariable( bool reread_flag=false ); // function for string access inline char *getStringBuffer(){ return string_buffer; }; char *saveStringBuffer(); void addStringBuffer( char ch ); // function for direct manipulation of script address inline char *getCurrent(bool use_script=false){ return (use_script && internal_current_script)?internal_current_script:current_script; }; inline char *getNext(){ return next_script; }; inline char *getWait(){ return wait_script; }; void setCurrent(char *pos); void pushCurrent( char *pos ); void popCurrent(); void enterExternalScript(char *pos); // LUA void leaveExternalScript(); bool isExternalScript(); int getOffset( char *pos ); char *getAddress( int offset ); int getLineByAddress( char *address ); char *getAddressByLine( int line ); LabelInfo getLabelByAddress( char *address ); LabelInfo getLabelByLine( int line ); bool isName( const char *name ); bool isText(); bool compareString( const char *buf ); void setEndStatus(int val){ end_status |= val; }; inline int getEndStatus(){ return end_status; }; void skipLine( int no=1 ); void setLinepage( bool val ); void setEnglishMode( bool val ){ english_mode = val; }; // function for kidoku history bool isKidoku(); void markAsKidoku( char *address=NULL ); void setKidokuskip( bool kidokuskip_flag ); void saveKidokuData(); void loadKidokuData(); void addStrVariable(char **buf); void addIntVariable(char **buf); void declareDim(); void enableTextgosub(bool val); void setClickstr( const char *list ); int checkClickstr(const char *buf, bool recursive_flag=false); void setInt( VariableInfo *var_info, int val, int offset=0 ); void setNumVariable( int no, int val ); void pushVariable(); int getIntVariable( VariableInfo *var_info=NULL ); int getStringFromInteger( char *buffer, int no, int num_column, bool is_zero_inserted=false ); int openScript( char *path ); LabelInfo lookupLabel( const char* label ); LabelInfo lookupLabelNext( const char* label ); void errorAndExit( const char *str ); ArrayVariable *getRootArrayVariable(); void loadArrayVariable( FILE *fp ); void addNumAlias( const char *str, int no ); void addStrAlias( const char *str1, const char *str2 ); enum { LABEL_LOG = 0, FILE_LOG = 1 }; struct LogLink{ LogLink *next; char *name; LogLink(){ next = NULL; name = NULL; }; ~LogLink(){ if ( name ) delete[] name; }; }; struct LogInfo{ LogLink root_log; LogLink *current_log; int num_logs; const char *filename; } log_info[2]; LogLink *findAndAddLog( LogInfo &info, const char *name, bool add_flag ); void resetLog( LogInfo &info ); /* ---------------------------------------- */ /* Variable */ struct VariableData{ int num; bool num_limit_flag; int num_limit_upper; int num_limit_lower; char *str; VariableData(){ str = NULL; reset(true); }; void reset(bool limit_reset_flag){ num = 0; if (limit_reset_flag) num_limit_flag = false; if (str){ delete[] str; str = NULL; } }; }; VariableData &getVariableData(int no); VariableInfo current_variable, pushed_variable; int screen_width; int screen_height; int variable_range; int global_variable_border; BaseReader *cBR; private: enum { OP_INVALID = 0, // 000 OP_PLUS = 2, // 010 OP_MINUS = 3, // 011 OP_MULT = 4, // 100 OP_DIV = 5, // 101 OP_MOD = 6 // 110 }; struct Alias{ struct Alias *next; char *alias; int num; char *str; Alias(){ next = NULL; alias = NULL; str = NULL; }; Alias( const char *name, int num ){ next = NULL; alias = new char[ strlen(name) + 1]; strcpy( alias, name ); str = NULL; this->num = num; }; Alias( const char *name, const char *str ){ next = NULL; alias = new char[ strlen(name) + 1]; strcpy( alias, name ); this->str = new char[ strlen(str) + 1]; strcpy( this->str, str ); }; ~Alias(){ if (alias) delete[] alias; if (str) delete[] str; }; }; int readScript(char *path); int readScriptSub(FILE *fp, char **buf, int encrypt_mode); void readConfiguration(); int labelScript(); int findLabel( const char* label ); char *checkComma( char *buf ); void parseStr( char **buf ); void readNextOp( char **buf, int *op, int *num ); int calcArithmetic( int num1, int op, int num2 ); int parseArray( char **buf, ArrayVariable &array ); int *getArrayPtr( int no, ArrayVariable &array, int offset ); /* ---------------------------------------- */ /* Variable */ struct VariableData *variable_data; struct ExtendedVariableData{ int no; VariableData vd; } *extended_variable_data; int num_extended_variable_data; int max_extended_variable_data; Alias root_num_alias, *last_num_alias; Alias root_str_alias, *last_str_alias; ArrayVariable *root_array_variable, *current_array_variable; char *archive_path; char *save_dir; int script_buffer_length; char *script_buffer; unsigned char *tmp_script_buf; char *string_buffer; // update only be readToken int string_counter; char *saved_string_buffer; // updated only by saveStringBuffer char *str_string_buffer; // updated only by readStr LabelInfo *label_info; int num_of_labels; bool skip_enabled; bool kidokuskip_flag; char *kidoku_buffer; bool text_flag; // true if the current token is text int end_status; bool linepage_flag; bool textgosub_flag; char *clickstr_list; bool english_mode; char *current_script; char *next_script; char *wait_script; // address where '@' or '//' appears char *pushed_current_script; char *pushed_next_script; char *internal_current_script; char *internal_next_script; int internal_end_status; VariableInfo internal_current_variable, internal_pushed_variable; unsigned char key_table[256]; bool key_table_flag; }; #endif // __SCRIPT_HANDLER_H__ onscripter-20150820/ONScripter_lut.cpp0000644017777601777760000004217312565174244017427 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_lut.cpp - command lookup-table for ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" static ONScripter::FuncLUT func_lut[] = { {"zenkakko", &ONScripter::zenkakkoCommand}, {"yesnobox", &ONScripter::yesnoboxCommand}, {"windoweffect", &ONScripter::effectCommand}, {"windowchip", &ONScripter::windowchipCommand}, {"windowback", &ONScripter::windowbackCommand}, {"wavestop", &ONScripter::wavestopCommand}, {"waveloop", &ONScripter::waveCommand}, {"wave", &ONScripter::waveCommand}, {"waittimer", &ONScripter::waittimerCommand}, {"wait", &ONScripter::waitCommand}, {"vsp2", &ONScripter::vspCommand}, {"vsp", &ONScripter::vspCommand}, {"voicevol", &ONScripter::voicevolCommand}, {"versionstr", &ONScripter::versionstrCommand}, {"usewheel", &ONScripter::usewheelCommand}, {"useescspc", &ONScripter::useescspcCommand}, {"underline", &ONScripter::underlineCommand}, {"trap", &ONScripter::trapCommand}, {"transmode", &ONScripter::transmodeCommand}, {"transbtn", &ONScripter::transbtnCommand}, {"time", &ONScripter::timeCommand}, {"textspeeddefault",&ONScripter::textspeeddefaultCommand}, {"textspeed", &ONScripter::textspeedCommand}, {"textshow", &ONScripter::textshowCommand}, {"texton", &ONScripter::textonCommand}, {"textoff", &ONScripter::textoffCommand}, {"texthide", &ONScripter::texthideCommand}, {"textgosub", &ONScripter::textgosubCommand}, {"textcolor", &ONScripter::textcolorCommand}, {"textclear", &ONScripter::textclearCommand}, {"textbtnwait", &ONScripter::btnwaitCommand}, {"texec", &ONScripter::texecCommand}, {"tateyoko", &ONScripter::tateyokoCommand}, {"tan", &ONScripter::tanCommand}, {"tal", &ONScripter::talCommand}, {"tablegoto", &ONScripter::tablegotoCommand}, {"systemcall", &ONScripter::systemcallCommand}, {"sub", &ONScripter::subCommand}, {"strsph", &ONScripter::strspCommand}, {"strsp", &ONScripter::strspCommand}, {"stralias", &ONScripter::straliasCommand}, {"stop", &ONScripter::stopCommand}, {"sp_rgb_gradation",&ONScripter::sp_rgb_gradationCommand}, {"spstr", &ONScripter::spstrCommand}, {"spreload", &ONScripter::spreloadCommand}, {"splitstring", &ONScripter::splitCommand}, {"split", &ONScripter::splitCommand}, {"spi", &ONScripter::soundpressplginCommand}, {"spclclk", &ONScripter::spclclkCommand}, {"spbtn", &ONScripter::spbtnCommand}, {"soundpressplgin", &ONScripter::soundpressplginCommand}, {"skipoff", &ONScripter::skipoffCommand}, {"skip", &ONScripter::skipCommand}, {"sin", &ONScripter::sinCommand}, {"shadedistance", &ONScripter::shadedistanceCommand}, {"sevol", &ONScripter::sevolCommand}, {"setwindow3", &ONScripter::setwindow3Command}, {"setwindow2", &ONScripter::setwindow2Command}, {"setwindow", &ONScripter::setwindowCommand}, {"setkinsoku", &ONScripter::setkinsokuCommand}, {"setcursor", &ONScripter::setcursorCommand}, {"selnum", &ONScripter::selectCommand}, {"selgosub", &ONScripter::selectCommand}, {"selectvoice", &ONScripter::selectvoiceCommand}, {"selectcolor", &ONScripter::selectcolorCommand}, {"selectbtnwait", &ONScripter::btnwaitCommand}, {"select", &ONScripter::selectCommand}, {"savetime", &ONScripter::savetimeCommand}, {"savescreenshot2", &ONScripter::savescreenshotCommand}, {"savescreenshot", &ONScripter::savescreenshotCommand}, {"saveon", &ONScripter::saveonCommand}, {"saveoff", &ONScripter::saveoffCommand}, {"savenumber", &ONScripter::savenumberCommand}, {"savename", &ONScripter::savenameCommand}, {"savegame2", &ONScripter::savegameCommand}, {"savegame", &ONScripter::savegameCommand}, {"savefileexist", &ONScripter::savefileexistCommand}, {"savedir", &ONScripter::savedirCommand}, {"sar", &ONScripter::nsaCommand}, {"rubyon", &ONScripter::rubyonCommand}, {"rubyoff", &ONScripter::rubyoffCommand}, {"roff", &ONScripter::roffCommand}, {"rnd2", &ONScripter::rndCommand}, {"rnd", &ONScripter::rndCommand}, {"rmode", &ONScripter::rmodeCommand}, {"rmenu", &ONScripter::rmenuCommand}, {"return", &ONScripter::returnCommand}, {"resettimer", &ONScripter::resettimerCommand}, {"reset", &ONScripter::resetCommand}, {"repaint", &ONScripter::repaintCommand}, {"quakey", &ONScripter::quakeCommand}, {"quakex", &ONScripter::quakeCommand}, {"quake", &ONScripter::quakeCommand}, {"puttext", &ONScripter::puttextCommand}, {"prnumclear", &ONScripter::prnumclearCommand}, {"prnum", &ONScripter::prnumCommand}, {"print", &ONScripter::printCommand}, {"pretextgosub", &ONScripter::pretextgosubCommand}, {"playstop", &ONScripter::playstopCommand}, {"playonce", &ONScripter::playCommand}, {"play", &ONScripter::playCommand}, {"pagetag", &ONScripter::pagetagCommand}, {"okcancelbox", &ONScripter::yesnoboxCommand}, {"ofscpy", &ONScripter::ofscopyCommand}, {"ofscopy", &ONScripter::ofscopyCommand}, {"numalias", &ONScripter::numaliasCommand}, {"nsadir", &ONScripter::nsadirCommand}, {"nsa", &ONScripter::nsaCommand}, {"notif", &ONScripter::ifCommand}, {"next", &ONScripter::nextCommand}, {"nsa", &ONScripter::arcCommand}, {"ns3", &ONScripter::nsaCommand}, {"ns2", &ONScripter::nsaCommand}, {"nega", &ONScripter::negaCommand}, {"mul", &ONScripter::mulCommand}, {"msp2", &ONScripter::mspCommand}, {"msp", &ONScripter::mspCommand}, {"mpegplay", &ONScripter::mpegplayCommand}, {"mp3vol", &ONScripter::mp3volCommand}, {"mp3stop", &ONScripter::mp3stopCommand}, {"mp3save", &ONScripter::mp3Command}, {"mp3loop", &ONScripter::mp3Command}, {"mp3fadeout", &ONScripter::mp3fadeoutCommand}, {"mp3fadein", &ONScripter::mp3fadeinCommand}, {"mp3", &ONScripter::mp3Command}, {"movl", &ONScripter::movCommand}, {"movie", &ONScripter::movieCommand}, {"movemousecursor", &ONScripter::movemousecursorCommand}, {"mov9", &ONScripter::movCommand}, {"mov8", &ONScripter::movCommand}, {"mov7", &ONScripter::movCommand}, {"mov6", &ONScripter::movCommand}, {"mov5", &ONScripter::movCommand}, {"mov4", &ONScripter::movCommand}, {"mov3", &ONScripter::movCommand}, {"mov10", &ONScripter::movCommand}, {"mov", &ONScripter::movCommand}, {"monocro", &ONScripter::monocroCommand}, {"mode_saya", &ONScripter::mode_sayaCommand}, {"mode_ext", &ONScripter::mode_extCommand}, {"mod", &ONScripter::modCommand}, {"mid", &ONScripter::midCommand}, {"menu_window", &ONScripter::menu_windowCommand}, {"menu_full", &ONScripter::menu_fullCommand}, {"menu_click_page", &ONScripter::menu_click_pageCommand}, {"menu_click_def", &ONScripter::menu_click_defCommand}, {"menu_automode", &ONScripter::menu_automodeCommand}, {"menusetwindow", &ONScripter::menusetwindowCommand}, {"menuselectvoice", &ONScripter::menuselectvoiceCommand}, {"menuselectcolor", &ONScripter::menuselectcolorCommand}, {"maxkaisoupage", &ONScripter::maxkaisoupageCommand}, {"luasub", &ONScripter::luasubCommand}, {"luacall", &ONScripter::luacallCommand}, {"lsph2sub", &ONScripter::lsp2Command}, {"lsph2add", &ONScripter::lsp2Command}, {"lsph2", &ONScripter::lsp2Command}, {"lsph", &ONScripter::lspCommand}, {"lsp2sub", &ONScripter::lsp2Command}, {"lsp2add", &ONScripter::lsp2Command}, {"lsp2", &ONScripter::lsp2Command}, {"lsp", &ONScripter::lspCommand}, {"lr_trap", &ONScripter::trapCommand}, {"lrclick", &ONScripter::clickCommand}, {"loopbgmstop", &ONScripter::loopbgmstopCommand}, {"loopbgm", &ONScripter::loopbgmCommand}, {"lookbacksp", &ONScripter::lookbackspCommand}, {"lookbackflush", &ONScripter::lookbackflushCommand}, {"lookbackcolor", &ONScripter::lookbackcolorCommand}, {"lookbackbutton", &ONScripter::lookbackbuttonCommand}, {"logsp2", &ONScripter::logspCommand}, {"logsp", &ONScripter::logspCommand}, {"locate", &ONScripter::locateCommand}, {"loadgosub", &ONScripter::loadgosubCommand}, {"loadgame", &ONScripter::loadgameCommand}, {"linepage2", &ONScripter::linepageCommand}, {"linepage", &ONScripter::linepageCommand}, {"len", &ONScripter::lenCommand}, {"ld", &ONScripter::ldCommand}, {"labellog", &ONScripter::labellogCommand}, {"kinsoku", &ONScripter::kinsokuCommand}, {"jumpf", &ONScripter::jumpfCommand}, {"jumpb", &ONScripter::jumpbCommand}, {"kidokuskip", &ONScripter::kidokuskipCommand}, {"kidokumode", &ONScripter::kidokumodeCommand}, {"itoa2", &ONScripter::itoaCommand}, {"itoa", &ONScripter::itoaCommand}, {"isskip", &ONScripter::isskipCommand}, {"ispage", &ONScripter::ispageCommand}, {"isfull", &ONScripter::isfullCommand}, {"isdown", &ONScripter::isdownCommand}, {"intlimit", &ONScripter::intlimitCommand}, {"input", &ONScripter::inputCommand}, {"indent", &ONScripter::indentCommand}, {"inc", &ONScripter::incCommand}, {"if", &ONScripter::ifCommand}, {"humanz", &ONScripter::humanzCommand}, {"humanorder", &ONScripter::humanorderCommand}, {"goto", &ONScripter::gotoCommand}, {"gosub", &ONScripter::gosubCommand}, {"globalon", &ONScripter::globalonCommand}, {"getzxc", &ONScripter::getzxcCommand}, {"getvoicevol", &ONScripter::getvoicevolCommand}, {"getversion", &ONScripter::getversionCommand}, {"gettimer", &ONScripter::gettimerCommand}, {"gettext", &ONScripter::gettextCommand}, {"gettaglog", &ONScripter::gettaglogCommand}, {"gettag", &ONScripter::gettagCommand}, {"gettab", &ONScripter::gettabCommand}, {"getspsize", &ONScripter::getspsizeCommand}, {"getsppos", &ONScripter::getspposCommand}, {"getspmode", &ONScripter::getspmodeCommand}, {"getsevol", &ONScripter::getsevolCommand}, {"getscreenshot", &ONScripter::getscreenshotCommand}, {"getsavestr", &ONScripter::getsavestrCommand}, {"getret", &ONScripter::getretCommand}, {"getreg", &ONScripter::getregCommand}, {"getparam2", &ONScripter::getparamCommand}, {"getparam", &ONScripter::getparamCommand}, {"getpageup", &ONScripter::getpageupCommand}, {"getpage", &ONScripter::getpageCommand}, {"getmp3vol", &ONScripter::getmp3volCommand}, {"getmousepos", &ONScripter::getmouseposCommand}, {"getmouseover", &ONScripter::getmouseoverCommand}, {"getmclick", &ONScripter::getmclickCommand}, {"getlog", &ONScripter::getlogCommand}, {"getinsert", &ONScripter::getinsertCommand}, {"getfunction", &ONScripter::getfunctionCommand}, {"getenter", &ONScripter::getenterCommand}, {"getcursorpos2", &ONScripter::getcursorpos2Command}, {"getcursorpos", &ONScripter::getcursorposCommand}, {"getcursor", &ONScripter::getcursorCommand}, {"getcselstr", &ONScripter::getcselstrCommand}, {"getcselnum", &ONScripter::getcselnumCommand}, {"getbtntimer", &ONScripter::gettimerCommand}, {"getbgmvol", &ONScripter::getmp3volCommand}, {"game", &ONScripter::gameCommand}, {"for", &ONScripter::forCommand}, {"filelog", &ONScripter::filelogCommand}, {"fileexist", &ONScripter::fileexistCommand}, {"existspbtn", &ONScripter::spbtnCommand}, {"exec_dll", &ONScripter::exec_dllCommand}, {"exbtn_d", &ONScripter::exbtnCommand}, {"exbtn", &ONScripter::exbtnCommand}, {"erasetextwindow", &ONScripter::erasetextwindowCommand}, {"english", &ONScripter::englishCommand}, {"end", &ONScripter::endCommand}, {"effectcut", &ONScripter::effectcutCommand}, {"effectblank", &ONScripter::effectblankCommand}, {"effect", &ONScripter::effectCommand}, {"dwavestop", &ONScripter::dwavestopCommand}, {"dwaveplayloop", &ONScripter::dwaveCommand}, {"dwaveplay", &ONScripter::dwaveCommand}, {"dwaveloop", &ONScripter::dwaveCommand}, {"dwaveload", &ONScripter::dwaveCommand}, {"dwave", &ONScripter::dwaveCommand}, {"drawtext", &ONScripter::drawtextCommand}, {"drawsp3", &ONScripter::drawsp3Command}, {"drawsp2", &ONScripter::drawsp2Command}, {"drawsp", &ONScripter::drawspCommand}, {"drawfill", &ONScripter::drawfillCommand}, {"drawclear", &ONScripter::drawclearCommand}, {"drawbg2", &ONScripter::drawbg2Command}, {"drawbg", &ONScripter::drawbgCommand}, {"draw", &ONScripter::drawCommand}, {"div", &ONScripter::divCommand}, {"dim", &ONScripter::dimCommand}, {"delay", &ONScripter::delayCommand}, {"defvoicevol", &ONScripter::defvoicevolCommand}, {"defsub", &ONScripter::defsubCommand}, {"defsevol", &ONScripter::defsevolCommand}, {"defmp3vol", &ONScripter::defmp3volCommand}, {"definereset", &ONScripter::defineresetCommand}, {"defaultspeed", &ONScripter::defaultspeedCommand}, {"defaultfont", &ONScripter::defaultfontCommand}, {"dec", &ONScripter::decCommand}, {"date", &ONScripter::dateCommand}, {"csp2", &ONScripter::cspCommand}, {"csp", &ONScripter::cspCommand}, {"cselgoto", &ONScripter::cselgotoCommand}, {"cselbtn", &ONScripter::cselbtnCommand}, {"csel", &ONScripter::selectCommand}, {"cos", &ONScripter::cosCommand}, {"cmp", &ONScripter::cmpCommand}, {"clickvoice", &ONScripter::clickvoiceCommand}, {"clickstr", &ONScripter::clickstrCommand}, {"click", &ONScripter::clickCommand}, {"cl", &ONScripter::clCommand}, {"chvol", &ONScripter::chvolCommand}, {"checkpage", &ONScripter::checkpageCommand}, {"checkkey", &ONScripter::checkkeyCommand}, {"cellcheckspbtn", &ONScripter::spbtnCommand}, {"cellcheckexbtn", &ONScripter::exbtnCommand}, {"cell", &ONScripter::cellCommand}, {"caption", &ONScripter::captionCommand}, {"btrans", &ONScripter::transbtnCommand}, {"btnwait2", &ONScripter::btnwaitCommand}, {"btnwait", &ONScripter::btnwaitCommand}, {"btntime2", &ONScripter::btntimeCommand}, {"btntime", &ONScripter::btntimeCommand}, {"btndown", &ONScripter::btndownCommand}, {"btndef", &ONScripter::btndefCommand}, {"btn", &ONScripter::btnCommand}, {"btime", &ONScripter::btntimeCommand}, {"bsp", &ONScripter::bspCommand}, {"break", &ONScripter::breakCommand}, {"br", &ONScripter::brCommand}, {"blt", &ONScripter::bltCommand}, {"bgmvol", &ONScripter::mp3volCommand}, {"bgmstop", &ONScripter::mp3stopCommand}, {"bgmonce", &ONScripter::mp3Command}, {"bgmfadeout", &ONScripter::mp3fadeoutCommand}, {"bgmfadein", &ONScripter::mp3fadeinCommand}, {"bgm", &ONScripter::mp3Command}, {"bgcpy", &ONScripter::bgcopyCommand}, {"bgcopy", &ONScripter::bgcopyCommand}, {"bg", &ONScripter::bgCommand}, {"bexec", &ONScripter::btnwaitCommand}, {"bdown", &ONScripter::bdownCommand}, {"bdef", &ONScripter::exbtnCommand}, {"bcursor", &ONScripter::getcursorCommand}, {"bclear", &ONScripter::btndefCommand}, {"barclear", &ONScripter::barclearCommand}, {"bar", &ONScripter::barCommand}, {"avi", &ONScripter::aviCommand}, {"automode_time", &ONScripter::automode_timeCommand}, {"automode", &ONScripter::mode_extCommand}, {"autoclick", &ONScripter::autoclickCommand}, {"atoi", &ONScripter::atoiCommand}, {"arc", &ONScripter::arcCommand}, {"amsp2", &ONScripter::amspCommand}, {"amsp", &ONScripter::amspCommand}, {"allspresume", &ONScripter::allspresumeCommand}, {"allsphide", &ONScripter::allsphideCommand}, {"allsp2resume", &ONScripter::allsp2resumeCommand}, {"allsp2hide", &ONScripter::allsp2hideCommand}, {"addkinsoku", &ONScripter::addkinsokuCommand}, {"add", &ONScripter::addCommand}, {"abssetcursor", &ONScripter::setcursorCommand}, {"", NULL} }; void ONScripter::makeFuncLUT() { for (int i='z'-'a' ; i>=0 ; i--) func_hash[i].func = NULL; int idx = 0; while (func_lut[idx].method){ int j = func_lut[idx].command[0]-'a'; if (func_hash[j].func == NULL) func_hash[j].func = func_lut+idx; func_hash[j].num = func_lut+idx - func_hash[j].func + 1; idx++; } } onscripter-20150820/ONScripter_effect.cpp0000644017777601777760000004305112565174244020053 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_effect.cpp - Effect executer of ONScripter * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #define EFFECT_STRIPE_WIDTH (16 * screen_ratio1 / screen_ratio2) #define EFFECT_STRIPE_CURTAIN_WIDTH (24 * screen_ratio1 / screen_ratio2) #define EFFECT_QUAKE_AMP (12 * screen_ratio1 / screen_ratio2) bool ONScripter::setEffect( EffectLink *effect, bool generate_effect_dst, bool update_backup_surface ) { if ( effect->effect == 0 ) return true; if (update_backup_surface) refreshSurface(backup_surface, &dirty_rect.bounding_box, REFRESH_NORMAL_MODE); int effect_no = effect->effect; if (effect_cut_flag && (skip_mode & SKIP_NORMAL || ctrl_pressed_status)) effect_no = 1; SDL_BlitSurface( accumulation_surface, NULL, effect_src_surface, NULL ); if (generate_effect_dst){ int refresh_mode = refreshMode(); if (update_backup_surface && refresh_mode == REFRESH_NORMAL_MODE){ SDL_BlitSurface( backup_surface, &dirty_rect.bounding_box, effect_dst_surface, &dirty_rect.bounding_box ); } else{ if (effect_no == 1) refreshSurface( effect_dst_surface, &dirty_rect.bounding_box, refresh_mode ); else refreshSurface( effect_dst_surface, NULL, refresh_mode ); } } /* Load mask image */ if ( effect_no == 15 || effect_no == 18 ){ if ( !effect->anim.image_surface ){ parseTaggedString( &effect->anim ); setupAnimationInfo( &effect->anim ); } } if ( effect_no == 11 || effect_no == 12 || effect_no == 13 || effect_no == 14 || effect_no == 16 || effect_no == 17 ) dirty_rect.fill( screen_width, screen_height ); if (effect_no == 99){ // dll-based if (effect->anim.image_name != NULL){ printf("dll effect: Got dll '%s'\n", effect->anim.image_name); if (!strncmp(effect->anim.image_name, "breakup.dll", 11)) initBreakup(effect->anim.image_name); dirty_rect.fill( screen_width, screen_height ); } } effect_counter = 0; effect_duration = effect->duration; if (skip_mode & SKIP_NORMAL || ctrl_pressed_status){ // shorten the duration of effects while skipping if ( effect_cut_flag ) effect_duration = 0; else if (effect_duration > 100){ effect_duration = effect_duration / 10; } else if (effect_duration > 10){ effect_duration = 10; } else { effect_duration = 1; } } return false; } bool ONScripter::doEffect( EffectLink *effect, bool clear_dirty_region ) { effect_start_time = SDL_GetTicks(); if ( effect_counter == 0 ) effect_start_time_old = effect_start_time - 1; //printf("effect_counter %d timer between %d %d\n",effect_counter,effect_start_time,effect_start_time_old); effect_timer_resolution = effect_start_time - effect_start_time_old; effect_start_time_old = effect_start_time; int effect_no = effect->effect; if (effect_cut_flag && (skip_mode & SKIP_NORMAL || ctrl_pressed_status)) effect_no = 1; int i, amp; int width, width2; int height, height2; SDL_Rect src_rect = screen_rect, dst_rect = screen_rect; SDL_Rect quake_rect = screen_rect; /* ---------------------------------------- */ /* Execute effect */ //printf("Effect number %d %d\n", effect_no, effect_duration ); bool not_implemented = false; switch ( effect_no ){ case 0: // Instant display case 1: // Instant display //drawEffect( &src_rect, &src_rect, effect_dst_surface ); break; case 2: // Left shutter width = EFFECT_STRIPE_WIDTH * effect_counter / effect_duration; for ( i=0 ; i= 0 ){ src_rect.x = i * EFFECT_STRIPE_CURTAIN_WIDTH; src_rect.y = 0; src_rect.w = width2; src_rect.h = screen_height; drawEffect(&src_rect, &src_rect, effect_dst_surface); } } break; case 7: // Right curtain width = EFFECT_STRIPE_CURTAIN_WIDTH * effect_counter * 2 / effect_duration; for ( i=0 ; i<=screen_width/EFFECT_STRIPE_CURTAIN_WIDTH ; i++ ){ width2 = width - EFFECT_STRIPE_CURTAIN_WIDTH * EFFECT_STRIPE_CURTAIN_WIDTH * i / screen_width; if ( width2 >= 0 ){ if ( width2 > EFFECT_STRIPE_CURTAIN_WIDTH ) width2 = EFFECT_STRIPE_CURTAIN_WIDTH; src_rect.x = screen_width - i * EFFECT_STRIPE_CURTAIN_WIDTH - width2; src_rect.y = 0; src_rect.w = width2; src_rect.h = screen_height; drawEffect(&src_rect, &src_rect, effect_dst_surface); } } break; case 8: // Top curtain height = EFFECT_STRIPE_CURTAIN_WIDTH * effect_counter * 2 / effect_duration; for ( i=0 ; i<=screen_height/EFFECT_STRIPE_CURTAIN_WIDTH ; i++ ){ height2 = height - EFFECT_STRIPE_CURTAIN_WIDTH * EFFECT_STRIPE_CURTAIN_WIDTH * i / screen_height; if ( height2 >= 0 ){ src_rect.x = 0; src_rect.y = i * EFFECT_STRIPE_CURTAIN_WIDTH; src_rect.w = screen_width; src_rect.h = height2; drawEffect(&src_rect, &src_rect, effect_dst_surface); } } break; case 9: // Bottom curtain height = EFFECT_STRIPE_CURTAIN_WIDTH * effect_counter * 2 / effect_duration; for ( i=0 ; i<=screen_height/EFFECT_STRIPE_CURTAIN_WIDTH ; i++ ){ height2 = height - EFFECT_STRIPE_CURTAIN_WIDTH * EFFECT_STRIPE_CURTAIN_WIDTH * i / screen_height; if ( height2 >= 0 ){ src_rect.x = 0; src_rect.y = screen_height - i * EFFECT_STRIPE_CURTAIN_WIDTH - height2; src_rect.w = screen_width; src_rect.h = height2; drawEffect(&src_rect, &src_rect, effect_dst_surface); } } break; default: not_implemented = true; case 10: // Cross fade height = 256 * effect_counter / effect_duration; alphaBlend( NULL, ALPHA_BLEND_CONST, height, &dirty_rect.bounding_box ); break; case 11: // Left scroll width = screen_width * effect_counter / effect_duration; src_rect.x = 0; dst_rect.x = width; src_rect.y = dst_rect.y = 0; src_rect.w = dst_rect.w = screen_width - width; src_rect.h = dst_rect.h = screen_height; drawEffect(&dst_rect, &src_rect, effect_src_surface); src_rect.x = screen_width - width - 1; dst_rect.x = 0; src_rect.y = dst_rect.y = 0; src_rect.w = dst_rect.w = width; src_rect.h = dst_rect.h = screen_height; drawEffect(&dst_rect, &src_rect, effect_dst_surface); break; case 12: // Right scroll width = screen_width * effect_counter / effect_duration; src_rect.x = width; dst_rect.x = 0; src_rect.y = dst_rect.y = 0; src_rect.w = dst_rect.w = screen_width - width; src_rect.h = dst_rect.h = screen_height; drawEffect(&dst_rect, &src_rect, effect_src_surface); src_rect.x = 0; dst_rect.x = screen_width - width - 1; src_rect.y = dst_rect.y = 0; src_rect.w = dst_rect.w = width; src_rect.h = dst_rect.h = screen_height; drawEffect(&dst_rect, &src_rect, effect_dst_surface); break; case 13: // Top scroll width = screen_height * effect_counter / effect_duration; src_rect.x = dst_rect.x = 0; src_rect.y = 0; dst_rect.y = width; src_rect.w = dst_rect.w = screen_width; src_rect.h = dst_rect.h = screen_height - width; drawEffect(&dst_rect, &src_rect, effect_src_surface); src_rect.x = dst_rect.x = 0; src_rect.y = screen_height - width - 1; dst_rect.y = 0; src_rect.w = dst_rect.w = screen_width; src_rect.h = dst_rect.h = width; drawEffect(&dst_rect, &src_rect, effect_dst_surface); break; case 14: // Bottom scroll width = screen_height * effect_counter / effect_duration; src_rect.x = dst_rect.x = 0; src_rect.y = width; dst_rect.y = 0; src_rect.w = dst_rect.w = screen_width; src_rect.h = dst_rect.h = screen_height - width; drawEffect(&dst_rect, &src_rect, effect_src_surface); src_rect.x = dst_rect.x = 0; src_rect.y = 0; dst_rect.y = screen_height - width - 1; src_rect.w = dst_rect.w = screen_width; src_rect.h = dst_rect.h = width; drawEffect(&dst_rect, &src_rect, effect_dst_surface); break; case 15: // Fade with mask alphaBlend( effect->anim.image_surface, ALPHA_BLEND_FADE_MASK, 256 * effect_counter / effect_duration, &dirty_rect.bounding_box ); break; case 16: // Mosaic out generateMosaic( effect_src_surface, 5 - 6 * effect_counter / effect_duration ); break; case 17: // Mosaic in generateMosaic( effect_dst_surface, 6 * effect_counter / effect_duration ); break; case 18: // Cross fade with mask alphaBlend( effect->anim.image_surface, ALPHA_BLEND_CROSSFADE_MASK, 256 * effect_counter * 2 / effect_duration, &dirty_rect.bounding_box ); break; case (MAX_EFFECT_NUM + 0): // quakey if ( effect_timer_resolution > effect_duration / 4 / effect->no ) effect_timer_resolution = effect_duration / 4 / effect->no; amp = (Sint16)(sin(M_PI * 2.0 * effect->no * effect_counter / effect_duration) * EFFECT_QUAKE_AMP * effect->no * (effect_duration - effect_counter) / effect_duration); dst_rect.x = 0; dst_rect.y = amp; drawEffect(&dst_rect, &src_rect, effect_dst_surface); if (amp >= 0){ quake_rect.y = 0; quake_rect.h = amp; } else{ quake_rect.y = screen_height + amp; quake_rect.h = -amp; } SDL_FillRect( accumulation_surface, &quake_rect, SDL_MapRGBA( accumulation_surface->format, 0, 0, 0, 0xff ) ); break; case (MAX_EFFECT_NUM + 1): // quakex if ( effect_timer_resolution > effect_duration / 4 / effect->no ) effect_timer_resolution = effect_duration / 4 / effect->no; amp = (Sint16)(sin(M_PI * 2.0 * effect->no * effect_counter / effect_duration) * EFFECT_QUAKE_AMP * effect->no * (effect_duration - effect_counter) / effect_duration); dst_rect.x = amp; dst_rect.y = 0; drawEffect(&dst_rect, &src_rect, effect_dst_surface); if (amp >= 0){ quake_rect.x = 0; quake_rect.w = amp; } else{ quake_rect.x = screen_width + amp; quake_rect.w = -amp; } SDL_FillRect( accumulation_surface, &quake_rect, SDL_MapRGBA( accumulation_surface->format, 0, 0, 0, 0xff ) ); break; case (MAX_EFFECT_NUM + 2): // quake dst_rect.x = effect->no*((int)(3.0*rand()/(RAND_MAX+1.0)) - 1) * 2; dst_rect.y = effect->no*((int)(3.0*rand()/(RAND_MAX+1.0)) - 1) * 2; SDL_FillRect( accumulation_surface, NULL, SDL_MapRGBA( accumulation_surface->format, 0, 0, 0, 0xff ) ); drawEffect(&dst_rect, &src_rect, effect_dst_surface); break; case 99: // dll-based if (effect->anim.image_name != NULL){ if (!strncmp(effect->anim.image_name, "breakup.dll", 11)){ effectBreakup(effect->anim.image_name, effect_duration); } else { // do crossfade height = 256 * effect_counter / effect_duration; alphaBlend( NULL, ALPHA_BLEND_CONST, height, &dirty_rect.bounding_box ); not_implemented = true; } } else { //just in case no dll is given // do crossfade height = 256 * effect_counter / effect_duration; alphaBlend( NULL, ALPHA_BLEND_CONST, height, &dirty_rect.bounding_box ); not_implemented = true; } break; } if (effect_counter == 0 && not_implemented) printf("effect No. %d not implemented; substituting crossfade\n", effect_no); //printf("effect conut %d / dur %d\n", effect_counter, effect_duration); effect_counter += effect_timer_resolution; event_mode = WAIT_INPUT_MODE; waitEvent(0); if ( !((automode_flag || autoclick_time > 0) || (usewheel_flag && current_button_state.button == -5) || (!usewheel_flag && current_button_state.button == -2)) ){ effect_counter = effect_duration; // interrupted } if ( effect_counter < effect_duration && effect_no != 1 ){ if ( effect_no != 0 ) flush( REFRESH_NONE_MODE, NULL, false ); return true; } else{ SDL_BlitSurface( effect_dst_surface, &dirty_rect.bounding_box, accumulation_surface, &dirty_rect.bounding_box ); if ( effect_no != 0 ) flush(REFRESH_NONE_MODE, NULL, clear_dirty_region); if ( effect_no == 1 ) effect_counter = 0; skip_mode &= ~SKIP_TO_EOL; event_mode = IDLE_EVENT_MODE; if (effect_blank != 0 && effect_counter != 0) waitEvent(effect_blank); return false; } } void ONScripter::drawEffect(SDL_Rect *dst_rect, SDL_Rect *src_rect, SDL_Surface *surface) { SDL_Rect clipped_rect; if (AnimationInfo::doClipping(dst_rect, &dirty_rect.bounding_box, &clipped_rect)) return; if (src_rect != dst_rect){ src_rect->x += clipped_rect.x; src_rect->y += clipped_rect.y; src_rect->w = clipped_rect.w; src_rect->h = clipped_rect.h; } SDL_BlitSurface(surface, src_rect, accumulation_surface, dst_rect); } void ONScripter::generateMosaic( SDL_Surface *src_surface, int level ) { int i, j, ii, jj; int width = 160; for ( i=0 ; i>= 1; #if defined(BPP16) int total_width = accumulation_surface->pitch / 2; #else int total_width = accumulation_surface->pitch / 4; #endif SDL_LockSurface( src_surface ); SDL_LockSurface( accumulation_surface ); ONSBuf *src_buffer = (ONSBuf *)src_surface->pixels; for ( i=screen_height-1 ; i>=0 ; i-=width ){ for ( j=0 ; jpixels + i*total_width + j; int height2 = width; if (i+1-width < 0) height2 = i+1; int width2 = width; if (j+width > screen_width) width2 = screen_width - j; for ( ii=height2 ; ii!=0 ; ii-- ){ for ( jj=width2 ; jj!=0 ; jj-- ){ *dst_buffer++ = p; } dst_buffer -= total_width + width2; } } } SDL_UnlockSurface( accumulation_surface ); SDL_UnlockSurface( src_surface ); } onscripter-20150820/DirtyRect.cpp0000644017777601777760000000562312565174244016423 0ustar nobodynogroup/* -*- C++ -*- * * DirtyRect.cpp - Invalid region on text_surface which should be updated * * Copyright (c) 2001-2012 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "DirtyRect.h" DirtyRect::DirtyRect() { screen_width = screen_height = 0; bounding_box.w = bounding_box.h = 0; } DirtyRect::DirtyRect( const DirtyRect &d ) { screen_width = d.screen_width; screen_height = d.screen_height; bounding_box = d.bounding_box; } DirtyRect& DirtyRect::operator =( const DirtyRect &d ) { screen_width = d.screen_width; screen_height = d.screen_height; bounding_box = d.bounding_box; return *this; } DirtyRect::~DirtyRect() { } void DirtyRect::setDimension(int w, int h) { screen_width = w; screen_height = h; } void DirtyRect::add( SDL_Rect src ) { //printf("add %d %d %d %d\n", src.x, src.y, src.w, src.h ); if ( src.w == 0 || src.h == 0 ) return; if (src.x < 0){ if (src.w < -src.x) return; src.w += src.x; src.x = 0; } if (src.y < 0){ if (src.h < -src.y) return; src.h += src.y; src.y = 0; } if (src.x >= screen_width) return; if (src.x+src.w >= screen_width) src.w = screen_width-src.x; if (src.y >= screen_height) return; if (src.y+src.h >= screen_height) src.h = screen_height-src.y; bounding_box = calcBoundingBox( bounding_box, src ); } SDL_Rect DirtyRect::calcBoundingBox( SDL_Rect src1, SDL_Rect &src2 ) { if ( src2.w == 0 || src2.h == 0 ){ return src1; } if ( src1.w == 0 || src1.h == 0 ){ return src2; } if ( src1.x > src2.x ){ src1.w += src1.x - src2.x; src1.x = src2.x; } if ( src1.y > src2.y ){ src1.h += src1.y - src2.y; src1.y = src2.y; } if ( src1.x + src1.w < src2.x + src2.w ){ src1.w = src2.x + src2.w - src1.x; } if ( src1.y + src1.h < src2.y + src2.h ){ src1.h = src2.y + src2.h - src1.y; } return src1; } void DirtyRect::clear() { bounding_box.w = bounding_box.h = 0; } void DirtyRect::fill( int w, int h ) { bounding_box.x = bounding_box.y = 0; bounding_box.w = w; bounding_box.h = h; } onscripter-20150820/SarReader.h0000644017777601777760000000453512565174244016030 0ustar nobodynogroup/* -*- C++ -*- * * SarReader.h - Reader from a SAR archive * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __SAR_READER_H__ #define __SAR_READER_H__ #include "DirectReader.h" class SarReader : public DirectReader { public: SarReader( const char *path=NULL, const unsigned char *key_table=NULL ); ~SarReader(); int open( const char *name=NULL ); int close(); const char *getArchiveName() const; int getNumFiles(); size_t getFileLength( const char *file_name ); size_t getFile( const char *file_name, unsigned char *buf, int *location=NULL ); FileInfo getFileByIndex( unsigned int index ); int writeHeader( FILE *fp ); size_t putFile( FILE *fp, int no, size_t offset, size_t length, size_t original_length, bool modified_flag, unsigned char *buffer ); protected: ArchiveInfo archive_info; ArchiveInfo *root_archive_info, *last_archive_info; int num_of_sar_archives; void readArchive( ArchiveInfo *ai, int archive_type = ARCHIVE_TYPE_SAR, unsigned int offset=0 ); int readArchiveSub( ArchiveInfo *ai, int archive_type = ARCHIVE_TYPE_SAR, bool check_size = true ); int getIndexFromFile( ArchiveInfo *ai, const char *file_name ); size_t getFileSub( ArchiveInfo *ai, const char *file_name, unsigned char *buf ); int writeHeaderSub( ArchiveInfo *ai, FILE *fp, int archive_type = ARCHIVE_TYPE_SAR, int nsa_offset=0 ); size_t putFileSub( ArchiveInfo *ai, FILE *fp, int no, size_t offset, size_t length, size_t original_length, int compression_type, bool modified_flag, unsigned char *buffer ); }; #endif // __SAR_READER_H__ onscripter-20150820/FontInfo.cpp0000644017777601777760000002014712565174244016232 0ustar nobodynogroup/* -*- C++ -*- * * FontInfo.cpp - Font information storage class of ONScripter * * Copyright (c) 2001-2013 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "FontInfo.h" #include #include #if defined(PSP) #include #include extern int psp_power_resume_number; #endif static struct FontContainer{ FontContainer *next; int size; TTF_Font *font[2]; #if defined(PSP) SDL_RWops *rw_ops; int power_resume_number; char name[256]; #endif FontContainer(){ size = 0; next = NULL; font[0] = font[1] = NULL; #if defined(PSP) rw_ops = NULL; power_resume_number = 0; #endif }; } root_font_container; FontInfo::FontInfo() { ttf_font[0] = ttf_font[1] = NULL; color[0] = color[1] = color[2] = 0xff; on_color[0] = on_color[1] = on_color[2] = 0xff; off_color[0] = off_color[1] = off_color[2] = 0xaa; nofile_color[0] = 0x55; nofile_color[1] = 0x55; nofile_color[2] = 0x99; rubyon_flag = false; reset(); } void FontInfo::reset() { tateyoko_mode = YOKO_MODE; clear(); is_bold = true; is_shadow = true; is_transparent = true; is_newline_accepted = false; } void *FontInfo::openFont( char *font_file, int ratio1, int ratio2 ) { int font_size; if ( font_size_xy[0] < font_size_xy[1] ) font_size = font_size_xy[0]; else font_size = font_size_xy[1]; FontContainer *fc = &root_font_container; while( fc->next ){ if ( fc->next->size == font_size ) break; fc = fc->next; } if ( !fc->next ){ fc->next = new FontContainer(); fc->next->size = font_size; FILE *fp = fopen( font_file, "r" ); if ( fp == NULL ) return NULL; fclose( fp ); #if defined(PSP) fc->next->rw_ops = SDL_RWFromFile(font_file, "r"); fc->next->font[0] = TTF_OpenFontRW( fc->next->rw_ops, SDL_TRUE, font_size * ratio1 / ratio2 ); #if (SDL_TTF_MAJOR_VERSION>=2) && (SDL_TTF_MINOR_VERSION>=0) && (SDL_TTF_PATCHLEVEL>=10) fc->next->font[1] = TTF_OpenFontRW( fc->next->rw_ops, SDL_TRUE, font_size * ratio1 / ratio2 ); TTF_SetFontOutline(fc->next->font[1], 1); #endif fc->next->power_resume_number = psp_power_resume_number; strcpy(fc->next->name, font_file); #else fc->next->font[0] = TTF_OpenFont( font_file, font_size * ratio1 / ratio2 ); #if (SDL_TTF_MAJOR_VERSION>=2) && (SDL_TTF_MINOR_VERSION>=0) && (SDL_TTF_PATCHLEVEL>=10) fc->next->font[1] = TTF_OpenFont( font_file, font_size * ratio1 / ratio2 ); TTF_SetFontOutline(fc->next->font[1], 1); #endif #endif } #if defined(PSP) else if (fc->next->power_resume_number != psp_power_resume_number){ FILE *fp = fopen(fc->next->name, "r"); fc->next->rw_ops->hidden.stdio.fp = fp; fc->next->power_resume_number = psp_power_resume_number; } #endif ttf_font[0] = (void*)fc->next->font[0]; ttf_font[1] = (void*)fc->next->font[1]; return fc->next->font; } void FontInfo::setTateyokoMode( int tateyoko_mode ) { this->tateyoko_mode = tateyoko_mode; clear(); } int FontInfo::getTateyokoMode() { return tateyoko_mode; } int FontInfo::getRemainingLine() { if (tateyoko_mode == YOKO_MODE) return num_xy[1] - xy[1]/2; else return num_xy[1] - num_xy[0] + xy[0]/2 + 1; } int FontInfo::x(bool use_ruby_offset) { int x = xy[0]*pitch_xy[0]/2 + top_xy[0] + line_offset_xy[0]; if (use_ruby_offset && rubyon_flag && tateyoko_mode == TATE_MODE) x += font_size_xy[0] - pitch_xy[0]; return x; } int FontInfo::y(bool use_ruby_offset) { int y = xy[1]*pitch_xy[1]/2 + top_xy[1] + line_offset_xy[1]; if (use_ruby_offset && rubyon_flag && tateyoko_mode == YOKO_MODE) y += pitch_xy[1] - font_size_xy[1]; return y; } void FontInfo::setXY( int x, int y ) { if ( x != -1 ) xy[0] = x*2; if ( y != -1 ) xy[1] = y*2; } void FontInfo::clear() { if (tateyoko_mode == YOKO_MODE) setXY(0, 0); else setXY(num_xy[0]-1, 0); line_offset_xy[0] = line_offset_xy[1] = 0; } void FontInfo::newLine() { if (tateyoko_mode == YOKO_MODE){ xy[0] = 0; xy[1] += 2; } else{ xy[0] -= 2; xy[1] = 0; } line_offset_xy[0] = line_offset_xy[1] = 0; } void FontInfo::setLineArea(int num) { num_xy[tateyoko_mode] = num; num_xy[1-tateyoko_mode] = 1; } bool FontInfo::isEndOfLine(int margin) { if (xy[tateyoko_mode] + margin >= num_xy[tateyoko_mode]*2) return true; return false; } bool FontInfo::isLineEmpty() { if (xy[tateyoko_mode] == 0) return true; return false; } void FontInfo::advanceCharInHankaku(int offset) { xy[tateyoko_mode] += offset; } void FontInfo::addLineOffset(int offset) { line_offset_xy[tateyoko_mode] += offset; } SDL_Rect FontInfo::calcUpdatedArea(int start_xy[2], int ratio1, int ratio2) { SDL_Rect rect; if (tateyoko_mode == YOKO_MODE){ if (start_xy[1] == xy[1]){ rect.x = top_xy[0] + pitch_xy[0]*start_xy[0]/2; rect.w = pitch_xy[0]*(xy[0]-start_xy[0])/2+1; } else{ rect.x = top_xy[0]; rect.w = pitch_xy[0]*num_xy[0]; } rect.y = top_xy[1] + start_xy[1]*pitch_xy[1]/2; rect.h = font_size_xy[1] + pitch_xy[1]*(xy[1]-start_xy[1])/2; if (rubyon_flag) rect.h += pitch_xy[1] - font_size_xy[1]; } else{ rect.x = top_xy[0] + pitch_xy[0]*xy[0]/2; rect.w = font_size_xy[0] + pitch_xy[0]*(start_xy[0]-xy[0])/2; if (rubyon_flag) rect.w += font_size_xy[0]-pitch_xy[0]; if (start_xy[0] == xy[0]){ rect.y = top_xy[1] + pitch_xy[1]*start_xy[1]/2; rect.h = pitch_xy[1]*(xy[1]-start_xy[1])/2+1; } else{ rect.y = top_xy[1]; rect.h = pitch_xy[1]*num_xy[1]; } num_xy[0] = (xy[0]-start_xy[0])/2+1; } return rect; } void FontInfo::addShadeArea(SDL_Rect &rect, int dx, int dy, int dw, int dh) { rect.x += dx; rect.y += dy; rect.w += dw; rect.h += dh; } int FontInfo::initRuby(FontInfo &body_info, int body_count, int ruby_count) { if ((tateyoko_mode == YOKO_MODE && body_count + body_info.xy[0]/2 >= body_info.num_xy[0]-1) || (tateyoko_mode == TATE_MODE && body_count + body_info.xy[1]/2 > body_info.num_xy[1])) body_info.newLine(); top_xy[0] = body_info.x(); top_xy[1] = body_info.y(); pitch_xy[0] = font_size_xy[0]; pitch_xy[1] = font_size_xy[1]; int margin=0; if (tateyoko_mode == YOKO_MODE){ top_xy[1] -= font_size_xy[1]; num_xy[0] = ruby_count; num_xy[1] = 1; } else{ top_xy[0] += body_info.font_size_xy[0]; num_xy[0] = 1; num_xy[1] = ruby_count; } if (ruby_count*font_size_xy[tateyoko_mode] >= body_count*body_info.pitch_xy[tateyoko_mode]){ margin = (ruby_count*font_size_xy[tateyoko_mode] - body_count*body_info.pitch_xy[tateyoko_mode] + 1)/2; } else{ int offset = 0; if (ruby_count > 0) offset = (body_count*body_info.pitch_xy[tateyoko_mode] - ruby_count*font_size_xy[tateyoko_mode] + ruby_count) / (ruby_count*2); top_xy[tateyoko_mode] += offset; pitch_xy[tateyoko_mode] += offset*2; } body_info.line_offset_xy[tateyoko_mode] += margin; clear(); return margin; } onscripter-20150820/Makefile.Linux0000644017777601777760000000351112565174244016536 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.Linux - Makefile rules for linux # EXESUFFIX = OBJSUFFIX = .o .SUFFIXES: .SUFFIXES: $(OBJSUFFIX) .cpp .h TARGET = onscripter$(EXESUFFIX) \ sardec$(EXESUFFIX) \ nsadec$(EXESUFFIX) \ sarconv$(EXESUFFIX) \ nsaconv$(EXESUFFIX) EXT_OBJS = # mandatory: SDL, SDL_ttf, SDL_image, SDL_mixer, bzip2, libjpeg DEFS = -DLINUX INCS = `sdl-config --cflags` LIBS = `sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -ljpeg -lm # recommended: smpeg DEFS += -DUSE_SMPEG INCS += `smpeg-config --cflags` LIBS += `smpeg-config --libs` # recommended: fontconfig (to get default font) DEFS += -DUSE_FONTCONFIG LIBS += -lfontconfig # recommended: OggVorbis DEFS += -DUSE_OGG_VORBIS LIBS += -logg -lvorbis -lvorbisfile # optional: Integer OggVorbis #DEFS += -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS #LIBS += -lvorbisidec # optional: support CD audio DEFS += -DUSE_CDROM # optional: avifile DEFS += -DUSE_AVIFILE INCS += `avifile-config --cflags` LIBS += `avifile-config --libs` TARGET += simple_aviplay$(EXESUFFIX) EXT_OBJS += AVIWrapper$(OBJSUFFIX) # optional: lua DEFS += -DUSE_LUA INCS += -I/usr/include/lua5.1 LIBS += -llua5.1 EXT_OBJS += LUAHandler$(OBJSUFFIX) # optional: force screen width for PDA #DEFS += -DPDA_WIDTH=640 # optional: enable English mode #DEFS += -DENABLE_1BYTE_CHAR -DFORCE_1BYTE_CHAR # for GNU g++ CC = g++ LD = g++ -o #CFLAGS = -g -Wall -pipe -c $(INCS) $(DEFS) CFLAGS = -O3 -Wall -fomit-frame-pointer -pipe -c $(INCS) $(DEFS) # for GCC on PowerPC specfied #CC = powerpc-unknown-linux-gnu-g++ #LD = powerpc-unknown-linux-gnu-g++ -o #CFLAGS = -O3 -mtune=G4 -maltivec -mabi=altivec -mpowerpc-gfxopt -mmultiple -mstring -Wall -fomit-frame-pointer -pipe -c $(INCS) $(DEFS) # for Intel compiler #CC = icc #LD = icc -o #CFLAGS = -O3 -tpp6 -xK -c $(INCS) $(DEFS) RM = rm -f include Makefile.onscripter onscripter-20150820/ONScripter_animation.cpp0000644017777601777760000004006612565174244020601 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_animation.cpp - Methods to manipulate AnimationInfo * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #define DEFAULT_CURSOR_WAIT ":l/3,160,2;cursor0.bmp" #define DEFAULT_CURSOR_NEWPAGE ":l/3,160,2;cursor1.bmp" int ONScripter::calcDurationToNextAnimation() { int min = -1; // minimum duration for (int i=0 ; i<3 ; i++){ AnimationInfo *anim = &tachi_info[i]; if (anim->visible && anim->is_animatable){ if (min == -1 || min > anim->remaining_time) min = anim->remaining_time; } } for (int i=MAX_SPRITE_NUM-1 ; i>=0 ; i--){ AnimationInfo *anim = &sprite_info[i]; if (anim->visible && anim->is_animatable){ if (min == -1 || min > anim->remaining_time) min = anim->remaining_time; } } if (!textgosub_label && (clickstr_state == CLICK_WAIT || clickstr_state == CLICK_NEWPAGE)){ AnimationInfo *anim; if (clickstr_state == CLICK_WAIT) anim = &cursor_info[0]; else if (clickstr_state == CLICK_NEWPAGE) anim = &cursor_info[1]; if (anim->visible && anim->is_animatable){ if (min == -1 || min > anim->remaining_time) min = anim->remaining_time; } } #ifdef USE_LUA if (lua_handler.is_animatable && !script_h.isExternalScript()){ if (min == -1 || min > lua_handler.remaining_time) min = lua_handler.remaining_time; } #endif if (min == -1) min = 0; return min; } void ONScripter::stepAnimation(int t) { for (int i=0 ; i<3 ; i++) tachi_info[i].stepAnimation(t); for (int i=MAX_SPRITE_NUM-1 ; i>=0 ; i--) sprite_info[i].stepAnimation(t); #ifdef USE_LUA if (lua_handler.is_animatable && !script_h.isExternalScript()) lua_handler.remaining_time -= t; #endif if (!textgosub_label){ if (clickstr_state == CLICK_WAIT) cursor_info[0].stepAnimation(t); else if (clickstr_state == CLICK_NEWPAGE) cursor_info[1].stepAnimation(t); } } void ONScripter::proceedAnimation() { for (int i=0 ; i<3 ; i++) if (tachi_info[i].proceedAnimation()) flushDirect(tachi_info[i].pos, refreshMode() | (draw_cursor_flag?REFRESH_CURSOR_MODE:0)); for (int i=MAX_SPRITE_NUM-1 ; i>=0 ; i--) if (sprite_info[i].proceedAnimation()) flushDirect(sprite_info[i].pos, refreshMode() | (draw_cursor_flag?REFRESH_CURSOR_MODE:0)); #ifdef USE_LUA if (lua_handler.is_animatable && !script_h.isExternalScript()){ if (lua_handler.remaining_time == 0){ lua_handler.remaining_time = lua_handler.duration_time; int tmp_event_mode = event_mode; int tmp_remaining_time = remaining_time; int tmp_string_buffer_offset = string_buffer_offset; char *current = script_h.getCurrent(); if (lua_handler.isCallbackEnabled(LUAHandler::LUA_ANIMATION)) if (lua_handler.callFunction(true, "animation")) errorAndExit( lua_handler.error_str ); script_h.setCurrent(current); readToken(); string_buffer_offset = tmp_string_buffer_offset; remaining_time = tmp_remaining_time; event_mode = tmp_event_mode; } } #endif if (!textgosub_label && (clickstr_state == CLICK_WAIT || clickstr_state == CLICK_NEWPAGE)){ AnimationInfo *anim; if (clickstr_state == CLICK_WAIT) anim = &cursor_info[0]; else if (clickstr_state == CLICK_NEWPAGE) anim = &cursor_info[1]; if (anim->proceedAnimation()){ SDL_Rect dst_rect = anim->pos; if (!anim->abs_flag){ dst_rect.x += sentence_font.x() * screen_ratio1 / screen_ratio2; dst_rect.y += sentence_font.y() * screen_ratio1 / screen_ratio2; } flushDirect( dst_rect, refreshMode() | (draw_cursor_flag?REFRESH_CURSOR_MODE:0) ); } } } void ONScripter::setupAnimationInfo( AnimationInfo *anim, FontInfo *info ) { if (anim->trans_mode != AnimationInfo::TRANS_STRING && anim->file_name && anim->surface_name && strcmp(anim->file_name, anim->surface_name) == 0 && ((!anim->mask_file_name && !anim->mask_surface_name) || (anim->mask_file_name && !anim->mask_surface_name && strcmp(anim->mask_file_name, anim->mask_surface_name) == 0))) return; anim->deleteSurface(); anim->abs_flag = true; anim->surface_name = new char[ strlen(anim->file_name) + 1 ]; strcpy( anim->surface_name, anim->file_name ); if (anim->mask_file_name){ anim->mask_surface_name = new char[ strlen(anim->mask_file_name) + 1 ]; strcpy( anim->mask_surface_name, anim->mask_file_name ); } if ( anim->trans_mode == AnimationInfo::TRANS_STRING ){ FontInfo f_info = sentence_font; if (info) f_info = *info; f_info.rubyon_flag = anim->is_ruby_drawable; if ( anim->font_size_xy[0] >= 0 ){ // in case of Sprite, not rclick menu f_info.setTateyokoMode(0); f_info.top_xy[0] = anim->orig_pos.x; f_info.top_xy[1] = anim->orig_pos.y; if (anim->is_single_line) f_info.setLineArea( strlen(anim->file_name)/2+1 ); f_info.clear(); f_info.font_size_xy[0] = anim->font_size_xy[0]; f_info.font_size_xy[1] = anim->font_size_xy[1]; f_info.pitch_xy[0] = anim->font_pitch[0]; f_info.pitch_xy[1] = anim->font_pitch[1]; f_info.ttf_font[0] = NULL; f_info.ttf_font[1] = NULL; } if (f_info.ttf_font[0] == NULL) f_info.openFont( font_file, screen_ratio1, screen_ratio2 ); SDL_Rect pos; if (anim->is_tight_region){ drawString( anim->file_name, anim->color_list[ anim->current_cell ], &f_info, false, NULL, &pos ); } else{ int xy_bak[2]; xy_bak[0] = f_info.xy[0]; xy_bak[1] = f_info.xy[1]; int xy[2] = {0, 0}; f_info.setXY(f_info.num_xy[0]-1, f_info.num_xy[1]-1); pos = f_info.calcUpdatedArea(xy, screen_ratio1, screen_ratio2); f_info.xy[0] = xy_bak[0]; f_info.xy[1] = xy_bak[1]; } if (info != NULL){ info->xy[0] = f_info.xy[0]; info->xy[1] = f_info.xy[1]; } anim->orig_pos.w = pos.w; anim->orig_pos.h = pos.h; anim->scalePosWH( screen_ratio1, screen_ratio2 ); anim->allocImage( anim->pos.w*anim->num_of_cells, anim->pos.h, texture_format ); anim->fill( 0, 0, 0, 0 ); f_info.top_xy[0] = f_info.top_xy[1] = 0; for ( int i=0 ; inum_of_cells ; i++ ){ f_info.clear(); drawString( anim->file_name, anim->color_list[i], &f_info, false, NULL, NULL, anim ); f_info.top_xy[0] += anim->orig_pos.w; } } else{ bool has_alpha; int location; SDL_Surface *surface = loadImage( anim->file_name, &has_alpha, &location ); SDL_Surface *surface_m = NULL; if (anim->trans_mode == AnimationInfo::TRANS_MASK) surface_m = loadImage( anim->mask_file_name ); surface = anim->setupImageAlpha(surface, surface_m, has_alpha); if (surface && screen_ratio2 != screen_ratio1 && (!disable_rescale_flag || location == BaseReader::ARCHIVE_TYPE_NONE)) { SDL_Surface *src_s = surface; int w, h; if ( (w = src_s->w * screen_ratio1 / screen_ratio2) == 0 ) w = 1; if ( (h = src_s->h * screen_ratio1 / screen_ratio2) == 0 ) h = 1; SDL_PixelFormat *fmt = image_surface->format; surface = SDL_CreateRGBSurface( SDL_SWSURFACE, w, h, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask ); resizeSurface(src_s, surface); SDL_FreeSurface(src_s); } anim->setImage( surface, texture_format ); if ( surface_m ) SDL_FreeSurface(surface_m); } } void ONScripter::parseTaggedString( AnimationInfo *anim ) { if (anim->image_name == NULL) return; anim->removeTag(); int i; char *buffer = anim->image_name; anim->num_of_cells = 1; anim->trans_mode = trans_mode; if ( buffer[0] == ':' ){ while (*++buffer == ' '); if ( buffer[0] == 'a' ){ anim->trans_mode = AnimationInfo::TRANS_ALPHA; buffer++; } else if ( buffer[0] == 'l' ){ anim->trans_mode = AnimationInfo::TRANS_TOPLEFT; buffer++; } else if ( buffer[0] == 'r' ){ anim->trans_mode = AnimationInfo::TRANS_TOPRIGHT; buffer++; } else if ( buffer[0] == 'c' ){ anim->trans_mode = AnimationInfo::TRANS_COPY; buffer++; } else if ( buffer[0] == 's' ){ anim->trans_mode = AnimationInfo::TRANS_STRING; buffer++; anim->num_of_cells = 0; if ( *buffer == '/' ){ buffer++; script_h.getNext(); script_h.pushCurrent( buffer ); anim->font_size_xy[0] = script_h.readInt(); anim->font_size_xy[1] = script_h.readInt(); anim->font_pitch[0] = anim->font_size_xy[0]; anim->font_pitch[1] = anim->font_size_xy[0]; // dummy if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ anim->font_pitch[0] += script_h.readInt(); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ script_h.readInt(); // 0 ... normal, 1 ... no anti-aliasing, 2 ... Fukuro } } buffer = script_h.getNext(); script_h.popCurrent(); } else{ anim->font_size_xy[0] = sentence_font.font_size_xy[0]; anim->font_size_xy[1] = sentence_font.font_size_xy[1]; anim->font_pitch[0] = sentence_font.pitch_xy[0]; anim->font_pitch[1] = sentence_font.pitch_xy[1]; } while(buffer[0] != '#' && buffer[0] != '\0') buffer++; i=0; while( buffer[i] == '#' ){ anim->num_of_cells++; i += 7; } anim->color_list = new uchar3[ anim->num_of_cells ]; for ( i=0 ; inum_of_cells ; i++ ){ readColor( &anim->color_list[i], buffer ); buffer += 7; } } else if ( buffer[0] == 'm' ){ anim->trans_mode = AnimationInfo::TRANS_MASK; char *start = ++buffer; while(buffer[0] != ';' && buffer[0] != 0x0a && buffer[0] != '\0') buffer++; if (buffer[0] == ';') setStr( &anim->mask_file_name, start, buffer-start ); } else if ( buffer[0] == '#' ){ anim->trans_mode = AnimationInfo::TRANS_DIRECT; readColor( &anim->direct_color, buffer ); buffer += 7; } else if ( buffer[0] == '!' ){ anim->trans_mode = AnimationInfo::TRANS_PALLETTE; buffer++; anim->pallette_number = getNumberFromBuffer( (const char**)&buffer ); } if (anim->trans_mode != AnimationInfo::TRANS_STRING) while(buffer[0] != '/' && buffer[0] != ';' && buffer[0] != '\0') buffer++; } if ( buffer[0] == '/' && anim->trans_mode != AnimationInfo::TRANS_STRING){ buffer++; anim->num_of_cells = getNumberFromBuffer( (const char**)&buffer ); if ( anim->num_of_cells == 0 ){ fprintf( stderr, "ONScripter::parseTaggedString The number of cells is 0\n"); return; } anim->duration_list = new int[ anim->num_of_cells ]; if (*buffer == ','){ buffer++; if ( *buffer == '<' ){ buffer++; for ( i=0 ; inum_of_cells ; i++ ){ anim->duration_list[i] = getNumberFromBuffer( (const char**)&buffer ); buffer++; } } else{ anim->duration_list[0] = getNumberFromBuffer( (const char**)&buffer ); for ( i=1 ; inum_of_cells ; i++ ) anim->duration_list[i] = anim->duration_list[0]; } anim->remaining_time = anim->duration_list[0]; buffer++; anim->loop_mode = *buffer++ - '0'; // 3...no animation } else{ for ( i=0 ; inum_of_cells ; i++ ) anim->duration_list[0] = 0; anim->loop_mode = 3; // 3...no animation } if ( anim->loop_mode != 3 ) anim->is_animatable = true; while(buffer[0] != ';' && buffer[0] != '\0') buffer++; } if ( buffer[0] == ';' && anim->trans_mode != AnimationInfo::TRANS_STRING) buffer++; if ( anim->trans_mode == AnimationInfo::TRANS_STRING && buffer[0] == '$' ){ script_h.pushCurrent( buffer ); setStr( &anim->file_name, script_h.readStr() ); script_h.popCurrent(); } else{ setStr( &anim->file_name, buffer ); } } void ONScripter::drawTaggedSurface( SDL_Surface *dst_surface, AnimationInfo *anim, SDL_Rect &clip ) { SDL_Rect poly_rect = anim->pos; if ( !anim->abs_flag ){ poly_rect.x += sentence_font.x() * screen_ratio1 / screen_ratio2; poly_rect.y += sentence_font.y() * screen_ratio1 / screen_ratio2; } if (!anim->affine_flag) anim->blendOnSurface( dst_surface, poly_rect.x, poly_rect.y, clip, anim->trans ); else anim->blendOnSurface2( dst_surface, poly_rect.x, poly_rect.y, clip, anim->trans ); } void ONScripter::stopAnimation( int click ) { int no; if ( textgosub_label ) return; if ( click == CLICK_WAIT ) no = 0; else if ( click == CLICK_NEWPAGE ) no = 1; else return; if (cursor_info[no].image_surface == NULL) return; SDL_Rect dst_rect = cursor_info[ no ].pos; if ( !cursor_info[ no ].abs_flag ){ dst_rect.x += sentence_font.x() * screen_ratio1 / screen_ratio2; dst_rect.y += sentence_font.y() * screen_ratio1 / screen_ratio2; } flushDirect( dst_rect, refreshMode() ); } void ONScripter::loadCursor(int no, const char *str, int x, int y, bool abs_flag) { AnimationInfo *ai = &cursor_info[no]; if (str){ ai->setImageName( str ); } else{ if (no == 0) ai->setImageName( DEFAULT_CURSOR_WAIT ); else ai->setImageName( DEFAULT_CURSOR_NEWPAGE ); } ai->orig_pos.x = x; ai->orig_pos.y = y; ai->scalePosXY( screen_ratio1, screen_ratio2 ); parseTaggedString( ai ); setupAnimationInfo( ai ); if ( filelog_flag ) script_h.findAndAddLog( script_h.log_info[ScriptHandler::FILE_LOG], ai->file_name, true ); // a trick for save file ai->abs_flag = abs_flag; if ( ai->image_surface ) ai->visible = true; else ai->remove(); if (str == NULL){ if (no == 0) ai->deleteImageName(); else ai->deleteImageName(); } } onscripter-20150820/Makefile.iPodLinux0000644017777601777760000000223312565174244017352 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.iPodLinux - Makefile rules for uCLinux on iPod (photo/nano/video) # Thanks Shiikuru-san # # Playing movie and audio is not supported. # PREF = /usr/local/arm-uclinux-tools/arm-uclinux-elf INCS = `$(PREF)/bin/sdl-config --cflags` `$(PREF)/bin/freetype-config --cflags` LIBS = `$(PREF)/bin/sdl-config --libs` -lSDL_ttf -lSDL_image -lSDL_mixer -lSDL -lfreetype -ljpeg -lbz2 # for iPod 5G (video) : 320x240 #DEFS = -DIPODLINUX -DLINUX -DPDA_WIDTH=320 -DBPP16 # for iPod photo : 220x176 -> 220x165 #DEFS = -DIPODLINUX -DLINUX -DPDA_WIDTH=220 -DBPP16 # for iPod nano : 176x132 #DEFS = -DIPODLINUX -DLINUX -DPDA_WIDTH=176 -DBPP16 # for iPod (nano, photo, 4G color, 5G) : Auto DEFS = -DIPODLINUX -DLINUX -DPDA_AUTOSIZE -DBPP16 EXESUFFIX = OBJSUFFIX = .o .SUFFIXES: .SUFFIXES: $(OBJSUFFIX) .cpp .h CC = arm-uclinux-elf-g++ LD = arm-uclinux-elf-g++ -Wl,-elf2flt -o CFLAGS = -O3 -Wall -fno-exceptions -fno-rtti -fno-check-new -fomit-frame-pointer -pipe -c $(INCS) $(DEFS) RM = rm -f TARGET = onscripter$(EXESUFFIX) nsaconv$(EXESUFFIX) sarconv$(EXESUFFIX) nsadec$(EXESUFFIX) sardec$(EXESUFFIX) EXT_OBJS = include Makefile.onscripter onscripter-20150820/resize_image.h0000644017777601777760000000226712565174244016623 0ustar nobodynogroup/* -*- C++ -*- * * resize_image.h - resize image using smoothing and resampling * * Copyright (c) 2001-2004 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ void resizeImage( unsigned char *dst_buffer, int dst_width, int dst_height, int dst_total_width, unsigned char *src_buffer, int src_width, int src_height, int src_total_width, int byte_per_pixel, unsigned char *tmp_buffer, int tmp_total_width, bool palette_flag ); onscripter-20150820/ONScripter_sound.cpp0000644017777601777760000003304312565174244017747 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter_sound.cpp - Methods for playing sound * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #include #if defined(LINUX) #include #endif #ifdef ANDROID extern "C" { #include #include static JavaVM *jniVM = NULL; static jobject JavaONScripter = NULL; static jmethodID JavaPlayVideo = NULL; JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { jniVM = vm; return JNI_VERSION_1_2; }; JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { jniVM = vm; }; #ifndef SDL_JAVA_PACKAGE_PATH #error You have to define SDL_JAVA_PACKAGE_PATH to your package path with dots replaced with underscores, for example "com_example_SanAngeles" #endif #define JAVA_EXPORT_NAME2(name,package) Java_##package##_##name #define JAVA_EXPORT_NAME1(name,package) JAVA_EXPORT_NAME2(name,package) #define JAVA_EXPORT_NAME(name) JAVA_EXPORT_NAME1(name,SDL_JAVA_PACKAGE_PATH) JNIEXPORT jint JNICALL JAVA_EXPORT_NAME(ONScripter_nativeInitJavaCallbacks) (JNIEnv * jniEnv, jobject thiz) { JavaONScripter = jniEnv->NewGlobalRef(thiz); jclass JavaONScripterClass = jniEnv->GetObjectClass(JavaONScripter); JavaPlayVideo = jniEnv->GetMethodID(JavaONScripterClass, "playVideo", "([C)V"); } } void playVideoAndroid(const char *filename) { JNIEnv * jniEnv = NULL; jniVM->AttachCurrentThread(&jniEnv, NULL); if (!jniEnv){ __android_log_print(ANDROID_LOG_ERROR, "ONS", "ONScripter::playVideoAndroid: Java VM AttachCurrentThread() failed"); return; } jchar *jc = new jchar[strlen(filename)]; for (int i=0 ; iNewCharArray(strlen(filename)); jniEnv->SetCharArrayRegion(jca, 0, strlen(filename), jc); jniEnv->CallVoidMethod( JavaONScripter, JavaPlayVideo, jca ); delete[] jc; } #endif #if defined(IOS) extern "C" void playVideoIOS(const char *filename, bool click_flag, bool loop_flag); #endif #if defined(USE_AVIFILE) #include "AVIWrapper.h" #endif #if defined(USE_SMPEG) #include extern "C" void mp3callback( void *userdata, Uint8 *stream, int len ) { SMPEG_playAudio( (SMPEG*)userdata, stream, len ); } #endif extern bool ext_music_play_once_flag; extern "C"{ extern void musicFinishCallback(); extern Uint32 SDLCALL cdaudioCallback( Uint32 interval, void *param ); } extern void midiCallback( int sig ); extern SDL_TimerID timer_cdaudio_id; extern SDL_TimerID timer_bgmfade_id; extern "C" Uint32 SDLCALL bgmfadeCallback( Uint32 interval, void *param ); #define TMP_MUSIC_FILE "tmp.mus" int ONScripter::playSound(const char *filename, int format, bool loop_flag, int channel) { if ( !audio_open_flag ) return SOUND_NONE; long length = script_h.cBR->getFileLength( filename ); if (length == 0) return SOUND_NONE; unsigned char *buffer; if (format & SOUND_MUSIC && length == music_buffer_length && music_buffer ){ buffer = music_buffer; } else{ buffer = new(std::nothrow) unsigned char[length]; if (buffer == NULL){ fprintf( stderr, "failed to load [%s] because file size [%lu] is too large.\n", filename, length); return SOUND_NONE; } script_h.cBR->getFile( filename, buffer ); } if (format & SOUND_MUSIC){ music_info = Mix_LoadMUS_RW( SDL_RWFromMem( buffer, length ) ); Mix_VolumeMusic( music_volume ); Mix_HookMusicFinished( musicFinishCallback ); if ( Mix_PlayMusic( music_info, (music_play_loop_flag&&music_loopback_offset==0.0)?-1:0 ) == 0 ){ music_buffer = buffer; music_buffer_length = length; return SOUND_MUSIC; } } if (format & SOUND_CHUNK){ Mix_Chunk *chunk = Mix_LoadWAV_RW(SDL_RWFromMem(buffer, length), 1); if (playWave(chunk, format, loop_flag, channel) == 0){ delete[] buffer; return SOUND_CHUNK; } } /* check WMA */ if ( buffer[0] == 0x30 && buffer[1] == 0x26 && buffer[2] == 0xb2 && buffer[3] == 0x75 ){ delete[] buffer; return SOUND_OTHER; } if (format & SOUND_MIDI){ FILE *fp; if ( (fp = fopen(TMP_MUSIC_FILE, "wb", true)) == NULL){ fprintf(stderr, "can't open temporaly MIDI file %s\n", TMP_MUSIC_FILE); } else{ fwrite(buffer, 1, length, fp); fclose( fp ); ext_music_play_once_flag = !loop_flag; if (playMIDI(loop_flag) == 0){ delete[] buffer; return SOUND_MIDI; } } } delete[] buffer; return SOUND_OTHER; } void ONScripter::playCDAudio() { if ( cdaudio_flag ){ #ifdef USE_CDROM if ( cdrom_info ){ int length = cdrom_info->track[current_cd_track - 1].length / 75; SDL_CDPlayTracks( cdrom_info, current_cd_track - 1, 0, 1, 0 ); timer_cdaudio_id = SDL_AddTimer( length * 1000, cdaudioCallback, NULL ); } #endif } else{ char filename[256]; sprintf( filename, "cd\\track%2.2d.mp3", current_cd_track ); int ret = playSound( filename, SOUND_MUSIC, cd_play_loop_flag ); if (ret == SOUND_MUSIC) return; sprintf( filename, "cd\\track%2.2d.ogg", current_cd_track ); ret = playSound( filename, SOUND_MUSIC, cd_play_loop_flag ); if (ret == SOUND_MUSIC) return; sprintf( filename, "cd\\track%2.2d.wav", current_cd_track ); ret = playSound( filename, SOUND_MUSIC|SOUND_CHUNK, cd_play_loop_flag, MIX_BGM_CHANNEL ); } } int ONScripter::playWave(Mix_Chunk *chunk, int format, bool loop_flag, int channel) { if (!chunk) return -1; Mix_Pause( channel ); if ( wave_sample[channel] ) Mix_FreeChunk( wave_sample[channel] ); wave_sample[channel] = chunk; if (channel == 0) Mix_Volume( channel, voice_volume * MIX_MAX_VOLUME / 100 ); else if (channel == MIX_BGM_CHANNEL) Mix_Volume( channel, music_volume * MIX_MAX_VOLUME / 100 ); else Mix_Volume( channel, se_volume * MIX_MAX_VOLUME / 100 ); if ( !(format & SOUND_PRELOAD) ) Mix_PlayChannel( channel, wave_sample[channel], loop_flag?-1:0 ); return 0; } int ONScripter::playMIDI(bool loop_flag) { Mix_SetMusicCMD(midi_cmd); char midi_filename[256]; sprintf(midi_filename, "%s%s", save_dir?save_dir:archive_path, TMP_MUSIC_FILE); if ((midi_info = Mix_LoadMUS(midi_filename)) == NULL) return -1; int midi_looping = loop_flag ? -1 : 0; #if defined(LINUX) signal(SIGCHLD, midiCallback); if (midi_cmd) midi_looping = 0; #endif Mix_VolumeMusic(music_volume); Mix_PlayMusic(midi_info, midi_looping); current_cd_track = -2; return 0; } int ONScripter::playMPEG(const char *filename, bool click_flag, bool loop_flag) { unsigned long length = script_h.cBR->getFileLength( filename ); if (length == 0){ fprintf( stderr, " *** can't find file [%s] ***\n", filename ); return 0; } #ifdef ANDROID playVideoAndroid(filename); return 0; #endif #ifdef IOS char *absolute_filename = new char[ strlen(archive_path) + strlen(filename) + 1 ]; sprintf( absolute_filename, "%s%s", archive_path, filename ); playVideoIOS(absolute_filename, click_flag, loop_flag); delete[] absolute_filename; return 0; #endif int ret = 0; #if defined(USE_SMPEG) && !defined(USE_SDL_RENDERER) unsigned char *mpeg_buffer = new unsigned char[length]; script_h.cBR->getFile( filename, mpeg_buffer ); SMPEG *mpeg_sample = SMPEG_new_rwops( SDL_RWFromMem( mpeg_buffer, length ), NULL, 0 ); if ( !SMPEG_error( mpeg_sample ) ){ SMPEG_enableaudio( mpeg_sample, 0 ); if ( audio_open_flag ){ SMPEG_actualSpec( mpeg_sample, &audio_format ); SMPEG_enableaudio( mpeg_sample, 1 ); } SMPEG_enablevideo( mpeg_sample, 1 ); SMPEG_setdisplay( mpeg_sample, screen_surface, NULL, NULL ); SMPEG_setvolume( mpeg_sample, music_volume ); SMPEG_loop(mpeg_sample, loop_flag); Mix_HookMusic( mp3callback, mpeg_sample ); SMPEG_play( mpeg_sample ); bool done_flag = false; while( !(done_flag & click_flag) && SMPEG_status(mpeg_sample) == SMPEG_PLAYING ){ SDL_Event event; while( SDL_PollEvent( &event ) ){ switch (event.type){ case SDL_KEYUP: if ( ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_RETURN || ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_SPACE || ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_ESCAPE ) done_flag = true; if ( ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_RCTRL) ctrl_pressed_status &= ~0x01; if ( ((SDL_KeyboardEvent *)&event)->keysym.sym == SDLK_LCTRL) ctrl_pressed_status &= ~0x02; break; case SDL_QUIT: ret = 1; case SDL_MOUSEBUTTONUP: done_flag = true; break; default: break; } } SDL_Delay( 10 ); } SMPEG_stop( mpeg_sample ); Mix_HookMusic( NULL, NULL ); SMPEG_delete( mpeg_sample ); } delete[] mpeg_buffer; #else fprintf( stderr, "mpegplay command is disabled.\n" ); #endif return ret; } int ONScripter::playAVI( const char *filename, bool click_flag ) { unsigned long length = script_h.cBR->getFileLength( filename ); if (length == 0){ fprintf( stderr, " *** can't find file [%s] ***\n", filename ); return 0; } #ifdef ANDROID playVideoAndroid(filename); return 0; #endif #if defined(USE_AVIFILE) && !defined(USE_SDL_RENDERER) char *absolute_filename = new char[ strlen(archive_path) + strlen(filename) + 1 ]; sprintf( absolute_filename, "%s%s", archive_path, filename ); for ( unsigned int i=0 ; iinit( absolute_filename, false ) == 0 && avi->initAV( screen_surface, audio_open_flag ) == 0 ){ if (avi->play( click_flag )) return 1; } delete avi; delete[] absolute_filename; if ( audio_open_flag ){ Mix_CloseAudio(); openAudio(); } #else fprintf( stderr, "avi command is disabled.\n" ); #endif return 0; } void ONScripter::stopBGM( bool continue_flag ) { removeBGMFadeEvent(); if (timer_bgmfade_id) SDL_RemoveTimer( timer_bgmfade_id ); timer_bgmfade_id = NULL; mp3fadeout_duration_internal = 0; #ifdef USE_CDROM if ( cdaudio_flag && cdrom_info ){ extern SDL_TimerID timer_cdaudio_id; if ( timer_cdaudio_id ){ SDL_RemoveTimer( timer_cdaudio_id ); timer_cdaudio_id = NULL; } if (SDL_CDStatus( cdrom_info ) >= CD_PLAYING ) SDL_CDStop( cdrom_info ); } #endif if ( wave_sample[MIX_BGM_CHANNEL] ){ Mix_Pause( MIX_BGM_CHANNEL ); Mix_FreeChunk( wave_sample[MIX_BGM_CHANNEL] ); wave_sample[MIX_BGM_CHANNEL] = NULL; } if ( music_info ){ ext_music_play_once_flag = true; Mix_HaltMusic(); Mix_FreeMusic( music_info ); music_info = NULL; } if ( midi_info ){ ext_music_play_once_flag = true; Mix_HaltMusic(); Mix_FreeMusic( midi_info ); midi_info = NULL; } if ( !continue_flag ){ setStr( &music_file_name, NULL ); music_play_loop_flag = false; if (music_buffer){ delete[] music_buffer; music_buffer = NULL; } setStr( &midi_file_name, NULL ); midi_play_loop_flag = false; current_cd_track = -1; } } void ONScripter::stopAllDWAVE() { for (int ch=0; ch #include #include #include #define DEFAULT_VIDEO_SURFACE_FLAG (SDL_SWSURFACE) #define DEFAULT_BLIT_FLAG (0) //#define DEFAULT_BLIT_FLAG (SDL_RLEACCEL) #define MAX_SPRITE_NUM 1000 #define MAX_SPRITE2_NUM 256 #define MAX_PARAM_NUM 100 #define MAX_EFFECT_NUM 256 #define DEFAULT_VOLUME 100 #define ONS_MIX_CHANNELS 50 #define ONS_MIX_EXTRA_CHANNELS 4 #define MIX_WAVE_CHANNEL (ONS_MIX_CHANNELS+0) #define MIX_BGM_CHANNEL (ONS_MIX_CHANNELS+1) #define MIX_LOOPBGM_CHANNEL0 (ONS_MIX_CHANNELS+2) #define MIX_LOOPBGM_CHANNEL1 (ONS_MIX_CHANNELS+3) #define DEFAULT_WM_TITLE "ONScripter" #define DEFAULT_WM_ICON "ONScripter" class ONScripter : public ScriptParser { public: typedef AnimationInfo::ONSBuf ONSBuf; struct ButtonState{ unsigned int event_type; unsigned char event_button; int x, y, button; char str[16]; bool down_flag; }; ONScripter(); ~ONScripter(); // ---------------------------------------- // start-up options void enableCDAudio(); void setCDNumber(int cdrom_drive_number); void setFontFile(const char *filename); void setRegistryFile(const char *filename); void setDLLFile(const char *filename); void setArchivePath(const char *path); void setSaveDir(const char *path); void setFullscreenMode(); void setWindowMode(); void enableButtonShortCut(); void enableWheelDownAdvance(); void disableRescale(); void renderFontOutline(); void enableEdit(); void setKeyEXE(const char *path); int getWidth(){ return screen_width;}; int getHeight(){return screen_height;}; ButtonState &getCurrentButtonState(){return current_button_state;}; int getSkip(){return automode_flag?2:((skip_mode&SKIP_NORMAL)?1:0);}; int openScript(); int init(); // ---------------------------------------- // Commands typedef int (ONScripter::*FuncList)(); struct FuncLUT{ char command[30]; FuncList method; }; struct FuncHash{ FuncLUT *func; int num; } func_hash['z'-'a'+1]; void makeFuncLUT(); int yesnoboxCommand(); int wavestopCommand(); int waveCommand(); int waittimerCommand(); int waitCommand(); int vspCommand(); int voicevolCommand(); int vCommand(); int trapCommand(); int transbtnCommand(); int textspeeddefaultCommand(); int textspeedCommand(); int textshowCommand(); int textonCommand(); int textoffCommand(); int texthideCommand(); int textcolorCommand(); int textclearCommand(); int texecCommand(); int tateyokoCommand(); int talCommand(); int tablegotoCommand(); int systemcallCommand(); int strspCommand(); int stopCommand(); int sp_rgb_gradationCommand(); int spstrCommand(); int spreloadCommand(); int splitCommand(); int spclclkCommand(); int spbtnCommand(); int skipoffCommand(); int sevolCommand(); int setwindow3Command(); int setwindow2Command(); int setwindowCommand(); int setcursorCommand(); int selectCommand(); int savetimeCommand(); int saveonCommand(); int saveoffCommand(); int savegameCommand(); int savefileexistCommand(); int savescreenshotCommand(); int resettimerCommand(); int resetCommand(); int repaintCommand(); int rndCommand(); int rmodeCommand(); int quakeCommand(); int puttextCommand(); int prnumclearCommand(); int prnumCommand(); int printCommand(); int playstopCommand(); int playonceCommand(); int playCommand(); int okcancelboxCommand(); int ofscopyCommand(); int negaCommand(); int mspCommand(); int mpegplayCommand(); int mp3volCommand(); int mp3stopCommand(); int mp3fadeoutCommand(); int mp3fadeinCommand(); int mp3Command(); int movieCommand(); int movemousecursorCommand(); int monocroCommand(); int menu_windowCommand(); int menu_fullCommand(); int menu_click_pageCommand(); int menu_click_defCommand(); int menu_automodeCommand(); int lsp2Command(); int lspCommand(); int loopbgmstopCommand(); int loopbgmCommand(); int lookbackflushCommand(); int lookbackbuttonCommand(); int logspCommand(); int locateCommand(); int loadgameCommand(); int ldCommand(); int kinsokuCommand(); int jumpfCommand(); int jumpbCommand(); int ispageCommand(); int isfullCommand(); int isskipCommand(); int isdownCommand(); int inputCommand(); int indentCommand(); int humanorderCommand(); int getzxcCommand(); int getvoicevolCommand(); int getversionCommand(); int gettimerCommand(); int gettextCommand(); int gettaglogCommand(); int gettagCommand(); int gettabCommand(); int getspsizeCommand(); int getspposCommand(); int getspmodeCommand(); int getsevolCommand(); int getscreenshotCommand(); int getsavestrCommand(); int getretCommand(); int getregCommand(); int getpageupCommand(); int getpageCommand(); int getmp3volCommand(); int getmouseposCommand(); int getmouseoverCommand(); int getmclickCommand(); int getlogCommand(); int getinsertCommand(); int getfunctionCommand(); int getenterCommand(); int getcursorpos2Command(); int getcursorposCommand(); int getcursorCommand(); int getcselstrCommand(); int getcselnumCommand(); int gameCommand(); int fileexistCommand(); int exec_dllCommand(); int exbtnCommand(); int erasetextwindowCommand(); int endCommand(); int dwavestopCommand(); int dwaveCommand(); int dvCommand(); int drawtextCommand(); int drawsp3Command(); int drawsp2Command(); int drawspCommand(); int drawfillCommand(); int drawclearCommand(); int drawbg2Command(); int drawbgCommand(); int drawCommand(); int delayCommand(); int defineresetCommand(); int cspCommand(); int cselgotoCommand(); int cselbtnCommand(); int clickCommand(); int clCommand(); int chvolCommand(); int checkpageCommand(); int checkkeyCommand(); int cellCommand(); int captionCommand(); int btnwait2Command(); int btnwaitCommand(); int btntime2Command(); int btntimeCommand(); int btndownCommand(); int btndefCommand(); int btnCommand(); int bspCommand(); int brCommand(); int bltCommand(); int bgcopyCommand(); int bgCommand(); int bdownCommand(); int barclearCommand(); int barCommand(); int aviCommand(); int automode_timeCommand(); int autoclickCommand(); int allsp2resumeCommand(); int allspresumeCommand(); int allsp2hideCommand(); int allsphideCommand(); int amspCommand(); private: // ---------------------------------------- // global variables and methods enum { IDLE_EVENT_MODE = 0, WAIT_RCLICK_MODE = 1, // for lrclick WAIT_BUTTON_MODE = 2, // For select, btnwait and rmenu. WAIT_INPUT_MODE = (4|8), // can be skipped by a click WAIT_TIMER_MODE = 32, WAIT_VOICE_MODE = 128, WAIT_TEXT_MODE = 256 // clickwait, newpage, select }; int event_mode; bool is_script_read; char *wm_title_string; char *wm_icon_string; char wm_edit_string[256]; bool fullscreen_mode; bool window_mode; // start-up options bool cdaudio_flag; char *default_font; char *registry_file; char *dll_file; char *getret_str; int getret_int; bool enable_wheeldown_advance_flag; bool disable_rescale_flag; bool edit_flag; char *key_exe_file; // variables relevant to button ButtonState current_button_state, last_mouse_state; ButtonLink root_button_link, *current_button_link, exbtn_d_button_link; bool is_exbtn_enabled; bool btntime2_flag; long btntime_value; long internal_button_timer; long btnwait_time; bool btndown_flag; bool transbtn_flag; int current_over_button; int shift_over_button; bool bexec_flag; bool getzxc_flag; bool gettab_flag; bool getpageup_flag; bool getpagedown_flag; bool getmclick_flag; bool getinsert_flag; bool getfunction_flag; bool getenter_flag; bool getcursor_flag; bool spclclk_flag; bool getmouseover_flag; int getmouseover_lower; int getmouseover_upper; // variables relevant to selection enum { SELECT_GOTO_MODE = 0, SELECT_GOSUB_MODE = 1, SELECT_NUM_MODE = 2, SELECT_CSEL_MODE = 3 }; struct SelectLink{ SelectLink *next; char *text; char *label; SelectLink(){ next = NULL; text = label = NULL; }; ~SelectLink(){ if ( text ) delete[] text; if ( label ) delete[] label; }; } root_select_link; NestInfo select_label_info; int shortcut_mouse_line; void initSDL(); void openAudio(); void reset(); // called on definereset void resetSub(); // called on reset void resetSentenceFont(); void flush( int refresh_mode, SDL_Rect *rect=NULL, bool clear_dirty_flag=true, bool direct_flag=false ); void flushDirect( SDL_Rect &rect, int refresh_mode ); void mouseOverCheck( int x, int y ); public: void executeLabel(); void runScript(); AnimationInfo *getSpriteInfo(int no){ return &sprite_info[no]; }; AnimationInfo *getSprite2Info(int no){ return &sprite2_info[no]; }; private: int parseLine(); void deleteButtonLink(); void refreshMouseOverButton(); void deleteSelectLink(); void clearCurrentPage(); void shadowTextDisplay( SDL_Surface *surface, SDL_Rect &clip ); void newPage(); ButtonLink *getSelectableSentence( char *buffer, FontInfo *info, bool flush_flag = true, bool nofile_flag = false ); void decodeExbtnControl( const char *ctl_str, SDL_Rect *check_src_rect=NULL, SDL_Rect *check_dst_rect=NULL ); void saveAll(); void loadEnvData(); void saveEnvData(); int refreshMode(); void quit(); void disableGetButtonFlag(); int getNumberFromBuffer( const char **buf ); // ---------------------------------------- // variables and methods relevant to animation enum { ALPHA_BLEND_CONST = 1, ALPHA_BLEND_MULTIPLE = 2, ALPHA_BLEND_FADE_MASK = 3, ALPHA_BLEND_CROSSFADE_MASK = 4 }; AnimationInfo btndef_info, bg_info, cursor_info[2]; AnimationInfo tachi_info[3]; // 0 ... left, 1 ... center, 2 ... right AnimationInfo *sprite_info, *sprite2_info; AnimationInfo *bar_info[MAX_PARAM_NUM], *prnum_info[MAX_PARAM_NUM]; AnimationInfo lookback_info[4]; AnimationInfo dialog_info; int human_order[3]; bool all_sprite_hide_flag; bool all_sprite2_hide_flag; bool show_dialog_flag; int calcDurationToNextAnimation(); void stepAnimation(int t); void proceedAnimation(); void setupAnimationInfo(AnimationInfo *anim, FontInfo *info=NULL); void parseTaggedString(AnimationInfo *anim ); void drawTaggedSurface(SDL_Surface *dst_surface, AnimationInfo *anim, SDL_Rect &clip); void stopAnimation(int click); void loadCursor(int no, const char *str, int x, int y, bool abs_flag = false); // ---------------------------------------- // variables and methods relevant to effect DirtyRect dirty_rect; // only this region is updated int effect_counter, effect_duration; // counter in each effect int effect_timer_resolution; int effect_start_time; int effect_start_time_old; bool setEffect( EffectLink *effect, bool generate_effect_dst, bool update_backup_surface ); bool doEffect( EffectLink *effect, bool clear_dirty_region=true ); void drawEffect( SDL_Rect *dst_rect, SDL_Rect *src_rect, SDL_Surface *surface ); void generateMosaic( SDL_Surface *src_surface, int level ); struct BreakupCell { int cell_x, cell_y; int dir; int state; int radius; BreakupCell(): cell_x(0), cell_y(0), dir(0), state(0), radius(0){} } *breakup_cells; bool *breakup_cellforms, *breakup_mask; void buildBreakupCellforms(); void buildBreakupMask(); void initBreakup( char *params ); void effectBreakup( char *params, int duration ); // ---------------------------------------- // variables and methods relevant to event enum { NOT_EDIT_MODE = 0, EDIT_SELECT_MODE = 1, EDIT_VARIABLE_INDEX_MODE = 2, EDIT_VARIABLE_NUM_MODE = 3, EDIT_MP3_VOLUME_MODE = 4, EDIT_VOICE_VOLUME_MODE = 5, EDIT_SE_VOLUME_MODE = 6 }; int remaining_time; int variable_edit_mode; int variable_edit_index; int variable_edit_num; int variable_edit_sign; int shift_pressed_status; int ctrl_pressed_status; int num_fingers; // numbur of fingers touching on the screen void flushEventSub( SDL_Event &event ); void flushEvent(); void removeEvent(int type); void removeBGMFadeEvent(); void waitEventSub(int count); bool waitEvent(int count); bool trapHandler(); bool mouseMoveEvent( SDL_MouseMotionEvent *event ); bool mousePressEvent( SDL_MouseButtonEvent *event ); void variableEditMode( SDL_KeyboardEvent *event ); void shiftCursorOnButton( int diff ); bool keyDownEvent( SDL_KeyboardEvent *event ); void keyUpEvent( SDL_KeyboardEvent *event ); bool keyPressEvent( SDL_KeyboardEvent *event ); void timerEvent(); void runEventLoop(); // ---------------------------------------- // variables and methods relevant to file/file2 void searchSaveFile( SaveFileInfo &info, int no ); char *readSaveStrFromFile( int no ); int loadSaveFile( int no ); void saveMagicNumber( bool output_flag ); int saveSaveFile( bool write_to_disk, int no=0, const char *savestr=NULL ); int loadSaveFile2( int file_version ); void saveSaveFile2( bool output_flag ); // ---------------------------------------- // variables and methods relevant to image bool monocro_flag; uchar3 monocro_color; uchar3 monocro_color_lut[256]; int nega_mode; enum { REFRESH_NONE_MODE = 0, REFRESH_NORMAL_MODE = 1, REFRESH_SAYA_MODE = 2, REFRESH_SHADOW_MODE = 4, REFRESH_TEXT_MODE = 8, REFRESH_CURSOR_MODE = 16 }; int refresh_shadow_text_mode; #ifdef USE_SDL_RENDERER SDL_Window *window; SDL_Renderer *renderer; SDL_Texture *texture; #endif // format = SDL_PIXELFORMAT_ABGR8888 for OpenGL ES 1.x, OpenGL ES 2.x (Android, iOS) // format = SDL_PIXELFORMAT_ARGB8888 for OpenGL, Direct3D (Windows, Linux, MacOSX) or for any 32bit surface without SDL_Renderer // format = SDL_PIXELFORMAT_RGB565 for any 16bit surface without SDL_Renderer (Android, Zaurus) Uint32 texture_format; SDL_Surface *accumulation_surface; // Final image, i.e. picture_surface (+ shadow + text_surface) SDL_Surface *backup_surface; // Final image w/o (shadow + text_surface) used in leaveTextDisplayMode() SDL_Surface *screen_surface; // Text + Select_image + Tachi image + background SDL_Surface *effect_dst_surface; // Intermediate source buffer for effect SDL_Surface *effect_src_surface; // Intermediate destnation buffer for effect SDL_Surface *screenshot_surface; // Screenshot int screenshot_w, screenshot_h; SDL_Surface *image_surface; // Reference for loadImage() unsigned char *tmp_image_buf; unsigned long tmp_image_buf_length; unsigned long mean_size_of_loaded_images; unsigned long num_loaded_images; unsigned char *resize_buffer; size_t resize_buffer_size; SDL_Surface *loadImage(char *filename, bool *has_alpha=NULL, int *location=NULL); SDL_Surface *createRectangleSurface(char *filename, bool *has_alpha); SDL_Surface *createSurfaceFromFile(char *filename,bool *has_alpha, int *location); int resizeSurface( SDL_Surface *src, SDL_Surface *dst ); void alphaBlend( SDL_Surface *mask_surface, int trans_mode, Uint32 mask_value = 255, SDL_Rect *clip=NULL ); void alphaBlendText( SDL_Surface *dst_surface, SDL_Rect dst_rect, SDL_Surface *src_surface, SDL_Color &color, SDL_Rect *clip, bool rotate_flag ); void makeNegaSurface( SDL_Surface *surface, SDL_Rect &clip ); void makeMonochromeSurface( SDL_Surface *surface, SDL_Rect &clip ); void refreshSurface( SDL_Surface *surface, SDL_Rect *clip_src, int refresh_mode = REFRESH_NORMAL_MODE ); void refreshSprite( int sprite_no, bool active_flag, int cell_no, SDL_Rect *check_src_rect, SDL_Rect *check_dst_rect ); void createBackground(); // ---------------------------------------- // variables and methods relevant to rmenu bool system_menu_enter_flag; int system_menu_mode; int shelter_event_mode; int shelter_display_mode; bool shelter_draw_cursor_flag; Page *cached_page; ButtonLink *shelter_button_link; SelectLink *shelter_select_link; ButtonState shelter_mouse_state; void enterSystemCall(); void leaveSystemCall( bool restore_flag = true ); int executeSystemCall(); void executeSystemMenu(); void executeSystemSkip(); void executeSystemAutomode(); bool executeSystemReset(); void executeSystemEnd(); void executeWindowErase(); bool executeSystemLoad(); void executeSystemSave(); bool executeSystemYesNo( int caller, int file_no=0 ); void setupLookbackButton(); void executeSystemLookback(); void buildDialog(bool yesno_flag, const char *mes1, const char *mes2); // ---------------------------------------- // variables and methods relevant to sound enum{ SOUND_NONE = 0, SOUND_PRELOAD = 1, SOUND_CHUNK = 2, // WAV, Ogg Vorbis SOUND_MUSIC = 4, // WAV, MP3, Ogg Vorbis (streaming) SOUND_MIDI = 8, SOUND_OTHER = 16 }; int cdrom_drive_number; char *default_cdrom_drive; bool cdaudio_on_flag; // false if mute bool volume_on_flag; // false if mute SDL_AudioSpec audio_format; bool audio_open_flag; bool wave_play_loop_flag; char *wave_file_name; bool midi_play_loop_flag; char *midi_file_name; Mix_Music *midi_info; #ifdef USE_CDROM SDL_CD *cdrom_info; #endif int current_cd_track; bool cd_play_loop_flag; bool music_play_loop_flag; double music_loopback_offset; bool mp3save_flag; char *music_file_name; unsigned char *music_buffer; // for looped music long music_buffer_length; Uint32 mp3fade_start; Uint32 mp3fadeout_duration; Uint32 mp3fadein_duration; Uint32 mp3fadeout_duration_internal; Uint32 mp3fadein_duration_internal; char *fadeout_music_file_name; Mix_Music *music_info; char *loop_bgm_name[2]; Mix_Chunk *wave_sample[ONS_MIX_CHANNELS+ONS_MIX_EXTRA_CHANNELS]; char *midi_cmd; int playSound(const char *filename, int format, bool loop_flag, int channel=0); void playCDAudio(); int playWave(Mix_Chunk *chunk, int format, bool loop_flag, int channel); int playMIDI(bool loop_flag); int playMPEG(const char *filename, bool click_flag, bool loop_flag=false); int playAVI( const char *filename, bool click_flag ); enum { WAVE_PLAY = 0, WAVE_PRELOAD = 1, WAVE_PLAY_LOADED = 2 }; void stopBGM( bool continue_flag ); void stopAllDWAVE(); void playClickVoice(); // ---------------------------------------- // variables and methods relevant to text enum { DISPLAY_MODE_NORMAL = 0, DISPLAY_MODE_TEXT = 1 }; int display_mode; enum { SKIP_NONE = 0, SKIP_NORMAL = 1, // skip endlessly (press 's' button) SKIP_TO_EOL = 2, // skip to end of line SKIP_TO_EOP = 4 // skip to end of page (press 'o' button) }; int skip_mode; enum { TRAP_NONE = 0, TRAP_LEFT_CLICK = 1, TRAP_RIGHT_CLICK = 2, TRAP_NEXT_SELECT = 4, TRAP_STOP = 8, TRAP_CLICKED = 16 }; int trap_mode; char *trap_dist; long internal_timer; bool automode_flag; long automode_time; long autoclick_time; bool saveon_flag; bool internal_saveon_flag; // to saveoff at the head of text bool new_line_skip_flag; int text_speed_no; bool is_kinsoku; AnimationInfo text_info; AnimationInfo sentence_font_info; char *font_file; int erase_text_window_mode; bool text_on_flag; // suppress the effect of erase_text_window_mode bool draw_cursor_flag; int textgosub_clickstr_state; int indent_offset; void setwindowCore(); void shiftHalfPixelX(SDL_Surface *surface); void shiftHalfPixelY(SDL_Surface *surface); void drawGlyph( SDL_Surface *dst_surface, FontInfo *info, SDL_Color &color, char *text, int xy[2], bool shadow_flag, AnimationInfo *cache_info, SDL_Rect *clip, SDL_Rect &dst_rect ); void drawChar( char* text, FontInfo *info, bool flush_flag, bool lookback_flag, SDL_Surface *surface, AnimationInfo *cache_info, SDL_Rect *clip=NULL ); void drawString( const char *str, uchar3 color, FontInfo *info, bool flush_flag, SDL_Surface *surface, SDL_Rect *rect = NULL, AnimationInfo *cache_info=NULL ); void restoreTextBuffer(SDL_Surface *surface = NULL); void enterTextDisplayMode(bool text_flag = true); void leaveTextDisplayMode(bool force_leave_flag = false); bool doClickEnd(); bool clickWait( char *out_text ); bool clickNewPage( char *out_text ); void startRuby(const char *buf, FontInfo &info); void endRuby(bool flush_flag, bool lookback_flag, SDL_Surface *surface, AnimationInfo *cache_info); int textCommand(); bool checkLineBreak(const char *buf, FontInfo *fi); void processEOT(); bool processText(); }; #endif // __ONSCRIPTER_H__ onscripter-20150820/nsadec.cpp0000644017777601777760000000621512565174244015745 0ustar nobodynogroup/* -*- C++ -*- * * nsadec.cpp - NSA archive decoder * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include #include #include #include #include #include #include "NsaReader.h" extern int errno; int main( int argc, char **argv ) { NsaReader cNR; unsigned int nsa_offset = 0; unsigned long length; unsigned char *buffer; char file_name[256], dir_name[256]; unsigned int i, j, count; int archive_type = BaseReader::ARCHIVE_TYPE_NSA; FILE *fp; struct stat file_stat; if ( argc >= 2 ){ while ( argc > 2 ){ if ( !strcmp( argv[1], "-ns2" ) ) archive_type = BaseReader::ARCHIVE_TYPE_NS2; else if ( !strcmp( argv[1], "-offset") ){ nsa_offset = atoi(argv[2]); argc--; argv++; } argc--; argv++; } } if ( argc != 2 ){ fprintf( stderr, "Usage: nsadec [-offset ##] [-ns2] arc_file\n"); exit(-1); } cNR.openForConvert( argv[1], archive_type, nsa_offset ); count = cNR.getNumFiles(); SarReader::FileInfo sFI; for ( i=0 ; i=0 ; i--){ UserFuncHash &ufh = user_func_hash[i]; UserFuncLUT *func = ufh.root.next; while(func){ UserFuncLUT *tmp = func; func = func->next; delete tmp; } ufh.root.next = NULL; ufh.last = &ufh.root; } // reset misc variables if ( nsa_path ){ delete[] nsa_path; nsa_path = NULL; } globalon_flag = false; labellog_flag = false; filelog_flag = false; kidokuskip_flag = false; kidokumode_flag = true; rmode_flag = true; windowback_flag = false; usewheel_flag = false; useescspc_flag = false; mode_saya_flag = false; mode_ext_flag = false; sentence_font.rubyon_flag = false; zenkakko_flag = false; pagetag_flag = false; windowchip_sprite_no = -1; string_buffer_offset = 0; break_flag = false; trans_mode = AnimationInfo::TRANS_TOPLEFT; if (version_str) delete[] version_str; version_str = new char[strlen(VERSION_STR1)+ strlen("\n")+ strlen(VERSION_STR2)+ strlen("\n")+ +1]; sprintf( version_str, "%s\n%s\n", VERSION_STR1, VERSION_STR2 ); z_order = 499; textgosub_label = NULL; pretextgosub_label = NULL; pretext_buf = NULL; loadgosub_label = NULL; /* ---------------------------------------- */ /* Lookback related variables */ lookback_sp[0] = lookback_sp[1] = -1; lookback_color[0] = 0xff; lookback_color[1] = 0xff; lookback_color[2] = 0x00; /* ---------------------------------------- */ /* Save/Load related variables */ setStr( &save_menu_name, DEFAULT_SAVE_MENU_NAME ); setStr( &load_menu_name, DEFAULT_LOAD_MENU_NAME ); setStr( &save_item_name, DEFAULT_SAVE_ITEM_NAME ); num_save_file = 9; /* ---------------------------------------- */ /* Text related variables */ sentence_font.reset(); menu_font.reset(); ruby_font.reset(); dialog_font.reset(); current_font = &sentence_font; shade_distance[0] = 1; shade_distance[1] = 1; default_text_speed[0] = DEFAULT_TEXT_SPEED_LOW; default_text_speed[1] = DEFAULT_TEXT_SPEED_MIDDLE; default_text_speed[2] = DEFAULT_TEXT_SPEED_HIGHT; max_page_list = MAX_PAGE_LIST+1; num_chars_in_sentence = 0; if (page_list){ delete[] page_list; page_list = NULL; } current_page = start_page = NULL; clickstr_line = 0; clickstr_state = CLICK_NONE; linepage_mode = 0; english_mode = false; /* ---------------------------------------- */ /* Sound related variables */ for ( i=0 ; i< CLICKVOICE_NUM ; i++ ) setStr(&clickvoice_file_name[i], NULL); for ( i=0 ; i< SELECTVOICE_NUM ; i++ ) setStr(&selectvoice_file_name[i], NULL); for ( i=0 ; inext; delete tmp; } last_effect_link = &root_effect_link; last_effect_link->next = NULL; current_mode = DEFINE_MODE; } int ScriptParser::openScript() { script_h.cBR = new NsaReader( 0, archive_path, BaseReader::ARCHIVE_TYPE_NS2, key_table ); if (script_h.cBR->open( nsa_path )){ delete script_h.cBR; script_h.cBR = new DirectReader( archive_path, key_table ); script_h.cBR->open(); } if ( script_h.openScript( archive_path ) ) return -1; screen_width = script_h.screen_width; screen_height = script_h.screen_height; return 0; } unsigned char ScriptParser::convHexToDec( char ch ) { if ( '0' <= ch && ch <= '9' ) return ch - '0'; else if ( 'a' <= ch && ch <= 'f' ) return ch - 'a' + 10; else if ( 'A' <= ch && ch <= 'F' ) return ch - 'A' + 10; else errorAndExit("convHexToDec: not valid character for color."); return 0; } void ScriptParser::readColor( uchar3 *color, const char *buf ){ if ( buf[0] != '#' ) errorAndExit("readColor: no preceding #."); (*color)[0] = convHexToDec( buf[1] ) << 4 | convHexToDec( buf[2] ); (*color)[1] = convHexToDec( buf[3] ) << 4 | convHexToDec( buf[4] ); (*color)[2] = convHexToDec( buf[5] ) << 4 | convHexToDec( buf[6] ); } void ScriptParser::deleteRMenuLink() { RMenuLink *link = root_rmenu_link.next; while(link){ RMenuLink *tmp = link; link = link->next; delete tmp; } root_rmenu_link.next = NULL; rmenu_link_num = 0; rmenu_link_width = 0; } int ScriptParser::getSystemCallNo( const char *buffer ) { if ( !strcmp( buffer, "skip" ) ) return SYSTEM_SKIP; else if ( !strcmp( buffer, "reset" ) ) return SYSTEM_RESET; else if ( !strcmp( buffer, "save" ) ) return SYSTEM_SAVE; else if ( !strcmp( buffer, "load" ) ) return SYSTEM_LOAD; else if ( !strcmp( buffer, "lookback" ) ) return SYSTEM_LOOKBACK; else if ( !strcmp( buffer, "windowerase" ) ) return SYSTEM_WINDOWERASE; else if ( !strcmp( buffer, "rmenu" ) ) return SYSTEM_MENU; else if ( !strcmp( buffer, "automode" ) ) return SYSTEM_AUTOMODE; else if ( !strcmp( buffer, "end" ) ) return SYSTEM_END; else{ printf("Unsupported system call %s\n", buffer ); return -1; } } void ScriptParser::saveGlovalData() { if ( !globalon_flag ) return; file_io_buf_ptr = 0; writeVariables( script_h.global_variable_border, script_h.variable_range, false ); allocFileIOBuf(); writeVariables( script_h.global_variable_border, script_h.variable_range, true ); if (saveFileIOBuf( "gloval.sav" )){ fprintf( stderr, "can't open gloval.sav for writing\n"); exit(-1); } } void ScriptParser::allocFileIOBuf() { if (file_io_buf_ptr > file_io_buf_len){ file_io_buf_len = file_io_buf_ptr; if (file_io_buf) delete[] file_io_buf; file_io_buf = new unsigned char[file_io_buf_len]; if (save_data_buf){ memcpy(file_io_buf, save_data_buf, save_data_len); delete[] save_data_buf; } save_data_buf = new unsigned char[file_io_buf_len]; memcpy(save_data_buf, file_io_buf, save_data_len); } file_io_buf_ptr = 0; } int ScriptParser::saveFileIOBuf( const char *filename, int offset, const char *savestr ) { bool use_save_dir = false; if (strcmp(filename, "envdata") != 0) use_save_dir = true; FILE *fp; if ( (fp = fopen( filename, "wb", use_save_dir )) == NULL ) return -1; size_t ret = fwrite(file_io_buf+offset, 1, file_io_buf_ptr-offset, fp); if (savestr){ fputc('"', fp); fwrite(savestr, 1, strlen(savestr), fp); fputc('"', fp); fputc('*', fp); } fclose(fp); if (ret != file_io_buf_ptr-offset) return -2; return 0; } size_t ScriptParser::loadFileIOBuf( const char *filename ) { bool use_save_dir = false; if (strcmp(filename, "envdata") != 0) use_save_dir = true; FILE *fp; if ( (fp = fopen( filename, "rb", use_save_dir )) == NULL ) return 0; fseek(fp, 0, SEEK_END); size_t len = ftell(fp); file_io_buf_ptr = len; allocFileIOBuf(); fseek(fp, 0, SEEK_SET); size_t ret = fread(file_io_buf, 1, len, fp); fclose(fp); return ret; } void ScriptParser::writeChar(char c, bool output_flag) { if (output_flag) file_io_buf[file_io_buf_ptr] = (unsigned char)c; file_io_buf_ptr++; } char ScriptParser::readChar() { if (file_io_buf_ptr >= file_io_buf_len ) return 0; return (char)file_io_buf[file_io_buf_ptr++]; } void ScriptParser::writeInt(int i, bool output_flag) { if (output_flag){ file_io_buf[file_io_buf_ptr++] = i & 0xff; file_io_buf[file_io_buf_ptr++] = (i >> 8) & 0xff; file_io_buf[file_io_buf_ptr++] = (i >> 16) & 0xff; file_io_buf[file_io_buf_ptr++] = (i >> 24) & 0xff; } else{ file_io_buf_ptr += 4; } } int ScriptParser::readInt() { if (file_io_buf_ptr+3 >= file_io_buf_len ) return 0; int i = (unsigned int)file_io_buf[file_io_buf_ptr+3] << 24 | (unsigned int)file_io_buf[file_io_buf_ptr+2] << 16 | (unsigned int)file_io_buf[file_io_buf_ptr+1] << 8 | (unsigned int)file_io_buf[file_io_buf_ptr]; file_io_buf_ptr += 4; return i; } void ScriptParser::writeStr(char *s, bool output_flag) { if ( s && s[0] ){ if (output_flag) memcpy( file_io_buf + file_io_buf_ptr, s, strlen(s) ); file_io_buf_ptr += strlen(s); } writeChar( 0, output_flag ); } void ScriptParser::readStr(char **s) { int counter = 0; while (file_io_buf_ptr+counter < file_io_buf_len){ if (file_io_buf[file_io_buf_ptr+counter++] == 0) break; } if (*s) delete[] *s; *s = NULL; if (counter > 1){ *s = new char[counter]; memcpy(*s, file_io_buf + file_io_buf_ptr, counter); } file_io_buf_ptr += counter; } void ScriptParser::writeVariables( int from, int to, bool output_flag ) { for (int i=from ; inum_dim ; i++ ) dim *= av->dim[i]; for ( i=0 ; idata[i]; if (output_flag){ file_io_buf[file_io_buf_ptr+3] = (unsigned char)((ch>>24) & 0xff); file_io_buf[file_io_buf_ptr+2] = (unsigned char)((ch>>16) & 0xff); file_io_buf[file_io_buf_ptr+1] = (unsigned char)((ch>>8) & 0xff); file_io_buf[file_io_buf_ptr] = (unsigned char)(ch & 0xff); } file_io_buf_ptr += 4; } av = av->next; } } void ScriptParser::readArrayVariable() { ScriptHandler::ArrayVariable *av = script_h.getRootArrayVariable(); while(av){ int i, dim = 1; for ( i=0 ; inum_dim ; i++ ) dim *= av->dim[i]; for ( i=0 ; i= file_io_buf_len ) return; ret = file_io_buf[file_io_buf_ptr+3]; ret = ret << 8 | file_io_buf[file_io_buf_ptr+2]; ret = ret << 8 | file_io_buf[file_io_buf_ptr+1]; ret = ret << 8 | file_io_buf[file_io_buf_ptr]; file_io_buf_ptr += 4; av->data[i] = ret; } av = av->next; } } void ScriptParser::writeLog( ScriptHandler::LogInfo &info ) { file_io_buf_ptr = 0; bool output_flag = false; for (int n=0 ; n<2 ; n++){ int i,j; char buf[10]; sprintf( buf, "%d", info.num_logs ); for ( i=0 ; i<(int)strlen( buf ) ; i++ ) writeChar( buf[i], output_flag ); writeChar( 0x0a, output_flag ); ScriptHandler::LogLink *cur = info.root_log.next; for ( i=0 ; iname ) ; j++ ) writeChar( cur->name[j] ^ 0x84, output_flag ); writeChar( '"', output_flag ); cur = cur->next; } if (n==1) break; allocFileIOBuf(); output_flag = true; } if (saveFileIOBuf( info.filename )){ fprintf( stderr, "can't write %s\n", info.filename ); exit( -1 ); } } void ScriptParser::readLog( ScriptHandler::LogInfo &info ) { script_h.resetLog( info ); if (loadFileIOBuf( info.filename ) > 0){ int i, j, ch, count = 0; char buf[100]; while( (ch = readChar()) != 0x0a ){ count = count * 10 + ch - '0'; } for ( i=0 ; inext; delete tmp; } root_nest_info.next = NULL; last_nest_info = &root_nest_info; } void ScriptParser::setStr( char **dst, const char *src, int num ) { if ( *dst ) delete[] *dst; *dst = NULL; if ( src ){ if (num >= 0){ *dst = new char[ num + 1 ]; memcpy( *dst, src, num ); (*dst)[num] = '\0'; } else{ *dst = new char[ strlen( src ) + 1]; strcpy( *dst, src ); } } } void ScriptParser::setCurrentLabel( const char *label ) { current_label_info = script_h.lookupLabel( label ); current_line = script_h.getLineByAddress( current_label_info.start_address ); script_h.setCurrent( current_label_info.start_address ); } void ScriptParser::readToken() { script_h.readToken(); string_buffer_offset = 0; if (script_h.isText() && linepage_mode > 0){ char ch = '@'; // click wait if (linepage_mode == 1 || sentence_font.getRemainingLine() <= clickstr_line) ch = '\\'; // newline // ugly work around unsigned int len = strlen(script_h.getStringBuffer()); if (script_h.getStringBuffer()[len-1] == 0x0a){ script_h.getStringBuffer()[len-1] = ch; script_h.addStringBuffer(0x0a); } else{ script_h.addStringBuffer(ch); } } } int ScriptParser::readEffect( EffectLink *effect ) { int num = 1; effect->effect = script_h.readInt(); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ num++; effect->duration = script_h.readInt(); if ( script_h.getEndStatus() & ScriptHandler::END_COMMA ){ num++; const char *buf = script_h.readStr(); effect->anim.setImageName( buf ); } else effect->anim.remove(); } else if (effect->effect < 0 || effect->effect > 255){ fprintf(stderr, "Effect %d is out of range and is switched to 0.\n", effect->effect); effect->effect = 0; // to suppress error } //printf("readEffect %d: %d %d %s\n", num, effect->effect, effect->duration, effect->anim.image_name ); return num; } ScriptParser::EffectLink *ScriptParser::parseEffect(bool init_flag) { if (init_flag) tmp_effect.anim.remove(); int num = readEffect(&tmp_effect); if (num > 1) return &tmp_effect; if (tmp_effect.effect == 0 || tmp_effect.effect == 1) return &tmp_effect; EffectLink *link = &root_effect_link; while(link){ if (link->no == tmp_effect.effect) return link; link = link->next; } fprintf(stderr, "Effect No. %d is not found.\n", tmp_effect.effect); exit(-1); return NULL; } FILE *ScriptParser::fopen(const char *path, const char *mode, bool use_save_dir) { char filename[256]; if (use_save_dir && save_dir) sprintf( filename, "%s%s", save_dir, path ); else sprintf( filename, "%s%s", archive_path, path ); return ::fopen( filename, mode ); } void ScriptParser::createKeyTable( const char *key_exe ) { if (!key_exe) return; FILE *fp = ::fopen(key_exe, "rb"); if (fp == NULL){ fprintf(stderr, "createKeyTable: can't open EXE file %s\n", key_exe); return; } key_table = new unsigned char[256]; int i; for (i=0 ; i<256 ; i++) key_table[i] = i; unsigned char ring_buffer[256]; int ring_start = 0, ring_last = 0; int ch, count; while((ch = fgetc(fp)) != EOF){ i = ring_start; count = 0; while (i != ring_last && ring_buffer[i] != ch ){ count++; i = (i+1)%256; } if (i == ring_last && count == 255) break; if (i != ring_last) ring_start = (i+1)%256; ring_buffer[ring_last] = ch; ring_last = (ring_last+1)%256; } fclose(fp); if (ch == EOF) errorAndExit( "createKeyTable: can't find a key table." ); // Key table creation ring_buffer[ring_last] = ch; for (i=0 ; i<256 ; i++) key_table[ring_buffer[(ring_start+i)%256]] = i; } void ScriptParser::setKinsoku(const char *start_chrs, const char *end_chrs, bool add) { int i; const char *kchr; Kinsoku *tmp; // count chrs int num_start = 0; kchr = start_chrs; while (*kchr != '\0') { if IS_TWO_BYTE(*kchr) kchr++; kchr++; num_start++; } int num_end = 0; kchr = end_chrs; while (*kchr != '\0') { if IS_TWO_BYTE(*kchr) kchr++; kchr++; num_end++; } if (add) { if (start_kinsoku != NULL) tmp = start_kinsoku; else { tmp = new Kinsoku[1]; num_start_kinsoku = 0; } } else { if (start_kinsoku != NULL) delete[] start_kinsoku; tmp = new Kinsoku[1]; num_start_kinsoku = 0; } start_kinsoku = new Kinsoku[num_start_kinsoku + num_start]; kchr = start_chrs; for (i=0; i #include #include #include #include #include "NsaReader.h" extern int scale_ratio_upper; extern int scale_ratio_lower; extern size_t rescaleJPEG( unsigned char *original_buffer, size_t length, unsigned char **rescaled_buffer, int quality ); extern size_t rescaleBMP( unsigned char *original_buffer, unsigned char **rescaled_buffer, bool output_jpeg_flag, int quality ); #ifdef main #undef main #endif void help() { fprintf(stderr, "Usage: nsaconv [-e] [-j] [-ns2] [-ns3] [-q quality] src_width dst_width src_archive_file dst_archive_file\n"); fprintf(stderr, " quality ... 0 to 100\n"); fprintf(stderr, " src_width ... 640 or 800\n"); fprintf(stderr, " dst_width ... 176, 220, 320, 360, 384, 640, etc.\n"); exit(-1); } int main( int argc, char **argv ) { NsaReader cSR; unsigned int nsa_offset = 0; unsigned long length, offset = 0, buffer_length = 0; unsigned char *buffer = NULL, *rescaled_buffer = NULL; unsigned int i, count; int archive_type = BaseReader::ARCHIVE_TYPE_NSA; bool enhanced_flag = false; bool bmp2jpeg_flag = false; int quality = 75; FILE *fp; argc--; // skip command name argv++; while (argc > 4){ if ( !strcmp( argv[0], "-e" ) ) enhanced_flag = true; else if ( !strcmp( argv[0], "-j" ) ) bmp2jpeg_flag = true; else if ( !strcmp( argv[0], "-ns2" ) ) nsa_offset = 1; else if ( !strcmp( argv[0], "-ns3" ) ) nsa_offset = 2; else if ( !strcmp( argv[0], "-q" ) ){ argc--; argv++; quality = atoi(argv[0]); } argc--; argv++; } if (argc != 4) help(); if (bmp2jpeg_flag) enhanced_flag = false; scale_ratio_lower = atoi(argv[0]); // src width if (scale_ratio_lower!=640 && scale_ratio_lower!=800) help(); scale_ratio_upper = atoi(argv[1]); // dst width if ( (fp = fopen( argv[3], "wb" ) ) == NULL ){ fprintf( stderr, "can't open file %s for writing.\n", argv[3] ); exit(-1); } cSR.openForConvert( argv[2], archive_type, nsa_offset ); count = cSR.getNumFiles(); SarReader::FileInfo sFI; for ( i=0 ; i buffer_length ){ if ( buffer ) delete[] buffer; buffer = new unsigned char[length]; buffer_length = length; } sFI.offset = offset; if ( (strlen( sFI.name ) > 3 && !strcmp( sFI.name + strlen( sFI.name ) - 3, "JPG")) || (strlen( sFI.name ) > 4 && !strcmp( sFI.name + strlen( sFI.name ) - 4, "JPEG")) ){ if ( cSR.getFile( sFI.name, buffer ) != length ){ fprintf( stderr, "file %s can't be retrieved %ld\n", sFI.name, length ); continue; } sFI.length = rescaleJPEG( buffer, length, &rescaled_buffer, quality ); cSR.putFile( fp, i, sFI.offset, sFI.length, sFI.length, sFI.compression_type, true, rescaled_buffer ); } else if ( strlen( sFI.name ) > 3 && !strcmp( sFI.name + strlen( sFI.name ) - 3, "BMP") ){ if ( cSR.getFile( sFI.name, buffer ) != length ){ fprintf( stderr, "file %s can't be retrieved %ld\n", sFI.name, length ); continue; } sFI.length = rescaleBMP( buffer, &rescaled_buffer, bmp2jpeg_flag, quality ); cSR.putFile( fp, i, sFI.offset, sFI.length, sFI.length, enhanced_flag?BaseReader::NBZ_COMPRESSION:sFI.compression_type, true, rescaled_buffer ); } else if ( enhanced_flag && strlen( sFI.name ) > 3 && !strcmp( sFI.name + strlen( sFI.name ) - 3, "WAV") ){ if ( cSR.getFile( sFI.name, buffer ) != length ){ fprintf( stderr, "file %s can't be retrieved %ld\n", sFI.name, length ); continue; } sFI.length = cSR.putFile( fp, i, sFI.offset, sFI.length, length, BaseReader::NBZ_COMPRESSION, true, buffer ); } else{ cSR.putFile( fp, i, sFI.offset, sFI.length, sFI.original_length, sFI.compression_type, false, buffer ); } offset += sFI.length; } cSR.writeHeader( fp, archive_type, nsa_offset ); fclose(fp); if ( rescaled_buffer ) delete[] rescaled_buffer; if ( buffer ) delete[] buffer; return 0; } onscripter-20150820/www/0000755017777601777760000000000012565174244014624 5ustar nobodynogrouponscripter-20150820/www/onscripter.html0000644017777601777760000010535112565174244017707 0ustar nobodynogroup ONScripter ¤Î¥Ú¡¼¥¸

¤Ï¤¸¤á¤Ë

ONScripter (¥ª¡¼¥¨¥Ì¥¹¥¯¥ê¥×¥¿¡¼)¤Ï NScripter (²òÀâ) ÍѤ˺î¤é¤ì¤¿¥¹¥¯¥ê¥×¥È¤òÆÈ¼«¤Ë²ò¼á¤·¤Æ¼Â¹Ô¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£Á´¤¯Æ±¤¸¥²¡¼¥à¥Ç¡¼¥¿¤ò»È¤Ã¤Æ¡¢Windows, Android, iOS ¤Ê¤É¤Î¾å¤Ç¥²¡¼¥à¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

ưºîÊó¹ð¡¦¥Ð¥°Êó¹ð¡¦µ¡Ç½ÄɲÃÍ×˾¡¦¥Ñ¥Ã¥Á¤Ï¿ï»þ¼õ¤±ÉÕ¤±¤Þ¤¹¤Î¤Ç[¥Ð¥°¥È¥é¥Ã¥­¥ó¥°¥·¥¹¥Æ¥à]¤Þ¤Ç¤ª´ê¤¤¤·¤Þ¤¹¡£Êó¹ð¤ÎºÝ¤Ï¥ª¥×¥·¥ç¥óÍó¤ÎÃæ±û¤Î¥Á¥§¥Ã¥¯¥Ü¥Ã¥¯¥¹¤ò³°¤·¤Æ¤«¤éÁ÷¿®¤·¤Æ¤¯¤À¤µ¤¤¡£¡Ö¡û¡û¥²¡¼¥à¤Î¡ß¡ß¾ìÌ̤¬¤Ê¤ó¤«¤ª¤«¤·¤¤¡×¤È¤¤¤¦ÄøÅ٤Ǥâ·ë¹½¤Ç¤¹¤Î¤Ç¤ªµ¤·Ú¤Ë¤É¤¦¤¾¡£¥Ú¡¼¥¸¤Î°ìÈÖ²¼¤Ëµ­ºÜ¤Î¤¢¤ë¥á¡¼¥ë¥¢¥É¥ì¥¹¤Þ¤ÇľÀÜÁ÷¤Ã¤Æ¤¤¤¿¤À¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£

¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸

ºÇ¿·ÈÇ onscripter-20150820.tar.gz
µìÈÇ onscripter-20150811.tar.gz

¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸ (Android, Zaurus °Ê³°¤ÏÅöÊý¤Ç¤Ïưºî̤³Îǧ)

¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¥Ñ¥Ã¥±¡¼¥¸ÇÛÉÛ¥µ¥¤¥È
Android (1.6 and later)ONScripter in Google Play
ONScripter on Android ¤Î¥Ú¡¼¥¸
¡¡¼«ºî¥Î¥Ù¥ë¥²¡¼¥à¥¢¥×¥ê¤ÎºîÀ®¤Ë¤âÍøÍѤǤ­¤Þ¤¹
Zaurus (SL-C700, etc.)SDL on Zaurus ¤Î¥Ú¡¼¥¸
LinuxDebian ¸ø¼° Unstable (Sid)
Debian ¸ø¼° Testing (Jessie)
Debian ¸ø¼° Stable (Wheezy)
Debian Èó¸ø¼° (Etch, Sarge, Woody, Potato)
Uncle Mion's ONScripter Corner (ONScripter-EN)
MacOSXHomebrew
ONScripter Launcher and Binary for Mac OS X
Uncle Mion's ONScripter Corner (ONScripter-EN)
Windows̸±«¤Î¹ß¤ëÆü¤Ë
Uncle Mion's ONScripter Corner (ONScripter-EN)
PNaClIdleTime (Google Chrome ¤«¤é¼Â¹Ô¤Ç¤­¤Þ¤¹)
PSPonscripter_signed (½ð̾ÉÕ, ̤²þ¤¤Î PSP ¤Çưºî²Ä)
PandoraPandora Handheld PC / ONScripter
iPhone, iPod touchiPodOns
NetWalkerQt ½é¿´¼Ô¤Î³Ð¤¨½ñ¤­
Brain (WindowsCE 6.0)ONScripter for Brain
NetBSDpkgsrc
OS2/Warppackage at OS2.jp
Playstation3 PS3 Linux ¤Ç¼«ºî¥½¥Õ¥È¤ò³Ú¤·¤â¤¦
WiiONScripter WiiBrew
FreeBSDOfficial FreeBSD package
Private Ports for FreeBSD
DreamcastONScripter for Dreamcast
¤½¤Î¾Êç½¸Ãæ

ONScripter-EN ¤È¤Ï¡¢Uncle Mion ¤µ¤ó¤Ë¤è¤Ã¤Æ±Ñ¸ì¤Î¥¹¥¯¥ê¥×¥È¤¬¤¦¤Þ¤¯°·¤¨¤ë¤è¤¦¤Ë³ÈÄ¥¤µ¤ì¤¿ ONScripter ¤Ç¤¹¡£¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëÌ¿Îá¤â ONScripter ¤è¤ê½¼¼Â¤·¤Æ¤¤¤Þ¤¹¡£½¾Íè¤ÎÆüËܸì¤Î¥¹¥¯¥ê¥×¥È¤âÌäÂê¤Ê¤¯¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ç¤¹¡£

ÆÃĹ

  1. ¸½»þÅÀ(2011/12/15)¤ÇºÇ¿·¤Î NScripter ¤È¸ß´¹À­¤Î¤¢¤ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤òÆþ½ÐÎϤ¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£°Û¤Ê¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤ÇƱ»þ¤ËÍ·¤ÖÊýË¡¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
  2. Á´¤Æ¤ÎÁàºî¤ò¥­¡¼¥Ü¡¼¥É¤«¤é¹Ô¤¨¤Þ¤¹¡£¤â¤Á¤í¤ó¥Þ¥¦¥¹¤â»È¤¨¤Þ¤¹¡£
  3. CD Audio ¤Î±éÁÕ¤ò²»³Ú¥Õ¥¡¥¤¥ë(MP3, Ogg)¤Î±éÁդ˿¶¤êÂØ¤¨¤ëµ¡Ç½¤¬¤¢¤ê¤Þ¤¹¡£
  4. ¥Þ¥ë¥Á¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ËÂбþ¤·¤Æ¤ª¤ê¡¢Windows, Linux, MacOS X, MacOS 9, Android(1.6 °Ê¾å), iPhone, iPad, PSP, Zaurus(SL-5500,SL-A300,SL-B500,SL-C700), FreeBSD, Solaris(on SPARC), Tru64 UNIX, OS/2Warp, iPod, PocketPC, Playstation3, Wii, GP2X, NetWalker, Dreamcast ¤Ç¤Îưºî¤¬³Îǧ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤½¤ì°Ê³°¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤â¡¢Æ°ºî´Ä¶­¤¬½àÈ÷¤Ç¤­¤ì¤Ðưºî¤¹¤ë¤Ï¤º¤Ç¤¹¡£
  5. Á´¤Æ¤ÎÌ¿Îᡦ»ÅÍͤò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢¥²¡¼¥à¤Ë¤è¤Ã¤Æ¤Ïµóư¤¬¤ª¤«¤·¤¯¤Ê¤ê¤Þ¤¹¡£¤½¤Î¾ì¹ç¤Ï¾åµ­¥Ð¥°¥È¥é¥Ã¥­¥ó¥°¥·¥¹¥Æ¥à¤Þ¤Ç¸æÊó¹ð²¼¤µ¤¤¡£

¼Â¹ÔÊýË¡

ưºî´Ä¶­

²¼µ­¤Î½èÍý·Ï¤È¥é¥¤¥Ö¥é¥êÅù¤¬É¬ÍפǤ¹¡£µ­ºÜ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ïºî¼Ô¤Î³«È¯´Ä¶­¤Î¤â¤Î¤Ç¤¹¤¬¡¢¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¹ç¤ï¤»¤ëɬÍפϤʤ¤¤È»×¤¤¤Þ¤¹¡£

ɬ¿Ü

  • C++ ½èÍý·Ï
    • g++ 4.4.4 (Linux)
    • Visual Studio 2008 C++ (Windows)
  • Unicode ¤Ç»ØÄꤵ¤ì¤¿ÆüËܸì TTF ¥Õ¥©¥ó¥È(¥Õ¥¡¥¤¥ë̾¤Ï default.ttf ¤Ë)
  • libjpeg-6b (Independent JPEG Group)
  • bzip2-1.0.5 (bzip2)
  • SDL-1.2.14, SDL_image-1.2.10, SDL_mixer-1.2.8, SDL_ttf-2.0.9 (Simple Directmedia Layer)
  • FreeType 2.3.11 (the Free Type Project)

¿ä¾©

  • SMPEG-0.4.6
    MPEG1 ·Á¼°¤Î²»³Ú¥Õ¥¡¥¤¥ë¤òºÆÀ¸¤¹¤ë¾ì¹ç¤Ë¤ÏÆþ¤ì¤Æ¤¯¤À¤µ¤¤¡£MP3 ¤ò±éÁÕ¤¹¤ë¤Ë¤Ï SMPEG ¤« MAD ¤Î¤¤¤º¤ì¤«¤¬É¬ÍפǤ¹¡£
  • ogg-1.2.0, vorbis-1.3.1 (The Ogg Vorbis CODEC Project)
    Ogg Vorbis ·Á¼°¤Î²»³Ú¥Õ¥¡¥¤¥ë¤òºÆÀ¸¤¹¤ë¾ì¹ç¤Ë¤ÏÆþ¤ì¤Æ¤¯¤À¤µ¤¤¡£Æ±º­¤Î Makefile.Linux, Makefile.ArmLinux ¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç»ÈÍѤ¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£À°¿ô±é»»¤Î¤ß¤ò»ÈÍѤ·¤¿ Tremor vorbis ¤òÂå¤ï¤ê¤Ë»È¤¦¤³¤È¤â¤Ç¤­¤Þ¤¹¡£

ɬÍפ˱þ¤¸¤ÆÆ³Æþ

  • mad-0.15.1b (MAD: Mpeg Audio Decoder)
    À°¿ô±é»»¤Î¤ß¤ò»ÈÍѤ·¤¿ MP3 ±éÁե饤¥Ö¥é¥ê¤Ç¤¹¡£Android ¤ä Zaurus ¤Ç MP3 ¤ò±éÁÕ¤¹¤ë¾ì¹ç¤Ë¤Ïɬ¿Ü¤Ç¤¹¡£MAD ¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢SMPEG ¤ÎÂå¤ï¤ê¤Ë MAD ¤òÍ­¸ú¤Ë¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿ SDL_mixer ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
  • avifile-0.7.48 (avifile)
    avi Ì¿Îá¤ò»È¤Ã¤Æ¥à¡¼¥Ó¡¼¤òºÆÀ¸¤¹¤ë¾ì¹ç¤Ë¤ÏÆþ¤ì¤Æ¤¯¤À¤µ¤¤¡£Linux ¤Çưºî³Îǧ¤ò¤·¤Æ¤¤¤Þ¤¹¡£USE_AVIFILE ¤òÄêµÁ¤· AVIWrapper.o ¤ò¥ê¥ó¥¯¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È»ÈÍѤµ¤ì¤Þ¤¹¡£

ÅöÊý¤Ç¤Ï Linux (Debian Wheezy), Android (Sony (4.4.2)), iOS (iPad2), (»þ¡¹ Windows) ¤Çưºî³Îǧ¤ò¤·¤Æ¤¤¤Þ¤¹¡£

¥³¥ó¥Ñ¥¤¥ë

ŬÅö¤Ê¾ì½ê¤Ë ONScripter ¤òŸ³«¤·¡¢Linux ¤Î¾ì¹ç¤Ï make -f Makefile.Linux, Windows ¤Î¾ì¹ç¤Ï¡¢nmake -f Makefile.Win ¤È¤ä¤Ã¤Æ²¼¤µ¤¤¡£Windows ¤Î¾ì¹ç¤Ï¡¢bzip2, SDL ¤È SMPEG ¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤È¥é¥¤¥Ö¥é¥ê¤Î¤¢¤ë¾ì½ê¤ò Makefile.Win ¤Ç»ØÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢¼«¿È¤Î´Ä¶­¤Ë¹ç¤ï¤»¤ÆÅ¬µ¹½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£

¼Â¹Ô

[ɬ¿Ü]¤Þ¤º¥²¡¼¥à¤Î¥¢¡¼¥«¥¤¥Ö¤ò°ì¥«½ê¤Ë¤Þ¤È¤á¤Þ¤¹¡£Ä̾ï¤Ï¡¢¥¹¥¯¥ê¥×¥È(0.txt ¤ä nscript.dat)¤È¥¢¡¼¥«¥¤¥Ö(arc.sar ¤ä *.nsa ¤ä *.ns2)¤¬¤¢¤ì¤Ð½½Ê¬¤Ê¤Ï¤º¤Ç¤¹¡£¥¢¡¼¥«¥¤¥Ö¤¬Ê£¿ô¤¢¤ë¾ì¹ç¤ÏÁ´¤ÆÃÖ¤¤¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¥²¡¼¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢¥¢¡¼¥«¥¤¥Ö¤Î³°¤Ë°ìÉô¤Î²èÁü¥Õ¥¡¥¤¥ë¤ä²»³Ú¥Õ¥¡¥¤¥ë¤òÃÖ¤¤¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¾ì¹ç¤Ï¡¢¤½¤ì¤é¤Î¥Õ¥¡¥¤¥ë¤â¸µ¤ÈƱ¤¸¤è¤¦¤ËÃÖ¤¤¤Æ¤¯¤À¤µ¤¤¡£¥Ç¥£¥ì¥¯¥È¥êËèÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤¹¤ë¤È³Î¼Â¤Ç¤¹¡£

[ɬ¿Ü]²¼µ­¤ÎTrueType font ¤Ë¤è¤ëʸ»úɽ¼¨¤ò»²¹Í¤Ë¡¢ÆüËܸì TrueType font ¤òÍѰդ·¡¢"default.ttf" ¤È¤¤¤¦Ì¾Á°¤ÇÃÖ¤¤¤Æ¤¯¤À¤µ¤¤¡£

[Ǥ°Õ] CD audio ¤Î¿¶¤êÂØ¤¨±éÁÕ¤ò¤·¤¿¤¤¾ì¹ç¤Ï¡¢²¼µ­¤ÎCD audio ±éÁդﶤêÂØ¤¨¤Ë½¾¤Ã¤Æ MP3 ¥Õ¥¡¥¤¥ë¤òÍѰդ·¤Æ¤¯¤À¤µ¤¤¡£

[ɬ¿Ü]ºÇ¸å¤Ë¡¢ONScripter ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£Æ±¤¸¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë nscript.dat ¤È¥¢¡¼¥«¥¤¥Ö¤ò¼«Æ°Åª¤Ëõ¤·¡¢¥²¡¼¥à¤¬³«»Ï¤µ¤ì¤Þ¤¹¡£¤Ê¤ª ONScripter ¤Ï¡¢Æ±¤¸¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥»¡¼¥Ö¥Ç¡¼¥¿¤ä¥Õ¥¡¥¤¥ë¥í¥°Åù¤Î¾õÂÖ¥Õ¥¡¥¤¥ë¤òÊݸ¤¹¤ë¤¿¤á¡¢¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï write permission ¤ò½Ð¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£

TODO

  1. (¹â)Lua Âбþ
  2. (Ãæ)±¦¥¯¥ê¥Ã¥¯¤«¤é¤Î windowerase ¤ò¼Â¹Ô¤¹¤ë»þ¤Ë windoweffect ¤Î¸ú²Ì¤òÈ¿±Ç¤µ¤»¤ë¡£
  3. (Ãæ)bgcopy ¤Ç¼èÆÀ¤·¤¿²èÁü¤ò¥»¡¼¥Ö»þ¤Ë¥Õ¥¡¥¤¥ë¤ËÊݸ¤¹¤ë¤è¤¦¤Ë¤¹¤ë¡£
  4. (Ãæ)ʸ»ú¤Î±Æ¤¬´û¤ËÉÁ²è¤µ¤ì¤Æ¤¤¤ëʸ»ú¤Ë¤«¤Ö¤Ã¤¿¾ì¹ç¤ËÂн褹¤ë¡£
  5. (Äã)Àµ¼°¤Ê±Ñ¸ì¥â¡¼¥É(english Ì¿Îá)¤Ø¤Î°Ü¹Ô¡£
  6. (Äã)existspbtn ¤ò spbtn ¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤¤¤ë¤¬¡¢¤½¤ì¤Ç¤è¤¤¤Î¤«¤ò¸¡¾Ú¤¹¤ë¡£
  7. (Äã)¥³¡¼¥É¤Î clean up¡£
¡û¤À¤á¡¼¥¨¥ó¥¸¥ó³«È¯¡¦°Ü¿¢Æüµ­¡Ê²¾¡Ë
¿ô¿¤¯¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ËONScripter¤ò°Ü¿¢¤·¤Æ¤¤¤¿¤À¤¤¤¿½©·î¤«¤¿¤Í¤µ¤ó¤ÎÆüµ­¤Ç¤¹¡£
¡ûµ»½Ñ²°¤­¤µ¤é¤ÎÈ¢Äí
°ÊÁ°¤Ë¥Ð¥°¥È¥é¥Ã¥­¥ó¥°¥·¥¹¥Æ¥à¤ò±¿ÍѤ·¤Æ¤¤¤¿¤À¤¤¤¿¤­¤µ¤é¤µ¤ó¤ÎÆüµ­¤Ç¤¹¡£

»¨Â¿¤Ê¤³¤È

¥­¡¼¥Ü¡¼¥É¥·¥ç¡¼¥È¥«¥Ã¥È

ONScripter ¤ÏÁ´¤Æ¤ÎÁàºî¤ò¥­¡¼¥Ü¡¼¥É¤Ç¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¢ ¥¹¥¯¥ê¥×¥È¤ÎÊý¤Ç¥·¥ç¡¼¥È¥«¥Ã¥È¥­¡¼¤òÀßÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤½¤Á¤é¤¬Í¥À褵 ¤ì¤Þ¤¹¡£

¥­¡¼ÀâÌÀ
space¥Þ¥¦¥¹¤Îº¸¥¯¥ê¥Ã¥¯¤ÈƱ¤¸¤À¤¬¡¢²¼¤Ë¥Ü¥¿¥ó¤¬¤¢¤Ã¤Æ¤â¥Ü¥¿¥ó³°¤ò²¡¤·¤¿¤³¤È¤Ë¤Ê¤ë
return¥Þ¥¦¥¹¤Îº¸¥¯¥ê¥Ã¥¯¤ÈƱ¤¸
escape¥Þ¥¦¥¹¤Î±¦¥¯¥ê¥Ã¥¯¤ÈƱ¤¸
p,k,¢¬¥Ü¥¿¥ó¡¦Ê¸¾ÏÁªÂò»þ¤Ë¥Þ¥¦¥¹¥«¡¼¥½¥ë¤òÁ°¤ÎÁªÂò¹àÌÜ¤ËÆ°¤«¤¹
n,j,¢­¥Ü¥¿¥ó¡¦Ê¸¾ÏÁªÂò»þ¤Ë¥Þ¥¦¥¹¥«¡¼¥½¥ë¤ò¼¡¤ÎÁªÂò¹àÌÜ¤ËÆ°¤«¤¹
s ¼¡¤ÎÁªÂò»è¤Þ¤ÇÈô¤Ð¤¹¥â¡¼¥É¤ËÀÚ¤êÂØ¤¨
o £±¥Ú¡¼¥¸É½¼¨¤ò¤¹¤ë¤«¤·¤Ê¤¤¤«¤ÎÀÚ¤êÂØ¤¨
h,¢«¥Þ¥¦¥¹¤Î¥Û¥¤¡¼¥ë¥¢¥Ã¥×¤ÈƱ¤¸
l,¢ª¥Þ¥¦¥¹¤Î¥Û¥¤¡¼¥ë¥À¥¦¥ó¤ÈƱ¤¸
f Full screen mode ¤È Window mode ¤ÎÀÚ¤êÂØ¤¨
a automode ¤â¤·¤¯¤Ï mode_ext ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢ÆÉ¤ß¾å¤²¥â¡¼¥É¤ËÆþ¤ë
z --edit ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æµ¯Æ°¤·¤¿¤È¤­¤Ë¡¢²»Î̵ڤÓÊÑ¿ôÊѹ¹¥â¡¼¥É¤ËÆþ¤ë
1, 2, 3 ʸ»ú¤ÎÉÁ²è®ÅÙ¤òÊѹ¹
Shift + q ½ªÎ»¡Êend Ì¿Îá¤òȯ¹Ô¡Ë

µ¯Æ°¥ª¥×¥·¥ç¥ó

¥ª¥×¥·¥ç¥ó ÀâÌÀ
-h,--help¤Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»¤·¤Þ¤¹¡£
-v,--version¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤·¤Æ½ªÎ»¤·¤Þ¤¹¡£
--cdaudioCD Audio ±éÁե⡼¥É¤ËÊѹ¹¤·¤Þ¤¹¡£CD Audio ¤¬»È¤¨¤Ê¤«¤Ã¤¿¤È¤·¤Æ¤â MP3 ¥Õ¥¡¥¤¥ë¤Ï»ÈÍѤ·¤Þ¤»¤ó¡£
--cdnumber cd_numberCD Audio ±éÁե⡼¥É¤Ë¤ª¤¤¤Æ¡¢CD-ROM ¥É¥é¥¤¥Ö¤¬Ê£¿ô¤¢¤ë¾ì¹ç¤Ë¡¢²¿ÈÖÌܤΥɥ饤¥Ö¤ò»ÈÍѤ¹¤ë¤Î¤«¤ò»ØÄꤷ¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ï£°ÈÖÌܤǤ¹¡£
-f,--font file»ÈÍѤ¹¤ë TTF ¥Õ¥©¥ó¥È¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£
--registry file»ÈÍѤ¹¤ë registry file ¤ò»ØÄꤷ¤Þ¤¹¡£
--dll file»ÈÍѤ¹¤ë dll file ¤ò»ØÄꤷ¤Þ¤¹¡£
-r,--root path»ÈÍѤ¹¤ë¥²¡¼¥à¥Õ¥¡¥¤¥ë¤Î¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£
--fullscreen¥Õ¥ë¥¹¥¯¥ê¡¼¥ó¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£
--window¥¦¥£¥ó¥É¥¦¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£
--force-button-shortcutgetenter ¤È useescspc ¤ÎÌ¿Îá¤ò̵»ë¤·¤Þ¤¹¡£¤Ä¤Þ¤ê¡¢¥Þ¥¦¥¹¤Î¥¯¥ê¥Ã¥¯¤ò¶¯À©Åª¤Ë esc, space, return ¥­¡¼¤Ë³ä¤êÉÕ¤±¤Þ¤¹¡£
--enable-wheeldown-advance¥Æ¥­¥¹¥È½ªÃ¼¤Ç¤Î¥¯¥ê¥Ã¥¯ÂÔ¤Á¤ÎºÝ¤Ë¡¢¥Þ¥¦¥¹¤Î¥Û¥¤¡¼¥ë¥À¥¦¥óÁàºî¤ò¥¯¥ê¥Ã¥¯Áàºî¤È¤·¤Æ°·¤¤¤Þ¤¹¡£textgosub ¤Ç¥¯¥ê¥Ã¥¯ÂÔ¤Á¤ò¥«¥¹¥¿¥Þ¥¤¥º¤·¤Æ¤¤¤ë¤È¤­¤Ë¤Ï¸ú²Ì¤Ï¤¢¤ê¤Þ¤»¤ó¡£
--disable-rescalePDA_WIDTH ¤ä PDA_AUTOSIZE ¤òÄêµÁ¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤¿ ONScripter ¤Ë¤ª¤¤¤Æ¡¢¥¢¡¼¥«¥¤¥Ö¤«¤é²èÁü¤òÆÉ¤ß¹þ¤àºÝ¤Ë¡¢²èÁü¤ÎÂ礭¤µ¤òüËö¤Î¥¹¥¯¥ê¡¼¥ó¤ÎÂ礭¤µ¤ËÊÑ´¹¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£¤¢¤é¤«¤¸¤á¥¢¡¼¥«¥¤¥Ö°µ½Ì¤Ë¤è¤Ã¤Æ²èÁü¤ÎÂ礭¤µ¤òüËö¤Î¥¹¥¯¥ê¡¼¥ó¤ÎÂ礭¤µ¤ËÊÑ´¹¤·¤Æ¤ª¤¤¤¿¥¢¡¼¥«¥¤¥Ö¤ò°ì½ï¤Ë»ÈÍѤ¹¤ë¤È¡¢ÊÑ´¹½èÍý¤¬¾Êά¤µ¤ì¤ë¤¿¤áưºî¤¬¹â®¤Ë¤Ê¤ê¤Þ¤¹¡£¤¿¤À¤·¡¢¤³¤Î¾ì¹ç¤Ç¤â¥¢¡¼¥«¥¤¥Ö³°¤Î²èÁü¥Õ¥¡¥¤¥ë¤ÏÂ礭¤µ¤¬ÊÑ´¹¤µ¤ì¤Þ¤¹¡£
--render-font-outlineSDL_ttf 2.0.10 °Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤¿¥Õ¥©¥ó¥È¤Î¥¢¥¦¥È¥é¥¤¥óÉÁ²èµ¡Ç½¤ò»È¤¤¡¢±ÆÉÕ¤­Ê¸»ú¤ò¹õ¤¤ÎسԤÎÂÞʸ»ú¤È¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£Ê¸»ú¤¬¤¯¤Ã¤­¤ê¤È¤·¤Æ¸«¤ä¤¹¤¯¤Ê¤ë¤È»×¤¤¤Þ¤¹¡£
--editz ¥­¡¼¤ò²¡¤·¤¿¤È¤­¤Ë¡¢²»Î̵ڤÓÊÑ¿ô¤ÎÊÔ½¸¥â¡¼¥É¤ËÆþ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

°Û¤Ê¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤ÇƱ»þ¤ËÍ·¤ÖÊýË¡

Î㤨¤Ð¥Ç¥¹¥¯¥È¥Ã¥×£Ð£Ã(Windows, Linux, MacOSX)¤ä¥¹¥Þ¡¼¥È¥Õ¥©¥ó(Android, iPhone)¤Ê¤É¡¢°Û¤Ê¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò¶¦Í­¤·¤Æ¥²¡¼¥à¤ò¿Ê¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤´¤È¤Ë¥²¡¼¥à¤Î¥¢¡¼¥«¥¤¥Ö¤òÍѰդ·¡¢°Ê²¼¤ÎÃí°Õ¤Ë¤·¤¿¤¬¤Ã¤Æ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ò°Ü¤ë¤¿¤Ó¤Ë ONScripter(¤â¤·¤¯¤Ï NScripter) ¤Î½ñ¤­½Ð¤¹¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£

NScripter ¤â¤·¤¯¤Ï ONScripter ¤¬½ñ¤­½Ð¤¹¥Õ¥¡¥¤¥ë¤Ë¤Ï¼¡¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¤¦¤Á°ìÉô¤Î¥Õ¥¡¥¤¥ë¤Ï¥²¡¼¥à¤Ë¤è¤Ã¤Æ¤Ï½ñ¤­½Ð¤µ¤ì¤Ê¤¤¤¿¤á¸ºß¤·¤Ê¤¤¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£

½ñ¤­½Ð¤·¥Õ¥¡¥¤¥ëÀâÌÀ
archive_path/gloval.sav¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤Î³ÊǼ
archive_path/envdata´Ä¶­ÊÑ¿ô¤Î³ÊǼ
archive_path/kidoku.dat´ûÆÉ¥Æ¥­¥¹¥È¾ðÊó¤Î³ÊǼ
archive_path/NScrflog.dat´ûÆÉ¥Õ¥¡¥¤¥ë¾ðÊó¤Î³ÊǼ
archive_path/NScrllog.dat´ûÆÉ¥é¥Ù¥ë¾ðÊó¤Î³ÊǼ
archive_path/save*.dat¥»¡¼¥Ö¥Õ¥¡¥¤¥ë(ONScripter ¤Î½ÐÎϤ·¤¿¤â¤Î¤Ï ONScripter ÀìÍѤǤ¹¡¢NScripter ¤¬½ÐÎϤ·¤¿¤â¤Î¤Ï NScripter ¤Ç¤â ONScripter ¤Ç¤âÆÉ¤ß¹þ¤á¤Þ¤¹)
archive_path/sav/save*.dat¾åÃʤΠNScripter ¤¬½ÐÎϤ¹¤ë¤â¤Î¤È¸ß´¹À­¤Î¤¢¤ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¡Ê̵Êݾڡˤǡ¢ONScripter ¤¬½ÐÎϤ·¤Þ¤¹
archive_path/¤½¤Î¾²èÁü¥Õ¥¡¥¤¥ë¥¹¥¯¥ê¡¼¥ó¥·¥ç¥Ã¥È¤ò²èÁü¥Õ¥¡¥¤¥ë¤È¤·¤ÆÊݸ¤·¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¥²¡¼¥à¤Ë¤è¤Ã¤Æ¾ì½ê¤ä̾Á°¤¬°Û¤Ê¤ë¤Î¤Ç¡¢¥²¡¼¥à¤´¤È¤ËÂбþ¤·¤Æ¤¯¤À¤µ¤¤¡£

¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï NScripter (ONScripter) ¤¬¥Ð¡¼¥¸¥ç¥ó ¥¢¥Ã¥×¤¹¤ë¤È¤­¤ËÊѹ¹¤µ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢ONScripter ¤Î½ÐÎÏ ¤¹¤ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢ÀèÆ¬¤Ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤Î¥Ð¡¼¥¸¥ç¥óÈֹ椬Æþ¤Ã¤Æ¤¤ ¤Þ¤¹¡£¤Þ¤¿¡¢sav ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Ê¤·¤Î ¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò sav °Ê²¼¤Ë¤âƱ»þ¤ËºîÀ®¤·¤Þ¤¹¡£sav °Ê²¼¤ËÀ¸À®¤µ¤ì¤ë¥»¡¼ ¥Ö¥Õ¥¡¥¤¥ë¤Ï¡¢ºÇ¿·¤Î NScripter ¤¬À¸À®¤¹¤ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤È¸ß´¹À­¤¬¤¢¤ê ¤Þ¤¹¡£¤Ê¤ª¡¢¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Ï ONScripter ¤Î¥Ð¡¼¥¸¥ç¥ó¤È ¤Ï°Û¤Ê¤ê¤Þ¤¹¡£

ONScripter ¤Ï¡¢¥Ð¡¼¥¸¥ç¥óÈֹ椢¤ê¤ÎǤ°Õ¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤«¡¢¤â¤·¤¯¤ÏºÇ¿·¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Ê¤·¤Î¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

ONScripter ¤«¤é ONScripter ¤Ø¥Ç¡¼¥¿¤ò°Üư

¾åµ­¤Î½ñ¤­½Ð¤·¥Õ¥¡¥¤¥ë¤òÁ´¤Æ¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£
ONScripter_dir/* ¢ª ONScripter_dir/*

NScripter ¤«¤é ONScripter ¤Ø¥Ç¡¼¥¿¤ò°Üư

¾åµ­¤Î½ñ¤­½Ð¤·¥Õ¥¡¥¤¥ë¤òÁ´¤Æ¡Êsave*.dat¤ò´Þ¤à¡Ë¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£
NScripter_dir/* ¢ª ONScripter_dir/*

ONScripter ¤«¤é NScripter ¤Ø¥Ç¡¼¥¿¤ò°Üư

save*.dat ¤ò½ü¤¯¾åµ­¤Î½ñ¤­½Ð¤·¥Õ¥¡¥¤¥ë¤òÁ´¤Æ¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£
ONScripter_dir/* ¢ª NScripter_dir/*
save*.dat ¤Ë¤Ä¤¤¤Æ¤Ï sav ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ËÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£
ONScripter_dir/sav/save*.dat ¢ª NScripter_dir/save*.dat

Ãí°ÕÅÀ

  • NScripter ¤Ï¡¢¸½»þÅÀ(2011/12/15)¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤ëºÇ¿·¤Î nscr.exe ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£¸Å¤¤ NScripter ¤¬½ÐÎϤ¹¤ë¥»¡¼¥Ö¥Õ¥¡¥¤¥ë¤ò ONScripter ¤ÇÆÉ¤ß¹þ¤à¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
  • ºÇ¿·¤Î NScripter ¤È ONScripter ¤Î¥Ç¡¼¥¿¸ß´¹À­¤ÏÊݾڤ·¤Þ¤»¤ó¤¬¡¢»ä¤¬»î¤·¤¿¸Â¤ê¤ÏÌäÂê¤ÏÀ¸¤¸¤Æ¤ª¤ê¤Þ¤»¤ó¡£
  • ONScripter ¤È NScripter ¤òÊ»ÍѤµ¤ì¤ëÊý¤Ï¡¢Windows ¾å¤Ç¤ÏºÇ½é¤«¤é¾åµ­¤ÎºÇ¿·¤Î nscr.exe ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£¤½¤Î¾ì¹ç¡¢¤¢¤é¤«¤¸¤á sav ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£

¥ì¥¸¥¹¥È¥êÆÉ¤ß¹þ¤ß

getreg Ì¿Îá¤Ï Windows ¤Î registry ¤«¤é»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¤ò¼èÆÀ¤· ¤Þ¤¹¡£ONScripter ¤Ç¤Ï¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë registry.txt ¤Ë¥Ç¡¼¥¿¤òµ­½Ò¤·¡¢ ¤³¤ì¤òÆÉ¤ß¹þ¤à¤³¤È¤Ç¤³¤Îµ¡Ç½¤ò¼Â¸½¤·¤Þ¤¹¡£

registry.txt ¤Î½ñ¼°¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹¡£Âçʸ»ú¡¦¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Þ¤¹¡£¤Þ ¤¿Í¾·×¤Ê¥¹¥Ú¡¼¥¹Åù¤òÆþ¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡££²¥Ð¥¤¥Èʸ»ú¤¬»È¤ï¤ì¤Æ¤¤ ¤ë¾ì¹ç¡¢Ê¸»ú¥³¡¼¥É¤¬ Shift JIS ¤Ë¤Ê¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£

[getreg ¤Î£²ÈÖÌܤΰú¿ô¡Ê¤¿¤À¤·Á°¸å¤Î""¤Ï½ü¤¯¡Ë]
getreg ¤Î£³ÈÖÌܤΰú¿ô = Èæ³ÓÂоÝʸ»úÎó¡ÊÁ°¸å¤Î""¤ÏɬÍפǤ¹¡Ë

registry.txt ¤ÎÎã

[software\StudioOGA\ONScripter]
"INSTALL"="FULL"

[software\StudioOGA\¤Î¤Þ¤É]
"Download log file"="c:\nomad_down.log"
"Upload log file"="c:\nomad_up.log"

ONScripter µ¯Æ°»þ¤Ë --registry ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢ registry.txt ¤ò°ì¥«½ê¤Ë¤Þ¤È¤á¤Æ¤ª¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£--registry ¤ò»ØÄꤷ ¤Ê¤¤¾ì¹ç¤Ï¡¢¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î registry.txt ¤òÆÉ¤ß¤Ë¤¤¤­¤Þ¤¹¡£

DLL ÆÉ¤ß¹þ¤ß

exec_dll Ì¿Îá¤Ï Windows ¾å¤Ç¼Â¹Ô²Äǽ¤Ê DLL (Dynamic Link Library) ¤ò¼Â¹Ô¤·¤Þ¤¹¡£ONScripter ¤Ç¤Ï¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë dll.txt ¤Ë DLL ̾¤È¤½¤ÎÌáÃͤÎÂбþ¤òµ­½Ò¤·¡¢¤³¤ì¤òÆÉ¤ß¹þ¤à¤³¤È¤Ç¤³¤Îµ¡Ç½¤ò¼Â¸½¤·¤Þ ¤¹¡£½¾¤Ã¤Æ¡¢¼ÂºÝ¤Ë DLL ¤¬¼Â¹Ô¤µ¤ì¤ë¤ï¤±¤Ç¤Ï¤Ê¤¯¡¢¤Þ¤¿ÌáÃͤϸÇÄê¤Ë¤Ê¤ê ¤Þ¤¹¡£

dll.txt ¤Î½ñ¼°¤Ï¼¡¤ÎÄ̤ê¤Ç¤¹¡£Âçʸ»ú¡¦¾®Ê¸»ú¤Ï¶èÊ̤µ¤ì¤Þ¤¹¡£¤Þ¤¿Í¾ ·×¤Ê¥¹¥Ú¡¼¥¹Åù¤òÆþ¤ì¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡££²¥Ð¥¤¥Èʸ»ú¤¬»È¤ï¤ì¤Æ¤¤¤ë¾ì ¹ç¡¢Ê¸»ú¥³¡¼¥É¤¬ Shift JIS ¤Ë¤Ê¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£

[DLL ̾]
str = "ʸ»úÎó" (getret ¤Ç¼õ¤±¼è¤ë¤³¤È¤Î¤Ç¤­¤ëʸ»úÎóÌáÃÍ)
ret = À°¿ô (getret ¤Ç¼õ¤±¼è¤ë¤³¤È¤Î¤Ç¤­¤ë¿ô»úÌáÃÍ)

dll.txt ¤ÎÎã

[test.dll]
str = "»³ÅÄ/ÂÀϺ/¤ä¤Þ¤À/¤¿¤í¤¦"
ret = 1

[test2.dll]
str = "StudioOGA"
ret = 2

ONScripter µ¯Æ°»þ¤Ë --dll ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢dll.txt ¤ò°ì ¥«½ê¤Ë¤Þ¤È¤á¤Æ¤ª¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£--dll ¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¸½ºß¤Î¥Ç¥£ ¥ì¥¯¥È¥ê¤Î dll.txt ¤òÆÉ¤ß¤Ë¤¤¤­¤Þ¤¹¡£

²»Î̵ڤÓÊÑ¿ôÊÔ½¸¥â¡¼¥É

¤³¤ì¤Ï»ÃÄêŪ¤Ê¤ª¤Þ¤±µ¡Ç½¤Ç¤¢¤ê¡¢º£¸åÊѹ¹¤µ¤ì¤¿¤ê̵¤¯¤Ê¤Ã¤¿¤ê¤¹¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£

ONScripter µ¯Æ°»þ¤Ë --edit ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤ÇÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£

Ǥ°Õ¤Î¥­¡¼ÆþÎÏÂÔ¤Á¾õÂÖ»þ¤Ë z ¥­¡¼¤ò²¡¤¹¤³¤È¤Ç¡¢ÊÔ½¸¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹¡£¤³¤Î»þ¡¢title bar ¤Ë

[EDIT MODE]  MP3 vol (m)  SE vol (s)  Voice vol (v)  Numeric variable (n)

¤Èɽ¼¨¤µ¤ì¤ë¤Ï¤º¤Ç¤¹¡£¤³¤Î¾õÂ֤ǡ¢m, s, v, n ¤Î¤¤ ¤º¤ì¤«¤Î¥­¡¼¤ò²¡¤¹¤³¤È¤Ç¡¢¤½¤ì¤¾¤ì¤ÎÃͤòÊѹ¹¤¹¤ë¥µ¥Ö¥â¡¼¥É¤ËÆþ¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢Esc ¥­¡¼¤ò²¡¤¹¤³¤È¤Ë¤è¤Ã¤Æ¥â¡¼¥É¤òÈ´¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¿ô»úÊÑ¿ô¤Î¾ì¹ç¤Ï¡¢ÃÍÊѹ¹¤ÎÁ°¤Ë¤É¤ÎÊÑ¿ô¤òÊѹ¹¤¹¤ë¤Î¤«¤òÁªÂò¤·¤Þ¤¹¡£

ÃÍÊѹ¹¥µ¥Ö¥â¡¼¥É¤Ç¤Ï¡¢0 ¤«¤é 9 ¤Þ¤Ç¤Î¿ô»ú¤È -, BackSpace, Esc, ¥ê¥¿¡¼ ¥ó¥­¡¼¤¬»È¤¨¤Þ¤¹¡£- ¥­¡¼¤Ï¡¢Âоݤ¬¿ô»úÊÑ¿ô¤Ç¤«¤Ä¿ô»ú¤¬0¤Î»þ¤Î¤ßÍ­¸ú¤Ë ¤Ê¤ê¤Þ¤¹¡£´û¤Ë¿ô»ú¤¬ÆþÎϤµ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢°ìö BackSpace ¤Ç¿ô»ú¤òÁ´ Éô¾Ã¤·¤Æ¤«¤é - ¥­¡¼¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£

TrueType font ¤Ë¤è¤ëʸ»úɽ¼¨

ʸ»ú¤òɽ¼¨¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ÅùÉý¤Î TrueType font ¤òÍѰդ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£Î㤨¤Ð Windows 7 ¤Ë¤Ï c:\Windows\Fonts ¤Î²¼¤Ë msgothic.ttc (£Í£Ó¥´¥·¥Ã¥¯)¤¬¤¢¤ê¡¢¤Þ¤¿¥Õ¥ê¡¼¤Ç¼ê¤Ë¤Ï¤¤¤ë¥Õ¥©¥ó¥È¤Ë¤Ï°Ê²¼¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£

M+¤ÈIPA¤Î¹çÀ®¥Õ¥©¥ó¥È
M+ ¥Õ¥©¥ó¥È¤È IPA ¥Õ¥©¥ó¥È¤ò¸µ¤Ë¤·¤¿ºÆÇÛÉÛ²Äǽ¤Ê¥Õ¥©¥ó¥È¤Ç¤¹¡£ÆÃ¤Ë Migu-2M-bold.ttf ¤¬¤­¤ì¤¤¤ÊÂÀ»ú¤Ç¸«¤ä¤¹¤¯¤ª´«¤á¤Ç¤¹¡£
IPA¥Õ¥©¥ó¥È
ºÆÇÛÉÛ²Äǽ¤Ê¥´¥·¥Ã¥¯¤ÈÌÀÄ«¤Î¥Õ¥©¥ó¥È¤Ç¤¹¡£
¤ß¤«¤Á¤ã¤ó¥Õ¥©¥ó¥È
¼ê½ñ¤­É÷¤Î¥Õ¥©¥ó¥È¤Ç¤¹¡£

SDL_ttf ¤ÎÂÀ»úɽ¼¨µ¡Ç½¤ò»È¤¦¤ÈÆüËܸì¤Îɽ¼¨¤¬±ø¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤¿¤á¡¢ONScripter ¤Ç¤ÏÂÀ»ú»ØÄê¤ò̵»ë¤·¤Æ¤¤¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢ÆÃ¤Ë¥¹¥Þ¡¼¥È¥Õ¥©¥ó¤Ê¤É²èÌ̤¬¾®¤µ¤¤µ¡´ï¤Ç¤Ï¡¢¾å¤Î Migu-2M-bold.ttf ¤ä HG¥´¥·¥Ã¥¯E (HGRGE.TTC) ¤Ê¤ÉºÇ½é¤«¤éÂÀ»ú¤Î¥Õ¥©¥ó¥È¤ò»ÈÍѤ¹¤ë¤È¤è¤¤¤È»×¤¤¤Þ¤¹¡£

ONScripter ¤òµ¯Æ°¤¹¤ëÁ°¤Ë¡¢»ÈÍѤ¹¤ë TrueType font ¥Õ¥¡¥¤¥ë¤ò¡¢default.ttf ¤È¤¤¤¦Ì¾Á°¤Ë¤·¤Æ¥²¡¼¥à¤Î¥¹¥¯¥ê¥×¥È¤¬¤¢¤ë¾ì½ê¤Î¥³¥Ô¡¼¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£

CD audio ±éÁդﶤêÂØ¤¨

¥²¡¼¥à¤Î¥¹¥¯¥ê¥×¥È¤¬¤¢¤ë¾ì½ê¤Ë cd ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¡¢¤½¤³¤Ë°Ê²¼¤Î̾Á°¤Ç²»³Ú¥Õ¥¡¥¤¥ë¤òÃÖ¤­¤Þ¤¹¡£
cd/track01.xxx
cd/track02.xxx
cd/track03.xxx
...
cd/track14.xxx
...
²»³Ú¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï mp3, ogg, wav ·Á¼°¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡£¾å¤Î xxx¤Ï¡¢»ÈÍѤ¹¤ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¹ç¤ï¤»¤ÆÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£

¥¹¥¯¥ê¥×¥ÈÃæ¤Î CD audio ¤Î£±¶ÊÌܤò±éÁÕ¤¹¤ëÌ¿Îá¤Ï¡¢ "track01.mp3" (mp3 ·Á¼°¤Î¾ì¹ç)¤ò±éÁÕ¤¹¤ë¤è¤¦¤ËÊѹ¹¤µ¤ì¤Þ¤¹¡£ "--cdaudio"¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¤®¤ê¡¢¤³¤ì¤¬¥Ç¥Õ¥© ¥ë¥È¤Îµóư¤È¤Ê¤ê¤Þ¤¹¡£²»³Ú¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢±éÁÕ¤»¤º¤Ë³¹Ô ¤·¤Þ¤¹¡£

MIDI ±éÁÕµ¡Ç½

MIDI ¤Ï SDL_mixer ¤Îµ¡Ç½¤ò»È¤Ã¤Æ±éÁÕ¤·¤Þ¤¹¡£
¤³¤Î»þ¡¢¸½ºß¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë tmp.mus ¤È¤¤¤¦°ì»þ¥Õ¥¡¥¤¥ë¤òºî¤ê¤Þ¤¹¡£Èþ¤·¤¯¤Ê¤¤¤Ç¤¹¤¬¡¢SDL_mixer ¤Î MIDI ÆÉ¤ß¹þ¤ßÉô¤¬¥Õ¥¡¥¤¥ë¤«¤é¤ÎÆÉ¤ß¹þ¤ß¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¤ä¤à¤ò¤¨¤Þ¤»¤ó¡£

Unix·Ï(ưºî³Îǧ¤Ï Linux ¤È Zaurus)¤Ç¥½¥Õ¥È¥¦¥§¥¢²»¸»¤Ç±éÁÕ¤¹¤ë¾ì¹ç¡Ê¥Ç¥Õ¥©¥ë¥È¡Ë¡£
SDL_mixer ¤Ë¼è¤ê¹þ¤Þ¤ì¤Æ¤¤¤ë timidity ¤ò»ÈÍѤ·¤Æ¥½¥Õ¥È¥¦¥§¥¢²»¸»¤Ç±éÁÕ¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢MIDI¤Î²»¿§¥Ç¡¼¥¿timidity.tar.gz¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ /usr/local/lib/ °Ê²¼¤ËŸ³«¤·¤Æ¤¯¤À¤µ¤¤¡£
Windows ¤Î¾ì¹ç¡£
timidity.tar.gz¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ c:\ °Ê²¼¤ËŸ³«¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤³¤ì¤ò¤·¤Ê¤¯¤Æ¤â MIDI ¤¬ÌĤ俤ȻפäƤ¤¤¿¤Î¤Ç¤¹¤¬¡¢¤³¤¦¤·¤Ê¤¤¤ÈÍî¤Á¤ë¤è¤¦¤Ç¤¹¡£
Unix·Ï(ưºî³Îǧ¤Ï Linux)¤Ç³°Éô MIDI ²»¸»¤òÍøÍѤ·¤Æ±éÁÕ¤¹¤ë¾ì¹ç¡£
playmidi Åù¤Î³°Éô²»¸»¤ò»ÈÍѤǤ­¤ë MIDI player ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¡¢´Ä¶­ÊÑ¿ô MUSIC_CMD ¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¡ÊÎã MUSIC_CMD=/usr/bin/playmidi¡Ë
ÅöÊý¤Ç¤Ï¡¢¥·¥ê¥¢¥ëÀܳ¤Ç³°Éô²»¸»¤ò·Ò¤®¡¢MUSIC_CMD ¤Ë '/usr/bin/midiplay -q -o /dev/ttyS0' ¤òÀßÄꤷ¤ÆÆ°ºî³Îǧ¤ò¤·¤Æ¤¤¤Þ¤¹¡£
playmidi¤Ï¡¢¥«¡¼¥Í¥ë¤Çǧ¼±¤µ¤ì¤ë MIDI ¥Ý¡¼¥È¤ËÂФ·¤Æ¤·¤«±éÁդǤ­¤Þ¤»¤ó¤¬¡¢midiplay¤Ï¥·¥ê¥¢¥ë¤ËľÀܽФ»¤Þ¤¹¡£
¥·¥ê¥¢¥ë¥Ý¡¼¥È¤òMIDI¥Ý¡¼¥È¤Ë¤¹¤ë patch¤ò»È¤¨¤Ð¡¢playmidi ¤Ç¤â¥·¥ê¥¢¥ëÀܳ²»¸»¤ò»È¤¨¤½¤¦¤Ç¤¹¤¬¡¢Ì¤³Îǧ¤Ç¤¹¡£

¥¢¡¼¥«¥¤¥Ö°µ½Ì

ÀΤÎZaurus (320x240) ¤ä PSP (360x270) ¤Ê¤É¤Ï²èÌ̤ÎÂ礭¤µ¤¬¾®¤µ¤¤¤¿ ¤á¡¢¤¢¤é¤«¤¸¤á¥¢¡¼¥«¥¤¥ÖÃæ¤Î²èÁü¥Õ¥¡¥¤¥ë¤ò²èÌÌ¥µ¥¤¥º¤Ë¹ç¤ï¤»¤Æ¾®¤µ¤¯¤· ¤Æ¤ª¤¯¤³¤È¤Ë¤è¤ê¡¢¥¢¡¼¥«¥¤¥Ö¥µ¥¤¥º¤ò½Ì¾®¤·¡¢¾¯¤Ê¤¤µ­²±¥Ç¥Ð¥¤¥¹¤òÍ­¸ú³è ÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Ê¤ª¡¢SPB °µ½Ì¤Î²èÁü¤Ï¡¢¸å½Ò¤Î -e ¥ª¥×¥·¥ç¥ó¤ò»Ø Äꤷ¤Ê¤¤¾ì¹ç BMP ·Á¼°¤È¤·¤Æ³ÊǼ¤µ¤ì¤Þ¤¹¡£

»È¤¤Êý

> sarconv                    ÊÑ´¹¸µ²èÌÌÉý ÊÑ´¹Àè²èÌÌÉý ÊÑ´¹¸µSAR¥Õ¥¡¥¤¥ë̾ ÊÑ´¹ÀèSAR¥Õ¥¡¥¤¥ë̾ 
> nsaconv [-e] [-ns2] [-ns3] ÊÑ´¹¸µ²èÌÌÉý ÊÑ´¹Àè²èÌÌÉý ÊÑ´¹¸µNSA¥Õ¥¡¥¤¥ë̾ ÊÑ´¹ÀèNSA¥Õ¥¡¥¤¥ë̾ 

ÊÑ´¹¸µ²èÌÌÉý¤Ï 640 ¤« 800 ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£

ÊÑ´¹Àè²èÌÌÉý¤Ï 176(iPod), 320(QVGA), 360(PSP), 384(PSP), 640(VGA) ¤Ê¤É¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£

»ÈÍÑÎã

²èÌ̤Υµ¥¤¥º¤¬ 640x480 ¤Ç³ÈÄ¥»Ò¤¬ sar ¤Î¥¢¡¼¥«¥¤¥Ö¤ò 320x240 ¤Ë¤¹¤ë ¾ì¹ç

> sarconv 640 320 arc.sar zaurus_dir/arc.sar
...

²èÌ̤Υµ¥¤¥º¤¬ 800x600 ¤Ç³ÈÄ¥»Ò¤¬ nsa ¤Î¥¢¡¼¥«¥¤¥Ö¡Ê¥Ð¡¼¥¸¥ç¥ó£±¡Ë ¤ò 320x240 ¤Ë¤¹¤ë¾ì¹ç

> nsaconv [-e] 800 320 arc.nsa zaurus_dir/arc.nsa
> nsaconv [-e] 800 320 arc1.nsa zaurus_dir/arc1.nsa
...

²èÌ̤Υµ¥¤¥º¤¬ 800x600 ¤Ç³ÈÄ¥»Ò¤¬ nsa ¤Î¥¢¡¼¥«¥¤¥Ö¡Ê¥Ð¡¼¥¸¥ç¥ó£²¡Ë ¤ò 640x480 ¤Ë¤¹¤ë¾ì¹ç

> nsaconv [-e] -ns2 800 640 arc.nsa zaurus_dir/arc.nsa
> nsaconv [-e] -ns2 800 640 arc1.nsa zaurus_dir/arc1.nsa
...

NSA ¥¢¡¼¥«¥¤¥Ö¤Î¥Ð¡¼¥¸¥ç¥ó£±¤È£²¤È£³¤Î¶èÊÌ¤Ï¼êÆ°¤Ç¤¹¡£¥¹¥¯¥ê¥×¥È¤Ç ns2 Ì¿Î᤬»È¤ï¤ì¤Æ¤¤¤ì¤Ð¥Ð¡¼¥¸¥ç¥ó£²¡¢ns3 Ì¿Î᤬»È¤ï¤ì¤Æ¤¤¤ì¤Ð¥Ð¡¼¥¸¥ç¥ó£³¤Ç¤¹¡£¥¹¥¯¥ê¥×¥È¤¬³Îǧ¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¢¤Þ¤º -ns2 ¤òÉÕ¤±¤º¤Ë»î¤·¡¢¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¤é -ns2 ¤â¤·¤¯¤Ï -ns3 ¤òÉÕ¤±¤Æ»î¤·¤Æ¤¯¤À¤µ¤¤¡£

-e ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È¡¢wav ¤È bmp ¥Õ¥¡¥¤¥ë¤ò nbz °µ½Ì¤·¤Þ¤¹¡£¤³¤ì¤ò¹Ô¤¦¤È¡¢NSA ¥¢¡¼¥«¥¤¥Ö¤Î°µ½Ì¤Î¼ïÎà¤ò¼¨¤¹¥Õ¥é¥°¤Ë ONScripter ÆÈ¼«¤ÎÃͤòÀßÄꤷ¤Þ¤¹¡£¤³¤ÎÆÈ¼«³ÈÄ¥¤Ë¤Ä¤¤¤Æ¤Ï¡¢ËܲȤ¬¾­Í襢¡¼¥«¥¤¥Ö¤Î»ÅÍͤò³ÈÄ¥¤·¤¿¤È¤­¤Ë¥Ð¥Ã¥Æ¥£¥ó¥°¤¹¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¤¬¡¢¤½¤Î»þ¤Ï¤½¤ì¤ò²óÈò¤¹¤ë¤è¤¦¤Ë¥³¥ó¥Ð¡¼¥¿¤ò½¤Àµ¤·¡¢ºÆ¥³¥ó¥Ð¡¼¥È¤¹¤ë¤³¤È¤Ç²ò·è¤Ç¤­¤Þ¤¹¡£¤½¤Î¾ì¹ç¤Ç¤â¡¢save file Åù¤Ë¤Ï°ìÀڱƶÁ¤¬¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡¢Zaurus ¤Ç»ÈÍѤµ¤ì¤ëÊý¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤Æ¥³¥ó¥Ð¡¼¥È¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£wav ¤ò bzip2 ¤Ç°µ½Ì¤¹¤ë¤Î¤Ç¡¢wav ¤ò¿ÍѤ¹¤ë¥²¡¼¥à¤Ç¤Ï¤«¤Ê¤ê¥¢¡¼¥«¥¤¥Ö¤¬¾®¤µ¤¯¤Ê¤ê¤Þ¤¹¡£¥Ç¥á¥ê¥Ã¥È¤È¤·¤Æ¤Ï¡¢bzip2 ¤ÎÉü¹æ¤ò¹Ô¤¦¤¿¤á¼ã´³ÃÙ¤¯¤Ê¤ê¤Þ¤¹¤¬¡¢µ¤¤¬ÉÕ¤«¤Ê¤¤ÄøÅ٤Ǥ¹¡£

-j ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È¡¢¥Õ¥¡¥¤¥ë̾¤Ï¤½¤Î¤Þ¤Þ¤Ç bmp ¥Õ¥¡¥¤¥ë¤ò jpeg ¤ËÊÑ´¹¤·¤Þ¤¹¡£¤¿¤À¤·¡¢¥Ñ¥ì¥Ã¥È¥«¥é¡¼¤Î bmp ¥Õ¥¡¥¤¥ë¤Ï bmp ¤Î¤Þ¤ÞÊÑ´¹¤µ¤ì¤Þ¤¹¡£

-q ¥ª¥×¥·¥ç¥ó¤Ç jpeg ¤Ç°µ½Ì¤¹¤ëºÝ¤ÎÉʼÁ¡Ê£°¡Á£±£°£°¡Ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¾®¤µ¤¤Ãͤò»ØÄꤹ¤ë¤È¡¢ÉʼÁ¤¬°­¤¯¤Ê¤ê¤Þ¤¹¤¬¡¢°µ½Ì¸å¤Î¥µ¥¤¥º¤¬¾®¤µ¤¯¤Ê¤ê¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤È¤Ï£·£µ¤Ç¤¹¡£

¥µ¥¤¥º¤ò¾®¤µ¤¯¤·¤¿¥¢¡¼¥«¥¤¥Ö¤ò»È¤¦¤È¤­¤Ï¡¢onscripter ¤Ë --disable-rescale ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
¤Ê¤ª¡¢Linux Åù¤Ç¤â¡¢-DPDA ¤ò¤Ä¤±¤Æ¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢320x240 ²è Ì̤ǥ²¡¼¥à¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

Windows ¾å¤Ç MP3 ¤Î²»¤¬¤Ö¤Ä¤Ö¤Ä¤È¤®¤ì¤ëÌäÂê

Windows ¤Ç¥³¥ó¥Ñ¥¤¥ëºÑ¤Î SMPEG ¤Î¥Ð¥¤¥Ê¥ê¤ò»ý¤Ã¤Æ¤¯¤ë¤È¡¢MP3 ¤Ë¤è¤Ã¤Æ¤Ï²»¤¬¤Ö¤Ä¤Ö¤Ä¤È¤®¤ì¤Æ±éÁÕ¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¡¢SMPEG ¤ò MSVC ¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë»þ¤ÎºÇŬ²½¤ÎÌäÂê¤Ç¡¢²¼µ­¤ÎÄ̤ê¤Ë MSVC ¤Î global optimization ¤ò°ìÉôÍÞÀ©¤¹¤ë»ØÄê¤ò¤·¡¢¼«Ê¬¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤Ç²ò·è¤Ç¤­¤Þ¤¹¡£

½¤Àµ¤¹¤ë¥Õ¥¡¥¤¥ë: audio/mpeglayer3.cpp
´Ø¿ô layer3reorderandantialias ¤ÎÁ°¸å¤Ë¡¢²¼¤Î¤è¤¦¤Ë #pragma »ØÄê¤òÄɲà ¤¹¤ë¡£

#pragma optimize( "g", off )
void MPEGaudio::layer3reorderandantialias(int ch,int gr,
                                          REAL  in[SBLIMIT][SSLIMIT],
                                          REAL out[SBLIMIT][SSLIMIT]){
  ......
}
#pragma optimize( "g", on )

±Ñ¸ì¥Î¥Ù¥ëºîÀ®(Obsolete)

¤³¤ì¤Ï Chend ¤µ¤ó(chendo[at]gmail.com)¤«¤é¤ÎÍ×˾¤Ë´ð¤Å¤¯ ONScripter ÆÈ¼«¤Î³ÈÄ¥¤Ç¤¹¡£¤³¤ì¤Þ¤Ç¡¢»ÅÍͤÎÄ󰯤ä¥Ñ¥Ã¥Á¤Ê¤É¿¤¯¤Î¶¨ÎϤò¤·¤Æ¤¤¤¿¤À ¤­¤Þ¤·¤¿¡£

¥³¥ó¥Ñ¥¤¥ë»þ¤Ë ENABLE_1BYTE_CHAR ¤òÄêµÁ¤¹¤ë¤³¤È¤Ç¡¢`(back quote) °Ê ¹ß¹ÔËö¤â¤·¤¯¤ÏÊ̤Π` ¤Þ¤Ç¤ò¡¢1byte ʸ»ú¤Çµ­½Ò¤µ¤ì¤¿¥Æ¥­¥¹¥Èʸ¤È¤ß¤Ê¤· ¤ÆÉ½¼¨¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£¤³¤Î´Ö¤Ç¤ÏȾ³Ñ¥¹¥Ú¡¼¥¹¤¬É½¼¨¤È¤·¤ÆÍ­¸ú¤Ë¤Ê¤ê¤Þ ¤¹¤¬¡¢¥Æ¥­¥¹¥ÈÆâ¤ÎÊÑ¿ôɽ¼¨¤Ï̵¸ú¤Ë¤Ê¤ê¡¢¤Þ¤¿¿§¡¦»þ´Ö»ØÄê¤â³«»Ï°ÌÃ֤ˤè¤Ã ¤Æ¤Ï̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£¥Æ¥­¥¹¥ÈÅÓÃæ¤Ç¿§¤òÊѤ¨¤ë¾ì¹ç¤Ï¡¢/ ¤Ç¹Ô¤òʬ¤±¤ë¤Ê¤É ¤·¤Æ¤¯¤À¤µ¤¤¡£¤¿¤À¤·¡¢¥¯¥ê¥Ã¥¯ÂÔ¤Á(@)²þ¥Ú¡¼¥¸ÂÔ¤Á(\)ľ¸å¤Î¶¯À©¥¯¥ê¥Ã¥¯ ʸ»ú¤ò̵»ë(_)¤ÏÍ­¸ú¤Ç¤¹¡£

¾­ÍèËÜ²È¤Ç ` ¤Ë²¿¤«µ¡Ç½¤ò³ä¤ê¿¶¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢ºï½ü¤â¤·¤¯¤ÏÊ̤Îʸ»ú¤Ë Êѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£¸½¾õ¤Î¤è¤¦¤Ë ENABLE_1BYTE_CHAR ¤Î»ØÄê¤ÎÍ­ ̵¤Ç»È¤¤Ê¬¤±¤é¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢Êݾڤθ¤ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

¤Þ¤¿¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤Ë ENABLE_1BYTE_CHAR ¤È¹ç¤ï¤»¤Æ FORCE_1BYTE_CHAR ¤ò»ØÄꤹ¤ë¤È¡¢Á´¤Æ¤Îɽ¼¨¤òȾ³Ñ¤Ë¤¹¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£¶ñÂÎŪ¤Ë¤Ï¡¢ ¾åµ­¤Ë²Ã¤¨¤Æ¡¢±¦¥¯¥ê¥Ã¥¯¥á¥Ë¥å¡¼¤Îɽ¼¨¤¬±Ñ¸ì¤Ë¤Ê¤ê¡¢¤Þ¤¿¿ô»úÊÑ¿ô¤Îɽ¼¨ ¤¬È¾³Ñ¤Ë¤Ê¤ê¤Þ¤¹¡£

°Ê²¼¤Ë¥¹¥¯¥ê¥×¥ÈÎã¤ò½ñ¤­¤Þ¤¹¡£

*define 
clickstr `.?"`, 2 
savename `Save the scene`, `Load the scene`, "Memory "
rmenu `Save to file`,save,`Load from file`,load
game
 
*start
`Hi, this was test.
`Hi, this is test again.
`_"He said so."
`_"She said so."
`Does it work??
br
selgosub `Say "Turn to the right."`, *right, 
`Say "Turn to the left."`, *left ,
"`Do nothing.", *nothing
end 

*right
`You turned to the right.
return

*left
`You turned to the left.
return

*nothing
`You didn't do anything.
return

³«È¯¥á¥â

event_mode

²¼¤Îɽ¤ÎÃͤÏÇÓ¾Ū¤ËÍѤ¤¤é¤ì¤Þ¤¹¡£

ÃÍÀâÌÀÎã
IDLE_EVENT_MODE¥¯¥ê¥Ã¥¯¤ÇÈô¤Ð¤»¤Ê¤¤ÂÔ¤Áwait
WAIT_BUTTON_MODEButtonLink(²èÁü)¤ò»ÈÍѤ·¤¿ÁªÂòÂÔ¤Ábtnwait, select, ±¦¥¯¥ê¥Ã¥¯¥á¥Ë¥å¡¼
WAIT_INPUT_MODE¥¯¥ê¥Ã¥¯¤ÇÈô¤Ð¤»¤ëÆþÎÏÂÔ¤Ádelay, click, @, \, ¥Æ¥­¥¹¥Èʸ»úÉÁ²è, ²èÌ̸ú²Ì

²¼¤Îɽ¤ÎÃͤϡ¢¾å¤Îɽ¤ÎÃͤÈÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£

ÃÍÀâÌÀÎã
WAIT_TIMER_MODE»þ´Ö¤ò»ØÄꤷ¤¿ÂÔ¤Á¡¢ÂÔ¤ÁÃæ¤Ë¥¢¥Ë¥á¡¼¥·¥ç¥ó¤ò¼Â¹Ô²èÌ̸ú²Ì¡¢¥Æ¥­¥¹¥Èʸ»úÉÁ²è°Ê³°¤Î¤Û¤ÜÁ´¤Æ¤Î¾ì¹ç
WAIT_VOICE_MODE¥Ü¥¤¥¹¤ÎȯÀ¼½ªÎ»¤òÂÔ¤Äautomode, btntime2 »ÈÍÑ»þ¤Î¤ß
WAIT_TEXT_MODE¥Æ¥­¥¹¥È½ªÃ¼¤Ç¤ÎÂÔ¤Á¡Ê±¦¥¯¥ê¥Ã¥¯¥á¥Ë¥å¡¼¤Î²ÄÈݤÎȽÄêÍÑ¡Ë@, \, select
WAIT_RCLICK_MODE±¦¥¯¥ê¥Ã¥¯ÂÔ¤Álrclick

¥ì¥¤¥äÉÁ²è½ç

²¼¤Îɽ¤Ç¡¢¾å¤Î¥ì¥¤¥ä¤¬²¼¤Î¥ì¥¤¥ä¤ò±£¤·¤Þ¤¹¡£humanz ¤Î½é´üÃÍ¤Ï 499 ¤Ç¤¹¡£

ʸ»ú¤Ï¡¢ÉÁ²è»þ¤Ë¤Ï¾ï¤Ë°ìÈÖ¾å¤ËÍè¤Þ¤¹¡£

Ä̾ïwindowback »ÈÍÑ
¥Ü¥¿¥ó
¥«¡¼¥½¥ë
¥Æ¥­¥¹¥È¥¦¥£¥ó¥É¥¦¡¦Ê¸»ú¿ôÃÍ¥é¥Ù¥ë
¿ôÃÍ¥é¥Ù¥ë¥Ð¡¼
¥Ð¡¼¥¹¥×¥é¥¤¥È (humanz ¤«¤é 0)
¡ö¡ö¥â¥Î¥¯¥í¡¦¥Í¥¬¸ú²Ì¡ö¡ö¥Æ¥­¥¹¥È¥¦¥£¥ó¥É¥¦¡¦Ê¸»ú
¥¹¥×¥é¥¤¥È£² (255 ¤«¤é 0)¥¹¥×¥é¥¤¥È£² (255 ¤«¤é 0)
¥¹¥×¥é¥¤¥È (humanz ¤«¤é 0)¡ö¡ö¥â¥Î¥¯¥í¡¦¥Í¥¬¸ú²Ì¡ö¡ö
Ω¤Á³¨
¥¹¥×¥é¥¤¥È (999 ¤«¤é humanz+1)
ÇØ·Ê
onscripter-20150820/www/ogapee.css0000644017777601777760000001104112565174244016573 0ustar nobodynogroup/* * CSS resource file for ONScripter web page * Copyright (c) 2001-2010 Ogapee. All rights reserved. * ogapee@aqua.dti2.ne.jp */ a { text-decoration: none; } a:link { color: #000080; } a:visited { color: #800000; } a:active{ color: #FF0000; text-decoration: underline; } a:hover{ background-color: #ccffcc; } body{ text-align: left; font-size: 100%; line-height: 1.4; color: black; background-color: gray; } p{ margin: 10px; text-indent: 1em; } p.noindent{ margin: 10px; text-indent: 0em; } /* -------------------- */ /* general page */ #body{ position: absolute; left: 50%; width: 800px; margin-left: -400px; background-color: white; } #header{ text-align: left; margin: 5px; padding: 5px; border-bottom: solid 1px #888; background-image: url(ons.png); background-repeat: no-repeat; color: #112244; /*background-color: #cc4400;*/ /*background-color: #cc0044;*/ /*background-color: #44cc00;*/ /*background-color: #448800;*/ background-color: white; } #header h1{ font-size: 167%; text-align: center; } /*#header a {background-color: #ddffdd; }*/ #header a:link{ color: #4444ff; } #header a:visited{ color: #ff4444; } #header a:active{ color: #cc8888; text-decoration: underline; } #header a:hover{ background-color: #ff8844; } /* -------------------- */ /* toc */ #toc-container{ float: left; width: 180px; font-size: 90%; } #toc{ padding: 5px; text-align: left; } #toc h3{ margin: 0px; padding: 5px; font-size: 100%; text-align: center; border-top: solid 1px #eef; border-bottom: solid 1px #eef; background-color: #f5f5ff; } #toc ul{ margin: 0px; margin-bottom: 15px; padding: 5px; text-align: left; list-style: none; } #toc ul li{ margin: 0px; padding-bottom:15px; } #toc ul li a{ display: block; border-bottom: dotted 1px #888; padding: 0px; } #toc ul li ul{ margin: 0px; margin-left: 1em; margin-bottom: 1em; padding: 0px; } #toc ul li ul li{ display: list-item; margin: 0px; padding: 0px; padding-bottom: 5px; border-bottom: solid 1px #ffffff; } #toc ul li ul li a{ border: none; } /* -------------------- */ /* main page */ #main-container{ margin-left: 180px; } #main{ text-align: left; font-size: 100%; } #main h2{ margin: 0px; padding: 5px; /*border: solid 1px #0000ff;*/ font-family: sans-selif; } #main .content{ margin: 0px 0px 20px; padding: 0px; /*border-bottom: solid 1px black;*/ } #main .content h2{ margin: 0px; margin-bottom: 5px; padding: 15px 30px; font-size: 110%; font-weight: bold; color: black; border-top: solid 1px #eef; border-bottom: solid 1px #eef; background-color: #f5f5ff; } #main .content h3{ margin: 5px; margin-top: 15px; padding: 0px; padding-left: 10px; font-size: 100%; border-left: solid 5px #0000aa; border-bottom: dotted 1px gray; } #main .content h4{ margin: 5px; text-decoration: underline; } .content dl{ margin: 0px; padding: 0px 5px 0px 10px; } .sub-content{ margin: 5pt; padding: 0px; /*border-top: dashed 1px gray;*/ } /* -------------------- */ /* diary page */ #diary-container{ margin-left: 180px; } #diary{ text-align: left; font-size: 100%; } #diary h2{ margin: 0px; padding: 5px; text-align: center; /*border: solid 1px #0000ff;*/ } #diary .diary-day{ margin: 5px; margin-bottom: 25px; padding: 0px; font-size: 100%; /*border-top: dashed 1px gray;*/ } #diary .diary-day h3{ display: block; margin: 5px; padding: 0px; padding-left: 5px; /*border-left: solid 5px #0000aa;*/ border-bottom: dashed 1px gray; } #diary .diary-day h4{ margin: 5px; text-decoration: underline; } /* -------------------- */ /* misc */ table { text-align: left; color: black; background-color: #fcfcff; margin: 5px; margin-bottom: 10pt; padding: 2pt; } th { padding: 2pt; border: solid 1px #888; font-weight: bold; color: black; background: white; text-align: center; } td { padding: 2pt; font-weight: normal; color: black; border: 0pt; border-bottom: 1px solid #888; text-indent: 1em; } td.span { border-bottom: 1pt dotted; } hr { width: 80%; text-align: center; } pre { white-space: -moz-pre-wrap; /* Mozilla */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ margin: 0.5em; padding: 0.5em; color: black; background: #f5f5f5; text-indent: 0; border-width: 1pt 1pt 1pt 1pt; border-color: #888888; border-style: solid; font-family: monospace; } /* -------------------- */ /* footer */ #footer{ clear: both; text-align: center; margin: 5px; padding: 5px; border-top: solid 1px #888; } div.figure{ /*float: right;*/ width: 80%; border: thin silver solid; margin: 0.2em; padding: 0.2em; } div.figure p{ text-align: center; text-indent: 0; }onscripter-20150820/ONScripter.cpp0000644017777601777760000011744612565174244016551 0ustar nobodynogroup/* -*- C++ -*- * * ONScripter.cpp - Execution block parser of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ONScripter.h" #ifdef USE_FONTCONFIG #include #endif extern void initSJIS2UTF16(); extern "C" void waveCallback( int channel ); #define DEFAULT_AUDIOBUF 4096 #define FONT_FILE "default.ttf" #define REGISTRY_FILE "registry.txt" #define DLL_FILE "dll.txt" #define DEFAULT_ENV_FONT "‚l‚r ƒSƒVƒbƒN" #define DEFAULT_AUTOMODE_TIME 1000 #ifdef __OS2__ static void SDL_Quit_Wrapper() { SDL_Quit(); } #endif void ONScripter::initSDL() { /* ---------------------------------------- */ /* Initialize SDL */ if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO ) < 0 ){ fprintf( stderr, "Couldn't initialize SDL: %s\n", SDL_GetError() ); exit(-1); } #ifdef __OS2__ atexit(SDL_Quit_Wrapper); // work-around for OS/2 #endif #ifdef USE_CDROM if( cdaudio_flag && SDL_InitSubSystem( SDL_INIT_CDROM ) < 0 ){ fprintf( stderr, "Couldn't initialize CD-ROM: %s\n", SDL_GetError() ); exit(-1); } #endif #if !defined(IOS) if(SDL_InitSubSystem( SDL_INIT_JOYSTICK ) == 0 && SDL_JoystickOpen(0) != NULL) printf( "Initialize JOYSTICK\n"); #endif #if defined(PSP) || defined(IPODLINUX) || defined(GP2X) || defined(WINCE) SDL_ShowCursor(SDL_DISABLE); #endif /* ---------------------------------------- */ /* Initialize SDL */ if ( TTF_Init() < 0 ){ fprintf( stderr, "can't initialize SDL TTF\n"); exit(-1); } #if defined(BPP16) screen_bpp = 16; #else screen_bpp = 32; #endif #if defined(PDA_WIDTH) screen_ratio1 = PDA_WIDTH; screen_ratio2 = script_h.screen_width; screen_width = PDA_WIDTH; #elif defined(PDA_AUTOSIZE) SDL_Rect **modes; modes = SDL_ListModes(NULL, SDL_FULLSCREEN); if (modes == (SDL_Rect **)0){ fprintf(stderr, "No Video mode available.\n"); exit(-1); } else if (modes == (SDL_Rect **)-1){ // no restriction } else{ int width; if (modes[0]->w * screen_height > modes[0]->h * screen_width) width = (modes[0]->h*screen_width/screen_height) & (~0x01); // to be 2 bytes aligned else width = modes[0]->w; screen_ratio1 = width; screen_ratio2 = script_h.screen_width; screen_width = width; } #endif screen_height = screen_width*script_h.screen_height/script_h.screen_width; screen_device_width = screen_width; screen_device_height = screen_height; #if defined(USE_SDL_RENDERER) // use hardware scaling screen_ratio1 = 1; screen_ratio2 = 1; screen_width = script_h.screen_width; screen_height = script_h.screen_height; SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); window = SDL_CreateWindow(NULL, 0, 0, screen_device_width, screen_device_height, SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN|SDL_WINDOW_BORDERLESS); SDL_GetWindowSize(window, &device_width, &device_height); renderer = SDL_CreateRenderer(window, -1, 0); texture_format = SDL_PIXELFORMAT_ARGB8888; SDL_RendererInfo info; SDL_GetRendererInfo(renderer, &info); if (info.texture_formats[0] == SDL_PIXELFORMAT_ABGR8888) texture_format = SDL_PIXELFORMAT_ABGR8888; SDL_RenderClear(renderer); #else #if defined(ANDROID) // use hardware scaling screen_ratio1 = 1; screen_ratio2 = 1; screen_width = script_h.screen_width; screen_height = script_h.screen_height; #endif screen_surface = SDL_SetVideoMode( screen_width, screen_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG|(fullscreen_mode?SDL_FULLSCREEN:0) ); #ifdef BPP16 texture_format = SDL_PIXELFORMAT_RGB565; #else #if defined(ANDROID) SDL_SetSurfaceBlendMode(screen_surface, SDL_BLENDMODE_NONE); texture_format = SDL_PIXELFORMAT_ABGR8888; #else texture_format = SDL_PIXELFORMAT_ARGB8888; #endif #endif #endif /* ---------------------------------------- */ /* Check if VGA screen is available. */ #if !defined(USE_SDL_RENDERER) && (PDA_WIDTH==640) if ( screen_surface == NULL ){ screen_ratio1 /= 2; screen_width /= 2; screen_height /= 2; screen_device_width = screen_width; screen_device_height = screen_height; screen_surface = SDL_SetVideoMode( screen_device_width, screen_device_height, screen_bpp, DEFAULT_VIDEO_SURFACE_FLAG|(fullscreen_mode?SDL_FULLSCREEN:0) ); } #endif underline_value = script_h.screen_height; #ifndef USE_SDL_RENDERER if ( screen_surface == NULL ) { fprintf( stderr, "Couldn't set %dx%dx%d video mode: %s\n", screen_width, screen_height, screen_bpp, SDL_GetError() ); exit(-1); } #endif printf("Display: %d x %d (%d bpp)\n", screen_width, screen_height, screen_bpp); dirty_rect.setDimension(screen_width, screen_height); screen_rect.x = screen_rect.y = 0; screen_rect.w = screen_width; screen_rect.h = screen_height; initSJIS2UTF16(); wm_title_string = new char[ strlen(DEFAULT_WM_TITLE) + 1 ]; memcpy( wm_title_string, DEFAULT_WM_TITLE, strlen(DEFAULT_WM_TITLE) + 1 ); wm_icon_string = new char[ strlen(DEFAULT_WM_ICON) + 1 ]; memcpy( wm_icon_string, DEFAULT_WM_TITLE, strlen(DEFAULT_WM_ICON) + 1 ); SDL_WM_SetCaption( wm_title_string, wm_icon_string ); } void ONScripter::openAudio() { #if (defined(PDA_WIDTH) || defined(PDA_AUTOSIZE)) && !defined(PSP) && !defined(IPHONE) && !defined(IOS) && !defined(PANDORA) if ( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, DEFAULT_AUDIOBUF ) < 0 ){ #else if ( Mix_OpenAudio( 44100, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, DEFAULT_AUDIOBUF ) < 0 ){ #endif fprintf(stderr, "Couldn't open audio device!\n" " reason: [%s].\n", SDL_GetError()); audio_open_flag = false; } else{ int freq; Uint16 format; int channels; Mix_QuerySpec( &freq, &format, &channels); printf("Audio: %d Hz %d bit %s\n", freq, (format&0xFF), (channels > 1) ? "stereo" : "mono"); audio_format.format = format; audio_format.freq = freq; audio_format.channels = channels; audio_open_flag = true; Mix_AllocateChannels( ONS_MIX_CHANNELS+ONS_MIX_EXTRA_CHANNELS ); Mix_ChannelFinished( waveCallback ); } } ONScripter::ONScripter() { is_script_read = false; cdrom_drive_number = 0; cdaudio_flag = false; default_font = NULL; registry_file = NULL; setStr( ®istry_file, REGISTRY_FILE ); dll_file = NULL; setStr( &dll_file, DLL_FILE ); getret_str = NULL; enable_wheeldown_advance_flag = false; disable_rescale_flag = false; edit_flag = false; key_exe_file = NULL; fullscreen_mode = false; window_mode = false; sprite_info = new AnimationInfo[MAX_SPRITE_NUM]; sprite2_info = new AnimationInfo[MAX_SPRITE2_NUM]; current_button_state.down_flag = false; int i; for (i=0 ; icdrom_drive_number = cdrom_drive_number; } void ONScripter::setFontFile(const char *filename) { setStr(&default_font, filename); } void ONScripter::setRegistryFile(const char *filename) { setStr(®istry_file, filename); } void ONScripter::setDLLFile(const char *filename) { setStr(&dll_file, filename); } void ONScripter::setArchivePath(const char *path) { if (archive_path) delete[] archive_path; archive_path = new char[ RELATIVEPATHLENGTH + strlen(path) + 2 ]; sprintf( archive_path, RELATIVEPATH "%s%c", path, DELIMITER ); } void ONScripter::setSaveDir(const char *path) { if (save_dir) delete[] save_dir; save_dir = new char[ RELATIVEPATHLENGTH + strlen(path) + 2 ]; sprintf( save_dir, RELATIVEPATH "%s%c", path, DELIMITER ); script_h.setSaveDir(save_dir); } void ONScripter::setFullscreenMode() { fullscreen_mode = true; } void ONScripter::setWindowMode() { window_mode = true; } void ONScripter::enableButtonShortCut() { force_button_shortcut_flag = true; } void ONScripter::enableWheelDownAdvance() { enable_wheeldown_advance_flag = true; } void ONScripter::disableRescale() { disable_rescale_flag = true; } void ONScripter::renderFontOutline() { #if (SDL_TTF_MAJOR_VERSION>=2) && (SDL_TTF_MINOR_VERSION>=0) && (SDL_TTF_PATCHLEVEL>=10) render_font_outline = true; #else fprintf(stderr, "--render-font-outline is not supported with SDL_ttf %d.%d.%d\n", SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL); #endif } void ONScripter::enableEdit() { edit_flag = true; } void ONScripter::setKeyEXE(const char *filename) { setStr(&key_exe_file, filename); } int ONScripter::openScript() { if (is_script_read) return 0; is_script_read = true; if (archive_path == NULL){ archive_path = new char[1]; archive_path[0] = 0; } if (key_exe_file){ createKeyTable( key_exe_file ); script_h.setKeyTable( key_table ); } return ScriptParser::openScript(); } int ONScripter::init() { initSDL(); openAudio(); image_surface = AnimationInfo::alloc32bitSurface( 1, 1, texture_format ); accumulation_surface = AnimationInfo::allocSurface( screen_width, screen_height, texture_format ); backup_surface = AnimationInfo::allocSurface( screen_width, screen_height, texture_format ); effect_src_surface = AnimationInfo::allocSurface( screen_width, screen_height, texture_format ); effect_dst_surface = AnimationInfo::allocSurface( screen_width, screen_height, texture_format ); #if defined(USE_SDL_RENDERER) screenshot_surface = AnimationInfo::alloc32bitSurface( screen_device_width, screen_device_height, texture_format ); #else screenshot_surface = AnimationInfo::alloc32bitSurface( screen_width, screen_height, texture_format ); #endif screenshot_w = screen_width; screenshot_h = screen_height; #ifdef USE_SDL_RENDERER texture = SDL_CreateTextureFromSurface(renderer, accumulation_surface); #endif tmp_image_buf = NULL; tmp_image_buf_length = 0; mean_size_of_loaded_images = 0; num_loaded_images = 10; // to suppress temporal increase at the start-up text_info.num_of_cells = 1; text_info.allocImage( screen_width, screen_height, texture_format ); text_info.fill(0, 0, 0, 0); // ---------------------------------------- // Initialize font if ( default_font ){ font_file = new char[ strlen(default_font) + 1 ]; sprintf( font_file, "%s", default_font ); } else{ font_file = new char[ strlen(archive_path) + strlen(FONT_FILE) + 1 ]; sprintf( font_file, "%s%s", archive_path, FONT_FILE ); #ifdef USE_FONTCONFIG FILE *fp = NULL; if ((fp = ::fopen(font_file, "rb")) == NULL){ FcPattern *pat = FcPatternCreate(); FcPatternAddString( pat, FC_LANG, (const FcChar8*)"ja" ); FcPatternAddBool( pat, FC_OUTLINE, FcTrue ); FcPatternAddInteger( pat, FC_SLANT, FC_SLANT_ROMAN ); FcPatternAddInteger( pat, FC_WEIGHT, FC_WEIGHT_NORMAL ); FcConfigSubstitute( NULL, pat, FcMatchPattern ); FcDefaultSubstitute( pat ); FcResult result; FcPattern *p_pat = FcFontMatch( NULL, pat, &result ); FcPatternDestroy( pat ); FcChar8* val_s; if (FcResultMatch == FcPatternGetString( p_pat, FC_FILE, 0, &val_s )){ delete[] font_file; font_file = new char[ strlen((const char*)val_s) + 1 ]; strcpy( font_file, (const char*)val_s ); printf("Font: %s\n", font_file); } FcPatternDestroy( p_pat ); } else{ fclose(fp); } #endif } // ---------------------------------------- // variables relevant to sound this->cdaudio_flag = cdaudio_flag; #ifdef USE_CDROM cdrom_info = NULL; if ( cdaudio_flag ){ if ( cdrom_drive_number >= 0 && cdrom_drive_number < SDL_CDNumDrives() ) cdrom_info = SDL_CDOpen( cdrom_drive_number ); if ( !cdrom_info ){ fprintf(stderr, "Couldn't open default CD-ROM: %s\n", SDL_GetError()); } else if ( cdrom_info && !CD_INDRIVE( SDL_CDStatus( cdrom_info ) ) ) { fprintf( stderr, "no CD-ROM in the drive\n" ); SDL_CDClose( cdrom_info ); cdrom_info = NULL; } } #endif wave_file_name = NULL; midi_file_name = NULL; midi_info = NULL; music_file_name = NULL; fadeout_music_file_name = NULL; music_buffer = NULL; music_info = NULL; loop_bgm_name[0] = NULL; loop_bgm_name[1] = NULL; int i; for (i=0 ; i 0) flushDirect( dirty_rect.bounding_box, refresh_mode ); } if ( clear_dirty_flag ) dirty_rect.clear(); } void ONScripter::flushDirect( SDL_Rect &rect, int refresh_mode ) { //printf("flush %d: %d %d %d %d\n", refresh_mode, rect.x, rect.y, rect.w, rect.h ); refreshSurface( accumulation_surface, &rect, refresh_mode ); #ifdef USE_SDL_RENDERER SDL_Rect src_rect = {0, 0, screen_width, screen_height}; SDL_Rect dst_rect = {(device_width -screen_device_width )/2, (device_height-screen_device_height)/2, screen_device_width, screen_device_height}; SDL_LockSurface(accumulation_surface); SDL_UpdateTexture(texture, &rect, (unsigned char*)accumulation_surface->pixels+accumulation_surface->pitch*rect.y+rect.x*sizeof(ONSBuf), accumulation_surface->pitch); SDL_UnlockSurface(accumulation_surface); SDL_RenderCopy(renderer, texture, &src_rect, &dst_rect); SDL_RenderPresent(renderer); #else SDL_Rect dst_rect = rect; if (AnimationInfo::doClipping(&dst_rect, &screen_rect) || (dst_rect.w==0 && dst_rect.h==0)) return; SDL_BlitSurface( accumulation_surface, &dst_rect, screen_surface, &dst_rect ); SDL_UpdateRect( screen_surface, dst_rect.x, dst_rect.y, dst_rect.w, dst_rect.h ); #endif } void ONScripter::mouseOverCheck( int x, int y ) { int c = 0, max_c = 0; last_mouse_state.x = x; last_mouse_state.y = y; /* ---------------------------------------- */ /* Check button */ int button = -1; ButtonLink *bl = root_button_link.next, *max_bl = NULL; unsigned int max_alpha = 0; while( bl ){ if ( x >= bl->select_rect.x && x < bl->select_rect.x + bl->select_rect.w && y >= bl->select_rect.y && y < bl->select_rect.y + bl->select_rect.h ){ if (transbtn_flag == false || shift_over_button == bl->no){ max_bl = bl; max_c = c; break; } else{ unsigned char alpha = 0; if ( (bl->button_type == ButtonLink::SPRITE_BUTTON && max_alpha < (alpha = sprite_info[ bl->sprite_no ].getAlpha(x, y))) || (bl->button_type == ButtonLink::NORMAL_BUTTON && max_alpha < (alpha = bl->anim[0]->getAlpha(x, y))) ){ max_alpha = alpha; max_bl = bl; max_c = c; } } } bl = bl->next; c++; } if (max_bl){ bl = max_bl; button = bl->no; c = max_c; } if ( current_over_button != button ){ DirtyRect dirty = dirty_rect; dirty_rect.clear(); SDL_Rect check_src_rect = {0, 0, 0, 0}; SDL_Rect check_dst_rect = {0, 0, 0, 0}; if ( current_over_button != -1 ){ ButtonLink *cbl = current_button_link; cbl->show_flag = 0; check_src_rect = cbl->image_rect; if ( cbl->button_type == ButtonLink::SPRITE_BUTTON ){ if ( cbl->exbtn_ctl[0] ) decodeExbtnControl( cbl->exbtn_ctl[0], &check_src_rect, &check_dst_rect ); else{ sprite_info[ cbl->sprite_no ].visible = true; sprite_info[ cbl->sprite_no ].setCell(0); } } else if ( cbl->button_type == ButtonLink::TMP_SPRITE_BUTTON ){ cbl->show_flag = 1; cbl->anim[0]->visible = true; cbl->anim[0]->setCell(0); } else if ( cbl->anim[1] != NULL ){ cbl->show_flag = 2; } dirty_rect.add( cbl->image_rect ); } if ( is_exbtn_enabled && exbtn_d_button_link.exbtn_ctl[1] ){ decodeExbtnControl( exbtn_d_button_link.exbtn_ctl[1], &check_src_rect, &check_dst_rect ); } if ( bl ){ if ( system_menu_mode != SYSTEM_NULL ){ if ( menuselectvoice_file_name[MENUSELECTVOICE_OVER] ) playSound(menuselectvoice_file_name[MENUSELECTVOICE_OVER], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); } else{ if ( selectvoice_file_name[SELECTVOICE_OVER] ) playSound(selectvoice_file_name[SELECTVOICE_OVER], SOUND_CHUNK, false, MIX_WAVE_CHANNEL); } check_dst_rect = bl->image_rect; if ( bl->button_type == ButtonLink::SPRITE_BUTTON ){ if (!bexec_flag || !bl->exbtn_ctl[1]){ sprite_info[ bl->sprite_no ].visible = true; sprite_info[ bl->sprite_no ].setCell(1); } if ( bl->exbtn_ctl[1] ) decodeExbtnControl( bl->exbtn_ctl[1], &check_src_rect, &check_dst_rect ); } else if ( bl->button_type == ButtonLink::TMP_SPRITE_BUTTON ){ bl->show_flag = 1; bl->anim[0]->visible = true; bl->anim[0]->setCell(1); } else if ( bl->button_type == ButtonLink::NORMAL_BUTTON || bl->button_type == ButtonLink::LOOKBACK_BUTTON ){ bl->show_flag = 1; } dirty_rect.add( bl->image_rect ); current_button_link = bl; shortcut_mouse_line = c; } flush( refreshMode() ); dirty_rect = dirty; } current_over_button = button; shift_over_button = -1; } void ONScripter::executeLabel() { executeLabelTop: while ( current_line 0 ) printf("***** executeLabel %s:%d/%d:%d:%d *****\n", current_label_info.name, current_line, current_label_info.num_of_lines, string_buffer_offset, display_mode ); if ( script_h.getStringBuffer()[0] == '~' ){ last_tilde.next_script = script_h.getNext(); readToken(); continue; } if ( break_flag && !script_h.isName("next") ){ if ( script_h.getStringBuffer()[string_buffer_offset] == 0x0a ) current_line++; if ( script_h.getStringBuffer()[string_buffer_offset] != ':' && script_h.getStringBuffer()[string_buffer_offset] != ';' && script_h.getStringBuffer()[string_buffer_offset] != 0x0a ) script_h.skipToken(); readToken(); continue; } if ( kidokuskip_flag && skip_mode & SKIP_NORMAL && kidokumode_flag && !script_h.isKidoku() ) skip_mode &= ~SKIP_NORMAL; int ret = parseLine(); if ( ret & (RET_SKIP_LINE | RET_EOL) ){ if (ret & RET_SKIP_LINE) script_h.skipLine(); if (++current_line >= current_label_info.num_of_lines) break; } if (!(ret & RET_NO_READ)) readToken(); } current_label_info = script_h.lookupLabelNext( current_label_info.name ); current_line = 0; if ( current_label_info.start_address != NULL ){ script_h.setCurrent( current_label_info.label_header ); readToken(); goto executeLabelTop; } fprintf( stderr, " ***** End *****\n"); endCommand(); } void ONScripter::runScript() { readToken(); parseLine(); } int ONScripter::parseLine( ) { if (debug_level > 0) printf("ONScripter::Parseline %s\n", script_h.getStringBuffer() ); const char *cmd = script_h.getStringBuffer(); if (cmd[0] == ';') return RET_CONTINUE; else if (cmd[0] == '*') return RET_CONTINUE; else if (cmd[0] == ':') return RET_CONTINUE; if (script_h.isText()){ if ( current_mode == DEFINE_MODE ) errorAndExit( "text cannot be displayed in define section." ); return textCommand(); } if (cmd[0] != '_'){ if (cmd[0] >= 'a' && cmd[0] <= 'z'){ UserFuncHash &ufh = user_func_hash[cmd[0]-'a']; UserFuncLUT *uf = ufh.root.next; while(uf){ if (!strcmp( uf->command, cmd )){ if (uf->lua_flag){ #ifdef USE_LUA if (lua_handler.callFunction(false, cmd)) errorAndExit( lua_handler.error_str ); #endif } else{ gosubReal( cmd, script_h.getNext() ); } return RET_CONTINUE; } uf = uf->next; } } } else{ cmd++; } if (cmd[0] >= 'a' && cmd[0] <= 'z'){ FuncHash &fh = func_hash[cmd[0]-'a']; for (int i=0 ; i*fh.func[i].method)(); } } } if ( cmd[0] == 0x0a ) return RET_CONTINUE | RET_EOL; else if ( cmd[0] == 'v' && cmd[1] >= '0' && cmd[1] <= '9' ) return vCommand(); else if ( cmd[0] == 'd' && cmd[1] == 'v' && cmd[2] >= '0' && cmd[2] <= '9' ) return dvCommand(); fprintf( stderr, " command [%s] is not supported yet!!\n", cmd ); script_h.skipToken(); return RET_CONTINUE; } /* ---------------------------------------- */ void ONScripter::deleteButtonLink() { ButtonLink *b1 = root_button_link.next; while( b1 ){ ButtonLink *b2 = b1; b1 = b1->next; if (b2 == current_button_link) current_over_button = -1; delete b2; } root_button_link.next = NULL; for (int i=0 ; i<3 ; i++){ if ( exbtn_d_button_link.exbtn_ctl[i] ){ delete[] exbtn_d_button_link.exbtn_ctl[i]; exbtn_d_button_link.exbtn_ctl[i] = NULL; } } is_exbtn_enabled = false; } void ONScripter::refreshMouseOverButton() { int mx, my; current_over_button = -1; shift_over_button = -1; current_button_link = root_button_link.next; SDL_GetMouseState( &mx, &my ); if (!(SDL_GetAppState() & SDL_APPMOUSEFOCUS)){ mx = screen_device_width; my = screen_device_height; } mx = mx * screen_width / screen_device_width; my = my * screen_width / screen_device_width; mouseOverCheck( mx, my ); } /* ---------------------------------------- */ /* Delete select link */ void ONScripter::deleteSelectLink() { SelectLink *link, *last_select_link = root_select_link.next; while ( last_select_link ){ link = last_select_link; last_select_link = last_select_link->next; delete link; } root_select_link.next = NULL; } void ONScripter::clearCurrentPage() { sentence_font.clear(); int num = (sentence_font.num_xy[0]*2+1)*sentence_font.num_xy[1]; if (sentence_font.getTateyokoMode() == FontInfo::TATE_MODE) num = (sentence_font.num_xy[1]*2+1)*sentence_font.num_xy[0]; if ( current_page->text && current_page->max_text != num ){ delete[] current_page->text; current_page->text = NULL; } if ( !current_page->text ){ current_page->text = new char[num]; current_page->max_text = num; } current_page->text_count = 0; if (current_page->tag){ delete[] current_page->tag; current_page->tag = NULL; } num_chars_in_sentence = 0; internal_saveon_flag = true; text_info.fill( 0, 0, 0, 0 ); cached_page = current_page; } void ONScripter::shadowTextDisplay( SDL_Surface *surface, SDL_Rect &clip ) { if ( current_font->is_transparent ){ SDL_Rect rect = screen_rect; if ( current_font == &sentence_font ) rect = sentence_font_info.pos; if ( AnimationInfo::doClipping( &rect, &clip ) ) return; if ( rect.x + rect.w > surface->w ) rect.w = surface->w - rect.x; if ( rect.y + rect.h > surface->h ) rect.h = surface->h - rect.y; SDL_LockSurface( surface ); ONSBuf *buf = (ONSBuf *)surface->pixels + rect.y * surface->w + rect.x; SDL_PixelFormat *fmt = surface->format; int color[3]; color[0] = current_font->window_color[0] + 1; color[1] = current_font->window_color[1] + 1; color[2] = current_font->window_color[2] + 1; for ( int i=rect.y ; iRmask) >> fmt->Rshift) * color[0] >> 8) << fmt->Rshift | (((*buf & fmt->Gmask) >> fmt->Gshift) * color[1] >> 8) << fmt->Gshift | (((*buf & fmt->Bmask) >> fmt->Bshift) * color[2] >> 8) << fmt->Bshift; } buf += surface->w - rect.w; } SDL_UnlockSurface( surface ); } else if ( sentence_font_info.image_surface ){ drawTaggedSurface( surface, &sentence_font_info, clip ); } } void ONScripter::newPage() { if ( current_page->text_count != 0 ){ current_page = current_page->next; if ( start_page == current_page ) start_page = start_page->next; clearCurrentPage(); } page_enter_status = 0; flush( refreshMode(), &sentence_font_info.pos ); } ButtonLink *ONScripter::getSelectableSentence( char *buffer, FontInfo *info, bool flush_flag, bool nofile_flag ) { int current_text_xy[2]; current_text_xy[0] = info->xy[0]; current_text_xy[1] = info->xy[1]; ButtonLink *bl = new ButtonLink(); bl->button_type = ButtonLink::TMP_SPRITE_BUTTON; bl->show_flag = 1; AnimationInfo *ai = bl->anim[0] = new AnimationInfo(); ai->trans_mode = AnimationInfo::TRANS_STRING; ai->is_single_line = false; ai->num_of_cells = 2; ai->color_list = new uchar3[ ai->num_of_cells ]; for (int i=0 ; i<3 ; i++){ if (nofile_flag) ai->color_list[0][i] = info->nofile_color[i]; else ai->color_list[0][i] = info->off_color[i]; ai->color_list[1][i] = info->on_color[i]; } setStr( &ai->file_name, buffer ); ai->orig_pos.x = info->x(); ai->orig_pos.y = info->y(); ai->scalePosXY( screen_ratio1, screen_ratio2 ); ai->visible = true; setupAnimationInfo( ai, info ); bl->select_rect = bl->image_rect = ai->pos; info->newLine(); if (info->getTateyokoMode() == FontInfo::YOKO_MODE) info->xy[0] = current_text_xy[0]; else info->xy[1] = current_text_xy[1]; dirty_rect.add( bl->image_rect ); return bl; } void ONScripter::decodeExbtnControl( const char *ctl_str, SDL_Rect *check_src_rect, SDL_Rect *check_dst_rect ) { char sound_name[256]; int i, sprite_no, sprite_no2, cell_no; while( char com = *ctl_str++ ){ if (com == 'C' || com == 'c'){ sprite_no = getNumberFromBuffer( &ctl_str ); sprite_no2 = sprite_no; cell_no = -1; if ( *ctl_str == '-' ){ ctl_str++; sprite_no2 = getNumberFromBuffer( &ctl_str ); } for (i=sprite_no ; i<=sprite_no2 ; i++) refreshSprite( i, false, cell_no, NULL, NULL ); } else if (com == 'P' || com == 'p'){ sprite_no = getNumberFromBuffer( &ctl_str ); if ( *ctl_str == ',' ){ ctl_str++; cell_no = getNumberFromBuffer( &ctl_str ); } else cell_no = 0; refreshSprite( sprite_no, true, cell_no, check_src_rect, check_dst_rect ); } else if (com == 'S' || com == 's'){ sprite_no = getNumberFromBuffer( &ctl_str ); if (sprite_no < 0) sprite_no = 0; else if (sprite_no >= ONS_MIX_CHANNELS) sprite_no = ONS_MIX_CHANNELS-1; if ( *ctl_str != ',' ) continue; ctl_str++; if ( *ctl_str != '(' ) continue; ctl_str++; char *buf = sound_name; while (*ctl_str != ')' && *ctl_str != '\0' ) *buf++ = *ctl_str++; *buf++ = '\0'; playSound(sound_name, SOUND_CHUNK, false, sprite_no); if ( *ctl_str == ')' ) ctl_str++; } else if (com == 'M' || com == 'm'){ sprite_no = getNumberFromBuffer( &ctl_str ); AnimationInfo *ai = &sprite_info[sprite_no]; SDL_Rect rect = ai->pos; if ( *ctl_str != ',' ) continue; ctl_str++; // skip ',' ai->orig_pos.x = getNumberFromBuffer( &ctl_str ); if ( *ctl_str != ',' ) continue; ctl_str++; // skip ',' ai->orig_pos.y = getNumberFromBuffer( &ctl_str ); ai->scalePosXY( screen_ratio1, screen_ratio2 ); dirty_rect.add( rect ); ai->visible = true; dirty_rect.add( ai->pos ); } } } void ONScripter::saveAll() { saveEnvData(); saveGlovalData(); if ( filelog_flag ) writeLog( script_h.log_info[ScriptHandler::FILE_LOG] ); if ( labellog_flag ) writeLog( script_h.log_info[ScriptHandler::LABEL_LOG] ); if ( kidokuskip_flag ) script_h.saveKidokuData(); } void ONScripter::loadEnvData() { volume_on_flag = true; text_speed_no = 1; skip_mode &= ~SKIP_TO_EOP; default_env_font = NULL; cdaudio_on_flag = true; default_cdrom_drive = NULL; kidokumode_flag = true; setStr( &save_dir_envdata, NULL ); automode_time = DEFAULT_AUTOMODE_TIME; if (loadFileIOBuf( "envdata" ) > 0){ if (readInt() == 1 && window_mode == false) menu_fullCommand(); if (readInt() == 0) volume_on_flag = false; text_speed_no = readInt(); if (readInt() == 1) skip_mode |= SKIP_TO_EOP; readStr( &default_env_font ); if (default_env_font == NULL) setStr(&default_env_font, DEFAULT_ENV_FONT); if (readInt() == 0) cdaudio_on_flag = false; readStr( &default_cdrom_drive ); voice_volume = DEFAULT_VOLUME - readInt(); se_volume = DEFAULT_VOLUME - readInt(); music_volume = DEFAULT_VOLUME - readInt(); if (readInt() == 0) kidokumode_flag = false; readInt(); readStr( &save_dir_envdata ); // save_dir_envdata is not used directly if (!save_dir && save_dir_envdata){ // a workaround not to overwrite save_dir given in command line options save_dir = new char[ strlen(archive_path) + strlen(save_dir_envdata) + 2 ]; sprintf( save_dir, "%s%s%c", archive_path, save_dir_envdata, DELIMITER ); script_h.setSaveDir(save_dir); } automode_time = readInt(); } else{ setStr( &default_env_font, DEFAULT_ENV_FONT ); voice_volume = se_volume = music_volume = DEFAULT_VOLUME; } } void ONScripter::saveEnvData() { file_io_buf_ptr = 0; bool output_flag = false; for (int i=0 ; i<2 ; i++){ writeInt( fullscreen_mode?1:0, output_flag ); writeInt( volume_on_flag?1:0, output_flag ); writeInt( text_speed_no, output_flag ); writeInt( (skip_mode & SKIP_TO_EOP)?1:0, output_flag ); writeStr( default_env_font, output_flag ); writeInt( cdaudio_on_flag?1:0, output_flag ); writeStr( default_cdrom_drive, output_flag ); writeInt( DEFAULT_VOLUME - voice_volume, output_flag ); writeInt( DEFAULT_VOLUME - se_volume, output_flag ); writeInt( DEFAULT_VOLUME - music_volume, output_flag ); writeInt( kidokumode_flag?1:0, output_flag ); writeInt( 0, output_flag ); // ? writeStr( save_dir_envdata, output_flag ); writeInt( automode_time, output_flag ); if (i==1) break; allocFileIOBuf(); output_flag = true; } saveFileIOBuf( "envdata" ); } int ONScripter::refreshMode() { if (display_mode & DISPLAY_MODE_TEXT) return refresh_shadow_text_mode; return REFRESH_NORMAL_MODE; } void ONScripter::quit() { saveAll(); #ifdef USE_CDROM if ( cdrom_info ){ SDL_CDStop( cdrom_info ); SDL_CDClose( cdrom_info ); } #endif if ( midi_info ){ Mix_HaltMusic(); Mix_FreeMusic( midi_info ); midi_info = NULL; } if ( music_info ){ Mix_HaltMusic(); Mix_FreeMusic( music_info ); music_info = NULL; } } void ONScripter::disableGetButtonFlag() { bexec_flag = false; btndown_flag = false; getzxc_flag = false; gettab_flag = false; getpageup_flag = false; getpagedown_flag = false; getmclick_flag = false; getinsert_flag = false; getfunction_flag = false; getenter_flag = false; getcursor_flag = false; getmouseover_flag = false; spclclk_flag = false; } int ONScripter::getNumberFromBuffer( const char **buf ) { int ret = 0; while ( **buf >= '0' && **buf <= '9' ) ret = ret*10 + *(*buf)++ - '0'; return ret; } onscripter-20150820/FontInfo.h0000644017777601777760000000470112565174244015675 0ustar nobodynogroup/* -*- C++ -*- * * FontInfo.h - Font information storage class of ONScripter * * Copyright (c) 2001-2012 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __FONT_INFO_H__ #define __FONT_INFO_H__ #include typedef unsigned char uchar3[3]; class FontInfo{ public: enum { YOKO_MODE = 0, TATE_MODE = 1 }; void *ttf_font[2]; // 0...normal rendering, 1...outline rendering uchar3 color; uchar3 on_color, off_color, nofile_color; int font_size_xy[2]; int top_xy[2]; // Top left origin int num_xy[2]; // Row and column of the text windows int xy[2]; // Current position int old_xy[2]; int pitch_xy[2]; // Width and height of a character int wait_time; bool is_bold; bool is_shadow; bool is_transparent; bool is_newline_accepted; uchar3 window_color; int line_offset_xy[2]; // ruby offset for each line bool rubyon_flag; int tateyoko_mode; FontInfo(); void reset(); void *openFont( char *font_file, int ratio1, int ratio2 ); void setTateyokoMode( int tateyoko_mode ); int getTateyokoMode(); int getRemainingLine(); int x(bool use_ruby_offset=true); int y(bool use_ruby_offset=true); void setXY( int x=-1, int y=-1 ); void clear(); void newLine(); void setLineArea(int num); bool isEndOfLine(int margin=0); bool isLineEmpty(); void advanceCharInHankaku(int offest); void addLineOffset(int margin); void setRubyOnFlag(bool flag); SDL_Rect calcUpdatedArea(int start_xy[2], int ratio1, int ratio2); void addShadeArea(SDL_Rect &rect, int dx, int dy, int dw, int dh); int initRuby(FontInfo &body_info, int body_count, int ruby_count); }; #endif // __FONT_INFO_H__ onscripter-20150820/Makefile.ARMLinux0000644017777601777760000000131312565174244017074 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.ARMLinux - Makefile rules for linux on Zaurus # INCS = `sdl-config --cflags` # for Qtopia LIBS = -lSDL -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -lfreetype -ljpeg -lm `sdl-config --libs` -lvorbisidec # for SL-5500, SL-A300, SL-B500, SL-C700 and SL-C750 DEFS = -DLINUX -DPDA_WIDTH=640 -DBPP16 -DQWS -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS EXESUFFIX = OBJSUFFIX = .o .SUFFIXES: .SUFFIXES: $(OBJSUFFIX) .cpp .h CC = arm-linux-g++ LD = arm-linux-g++ -o CFLAGS = -O3 -Wall -fno-exceptions -fno-rtti -fno-check-new -fomit-frame-pointer -pipe -c $(INCS) $(DEFS) RM = rm -f TARGET = onscripter$(EXESUFFIX) sarconv$(EXESUFFIX) nsaconv$(EXESUFFIX) EXT_OBJS = include Makefile.onscripter onscripter-20150820/DirectReader.h0000644017777601777760000000747612565174244016524 0ustar nobodynogroup//$Id:$ -*- C++ -*- /* * DirectReader.h - Reader from independent files * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __DIRECT_READER_H__ #define __DIRECT_READER_H__ #include "BaseReader.h" #include #define MAX_FILE_NAME_LENGTH 256 class DirectReader : public BaseReader { public: DirectReader( const char *path=NULL, const unsigned char *key_table=NULL ); ~DirectReader(); int open( const char *name=NULL ); int close(); const char *getArchiveName() const; int getNumFiles(); void registerCompressionType( const char *ext, int type ); struct FileInfo getFileByIndex( unsigned int index ); size_t getFileLength( const char *file_name ); size_t getFile( const char *file_name, unsigned char *buffer, int *location=NULL ); static void convertFromSJISToEUC( char *buf ); static void convertFromSJISToUTF8( char *dst_buf, const char *src_buf ); protected: char *file_full_path; char *file_sub_path; size_t file_path_len; char *capital_name; char *capital_name_tmp; char *archive_path; unsigned char key_table[256]; bool key_table_flag; int getbit_mask; size_t getbit_len, getbit_count; unsigned char *read_buf; unsigned char *decomp_buffer; size_t decomp_buffer_len; struct RegisteredCompressionType{ RegisteredCompressionType *next; char *ext; int type; RegisteredCompressionType(){ ext = NULL; next = NULL; }; RegisteredCompressionType( const char *ext, int type ){ this->ext = new char[ strlen(ext)+1 ]; for ( unsigned int i=0 ; iext[i] = ext[i]; if ( this->ext[i] >= 'a' && this->ext[i] <= 'z' ) this->ext[i] += 'A' - 'a'; } this->type = type; this->next = NULL; }; ~RegisteredCompressionType(){ if (ext) delete[] ext; }; } root_registered_compression_type, *last_registered_compression_type; FILE *fopen(const char *path, const char *mode); unsigned char readChar( FILE *fp ); unsigned short readShort( FILE *fp ); unsigned long readLong( FILE *fp ); void writeChar( FILE *fp, unsigned char ch ); void writeShort( FILE *fp, unsigned short ch ); void writeLong( FILE *fp, unsigned long ch ); static unsigned short swapShort( unsigned short ch ); static unsigned long swapLong( unsigned long ch ); size_t decodeNBZ( FILE *fp, size_t offset, unsigned char *buf ); size_t encodeNBZ( FILE *fp, size_t length, unsigned char *buf ); int getbit( FILE *fp, int n ); size_t decodeSPB( FILE *fp, size_t offset, unsigned char *buf ); size_t decodeLZSS( struct ArchiveInfo *ai, int no, unsigned char *buf ); int getRegisteredCompressionType( const char *file_name ); size_t getDecompressedFileLength( int type, FILE *fp, size_t offset ); private: FILE *getFileHandle( const char *file_name, int &compression_type, size_t *length ); }; #endif // __DIRECT_READER_H__ onscripter-20150820/sjis2utf16.cpp0000644017777601777760000061723112565174244016436 0ustar nobodynogroup/* sjis 0x8140 - 0xfcfc */ static unsigned short *sjis_2_utf16; static unsigned short sjis_2_utf16_org[][2] = { {0x8140,0x3000}, {0x8141,0x3001}, {0x8142,0x3002}, {0x8143,0xff0c}, {0x8144,0xff0e}, {0x8145,0x30fb}, {0x8146,0xff1a}, {0x8147,0xff1b}, {0x8148,0xff1f}, {0x8149,0xff01}, {0x814a,0x309b}, {0x814b,0x309c}, {0x814c,0x00b4}, {0x814d,0xff40}, {0x814e,0x00a8}, {0x814f,0xff3e}, {0x8150,0x203e}, {0x8151,0xff3f}, {0x8152,0x30fd}, {0x8153,0x30fe}, {0x8154,0x309d}, {0x8155,0x309e}, {0x8156,0x3003}, {0x8157,0x4edd}, {0x8158,0x3005}, {0x8159,0x3006}, {0x815a,0x3007}, {0x815b,0x30fc}, {0x815c,0x2500}, // instead of 0x2014 {0x815d,0x2010}, {0x815e,0xff0f}, {0x815f,0xff3c}, {0x8160,0xff5e}, // instead of 0x301c {0x8161,0x2016}, {0x8162,0xff5c}, {0x8163,0x2026}, {0x8164,0x2025}, {0x8165,0x2018}, {0x8166,0x2019}, {0x8167,0x201c}, {0x8168,0x201d}, {0x8169,0xff08}, {0x816a,0xff09}, {0x816b,0x3014}, {0x816c,0x3015}, {0x816d,0xff3b}, {0x816e,0xff3d}, {0x816f,0xff5b}, {0x8170,0xff5d}, {0x8171,0x3008}, {0x8172,0x3009}, {0x8173,0x300a}, {0x8174,0x300b}, {0x8175,0x300c}, {0x8176,0x300d}, {0x8177,0x300e}, {0x8178,0x300f}, {0x8179,0x3010}, {0x817a,0x3011}, {0x817b,0xff0b}, {0x817c,0xff0d}, // instead of 0x2212 {0x817d,0x00b1}, {0x817e,0x00d7}, {0x8180,0x00f7}, {0x8181,0xff1d}, {0x8182,0x2260}, {0x8183,0xff1c}, {0x8184,0xff1e}, {0x8185,0x2266}, {0x8186,0x2267}, {0x8187,0x221e}, {0x8188,0x2234}, {0x8189,0x2642}, {0x818a,0x2640}, {0x818b,0x00b0}, {0x818c,0x2032}, {0x818d,0x2033}, {0x818e,0x2103}, {0x818f,0xffe5}, // instead of 0x00a5 {0x8190,0xff04}, {0x8191,0x00a2}, {0x8192,0x00a3}, {0x8193,0xff05}, {0x8194,0xff03}, {0x8195,0xff06}, {0x8196,0xff0a}, {0x8197,0xff20}, {0x8198,0x00a7}, {0x8199,0x2606}, {0x819a,0x2605}, {0x819b,0x25cb}, {0x819c,0x25cf}, {0x819d,0x25ce}, {0x819e,0x25c7}, {0x819f,0x25c6}, {0x81a0,0x25a1}, {0x81a1,0x25a0}, {0x81a2,0x25b3}, {0x81a3,0x25b2}, {0x81a4,0x25bd}, {0x81a5,0x25bc}, {0x81a6,0x203b}, {0x81a7,0x3012}, {0x81a8,0x2192}, {0x81a9,0x2190}, {0x81aa,0x2191}, {0x81ab,0x2193}, {0x81ac,0x3013}, {0x81ad,0xff07}, {0x81ae,0xff02}, {0x81af,0xff0d}, {0x81b0,0xff5e}, {0x81b1,0x3033}, {0x81b2,0x3034}, {0x81b3,0x3035}, {0x81b4,0x0}, {0x81b5,0x0}, {0x81b6,0x0}, {0x81b7,0x0}, {0x81b8,0x2208}, {0x81b9,0x220b}, {0x81ba,0x2286}, {0x81bb,0x2287}, {0x81bc,0x2282}, {0x81bd,0x2283}, {0x81be,0x222a}, {0x81bf,0x2229}, {0x81c0,0x2284}, {0x81c1,0x2285}, {0x81c2,0x228a}, {0x81c3,0x228b}, {0x81c4,0x2209}, {0x81c5,0x2205}, {0x81c6,0x2305}, {0x81c7,0x2306}, {0x81c8,0x2227}, {0x81c9,0x2228}, {0x81ca,0x00ac}, {0x81cb,0x21d2}, {0x81cc,0x21d4}, {0x81cd,0x2200}, {0x81ce,0x2203}, {0x81cf,0x2295}, {0x81d0,0x2296}, {0x81d1,0x2297}, {0x81d2,0x2225}, {0x81d3,0x2226}, {0x81d4,0x0}, {0x81d5,0x0}, {0x81d6,0x3018}, {0x81d7,0x3019}, {0x81d8,0x3016}, {0x81d9,0x3017}, {0x81da,0x2220}, {0x81db,0x22a5}, {0x81dc,0x2312}, {0x81dd,0x2202}, {0x81de,0x2207}, {0x81df,0x2261}, {0x81e0,0x2252}, {0x81e1,0x226a}, {0x81e2,0x226b}, {0x81e3,0x221a}, {0x81e4,0x223d}, {0x81e5,0x221d}, {0x81e6,0x2235}, {0x81e7,0x222b}, {0x81e8,0x222c}, {0x81e9,0x2262}, {0x81ea,0x2243}, {0x81eb,0x2245}, {0x81ec,0x2248}, {0x81ed,0x2276}, {0x81ee,0x2277}, {0x81ef,0x2194}, {0x81f0,0x212b}, {0x81f1,0x2030}, {0x81f2,0x266f}, {0x81f3,0x266d}, {0x81f4,0x266a}, {0x81f5,0x2020}, {0x81f6,0x2021}, {0x81f7,0x00b6}, {0x81f8,0x266e}, {0x81f9,0x266b}, {0x81fa,0x266c}, {0x81fb,0x2669}, {0x81fc,0x25ef}, {0x8240,0x25b7}, {0x8241,0x25b6}, {0x8242,0x25c1}, {0x8243,0x25c0}, {0x8244,0x2197}, {0x8245,0x2198}, {0x8246,0x2196}, {0x8247,0x2199}, {0x8248,0x21c4}, {0x8249,0x21e8}, {0x824a,0x21e6}, {0x824b,0x21e7}, {0x824c,0x21e9}, {0x824d,0x0}, {0x824e,0x0}, {0x824f,0xff10}, {0x8250,0xff11}, {0x8251,0xff12}, {0x8252,0xff13}, {0x8253,0xff14}, {0x8254,0xff15}, {0x8255,0xff16}, {0x8256,0xff17}, {0x8257,0xff18}, {0x8258,0xff19}, {0x8259,0x0}, {0x825a,0x25c9}, {0x825b,0x0}, {0x825c,0x0}, {0x825d,0x0}, {0x825e,0x25e6}, {0x825f,0x2022}, {0x8260,0xff21}, {0x8261,0xff22}, {0x8262,0xff23}, {0x8263,0xff24}, {0x8264,0xff25}, {0x8265,0xff26}, {0x8266,0xff27}, {0x8267,0xff28}, {0x8268,0xff29}, {0x8269,0xff2a}, {0x826a,0xff2b}, {0x826b,0xff2c}, {0x826c,0xff2d}, {0x826d,0xff2e}, {0x826e,0xff2f}, {0x826f,0xff30}, {0x8270,0xff31}, {0x8271,0xff32}, {0x8272,0xff33}, {0x8273,0xff34}, {0x8274,0xff35}, {0x8275,0xff36}, {0x8276,0xff37}, {0x8277,0xff38}, {0x8278,0xff39}, {0x8279,0xff3a}, {0x827a,0x2213}, {0x827b,0x2135}, {0x827c,0x210f}, {0x827d,0x33cb}, {0x827e,0x2113}, {0x8280,0x2127}, {0x8281,0xff41}, {0x8282,0xff42}, {0x8283,0xff43}, {0x8284,0xff44}, {0x8285,0xff45}, {0x8286,0xff46}, {0x8287,0xff47}, {0x8288,0xff48}, {0x8289,0xff49}, {0x828a,0xff4a}, {0x828b,0xff4b}, {0x828c,0xff4c}, {0x828d,0xff4d}, {0x828e,0xff4e}, {0x828f,0xff4f}, {0x8290,0xff50}, {0x8291,0xff51}, {0x8292,0xff52}, {0x8293,0xff53}, {0x8294,0xff54}, {0x8295,0xff55}, {0x8296,0xff56}, {0x8297,0xff57}, {0x8298,0xff58}, {0x8299,0xff59}, {0x829a,0xff5a}, {0x829b,0x0}, {0x829c,0x2013}, {0x829d,0x0}, {0x829e,0x0}, {0x829f,0x3041}, {0x82a0,0x3042}, {0x82a1,0x3043}, {0x82a2,0x3044}, {0x82a3,0x3045}, {0x82a4,0x3046}, {0x82a5,0x3047}, {0x82a6,0x3048}, {0x82a7,0x3049}, {0x82a8,0x304a}, {0x82a9,0x304b}, {0x82aa,0x304c}, {0x82ab,0x304d}, {0x82ac,0x304e}, {0x82ad,0x304f}, {0x82ae,0x3050}, {0x82af,0x3051}, {0x82b0,0x3052}, {0x82b1,0x3053}, {0x82b2,0x3054}, {0x82b3,0x3055}, {0x82b4,0x3056}, {0x82b5,0x3057}, {0x82b6,0x3058}, {0x82b7,0x3059}, {0x82b8,0x305a}, {0x82b9,0x305b}, {0x82ba,0x305c}, {0x82bb,0x305d}, {0x82bc,0x305e}, {0x82bd,0x305f}, {0x82be,0x3060}, {0x82bf,0x3061}, {0x82c0,0x3062}, {0x82c1,0x3063}, {0x82c2,0x3064}, {0x82c3,0x3065}, {0x82c4,0x3066}, {0x82c5,0x3067}, {0x82c6,0x3068}, {0x82c7,0x3069}, {0x82c8,0x306a}, {0x82c9,0x306b}, {0x82ca,0x306c}, {0x82cb,0x306d}, {0x82cc,0x306e}, {0x82cd,0x306f}, {0x82ce,0x3070}, {0x82cf,0x3071}, {0x82d0,0x3072}, {0x82d1,0x3073}, {0x82d2,0x3074}, {0x82d3,0x3075}, {0x82d4,0x3076}, {0x82d5,0x3077}, {0x82d6,0x3078}, {0x82d7,0x3079}, {0x82d8,0x307a}, {0x82d9,0x307b}, {0x82da,0x307c}, {0x82db,0x307d}, {0x82dc,0x307e}, {0x82dd,0x307f}, {0x82de,0x3080}, {0x82df,0x3081}, {0x82e0,0x3082}, {0x82e1,0x3083}, {0x82e2,0x3084}, {0x82e3,0x3085}, {0x82e4,0x3086}, {0x82e5,0x3087}, {0x82e6,0x3088}, {0x82e7,0x3089}, {0x82e8,0x308a}, {0x82e9,0x308b}, {0x82ea,0x308c}, {0x82eb,0x308d}, {0x82ec,0x308e}, {0x82ed,0x308f}, {0x82ee,0x3090}, {0x82ef,0x3091}, {0x82f0,0x3092}, {0x82f1,0x3093}, {0x82f2,0x3094}, {0x82f3,0x0}, {0x82f4,0x0}, {0x82f5,0x0}, {0x82f6,0x0}, {0x82f7,0x0}, {0x82f8,0x0}, {0x82f9,0x0}, {0x82fa,0xffff}, {0x82fb,0xffff}, {0x82fc,0xffff}, {0x8340,0x30a1}, {0x8341,0x30a2}, {0x8342,0x30a3}, {0x8343,0x30a4}, {0x8344,0x30a5}, {0x8345,0x30a6}, {0x8346,0x30a7}, {0x8347,0x30a8}, {0x8348,0x30a9}, {0x8349,0x30aa}, {0x834a,0x30ab}, {0x834b,0x30ac}, {0x834c,0x30ad}, {0x834d,0x30ae}, {0x834e,0x30af}, {0x834f,0x30b0}, {0x8350,0x30b1}, {0x8351,0x30b2}, {0x8352,0x30b3}, {0x8353,0x30b4}, {0x8354,0x30b5}, {0x8355,0x30b6}, {0x8356,0x30b7}, {0x8357,0x30b8}, {0x8358,0x30b9}, {0x8359,0x30ba}, {0x835a,0x30bb}, {0x835b,0x30bc}, {0x835c,0x30bd}, {0x835d,0x30be}, {0x835e,0x30bf}, {0x835f,0x30c0}, {0x8360,0x30c1}, {0x8361,0x30c2}, {0x8362,0x30c3}, {0x8363,0x30c4}, {0x8364,0x30c5}, {0x8365,0x30c6}, {0x8366,0x30c7}, {0x8367,0x30c8}, {0x8368,0x30c9}, {0x8369,0x30ca}, {0x836a,0x30cb}, {0x836b,0x30cc}, {0x836c,0x30cd}, {0x836d,0x30ce}, {0x836e,0x30cf}, {0x836f,0x30d0}, {0x8370,0x30d1}, {0x8371,0x30d2}, {0x8372,0x30d3}, {0x8373,0x30d4}, {0x8374,0x30d5}, {0x8375,0x30d6}, {0x8376,0x30d7}, {0x8377,0x30d8}, {0x8378,0x30d9}, {0x8379,0x30da}, {0x837a,0x30db}, {0x837b,0x30dc}, {0x837c,0x30dd}, {0x837d,0x30de}, {0x837e,0x30df}, {0x8380,0x30e0}, {0x8381,0x30e1}, {0x8382,0x30e2}, {0x8383,0x30e3}, {0x8384,0x30e4}, {0x8385,0x30e5}, {0x8386,0x30e6}, {0x8387,0x30e7}, {0x8388,0x30e8}, {0x8389,0x30e9}, {0x838a,0x30ea}, {0x838b,0x30eb}, {0x838c,0x30ec}, {0x838d,0x30ed}, {0x838e,0x30ee}, {0x838f,0x30ef}, {0x8390,0x30f0}, {0x8391,0x30f1}, {0x8392,0x30f2}, {0x8393,0x30f3}, {0x8394,0x30f4}, {0x8395,0x30f5}, {0x8396,0x30f6}, {0x8397,0x0}, {0x8398,0x0}, {0x8399,0x0}, {0x839a,0x0}, {0x839b,0x0}, {0x839c,0x0}, {0x839d,0x0}, {0x839e,0x0}, {0x839f,0x0391}, {0x83a0,0x0392}, {0x83a1,0x0393}, {0x83a2,0x0394}, {0x83a3,0x0395}, {0x83a4,0x0396}, {0x83a5,0x0397}, {0x83a6,0x0398}, {0x83a7,0x0399}, {0x83a8,0x039a}, {0x83a9,0x039b}, {0x83aa,0x039c}, {0x83ab,0x039d}, {0x83ac,0x039e}, {0x83ad,0x039f}, {0x83ae,0x03a0}, {0x83af,0x03a1}, {0x83b0,0x03a3}, {0x83b1,0x03a4}, {0x83b2,0x03a5}, {0x83b3,0x03a6}, {0x83b4,0x03a7}, {0x83b5,0x03a8}, {0x83b6,0x03a9}, {0x83b7,0x2664}, {0x83b8,0x2660}, {0x83b9,0x2662}, {0x83ba,0x2666}, {0x83bb,0x2661}, {0x83bc,0x2665}, {0x83bd,0x2667}, {0x83be,0x2663}, {0x83bf,0x03b1}, {0x83c0,0x03b2}, {0x83c1,0x03b3}, {0x83c2,0x03b4}, {0x83c3,0x03b5}, {0x83c4,0x03b6}, {0x83c5,0x03b7}, {0x83c6,0x03b8}, {0x83c7,0x03b9}, {0x83c8,0x03ba}, {0x83c9,0x03bb}, {0x83ca,0x03bc}, {0x83cb,0x03bd}, {0x83cc,0x03be}, {0x83cd,0x03bf}, {0x83ce,0x03c0}, {0x83cf,0x03c1}, {0x83d0,0x03c3}, {0x83d1,0x03c4}, {0x83d2,0x03c5}, {0x83d3,0x03c6}, {0x83d4,0x03c7}, {0x83d5,0x03c8}, {0x83d6,0x03c9}, {0x83d7,0x03c2}, {0x83d8,0x0}, {0x83d9,0x0}, {0x83da,0x0}, {0x83db,0x0}, {0x83dc,0x0}, {0x83dd,0x0}, {0x83de,0x0}, {0x83df,0x0}, {0x83e0,0x0}, {0x83e1,0x0}, {0x83e2,0x0}, {0x83e3,0x0}, {0x83e4,0x3020}, {0x83e5,0x260e}, {0x83e6,0x2600}, {0x83e7,0x2601}, {0x83e8,0x2602}, {0x83e9,0x2603}, {0x83ea,0x2668}, {0x83eb,0x25b1}, {0x83ec,0x0}, {0x83ed,0x0}, {0x83ee,0x0}, {0x83ef,0x0}, {0x83f0,0x0}, {0x83f1,0x0}, {0x83f2,0x0}, {0x83f3,0x0}, {0x83f4,0x0}, {0x83f5,0x0}, {0x83f6,0x0}, {0x83f7,0x0}, {0x83f8,0x0}, {0x83f9,0x0}, {0x83fa,0x0}, {0x83fb,0x0}, {0x83fc,0x0}, {0x8440,0x0410}, {0x8441,0x0411}, {0x8442,0x0412}, {0x8443,0x0413}, {0x8444,0x0414}, {0x8445,0x0415}, {0x8446,0x0401}, {0x8447,0x0416}, {0x8448,0x0417}, {0x8449,0x0418}, {0x844a,0x0419}, {0x844b,0x041a}, {0x844c,0x041b}, {0x844d,0x041c}, {0x844e,0x041d}, {0x844f,0x041e}, {0x8450,0x041f}, {0x8451,0x0420}, {0x8452,0x0421}, {0x8453,0x0422}, {0x8454,0x0423}, {0x8455,0x0424}, {0x8456,0x0425}, {0x8457,0x0426}, {0x8458,0x0427}, {0x8459,0x0428}, {0x845a,0x0429}, {0x845b,0x042a}, {0x845c,0x042b}, {0x845d,0x042c}, {0x845e,0x042d}, {0x845f,0x042e}, {0x8460,0x042f}, {0x8461,0x0}, {0x8462,0x0}, {0x8463,0x0}, {0x8464,0x0}, {0x8465,0x0}, {0x8466,0x0}, {0x8467,0x0}, {0x8468,0x0}, {0x8469,0x0}, {0x846a,0x0}, {0x846b,0x0}, {0x846c,0x0}, {0x846d,0x0}, {0x846e,0x0}, {0x846f,0x0}, {0x8470,0x0430}, {0x8471,0x0431}, {0x8472,0x0432}, {0x8473,0x0433}, {0x8474,0x0434}, {0x8475,0x0435}, {0x8476,0x0451}, {0x8477,0x0436}, {0x8478,0x0437}, {0x8479,0x0438}, {0x847a,0x0439}, {0x847b,0x043a}, {0x847c,0x043b}, {0x847d,0x043c}, {0x847e,0x043d}, {0x8480,0x043e}, {0x8481,0x043f}, {0x8482,0x0440}, {0x8483,0x0441}, {0x8484,0x0442}, {0x8485,0x0443}, {0x8486,0x0444}, {0x8487,0x0445}, {0x8488,0x0446}, {0x8489,0x0447}, {0x848a,0x0448}, {0x848b,0x0449}, {0x848c,0x044a}, {0x848d,0x044b}, {0x848e,0x044c}, {0x848f,0x044d}, {0x8490,0x044e}, {0x8491,0x044f}, {0x8492,0x30f7}, {0x8493,0x30f8}, {0x8494,0x30f9}, {0x8495,0x30fa}, {0x8496,0x22da}, {0x8497,0x22db}, {0x8498,0x2153}, {0x8499,0x2154}, {0x849a,0x2155}, {0x849b,0x2713}, {0x849c,0x2318}, {0x849d,0x2423}, {0x849e,0x0}, {0x849f,0x2500}, {0x84a0,0x2502}, {0x84a1,0x250c}, {0x84a2,0x2510}, {0x84a3,0x2518}, {0x84a4,0x2514}, {0x84a5,0x251c}, {0x84a6,0x252c}, {0x84a7,0x2524}, {0x84a8,0x2534}, {0x84a9,0x253c}, {0x84aa,0x2501}, {0x84ab,0x2503}, {0x84ac,0x250f}, {0x84ad,0x2513}, {0x84ae,0x251b}, {0x84af,0x2517}, {0x84b0,0x2523}, {0x84b1,0x2533}, {0x84b2,0x252b}, {0x84b3,0x253b}, {0x84b4,0x254b}, {0x84b5,0x2520}, {0x84b6,0x252f}, {0x84b7,0x2528}, {0x84b8,0x2537}, {0x84b9,0x253f}, {0x84ba,0x251d}, {0x84bb,0x2530}, {0x84bc,0x2525}, {0x84bd,0x2538}, {0x84be,0x2542}, {0x84bf,0x0}, {0x84c0,0x0}, {0x84c1,0x0}, {0x84c2,0x0}, {0x84c3,0x0}, {0x84c4,0x0}, {0x84c5,0x0}, {0x84c6,0x0}, {0x84c7,0x0}, {0x84c8,0x0}, {0x84c9,0x0}, {0x84ca,0x0}, {0x84cb,0x0}, {0x84cc,0x0}, {0x84cd,0x0}, {0x84ce,0x0}, {0x84cf,0x0}, {0x84d0,0x0}, {0x84d1,0x0}, {0x84d2,0x0}, {0x84d3,0x0}, {0x84d4,0x0}, {0x84d5,0x0}, {0x84d6,0x0}, {0x84d7,0x0}, {0x84d8,0x0}, {0x84d9,0x0}, {0x84da,0x0}, {0x84db,0x0}, {0x84dc,0x0}, {0x84dd,0xffff}, {0x84de,0xffff}, {0x84df,0xffff}, {0x84e0,0xffff}, {0x84e1,0xffff}, {0x84e2,0xffff}, {0x84e3,0xffff}, {0x84e4,0xffff}, {0x84e5,0x25d0}, {0x84e6,0x25d1}, {0x84e7,0x25d2}, {0x84e8,0x25d3}, {0x84e9,0x203c}, {0x84ea,0x0}, {0x84eb,0x2048}, {0x84ec,0x2049}, {0x84ed,0x01cd}, {0x84ee,0x01ce}, {0x84ef,0x01d0}, {0x84f0,0x1e3e}, {0x84f1,0x1e3f}, {0x84f2,0x01f8}, {0x84f3,0x01f9}, {0x84f4,0x01d1}, {0x84f5,0x01d2}, {0x84f6,0x01d4}, {0x84f7,0x01d6}, {0x84f8,0x01d8}, {0x84f9,0x01da}, {0x84fa,0x01dc}, {0x84fb,0xffff}, {0x84fc,0xffff}, {0x8540,0x20ac}, {0x8541,0x00a0}, {0x8542,0x00a1}, {0x8543,0x00a4}, {0x8544,0x00a6}, {0x8545,0x00a9}, {0x8546,0x00aa}, {0x8547,0x00ab}, {0x8548,0x00ad}, {0x8549,0x00ae}, {0x854a,0x00af}, {0x854b,0x00b2}, {0x854c,0x00b3}, {0x854d,0x00b7}, {0x854e,0x00b8}, {0x854f,0x00b9}, {0x8550,0x00ba}, {0x8551,0x00bb}, {0x8552,0x00bc}, {0x8553,0x00bd}, {0x8554,0x00be}, {0x8555,0x00bf}, {0x8556,0x00c0}, {0x8557,0x00c1}, {0x8558,0x00c2}, {0x8559,0x00c3}, {0x855a,0x00c4}, {0x855b,0x00c5}, {0x855c,0x00c6}, {0x855d,0x00c7}, {0x855e,0x00c8}, {0x855f,0x00c9}, {0x8560,0x00ca}, {0x8561,0x00cb}, {0x8562,0x00cc}, {0x8563,0x00cd}, {0x8564,0x00ce}, {0x8565,0x00cf}, {0x8566,0x00d0}, {0x8567,0x00d1}, {0x8568,0x00d2}, {0x8569,0x00d3}, {0x856a,0x00d4}, {0x856b,0x00d5}, {0x856c,0x00d6}, {0x856d,0x00d8}, {0x856e,0x00d9}, {0x856f,0x00da}, {0x8570,0x00db}, {0x8571,0x00dc}, {0x8572,0x00dd}, {0x8573,0x00de}, {0x8574,0x00df}, {0x8575,0x00e0}, {0x8576,0x00e1}, {0x8577,0x00e2}, {0x8578,0x00e3}, {0x8579,0x00e4}, {0x857a,0x00e5}, {0x857b,0x00e6}, {0x857c,0x00e7}, {0x857d,0x00e8}, {0x857e,0x00e9}, {0x8580,0x00ea}, {0x8581,0x00eb}, {0x8582,0x00ec}, {0x8583,0x00ed}, {0x8584,0x00ee}, {0x8585,0x00ef}, {0x8586,0x00f0}, {0x8587,0x00f1}, {0x8588,0x00f2}, {0x8589,0x00f3}, {0x858a,0x00f4}, {0x858b,0x00f5}, {0x858c,0x00f6}, {0x858d,0x00f8}, {0x858e,0x00f9}, {0x858f,0x00fa}, {0x8590,0x00fb}, {0x8591,0x00fc}, {0x8592,0x00fd}, {0x8593,0x00fe}, {0x8594,0x00ff}, {0x8595,0x0100}, {0x8596,0x012a}, {0x8597,0x016a}, {0x8598,0x0112}, {0x8599,0x014c}, {0x859a,0x0101}, {0x859b,0x012b}, {0x859c,0x016b}, {0x859d,0x0113}, {0x859e,0x014d}, {0x859f,0x0104}, {0x85a0,0x02d8}, {0x85a1,0x0141}, {0x85a2,0x013d}, {0x85a3,0x015a}, {0x85a4,0x0160}, {0x85a5,0x015e}, {0x85a6,0x0164}, {0x85a7,0x0179}, {0x85a8,0x017d}, {0x85a9,0x017b}, {0x85aa,0x0105}, {0x85ab,0x02db}, {0x85ac,0x0142}, {0x85ad,0x013e}, {0x85ae,0x015b}, {0x85af,0x02c7}, {0x85b0,0x0161}, {0x85b1,0x015f}, {0x85b2,0x0165}, {0x85b3,0x017a}, {0x85b4,0x02dd}, {0x85b5,0x017e}, {0x85b6,0x017c}, {0x85b7,0x0154}, {0x85b8,0x0102}, {0x85b9,0x0139}, {0x85ba,0x0106}, {0x85bb,0x010c}, {0x85bc,0x0118}, {0x85bd,0x011a}, {0x85be,0x010e}, {0x85bf,0x0143}, {0x85c0,0x0147}, {0x85c1,0x0150}, {0x85c2,0x0158}, {0x85c3,0x016e}, {0x85c4,0x0170}, {0x85c5,0x0162}, {0x85c6,0x0155}, {0x85c7,0x0103}, {0x85c8,0x013a}, {0x85c9,0x0107}, {0x85ca,0x010d}, {0x85cb,0x0119}, {0x85cc,0x011b}, {0x85cd,0x010f}, {0x85ce,0x0111}, {0x85cf,0x0144}, {0x85d0,0x0148}, {0x85d1,0x0151}, {0x85d2,0x0159}, {0x85d3,0x016f}, {0x85d4,0x0171}, {0x85d5,0x0163}, {0x85d6,0x02d9}, {0x85d7,0x0108}, {0x85d8,0x011c}, {0x85d9,0x0124}, {0x85da,0x0134}, {0x85db,0x015c}, {0x85dc,0x016c}, {0x85dd,0x0109}, {0x85de,0x011d}, {0x85df,0x0125}, {0x85e0,0x0135}, {0x85e1,0x015d}, {0x85e2,0x016d}, {0x85e3,0x0271}, {0x85e4,0x028b}, {0x85e5,0x027e}, {0x85e6,0x0283}, {0x85e7,0x0292}, {0x85e8,0x026c}, {0x85e9,0x026e}, {0x85ea,0x0279}, {0x85eb,0x0288}, {0x85ec,0x0256}, {0x85ed,0x0273}, {0x85ee,0x027d}, {0x85ef,0x0282}, {0x85f0,0x0290}, {0x85f1,0x027b}, {0x85f2,0x026d}, {0x85f3,0x025f}, {0x85f4,0x0272}, {0x85f5,0x029d}, {0x85f6,0x028e}, {0x85f7,0x0261}, {0x85f8,0x014b}, {0x85f9,0x0270}, {0x85fa,0x0281}, {0x85fb,0x0127}, {0x85fc,0x0295}, {0x8640,0x0294}, {0x8641,0x0266}, {0x8642,0x0298}, {0x8643,0x01c2}, {0x8644,0x0253}, {0x8645,0x0257}, {0x8646,0x0284}, {0x8647,0x0260}, {0x8648,0x0193}, {0x8649,0x0153}, {0x864a,0x0152}, {0x864b,0x0268}, {0x864c,0x0289}, {0x864d,0x0258}, {0x864e,0x0275}, {0x864f,0x0259}, {0x8650,0x025c}, {0x8651,0x025e}, {0x8652,0x0250}, {0x8653,0x026f}, {0x8654,0x028a}, {0x8655,0x0264}, {0x8656,0x028c}, {0x8657,0x0254}, {0x8658,0x0251}, {0x8659,0x0252}, {0x865a,0x028d}, {0x865b,0x0265}, {0x865c,0x02a2}, {0x865d,0x02a1}, {0x865e,0x0255}, {0x865f,0x0291}, {0x8660,0x027a}, {0x8661,0x0267}, {0x8662,0x025a}, {0x8663,0x0}, {0x8664,0x01fd}, {0x8665,0x1f70}, {0x8666,0x1f71}, {0x8667,0x0}, {0x8668,0x0}, {0x8669,0x0}, {0x866a,0x0}, {0x866b,0x0}, {0x866c,0x0}, {0x866d,0x0}, {0x866e,0x0}, {0x866f,0x1f72}, {0x8670,0x1f73}, {0x8671,0x0361}, {0x8672,0x02c8}, {0x8673,0x02cc}, {0x8674,0x02d0}, {0x8675,0x02d1}, {0x8676,0x0306}, {0x8677,0x203F}, {0x8678,0x030b}, {0x8679,0x0301}, {0x867a,0x0304}, {0x867b,0x0300}, {0x867c,0x030f}, {0x867d,0x030c}, {0x867e,0x0302}, {0x8680,0x02e5}, {0x8681,0x02e6}, {0x8682,0x02e7}, {0x8683,0x02e8}, {0x8684,0x02e9}, {0x8685,0x0}, {0x8686,0x0}, {0x8687,0x0325}, {0x8688,0x032c}, {0x8689,0x0339}, {0x868a,0x031c}, {0x868b,0x031f}, {0x868c,0x0320}, {0x868d,0x0308}, {0x868e,0x033d}, {0x868f,0x0329}, {0x8690,0x032f}, {0x8691,0x02de}, {0x8692,0x0324}, {0x8693,0x0330}, {0x8694,0x033c}, {0x8695,0x0334}, {0x8696,0x031d}, {0x8697,0x031e}, {0x8698,0x0318}, {0x8699,0x0319}, {0x869a,0x032a}, {0x869b,0x033a}, {0x869c,0x033b}, {0x869d,0x0303}, {0x869e,0x031a}, {0x869f,0x2776}, {0x86a0,0x2777}, {0x86a1,0x2778}, {0x86a2,0x2779}, {0x86a3,0x277a}, {0x86a4,0x277b}, {0x86a5,0x277c}, {0x86a6,0x277d}, {0x86a7,0x277e}, {0x86a8,0x277f}, {0x86a9,0x0}, {0x86aa,0x0}, {0x86ab,0x0}, {0x86ac,0x0}, {0x86ad,0x0}, {0x86ae,0x0}, {0x86af,0x0}, {0x86b0,0x0}, {0x86b1,0x0}, {0x86b2,0x0}, {0x86b3,0x2170}, {0x86b4,0x2171}, {0x86b5,0x2172}, {0x86b6,0x2173}, {0x86b7,0x2174}, {0x86b8,0x2175}, {0x86b9,0x2176}, {0x86ba,0x2177}, {0x86bb,0x2178}, {0x86bc,0x2179}, {0x86bd,0x217a}, {0x86be,0x217b}, {0x86bf,0x24d0}, {0x86c0,0x24d1}, {0x86c1,0x24d2}, {0x86c2,0x24d3}, {0x86c3,0x24d4}, {0x86c4,0x24d5}, {0x86c5,0x24d6}, {0x86c6,0x24d7}, {0x86c7,0x24d8}, {0x86c8,0x24d9}, {0x86c9,0x24da}, {0x86ca,0x24db}, {0x86cb,0x24dc}, {0x86cc,0x24dd}, {0x86cd,0x24de}, {0x86ce,0x24df}, {0x86cf,0x24e0}, {0x86d0,0x24e1}, {0x86d1,0x24e2}, {0x86d2,0x24e3}, {0x86d3,0x24e4}, {0x86d4,0x24e5}, {0x86d5,0x24e6}, {0x86d6,0x24e7}, {0x86d7,0x24e8}, {0x86d8,0x24e9}, {0x86d9,0x32d0}, {0x86da,0x32d1}, {0x86db,0x32d2}, {0x86dc,0x32d3}, {0x86dd,0x32d4}, {0x86de,0x32d5}, {0x86df,0x32d6}, {0x86e0,0x32d7}, {0x86e1,0x32d8}, {0x86e2,0x32d9}, {0x86e3,0x32da}, {0x86e4,0x32db}, {0x86e5,0x32dc}, {0x86e6,0x32dd}, {0x86e7,0x32de}, {0x86e8,0x32df}, {0x86e9,0x32e0}, {0x86ea,0x32e1}, {0x86eb,0x32e2}, {0x86ec,0x32e3}, {0x86ed,0x32fa}, {0x86ee,0x32e9}, {0x86ef,0x32e5}, {0x86f0,0x32ed}, {0x86f1,0x32ec}, {0x86f2,0xffff}, {0x86f3,0xffff}, {0x86f4,0xffff}, {0x86f5,0xffff}, {0x86f6,0xffff}, {0x86f7,0xffff}, {0x86f8,0xffff}, {0x86f9,0xffff}, {0x86fa,0xffff}, {0x86fb,0x0}, {0x86fc,0x2042}, {0x8740,0x2460}, {0x8741,0x2461}, {0x8742,0x2462}, {0x8743,0x2463}, {0x8744,0x2464}, {0x8745,0x2465}, {0x8746,0x2466}, {0x8747,0x2467}, {0x8748,0x2468}, {0x8749,0x2469}, {0x874a,0x246a}, {0x874b,0x246b}, {0x874c,0x246c}, {0x874d,0x246d}, {0x874e,0x246e}, {0x874f,0x246f}, {0x8750,0x2470}, {0x8751,0x2471}, {0x8752,0x2472}, {0x8753,0x2473}, {0x8754,0x2160}, {0x8755,0x2161}, {0x8756,0x2162}, {0x8757,0x2163}, {0x8758,0x2164}, {0x8759,0x2165}, {0x875a,0x2166}, {0x875b,0x2167}, {0x875c,0x2168}, {0x875d,0x2169}, {0x875e,0x216a}, {0x875f,0x3349}, {0x8760,0x3314}, {0x8761,0x3322}, {0x8762,0x334d}, {0x8763,0x3318}, {0x8764,0x3327}, {0x8765,0x3303}, {0x8766,0x3336}, {0x8767,0x3351}, {0x8768,0x3357}, {0x8769,0x330d}, {0x876a,0x3326}, {0x876b,0x3323}, {0x876c,0x332b}, {0x876d,0x334a}, {0x876e,0x333b}, {0x876f,0x339c}, {0x8770,0x339d}, {0x8771,0x339e}, {0x8772,0x338e}, {0x8773,0x338f}, {0x8774,0x33c4}, {0x8775,0x33a1}, {0x8776,0x216b}, {0x8777,0xffff}, {0x8778,0xffff}, {0x8779,0xffff}, {0x877a,0xffff}, {0x877b,0xffff}, {0x877c,0xffff}, {0x877d,0xffff}, {0x877e,0x337b}, {0x8780,0x301d}, {0x8781,0x301f}, {0x8782,0x2116}, {0x8783,0x33cd}, {0x8784,0x2121}, {0x8785,0x32a4}, {0x8786,0x32a5}, {0x8787,0x32a6}, {0x8788,0x32a7}, {0x8789,0x32a8}, {0x878a,0x3231}, {0x878b,0x3232}, {0x878c,0x3239}, {0x878d,0x337e}, {0x878e,0x337d}, {0x878f,0x337c}, {0x8790,0xffff}, {0x8791,0xffff}, {0x8792,0xffff}, {0x8793,0x222e}, {0x8794,0xffff}, {0x8795,0xffff}, {0x8796,0xffff}, {0x8797,0xffff}, {0x8798,0x221f}, {0x8799,0x22bf}, {0x879a,0xffff}, {0x879b,0xffff}, {0x879c,0xffff}, {0x879d,0x2756}, {0x879e,0x261e}, {0x879f,0xffff}, {0x87a0,0x0}, {0x87a1,0x3402}, {0x87a2,0x4e28}, {0x87a3,0x4e2f}, {0x87a4,0x4e30}, {0x87a5,0x4e8d}, {0x87a6,0x4ee1}, {0x87a7,0x4efd}, {0x87a8,0x4eff}, {0x87a9,0x4f03}, {0x87aa,0x4f0b}, {0x87ab,0x4f60}, {0x87ac,0x4f48}, {0x87ad,0x4f49}, {0x87ae,0x4f56}, {0x87af,0x4f5f}, {0x87b0,0x4f6a}, {0x87b1,0x4f6c}, {0x87b2,0x4f7e}, {0x87b3,0x4f8a}, {0x87b4,0x4f94}, {0x87b5,0x4f97}, {0x87b6,0x0}, {0x87b7,0x4fc9}, {0x87b8,0x4fe0}, {0x87b9,0x5001}, {0x87ba,0x5002}, {0x87bb,0x500e}, {0x87bc,0x5018}, {0x87bd,0x5027}, {0x87be,0x502e}, {0x87bf,0x5040}, {0x87c0,0x503b}, {0x87c1,0x5041}, {0x87c2,0x5094}, {0x87c3,0x50cc}, {0x87c4,0x50f2}, {0x87c5,0x50d0}, {0x87c6,0x50e6}, {0x87c7,0x0}, {0x87c8,0x5106}, {0x87c9,0x5103}, {0x87ca,0x510b}, {0x87cb,0x511e}, {0x87cc,0x5135}, {0x87cd,0x514a}, {0x87ce,0x0}, {0x87cf,0x5155}, {0x87d0,0x5157}, {0x87d1,0x34b5}, {0x87d2,0x519d}, {0x87d3,0x51c3}, {0x87d4,0x51ca}, {0x87d5,0x51de}, {0x87d6,0x51e2}, {0x87d7,0x51ee}, {0x87d8,0x5201}, {0x87d9,0x34db}, {0x87da,0x5213}, {0x87db,0x5215}, {0x87dc,0x5249}, {0x87dd,0x5257}, {0x87de,0x5261}, {0x87df,0x5293}, {0x87e0,0x52c8}, {0x87e1,0x0}, {0x87e2,0x52cc}, {0x87e3,0x52d0}, {0x87e4,0x52d6}, {0x87e5,0x52db}, {0x87e6,0x0}, {0x87e7,0x52f0}, {0x87e8,0x52fb}, {0x87e9,0x5300}, {0x87ea,0x5307}, {0x87eb,0x531c}, {0x87ec,0x0}, {0x87ed,0x5361}, {0x87ee,0x5363}, {0x87ef,0x537d}, {0x87f0,0x5393}, {0x87f1,0x539d}, {0x87f2,0x53b2}, {0x87f3,0x5412}, {0x87f4,0x5427}, {0x87f5,0x544d}, {0x87f6,0x549c}, {0x87f7,0x546b}, {0x87f8,0x5474}, {0x87f9,0x547f}, {0x87fa,0x5488}, {0x87fb,0x5496}, {0x87fc,0x54a1}, {0x8840,0x54a9}, {0x8841,0x54c6}, {0x8842,0x54ff}, {0x8843,0x550e}, {0x8844,0x552b}, {0x8845,0x5535}, {0x8846,0x5550}, {0x8847,0x555e}, {0x8848,0x5581}, {0x8849,0x5586}, {0x884a,0x558e}, {0x884b,0x0}, {0x884c,0x55ad}, {0x884d,0x55ce}, {0x884e,0x0}, {0x884f,0x5608}, {0x8850,0x560e}, {0x8851,0x563b}, {0x8852,0x5649}, {0x8853,0x5676}, {0x8854,0x5666}, {0x8855,0x0}, {0x8856,0x566f}, {0x8857,0x5671}, {0x8858,0x5672}, {0x8859,0x5699}, {0x885a,0x569e}, {0x885b,0x56a9}, {0x885c,0x56ac}, {0x885d,0x56b3}, {0x885e,0x56c9}, {0x885f,0x56ca}, {0x8860,0x570a}, {0x8861,0x0}, {0x8862,0x5721}, {0x8863,0x572f}, {0x8864,0x5733}, {0x8865,0x5734}, {0x8866,0x5770}, {0x8867,0x5777}, {0x8868,0x577c}, {0x8869,0x579c}, {0x886a,0xfa0f}, {0x886b,0x0}, {0x886c,0x57b8}, {0x886d,0x57c7}, {0x886e,0x57c8}, {0x886f,0x57cf}, {0x8870,0x57e4}, {0x8871,0x57ed}, {0x8872,0x57f5}, {0x8873,0x57f6}, {0x8874,0x57ff}, {0x8875,0x5809}, {0x8876,0xfa10}, {0x8877,0x5861}, {0x8878,0x5864}, {0x8879,0x0}, {0x887a,0x587c}, {0x887b,0x5889}, {0x887c,0x589e}, {0x887d,0x0}, {0x887e,0x58a9}, {0x8880,0x0}, {0x8881,0x58d2}, {0x8882,0x58ce}, {0x8883,0x58d4}, {0x8884,0x58da}, {0x8885,0x58e0}, {0x8886,0x58e9}, {0x8887,0x590c}, {0x8888,0x8641}, {0x8889,0x595d}, {0x888a,0x596d}, {0x888b,0x598b}, {0x888c,0x5992}, {0x888d,0x59a4}, {0x888e,0x59c3}, {0x888f,0x59d2}, {0x8890,0x59dd}, {0x8891,0x5a13}, {0x8892,0x5a23}, {0x8893,0x5a67}, {0x8894,0x5a6d}, {0x8895,0x5a77}, {0x8896,0x5a7e}, {0x8897,0x5a84}, {0x8898,0x5a9e}, {0x8899,0x5aa7}, {0x889a,0x5ac4}, {0x889b,0x0}, {0x889c,0x5b19}, {0x889d,0x5b25}, {0x889e,0xffff}, {0x889f,0x4e9c}, {0x88a0,0x5516}, {0x88a1,0x5a03}, {0x88a2,0x963f}, {0x88a3,0x54c0}, {0x88a4,0x611b}, {0x88a5,0x6328}, {0x88a6,0x59f6}, {0x88a7,0x9022}, {0x88a8,0x8475}, {0x88a9,0x831c}, {0x88aa,0x7a50}, {0x88ab,0x60aa}, {0x88ac,0x63e1}, {0x88ad,0x6e25}, {0x88ae,0x65ed}, {0x88af,0x8466}, {0x88b0,0x82a6}, {0x88b1,0x9bf5}, {0x88b2,0x6893}, {0x88b3,0x5727}, {0x88b4,0x65a1}, {0x88b5,0x6271}, {0x88b6,0x5b9b}, {0x88b7,0x59d0}, {0x88b8,0x867b}, {0x88b9,0x98f4}, {0x88ba,0x7d62}, {0x88bb,0x7dbe}, {0x88bc,0x9b8e}, {0x88bd,0x6216}, {0x88be,0x7c9f}, {0x88bf,0x88b7}, {0x88c0,0x5b89}, {0x88c1,0x5eb5}, {0x88c2,0x6309}, {0x88c3,0x6697}, {0x88c4,0x6848}, {0x88c5,0x95c7}, {0x88c6,0x978d}, {0x88c7,0x674f}, {0x88c8,0x4ee5}, {0x88c9,0x4f0a}, {0x88ca,0x4f4d}, {0x88cb,0x4f9d}, {0x88cc,0x5049}, {0x88cd,0x56f2}, {0x88ce,0x5937}, {0x88cf,0x59d4}, {0x88d0,0x5a01}, {0x88d1,0x5c09}, {0x88d2,0x60df}, {0x88d3,0x610f}, {0x88d4,0x6170}, {0x88d5,0x6613}, {0x88d6,0x6905}, {0x88d7,0x70ba}, {0x88d8,0x754f}, {0x88d9,0x7570}, {0x88da,0x79fb}, {0x88db,0x7dad}, {0x88dc,0x7def}, {0x88dd,0x80c3}, {0x88de,0x840e}, {0x88df,0x8863}, {0x88e0,0x8b02}, {0x88e1,0x9055}, {0x88e2,0x907a}, {0x88e3,0x533b}, {0x88e4,0x4e95}, {0x88e5,0x4ea5}, {0x88e6,0x57df}, {0x88e7,0x80b2}, {0x88e8,0x90c1}, {0x88e9,0x78ef}, {0x88ea,0x4e00}, {0x88eb,0x58f1}, {0x88ec,0x6ea2}, {0x88ed,0x9038}, {0x88ee,0x7a32}, {0x88ef,0x8328}, {0x88f0,0x828b}, {0x88f1,0x9c2f}, {0x88f2,0x5141}, {0x88f3,0x5370}, {0x88f4,0x54bd}, {0x88f5,0x54e1}, {0x88f6,0x56e0}, {0x88f7,0x59fb}, {0x88f8,0x5f15}, {0x88f9,0x98f2}, {0x88fa,0x6deb}, {0x88fb,0x80e4}, {0x88fc,0x852d}, {0x8940,0x9662}, {0x8941,0x9670}, {0x8942,0x96a0}, {0x8943,0x97fb}, {0x8944,0x540b}, {0x8945,0x53f3}, {0x8946,0x5b87}, {0x8947,0x70cf}, {0x8948,0x7fbd}, {0x8949,0x8fc2}, {0x894a,0x96e8}, {0x894b,0x536f}, {0x894c,0x9d5c}, {0x894d,0x7aba}, {0x894e,0x4e11}, {0x894f,0x7893}, {0x8950,0x81fc}, {0x8951,0x6e26}, {0x8952,0x5618}, {0x8953,0x5504}, {0x8954,0x6b1d}, {0x8955,0x851a}, {0x8956,0x9c3b}, {0x8957,0x59e5}, {0x8958,0x53a9}, {0x8959,0x6d66}, {0x895a,0x74dc}, {0x895b,0x958f}, {0x895c,0x5642}, {0x895d,0x4e91}, {0x895e,0x904b}, {0x895f,0x96f2}, {0x8960,0x834f}, {0x8961,0x990c}, {0x8962,0x53e1}, {0x8963,0x55b6}, {0x8964,0x5b30}, {0x8965,0x5f71}, {0x8966,0x6620}, {0x8967,0x66f3}, {0x8968,0x6804}, {0x8969,0x6c38}, {0x896a,0x6cf3}, {0x896b,0x6d29}, {0x896c,0x745b}, {0x896d,0x76c8}, {0x896e,0x7a4e}, {0x896f,0x9834}, {0x8970,0x82f1}, {0x8971,0x885b}, {0x8972,0x8a60}, {0x8973,0x92ed}, {0x8974,0x6db2}, {0x8975,0x75ab}, {0x8976,0x76ca}, {0x8977,0x99c5}, {0x8978,0x60a6}, {0x8979,0x8b01}, {0x897a,0x8d8a}, {0x897b,0x95b2}, {0x897c,0x698e}, {0x897d,0x53ad}, {0x897e,0x5186}, {0x8980,0x5712}, {0x8981,0x5830}, {0x8982,0x5944}, {0x8983,0x5bb4}, {0x8984,0x5ef6}, {0x8985,0x6028}, {0x8986,0x63a9}, {0x8987,0x63f4}, {0x8988,0x6cbf}, {0x8989,0x6f14}, {0x898a,0x708e}, {0x898b,0x7114}, {0x898c,0x7159}, {0x898d,0x71d5}, {0x898e,0x733f}, {0x898f,0x7e01}, {0x8990,0x8276}, {0x8991,0x82d1}, {0x8992,0x8597}, {0x8993,0x9060}, {0x8994,0x925b}, {0x8995,0x9d1b}, {0x8996,0x5869}, {0x8997,0x65bc}, {0x8998,0x6c5a}, {0x8999,0x7525}, {0x899a,0x51f9}, {0x899b,0x592e}, {0x899c,0x5965}, {0x899d,0x5f80}, {0x899e,0x5fdc}, {0x899f,0x62bc}, {0x89a0,0x65fa}, {0x89a1,0x6a2a}, {0x89a2,0x6b27}, {0x89a3,0x6bb4}, {0x89a4,0x738b}, {0x89a5,0x7fc1}, {0x89a6,0x8956}, {0x89a7,0x9d2c}, {0x89a8,0x9d0e}, {0x89a9,0x9ec4}, {0x89aa,0x5ca1}, {0x89ab,0x6c96}, {0x89ac,0x837b}, {0x89ad,0x5104}, {0x89ae,0x5c4b}, {0x89af,0x61b6}, {0x89b0,0x81c6}, {0x89b1,0x6876}, {0x89b2,0x7261}, {0x89b3,0x4e59}, {0x89b4,0x4ffa}, {0x89b5,0x5378}, {0x89b6,0x6069}, {0x89b7,0x6e29}, {0x89b8,0x7a4f}, {0x89b9,0x97f3}, {0x89ba,0x4e0b}, {0x89bb,0x5316}, {0x89bc,0x4eee}, {0x89bd,0x4f55}, {0x89be,0x4f3d}, {0x89bf,0x4fa1}, {0x89c0,0x4f73}, {0x89c1,0x52a0}, {0x89c2,0x53ef}, {0x89c3,0x5609}, {0x89c4,0x590f}, {0x89c5,0x5ac1}, {0x89c6,0x5bb6}, {0x89c7,0x5be1}, {0x89c8,0x79d1}, {0x89c9,0x6687}, {0x89ca,0x679c}, {0x89cb,0x67b6}, {0x89cc,0x6b4c}, {0x89cd,0x6cb3}, {0x89ce,0x706b}, {0x89cf,0x73c2}, {0x89d0,0x798d}, {0x89d1,0x79be}, {0x89d2,0x7a3c}, {0x89d3,0x7b87}, {0x89d4,0x82b1}, {0x89d5,0x82db}, {0x89d6,0x8304}, {0x89d7,0x8377}, {0x89d8,0x83ef}, {0x89d9,0x83d3}, {0x89da,0x8766}, {0x89db,0x8ab2}, {0x89dc,0x5629}, {0x89dd,0x8ca8}, {0x89de,0x8fe6}, {0x89df,0x904e}, {0x89e0,0x971e}, {0x89e1,0x868a}, {0x89e2,0x4fc4}, {0x89e3,0x5ce8}, {0x89e4,0x6211}, {0x89e5,0x7259}, {0x89e6,0x753b}, {0x89e7,0x81e5}, {0x89e8,0x82bd}, {0x89e9,0x86fe}, {0x89ea,0x8cc0}, {0x89eb,0x96c5}, {0x89ec,0x9913}, {0x89ed,0x99d5}, {0x89ee,0x4ecb}, {0x89ef,0x4f1a}, {0x89f0,0x89e3}, {0x89f1,0x56de}, {0x89f2,0x584a}, {0x89f3,0x58ca}, {0x89f4,0x5efb}, {0x89f5,0x5feb}, {0x89f6,0x602a}, {0x89f7,0x6094}, {0x89f8,0x6062}, {0x89f9,0x61d0}, {0x89fa,0x6212}, {0x89fb,0x62d0}, {0x89fc,0x6539}, {0x8a40,0x9b41}, {0x8a41,0x6666}, {0x8a42,0x68b0}, {0x8a43,0x6d77}, {0x8a44,0x7070}, {0x8a45,0x754c}, {0x8a46,0x7686}, {0x8a47,0x7d75}, {0x8a48,0x82a5}, {0x8a49,0x87f9}, {0x8a4a,0x958b}, {0x8a4b,0x968e}, {0x8a4c,0x8c9d}, {0x8a4d,0x51f1}, {0x8a4e,0x52be}, {0x8a4f,0x5916}, {0x8a50,0x54b3}, {0x8a51,0x5bb3}, {0x8a52,0x5d16}, {0x8a53,0x6168}, {0x8a54,0x6982}, {0x8a55,0x6daf}, {0x8a56,0x788d}, {0x8a57,0x84cb}, {0x8a58,0x8857}, {0x8a59,0x8a72}, {0x8a5a,0x93a7}, {0x8a5b,0x9ab8}, {0x8a5c,0x6d6c}, {0x8a5d,0x99a8}, {0x8a5e,0x86d9}, {0x8a5f,0x57a3}, {0x8a60,0x67ff}, {0x8a61,0x86ce}, {0x8a62,0x920e}, {0x8a63,0x5283}, {0x8a64,0x5687}, {0x8a65,0x5404}, {0x8a66,0x5ed3}, {0x8a67,0x62e1}, {0x8a68,0x64b9}, {0x8a69,0x683c}, {0x8a6a,0x6838}, {0x8a6b,0x6bbb}, {0x8a6c,0x7372}, {0x8a6d,0x78ba}, {0x8a6e,0x7a6b}, {0x8a6f,0x899a}, {0x8a70,0x89d2}, {0x8a71,0x8d6b}, {0x8a72,0x8f03}, {0x8a73,0x90ed}, {0x8a74,0x95a3}, {0x8a75,0x9694}, {0x8a76,0x9769}, {0x8a77,0x5b66}, {0x8a78,0x5cb3}, {0x8a79,0x697d}, {0x8a7a,0x984d}, {0x8a7b,0x984e}, {0x8a7c,0x639b}, {0x8a7d,0x7b20}, {0x8a7e,0x6a2b}, {0x8a80,0x6a7f}, {0x8a81,0x68b6}, {0x8a82,0x9c0d}, {0x8a83,0x6f5f}, {0x8a84,0x5272}, {0x8a85,0x559d}, {0x8a86,0x6070}, {0x8a87,0x62ec}, {0x8a88,0x6d3b}, {0x8a89,0x6e07}, {0x8a8a,0x6ed1}, {0x8a8b,0x845b}, {0x8a8c,0x8910}, {0x8a8d,0x8f44}, {0x8a8e,0x4e14}, {0x8a8f,0x9c39}, {0x8a90,0x53f6}, {0x8a91,0x691b}, {0x8a92,0x6a3a}, {0x8a93,0x9784}, {0x8a94,0x682a}, {0x8a95,0x515c}, {0x8a96,0x7ac3}, {0x8a97,0x84b2}, {0x8a98,0x91dc}, {0x8a99,0x938c}, {0x8a9a,0x565b}, {0x8a9b,0x9d28}, {0x8a9c,0x6822}, {0x8a9d,0x8305}, {0x8a9e,0x8431}, {0x8a9f,0x7ca5}, {0x8aa0,0x5208}, {0x8aa1,0x82c5}, {0x8aa2,0x74e6}, {0x8aa3,0x4e7e}, {0x8aa4,0x4f83}, {0x8aa5,0x51a0}, {0x8aa6,0x5bd2}, {0x8aa7,0x520a}, {0x8aa8,0x52d8}, {0x8aa9,0x52e7}, {0x8aaa,0x5dfb}, {0x8aab,0x559a}, {0x8aac,0x582a}, {0x8aad,0x59e6}, {0x8aae,0x5b8c}, {0x8aaf,0x5b98}, {0x8ab0,0x5bdb}, {0x8ab1,0x5e72}, {0x8ab2,0x5e79}, {0x8ab3,0x60a3}, {0x8ab4,0x611f}, {0x8ab5,0x6163}, {0x8ab6,0x61be}, {0x8ab7,0x63db}, {0x8ab8,0x6562}, {0x8ab9,0x67d1}, {0x8aba,0x6853}, {0x8abb,0x68fa}, {0x8abc,0x6b3e}, {0x8abd,0x6b53}, {0x8abe,0x6c57}, {0x8abf,0x6f22}, {0x8ac0,0x6f97}, {0x8ac1,0x6f45}, {0x8ac2,0x74b0}, {0x8ac3,0x7518}, {0x8ac4,0x76e3}, {0x8ac5,0x770b}, {0x8ac6,0x7aff}, {0x8ac7,0x7ba1}, {0x8ac8,0x7c21}, {0x8ac9,0x7de9}, {0x8aca,0x7f36}, {0x8acb,0x7ff0}, {0x8acc,0x809d}, {0x8acd,0x8266}, {0x8ace,0x839e}, {0x8acf,0x89b3}, {0x8ad0,0x8acc}, {0x8ad1,0x8cab}, {0x8ad2,0x9084}, {0x8ad3,0x9451}, {0x8ad4,0x9593}, {0x8ad5,0x9591}, {0x8ad6,0x95a2}, {0x8ad7,0x9665}, {0x8ad8,0x97d3}, {0x8ad9,0x9928}, {0x8ada,0x8218}, {0x8adb,0x4e38}, {0x8adc,0x542b}, {0x8add,0x5cb8}, {0x8ade,0x5dcc}, {0x8adf,0x73a9}, {0x8ae0,0x764c}, {0x8ae1,0x773c}, {0x8ae2,0x5ca9}, {0x8ae3,0x7feb}, {0x8ae4,0x8d0b}, {0x8ae5,0x96c1}, {0x8ae6,0x9811}, {0x8ae7,0x9854}, {0x8ae8,0x9858}, {0x8ae9,0x4f01}, {0x8aea,0x4f0e}, {0x8aeb,0x5371}, {0x8aec,0x559c}, {0x8aed,0x5668}, {0x8aee,0x57fa}, {0x8aef,0x5947}, {0x8af0,0x5b09}, {0x8af1,0x5bc4}, {0x8af2,0x5c90}, {0x8af3,0x5e0c}, {0x8af4,0x5e7e}, {0x8af5,0x5fcc}, {0x8af6,0x63ee}, {0x8af7,0x673a}, {0x8af8,0x65d7}, {0x8af9,0x65e2}, {0x8afa,0x671f}, {0x8afb,0x68cb}, {0x8afc,0x68c4}, {0x8b40,0x6a5f}, {0x8b41,0x5e30}, {0x8b42,0x6bc5}, {0x8b43,0x6c17}, {0x8b44,0x6c7d}, {0x8b45,0x757f}, {0x8b46,0x7948}, {0x8b47,0x5b63}, {0x8b48,0x7a00}, {0x8b49,0x7d00}, {0x8b4a,0x5fbd}, {0x8b4b,0x898f}, {0x8b4c,0x8a18}, {0x8b4d,0x8cb4}, {0x8b4e,0x8d77}, {0x8b4f,0x8ecc}, {0x8b50,0x8f1d}, {0x8b51,0x98e2}, {0x8b52,0x9a0e}, {0x8b53,0x9b3c}, {0x8b54,0x4e80}, {0x8b55,0x507d}, {0x8b56,0x5100}, {0x8b57,0x5993}, {0x8b58,0x5b9c}, {0x8b59,0x622f}, {0x8b5a,0x6280}, {0x8b5b,0x64ec}, {0x8b5c,0x6b3a}, {0x8b5d,0x72a0}, {0x8b5e,0x7591}, {0x8b5f,0x7947}, {0x8b60,0x7fa9}, {0x8b61,0x87fb}, {0x8b62,0x8abc}, {0x8b63,0x8b70}, {0x8b64,0x63ac}, {0x8b65,0x83ca}, {0x8b66,0x97a0}, {0x8b67,0x5409}, {0x8b68,0x5403}, {0x8b69,0x55ab}, {0x8b6a,0x6854}, {0x8b6b,0x6a58}, {0x8b6c,0x8a70}, {0x8b6d,0x7827}, {0x8b6e,0x6775}, {0x8b6f,0x9ecd}, {0x8b70,0x5374}, {0x8b71,0x5ba2}, {0x8b72,0x811a}, {0x8b73,0x8650}, {0x8b74,0x9006}, {0x8b75,0x4e18}, {0x8b76,0x4e45}, {0x8b77,0x4ec7}, {0x8b78,0x4f11}, {0x8b79,0x53ca}, {0x8b7a,0x5438}, {0x8b7b,0x5bae}, {0x8b7c,0x5f13}, {0x8b7d,0x6025}, {0x8b7e,0x6551}, {0x8b80,0x673d}, {0x8b81,0x6c42}, {0x8b82,0x6c72}, {0x8b83,0x6ce3}, {0x8b84,0x7078}, {0x8b85,0x7403}, {0x8b86,0x7a76}, {0x8b87,0x7aae}, {0x8b88,0x7b08}, {0x8b89,0x7d1a}, {0x8b8a,0x7cfe}, {0x8b8b,0x7d66}, {0x8b8c,0x65e7}, {0x8b8d,0x725b}, {0x8b8e,0x53bb}, {0x8b8f,0x5c45}, {0x8b90,0x5de8}, {0x8b91,0x62d2}, {0x8b92,0x62e0}, {0x8b93,0x6319}, {0x8b94,0x6e20}, {0x8b95,0x865a}, {0x8b96,0x8a31}, {0x8b97,0x8ddd}, {0x8b98,0x92f8}, {0x8b99,0x6f01}, {0x8b9a,0x79a6}, {0x8b9b,0x9b5a}, {0x8b9c,0x4ea8}, {0x8b9d,0x4eab}, {0x8b9e,0x4eac}, {0x8b9f,0x4f9b}, {0x8ba0,0x4fa0}, {0x8ba1,0x50d1}, {0x8ba2,0x5147}, {0x8ba3,0x7af6}, {0x8ba4,0x5171}, {0x8ba5,0x51f6}, {0x8ba6,0x5354}, {0x8ba7,0x5321}, {0x8ba8,0x537f}, {0x8ba9,0x53eb}, {0x8baa,0x55ac}, {0x8bab,0x5883}, {0x8bac,0x5ce1}, {0x8bad,0x5f37}, {0x8bae,0x5f4a}, {0x8baf,0x602f}, {0x8bb0,0x6050}, {0x8bb1,0x606d}, {0x8bb2,0x631f}, {0x8bb3,0x6559}, {0x8bb4,0x6a4b}, {0x8bb5,0x6cc1}, {0x8bb6,0x72c2}, {0x8bb7,0x72ed}, {0x8bb8,0x77ef}, {0x8bb9,0x80f8}, {0x8bba,0x8105}, {0x8bbb,0x8208}, {0x8bbc,0x854e}, {0x8bbd,0x90f7}, {0x8bbe,0x93e1}, {0x8bbf,0x97ff}, {0x8bc0,0x9957}, {0x8bc1,0x9a5a}, {0x8bc2,0x4ef0}, {0x8bc3,0x51dd}, {0x8bc4,0x5c2d}, {0x8bc5,0x6681}, {0x8bc6,0x696d}, {0x8bc7,0x5c40}, {0x8bc8,0x66f2}, {0x8bc9,0x6975}, {0x8bca,0x7389}, {0x8bcb,0x6850}, {0x8bcc,0x7c81}, {0x8bcd,0x50c5}, {0x8bce,0x52e4}, {0x8bcf,0x5747}, {0x8bd0,0x5dfe}, {0x8bd1,0x9326}, {0x8bd2,0x65a4}, {0x8bd3,0x6b23}, {0x8bd4,0x6b3d}, {0x8bd5,0x7434}, {0x8bd6,0x7981}, {0x8bd7,0x79bd}, {0x8bd8,0x7b4b}, {0x8bd9,0x7dca}, {0x8bda,0x82b9}, {0x8bdb,0x83cc}, {0x8bdc,0x887f}, {0x8bdd,0x895f}, {0x8bde,0x8b39}, {0x8bdf,0x8fd1}, {0x8be0,0x91d1}, {0x8be1,0x541f}, {0x8be2,0x9280}, {0x8be3,0x4e5d}, {0x8be4,0x5036}, {0x8be5,0x53e5}, {0x8be6,0x533a}, {0x8be7,0x72d7}, {0x8be8,0x7396}, {0x8be9,0x77e9}, {0x8bea,0x82e6}, {0x8beb,0x8eaf}, {0x8bec,0x99c6}, {0x8bed,0x99c8}, {0x8bee,0x99d2}, {0x8bef,0x5177}, {0x8bf0,0x611a}, {0x8bf1,0x865e}, {0x8bf2,0x55b0}, {0x8bf3,0x7a7a}, {0x8bf4,0x5076}, {0x8bf5,0x5bd3}, {0x8bf6,0x9047}, {0x8bf7,0x9685}, {0x8bf8,0x4e32}, {0x8bf9,0x6adb}, {0x8bfa,0x91e7}, {0x8bfb,0x5c51}, {0x8bfc,0x5c48}, {0x8c40,0x6398}, {0x8c41,0x7a9f}, {0x8c42,0x6c93}, {0x8c43,0x9774}, {0x8c44,0x8f61}, {0x8c45,0x7aaa}, {0x8c46,0x718a}, {0x8c47,0x9688}, {0x8c48,0x7c82}, {0x8c49,0x6817}, {0x8c4a,0x7e70}, {0x8c4b,0x6851}, {0x8c4c,0x936c}, {0x8c4d,0x52f2}, {0x8c4e,0x541b}, {0x8c4f,0x85ab}, {0x8c50,0x8a13}, {0x8c51,0x7fa4}, {0x8c52,0x8ecd}, {0x8c53,0x90e1}, {0x8c54,0x5366}, {0x8c55,0x8888}, {0x8c56,0x7941}, {0x8c57,0x4fc2}, {0x8c58,0x50be}, {0x8c59,0x5211}, {0x8c5a,0x5144}, {0x8c5b,0x5553}, {0x8c5c,0x572d}, {0x8c5d,0x73ea}, {0x8c5e,0x578b}, {0x8c5f,0x5951}, {0x8c60,0x5f62}, {0x8c61,0x5f84}, {0x8c62,0x6075}, {0x8c63,0x6176}, {0x8c64,0x6167}, {0x8c65,0x61a9}, {0x8c66,0x63b2}, {0x8c67,0x643a}, {0x8c68,0x656c}, {0x8c69,0x666f}, {0x8c6a,0x6842}, {0x8c6b,0x6e13}, {0x8c6c,0x7566}, {0x8c6d,0x7a3d}, {0x8c6e,0x7cfb}, {0x8c6f,0x7d4c}, {0x8c70,0x7d99}, {0x8c71,0x7e4b}, {0x8c72,0x7f6b}, {0x8c73,0x830e}, {0x8c74,0x834a}, {0x8c75,0x86cd}, {0x8c76,0x8a08}, {0x8c77,0x8a63}, {0x8c78,0x8b66}, {0x8c79,0x8efd}, {0x8c7a,0x981a}, {0x8c7b,0x9d8f}, {0x8c7c,0x82b8}, {0x8c7d,0x8fce}, {0x8c7e,0x9be8}, {0x8c80,0x5287}, {0x8c81,0x621f}, {0x8c82,0x6483}, {0x8c83,0x6fc0}, {0x8c84,0x9699}, {0x8c85,0x6841}, {0x8c86,0x5091}, {0x8c87,0x6b20}, {0x8c88,0x6c7a}, {0x8c89,0x6f54}, {0x8c8a,0x7a74}, {0x8c8b,0x7d50}, {0x8c8c,0x8840}, {0x8c8d,0x8a23}, {0x8c8e,0x6708}, {0x8c8f,0x4ef6}, {0x8c90,0x5039}, {0x8c91,0x5026}, {0x8c92,0x5065}, {0x8c93,0x517c}, {0x8c94,0x5238}, {0x8c95,0x5263}, {0x8c96,0x55a7}, {0x8c97,0x570f}, {0x8c98,0x5805}, {0x8c99,0x5acc}, {0x8c9a,0x5efa}, {0x8c9b,0x61b2}, {0x8c9c,0x61f8}, {0x8c9d,0x62f3}, {0x8c9e,0x6372}, {0x8c9f,0x691c}, {0x8ca0,0x6a29}, {0x8ca1,0x727d}, {0x8ca2,0x72ac}, {0x8ca3,0x732e}, {0x8ca4,0x7814}, {0x8ca5,0x786f}, {0x8ca6,0x7d79}, {0x8ca7,0x770c}, {0x8ca8,0x80a9}, {0x8ca9,0x898b}, {0x8caa,0x8b19}, {0x8cab,0x8ce2}, {0x8cac,0x8ed2}, {0x8cad,0x9063}, {0x8cae,0x9375}, {0x8caf,0x967a}, {0x8cb0,0x9855}, {0x8cb1,0x9a13}, {0x8cb2,0x9e78}, {0x8cb3,0x5143}, {0x8cb4,0x539f}, {0x8cb5,0x53b3}, {0x8cb6,0x5e7b}, {0x8cb7,0x5f26}, {0x8cb8,0x6e1b}, {0x8cb9,0x6e90}, {0x8cba,0x7384}, {0x8cbb,0x73fe}, {0x8cbc,0x7d43}, {0x8cbd,0x8237}, {0x8cbe,0x8a00}, {0x8cbf,0x8afa}, {0x8cc0,0x9650}, {0x8cc1,0x4e4e}, {0x8cc2,0x500b}, {0x8cc3,0x53e4}, {0x8cc4,0x547c}, {0x8cc5,0x56fa}, {0x8cc6,0x59d1}, {0x8cc7,0x5b64}, {0x8cc8,0x5df1}, {0x8cc9,0x5eab}, {0x8cca,0x5f27}, {0x8ccb,0x6238}, {0x8ccc,0x6545}, {0x8ccd,0x67af}, {0x8cce,0x6e56}, {0x8ccf,0x72d0}, {0x8cd0,0x7cca}, {0x8cd1,0x88b4}, {0x8cd2,0x80a1}, {0x8cd3,0x80e1}, {0x8cd4,0x83f0}, {0x8cd5,0x864e}, {0x8cd6,0x8a87}, {0x8cd7,0x8de8}, {0x8cd8,0x9237}, {0x8cd9,0x96c7}, {0x8cda,0x9867}, {0x8cdb,0x9f13}, {0x8cdc,0x4e94}, {0x8cdd,0x4e92}, {0x8cde,0x4f0d}, {0x8cdf,0x5348}, {0x8ce0,0x5449}, {0x8ce1,0x543e}, {0x8ce2,0x5a2f}, {0x8ce3,0x5f8c}, {0x8ce4,0x5fa1}, {0x8ce5,0x609f}, {0x8ce6,0x68a7}, {0x8ce7,0x6a8e}, {0x8ce8,0x745a}, {0x8ce9,0x7881}, {0x8cea,0x8a9e}, {0x8ceb,0x8aa4}, {0x8cec,0x8b77}, {0x8ced,0x9190}, {0x8cee,0x4e5e}, {0x8cef,0x9bc9}, {0x8cf0,0x4ea4}, {0x8cf1,0x4f7c}, {0x8cf2,0x4faf}, {0x8cf3,0x5019}, {0x8cf4,0x5016}, {0x8cf5,0x5149}, {0x8cf6,0x516c}, {0x8cf7,0x529f}, {0x8cf8,0x52b9}, {0x8cf9,0x52fe}, {0x8cfa,0x539a}, {0x8cfb,0x53e3}, {0x8cfc,0x5411}, {0x8d40,0x540e}, {0x8d41,0x5589}, {0x8d42,0x5751}, {0x8d43,0x57a2}, {0x8d44,0x597d}, {0x8d45,0x5b54}, {0x8d46,0x5b5d}, {0x8d47,0x5b8f}, {0x8d48,0x5de5}, {0x8d49,0x5de7}, {0x8d4a,0x5df7}, {0x8d4b,0x5e78}, {0x8d4c,0x5e83}, {0x8d4d,0x5e9a}, {0x8d4e,0x5eb7}, {0x8d4f,0x5f18}, {0x8d50,0x6052}, {0x8d51,0x614c}, {0x8d52,0x6297}, {0x8d53,0x62d8}, {0x8d54,0x63a7}, {0x8d55,0x653b}, {0x8d56,0x6602}, {0x8d57,0x6643}, {0x8d58,0x66f4}, {0x8d59,0x676d}, {0x8d5a,0x6821}, {0x8d5b,0x6897}, {0x8d5c,0x69cb}, {0x8d5d,0x6c5f}, {0x8d5e,0x6d2a}, {0x8d5f,0x6d69}, {0x8d60,0x6e2f}, {0x8d61,0x6e9d}, {0x8d62,0x7532}, {0x8d63,0x7687}, {0x8d64,0x786c}, {0x8d65,0x7a3f}, {0x8d66,0x7ce0}, {0x8d67,0x7d05}, {0x8d68,0x7d18}, {0x8d69,0x7d5e}, {0x8d6a,0x7db1}, {0x8d6b,0x8015}, {0x8d6c,0x8003}, {0x8d6d,0x80af}, {0x8d6e,0x80b1}, {0x8d6f,0x8154}, {0x8d70,0x818f}, {0x8d71,0x822a}, {0x8d72,0x8352}, {0x8d73,0x884c}, {0x8d74,0x8861}, {0x8d75,0x8b1b}, {0x8d76,0x8ca2}, {0x8d77,0x8cfc}, {0x8d78,0x90ca}, {0x8d79,0x9175}, {0x8d7a,0x9271}, {0x8d7b,0x783f}, {0x8d7c,0x92fc}, {0x8d7d,0x95a4}, {0x8d7e,0x964d}, {0x8d80,0x9805}, {0x8d81,0x9999}, {0x8d82,0x9ad8}, {0x8d83,0x9d3b}, {0x8d84,0x525b}, {0x8d85,0x52ab}, {0x8d86,0x53f7}, {0x8d87,0x5408}, {0x8d88,0x58d5}, {0x8d89,0x62f7}, {0x8d8a,0x6fe0}, {0x8d8b,0x8c6a}, {0x8d8c,0x8f5f}, {0x8d8d,0x9eb9}, {0x8d8e,0x514b}, {0x8d8f,0x523b}, {0x8d90,0x544a}, {0x8d91,0x56fd}, {0x8d92,0x7a40}, {0x8d93,0x9177}, {0x8d94,0x9d60}, {0x8d95,0x9ed2}, {0x8d96,0x7344}, {0x8d97,0x6f09}, {0x8d98,0x8170}, {0x8d99,0x7511}, {0x8d9a,0x5ffd}, {0x8d9b,0x60da}, {0x8d9c,0x9aa8}, {0x8d9d,0x72db}, {0x8d9e,0x8fbc}, {0x8d9f,0x6b64}, {0x8da0,0x9803}, {0x8da1,0x4eca}, {0x8da2,0x56f0}, {0x8da3,0x5764}, {0x8da4,0x58be}, {0x8da5,0x5a5a}, {0x8da6,0x6068}, {0x8da7,0x61c7}, {0x8da8,0x660f}, {0x8da9,0x6606}, {0x8daa,0x6839}, {0x8dab,0x68b1}, {0x8dac,0x6df7}, {0x8dad,0x75d5}, {0x8dae,0x7d3a}, {0x8daf,0x826e}, {0x8db0,0x9b42}, {0x8db1,0x4e9b}, {0x8db2,0x4f50}, {0x8db3,0x53c9}, {0x8db4,0x5506}, {0x8db5,0x5d6f}, {0x8db6,0x5de6}, {0x8db7,0x5dee}, {0x8db8,0x67fb}, {0x8db9,0x6c99}, {0x8dba,0x7473}, {0x8dbb,0x7802}, {0x8dbc,0x8a50}, {0x8dbd,0x9396}, {0x8dbe,0x88df}, {0x8dbf,0x5750}, {0x8dc0,0x5ea7}, {0x8dc1,0x632b}, {0x8dc2,0x50b5}, {0x8dc3,0x50ac}, {0x8dc4,0x518d}, {0x8dc5,0x6700}, {0x8dc6,0x54c9}, {0x8dc7,0x585e}, {0x8dc8,0x59bb}, {0x8dc9,0x5bb0}, {0x8dca,0x5f69}, {0x8dcb,0x624d}, {0x8dcc,0x63a1}, {0x8dcd,0x683d}, {0x8dce,0x6b73}, {0x8dcf,0x6e08}, {0x8dd0,0x707d}, {0x8dd1,0x91c7}, {0x8dd2,0x7280}, {0x8dd3,0x7815}, {0x8dd4,0x7826}, {0x8dd5,0x796d}, {0x8dd6,0x658e}, {0x8dd7,0x7d30}, {0x8dd8,0x83dc}, {0x8dd9,0x88c1}, {0x8dda,0x8f09}, {0x8ddb,0x969b}, {0x8ddc,0x5264}, {0x8ddd,0x5728}, {0x8dde,0x6750}, {0x8ddf,0x7f6a}, {0x8de0,0x8ca1}, {0x8de1,0x51b4}, {0x8de2,0x5742}, {0x8de3,0x962a}, {0x8de4,0x583a}, {0x8de5,0x698a}, {0x8de6,0x80b4}, {0x8de7,0x54b2}, {0x8de8,0x5d0e}, {0x8de9,0x57fc}, {0x8dea,0x7895}, {0x8deb,0x9dfa}, {0x8dec,0x4f5c}, {0x8ded,0x524a}, {0x8dee,0x548b}, {0x8def,0x643e}, {0x8df0,0x6628}, {0x8df1,0x6714}, {0x8df2,0x67f5}, {0x8df3,0x7a84}, {0x8df4,0x7b56}, {0x8df5,0x7d22}, {0x8df6,0x932f}, {0x8df7,0x685c}, {0x8df8,0x9bad}, {0x8df9,0x7b39}, {0x8dfa,0x5319}, {0x8dfb,0x518a}, {0x8dfc,0x5237}, {0x8e40,0x5bdf}, {0x8e41,0x62f6}, {0x8e42,0x64ae}, {0x8e43,0x64e6}, {0x8e44,0x672d}, {0x8e45,0x6bba}, {0x8e46,0x85a9}, {0x8e47,0x96d1}, {0x8e48,0x7690}, {0x8e49,0x9bd6}, {0x8e4a,0x634c}, {0x8e4b,0x9306}, {0x8e4c,0x9bab}, {0x8e4d,0x76bf}, {0x8e4e,0x6652}, {0x8e4f,0x4e09}, {0x8e50,0x5098}, {0x8e51,0x53c2}, {0x8e52,0x5c71}, {0x8e53,0x60e8}, {0x8e54,0x6492}, {0x8e55,0x6563}, {0x8e56,0x685f}, {0x8e57,0x71e6}, {0x8e58,0x73ca}, {0x8e59,0x7523}, {0x8e5a,0x7b97}, {0x8e5b,0x7e82}, {0x8e5c,0x8695}, {0x8e5d,0x8b83}, {0x8e5e,0x8cdb}, {0x8e5f,0x9178}, {0x8e60,0x9910}, {0x8e61,0x65ac}, {0x8e62,0x66ab}, {0x8e63,0x6b8b}, {0x8e64,0x4ed5}, {0x8e65,0x4ed4}, {0x8e66,0x4f3a}, {0x8e67,0x4f7f}, {0x8e68,0x523a}, {0x8e69,0x53f8}, {0x8e6a,0x53f2}, {0x8e6b,0x55e3}, {0x8e6c,0x56db}, {0x8e6d,0x58eb}, {0x8e6e,0x59cb}, {0x8e6f,0x59c9}, {0x8e70,0x59ff}, {0x8e71,0x5b50}, {0x8e72,0x5c4d}, {0x8e73,0x5e02}, {0x8e74,0x5e2b}, {0x8e75,0x5fd7}, {0x8e76,0x601d}, {0x8e77,0x6307}, {0x8e78,0x652f}, {0x8e79,0x5b5c}, {0x8e7a,0x65af}, {0x8e7b,0x65bd}, {0x8e7c,0x65e8}, {0x8e7d,0x679d}, {0x8e7e,0x6b62}, {0x8e80,0x6b7b}, {0x8e81,0x6c0f}, {0x8e82,0x7345}, {0x8e83,0x7949}, {0x8e84,0x79c1}, {0x8e85,0x7cf8}, {0x8e86,0x7d19}, {0x8e87,0x7d2b}, {0x8e88,0x80a2}, {0x8e89,0x8102}, {0x8e8a,0x81f3}, {0x8e8b,0x8996}, {0x8e8c,0x8a5e}, {0x8e8d,0x8a69}, {0x8e8e,0x8a66}, {0x8e8f,0x8a8c}, {0x8e90,0x8aee}, {0x8e91,0x8cc7}, {0x8e92,0x8cdc}, {0x8e93,0x96cc}, {0x8e94,0x98fc}, {0x8e95,0x6b6f}, {0x8e96,0x4e8b}, {0x8e97,0x4f3c}, {0x8e98,0x4f8d}, {0x8e99,0x5150}, {0x8e9a,0x5b57}, {0x8e9b,0x5bfa}, {0x8e9c,0x6148}, {0x8e9d,0x6301}, {0x8e9e,0x6642}, {0x8e9f,0x6b21}, {0x8ea0,0x6ecb}, {0x8ea1,0x6cbb}, {0x8ea2,0x723e}, {0x8ea3,0x74bd}, {0x8ea4,0x75d4}, {0x8ea5,0x78c1}, {0x8ea6,0x793a}, {0x8ea7,0x800c}, {0x8ea8,0x8033}, {0x8ea9,0x81ea}, {0x8eaa,0x8494}, {0x8eab,0x8f9e}, {0x8eac,0x6c50}, {0x8ead,0x9e7f}, {0x8eae,0x5f0f}, {0x8eaf,0x8b58}, {0x8eb0,0x9d2b}, {0x8eb1,0x7afa}, {0x8eb2,0x8ef8}, {0x8eb3,0x5b8d}, {0x8eb4,0x96eb}, {0x8eb5,0x4e03}, {0x8eb6,0x53f1}, {0x8eb7,0x57f7}, {0x8eb8,0x5931}, {0x8eb9,0x5ac9}, {0x8eba,0x5ba4}, {0x8ebb,0x6089}, {0x8ebc,0x6e7f}, {0x8ebd,0x6f06}, {0x8ebe,0x75be}, {0x8ebf,0x8cea}, {0x8ec0,0x5b9f}, {0x8ec1,0x8500}, {0x8ec2,0x7be0}, {0x8ec3,0x5072}, {0x8ec4,0x67f4}, {0x8ec5,0x829d}, {0x8ec6,0x5c61}, {0x8ec7,0x854a}, {0x8ec8,0x7e1e}, {0x8ec9,0x820e}, {0x8eca,0x5199}, {0x8ecb,0x5c04}, {0x8ecc,0x6368}, {0x8ecd,0x8d66}, {0x8ece,0x659c}, {0x8ecf,0x716e}, {0x8ed0,0x793e}, {0x8ed1,0x7d17}, {0x8ed2,0x8005}, {0x8ed3,0x8b1d}, {0x8ed4,0x8eca}, {0x8ed5,0x906e}, {0x8ed6,0x86c7}, {0x8ed7,0x90aa}, {0x8ed8,0x501f}, {0x8ed9,0x52fa}, {0x8eda,0x5c3a}, {0x8edb,0x6753}, {0x8edc,0x707c}, {0x8edd,0x7235}, {0x8ede,0x914c}, {0x8edf,0x91c8}, {0x8ee0,0x932b}, {0x8ee1,0x82e5}, {0x8ee2,0x5bc2}, {0x8ee3,0x5f31}, {0x8ee4,0x60f9}, {0x8ee5,0x4e3b}, {0x8ee6,0x53d6}, {0x8ee7,0x5b88}, {0x8ee8,0x624b}, {0x8ee9,0x6731}, {0x8eea,0x6b8a}, {0x8eeb,0x72e9}, {0x8eec,0x73e0}, {0x8eed,0x7a2e}, {0x8eee,0x816b}, {0x8eef,0x8da3}, {0x8ef0,0x9152}, {0x8ef1,0x9996}, {0x8ef2,0x5112}, {0x8ef3,0x53d7}, {0x8ef4,0x546a}, {0x8ef5,0x5bff}, {0x8ef6,0x6388}, {0x8ef7,0x6a39}, {0x8ef8,0x7dac}, {0x8ef9,0x9700}, {0x8efa,0x56da}, {0x8efb,0x53ce}, {0x8efc,0x5468}, {0x8f40,0x5b97}, {0x8f41,0x5c31}, {0x8f42,0x5dde}, {0x8f43,0x4fee}, {0x8f44,0x6101}, {0x8f45,0x62fe}, {0x8f46,0x6d32}, {0x8f47,0x79c0}, {0x8f48,0x79cb}, {0x8f49,0x7d42}, {0x8f4a,0x7e4d}, {0x8f4b,0x7fd2}, {0x8f4c,0x81ed}, {0x8f4d,0x821f}, {0x8f4e,0x8490}, {0x8f4f,0x8846}, {0x8f50,0x8972}, {0x8f51,0x8b90}, {0x8f52,0x8e74}, {0x8f53,0x8f2f}, {0x8f54,0x9031}, {0x8f55,0x914b}, {0x8f56,0x916c}, {0x8f57,0x96c6}, {0x8f58,0x919c}, {0x8f59,0x4ec0}, {0x8f5a,0x4f4f}, {0x8f5b,0x5145}, {0x8f5c,0x5341}, {0x8f5d,0x5f93}, {0x8f5e,0x620e}, {0x8f5f,0x67d4}, {0x8f60,0x6c41}, {0x8f61,0x6e0b}, {0x8f62,0x7363}, {0x8f63,0x7e26}, {0x8f64,0x91cd}, {0x8f65,0x9283}, {0x8f66,0x53d4}, {0x8f67,0x5919}, {0x8f68,0x5bbf}, {0x8f69,0x6dd1}, {0x8f6a,0x795d}, {0x8f6b,0x7e2e}, {0x8f6c,0x7c9b}, {0x8f6d,0x587e}, {0x8f6e,0x719f}, {0x8f6f,0x51fa}, {0x8f70,0x8853}, {0x8f71,0x8ff0}, {0x8f72,0x4fca}, {0x8f73,0x5cfb}, {0x8f74,0x6625}, {0x8f75,0x77ac}, {0x8f76,0x7ae3}, {0x8f77,0x821c}, {0x8f78,0x99ff}, {0x8f79,0x51c6}, {0x8f7a,0x5faa}, {0x8f7b,0x65ec}, {0x8f7c,0x696f}, {0x8f7d,0x6b89}, {0x8f7e,0x6df3}, {0x8f80,0x6e96}, {0x8f81,0x6f64}, {0x8f82,0x76fe}, {0x8f83,0x7d14}, {0x8f84,0x5de1}, {0x8f85,0x9075}, {0x8f86,0x9187}, {0x8f87,0x9806}, {0x8f88,0x51e6}, {0x8f89,0x521d}, {0x8f8a,0x6240}, {0x8f8b,0x6691}, {0x8f8c,0x66d9}, {0x8f8d,0x6e1a}, {0x8f8e,0x5eb6}, {0x8f8f,0x7dd2}, {0x8f90,0x7f72}, {0x8f91,0x66f8}, {0x8f92,0x85af}, {0x8f93,0x85f7}, {0x8f94,0x8af8}, {0x8f95,0x52a9}, {0x8f96,0x53d9}, {0x8f97,0x5973}, {0x8f98,0x5e8f}, {0x8f99,0x5f90}, {0x8f9a,0x6055}, {0x8f9b,0x92e4}, {0x8f9c,0x9664}, {0x8f9d,0x50b7}, {0x8f9e,0x511f}, {0x8f9f,0x52dd}, {0x8fa0,0x5320}, {0x8fa1,0x5347}, {0x8fa2,0x53ec}, {0x8fa3,0x54e8}, {0x8fa4,0x5546}, {0x8fa5,0x5531}, {0x8fa6,0x5617}, {0x8fa7,0x5968}, {0x8fa8,0x59be}, {0x8fa9,0x5a3c}, {0x8faa,0x5bb5}, {0x8fab,0x5c06}, {0x8fac,0x5c0f}, {0x8fad,0x5c11}, {0x8fae,0x5c1a}, {0x8faf,0x5e84}, {0x8fb0,0x5e8a}, {0x8fb1,0x5ee0}, {0x8fb2,0x5f70}, {0x8fb3,0x627f}, {0x8fb4,0x6284}, {0x8fb5,0x62db}, {0x8fb6,0x638c}, {0x8fb7,0x6377}, {0x8fb8,0x6607}, {0x8fb9,0x660c}, {0x8fba,0x662d}, {0x8fbb,0x6676}, {0x8fbc,0x677e}, {0x8fbd,0x68a2}, {0x8fbe,0x6a1f}, {0x8fbf,0x6a35}, {0x8fc0,0x6cbc}, {0x8fc1,0x6d88}, {0x8fc2,0x6e09}, {0x8fc3,0x6e58}, {0x8fc4,0x713c}, {0x8fc5,0x7126}, {0x8fc6,0x7167}, {0x8fc7,0x75c7}, {0x8fc8,0x7701}, {0x8fc9,0x785d}, {0x8fca,0x7901}, {0x8fcb,0x7965}, {0x8fcc,0x79f0}, {0x8fcd,0x7ae0}, {0x8fce,0x7b11}, {0x8fcf,0x7ca7}, {0x8fd0,0x7d39}, {0x8fd1,0x8096}, {0x8fd2,0x83d6}, {0x8fd3,0x848b}, {0x8fd4,0x8549}, {0x8fd5,0x885d}, {0x8fd6,0x88f3}, {0x8fd7,0x8a1f}, {0x8fd8,0x8a3c}, {0x8fd9,0x8a54}, {0x8fda,0x8a73}, {0x8fdb,0x8c61}, {0x8fdc,0x8cde}, {0x8fdd,0x91a4}, {0x8fde,0x9266}, {0x8fdf,0x937e}, {0x8fe0,0x9418}, {0x8fe1,0x969c}, {0x8fe2,0x9798}, {0x8fe3,0x4e0a}, {0x8fe4,0x4e08}, {0x8fe5,0x4e1e}, {0x8fe6,0x4e57}, {0x8fe7,0x5197}, {0x8fe8,0x5270}, {0x8fe9,0x57ce}, {0x8fea,0x5834}, {0x8feb,0x58cc}, {0x8fec,0x5b22}, {0x8fed,0x5e38}, {0x8fee,0x60c5}, {0x8fef,0x64fe}, {0x8ff0,0x6761}, {0x8ff1,0x6756}, {0x8ff2,0x6d44}, {0x8ff3,0x72b6}, {0x8ff4,0x7573}, {0x8ff5,0x7a63}, {0x8ff6,0x84b8}, {0x8ff7,0x8b72}, {0x8ff8,0x91b8}, {0x8ff9,0x9320}, {0x8ffa,0x5631}, {0x8ffb,0x57f4}, {0x8ffc,0x98fe}, {0x9040,0x62ed}, {0x9041,0x690d}, {0x9042,0x6b96}, {0x9043,0x71ed}, {0x9044,0x7e54}, {0x9045,0x8077}, {0x9046,0x8272}, {0x9047,0x89e6}, {0x9048,0x98df}, {0x9049,0x8755}, {0x904a,0x8fb1}, {0x904b,0x5c3b}, {0x904c,0x4f38}, {0x904d,0x4fe1}, {0x904e,0x4fb5}, {0x904f,0x5507}, {0x9050,0x5a20}, {0x9051,0x5bdd}, {0x9052,0x5be9}, {0x9053,0x5fc3}, {0x9054,0x614e}, {0x9055,0x632f}, {0x9056,0x65b0}, {0x9057,0x664b}, {0x9058,0x68ee}, {0x9059,0x699b}, {0x905a,0x6d78}, {0x905b,0x6df1}, {0x905c,0x7533}, {0x905d,0x75b9}, {0x905e,0x771f}, {0x905f,0x795e}, {0x9060,0x79e6}, {0x9061,0x7d33}, {0x9062,0x81e3}, {0x9063,0x82af}, {0x9064,0x85aa}, {0x9065,0x89aa}, {0x9066,0x8a3a}, {0x9067,0x8eab}, {0x9068,0x8f9b}, {0x9069,0x9032}, {0x906a,0x91dd}, {0x906b,0x9707}, {0x906c,0x4eba}, {0x906d,0x4ec1}, {0x906e,0x5203}, {0x906f,0x5875}, {0x9070,0x58ec}, {0x9071,0x5c0b}, {0x9072,0x751a}, {0x9073,0x5c3d}, {0x9074,0x814e}, {0x9075,0x8a0a}, {0x9076,0x8fc5}, {0x9077,0x9663}, {0x9078,0x976d}, {0x9079,0x7b25}, {0x907a,0x8acf}, {0x907b,0x9808}, {0x907c,0x9162}, {0x907d,0x56f3}, {0x907e,0x53a8}, {0x9080,0x9017}, {0x9081,0x5439}, {0x9082,0x5782}, {0x9083,0x5e25}, {0x9084,0x63a8}, {0x9085,0x6c34}, {0x9086,0x708a}, {0x9087,0x7761}, {0x9088,0x7c8b}, {0x9089,0x7fe0}, {0x908a,0x8870}, {0x908b,0x9042}, {0x908c,0x9154}, {0x908d,0x9310}, {0x908e,0x9318}, {0x908f,0x968f}, {0x9090,0x745e}, {0x9091,0x9ac4}, {0x9092,0x5d07}, {0x9093,0x5d69}, {0x9094,0x6570}, {0x9095,0x67a2}, {0x9096,0x8da8}, {0x9097,0x96db}, {0x9098,0x636e}, {0x9099,0x6749}, {0x909a,0x6919}, {0x909b,0x83c5}, {0x909c,0x9817}, {0x909d,0x96c0}, {0x909e,0x88fe}, {0x909f,0x6f84}, {0x90a0,0x647a}, {0x90a1,0x5bf8}, {0x90a2,0x4e16}, {0x90a3,0x702c}, {0x90a4,0x755d}, {0x90a5,0x662f}, {0x90a6,0x51c4}, {0x90a7,0x5236}, {0x90a8,0x52e2}, {0x90a9,0x59d3}, {0x90aa,0x5f81}, {0x90ab,0x6027}, {0x90ac,0x6210}, {0x90ad,0x653f}, {0x90ae,0x6574}, {0x90af,0x661f}, {0x90b0,0x6674}, {0x90b1,0x68f2}, {0x90b2,0x6816}, {0x90b3,0x6b63}, {0x90b4,0x6e05}, {0x90b5,0x7272}, {0x90b6,0x751f}, {0x90b7,0x76db}, {0x90b8,0x7cbe}, {0x90b9,0x8056}, {0x90ba,0x58f0}, {0x90bb,0x88fd}, {0x90bc,0x897f}, {0x90bd,0x8aa0}, {0x90be,0x8a93}, {0x90bf,0x8acb}, {0x90c0,0x901d}, {0x90c1,0x9192}, {0x90c2,0x9752}, {0x90c3,0x9759}, {0x90c4,0x6589}, {0x90c5,0x7a0e}, {0x90c6,0x8106}, {0x90c7,0x96bb}, {0x90c8,0x5e2d}, {0x90c9,0x60dc}, {0x90ca,0x621a}, {0x90cb,0x65a5}, {0x90cc,0x6614}, {0x90cd,0x6790}, {0x90ce,0x77f3}, {0x90cf,0x7a4d}, {0x90d0,0x7c4d}, {0x90d1,0x7e3e}, {0x90d2,0x810a}, {0x90d3,0x8cac}, {0x90d4,0x8d64}, {0x90d5,0x8de1}, {0x90d6,0x8e5f}, {0x90d7,0x78a9}, {0x90d8,0x5207}, {0x90d9,0x62d9}, {0x90da,0x63a5}, {0x90db,0x6442}, {0x90dc,0x6298}, {0x90dd,0x8a2d}, {0x90de,0x7a83}, {0x90df,0x7bc0}, {0x90e0,0x8aac}, {0x90e1,0x96ea}, {0x90e2,0x7d76}, {0x90e3,0x820c}, {0x90e4,0x8749}, {0x90e5,0x4ed9}, {0x90e6,0x5148}, {0x90e7,0x5343}, {0x90e8,0x5360}, {0x90e9,0x5ba3}, {0x90ea,0x5c02}, {0x90eb,0x5c16}, {0x90ec,0x5ddd}, {0x90ed,0x6226}, {0x90ee,0x6247}, {0x90ef,0x64b0}, {0x90f0,0x6813}, {0x90f1,0x6834}, {0x90f2,0x6cc9}, {0x90f3,0x6d45}, {0x90f4,0x6d17}, {0x90f5,0x67d3}, {0x90f6,0x6f5c}, {0x90f7,0x714e}, {0x90f8,0x717d}, {0x90f9,0x65cb}, {0x90fa,0x7a7f}, {0x90fb,0x7bad}, {0x90fc,0x7dda}, {0x9140,0x7e4a}, {0x9141,0x7fa8}, {0x9142,0x817a}, {0x9143,0x821b}, {0x9144,0x8239}, {0x9145,0x85a6}, {0x9146,0x8a6e}, {0x9147,0x8cce}, {0x9148,0x8df5}, {0x9149,0x9078}, {0x914a,0x9077}, {0x914b,0x92ad}, {0x914c,0x9291}, {0x914d,0x9583}, {0x914e,0x9bae}, {0x914f,0x524d}, {0x9150,0x5584}, {0x9151,0x6f38}, {0x9152,0x7136}, {0x9153,0x5168}, {0x9154,0x7985}, {0x9155,0x7e55}, {0x9156,0x81b3}, {0x9157,0x7cce}, {0x9158,0x564c}, {0x9159,0x5851}, {0x915a,0x5ca8}, {0x915b,0x63aa}, {0x915c,0x66fe}, {0x915d,0x66fd}, {0x915e,0x695a}, {0x915f,0x72d9}, {0x9160,0x758f}, {0x9161,0x758e}, {0x9162,0x790e}, {0x9163,0x7956}, {0x9164,0x79df}, {0x9165,0x7c97}, {0x9166,0x7d20}, {0x9167,0x7d44}, {0x9168,0x8607}, {0x9169,0x8a34}, {0x916a,0x963b}, {0x916b,0x9061}, {0x916c,0x9f20}, {0x916d,0x50e7}, {0x916e,0x5275}, {0x916f,0x53cc}, {0x9170,0x53e2}, {0x9171,0x5009}, {0x9172,0x55aa}, {0x9173,0x58ee}, {0x9174,0x594f}, {0x9175,0x723d}, {0x9176,0x5b8b}, {0x9177,0x5c64}, {0x9178,0x531d}, {0x9179,0x60e3}, {0x917a,0x60f3}, {0x917b,0x635c}, {0x917c,0x6383}, {0x917d,0x633f}, {0x917e,0x63bb}, {0x9180,0x64cd}, {0x9181,0x65e9}, {0x9182,0x66f9}, {0x9183,0x5de3}, {0x9184,0x69cd}, {0x9185,0x69fd}, {0x9186,0x6f15}, {0x9187,0x71e5}, {0x9188,0x4e89}, {0x9189,0x75e9}, {0x918a,0x76f8}, {0x918b,0x7a93}, {0x918c,0x7cdf}, {0x918d,0x7dcf}, {0x918e,0x7d9c}, {0x918f,0x8061}, {0x9190,0x8349}, {0x9191,0x8358}, {0x9192,0x846c}, {0x9193,0x84bc}, {0x9194,0x85fb}, {0x9195,0x88c5}, {0x9196,0x8d70}, {0x9197,0x9001}, {0x9198,0x906d}, {0x9199,0x9397}, {0x919a,0x971c}, {0x919b,0x9a12}, {0x919c,0x50cf}, {0x919d,0x5897}, {0x919e,0x618e}, {0x919f,0x81d3}, {0x91a0,0x8535}, {0x91a1,0x8d08}, {0x91a2,0x9020}, {0x91a3,0x4fc3}, {0x91a4,0x5074}, {0x91a5,0x5247}, {0x91a6,0x5373}, {0x91a7,0x606f}, {0x91a8,0x6349}, {0x91a9,0x675f}, {0x91aa,0x6e2c}, {0x91ab,0x8db3}, {0x91ac,0x901f}, {0x91ad,0x4fd7}, {0x91ae,0x5c5e}, {0x91af,0x8cca}, {0x91b0,0x65cf}, {0x91b1,0x7d9a}, {0x91b2,0x5352}, {0x91b3,0x8896}, {0x91b4,0x5176}, {0x91b5,0x63c3}, {0x91b6,0x5b58}, {0x91b7,0x5b6b}, {0x91b8,0x5c0a}, {0x91b9,0x640d}, {0x91ba,0x6751}, {0x91bb,0x905c}, {0x91bc,0x4ed6}, {0x91bd,0x591a}, {0x91be,0x592a}, {0x91bf,0x6c70}, {0x91c0,0x8a51}, {0x91c1,0x553e}, {0x91c2,0x5815}, {0x91c3,0x59a5}, {0x91c4,0x60f0}, {0x91c5,0x6253}, {0x91c6,0x67c1}, {0x91c7,0x8235}, {0x91c8,0x6955}, {0x91c9,0x9640}, {0x91ca,0x99c4}, {0x91cb,0x9a28}, {0x91cc,0x4f53}, {0x91cd,0x5806}, {0x91ce,0x5bfe}, {0x91cf,0x8010}, {0x91d0,0x5cb1}, {0x91d1,0x5e2f}, {0x91d2,0x5f85}, {0x91d3,0x6020}, {0x91d4,0x614b}, {0x91d5,0x6234}, {0x91d6,0x66ff}, {0x91d7,0x6cf0}, {0x91d8,0x6ede}, {0x91d9,0x80ce}, {0x91da,0x817f}, {0x91db,0x82d4}, {0x91dc,0x888b}, {0x91dd,0x8cb8}, {0x91de,0x9000}, {0x91df,0x902e}, {0x91e0,0x968a}, {0x91e1,0x9edb}, {0x91e2,0x9bdb}, {0x91e3,0x4ee3}, {0x91e4,0x53f0}, {0x91e5,0x5927}, {0x91e6,0x7b2c}, {0x91e7,0x918d}, {0x91e8,0x984c}, {0x91e9,0x9df9}, {0x91ea,0x6edd}, {0x91eb,0x7027}, {0x91ec,0x5353}, {0x91ed,0x5544}, {0x91ee,0x5b85}, {0x91ef,0x6258}, {0x91f0,0x629e}, {0x91f1,0x62d3}, {0x91f2,0x6ca2}, {0x91f3,0x6fef}, {0x91f4,0x7422}, {0x91f5,0x8a17}, {0x91f6,0x9438}, {0x91f7,0x6fc1}, {0x91f8,0x8afe}, {0x91f9,0x8338}, {0x91fa,0x51e7}, {0x91fb,0x86f8}, {0x91fc,0x53ea}, {0x9240,0x53e9}, {0x9241,0x4f46}, {0x9242,0x9054}, {0x9243,0x8fb0}, {0x9244,0x596a}, {0x9245,0x8131}, {0x9246,0x5dfd}, {0x9247,0x7aea}, {0x9248,0x8fbf}, {0x9249,0x68da}, {0x924a,0x8c37}, {0x924b,0x72f8}, {0x924c,0x9c48}, {0x924d,0x6a3d}, {0x924e,0x8ab0}, {0x924f,0x4e39}, {0x9250,0x5358}, {0x9251,0x5606}, {0x9252,0x5766}, {0x9253,0x62c5}, {0x9254,0x63a2}, {0x9255,0x65e6}, {0x9256,0x6b4e}, {0x9257,0x6de1}, {0x9258,0x6e5b}, {0x9259,0x70ad}, {0x925a,0x77ed}, {0x925b,0x7aef}, {0x925c,0x7baa}, {0x925d,0x7dbb}, {0x925e,0x803d}, {0x925f,0x80c6}, {0x9260,0x86cb}, {0x9261,0x8a95}, {0x9262,0x935b}, {0x9263,0x56e3}, {0x9264,0x58c7}, {0x9265,0x5f3e}, {0x9266,0x65ad}, {0x9267,0x6696}, {0x9268,0x6a80}, {0x9269,0x6bb5}, {0x926a,0x7537}, {0x926b,0x8ac7}, {0x926c,0x5024}, {0x926d,0x77e5}, {0x926e,0x5730}, {0x926f,0x5f1b}, {0x9270,0x6065}, {0x9271,0x667a}, {0x9272,0x6c60}, {0x9273,0x75f4}, {0x9274,0x7a1a}, {0x9275,0x7f6e}, {0x9276,0x81f4}, {0x9277,0x8718}, {0x9278,0x9045}, {0x9279,0x99b3}, {0x927a,0x7bc9}, {0x927b,0x755c}, {0x927c,0x7af9}, {0x927d,0x7b51}, {0x927e,0x84c4}, {0x9280,0x9010}, {0x9281,0x79e9}, {0x9282,0x7a92}, {0x9283,0x8336}, {0x9284,0x5ae1}, {0x9285,0x7740}, {0x9286,0x4e2d}, {0x9287,0x4ef2}, {0x9288,0x5b99}, {0x9289,0x5fe0}, {0x928a,0x62bd}, {0x928b,0x663c}, {0x928c,0x67f1}, {0x928d,0x6ce8}, {0x928e,0x866b}, {0x928f,0x8877}, {0x9290,0x8a3b}, {0x9291,0x914e}, {0x9292,0x92f3}, {0x9293,0x99d0}, {0x9294,0x6a17}, {0x9295,0x7026}, {0x9296,0x732a}, {0x9297,0x82e7}, {0x9298,0x8457}, {0x9299,0x8caf}, {0x929a,0x4e01}, {0x929b,0x5146}, {0x929c,0x51cb}, {0x929d,0x558b}, {0x929e,0x5bf5}, {0x929f,0x5e16}, {0x92a0,0x5e33}, {0x92a1,0x5e81}, {0x92a2,0x5f14}, {0x92a3,0x5f35}, {0x92a4,0x5f6b}, {0x92a5,0x5fb4}, {0x92a6,0x61f2}, {0x92a7,0x6311}, {0x92a8,0x66a2}, {0x92a9,0x671d}, {0x92aa,0x6f6e}, {0x92ab,0x7252}, {0x92ac,0x753a}, {0x92ad,0x773a}, {0x92ae,0x8074}, {0x92af,0x8139}, {0x92b0,0x8178}, {0x92b1,0x8776}, {0x92b2,0x8abf}, {0x92b3,0x8adc}, {0x92b4,0x8d85}, {0x92b5,0x8df3}, {0x92b6,0x929a}, {0x92b7,0x9577}, {0x92b8,0x9802}, {0x92b9,0x9ce5}, {0x92ba,0x52c5}, {0x92bb,0x6357}, {0x92bc,0x76f4}, {0x92bd,0x6715}, {0x92be,0x6c88}, {0x92bf,0x73cd}, {0x92c0,0x8cc3}, {0x92c1,0x93ae}, {0x92c2,0x9673}, {0x92c3,0x6d25}, {0x92c4,0x589c}, {0x92c5,0x690e}, {0x92c6,0x69cc}, {0x92c7,0x8ffd}, {0x92c8,0x939a}, {0x92c9,0x75db}, {0x92ca,0x901a}, {0x92cb,0x585a}, {0x92cc,0x6802}, {0x92cd,0x63b4}, {0x92ce,0x69fb}, {0x92cf,0x4f43}, {0x92d0,0x6f2c}, {0x92d1,0x67d8}, {0x92d2,0x8fbb}, {0x92d3,0x8526}, {0x92d4,0x7db4}, {0x92d5,0x9354}, {0x92d6,0x693f}, {0x92d7,0x6f70}, {0x92d8,0x576a}, {0x92d9,0x58f7}, {0x92da,0x5b2c}, {0x92db,0x7d2c}, {0x92dc,0x722a}, {0x92dd,0x540a}, {0x92de,0x91e3}, {0x92df,0x9db4}, {0x92e0,0x4ead}, {0x92e1,0x4f4e}, {0x92e2,0x505c}, {0x92e3,0x5075}, {0x92e4,0x5243}, {0x92e5,0x8c9e}, {0x92e6,0x5448}, {0x92e7,0x5824}, {0x92e8,0x5b9a}, {0x92e9,0x5e1d}, {0x92ea,0x5e95}, {0x92eb,0x5ead}, {0x92ec,0x5ef7}, {0x92ed,0x5f1f}, {0x92ee,0x608c}, {0x92ef,0x62b5}, {0x92f0,0x633a}, {0x92f1,0x63d0}, {0x92f2,0x68af}, {0x92f3,0x6c40}, {0x92f4,0x7887}, {0x92f5,0x798e}, {0x92f6,0x7a0b}, {0x92f7,0x7de0}, {0x92f8,0x8247}, {0x92f9,0x8a02}, {0x92fa,0x8ae6}, {0x92fb,0x8e44}, {0x92fc,0x9013}, {0x9340,0x90b8}, {0x9341,0x912d}, {0x9342,0x91d8}, {0x9343,0x9f0e}, {0x9344,0x6ce5}, {0x9345,0x6458}, {0x9346,0x64e2}, {0x9347,0x6575}, {0x9348,0x6ef4}, {0x9349,0x7684}, {0x934a,0x7b1b}, {0x934b,0x9069}, {0x934c,0x93d1}, {0x934d,0x6eba}, {0x934e,0x54f2}, {0x934f,0x5fb9}, {0x9350,0x64a4}, {0x9351,0x8f4d}, {0x9352,0x8fed}, {0x9353,0x9244}, {0x9354,0x5178}, {0x9355,0x586b}, {0x9356,0x5929}, {0x9357,0x5c55}, {0x9358,0x5e97}, {0x9359,0x6dfb}, {0x935a,0x7e8f}, {0x935b,0x751c}, {0x935c,0x8cbc}, {0x935d,0x8ee2}, {0x935e,0x985b}, {0x935f,0x70b9}, {0x9360,0x4f1d}, {0x9361,0x6bbf}, {0x9362,0x6fb1}, {0x9363,0x7530}, {0x9364,0x96fb}, {0x9365,0x514e}, {0x9366,0x5410}, {0x9367,0x5835}, {0x9368,0x5857}, {0x9369,0x59ac}, {0x936a,0x5c60}, {0x936b,0x5f92}, {0x936c,0x6597}, {0x936d,0x675c}, {0x936e,0x6e21}, {0x936f,0x767b}, {0x9370,0x83df}, {0x9371,0x8ced}, {0x9372,0x9014}, {0x9373,0x90fd}, {0x9374,0x934d}, {0x9375,0x7825}, {0x9376,0x783a}, {0x9377,0x52aa}, {0x9378,0x5ea6}, {0x9379,0x571f}, {0x937a,0x5974}, {0x937b,0x6012}, {0x937c,0x5012}, {0x937d,0x515a}, {0x937e,0x51ac}, {0x9380,0x51cd}, {0x9381,0x5200}, {0x9382,0x5510}, {0x9383,0x5854}, {0x9384,0x5858}, {0x9385,0x5957}, {0x9386,0x5b95}, {0x9387,0x5cf6}, {0x9388,0x5d8b}, {0x9389,0x60bc}, {0x938a,0x6295}, {0x938b,0x642d}, {0x938c,0x6771}, {0x938d,0x6843}, {0x938e,0x68bc}, {0x938f,0x68df}, {0x9390,0x76d7}, {0x9391,0x6dd8}, {0x9392,0x6e6f}, {0x9393,0x6d9b}, {0x9394,0x706f}, {0x9395,0x71c8}, {0x9396,0x5f53}, {0x9397,0x75d8}, {0x9398,0x7977}, {0x9399,0x7b49}, {0x939a,0x7b54}, {0x939b,0x7b52}, {0x939c,0x7cd6}, {0x939d,0x7d71}, {0x939e,0x5230}, {0x939f,0x8463}, {0x93a0,0x8569}, {0x93a1,0x85e4}, {0x93a2,0x8a0e}, {0x93a3,0x8b04}, {0x93a4,0x8c46}, {0x93a5,0x8e0f}, {0x93a6,0x9003}, {0x93a7,0x900f}, {0x93a8,0x9419}, {0x93a9,0x9676}, {0x93aa,0x982d}, {0x93ab,0x9a30}, {0x93ac,0x95d8}, {0x93ad,0x50cd}, {0x93ae,0x52d5}, {0x93af,0x540c}, {0x93b0,0x5802}, {0x93b1,0x5c0e}, {0x93b2,0x61a7}, {0x93b3,0x649e}, {0x93b4,0x6d1e}, {0x93b5,0x77b3}, {0x93b6,0x7ae5}, {0x93b7,0x80f4}, {0x93b8,0x8404}, {0x93b9,0x9053}, {0x93ba,0x9285}, {0x93bb,0x5ce0}, {0x93bc,0x9d07}, {0x93bd,0x533f}, {0x93be,0x5f97}, {0x93bf,0x5fb3}, {0x93c0,0x6d9c}, {0x93c1,0x7279}, {0x93c2,0x7763}, {0x93c3,0x79bf}, {0x93c4,0x7be4}, {0x93c5,0x6bd2}, {0x93c6,0x72ec}, {0x93c7,0x8aad}, {0x93c8,0x6803}, {0x93c9,0x6a61}, {0x93ca,0x51f8}, {0x93cb,0x7a81}, {0x93cc,0x6934}, {0x93cd,0x5c4a}, {0x93ce,0x9cf6}, {0x93cf,0x82eb}, {0x93d0,0x5bc5}, {0x93d1,0x9149}, {0x93d2,0x701e}, {0x93d3,0x5678}, {0x93d4,0x5c6f}, {0x93d5,0x60c7}, {0x93d6,0x6566}, {0x93d7,0x6c8c}, {0x93d8,0x8c5a}, {0x93d9,0x9041}, {0x93da,0x9813}, {0x93db,0x5451}, {0x93dc,0x66c7}, {0x93dd,0x920d}, {0x93de,0x5948}, {0x93df,0x90a3}, {0x93e0,0x5185}, {0x93e1,0x4e4d}, {0x93e2,0x51ea}, {0x93e3,0x8599}, {0x93e4,0x8b0e}, {0x93e5,0x7058}, {0x93e6,0x637a}, {0x93e7,0x934b}, {0x93e8,0x6962}, {0x93e9,0x99b4}, {0x93ea,0x7e04}, {0x93eb,0x7577}, {0x93ec,0x5357}, {0x93ed,0x6960}, {0x93ee,0x8edf}, {0x93ef,0x96e3}, {0x93f0,0x6c5d}, {0x93f1,0x4e8c}, {0x93f2,0x5c3c}, {0x93f3,0x5f10}, {0x93f4,0x8fe9}, {0x93f5,0x5302}, {0x93f6,0x8cd1}, {0x93f7,0x8089}, {0x93f8,0x8679}, {0x93f9,0x5eff}, {0x93fa,0x65e5}, {0x93fb,0x4e73}, {0x93fc,0x5165}, {0x9440,0x5982}, {0x9441,0x5c3f}, {0x9442,0x97ee}, {0x9443,0x4efb}, {0x9444,0x598a}, {0x9445,0x5fcd}, {0x9446,0x8a8d}, {0x9447,0x6fe1}, {0x9448,0x79b0}, {0x9449,0x7962}, {0x944a,0x5be7}, {0x944b,0x8471}, {0x944c,0x732b}, {0x944d,0x71b1}, {0x944e,0x5e74}, {0x944f,0x5ff5}, {0x9450,0x637b}, {0x9451,0x649a}, {0x9452,0x71c3}, {0x9453,0x7c98}, {0x9454,0x4e43}, {0x9455,0x5efc}, {0x9456,0x4e4b}, {0x9457,0x57dc}, {0x9458,0x56a2}, {0x9459,0x60a9}, {0x945a,0x6fc3}, {0x945b,0x7d0d}, {0x945c,0x80fd}, {0x945d,0x8133}, {0x945e,0x81bf}, {0x945f,0x8fb2}, {0x9460,0x8997}, {0x9461,0x86a4}, {0x9462,0x5df4}, {0x9463,0x628a}, {0x9464,0x64ad}, {0x9465,0x8987}, {0x9466,0x6777}, {0x9467,0x6ce2}, {0x9468,0x6d3e}, {0x9469,0x7436}, {0x946a,0x7834}, {0x946b,0x5a46}, {0x946c,0x7f75}, {0x946d,0x82ad}, {0x946e,0x99ac}, {0x946f,0x4ff3}, {0x9470,0x5ec3}, {0x9471,0x62dd}, {0x9472,0x6392}, {0x9473,0x6557}, {0x9474,0x676f}, {0x9475,0x76c3}, {0x9476,0x724c}, {0x9477,0x80cc}, {0x9478,0x80ba}, {0x9479,0x8f29}, {0x947a,0x914d}, {0x947b,0x500d}, {0x947c,0x57f9}, {0x947d,0x5a92}, {0x947e,0x6885}, {0x9480,0x6973}, {0x9481,0x7164}, {0x9482,0x72fd}, {0x9483,0x8cb7}, {0x9484,0x58f2}, {0x9485,0x8ce0}, {0x9486,0x966a}, {0x9487,0x9019}, {0x9488,0x877f}, {0x9489,0x79e4}, {0x948a,0x77e7}, {0x948b,0x8429}, {0x948c,0x4f2f}, {0x948d,0x5265}, {0x948e,0x535a}, {0x948f,0x62cd}, {0x9490,0x67cf}, {0x9491,0x6cca}, {0x9492,0x767d}, {0x9493,0x7b94}, {0x9494,0x7c95}, {0x9495,0x8236}, {0x9496,0x8584}, {0x9497,0x8feb}, {0x9498,0x66dd}, {0x9499,0x6f20}, {0x949a,0x7206}, {0x949b,0x7e1b}, {0x949c,0x83ab}, {0x949d,0x99c1}, {0x949e,0x9ea6}, {0x949f,0x51fd}, {0x94a0,0x7bb1}, {0x94a1,0x7872}, {0x94a2,0x7bb8}, {0x94a3,0x8087}, {0x94a4,0x7b48}, {0x94a5,0x6ae8}, {0x94a6,0x5e61}, {0x94a7,0x808c}, {0x94a8,0x7551}, {0x94a9,0x7560}, {0x94aa,0x516b}, {0x94ab,0x9262}, {0x94ac,0x6e8c}, {0x94ad,0x767a}, {0x94ae,0x9197}, {0x94af,0x9aea}, {0x94b0,0x4f10}, {0x94b1,0x7f70}, {0x94b2,0x629c}, {0x94b3,0x7b4f}, {0x94b4,0x95a5}, {0x94b5,0x9ce9}, {0x94b6,0x567a}, {0x94b7,0x5859}, {0x94b8,0x86e4}, {0x94b9,0x96bc}, {0x94ba,0x4f34}, {0x94bb,0x5224}, {0x94bc,0x534a}, {0x94bd,0x53cd}, {0x94be,0x53db}, {0x94bf,0x5e06}, {0x94c0,0x642c}, {0x94c1,0x6591}, {0x94c2,0x677f}, {0x94c3,0x6c3e}, {0x94c4,0x6c4e}, {0x94c5,0x7248}, {0x94c6,0x72af}, {0x94c7,0x73ed}, {0x94c8,0x7554}, {0x94c9,0x7e41}, {0x94ca,0x822c}, {0x94cb,0x85e9}, {0x94cc,0x8ca9}, {0x94cd,0x7bc4}, {0x94ce,0x91c6}, {0x94cf,0x7169}, {0x94d0,0x9812}, {0x94d1,0x98ef}, {0x94d2,0x633d}, {0x94d3,0x6669}, {0x94d4,0x756a}, {0x94d5,0x76e4}, {0x94d6,0x78d0}, {0x94d7,0x8543}, {0x94d8,0x86ee}, {0x94d9,0x532a}, {0x94da,0x5351}, {0x94db,0x5426}, {0x94dc,0x5983}, {0x94dd,0x5e87}, {0x94de,0x5f7c}, {0x94df,0x60b2}, {0x94e0,0x6249}, {0x94e1,0x6279}, {0x94e2,0x62ab}, {0x94e3,0x6590}, {0x94e4,0x6bd4}, {0x94e5,0x6ccc}, {0x94e6,0x75b2}, {0x94e7,0x76ae}, {0x94e8,0x7891}, {0x94e9,0x79d8}, {0x94ea,0x7dcb}, {0x94eb,0x7f77}, {0x94ec,0x80a5}, {0x94ed,0x88ab}, {0x94ee,0x8ab9}, {0x94ef,0x8cbb}, {0x94f0,0x907f}, {0x94f1,0x975e}, {0x94f2,0x98db}, {0x94f3,0x6a0b}, {0x94f4,0x7c38}, {0x94f5,0x5099}, {0x94f6,0x5c3e}, {0x94f7,0x5fae}, {0x94f8,0x6787}, {0x94f9,0x6bd8}, {0x94fa,0x7435}, {0x94fb,0x7709}, {0x94fc,0x7f8e}, {0x9540,0x9f3b}, {0x9541,0x67ca}, {0x9542,0x7a17}, {0x9543,0x5339}, {0x9544,0x758b}, {0x9545,0x9aed}, {0x9546,0x5f66}, {0x9547,0x819d}, {0x9548,0x83f1}, {0x9549,0x8098}, {0x954a,0x5f3c}, {0x954b,0x5fc5}, {0x954c,0x7562}, {0x954d,0x7b46}, {0x954e,0x903c}, {0x954f,0x6867}, {0x9550,0x59eb}, {0x9551,0x5a9b}, {0x9552,0x7d10}, {0x9553,0x767e}, {0x9554,0x8b2c}, {0x9555,0x4ff5}, {0x9556,0x5f6a}, {0x9557,0x6a19}, {0x9558,0x6c37}, {0x9559,0x6f02}, {0x955a,0x74e2}, {0x955b,0x7968}, {0x955c,0x8868}, {0x955d,0x8a55}, {0x955e,0x8c79}, {0x955f,0x5edf}, {0x9560,0x63cf}, {0x9561,0x75c5}, {0x9562,0x79d2}, {0x9563,0x82d7}, {0x9564,0x9328}, {0x9565,0x92f2}, {0x9566,0x849c}, {0x9567,0x86ed}, {0x9568,0x9c2d}, {0x9569,0x54c1}, {0x956a,0x5f6c}, {0x956b,0x658c}, {0x956c,0x6d5c}, {0x956d,0x7015}, {0x956e,0x8ca7}, {0x956f,0x8cd3}, {0x9570,0x983b}, {0x9571,0x654f}, {0x9572,0x74f6}, {0x9573,0x4e0d}, {0x9574,0x4ed8}, {0x9575,0x57e0}, {0x9576,0x592b}, {0x9577,0x5a66}, {0x9578,0x5bcc}, {0x9579,0x51a8}, {0x957a,0x5e03}, {0x957b,0x5e9c}, {0x957c,0x6016}, {0x957d,0x6276}, {0x957e,0x6577}, {0x9580,0x65a7}, {0x9581,0x666e}, {0x9582,0x6d6e}, {0x9583,0x7236}, {0x9584,0x7b26}, {0x9585,0x8150}, {0x9586,0x819a}, {0x9587,0x8299}, {0x9588,0x8b5c}, {0x9589,0x8ca0}, {0x958a,0x8ce6}, {0x958b,0x8d74}, {0x958c,0x961c}, {0x958d,0x9644}, {0x958e,0x4fae}, {0x958f,0x64ab}, {0x9590,0x6b66}, {0x9591,0x821e}, {0x9592,0x8461}, {0x9593,0x856a}, {0x9594,0x90e8}, {0x9595,0x5c01}, {0x9596,0x6953}, {0x9597,0x98a8}, {0x9598,0x847a}, {0x9599,0x8557}, {0x959a,0x4f0f}, {0x959b,0x526f}, {0x959c,0x5fa9}, {0x959d,0x5e45}, {0x959e,0x670d}, {0x959f,0x798f}, {0x95a0,0x8179}, {0x95a1,0x8907}, {0x95a2,0x8986}, {0x95a3,0x6df5}, {0x95a4,0x5f17}, {0x95a5,0x6255}, {0x95a6,0x6cb8}, {0x95a7,0x4ecf}, {0x95a8,0x7269}, {0x95a9,0x9b92}, {0x95aa,0x5206}, {0x95ab,0x543b}, {0x95ac,0x5674}, {0x95ad,0x58b3}, {0x95ae,0x61a4}, {0x95af,0x626e}, {0x95b0,0x711a}, {0x95b1,0x596e}, {0x95b2,0x7c89}, {0x95b3,0x7cde}, {0x95b4,0x7d1b}, {0x95b5,0x96f0}, {0x95b6,0x6587}, {0x95b7,0x805e}, {0x95b8,0x4e19}, {0x95b9,0x4f75}, {0x95ba,0x5175}, {0x95bb,0x5840}, {0x95bc,0x5e63}, {0x95bd,0x5e73}, {0x95be,0x5f0a}, {0x95bf,0x67c4}, {0x95c0,0x4e26}, {0x95c1,0x853d}, {0x95c2,0x9589}, {0x95c3,0x965b}, {0x95c4,0x7c73}, {0x95c5,0x9801}, {0x95c6,0x50fb}, {0x95c7,0x58c1}, {0x95c8,0x7656}, {0x95c9,0x78a7}, {0x95ca,0x5225}, {0x95cb,0x77a5}, {0x95cc,0x8511}, {0x95cd,0x7b86}, {0x95ce,0x504f}, {0x95cf,0x5909}, {0x95d0,0x7247}, {0x95d1,0x7bc7}, {0x95d2,0x7de8}, {0x95d3,0x8fba}, {0x95d4,0x8fd4}, {0x95d5,0x904d}, {0x95d6,0x4fbf}, {0x95d7,0x52c9}, {0x95d8,0x5a29}, {0x95d9,0x5f01}, {0x95da,0x97ad}, {0x95db,0x4fdd}, {0x95dc,0x8217}, {0x95dd,0x92ea}, {0x95de,0x5703}, {0x95df,0x6355}, {0x95e0,0x6b69}, {0x95e1,0x752b}, {0x95e2,0x88dc}, {0x95e3,0x8f14}, {0x95e4,0x7a42}, {0x95e5,0x52df}, {0x95e6,0x5893}, {0x95e7,0x6155}, {0x95e8,0x620a}, {0x95e9,0x66ae}, {0x95ea,0x6bcd}, {0x95eb,0x7c3f}, {0x95ec,0x83e9}, {0x95ed,0x5023}, {0x95ee,0x4ff8}, {0x95ef,0x5305}, {0x95f0,0x5446}, {0x95f1,0x5831}, {0x95f2,0x5949}, {0x95f3,0x5b9d}, {0x95f4,0x5cf0}, {0x95f5,0x5cef}, {0x95f6,0x5d29}, {0x95f7,0x5e96}, {0x95f8,0x62b1}, {0x95f9,0x6367}, {0x95fa,0x653e}, {0x95fb,0x65b9}, {0x95fc,0x670b}, {0x9640,0x6cd5}, {0x9641,0x6ce1}, {0x9642,0x70f9}, {0x9643,0x7832}, {0x9644,0x7e2b}, {0x9645,0x80de}, {0x9646,0x82b3}, {0x9647,0x840c}, {0x9648,0x84ec}, {0x9649,0x8702}, {0x964a,0x8912}, {0x964b,0x8a2a}, {0x964c,0x8c4a}, {0x964d,0x90a6}, {0x964e,0x92d2}, {0x964f,0x98fd}, {0x9650,0x9cf3}, {0x9651,0x9d6c}, {0x9652,0x4e4f}, {0x9653,0x4ea1}, {0x9654,0x508d}, {0x9655,0x5256}, {0x9656,0x574a}, {0x9657,0x59a8}, {0x9658,0x5e3d}, {0x9659,0x5fd8}, {0x965a,0x5fd9}, {0x965b,0x623f}, {0x965c,0x66b4}, {0x965d,0x671b}, {0x965e,0x67d0}, {0x965f,0x68d2}, {0x9660,0x5192}, {0x9661,0x7d21}, {0x9662,0x80aa}, {0x9663,0x81a8}, {0x9664,0x8b00}, {0x9665,0x8c8c}, {0x9666,0x8cbf}, {0x9667,0x927e}, {0x9668,0x9632}, {0x9669,0x5420}, {0x966a,0x982c}, {0x966b,0x5317}, {0x966c,0x50d5}, {0x966d,0x535c}, {0x966e,0x58a8}, {0x966f,0x64b2}, {0x9670,0x6734}, {0x9671,0x7267}, {0x9672,0x7766}, {0x9673,0x7a46}, {0x9674,0x91e6}, {0x9675,0x52c3}, {0x9676,0x6ca1}, {0x9677,0x6b86}, {0x9678,0x5800}, {0x9679,0x5e4c}, {0x967a,0x5954}, {0x967b,0x672c}, {0x967c,0x7ffb}, {0x967d,0x51e1}, {0x967e,0x76c6}, {0x9680,0x6469}, {0x9681,0x78e8}, {0x9682,0x9b54}, {0x9683,0x9ebb}, {0x9684,0x57cb}, {0x9685,0x59b9}, {0x9686,0x6627}, {0x9687,0x679a}, {0x9688,0x6bce}, {0x9689,0x54e9}, {0x968a,0x69d9}, {0x968b,0x5e55}, {0x968c,0x819c}, {0x968d,0x6795}, {0x968e,0x9baa}, {0x968f,0x67fe}, {0x9690,0x9c52}, {0x9691,0x685d}, {0x9692,0x4ea6}, {0x9693,0x4fe3}, {0x9694,0x53c8}, {0x9695,0x62b9}, {0x9696,0x672b}, {0x9697,0x6cab}, {0x9698,0x8fc4}, {0x9699,0x4fad}, {0x969a,0x7e6d}, {0x969b,0x9ebf}, {0x969c,0x4e07}, {0x969d,0x6162}, {0x969e,0x6e80}, {0x969f,0x6f2b}, {0x96a0,0x8513}, {0x96a1,0x5473}, {0x96a2,0x672a}, {0x96a3,0x9b45}, {0x96a4,0x5df3}, {0x96a5,0x7b95}, {0x96a6,0x5cac}, {0x96a7,0x5bc6}, {0x96a8,0x871c}, {0x96a9,0x6e4a}, {0x96aa,0x84d1}, {0x96ab,0x7a14}, {0x96ac,0x8108}, {0x96ad,0x5999}, {0x96ae,0x7c8d}, {0x96af,0x6c11}, {0x96b0,0x7720}, {0x96b1,0x52d9}, {0x96b2,0x5922}, {0x96b3,0x7121}, {0x96b4,0x725f}, {0x96b5,0x77db}, {0x96b6,0x9727}, {0x96b7,0x9d61}, {0x96b8,0x690b}, {0x96b9,0x5a7f}, {0x96ba,0x5a18}, {0x96bb,0x51a5}, {0x96bc,0x540d}, {0x96bd,0x547d}, {0x96be,0x660e}, {0x96bf,0x76df}, {0x96c0,0x8ff7}, {0x96c1,0x9298}, {0x96c2,0x9cf4}, {0x96c3,0x59ea}, {0x96c4,0x725d}, {0x96c5,0x6ec5}, {0x96c6,0x514d}, {0x96c7,0x68c9}, {0x96c8,0x7dbf}, {0x96c9,0x7dec}, {0x96ca,0x9762}, {0x96cb,0x9eba}, {0x96cc,0x6478}, {0x96cd,0x6a21}, {0x96ce,0x8302}, {0x96cf,0x5984}, {0x96d0,0x5b5f}, {0x96d1,0x6bdb}, {0x96d2,0x731b}, {0x96d3,0x76f2}, {0x96d4,0x7db2}, {0x96d5,0x8017}, {0x96d6,0x8499}, {0x96d7,0x5132}, {0x96d8,0x6728}, {0x96d9,0x9ed9}, {0x96da,0x76ee}, {0x96db,0x6762}, {0x96dc,0x52ff}, {0x96dd,0x9905}, {0x96de,0x5c24}, {0x96df,0x623b}, {0x96e0,0x7c7e}, {0x96e1,0x8cb0}, {0x96e2,0x554f}, {0x96e3,0x60b6}, {0x96e4,0x7d0b}, {0x96e5,0x9580}, {0x96e6,0x5301}, {0x96e7,0x4e5f}, {0x96e8,0x51b6}, {0x96e9,0x591c}, {0x96ea,0x723a}, {0x96eb,0x8036}, {0x96ec,0x91ce}, {0x96ed,0x5f25}, {0x96ee,0x77e2}, {0x96ef,0x5384}, {0x96f0,0x5f79}, {0x96f1,0x7d04}, {0x96f2,0x85ac}, {0x96f3,0x8a33}, {0x96f4,0x8e8d}, {0x96f5,0x9756}, {0x96f6,0x67f3}, {0x96f7,0x85ae}, {0x96f8,0x9453}, {0x96f9,0x6109}, {0x96fa,0x6108}, {0x96fb,0x6cb9}, {0x96fc,0x7652}, {0x9740,0x8aed}, {0x9741,0x8f38}, {0x9742,0x552f}, {0x9743,0x4f51}, {0x9744,0x512a}, {0x9745,0x52c7}, {0x9746,0x53cb}, {0x9747,0x5ba5}, {0x9748,0x5e7d}, {0x9749,0x60a0}, {0x974a,0x6182}, {0x974b,0x63d6}, {0x974c,0x6709}, {0x974d,0x67da}, {0x974e,0x6e67}, {0x974f,0x6d8c}, {0x9750,0x7336}, {0x9751,0x7337}, {0x9752,0x7531}, {0x9753,0x7950}, {0x9754,0x88d5}, {0x9755,0x8a98}, {0x9756,0x904a}, {0x9757,0x9091}, {0x9758,0x90f5}, {0x9759,0x96c4}, {0x975a,0x878d}, {0x975b,0x5915}, {0x975c,0x4e88}, {0x975d,0x4f59}, {0x975e,0x4e0e}, {0x975f,0x8a89}, {0x9760,0x8f3f}, {0x9761,0x9810}, {0x9762,0x50ad}, {0x9763,0x5e7c}, {0x9764,0x5996}, {0x9765,0x5bb9}, {0x9766,0x5eb8}, {0x9767,0x63da}, {0x9768,0x63fa}, {0x9769,0x64c1}, {0x976a,0x66dc}, {0x976b,0x694a}, {0x976c,0x69d8}, {0x976d,0x6d0b}, {0x976e,0x6eb6}, {0x976f,0x7194}, {0x9770,0x7528}, {0x9771,0x7aaf}, {0x9772,0x7f8a}, {0x9773,0x8000}, {0x9774,0x8449}, {0x9775,0x84c9}, {0x9776,0x8981}, {0x9777,0x8b21}, {0x9778,0x8e0a}, {0x9779,0x9065}, {0x977a,0x967d}, {0x977b,0x990a}, {0x977c,0x617e}, {0x977d,0x6291}, {0x977e,0x6b32}, {0x9780,0x6c83}, {0x9781,0x6d74}, {0x9782,0x7fcc}, {0x9783,0x7ffc}, {0x9784,0x6dc0}, {0x9785,0x7f85}, {0x9786,0x87ba}, {0x9787,0x88f8}, {0x9788,0x6765}, {0x9789,0x83b1}, {0x978a,0x983c}, {0x978b,0x96f7}, {0x978c,0x6d1b}, {0x978d,0x7d61}, {0x978e,0x843d}, {0x978f,0x916a}, {0x9790,0x4e71}, {0x9791,0x5375}, {0x9792,0x5d50}, {0x9793,0x6b04}, {0x9794,0x6feb}, {0x9795,0x85cd}, {0x9796,0x862d}, {0x9797,0x89a7}, {0x9798,0x5229}, {0x9799,0x540f}, {0x979a,0x5c65}, {0x979b,0x674e}, {0x979c,0x68a8}, {0x979d,0x7406}, {0x979e,0x7483}, {0x979f,0x75e2}, {0x97a0,0x88cf}, {0x97a1,0x88e1}, {0x97a2,0x91cc}, {0x97a3,0x96e2}, {0x97a4,0x9678}, {0x97a5,0x5f8b}, {0x97a6,0x7387}, {0x97a7,0x7acb}, {0x97a8,0x844e}, {0x97a9,0x63a0}, {0x97aa,0x7565}, {0x97ab,0x5289}, {0x97ac,0x6d41}, {0x97ad,0x6e9c}, {0x97ae,0x7409}, {0x97af,0x7559}, {0x97b0,0x786b}, {0x97b1,0x7c92}, {0x97b2,0x9686}, {0x97b3,0x7adc}, {0x97b4,0x9f8d}, {0x97b5,0x4fb6}, {0x97b6,0x616e}, {0x97b7,0x65c5}, {0x97b8,0x865c}, {0x97b9,0x4e86}, {0x97ba,0x4eae}, {0x97bb,0x50da}, {0x97bc,0x4e21}, {0x97bd,0x51cc}, {0x97be,0x5bee}, {0x97bf,0x6599}, {0x97c0,0x6881}, {0x97c1,0x6dbc}, {0x97c2,0x731f}, {0x97c3,0x7642}, {0x97c4,0x77ad}, {0x97c5,0x7a1c}, {0x97c6,0x7ce7}, {0x97c7,0x826f}, {0x97c8,0x8ad2}, {0x97c9,0x907c}, {0x97ca,0x91cf}, {0x97cb,0x9675}, {0x97cc,0x9818}, {0x97cd,0x529b}, {0x97ce,0x7dd1}, {0x97cf,0x502b}, {0x97d0,0x5398}, {0x97d1,0x6797}, {0x97d2,0x6dcb}, {0x97d3,0x71d0}, {0x97d4,0x7433}, {0x97d5,0x81e8}, {0x97d6,0x8f2a}, {0x97d7,0x96a3}, {0x97d8,0x9c57}, {0x97d9,0x9e9f}, {0x97da,0x7460}, {0x97db,0x5841}, {0x97dc,0x6d99}, {0x97dd,0x7d2f}, {0x97de,0x985e}, {0x97df,0x4ee4}, {0x97e0,0x4f36}, {0x97e1,0x4f8b}, {0x97e2,0x51b7}, {0x97e3,0x52b1}, {0x97e4,0x5dba}, {0x97e5,0x601c}, {0x97e6,0x73b2}, {0x97e7,0x793c}, {0x97e8,0x82d3}, {0x97e9,0x9234}, {0x97ea,0x96b7}, {0x97eb,0x96f6}, {0x97ec,0x970a}, {0x97ed,0x9e97}, {0x97ee,0x9f62}, {0x97ef,0x66a6}, {0x97f0,0x6b74}, {0x97f1,0x5217}, {0x97f2,0x52a3}, {0x97f3,0x70c8}, {0x97f4,0x88c2}, {0x97f5,0x5ec9}, {0x97f6,0x604b}, {0x97f7,0x6190}, {0x97f8,0x6f23}, {0x97f9,0x7149}, {0x97fa,0x7c3e}, {0x97fb,0x7df4}, {0x97fc,0x806f}, {0x9840,0x84ee}, {0x9841,0x9023}, {0x9842,0x932c}, {0x9843,0x5442}, {0x9844,0x9b6f}, {0x9845,0x6ad3}, {0x9846,0x7089}, {0x9847,0x8cc2}, {0x9848,0x8def}, {0x9849,0x9732}, {0x984a,0x52b4}, {0x984b,0x5a41}, {0x984c,0x5eca}, {0x984d,0x5f04}, {0x984e,0x6717}, {0x984f,0x697c}, {0x9850,0x6994}, {0x9851,0x6d6a}, {0x9852,0x6f0f}, {0x9853,0x7262}, {0x9854,0x72fc}, {0x9855,0x7bed}, {0x9856,0x8001}, {0x9857,0x807e}, {0x9858,0x874b}, {0x9859,0x90ce}, {0x985a,0x516d}, {0x985b,0x9e93}, {0x985c,0x7984}, {0x985d,0x808b}, {0x985e,0x9332}, {0x985f,0x8ad6}, {0x9860,0x502d}, {0x9861,0x548c}, {0x9862,0x8a71}, {0x9863,0x6b6a}, {0x9864,0x8cc4}, {0x9865,0x8107}, {0x9866,0x60d1}, {0x9867,0x67a0}, {0x9868,0x9df2}, {0x9869,0x4e99}, {0x986a,0x4e98}, {0x986b,0x9c10}, {0x986c,0x8a6b}, {0x986d,0x85c1}, {0x986e,0x8568}, {0x986f,0x6900}, {0x9870,0x6e7e}, {0x9871,0x7897}, {0x9872,0x8155}, {0x9873,0xffff}, {0x9874,0x5b41}, {0x9875,0x5b56}, {0x9876,0x5b7d}, {0x9877,0x5b93}, {0x9878,0x5bd8}, {0x9879,0x5bec}, {0x987a,0x5c12}, {0x987b,0x5c1e}, {0x987c,0x5c23}, {0x987d,0x5c2b}, {0x987e,0x378d}, {0x9880,0x5c62}, {0x9881,0x0}, {0x9882,0x0}, {0x9883,0x0}, {0x9884,0x5c7a}, {0x9885,0x5c8f}, {0x9886,0x5c9f}, {0x9887,0x5ca3}, {0x9888,0x5caa}, {0x9889,0x5cba}, {0x988a,0x5ccb}, {0x988b,0x5cd0}, {0x988c,0x5cd2}, {0x988d,0x5cf4}, {0x988e,0x0}, {0x988f,0x37e2}, {0x9890,0x5d0d}, {0x9891,0x5d27}, {0x9892,0xfa11}, {0x9893,0x5d46}, {0x9894,0x5d47}, {0x9895,0x5d53}, {0x9896,0x5d4a}, {0x9897,0x5d6d}, {0x9898,0x5d81}, {0x9899,0x5da0}, {0x989a,0x5da4}, {0x989b,0x5da7}, {0x989c,0x5db8}, {0x989d,0x5dcb}, {0x989e,0xffff}, {0x989f,0x5f0c}, {0x98a0,0x4e10}, {0x98a1,0x4e15}, {0x98a2,0x4e2a}, {0x98a3,0x4e31}, {0x98a4,0x4e36}, {0x98a5,0x4e3c}, {0x98a6,0x4e3f}, {0x98a7,0x4e42}, {0x98a8,0x4e56}, {0x98a9,0x4e58}, {0x98aa,0x4e82}, {0x98ab,0x4e85}, {0x98ac,0x8c6b}, {0x98ad,0x4e8a}, {0x98ae,0x8212}, {0x98af,0x5f0d}, {0x98b0,0x4e8e}, {0x98b1,0x4e9e}, {0x98b2,0x4e9f}, {0x98b3,0x4ea0}, {0x98b4,0x4ea2}, {0x98b5,0x4eb0}, {0x98b6,0x4eb3}, {0x98b7,0x4eb6}, {0x98b8,0x4ece}, {0x98b9,0x4ecd}, {0x98ba,0x4ec4}, {0x98bb,0x4ec6}, {0x98bc,0x4ec2}, {0x98bd,0x4ed7}, {0x98be,0x4ede}, {0x98bf,0x4eed}, {0x98c0,0x4edf}, {0x98c1,0x4ef7}, {0x98c2,0x4f09}, {0x98c3,0x4f5a}, {0x98c4,0x4f30}, {0x98c5,0x4f5b}, {0x98c6,0x4f5d}, {0x98c7,0x4f57}, {0x98c8,0x4f47}, {0x98c9,0x4f76}, {0x98ca,0x4f88}, {0x98cb,0x4f8f}, {0x98cc,0x4f98}, {0x98cd,0x4f7b}, {0x98ce,0x4f69}, {0x98cf,0x4f70}, {0x98d0,0x4f91}, {0x98d1,0x4f6f}, {0x98d2,0x4f86}, {0x98d3,0x4f96}, {0x98d4,0x5118}, {0x98d5,0x4fd4}, {0x98d6,0x4fdf}, {0x98d7,0x4fce}, {0x98d8,0x4fd8}, {0x98d9,0x4fdb}, {0x98da,0x4fd1}, {0x98db,0x4fda}, {0x98dc,0x4fd0}, {0x98dd,0x4fe4}, {0x98de,0x4fe5}, {0x98df,0x501a}, {0x98e0,0x5028}, {0x98e1,0x5014}, {0x98e2,0x502a}, {0x98e3,0x5025}, {0x98e4,0x5005}, {0x98e5,0x4f1c}, {0x98e6,0x4ff6}, {0x98e7,0x5021}, {0x98e8,0x5029}, {0x98e9,0x502c}, {0x98ea,0x4ffe}, {0x98eb,0x4fef}, {0x98ec,0x5011}, {0x98ed,0x5006}, {0x98ee,0x5043}, {0x98ef,0x5047}, {0x98f0,0x6703}, {0x98f1,0x5055}, {0x98f2,0x5050}, {0x98f3,0x5048}, {0x98f4,0x505a}, {0x98f5,0x5056}, {0x98f6,0x506c}, {0x98f7,0x5078}, {0x98f8,0x5080}, {0x98f9,0x509a}, {0x98fa,0x5085}, {0x98fb,0x50b4}, {0x98fc,0x50b2}, {0x9940,0x50c9}, {0x9941,0x50ca}, {0x9942,0x50b3}, {0x9943,0x50c2}, {0x9944,0x50d6}, {0x9945,0x50de}, {0x9946,0x50e5}, {0x9947,0x50ed}, {0x9948,0x50e3}, {0x9949,0x50ee}, {0x994a,0x50f9}, {0x994b,0x50f5}, {0x994c,0x5109}, {0x994d,0x5101}, {0x994e,0x5102}, {0x994f,0x5116}, {0x9950,0x5115}, {0x9951,0x5114}, {0x9952,0x511a}, {0x9953,0x5121}, {0x9954,0x513a}, {0x9955,0x5137}, {0x9956,0x513c}, {0x9957,0x513b}, {0x9958,0x513f}, {0x9959,0x5140}, {0x995a,0x5152}, {0x995b,0x514c}, {0x995c,0x5154}, {0x995d,0x5162}, {0x995e,0x7af8}, {0x995f,0x5169}, {0x9960,0x516a}, {0x9961,0x516e}, {0x9962,0x5180}, {0x9963,0x5182}, {0x9964,0x56d8}, {0x9965,0x518c}, {0x9966,0x5189}, {0x9967,0x518f}, {0x9968,0x5191}, {0x9969,0x5193}, {0x996a,0x5195}, {0x996b,0x5196}, {0x996c,0x51a4}, {0x996d,0x51a6}, {0x996e,0x51a2}, {0x996f,0x51a9}, {0x9970,0x51aa}, {0x9971,0x51ab}, {0x9972,0x51b3}, {0x9973,0x51b1}, {0x9974,0x51b2}, {0x9975,0x51b0}, {0x9976,0x51b5}, {0x9977,0x51bd}, {0x9978,0x51c5}, {0x9979,0x51c9}, {0x997a,0x51db}, {0x997b,0x51e0}, {0x997c,0x8655}, {0x997d,0x51e9}, {0x997e,0x51ed}, {0x9980,0x51f0}, {0x9981,0x51f5}, {0x9982,0x51fe}, {0x9983,0x5204}, {0x9984,0x520b}, {0x9985,0x5214}, {0x9986,0x520e}, {0x9987,0x5227}, {0x9988,0x522a}, {0x9989,0x522e}, {0x998a,0x5233}, {0x998b,0x5239}, {0x998c,0x524f}, {0x998d,0x5244}, {0x998e,0x524b}, {0x998f,0x524c}, {0x9990,0x525e}, {0x9991,0x5254}, {0x9992,0x526a}, {0x9993,0x5274}, {0x9994,0x5269}, {0x9995,0x5273}, {0x9996,0x527f}, {0x9997,0x527d}, {0x9998,0x528d}, {0x9999,0x5294}, {0x999a,0x5292}, {0x999b,0x5271}, {0x999c,0x5288}, {0x999d,0x5291}, {0x999e,0x8fa8}, {0x999f,0x8fa7}, {0x99a0,0x52ac}, {0x99a1,0x52ad}, {0x99a2,0x52bc}, {0x99a3,0x52b5}, {0x99a4,0x52c1}, {0x99a5,0x52cd}, {0x99a6,0x52d7}, {0x99a7,0x52de}, {0x99a8,0x52e3}, {0x99a9,0x52e6}, {0x99aa,0x98ed}, {0x99ab,0x52e0}, {0x99ac,0x52f3}, {0x99ad,0x52f5}, {0x99ae,0x52f8}, {0x99af,0x52f9}, {0x99b0,0x5306}, {0x99b1,0x5308}, {0x99b2,0x7538}, {0x99b3,0x530d}, {0x99b4,0x5310}, {0x99b5,0x530f}, {0x99b6,0x5315}, {0x99b7,0x531a}, {0x99b8,0x5323}, {0x99b9,0x532f}, {0x99ba,0x5331}, {0x99bb,0x5333}, {0x99bc,0x5338}, {0x99bd,0x5340}, {0x99be,0x5346}, {0x99bf,0x5345}, {0x99c0,0x4e17}, {0x99c1,0x5349}, {0x99c2,0x534d}, {0x99c3,0x51d6}, {0x99c4,0x535e}, {0x99c5,0x5369}, {0x99c6,0x536e}, {0x99c7,0x5918}, {0x99c8,0x537b}, {0x99c9,0x5377}, {0x99ca,0x5382}, {0x99cb,0x5396}, {0x99cc,0x53a0}, {0x99cd,0x53a6}, {0x99ce,0x53a5}, {0x99cf,0x53ae}, {0x99d0,0x53b0}, {0x99d1,0x53b6}, {0x99d2,0x53c3}, {0x99d3,0x7c12}, {0x99d4,0x96d9}, {0x99d5,0x53df}, {0x99d6,0x66fc}, {0x99d7,0x71ee}, {0x99d8,0x53ee}, {0x99d9,0x53e8}, {0x99da,0x53ed}, {0x99db,0x53fa}, {0x99dc,0x5401}, {0x99dd,0x543d}, {0x99de,0x5440}, {0x99df,0x542c}, {0x99e0,0x542d}, {0x99e1,0x543c}, {0x99e2,0x542e}, {0x99e3,0x5436}, {0x99e4,0x5429}, {0x99e5,0x541d}, {0x99e6,0x544e}, {0x99e7,0x548f}, {0x99e8,0x5475}, {0x99e9,0x548e}, {0x99ea,0x545f}, {0x99eb,0x5471}, {0x99ec,0x5477}, {0x99ed,0x5470}, {0x99ee,0x5492}, {0x99ef,0x547b}, {0x99f0,0x5480}, {0x99f1,0x5476}, {0x99f2,0x5484}, {0x99f3,0x5490}, {0x99f4,0x5486}, {0x99f5,0x54c7}, {0x99f6,0x54a2}, {0x99f7,0x54b8}, {0x99f8,0x54a5}, {0x99f9,0x54ac}, {0x99fa,0x54c4}, {0x99fb,0x54c8}, {0x99fc,0x54a8}, {0x9a40,0x54ab}, {0x9a41,0x54c2}, {0x9a42,0x54a4}, {0x9a43,0x54be}, {0x9a44,0x54bc}, {0x9a45,0x54d8}, {0x9a46,0x54e5}, {0x9a47,0x54e6}, {0x9a48,0x550f}, {0x9a49,0x5514}, {0x9a4a,0x54fd}, {0x9a4b,0x54ee}, {0x9a4c,0x54ed}, {0x9a4d,0x54fa}, {0x9a4e,0x54e2}, {0x9a4f,0x5539}, {0x9a50,0x5540}, {0x9a51,0x5563}, {0x9a52,0x554c}, {0x9a53,0x552e}, {0x9a54,0x555c}, {0x9a55,0x5545}, {0x9a56,0x5556}, {0x9a57,0x5557}, {0x9a58,0x5538}, {0x9a59,0x5533}, {0x9a5a,0x555d}, {0x9a5b,0x5599}, {0x9a5c,0x5580}, {0x9a5d,0x54af}, {0x9a5e,0x558a}, {0x9a5f,0x559f}, {0x9a60,0x557b}, {0x9a61,0x557e}, {0x9a62,0x5598}, {0x9a63,0x559e}, {0x9a64,0x55ae}, {0x9a65,0x557c}, {0x9a66,0x5583}, {0x9a67,0x55a9}, {0x9a68,0x5587}, {0x9a69,0x55a8}, {0x9a6a,0x55da}, {0x9a6b,0x55c5}, {0x9a6c,0x55df}, {0x9a6d,0x55c4}, {0x9a6e,0x55dc}, {0x9a6f,0x55e4}, {0x9a70,0x55d4}, {0x9a71,0x5614}, {0x9a72,0x55f7}, {0x9a73,0x5616}, {0x9a74,0x55fe}, {0x9a75,0x55fd}, {0x9a76,0x561b}, {0x9a77,0x55f9}, {0x9a78,0x564e}, {0x9a79,0x5650}, {0x9a7a,0x71df}, {0x9a7b,0x5634}, {0x9a7c,0x5636}, {0x9a7d,0x5632}, {0x9a7e,0x5638}, {0x9a80,0x566b}, {0x9a81,0x5664}, {0x9a82,0x562f}, {0x9a83,0x566c}, {0x9a84,0x566a}, {0x9a85,0x5686}, {0x9a86,0x5680}, {0x9a87,0x568a}, {0x9a88,0x56a0}, {0x9a89,0x5694}, {0x9a8a,0x568f}, {0x9a8b,0x56a5}, {0x9a8c,0x56ae}, {0x9a8d,0x56b6}, {0x9a8e,0x56b4}, {0x9a8f,0x56c2}, {0x9a90,0x56bc}, {0x9a91,0x56c1}, {0x9a92,0x56c3}, {0x9a93,0x56c0}, {0x9a94,0x56c8}, {0x9a95,0x56ce}, {0x9a96,0x56d1}, {0x9a97,0x56d3}, {0x9a98,0x56d7}, {0x9a99,0x56ee}, {0x9a9a,0x56f9}, {0x9a9b,0x5700}, {0x9a9c,0x56ff}, {0x9a9d,0x5704}, {0x9a9e,0x5709}, {0x9a9f,0x5708}, {0x9aa0,0x570b}, {0x9aa1,0x570d}, {0x9aa2,0x5713}, {0x9aa3,0x5718}, {0x9aa4,0x5716}, {0x9aa5,0x55c7}, {0x9aa6,0x571c}, {0x9aa7,0x5726}, {0x9aa8,0x5737}, {0x9aa9,0x5738}, {0x9aaa,0x574e}, {0x9aab,0x573b}, {0x9aac,0x5740}, {0x9aad,0x574f}, {0x9aae,0x5769}, {0x9aaf,0x57c0}, {0x9ab0,0x5788}, {0x9ab1,0x5761}, {0x9ab2,0x577f}, {0x9ab3,0x5789}, {0x9ab4,0x5793}, {0x9ab5,0x57a0}, {0x9ab6,0x57b3}, {0x9ab7,0x57a4}, {0x9ab8,0x57aa}, {0x9ab9,0x57b0}, {0x9aba,0x57c3}, {0x9abb,0x57c6}, {0x9abc,0x57d4}, {0x9abd,0x57d2}, {0x9abe,0x57d3}, {0x9abf,0x580a}, {0x9ac0,0x57d6}, {0x9ac1,0x57e3}, {0x9ac2,0x580b}, {0x9ac3,0x5819}, {0x9ac4,0x581d}, {0x9ac5,0x5872}, {0x9ac6,0x5821}, {0x9ac7,0x5862}, {0x9ac8,0x584b}, {0x9ac9,0x5870}, {0x9aca,0x6bc0}, {0x9acb,0x5852}, {0x9acc,0x583d}, {0x9acd,0x5879}, {0x9ace,0x5885}, {0x9acf,0x58b9}, {0x9ad0,0x589f}, {0x9ad1,0x58ab}, {0x9ad2,0x58ba}, {0x9ad3,0x58de}, {0x9ad4,0x58bb}, {0x9ad5,0x58b8}, {0x9ad6,0x58ae}, {0x9ad7,0x58c5}, {0x9ad8,0x58d3}, {0x9ad9,0x58d1}, {0x9ada,0x58d7}, {0x9adb,0x58d9}, {0x9adc,0x58d8}, {0x9add,0x58e5}, {0x9ade,0x58dc}, {0x9adf,0x58e4}, {0x9ae0,0x58df}, {0x9ae1,0x58ef}, {0x9ae2,0x58fa}, {0x9ae3,0x58f9}, {0x9ae4,0x58fb}, {0x9ae5,0x58fc}, {0x9ae6,0x58fd}, {0x9ae7,0x5902}, {0x9ae8,0x590a}, {0x9ae9,0x5910}, {0x9aea,0x591b}, {0x9aeb,0x68a6}, {0x9aec,0x5925}, {0x9aed,0x592c}, {0x9aee,0x592d}, {0x9aef,0x5932}, {0x9af0,0x5938}, {0x9af1,0x593e}, {0x9af2,0x7ad2}, {0x9af3,0x5955}, {0x9af4,0x5950}, {0x9af5,0x594e}, {0x9af6,0x595a}, {0x9af7,0x5958}, {0x9af8,0x5962}, {0x9af9,0x5960}, {0x9afa,0x5967}, {0x9afb,0x596c}, {0x9afc,0x5969}, {0x9b40,0x5978}, {0x9b41,0x5981}, {0x9b42,0x599d}, {0x9b43,0x4f5e}, {0x9b44,0x4fab}, {0x9b45,0x59a3}, {0x9b46,0x59b2}, {0x9b47,0x59c6}, {0x9b48,0x59e8}, {0x9b49,0x59dc}, {0x9b4a,0x598d}, {0x9b4b,0x59d9}, {0x9b4c,0x59da}, {0x9b4d,0x5a25}, {0x9b4e,0x5a1f}, {0x9b4f,0x5a11}, {0x9b50,0x5a1c}, {0x9b51,0x5a09}, {0x9b52,0x5a1a}, {0x9b53,0x5a40}, {0x9b54,0x5a6c}, {0x9b55,0x5a49}, {0x9b56,0x5a35}, {0x9b57,0x5a36}, {0x9b58,0x5a62}, {0x9b59,0x5a6a}, {0x9b5a,0x5a9a}, {0x9b5b,0x5abc}, {0x9b5c,0x5abe}, {0x9b5d,0x5acb}, {0x9b5e,0x5ac2}, {0x9b5f,0x5abd}, {0x9b60,0x5ae3}, {0x9b61,0x5ad7}, {0x9b62,0x5ae6}, {0x9b63,0x5ae9}, {0x9b64,0x5ad6}, {0x9b65,0x5afa}, {0x9b66,0x5afb}, {0x9b67,0x5b0c}, {0x9b68,0x5b0b}, {0x9b69,0x5b16}, {0x9b6a,0x5b32}, {0x9b6b,0x5ad0}, {0x9b6c,0x5b2a}, {0x9b6d,0x5b36}, {0x9b6e,0x5b3e}, {0x9b6f,0x5b43}, {0x9b70,0x5b45}, {0x9b71,0x5b40}, {0x9b72,0x5b51}, {0x9b73,0x5b55}, {0x9b74,0x5b5a}, {0x9b75,0x5b5b}, {0x9b76,0x5b65}, {0x9b77,0x5b69}, {0x9b78,0x5b70}, {0x9b79,0x5b73}, {0x9b7a,0x5b75}, {0x9b7b,0x5b78}, {0x9b7c,0x6588}, {0x9b7d,0x5b7a}, {0x9b7e,0x5b80}, {0x9b80,0x5b83}, {0x9b81,0x5ba6}, {0x9b82,0x5bb8}, {0x9b83,0x5bc3}, {0x9b84,0x5bc7}, {0x9b85,0x5bc9}, {0x9b86,0x5bd4}, {0x9b87,0x5bd0}, {0x9b88,0x5be4}, {0x9b89,0x5be6}, {0x9b8a,0x5be2}, {0x9b8b,0x5bde}, {0x9b8c,0x5be5}, {0x9b8d,0x5beb}, {0x9b8e,0x5bf0}, {0x9b8f,0x5bf6}, {0x9b90,0x5bf3}, {0x9b91,0x5c05}, {0x9b92,0x5c07}, {0x9b93,0x5c08}, {0x9b94,0x5c0d}, {0x9b95,0x5c13}, {0x9b96,0x5c20}, {0x9b97,0x5c22}, {0x9b98,0x5c28}, {0x9b99,0x5c38}, {0x9b9a,0x5c39}, {0x9b9b,0x5c41}, {0x9b9c,0x5c46}, {0x9b9d,0x5c4e}, {0x9b9e,0x5c53}, {0x9b9f,0x5c50}, {0x9ba0,0x5c4f}, {0x9ba1,0x5b71}, {0x9ba2,0x5c6c}, {0x9ba3,0x5c6e}, {0x9ba4,0x4e62}, {0x9ba5,0x5c76}, {0x9ba6,0x5c79}, {0x9ba7,0x5c8c}, {0x9ba8,0x5c91}, {0x9ba9,0x5c94}, {0x9baa,0x599b}, {0x9bab,0x5cab}, {0x9bac,0x5cbb}, {0x9bad,0x5cb6}, {0x9bae,0x5cbc}, {0x9baf,0x5cb7}, {0x9bb0,0x5cc5}, {0x9bb1,0x5cbe}, {0x9bb2,0x5cc7}, {0x9bb3,0x5cd9}, {0x9bb4,0x5ce9}, {0x9bb5,0x5cfd}, {0x9bb6,0x5cfa}, {0x9bb7,0x5ced}, {0x9bb8,0x5d8c}, {0x9bb9,0x5cea}, {0x9bba,0x5d0b}, {0x9bbb,0x5d15}, {0x9bbc,0x5d17}, {0x9bbd,0x5d5c}, {0x9bbe,0x5d1f}, {0x9bbf,0x5d1b}, {0x9bc0,0x5d11}, {0x9bc1,0x5d14}, {0x9bc2,0x5d22}, {0x9bc3,0x5d1a}, {0x9bc4,0x5d19}, {0x9bc5,0x5d18}, {0x9bc6,0x5d4c}, {0x9bc7,0x5d52}, {0x9bc8,0x5d4e}, {0x9bc9,0x5d4b}, {0x9bca,0x5d6c}, {0x9bcb,0x5d73}, {0x9bcc,0x5d76}, {0x9bcd,0x5d87}, {0x9bce,0x5d84}, {0x9bcf,0x5d82}, {0x9bd0,0x5da2}, {0x9bd1,0x5d9d}, {0x9bd2,0x5dac}, {0x9bd3,0x5dae}, {0x9bd4,0x5dbd}, {0x9bd5,0x5d90}, {0x9bd6,0x5db7}, {0x9bd7,0x5dbc}, {0x9bd8,0x5dc9}, {0x9bd9,0x5dcd}, {0x9bda,0x5dd3}, {0x9bdb,0x5dd2}, {0x9bdc,0x5dd6}, {0x9bdd,0x5ddb}, {0x9bde,0x5deb}, {0x9bdf,0x5df2}, {0x9be0,0x5df5}, {0x9be1,0x5e0b}, {0x9be2,0x5e1a}, {0x9be3,0x5e19}, {0x9be4,0x5e11}, {0x9be5,0x5e1b}, {0x9be6,0x5e36}, {0x9be7,0x5e37}, {0x9be8,0x5e44}, {0x9be9,0x5e43}, {0x9bea,0x5e40}, {0x9beb,0x5e4e}, {0x9bec,0x5e57}, {0x9bed,0x5e54}, {0x9bee,0x5e5f}, {0x9bef,0x5e62}, {0x9bf0,0x5e64}, {0x9bf1,0x5e47}, {0x9bf2,0x5e75}, {0x9bf3,0x5e76}, {0x9bf4,0x5e7a}, {0x9bf5,0x9ebc}, {0x9bf6,0x5e7f}, {0x9bf7,0x5ea0}, {0x9bf8,0x5ec1}, {0x9bf9,0x5ec2}, {0x9bfa,0x5ec8}, {0x9bfb,0x5ed0}, {0x9bfc,0x5ecf}, {0x9c40,0x5ed6}, {0x9c41,0x5ee3}, {0x9c42,0x5edd}, {0x9c43,0x5eda}, {0x9c44,0x5edb}, {0x9c45,0x5ee2}, {0x9c46,0x5ee1}, {0x9c47,0x5ee8}, {0x9c48,0x5ee9}, {0x9c49,0x5eec}, {0x9c4a,0x5ef1}, {0x9c4b,0x5ef3}, {0x9c4c,0x5ef0}, {0x9c4d,0x5ef4}, {0x9c4e,0x5ef8}, {0x9c4f,0x5efe}, {0x9c50,0x5f03}, {0x9c51,0x5f09}, {0x9c52,0x5f5d}, {0x9c53,0x5f5c}, {0x9c54,0x5f0b}, {0x9c55,0x5f11}, {0x9c56,0x5f16}, {0x9c57,0x5f29}, {0x9c58,0x5f2d}, {0x9c59,0x5f38}, {0x9c5a,0x5f41}, {0x9c5b,0x5f48}, {0x9c5c,0x5f4c}, {0x9c5d,0x5f4e}, {0x9c5e,0x5f2f}, {0x9c5f,0x5f51}, {0x9c60,0x5f56}, {0x9c61,0x5f57}, {0x9c62,0x5f59}, {0x9c63,0x5f61}, {0x9c64,0x5f6d}, {0x9c65,0x5f73}, {0x9c66,0x5f77}, {0x9c67,0x5f83}, {0x9c68,0x5f82}, {0x9c69,0x5f7f}, {0x9c6a,0x5f8a}, {0x9c6b,0x5f88}, {0x9c6c,0x5f91}, {0x9c6d,0x5f87}, {0x9c6e,0x5f9e}, {0x9c6f,0x5f99}, {0x9c70,0x5f98}, {0x9c71,0x5fa0}, {0x9c72,0x5fa8}, {0x9c73,0x5fad}, {0x9c74,0x5fbc}, {0x9c75,0x5fd6}, {0x9c76,0x5ffb}, {0x9c77,0x5fe4}, {0x9c78,0x5ff8}, {0x9c79,0x5ff1}, {0x9c7a,0x5fdd}, {0x9c7b,0x60b3}, {0x9c7c,0x5fff}, {0x9c7d,0x6021}, {0x9c7e,0x6060}, {0x9c80,0x6019}, {0x9c81,0x6010}, {0x9c82,0x6029}, {0x9c83,0x600e}, {0x9c84,0x6031}, {0x9c85,0x601b}, {0x9c86,0x6015}, {0x9c87,0x602b}, {0x9c88,0x6026}, {0x9c89,0x600f}, {0x9c8a,0x603a}, {0x9c8b,0x605a}, {0x9c8c,0x6041}, {0x9c8d,0x606a}, {0x9c8e,0x6077}, {0x9c8f,0x605f}, {0x9c90,0x604a}, {0x9c91,0x6046}, {0x9c92,0x604d}, {0x9c93,0x6063}, {0x9c94,0x6043}, {0x9c95,0x6064}, {0x9c96,0x6042}, {0x9c97,0x606c}, {0x9c98,0x606b}, {0x9c99,0x6059}, {0x9c9a,0x6081}, {0x9c9b,0x608d}, {0x9c9c,0x60e7}, {0x9c9d,0x6083}, {0x9c9e,0x609a}, {0x9c9f,0x6084}, {0x9ca0,0x609b}, {0x9ca1,0x6096}, {0x9ca2,0x6097}, {0x9ca3,0x6092}, {0x9ca4,0x60a7}, {0x9ca5,0x608b}, {0x9ca6,0x60e1}, {0x9ca7,0x60b8}, {0x9ca8,0x60e0}, {0x9ca9,0x60d3}, {0x9caa,0x60b4}, {0x9cab,0x5ff0}, {0x9cac,0x60bd}, {0x9cad,0x60c6}, {0x9cae,0x60b5}, {0x9caf,0x60d8}, {0x9cb0,0x614d}, {0x9cb1,0x6115}, {0x9cb2,0x6106}, {0x9cb3,0x60f6}, {0x9cb4,0x60f7}, {0x9cb5,0x6100}, {0x9cb6,0x60f4}, {0x9cb7,0x60fa}, {0x9cb8,0x6103}, {0x9cb9,0x6121}, {0x9cba,0x60fb}, {0x9cbb,0x60f1}, {0x9cbc,0x610d}, {0x9cbd,0x610e}, {0x9cbe,0x6147}, {0x9cbf,0x613e}, {0x9cc0,0x6128}, {0x9cc1,0x6127}, {0x9cc2,0x614a}, {0x9cc3,0x613f}, {0x9cc4,0x613c}, {0x9cc5,0x612c}, {0x9cc6,0x6134}, {0x9cc7,0x613d}, {0x9cc8,0x6142}, {0x9cc9,0x6144}, {0x9cca,0x6173}, {0x9ccb,0x6177}, {0x9ccc,0x6158}, {0x9ccd,0x6159}, {0x9cce,0x615a}, {0x9ccf,0x616b}, {0x9cd0,0x6174}, {0x9cd1,0x616f}, {0x9cd2,0x6165}, {0x9cd3,0x6171}, {0x9cd4,0x615f}, {0x9cd5,0x615d}, {0x9cd6,0x6153}, {0x9cd7,0x6175}, {0x9cd8,0x6199}, {0x9cd9,0x6196}, {0x9cda,0x6187}, {0x9cdb,0x61ac}, {0x9cdc,0x6194}, {0x9cdd,0x619a}, {0x9cde,0x618a}, {0x9cdf,0x6191}, {0x9ce0,0x61ab}, {0x9ce1,0x61ae}, {0x9ce2,0x61cc}, {0x9ce3,0x61ca}, {0x9ce4,0x61c9}, {0x9ce5,0x61f7}, {0x9ce6,0x61c8}, {0x9ce7,0x61c3}, {0x9ce8,0x61c6}, {0x9ce9,0x61ba}, {0x9cea,0x61cb}, {0x9ceb,0x7f79}, {0x9cec,0x61cd}, {0x9ced,0x61e6}, {0x9cee,0x61e3}, {0x9cef,0x61f6}, {0x9cf0,0x61fa}, {0x9cf1,0x61f4}, {0x9cf2,0x61ff}, {0x9cf3,0x61fd}, {0x9cf4,0x61fc}, {0x9cf5,0x61fe}, {0x9cf6,0x6200}, {0x9cf7,0x6208}, {0x9cf8,0x6209}, {0x9cf9,0x620d}, {0x9cfa,0x620c}, {0x9cfb,0x6214}, {0x9cfc,0x621b}, {0x9d40,0x621e}, {0x9d41,0x6221}, {0x9d42,0x622a}, {0x9d43,0x622e}, {0x9d44,0x6230}, {0x9d45,0x6232}, {0x9d46,0x6233}, {0x9d47,0x6241}, {0x9d48,0x624e}, {0x9d49,0x625e}, {0x9d4a,0x6263}, {0x9d4b,0x625b}, {0x9d4c,0x6260}, {0x9d4d,0x6268}, {0x9d4e,0x627c}, {0x9d4f,0x6282}, {0x9d50,0x6289}, {0x9d51,0x627e}, {0x9d52,0x6292}, {0x9d53,0x6293}, {0x9d54,0x6296}, {0x9d55,0x62d4}, {0x9d56,0x6283}, {0x9d57,0x6294}, {0x9d58,0x62d7}, {0x9d59,0x62d1}, {0x9d5a,0x62bb}, {0x9d5b,0x62cf}, {0x9d5c,0x62ff}, {0x9d5d,0x62c6}, {0x9d5e,0x64d4}, {0x9d5f,0x62c8}, {0x9d60,0x62dc}, {0x9d61,0x62cc}, {0x9d62,0x62ca}, {0x9d63,0x62c2}, {0x9d64,0x62c7}, {0x9d65,0x629b}, {0x9d66,0x62c9}, {0x9d67,0x630c}, {0x9d68,0x62ee}, {0x9d69,0x62f1}, {0x9d6a,0x6327}, {0x9d6b,0x6302}, {0x9d6c,0x6308}, {0x9d6d,0x62ef}, {0x9d6e,0x62f5}, {0x9d6f,0x6350}, {0x9d70,0x633e}, {0x9d71,0x634d}, {0x9d72,0x641c}, {0x9d73,0x634f}, {0x9d74,0x6396}, {0x9d75,0x638e}, {0x9d76,0x6380}, {0x9d77,0x63ab}, {0x9d78,0x6376}, {0x9d79,0x63a3}, {0x9d7a,0x638f}, {0x9d7b,0x6389}, {0x9d7c,0x639f}, {0x9d7d,0x63b5}, {0x9d7e,0x636b}, {0x9d80,0x6369}, {0x9d81,0x63be}, {0x9d82,0x63e9}, {0x9d83,0x63c0}, {0x9d84,0x63c6}, {0x9d85,0x63e3}, {0x9d86,0x63c9}, {0x9d87,0x63d2}, {0x9d88,0x63f6}, {0x9d89,0x63c4}, {0x9d8a,0x6416}, {0x9d8b,0x6434}, {0x9d8c,0x6406}, {0x9d8d,0x6413}, {0x9d8e,0x6426}, {0x9d8f,0x6436}, {0x9d90,0x651d}, {0x9d91,0x6417}, {0x9d92,0x6428}, {0x9d93,0x640f}, {0x9d94,0x6467}, {0x9d95,0x646f}, {0x9d96,0x6476}, {0x9d97,0x644e}, {0x9d98,0x652a}, {0x9d99,0x6495}, {0x9d9a,0x6493}, {0x9d9b,0x64a5}, {0x9d9c,0x64a9}, {0x9d9d,0x6488}, {0x9d9e,0x64bc}, {0x9d9f,0x64da}, {0x9da0,0x64d2}, {0x9da1,0x64c5}, {0x9da2,0x64c7}, {0x9da3,0x64bb}, {0x9da4,0x64d8}, {0x9da5,0x64c2}, {0x9da6,0x64f1}, {0x9da7,0x64e7}, {0x9da8,0x8209}, {0x9da9,0x64e0}, {0x9daa,0x64e1}, {0x9dab,0x62ac}, {0x9dac,0x64e3}, {0x9dad,0x64ef}, {0x9dae,0x652c}, {0x9daf,0x64f6}, {0x9db0,0x64f4}, {0x9db1,0x64f2}, {0x9db2,0x64fa}, {0x9db3,0x6500}, {0x9db4,0x64fd}, {0x9db5,0x6518}, {0x9db6,0x651c}, {0x9db7,0x6505}, {0x9db8,0x6524}, {0x9db9,0x6523}, {0x9dba,0x652b}, {0x9dbb,0x6534}, {0x9dbc,0x6535}, {0x9dbd,0x6537}, {0x9dbe,0x6536}, {0x9dbf,0x6538}, {0x9dc0,0x754b}, {0x9dc1,0x6548}, {0x9dc2,0x6556}, {0x9dc3,0x6555}, {0x9dc4,0x654d}, {0x9dc5,0x6558}, {0x9dc6,0x655e}, {0x9dc7,0x655d}, {0x9dc8,0x6572}, {0x9dc9,0x6578}, {0x9dca,0x6582}, {0x9dcb,0x6583}, {0x9dcc,0x8b8a}, {0x9dcd,0x659b}, {0x9dce,0x659f}, {0x9dcf,0x65ab}, {0x9dd0,0x65b7}, {0x9dd1,0x65c3}, {0x9dd2,0x65c6}, {0x9dd3,0x65c1}, {0x9dd4,0x65c4}, {0x9dd5,0x65cc}, {0x9dd6,0x65d2}, {0x9dd7,0x65db}, {0x9dd8,0x65d9}, {0x9dd9,0x65e0}, {0x9dda,0x65e1}, {0x9ddb,0x65f1}, {0x9ddc,0x6772}, {0x9ddd,0x660a}, {0x9dde,0x6603}, {0x9ddf,0x65fb}, {0x9de0,0x6773}, {0x9de1,0x6635}, {0x9de2,0x6636}, {0x9de3,0x6634}, {0x9de4,0x661c}, {0x9de5,0x664f}, {0x9de6,0x6644}, {0x9de7,0x6649}, {0x9de8,0x6641}, {0x9de9,0x665e}, {0x9dea,0x665d}, {0x9deb,0x6664}, {0x9dec,0x6667}, {0x9ded,0x6668}, {0x9dee,0x665f}, {0x9def,0x6662}, {0x9df0,0x6670}, {0x9df1,0x6683}, {0x9df2,0x6688}, {0x9df3,0x668e}, {0x9df4,0x6689}, {0x9df5,0x6684}, {0x9df6,0x6698}, {0x9df7,0x669d}, {0x9df8,0x66c1}, {0x9df9,0x66b9}, {0x9dfa,0x66c9}, {0x9dfb,0x66be}, {0x9dfc,0x66bc}, {0x9e40,0x66c4}, {0x9e41,0x66b8}, {0x9e42,0x66d6}, {0x9e43,0x66da}, {0x9e44,0x66e0}, {0x9e45,0x663f}, {0x9e46,0x66e6}, {0x9e47,0x66e9}, {0x9e48,0x66f0}, {0x9e49,0x66f5}, {0x9e4a,0x66f7}, {0x9e4b,0x670f}, {0x9e4c,0x6716}, {0x9e4d,0x671e}, {0x9e4e,0x6726}, {0x9e4f,0x6727}, {0x9e50,0x9738}, {0x9e51,0x672e}, {0x9e52,0x673f}, {0x9e53,0x6736}, {0x9e54,0x6741}, {0x9e55,0x6738}, {0x9e56,0x6737}, {0x9e57,0x6746}, {0x9e58,0x675e}, {0x9e59,0x6760}, {0x9e5a,0x6759}, {0x9e5b,0x6763}, {0x9e5c,0x6764}, {0x9e5d,0x6789}, {0x9e5e,0x6770}, {0x9e5f,0x67a9}, {0x9e60,0x677c}, {0x9e61,0x676a}, {0x9e62,0x678c}, {0x9e63,0x678b}, {0x9e64,0x67a6}, {0x9e65,0x67a1}, {0x9e66,0x6785}, {0x9e67,0x67b7}, {0x9e68,0x67ef}, {0x9e69,0x67b4}, {0x9e6a,0x67ec}, {0x9e6b,0x67b3}, {0x9e6c,0x67e9}, {0x9e6d,0x67b8}, {0x9e6e,0x67e4}, {0x9e6f,0x67de}, {0x9e70,0x67dd}, {0x9e71,0x67e2}, {0x9e72,0x67ee}, {0x9e73,0x67b9}, {0x9e74,0x67ce}, {0x9e75,0x67c6}, {0x9e76,0x67e7}, {0x9e77,0x6a9c}, {0x9e78,0x681e}, {0x9e79,0x6846}, {0x9e7a,0x6829}, {0x9e7b,0x6840}, {0x9e7c,0x684d}, {0x9e7d,0x6832}, {0x9e7e,0x684e}, {0x9e80,0x68b3}, {0x9e81,0x682b}, {0x9e82,0x6859}, {0x9e83,0x6863}, {0x9e84,0x6877}, {0x9e85,0x687f}, {0x9e86,0x689f}, {0x9e87,0x688f}, {0x9e88,0x68ad}, {0x9e89,0x6894}, {0x9e8a,0x689d}, {0x9e8b,0x689b}, {0x9e8c,0x6883}, {0x9e8d,0x6aae}, {0x9e8e,0x68b9}, {0x9e8f,0x6874}, {0x9e90,0x68b5}, {0x9e91,0x68a0}, {0x9e92,0x68ba}, {0x9e93,0x690f}, {0x9e94,0x688d}, {0x9e95,0x687e}, {0x9e96,0x6901}, {0x9e97,0x68ca}, {0x9e98,0x6908}, {0x9e99,0x68d8}, {0x9e9a,0x6922}, {0x9e9b,0x6926}, {0x9e9c,0x68e1}, {0x9e9d,0x690c}, {0x9e9e,0x68cd}, {0x9e9f,0x68d4}, {0x9ea0,0x68e7}, {0x9ea1,0x68d5}, {0x9ea2,0x6936}, {0x9ea3,0x6912}, {0x9ea4,0x6904}, {0x9ea5,0x68d7}, {0x9ea6,0x68e3}, {0x9ea7,0x6925}, {0x9ea8,0x68f9}, {0x9ea9,0x68e0}, {0x9eaa,0x68ef}, {0x9eab,0x6928}, {0x9eac,0x692a}, {0x9ead,0x691a}, {0x9eae,0x6923}, {0x9eaf,0x6921}, {0x9eb0,0x68c6}, {0x9eb1,0x6979}, {0x9eb2,0x6977}, {0x9eb3,0x695c}, {0x9eb4,0x6978}, {0x9eb5,0x696b}, {0x9eb6,0x6954}, {0x9eb7,0x697e}, {0x9eb8,0x696e}, {0x9eb9,0x6939}, {0x9eba,0x6974}, {0x9ebb,0x693d}, {0x9ebc,0x6959}, {0x9ebd,0x6930}, {0x9ebe,0x6961}, {0x9ebf,0x695e}, {0x9ec0,0x695d}, {0x9ec1,0x6981}, {0x9ec2,0x696a}, {0x9ec3,0x69b2}, {0x9ec4,0x69ae}, {0x9ec5,0x69d0}, {0x9ec6,0x69bf}, {0x9ec7,0x69c1}, {0x9ec8,0x69d3}, {0x9ec9,0x69be}, {0x9eca,0x69ce}, {0x9ecb,0x5be8}, {0x9ecc,0x69ca}, {0x9ecd,0x69dd}, {0x9ece,0x69bb}, {0x9ecf,0x69c3}, {0x9ed0,0x69a7}, {0x9ed1,0x6a2e}, {0x9ed2,0x6991}, {0x9ed3,0x69a0}, {0x9ed4,0x699c}, {0x9ed5,0x6995}, {0x9ed6,0x69b4}, {0x9ed7,0x69de}, {0x9ed8,0x69e8}, {0x9ed9,0x6a02}, {0x9eda,0x6a1b}, {0x9edb,0x69ff}, {0x9edc,0x6b0a}, {0x9edd,0x69f9}, {0x9ede,0x69f2}, {0x9edf,0x69e7}, {0x9ee0,0x6a05}, {0x9ee1,0x69b1}, {0x9ee2,0x6a1e}, {0x9ee3,0x69ed}, {0x9ee4,0x6a14}, {0x9ee5,0x69eb}, {0x9ee6,0x6a0a}, {0x9ee7,0x6a12}, {0x9ee8,0x6ac1}, {0x9ee9,0x6a23}, {0x9eea,0x6a13}, {0x9eeb,0x6a44}, {0x9eec,0x6a0c}, {0x9eed,0x6a72}, {0x9eee,0x6a36}, {0x9eef,0x6a78}, {0x9ef0,0x6a47}, {0x9ef1,0x6a62}, {0x9ef2,0x6a59}, {0x9ef3,0x6a66}, {0x9ef4,0x6a48}, {0x9ef5,0x6a38}, {0x9ef6,0x6a22}, {0x9ef7,0x6a90}, {0x9ef8,0x6a8d}, {0x9ef9,0x6aa0}, {0x9efa,0x6a84}, {0x9efb,0x6aa2}, {0x9efc,0x6aa3}, {0x9f40,0x6a97}, {0x9f41,0x8617}, {0x9f42,0x6abb}, {0x9f43,0x6ac3}, {0x9f44,0x6ac2}, {0x9f45,0x6ab8}, {0x9f46,0x6ab3}, {0x9f47,0x6aac}, {0x9f48,0x6ade}, {0x9f49,0x6ad1}, {0x9f4a,0x6adf}, {0x9f4b,0x6aaa}, {0x9f4c,0x6ada}, {0x9f4d,0x6aea}, {0x9f4e,0x6afb}, {0x9f4f,0x6b05}, {0x9f50,0x8616}, {0x9f51,0x6afa}, {0x9f52,0x6b12}, {0x9f53,0x6b16}, {0x9f54,0x9b31}, {0x9f55,0x6b1f}, {0x9f56,0x6b38}, {0x9f57,0x6b37}, {0x9f58,0x76dc}, {0x9f59,0x6b39}, {0x9f5a,0x98ee}, {0x9f5b,0x6b47}, {0x9f5c,0x6b43}, {0x9f5d,0x6b49}, {0x9f5e,0x6b50}, {0x9f5f,0x6b59}, {0x9f60,0x6b54}, {0x9f61,0x6b5b}, {0x9f62,0x6b5f}, {0x9f63,0x6b61}, {0x9f64,0x6b78}, {0x9f65,0x6b79}, {0x9f66,0x6b7f}, {0x9f67,0x6b80}, {0x9f68,0x6b84}, {0x9f69,0x6b83}, {0x9f6a,0x6b8d}, {0x9f6b,0x6b98}, {0x9f6c,0x6b95}, {0x9f6d,0x6b9e}, {0x9f6e,0x6ba4}, {0x9f6f,0x6baa}, {0x9f70,0x6bab}, {0x9f71,0x6baf}, {0x9f72,0x6bb2}, {0x9f73,0x6bb1}, {0x9f74,0x6bb3}, {0x9f75,0x6bb7}, {0x9f76,0x6bbc}, {0x9f77,0x6bc6}, {0x9f78,0x6bcb}, {0x9f79,0x6bd3}, {0x9f7a,0x6bdf}, {0x9f7b,0x6bec}, {0x9f7c,0x6beb}, {0x9f7d,0x6bf3}, {0x9f7e,0x6bef}, {0x9f80,0x9ebe}, {0x9f81,0x6c08}, {0x9f82,0x6c13}, {0x9f83,0x6c14}, {0x9f84,0x6c1b}, {0x9f85,0x6c24}, {0x9f86,0x6c23}, {0x9f87,0x6c5e}, {0x9f88,0x6c55}, {0x9f89,0x6c62}, {0x9f8a,0x6c6a}, {0x9f8b,0x6c82}, {0x9f8c,0x6c8d}, {0x9f8d,0x6c9a}, {0x9f8e,0x6c81}, {0x9f8f,0x6c9b}, {0x9f90,0x6c7e}, {0x9f91,0x6c68}, {0x9f92,0x6c73}, {0x9f93,0x6c92}, {0x9f94,0x6c90}, {0x9f95,0x6cc4}, {0x9f96,0x6cf1}, {0x9f97,0x6cd3}, {0x9f98,0x6cbd}, {0x9f99,0x6cd7}, {0x9f9a,0x6cc5}, {0x9f9b,0x6cdd}, {0x9f9c,0x6cae}, {0x9f9d,0x6cb1}, {0x9f9e,0x6cbe}, {0x9f9f,0x6cba}, {0x9fa0,0x6cdb}, {0x9fa1,0x6cef}, {0x9fa2,0x6cd9}, {0x9fa3,0x6cea}, {0x9fa4,0x6d1f}, {0x9fa5,0x884d}, {0x9fa6,0x6d36}, {0x9fa7,0x6d2b}, {0x9fa8,0x6d3d}, {0x9fa9,0x6d38}, {0x9faa,0x6d19}, {0x9fab,0x6d35}, {0x9fac,0x6d33}, {0x9fad,0x6d12}, {0x9fae,0x6d0c}, {0x9faf,0x6d63}, {0x9fb0,0x6d93}, {0x9fb1,0x6d64}, {0x9fb2,0x6d5a}, {0x9fb3,0x6d79}, {0x9fb4,0x6d59}, {0x9fb5,0x6d8e}, {0x9fb6,0x6d95}, {0x9fb7,0x6fe4}, {0x9fb8,0x6d85}, {0x9fb9,0x6df9}, {0x9fba,0x6e15}, {0x9fbb,0x6e0a}, {0x9fbc,0x6db5}, {0x9fbd,0x6dc7}, {0x9fbe,0x6de6}, {0x9fbf,0x6db8}, {0x9fc0,0x6dc6}, {0x9fc1,0x6dec}, {0x9fc2,0x6dde}, {0x9fc3,0x6dcc}, {0x9fc4,0x6de8}, {0x9fc5,0x6dd2}, {0x9fc6,0x6dc5}, {0x9fc7,0x6dfa}, {0x9fc8,0x6dd9}, {0x9fc9,0x6de4}, {0x9fca,0x6dd5}, {0x9fcb,0x6dea}, {0x9fcc,0x6dee}, {0x9fcd,0x6e2d}, {0x9fce,0x6e6e}, {0x9fcf,0x6e2e}, {0x9fd0,0x6e19}, {0x9fd1,0x6e72}, {0x9fd2,0x6e5f}, {0x9fd3,0x6e3e}, {0x9fd4,0x6e23}, {0x9fd5,0x6e6b}, {0x9fd6,0x6e2b}, {0x9fd7,0x6e76}, {0x9fd8,0x6e4d}, {0x9fd9,0x6e1f}, {0x9fda,0x6e43}, {0x9fdb,0x6e3a}, {0x9fdc,0x6e4e}, {0x9fdd,0x6e24}, {0x9fde,0x6eff}, {0x9fdf,0x6e1d}, {0x9fe0,0x6e38}, {0x9fe1,0x6e82}, {0x9fe2,0x6eaa}, {0x9fe3,0x6e98}, {0x9fe4,0x6ec9}, {0x9fe5,0x6eb7}, {0x9fe6,0x6ed3}, {0x9fe7,0x6ebd}, {0x9fe8,0x6eaf}, {0x9fe9,0x6ec4}, {0x9fea,0x6eb2}, {0x9feb,0x6ed4}, {0x9fec,0x6ed5}, {0x9fed,0x6e8f}, {0x9fee,0x6ea5}, {0x9fef,0x6ec2}, {0x9ff0,0x6e9f}, {0x9ff1,0x6f41}, {0x9ff2,0x6f11}, {0x9ff3,0x704c}, {0x9ff4,0x6eec}, {0x9ff5,0x6ef8}, {0x9ff6,0x6efe}, {0x9ff7,0x6f3f}, {0x9ff8,0x6ef2}, {0x9ff9,0x6f31}, {0x9ffa,0x6eef}, {0x9ffb,0x6f32}, {0x9ffc,0x6ecc}, {0xe040,0x6f3e}, {0xe041,0x6f13}, {0xe042,0x6ef7}, {0xe043,0x6f86}, {0xe044,0x6f7a}, {0xe045,0x6f78}, {0xe046,0x6f81}, {0xe047,0x6f80}, {0xe048,0x6f6f}, {0xe049,0x6f5b}, {0xe04a,0x6ff3}, {0xe04b,0x6f6d}, {0xe04c,0x6f82}, {0xe04d,0x6f7c}, {0xe04e,0x6f58}, {0xe04f,0x6f8e}, {0xe050,0x6f91}, {0xe051,0x6fc2}, {0xe052,0x6f66}, {0xe053,0x6fb3}, {0xe054,0x6fa3}, {0xe055,0x6fa1}, {0xe056,0x6fa4}, {0xe057,0x6fb9}, {0xe058,0x6fc6}, {0xe059,0x6faa}, {0xe05a,0x6fdf}, {0xe05b,0x6fd5}, {0xe05c,0x6fec}, {0xe05d,0x6fd4}, {0xe05e,0x6fd8}, {0xe05f,0x6ff1}, {0xe060,0x6fee}, {0xe061,0x6fdb}, {0xe062,0x7009}, {0xe063,0x700b}, {0xe064,0x6ffa}, {0xe065,0x7011}, {0xe066,0x7001}, {0xe067,0x700f}, {0xe068,0x6ffe}, {0xe069,0x701b}, {0xe06a,0x701a}, {0xe06b,0x6f74}, {0xe06c,0x701d}, {0xe06d,0x7018}, {0xe06e,0x701f}, {0xe06f,0x7030}, {0xe070,0x703e}, {0xe071,0x7032}, {0xe072,0x7051}, {0xe073,0x7063}, {0xe074,0x7099}, {0xe075,0x7092}, {0xe076,0x70af}, {0xe077,0x70f1}, {0xe078,0x70ac}, {0xe079,0x70b8}, {0xe07a,0x70b3}, {0xe07b,0x70ae}, {0xe07c,0x70df}, {0xe07d,0x70cb}, {0xe07e,0x70dd}, {0xe080,0x70d9}, {0xe081,0x7109}, {0xe082,0x70fd}, {0xe083,0x711c}, {0xe084,0x7119}, {0xe085,0x7165}, {0xe086,0x7155}, {0xe087,0x7188}, {0xe088,0x7166}, {0xe089,0x7162}, {0xe08a,0x714c}, {0xe08b,0x7156}, {0xe08c,0x716c}, {0xe08d,0x718f}, {0xe08e,0x71fb}, {0xe08f,0x7184}, {0xe090,0x7195}, {0xe091,0x71a8}, {0xe092,0x71ac}, {0xe093,0x71d7}, {0xe094,0x71b9}, {0xe095,0x71be}, {0xe096,0x71d2}, {0xe097,0x71c9}, {0xe098,0x71d4}, {0xe099,0x71ce}, {0xe09a,0x71e0}, {0xe09b,0x71ec}, {0xe09c,0x71e7}, {0xe09d,0x71f5}, {0xe09e,0x71fc}, {0xe09f,0x71f9}, {0xe0a0,0x71ff}, {0xe0a1,0x720d}, {0xe0a2,0x7210}, {0xe0a3,0x721b}, {0xe0a4,0x7228}, {0xe0a5,0x722d}, {0xe0a6,0x722c}, {0xe0a7,0x7230}, {0xe0a8,0x7232}, {0xe0a9,0x723b}, {0xe0aa,0x723c}, {0xe0ab,0x723f}, {0xe0ac,0x7240}, {0xe0ad,0x7246}, {0xe0ae,0x724b}, {0xe0af,0x7258}, {0xe0b0,0x7274}, {0xe0b1,0x727e}, {0xe0b2,0x7282}, {0xe0b3,0x7281}, {0xe0b4,0x7287}, {0xe0b5,0x7292}, {0xe0b6,0x7296}, {0xe0b7,0x72a2}, {0xe0b8,0x72a7}, {0xe0b9,0x72b9}, {0xe0ba,0x72b2}, {0xe0bb,0x72c3}, {0xe0bc,0x72c6}, {0xe0bd,0x72c4}, {0xe0be,0x72ce}, {0xe0bf,0x72d2}, {0xe0c0,0x72e2}, {0xe0c1,0x72e0}, {0xe0c2,0x72e1}, {0xe0c3,0x72f9}, {0xe0c4,0x72f7}, {0xe0c5,0x500f}, {0xe0c6,0x7317}, {0xe0c7,0x730a}, {0xe0c8,0x731c}, {0xe0c9,0x7316}, {0xe0ca,0x731d}, {0xe0cb,0x7334}, {0xe0cc,0x732f}, {0xe0cd,0x7329}, {0xe0ce,0x7325}, {0xe0cf,0x733e}, {0xe0d0,0x734e}, {0xe0d1,0x734f}, {0xe0d2,0x9ed8}, {0xe0d3,0x7357}, {0xe0d4,0x736a}, {0xe0d5,0x7368}, {0xe0d6,0x7370}, {0xe0d7,0x7378}, {0xe0d8,0x7375}, {0xe0d9,0x737b}, {0xe0da,0x737a}, {0xe0db,0x73c8}, {0xe0dc,0x73b3}, {0xe0dd,0x73ce}, {0xe0de,0x73bb}, {0xe0df,0x73c0}, {0xe0e0,0x73e5}, {0xe0e1,0x73ee}, {0xe0e2,0x73de}, {0xe0e3,0x74a2}, {0xe0e4,0x7405}, {0xe0e5,0x746f}, {0xe0e6,0x7425}, {0xe0e7,0x73f8}, {0xe0e8,0x7432}, {0xe0e9,0x743a}, {0xe0ea,0x7455}, {0xe0eb,0x743f}, {0xe0ec,0x745f}, {0xe0ed,0x7459}, {0xe0ee,0x7441}, {0xe0ef,0x745c}, {0xe0f0,0x7469}, {0xe0f1,0x7470}, {0xe0f2,0x7463}, {0xe0f3,0x746a}, {0xe0f4,0x7476}, {0xe0f5,0x747e}, {0xe0f6,0x748b}, {0xe0f7,0x749e}, {0xe0f8,0x74a7}, {0xe0f9,0x74ca}, {0xe0fa,0x74cf}, {0xe0fb,0x74d4}, {0xe0fc,0x73f1}, {0xe140,0x74e0}, {0xe141,0x74e3}, {0xe142,0x74e7}, {0xe143,0x74e9}, {0xe144,0x74ee}, {0xe145,0x74f2}, {0xe146,0x74f0}, {0xe147,0x74f1}, {0xe148,0x74f8}, {0xe149,0x74f7}, {0xe14a,0x7504}, {0xe14b,0x7503}, {0xe14c,0x7505}, {0xe14d,0x750c}, {0xe14e,0x750e}, {0xe14f,0x750d}, {0xe150,0x7515}, {0xe151,0x7513}, {0xe152,0x751e}, {0xe153,0x7526}, {0xe154,0x752c}, {0xe155,0x753c}, {0xe156,0x7544}, {0xe157,0x754d}, {0xe158,0x754a}, {0xe159,0x7549}, {0xe15a,0x755b}, {0xe15b,0x7546}, {0xe15c,0x755a}, {0xe15d,0x7569}, {0xe15e,0x7564}, {0xe15f,0x7567}, {0xe160,0x756b}, {0xe161,0x756d}, {0xe162,0x7578}, {0xe163,0x7576}, {0xe164,0x7586}, {0xe165,0x7587}, {0xe166,0x7574}, {0xe167,0x758a}, {0xe168,0x7589}, {0xe169,0x7582}, {0xe16a,0x7594}, {0xe16b,0x759a}, {0xe16c,0x759d}, {0xe16d,0x75a5}, {0xe16e,0x75a3}, {0xe16f,0x75c2}, {0xe170,0x75b3}, {0xe171,0x75c3}, {0xe172,0x75b5}, {0xe173,0x75bd}, {0xe174,0x75b8}, {0xe175,0x75bc}, {0xe176,0x75b1}, {0xe177,0x75cd}, {0xe178,0x75ca}, {0xe179,0x75d2}, {0xe17a,0x75d9}, {0xe17b,0x75e3}, {0xe17c,0x75de}, {0xe17d,0x75fe}, {0xe17e,0x75ff}, {0xe180,0x75fc}, {0xe181,0x7601}, {0xe182,0x75f0}, {0xe183,0x75fa}, {0xe184,0x75f2}, {0xe185,0x75f3}, {0xe186,0x760b}, {0xe187,0x760d}, {0xe188,0x7609}, {0xe189,0x761f}, {0xe18a,0x7627}, {0xe18b,0x7620}, {0xe18c,0x7621}, {0xe18d,0x7622}, {0xe18e,0x7624}, {0xe18f,0x7634}, {0xe190,0x7630}, {0xe191,0x763b}, {0xe192,0x7647}, {0xe193,0x7648}, {0xe194,0x7646}, {0xe195,0x765c}, {0xe196,0x7658}, {0xe197,0x7661}, {0xe198,0x7662}, {0xe199,0x7668}, {0xe19a,0x7669}, {0xe19b,0x766a}, {0xe19c,0x7667}, {0xe19d,0x766c}, {0xe19e,0x7670}, {0xe19f,0x7672}, {0xe1a0,0x7676}, {0xe1a1,0x7678}, {0xe1a2,0x767c}, {0xe1a3,0x7680}, {0xe1a4,0x7683}, {0xe1a5,0x7688}, {0xe1a6,0x768b}, {0xe1a7,0x768e}, {0xe1a8,0x7696}, {0xe1a9,0x7693}, {0xe1aa,0x7699}, {0xe1ab,0x769a}, {0xe1ac,0x76b0}, {0xe1ad,0x76b4}, {0xe1ae,0x76b8}, {0xe1af,0x76b9}, {0xe1b0,0x76ba}, {0xe1b1,0x76c2}, {0xe1b2,0x76cd}, {0xe1b3,0x76d6}, {0xe1b4,0x76d2}, {0xe1b5,0x76de}, {0xe1b6,0x76e1}, {0xe1b7,0x76e5}, {0xe1b8,0x76e7}, {0xe1b9,0x76ea}, {0xe1ba,0x862f}, {0xe1bb,0x76fb}, {0xe1bc,0x7708}, {0xe1bd,0x7707}, {0xe1be,0x7704}, {0xe1bf,0x7729}, {0xe1c0,0x7724}, {0xe1c1,0x771e}, {0xe1c2,0x7725}, {0xe1c3,0x7726}, {0xe1c4,0x771b}, {0xe1c5,0x7737}, {0xe1c6,0x7738}, {0xe1c7,0x7747}, {0xe1c8,0x775a}, {0xe1c9,0x7768}, {0xe1ca,0x776b}, {0xe1cb,0x775b}, {0xe1cc,0x7765}, {0xe1cd,0x777f}, {0xe1ce,0x777e}, {0xe1cf,0x7779}, {0xe1d0,0x778e}, {0xe1d1,0x778b}, {0xe1d2,0x7791}, {0xe1d3,0x77a0}, {0xe1d4,0x779e}, {0xe1d5,0x77b0}, {0xe1d6,0x77b6}, {0xe1d7,0x77b9}, {0xe1d8,0x77bf}, {0xe1d9,0x77bc}, {0xe1da,0x77bd}, {0xe1db,0x77bb}, {0xe1dc,0x77c7}, {0xe1dd,0x77cd}, {0xe1de,0x77d7}, {0xe1df,0x77da}, {0xe1e0,0x77dc}, {0xe1e1,0x77e3}, {0xe1e2,0x77ee}, {0xe1e3,0x77fc}, {0xe1e4,0x780c}, {0xe1e5,0x7812}, {0xe1e6,0x7926}, {0xe1e7,0x7820}, {0xe1e8,0x792a}, {0xe1e9,0x7845}, {0xe1ea,0x788e}, {0xe1eb,0x7874}, {0xe1ec,0x7886}, {0xe1ed,0x787c}, {0xe1ee,0x789a}, {0xe1ef,0x788c}, {0xe1f0,0x78a3}, {0xe1f1,0x78b5}, {0xe1f2,0x78aa}, {0xe1f3,0x78af}, {0xe1f4,0x78d1}, {0xe1f5,0x78c6}, {0xe1f6,0x78cb}, {0xe1f7,0x78d4}, {0xe1f8,0x78be}, {0xe1f9,0x78bc}, {0xe1fa,0x78c5}, {0xe1fb,0x78ca}, {0xe1fc,0x78ec}, {0xe240,0x78e7}, {0xe241,0x78da}, {0xe242,0x78fd}, {0xe243,0x78f4}, {0xe244,0x7907}, {0xe245,0x7912}, {0xe246,0x7911}, {0xe247,0x7919}, {0xe248,0x792c}, {0xe249,0x792b}, {0xe24a,0x7940}, {0xe24b,0x7960}, {0xe24c,0x7957}, {0xe24d,0x795f}, {0xe24e,0x795a}, {0xe24f,0x7955}, {0xe250,0x7953}, {0xe251,0x797a}, {0xe252,0x797f}, {0xe253,0x798a}, {0xe254,0x799d}, {0xe255,0x79a7}, {0xe256,0x9f4b}, {0xe257,0x79aa}, {0xe258,0x79ae}, {0xe259,0x79b3}, {0xe25a,0x79b9}, {0xe25b,0x79ba}, {0xe25c,0x79c9}, {0xe25d,0x79d5}, {0xe25e,0x79e7}, {0xe25f,0x79ec}, {0xe260,0x79e1}, {0xe261,0x79e3}, {0xe262,0x7a08}, {0xe263,0x7a0d}, {0xe264,0x7a18}, {0xe265,0x7a19}, {0xe266,0x7a20}, {0xe267,0x7a1f}, {0xe268,0x7980}, {0xe269,0x7a31}, {0xe26a,0x7a3b}, {0xe26b,0x7a3e}, {0xe26c,0x7a37}, {0xe26d,0x7a43}, {0xe26e,0x7a57}, {0xe26f,0x7a49}, {0xe270,0x7a61}, {0xe271,0x7a62}, {0xe272,0x7a69}, {0xe273,0x9f9d}, {0xe274,0x7a70}, {0xe275,0x7a79}, {0xe276,0x7a7d}, {0xe277,0x7a88}, {0xe278,0x7a97}, {0xe279,0x7a95}, {0xe27a,0x7a98}, {0xe27b,0x7a96}, {0xe27c,0x7aa9}, {0xe27d,0x7ac8}, {0xe27e,0x7ab0}, {0xe280,0x7ab6}, {0xe281,0x7ac5}, {0xe282,0x7ac4}, {0xe283,0x7abf}, {0xe284,0x9083}, {0xe285,0x7ac7}, {0xe286,0x7aca}, {0xe287,0x7acd}, {0xe288,0x7acf}, {0xe289,0x7ad5}, {0xe28a,0x7ad3}, {0xe28b,0x7ad9}, {0xe28c,0x7ada}, {0xe28d,0x7add}, {0xe28e,0x7ae1}, {0xe28f,0x7ae2}, {0xe290,0x7ae6}, {0xe291,0x7aed}, {0xe292,0x7af0}, {0xe293,0x7b02}, {0xe294,0x7b0f}, {0xe295,0x7b0a}, {0xe296,0x7b06}, {0xe297,0x7b33}, {0xe298,0x7b18}, {0xe299,0x7b19}, {0xe29a,0x7b1e}, {0xe29b,0x7b35}, {0xe29c,0x7b28}, {0xe29d,0x7b36}, {0xe29e,0x7b50}, {0xe29f,0x7b7a}, {0xe2a0,0x7b04}, {0xe2a1,0x7b4d}, {0xe2a2,0x7b0b}, {0xe2a3,0x7b4c}, {0xe2a4,0x7b45}, {0xe2a5,0x7b75}, {0xe2a6,0x7b65}, {0xe2a7,0x7b74}, {0xe2a8,0x7b67}, {0xe2a9,0x7b70}, {0xe2aa,0x7b71}, {0xe2ab,0x7b6c}, {0xe2ac,0x7b6e}, {0xe2ad,0x7b9d}, {0xe2ae,0x7b98}, {0xe2af,0x7b9f}, {0xe2b0,0x7b8d}, {0xe2b1,0x7b9c}, {0xe2b2,0x7b9a}, {0xe2b3,0x7b8b}, {0xe2b4,0x7b92}, {0xe2b5,0x7b8f}, {0xe2b6,0x7b5d}, {0xe2b7,0x7b99}, {0xe2b8,0x7bcb}, {0xe2b9,0x7bc1}, {0xe2ba,0x7bcc}, {0xe2bb,0x7bcf}, {0xe2bc,0x7bb4}, {0xe2bd,0x7bc6}, {0xe2be,0x7bdd}, {0xe2bf,0x7be9}, {0xe2c0,0x7c11}, {0xe2c1,0x7c14}, {0xe2c2,0x7be6}, {0xe2c3,0x7be5}, {0xe2c4,0x7c60}, {0xe2c5,0x7c00}, {0xe2c6,0x7c07}, {0xe2c7,0x7c13}, {0xe2c8,0x7bf3}, {0xe2c9,0x7bf7}, {0xe2ca,0x7c17}, {0xe2cb,0x7c0d}, {0xe2cc,0x7bf6}, {0xe2cd,0x7c23}, {0xe2ce,0x7c27}, {0xe2cf,0x7c2a}, {0xe2d0,0x7c1f}, {0xe2d1,0x7c37}, {0xe2d2,0x7c2b}, {0xe2d3,0x7c3d}, {0xe2d4,0x7c4c}, {0xe2d5,0x7c43}, {0xe2d6,0x7c54}, {0xe2d7,0x7c4f}, {0xe2d8,0x7c40}, {0xe2d9,0x7c50}, {0xe2da,0x7c58}, {0xe2db,0x7c5f}, {0xe2dc,0x7c64}, {0xe2dd,0x7c56}, {0xe2de,0x7c65}, {0xe2df,0x7c6c}, {0xe2e0,0x7c75}, {0xe2e1,0x7c83}, {0xe2e2,0x7c90}, {0xe2e3,0x7ca4}, {0xe2e4,0x7cad}, {0xe2e5,0x7ca2}, {0xe2e6,0x7cab}, {0xe2e7,0x7ca1}, {0xe2e8,0x7ca8}, {0xe2e9,0x7cb3}, {0xe2ea,0x7cb2}, {0xe2eb,0x7cb1}, {0xe2ec,0x7cae}, {0xe2ed,0x7cb9}, {0xe2ee,0x7cbd}, {0xe2ef,0x7cc0}, {0xe2f0,0x7cc5}, {0xe2f1,0x7cc2}, {0xe2f2,0x7cd8}, {0xe2f3,0x7cd2}, {0xe2f4,0x7cdc}, {0xe2f5,0x7ce2}, {0xe2f6,0x9b3b}, {0xe2f7,0x7cef}, {0xe2f8,0x7cf2}, {0xe2f9,0x7cf4}, {0xe2fa,0x7cf6}, {0xe2fb,0x7cfa}, {0xe2fc,0x7d06}, {0xe340,0x7d02}, {0xe341,0x7d1c}, {0xe342,0x7d15}, {0xe343,0x7d0a}, {0xe344,0x7d45}, {0xe345,0x7d4b}, {0xe346,0x7d2e}, {0xe347,0x7d32}, {0xe348,0x7d3f}, {0xe349,0x7d35}, {0xe34a,0x7d46}, {0xe34b,0x7d73}, {0xe34c,0x7d56}, {0xe34d,0x7d4e}, {0xe34e,0x7d72}, {0xe34f,0x7d68}, {0xe350,0x7d6e}, {0xe351,0x7d4f}, {0xe352,0x7d63}, {0xe353,0x7d93}, {0xe354,0x7d89}, {0xe355,0x7d5b}, {0xe356,0x7d8f}, {0xe357,0x7d7d}, {0xe358,0x7d9b}, {0xe359,0x7dba}, {0xe35a,0x7dae}, {0xe35b,0x7da3}, {0xe35c,0x7db5}, {0xe35d,0x7dc7}, {0xe35e,0x7dbd}, {0xe35f,0x7dab}, {0xe360,0x7e3d}, {0xe361,0x7da2}, {0xe362,0x7daf}, {0xe363,0x7ddc}, {0xe364,0x7db8}, {0xe365,0x7d9f}, {0xe366,0x7db0}, {0xe367,0x7dd8}, {0xe368,0x7ddd}, {0xe369,0x7de4}, {0xe36a,0x7dde}, {0xe36b,0x7dfb}, {0xe36c,0x7df2}, {0xe36d,0x7de1}, {0xe36e,0x7e05}, {0xe36f,0x7e0a}, {0xe370,0x7e23}, {0xe371,0x7e21}, {0xe372,0x7e12}, {0xe373,0x7e31}, {0xe374,0x7e1f}, {0xe375,0x7e09}, {0xe376,0x7e0b}, {0xe377,0x7e22}, {0xe378,0x7e46}, {0xe379,0x7e66}, {0xe37a,0x7e3b}, {0xe37b,0x7e35}, {0xe37c,0x7e39}, {0xe37d,0x7e43}, {0xe37e,0x7e37}, {0xe380,0x7e32}, {0xe381,0x7e3a}, {0xe382,0x7e67}, {0xe383,0x7e5d}, {0xe384,0x7e56}, {0xe385,0x7e5e}, {0xe386,0x7e59}, {0xe387,0x7e5a}, {0xe388,0x7e79}, {0xe389,0x7e6a}, {0xe38a,0x7e69}, {0xe38b,0x7e7c}, {0xe38c,0x7e7b}, {0xe38d,0x7e83}, {0xe38e,0x7dd5}, {0xe38f,0x7e7d}, {0xe390,0x8fae}, {0xe391,0x7e7f}, {0xe392,0x7e88}, {0xe393,0x7e89}, {0xe394,0x7e8c}, {0xe395,0x7e92}, {0xe396,0x7e90}, {0xe397,0x7e93}, {0xe398,0x7e94}, {0xe399,0x7e96}, {0xe39a,0x7e8e}, {0xe39b,0x7e9b}, {0xe39c,0x7e9c}, {0xe39d,0x7f38}, {0xe39e,0x7f3a}, {0xe39f,0x7f45}, {0xe3a0,0x7f4c}, {0xe3a1,0x7f4d}, {0xe3a2,0x7f4e}, {0xe3a3,0x7f50}, {0xe3a4,0x7f51}, {0xe3a5,0x7f55}, {0xe3a6,0x7f54}, {0xe3a7,0x7f58}, {0xe3a8,0x7f5f}, {0xe3a9,0x7f60}, {0xe3aa,0x7f68}, {0xe3ab,0x7f69}, {0xe3ac,0x7f67}, {0xe3ad,0x7f78}, {0xe3ae,0x7f82}, {0xe3af,0x7f86}, {0xe3b0,0x7f83}, {0xe3b1,0x7f88}, {0xe3b2,0x7f87}, {0xe3b3,0x7f8c}, {0xe3b4,0x7f94}, {0xe3b5,0x7f9e}, {0xe3b6,0x7f9d}, {0xe3b7,0x7f9a}, {0xe3b8,0x7fa3}, {0xe3b9,0x7faf}, {0xe3ba,0x7fb2}, {0xe3bb,0x7fb9}, {0xe3bc,0x7fae}, {0xe3bd,0x7fb6}, {0xe3be,0x7fb8}, {0xe3bf,0x8b71}, {0xe3c0,0x7fc5}, {0xe3c1,0x7fc6}, {0xe3c2,0x7fca}, {0xe3c3,0x7fd5}, {0xe3c4,0x7fd4}, {0xe3c5,0x7fe1}, {0xe3c6,0x7fe6}, {0xe3c7,0x7fe9}, {0xe3c8,0x7ff3}, {0xe3c9,0x7ff9}, {0xe3ca,0x98dc}, {0xe3cb,0x8006}, {0xe3cc,0x8004}, {0xe3cd,0x800b}, {0xe3ce,0x8012}, {0xe3cf,0x8018}, {0xe3d0,0x8019}, {0xe3d1,0x801c}, {0xe3d2,0x8021}, {0xe3d3,0x8028}, {0xe3d4,0x803f}, {0xe3d5,0x803b}, {0xe3d6,0x804a}, {0xe3d7,0x8046}, {0xe3d8,0x8052}, {0xe3d9,0x8058}, {0xe3da,0x805a}, {0xe3db,0x805f}, {0xe3dc,0x8062}, {0xe3dd,0x8068}, {0xe3de,0x8073}, {0xe3df,0x8072}, {0xe3e0,0x8070}, {0xe3e1,0x8076}, {0xe3e2,0x8079}, {0xe3e3,0x807d}, {0xe3e4,0x807f}, {0xe3e5,0x8084}, {0xe3e6,0x8086}, {0xe3e7,0x8085}, {0xe3e8,0x809b}, {0xe3e9,0x8093}, {0xe3ea,0x809a}, {0xe3eb,0x80ad}, {0xe3ec,0x5190}, {0xe3ed,0x80ac}, {0xe3ee,0x80db}, {0xe3ef,0x80e5}, {0xe3f0,0x80d9}, {0xe3f1,0x80dd}, {0xe3f2,0x80c4}, {0xe3f3,0x80da}, {0xe3f4,0x80d6}, {0xe3f5,0x8109}, {0xe3f6,0x80ef}, {0xe3f7,0x80f1}, {0xe3f8,0x811b}, {0xe3f9,0x8129}, {0xe3fa,0x8123}, {0xe3fb,0x812f}, {0xe3fc,0x814b}, {0xe440,0x968b}, {0xe441,0x8146}, {0xe442,0x813e}, {0xe443,0x8153}, {0xe444,0x8151}, {0xe445,0x80fc}, {0xe446,0x8171}, {0xe447,0x816e}, {0xe448,0x8165}, {0xe449,0x8166}, {0xe44a,0x8174}, {0xe44b,0x8183}, {0xe44c,0x8188}, {0xe44d,0x818a}, {0xe44e,0x8180}, {0xe44f,0x8182}, {0xe450,0x81a0}, {0xe451,0x8195}, {0xe452,0x81a4}, {0xe453,0x81a3}, {0xe454,0x815f}, {0xe455,0x8193}, {0xe456,0x81a9}, {0xe457,0x81b0}, {0xe458,0x81b5}, {0xe459,0x81be}, {0xe45a,0x81b8}, {0xe45b,0x81bd}, {0xe45c,0x81c0}, {0xe45d,0x81c2}, {0xe45e,0x81ba}, {0xe45f,0x81c9}, {0xe460,0x81cd}, {0xe461,0x81d1}, {0xe462,0x81d9}, {0xe463,0x81d8}, {0xe464,0x81c8}, {0xe465,0x81da}, {0xe466,0x81df}, {0xe467,0x81e0}, {0xe468,0x81e7}, {0xe469,0x81fa}, {0xe46a,0x81fb}, {0xe46b,0x81fe}, {0xe46c,0x8201}, {0xe46d,0x8202}, {0xe46e,0x8205}, {0xe46f,0x8207}, {0xe470,0x820a}, {0xe471,0x820d}, {0xe472,0x8210}, {0xe473,0x8216}, {0xe474,0x8229}, {0xe475,0x822b}, {0xe476,0x8238}, {0xe477,0x8233}, {0xe478,0x8240}, {0xe479,0x8259}, {0xe47a,0x8258}, {0xe47b,0x825d}, {0xe47c,0x825a}, {0xe47d,0x825f}, {0xe47e,0x8264}, {0xe480,0x8262}, {0xe481,0x8268}, {0xe482,0x826a}, {0xe483,0x826b}, {0xe484,0x822e}, {0xe485,0x8271}, {0xe486,0x8277}, {0xe487,0x8278}, {0xe488,0x827e}, {0xe489,0x828d}, {0xe48a,0x8292}, {0xe48b,0x82ab}, {0xe48c,0x829f}, {0xe48d,0x82bb}, {0xe48e,0x82ac}, {0xe48f,0x82e1}, {0xe490,0x82e3}, {0xe491,0x82df}, {0xe492,0x82d2}, {0xe493,0x82f4}, {0xe494,0x82f3}, {0xe495,0x82fa}, {0xe496,0x8393}, {0xe497,0x8303}, {0xe498,0x82fb}, {0xe499,0x82f9}, {0xe49a,0x82de}, {0xe49b,0x8306}, {0xe49c,0x82dc}, {0xe49d,0x8309}, {0xe49e,0x82d9}, {0xe49f,0x8335}, {0xe4a0,0x8334}, {0xe4a1,0x8316}, {0xe4a2,0x8332}, {0xe4a3,0x8331}, {0xe4a4,0x8340}, {0xe4a5,0x8339}, {0xe4a6,0x8350}, {0xe4a7,0x8345}, {0xe4a8,0x832f}, {0xe4a9,0x832b}, {0xe4aa,0x8317}, {0xe4ab,0x8318}, {0xe4ac,0x8385}, {0xe4ad,0x839a}, {0xe4ae,0x83aa}, {0xe4af,0x839f}, {0xe4b0,0x83a2}, {0xe4b1,0x8396}, {0xe4b2,0x8323}, {0xe4b3,0x838e}, {0xe4b4,0x8387}, {0xe4b5,0x838a}, {0xe4b6,0x837c}, {0xe4b7,0x83b5}, {0xe4b8,0x8373}, {0xe4b9,0x8375}, {0xe4ba,0x83a0}, {0xe4bb,0x8389}, {0xe4bc,0x83a8}, {0xe4bd,0x83f4}, {0xe4be,0x8413}, {0xe4bf,0x83eb}, {0xe4c0,0x83ce}, {0xe4c1,0x83fd}, {0xe4c2,0x8403}, {0xe4c3,0x83d8}, {0xe4c4,0x840b}, {0xe4c5,0x83c1}, {0xe4c6,0x83f7}, {0xe4c7,0x8407}, {0xe4c8,0x83e0}, {0xe4c9,0x83f2}, {0xe4ca,0x840d}, {0xe4cb,0x8422}, {0xe4cc,0x8420}, {0xe4cd,0x83bd}, {0xe4ce,0x8438}, {0xe4cf,0x8506}, {0xe4d0,0x83fb}, {0xe4d1,0x846d}, {0xe4d2,0x842a}, {0xe4d3,0x843c}, {0xe4d4,0x855a}, {0xe4d5,0x8484}, {0xe4d6,0x8477}, {0xe4d7,0x846b}, {0xe4d8,0x84ad}, {0xe4d9,0x846e}, {0xe4da,0x8482}, {0xe4db,0x8469}, {0xe4dc,0x8446}, {0xe4dd,0x842c}, {0xe4de,0x846f}, {0xe4df,0x8479}, {0xe4e0,0x8435}, {0xe4e1,0x84ca}, {0xe4e2,0x8462}, {0xe4e3,0x84b9}, {0xe4e4,0x84bf}, {0xe4e5,0x849f}, {0xe4e6,0x84d9}, {0xe4e7,0x84cd}, {0xe4e8,0x84bb}, {0xe4e9,0x84da}, {0xe4ea,0x84d0}, {0xe4eb,0x84c1}, {0xe4ec,0x84c6}, {0xe4ed,0x84d6}, {0xe4ee,0x84a1}, {0xe4ef,0x8521}, {0xe4f0,0x84ff}, {0xe4f1,0x84f4}, {0xe4f2,0x8517}, {0xe4f3,0x8518}, {0xe4f4,0x852c}, {0xe4f5,0x851f}, {0xe4f6,0x8515}, {0xe4f7,0x8514}, {0xe4f8,0x84fc}, {0xe4f9,0x8540}, {0xe4fa,0x8563}, {0xe4fb,0x8558}, {0xe4fc,0x8548}, {0xe540,0x8541}, {0xe541,0x8602}, {0xe542,0x854b}, {0xe543,0x8555}, {0xe544,0x8580}, {0xe545,0x85a4}, {0xe546,0x8588}, {0xe547,0x8591}, {0xe548,0x858a}, {0xe549,0x85a8}, {0xe54a,0x856d}, {0xe54b,0x8594}, {0xe54c,0x859b}, {0xe54d,0x85ea}, {0xe54e,0x8587}, {0xe54f,0x859c}, {0xe550,0x8577}, {0xe551,0x857e}, {0xe552,0x8590}, {0xe553,0x85c9}, {0xe554,0x85ba}, {0xe555,0x85cf}, {0xe556,0x85b9}, {0xe557,0x85d0}, {0xe558,0x85d5}, {0xe559,0x85dd}, {0xe55a,0x85e5}, {0xe55b,0x85dc}, {0xe55c,0x85f9}, {0xe55d,0x860a}, {0xe55e,0x8613}, {0xe55f,0x860b}, {0xe560,0x85fe}, {0xe561,0x85fa}, {0xe562,0x8606}, {0xe563,0x8622}, {0xe564,0x861a}, {0xe565,0x8630}, {0xe566,0x863f}, {0xe567,0x864d}, {0xe568,0x4e55}, {0xe569,0x8654}, {0xe56a,0x865f}, {0xe56b,0x8667}, {0xe56c,0x8671}, {0xe56d,0x8693}, {0xe56e,0x86a3}, {0xe56f,0x86a9}, {0xe570,0x86aa}, {0xe571,0x868b}, {0xe572,0x868c}, {0xe573,0x86b6}, {0xe574,0x86af}, {0xe575,0x86c4}, {0xe576,0x86c6}, {0xe577,0x86b0}, {0xe578,0x86c9}, {0xe579,0x8823}, {0xe57a,0x86ab}, {0xe57b,0x86d4}, {0xe57c,0x86de}, {0xe57d,0x86e9}, {0xe57e,0x86ec}, {0xe580,0x86df}, {0xe581,0x86db}, {0xe582,0x86ef}, {0xe583,0x8712}, {0xe584,0x8706}, {0xe585,0x8708}, {0xe586,0x8700}, {0xe587,0x8703}, {0xe588,0x86fb}, {0xe589,0x8711}, {0xe58a,0x8709}, {0xe58b,0x870d}, {0xe58c,0x86f9}, {0xe58d,0x870a}, {0xe58e,0x8734}, {0xe58f,0x873f}, {0xe590,0x8737}, {0xe591,0x873b}, {0xe592,0x8725}, {0xe593,0x8729}, {0xe594,0x871a}, {0xe595,0x8760}, {0xe596,0x875f}, {0xe597,0x8778}, {0xe598,0x874c}, {0xe599,0x874e}, {0xe59a,0x8774}, {0xe59b,0x8757}, {0xe59c,0x8768}, {0xe59d,0x876e}, {0xe59e,0x8759}, {0xe59f,0x8753}, {0xe5a0,0x8763}, {0xe5a1,0x876a}, {0xe5a2,0x8805}, {0xe5a3,0x87a2}, {0xe5a4,0x879f}, {0xe5a5,0x8782}, {0xe5a6,0x87af}, {0xe5a7,0x87cb}, {0xe5a8,0x87bd}, {0xe5a9,0x87c0}, {0xe5aa,0x87d0}, {0xe5ab,0x96d6}, {0xe5ac,0x87ab}, {0xe5ad,0x87c4}, {0xe5ae,0x87b3}, {0xe5af,0x87c7}, {0xe5b0,0x87c6}, {0xe5b1,0x87bb}, {0xe5b2,0x87ef}, {0xe5b3,0x87f2}, {0xe5b4,0x87e0}, {0xe5b5,0x880f}, {0xe5b6,0x880d}, {0xe5b7,0x87fe}, {0xe5b8,0x87f6}, {0xe5b9,0x87f7}, {0xe5ba,0x880e}, {0xe5bb,0x87d2}, {0xe5bc,0x8811}, {0xe5bd,0x8816}, {0xe5be,0x8815}, {0xe5bf,0x8822}, {0xe5c0,0x8821}, {0xe5c1,0x8831}, {0xe5c2,0x8836}, {0xe5c3,0x8839}, {0xe5c4,0x8827}, {0xe5c5,0x883b}, {0xe5c6,0x8844}, {0xe5c7,0x8842}, {0xe5c8,0x8852}, {0xe5c9,0x8859}, {0xe5ca,0x885e}, {0xe5cb,0x8862}, {0xe5cc,0x886b}, {0xe5cd,0x8881}, {0xe5ce,0x887e}, {0xe5cf,0x889e}, {0xe5d0,0x8875}, {0xe5d1,0x887d}, {0xe5d2,0x88b5}, {0xe5d3,0x8872}, {0xe5d4,0x8882}, {0xe5d5,0x8897}, {0xe5d6,0x8892}, {0xe5d7,0x88ae}, {0xe5d8,0x8899}, {0xe5d9,0x88a2}, {0xe5da,0x888d}, {0xe5db,0x88a4}, {0xe5dc,0x88b0}, {0xe5dd,0x88bf}, {0xe5de,0x88b1}, {0xe5df,0x88c3}, {0xe5e0,0x88c4}, {0xe5e1,0x88d4}, {0xe5e2,0x88d8}, {0xe5e3,0x88d9}, {0xe5e4,0x88dd}, {0xe5e5,0x88f9}, {0xe5e6,0x8902}, {0xe5e7,0x88fc}, {0xe5e8,0x88f4}, {0xe5e9,0x88e8}, {0xe5ea,0x88f2}, {0xe5eb,0x8904}, {0xe5ec,0x890c}, {0xe5ed,0x890a}, {0xe5ee,0x8913}, {0xe5ef,0x8943}, {0xe5f0,0x891e}, {0xe5f1,0x8925}, {0xe5f2,0x892a}, {0xe5f3,0x892b}, {0xe5f4,0x8941}, {0xe5f5,0x8944}, {0xe5f6,0x893b}, {0xe5f7,0x8936}, {0xe5f8,0x8938}, {0xe5f9,0x894c}, {0xe5fa,0x891d}, {0xe5fb,0x8960}, {0xe5fc,0x895e}, {0xe640,0x8966}, {0xe641,0x8964}, {0xe642,0x896d}, {0xe643,0x896a}, {0xe644,0x896f}, {0xe645,0x8974}, {0xe646,0x8977}, {0xe647,0x897e}, {0xe648,0x8983}, {0xe649,0x8988}, {0xe64a,0x898a}, {0xe64b,0x8993}, {0xe64c,0x8998}, {0xe64d,0x89a1}, {0xe64e,0x89a9}, {0xe64f,0x89a6}, {0xe650,0x89ac}, {0xe651,0x89af}, {0xe652,0x89b2}, {0xe653,0x89ba}, {0xe654,0x89bd}, {0xe655,0x89bf}, {0xe656,0x89c0}, {0xe657,0x89da}, {0xe658,0x89dc}, {0xe659,0x89dd}, {0xe65a,0x89e7}, {0xe65b,0x89f4}, {0xe65c,0x89f8}, {0xe65d,0x8a03}, {0xe65e,0x8a16}, {0xe65f,0x8a10}, {0xe660,0x8a0c}, {0xe661,0x8a1b}, {0xe662,0x8a1d}, {0xe663,0x8a25}, {0xe664,0x8a36}, {0xe665,0x8a41}, {0xe666,0x8a5b}, {0xe667,0x8a52}, {0xe668,0x8a46}, {0xe669,0x8a48}, {0xe66a,0x8a7c}, {0xe66b,0x8a6d}, {0xe66c,0x8a6c}, {0xe66d,0x8a62}, {0xe66e,0x8a85}, {0xe66f,0x8a82}, {0xe670,0x8a84}, {0xe671,0x8aa8}, {0xe672,0x8aa1}, {0xe673,0x8a91}, {0xe674,0x8aa5}, {0xe675,0x8aa6}, {0xe676,0x8a9a}, {0xe677,0x8aa3}, {0xe678,0x8ac4}, {0xe679,0x8acd}, {0xe67a,0x8ac2}, {0xe67b,0x8ada}, {0xe67c,0x8aeb}, {0xe67d,0x8af3}, {0xe67e,0x8ae7}, {0xe680,0x8ae4}, {0xe681,0x8af1}, {0xe682,0x8b14}, {0xe683,0x8ae0}, {0xe684,0x8ae2}, {0xe685,0x8af7}, {0xe686,0x8ade}, {0xe687,0x8adb}, {0xe688,0x8b0c}, {0xe689,0x8b07}, {0xe68a,0x8b1a}, {0xe68b,0x8ae1}, {0xe68c,0x8b16}, {0xe68d,0x8b10}, {0xe68e,0x8b17}, {0xe68f,0x8b20}, {0xe690,0x8b33}, {0xe691,0x97ab}, {0xe692,0x8b26}, {0xe693,0x8b2b}, {0xe694,0x8b3e}, {0xe695,0x8b28}, {0xe696,0x8b41}, {0xe697,0x8b4c}, {0xe698,0x8b4f}, {0xe699,0x8b4e}, {0xe69a,0x8b49}, {0xe69b,0x8b56}, {0xe69c,0x8b5b}, {0xe69d,0x8b5a}, {0xe69e,0x8b6b}, {0xe69f,0x8b5f}, {0xe6a0,0x8b6c}, {0xe6a1,0x8b6f}, {0xe6a2,0x8b74}, {0xe6a3,0x8b7d}, {0xe6a4,0x8b80}, {0xe6a5,0x8b8c}, {0xe6a6,0x8b8e}, {0xe6a7,0x8b92}, {0xe6a8,0x8b93}, {0xe6a9,0x8b96}, {0xe6aa,0x8b99}, {0xe6ab,0x8b9a}, {0xe6ac,0x8c3a}, {0xe6ad,0x8c41}, {0xe6ae,0x8c3f}, {0xe6af,0x8c48}, {0xe6b0,0x8c4c}, {0xe6b1,0x8c4e}, {0xe6b2,0x8c50}, {0xe6b3,0x8c55}, {0xe6b4,0x8c62}, {0xe6b5,0x8c6c}, {0xe6b6,0x8c78}, {0xe6b7,0x8c7a}, {0xe6b8,0x8c82}, {0xe6b9,0x8c89}, {0xe6ba,0x8c85}, {0xe6bb,0x8c8a}, {0xe6bc,0x8c8d}, {0xe6bd,0x8c8e}, {0xe6be,0x8c94}, {0xe6bf,0x8c7c}, {0xe6c0,0x8c98}, {0xe6c1,0x621d}, {0xe6c2,0x8cad}, {0xe6c3,0x8caa}, {0xe6c4,0x8cbd}, {0xe6c5,0x8cb2}, {0xe6c6,0x8cb3}, {0xe6c7,0x8cae}, {0xe6c8,0x8cb6}, {0xe6c9,0x8cc8}, {0xe6ca,0x8cc1}, {0xe6cb,0x8ce4}, {0xe6cc,0x8ce3}, {0xe6cd,0x8cda}, {0xe6ce,0x8cfd}, {0xe6cf,0x8cfa}, {0xe6d0,0x8cfb}, {0xe6d1,0x8d04}, {0xe6d2,0x8d05}, {0xe6d3,0x8d0a}, {0xe6d4,0x8d07}, {0xe6d5,0x8d0f}, {0xe6d6,0x8d0d}, {0xe6d7,0x8d10}, {0xe6d8,0x9f4e}, {0xe6d9,0x8d13}, {0xe6da,0x8ccd}, {0xe6db,0x8d14}, {0xe6dc,0x8d16}, {0xe6dd,0x8d67}, {0xe6de,0x8d6d}, {0xe6df,0x8d71}, {0xe6e0,0x8d73}, {0xe6e1,0x8d81}, {0xe6e2,0x8d99}, {0xe6e3,0x8dc2}, {0xe6e4,0x8dbe}, {0xe6e5,0x8dba}, {0xe6e6,0x8dcf}, {0xe6e7,0x8dda}, {0xe6e8,0x8dd6}, {0xe6e9,0x8dcc}, {0xe6ea,0x8ddb}, {0xe6eb,0x8dcb}, {0xe6ec,0x8dea}, {0xe6ed,0x8deb}, {0xe6ee,0x8ddf}, {0xe6ef,0x8de3}, {0xe6f0,0x8dfc}, {0xe6f1,0x8e08}, {0xe6f2,0x8e09}, {0xe6f3,0x8dff}, {0xe6f4,0x8e1d}, {0xe6f5,0x8e1e}, {0xe6f6,0x8e10}, {0xe6f7,0x8e1f}, {0xe6f8,0x8e42}, {0xe6f9,0x8e35}, {0xe6fa,0x8e30}, {0xe6fb,0x8e34}, {0xe6fc,0x8e4a}, {0xe740,0x8e47}, {0xe741,0x8e49}, {0xe742,0x8e4c}, {0xe743,0x8e50}, {0xe744,0x8e48}, {0xe745,0x8e59}, {0xe746,0x8e64}, {0xe747,0x8e60}, {0xe748,0x8e2a}, {0xe749,0x8e63}, {0xe74a,0x8e55}, {0xe74b,0x8e76}, {0xe74c,0x8e72}, {0xe74d,0x8e7c}, {0xe74e,0x8e81}, {0xe74f,0x8e87}, {0xe750,0x8e85}, {0xe751,0x8e84}, {0xe752,0x8e8b}, {0xe753,0x8e8a}, {0xe754,0x8e93}, {0xe755,0x8e91}, {0xe756,0x8e94}, {0xe757,0x8e99}, {0xe758,0x8eaa}, {0xe759,0x8ea1}, {0xe75a,0x8eac}, {0xe75b,0x8eb0}, {0xe75c,0x8ec6}, {0xe75d,0x8eb1}, {0xe75e,0x8ebe}, {0xe75f,0x8ec5}, {0xe760,0x8ec8}, {0xe761,0x8ecb}, {0xe762,0x8edb}, {0xe763,0x8ee3}, {0xe764,0x8efc}, {0xe765,0x8efb}, {0xe766,0x8eeb}, {0xe767,0x8efe}, {0xe768,0x8f0a}, {0xe769,0x8f05}, {0xe76a,0x8f15}, {0xe76b,0x8f12}, {0xe76c,0x8f19}, {0xe76d,0x8f13}, {0xe76e,0x8f1c}, {0xe76f,0x8f1f}, {0xe770,0x8f1b}, {0xe771,0x8f0c}, {0xe772,0x8f26}, {0xe773,0x8f33}, {0xe774,0x8f3b}, {0xe775,0x8f39}, {0xe776,0x8f45}, {0xe777,0x8f42}, {0xe778,0x8f3e}, {0xe779,0x8f4c}, {0xe77a,0x8f49}, {0xe77b,0x8f46}, {0xe77c,0x8f4e}, {0xe77d,0x8f57}, {0xe77e,0x8f5c}, {0xe780,0x8f62}, {0xe781,0x8f63}, {0xe782,0x8f64}, {0xe783,0x8f9c}, {0xe784,0x8f9f}, {0xe785,0x8fa3}, {0xe786,0x8fad}, {0xe787,0x8faf}, {0xe788,0x8fb7}, {0xe789,0x8fda}, {0xe78a,0x8fe5}, {0xe78b,0x8fe2}, {0xe78c,0x8fea}, {0xe78d,0x8fef}, {0xe78e,0x9087}, {0xe78f,0x8ff4}, {0xe790,0x9005}, {0xe791,0x8ff9}, {0xe792,0x8ffa}, {0xe793,0x9011}, {0xe794,0x9015}, {0xe795,0x9021}, {0xe796,0x900d}, {0xe797,0x901e}, {0xe798,0x9016}, {0xe799,0x900b}, {0xe79a,0x9027}, {0xe79b,0x9036}, {0xe79c,0x9035}, {0xe79d,0x9039}, {0xe79e,0x8ff8}, {0xe79f,0x904f}, {0xe7a0,0x9050}, {0xe7a1,0x9051}, {0xe7a2,0x9052}, {0xe7a3,0x900e}, {0xe7a4,0x9049}, {0xe7a5,0x903e}, {0xe7a6,0x9056}, {0xe7a7,0x9058}, {0xe7a8,0x905e}, {0xe7a9,0x9068}, {0xe7aa,0x906f}, {0xe7ab,0x9076}, {0xe7ac,0x96a8}, {0xe7ad,0x9072}, {0xe7ae,0x9082}, {0xe7af,0x907d}, {0xe7b0,0x9081}, {0xe7b1,0x9080}, {0xe7b2,0x908a}, {0xe7b3,0x9089}, {0xe7b4,0x908f}, {0xe7b5,0x90a8}, {0xe7b6,0x90af}, {0xe7b7,0x90b1}, {0xe7b8,0x90b5}, {0xe7b9,0x90e2}, {0xe7ba,0x90e4}, {0xe7bb,0x6248}, {0xe7bc,0x90db}, {0xe7bd,0x9102}, {0xe7be,0x9112}, {0xe7bf,0x9119}, {0xe7c0,0x9132}, {0xe7c1,0x9130}, {0xe7c2,0x914a}, {0xe7c3,0x9156}, {0xe7c4,0x9158}, {0xe7c5,0x9163}, {0xe7c6,0x9165}, {0xe7c7,0x9169}, {0xe7c8,0x9173}, {0xe7c9,0x9172}, {0xe7ca,0x918b}, {0xe7cb,0x9189}, {0xe7cc,0x9182}, {0xe7cd,0x91a2}, {0xe7ce,0x91ab}, {0xe7cf,0x91af}, {0xe7d0,0x91aa}, {0xe7d1,0x91b5}, {0xe7d2,0x91b4}, {0xe7d3,0x91ba}, {0xe7d4,0x91c0}, {0xe7d5,0x91c1}, {0xe7d6,0x91c9}, {0xe7d7,0x91cb}, {0xe7d8,0x91d0}, {0xe7d9,0x91d6}, {0xe7da,0x91df}, {0xe7db,0x91e1}, {0xe7dc,0x91db}, {0xe7dd,0x91fc}, {0xe7de,0x91f5}, {0xe7df,0x91f6}, {0xe7e0,0x921e}, {0xe7e1,0x91ff}, {0xe7e2,0x9214}, {0xe7e3,0x922c}, {0xe7e4,0x9215}, {0xe7e5,0x9211}, {0xe7e6,0x925e}, {0xe7e7,0x9257}, {0xe7e8,0x9245}, {0xe7e9,0x9249}, {0xe7ea,0x9264}, {0xe7eb,0x9248}, {0xe7ec,0x9295}, {0xe7ed,0x923f}, {0xe7ee,0x924b}, {0xe7ef,0x9250}, {0xe7f0,0x929c}, {0xe7f1,0x9296}, {0xe7f2,0x9293}, {0xe7f3,0x929b}, {0xe7f4,0x925a}, {0xe7f5,0x92cf}, {0xe7f6,0x92b9}, {0xe7f7,0x92b7}, {0xe7f8,0x92e9}, {0xe7f9,0x930f}, {0xe7fa,0x92fa}, {0xe7fb,0x9344}, {0xe7fc,0x932e}, {0xe840,0x9319}, {0xe841,0x9322}, {0xe842,0x931a}, {0xe843,0x9323}, {0xe844,0x933a}, {0xe845,0x9335}, {0xe846,0x933b}, {0xe847,0x935c}, {0xe848,0x9360}, {0xe849,0x937c}, {0xe84a,0x936e}, {0xe84b,0x9356}, {0xe84c,0x93b0}, {0xe84d,0x93ac}, {0xe84e,0x93ad}, {0xe84f,0x9394}, {0xe850,0x93b9}, {0xe851,0x93d6}, {0xe852,0x93d7}, {0xe853,0x93e8}, {0xe854,0x93e5}, {0xe855,0x93d8}, {0xe856,0x93c3}, {0xe857,0x93dd}, {0xe858,0x93d0}, {0xe859,0x93c8}, {0xe85a,0x93e4}, {0xe85b,0x941a}, {0xe85c,0x9414}, {0xe85d,0x9413}, {0xe85e,0x9403}, {0xe85f,0x9407}, {0xe860,0x9410}, {0xe861,0x9436}, {0xe862,0x942b}, {0xe863,0x9435}, {0xe864,0x9421}, {0xe865,0x943a}, {0xe866,0x9441}, {0xe867,0x9452}, {0xe868,0x9444}, {0xe869,0x945b}, {0xe86a,0x9460}, {0xe86b,0x9462}, {0xe86c,0x945e}, {0xe86d,0x946a}, {0xe86e,0x9229}, {0xe86f,0x9470}, {0xe870,0x9475}, {0xe871,0x9477}, {0xe872,0x947d}, {0xe873,0x945a}, {0xe874,0x947c}, {0xe875,0x947e}, {0xe876,0x9481}, {0xe877,0x947f}, {0xe878,0x9582}, {0xe879,0x9587}, {0xe87a,0x958a}, {0xe87b,0x9594}, {0xe87c,0x9596}, {0xe87d,0x9598}, {0xe87e,0x9599}, {0xe880,0x95a0}, {0xe881,0x95a8}, {0xe882,0x95a7}, {0xe883,0x95ad}, {0xe884,0x95bc}, {0xe885,0x95bb}, {0xe886,0x95b9}, {0xe887,0x95be}, {0xe888,0x95ca}, {0xe889,0x6ff6}, {0xe88a,0x95c3}, {0xe88b,0x95cd}, {0xe88c,0x95cc}, {0xe88d,0x95d5}, {0xe88e,0x95d4}, {0xe88f,0x95d6}, {0xe890,0x95dc}, {0xe891,0x95e1}, {0xe892,0x95e5}, {0xe893,0x95e2}, {0xe894,0x9621}, {0xe895,0x9628}, {0xe896,0x962e}, {0xe897,0x962f}, {0xe898,0x9642}, {0xe899,0x964c}, {0xe89a,0x964f}, {0xe89b,0x964b}, {0xe89c,0x9677}, {0xe89d,0x965c}, {0xe89e,0x965e}, {0xe89f,0x965d}, {0xe8a0,0x965f}, {0xe8a1,0x9666}, {0xe8a2,0x9672}, {0xe8a3,0x966c}, {0xe8a4,0x968d}, {0xe8a5,0x9698}, {0xe8a6,0x9695}, {0xe8a7,0x9697}, {0xe8a8,0x96aa}, {0xe8a9,0x96a7}, {0xe8aa,0x96b1}, {0xe8ab,0x96b2}, {0xe8ac,0x96b0}, {0xe8ad,0x96b4}, {0xe8ae,0x96b6}, {0xe8af,0x96b8}, {0xe8b0,0x96b9}, {0xe8b1,0x96ce}, {0xe8b2,0x96cb}, {0xe8b3,0x96c9}, {0xe8b4,0x96cd}, {0xe8b5,0x894d}, {0xe8b6,0x96dc}, {0xe8b7,0x970d}, {0xe8b8,0x96d5}, {0xe8b9,0x96f9}, {0xe8ba,0x9704}, {0xe8bb,0x9706}, {0xe8bc,0x9708}, {0xe8bd,0x9713}, {0xe8be,0x970e}, {0xe8bf,0x9711}, {0xe8c0,0x970f}, {0xe8c1,0x9716}, {0xe8c2,0x9719}, {0xe8c3,0x9724}, {0xe8c4,0x972a}, {0xe8c5,0x9730}, {0xe8c6,0x9739}, {0xe8c7,0x973d}, {0xe8c8,0x973e}, {0xe8c9,0x9744}, {0xe8ca,0x9746}, {0xe8cb,0x9748}, {0xe8cc,0x9742}, {0xe8cd,0x9749}, {0xe8ce,0x975c}, {0xe8cf,0x9760}, {0xe8d0,0x9764}, {0xe8d1,0x9766}, {0xe8d2,0x9768}, {0xe8d3,0x52d2}, {0xe8d4,0x976b}, {0xe8d5,0x9771}, {0xe8d6,0x9779}, {0xe8d7,0x9785}, {0xe8d8,0x977c}, {0xe8d9,0x9781}, {0xe8da,0x977a}, {0xe8db,0x9786}, {0xe8dc,0x978b}, {0xe8dd,0x978f}, {0xe8de,0x9790}, {0xe8df,0x979c}, {0xe8e0,0x97a8}, {0xe8e1,0x97a6}, {0xe8e2,0x97a3}, {0xe8e3,0x97b3}, {0xe8e4,0x97b4}, {0xe8e5,0x97c3}, {0xe8e6,0x97c6}, {0xe8e7,0x97c8}, {0xe8e8,0x97cb}, {0xe8e9,0x97dc}, {0xe8ea,0x97ed}, {0xe8eb,0x9f4f}, {0xe8ec,0x97f2}, {0xe8ed,0x7adf}, {0xe8ee,0x97f6}, {0xe8ef,0x97f5}, {0xe8f0,0x980f}, {0xe8f1,0x980c}, {0xe8f2,0x9838}, {0xe8f3,0x9824}, {0xe8f4,0x9821}, {0xe8f5,0x9837}, {0xe8f6,0x983d}, {0xe8f7,0x9846}, {0xe8f8,0x984f}, {0xe8f9,0x984b}, {0xe8fa,0x986b}, {0xe8fb,0x986f}, {0xe8fc,0x9870}, {0xe940,0x9871}, {0xe941,0x9874}, {0xe942,0x9873}, {0xe943,0x98aa}, {0xe944,0x98af}, {0xe945,0x98b1}, {0xe946,0x98b6}, {0xe947,0x98c4}, {0xe948,0x98c3}, {0xe949,0x98c6}, {0xe94a,0x98e9}, {0xe94b,0x98eb}, {0xe94c,0x9903}, {0xe94d,0x9909}, {0xe94e,0x9912}, {0xe94f,0x9914}, {0xe950,0x9918}, {0xe951,0x9921}, {0xe952,0x991d}, {0xe953,0x991e}, {0xe954,0x9924}, {0xe955,0x9920}, {0xe956,0x992c}, {0xe957,0x992e}, {0xe958,0x993d}, {0xe959,0x993e}, {0xe95a,0x9942}, {0xe95b,0x9949}, {0xe95c,0x9945}, {0xe95d,0x9950}, {0xe95e,0x994b}, {0xe95f,0x9951}, {0xe960,0x9952}, {0xe961,0x994c}, {0xe962,0x9955}, {0xe963,0x9997}, {0xe964,0x9998}, {0xe965,0x99a5}, {0xe966,0x99ad}, {0xe967,0x99ae}, {0xe968,0x99bc}, {0xe969,0x99df}, {0xe96a,0x99db}, {0xe96b,0x99dd}, {0xe96c,0x99d8}, {0xe96d,0x99d1}, {0xe96e,0x99ed}, {0xe96f,0x99ee}, {0xe970,0x99f1}, {0xe971,0x99f2}, {0xe972,0x99fb}, {0xe973,0x99f8}, {0xe974,0x9a01}, {0xe975,0x9a0f}, {0xe976,0x9a05}, {0xe977,0x99e2}, {0xe978,0x9a19}, {0xe979,0x9a2b}, {0xe97a,0x9a37}, {0xe97b,0x9a45}, {0xe97c,0x9a42}, {0xe97d,0x9a40}, {0xe97e,0x9a43}, {0xe980,0x9a3e}, {0xe981,0x9a55}, {0xe982,0x9a4d}, {0xe983,0x9a5b}, {0xe984,0x9a57}, {0xe985,0x9a5f}, {0xe986,0x9a62}, {0xe987,0x9a65}, {0xe988,0x9a64}, {0xe989,0x9a69}, {0xe98a,0x9a6b}, {0xe98b,0x9a6a}, {0xe98c,0x9aad}, {0xe98d,0x9ab0}, {0xe98e,0x9abc}, {0xe98f,0x9ac0}, {0xe990,0x9acf}, {0xe991,0x9ad1}, {0xe992,0x9ad3}, {0xe993,0x9ad4}, {0xe994,0x9ade}, {0xe995,0x9adf}, {0xe996,0x9ae2}, {0xe997,0x9ae3}, {0xe998,0x9ae6}, {0xe999,0x9aef}, {0xe99a,0x9aeb}, {0xe99b,0x9aee}, {0xe99c,0x9af4}, {0xe99d,0x9af1}, {0xe99e,0x9af7}, {0xe99f,0x9afb}, {0xe9a0,0x9b06}, {0xe9a1,0x9b18}, {0xe9a2,0x9b1a}, {0xe9a3,0x9b1f}, {0xe9a4,0x9b22}, {0xe9a5,0x9b23}, {0xe9a6,0x9b25}, {0xe9a7,0x9b27}, {0xe9a8,0x9b28}, {0xe9a9,0x9b29}, {0xe9aa,0x9b2a}, {0xe9ab,0x9b2e}, {0xe9ac,0x9b2f}, {0xe9ad,0x9b32}, {0xe9ae,0x9b44}, {0xe9af,0x9b43}, {0xe9b0,0x9b4f}, {0xe9b1,0x9b4d}, {0xe9b2,0x9b4e}, {0xe9b3,0x9b51}, {0xe9b4,0x9b58}, {0xe9b5,0x9b74}, {0xe9b6,0x9b93}, {0xe9b7,0x9b83}, {0xe9b8,0x9b91}, {0xe9b9,0x9b96}, {0xe9ba,0x9b97}, {0xe9bb,0x9b9f}, {0xe9bc,0x9ba0}, {0xe9bd,0x9ba8}, {0xe9be,0x9bb4}, {0xe9bf,0x9bc0}, {0xe9c0,0x9bca}, {0xe9c1,0x9bb9}, {0xe9c2,0x9bc6}, {0xe9c3,0x9bcf}, {0xe9c4,0x9bd1}, {0xe9c5,0x9bd2}, {0xe9c6,0x9be3}, {0xe9c7,0x9be2}, {0xe9c8,0x9be4}, {0xe9c9,0x9bd4}, {0xe9ca,0x9be1}, {0xe9cb,0x9c3a}, {0xe9cc,0x9bf2}, {0xe9cd,0x9bf1}, {0xe9ce,0x9bf0}, {0xe9cf,0x9c15}, {0xe9d0,0x9c14}, {0xe9d1,0x9c09}, {0xe9d2,0x9c13}, {0xe9d3,0x9c0c}, {0xe9d4,0x9c06}, {0xe9d5,0x9c08}, {0xe9d6,0x9c12}, {0xe9d7,0x9c0a}, {0xe9d8,0x9c04}, {0xe9d9,0x9c2e}, {0xe9da,0x9c1b}, {0xe9db,0x9c25}, {0xe9dc,0x9c24}, {0xe9dd,0x9c21}, {0xe9de,0x9c30}, {0xe9df,0x9c47}, {0xe9e0,0x9c32}, {0xe9e1,0x9c46}, {0xe9e2,0x9c3e}, {0xe9e3,0x9c5a}, {0xe9e4,0x9c60}, {0xe9e5,0x9c67}, {0xe9e6,0x9c76}, {0xe9e7,0x9c78}, {0xe9e8,0x9ce7}, {0xe9e9,0x9cec}, {0xe9ea,0x9cf0}, {0xe9eb,0x9d09}, {0xe9ec,0x9d08}, {0xe9ed,0x9ceb}, {0xe9ee,0x9d03}, {0xe9ef,0x9d06}, {0xe9f0,0x9d2a}, {0xe9f1,0x9d26}, {0xe9f2,0x9daf}, {0xe9f3,0x9d23}, {0xe9f4,0x9d1f}, {0xe9f5,0x9d44}, {0xe9f6,0x9d15}, {0xe9f7,0x9d12}, {0xe9f8,0x9d41}, {0xe9f9,0x9d3f}, {0xe9fa,0x9d3e}, {0xe9fb,0x9d46}, {0xe9fc,0x9d48}, {0xea40,0x9d5d}, {0xea41,0x9d5e}, {0xea42,0x9d64}, {0xea43,0x9d51}, {0xea44,0x9d50}, {0xea45,0x9d59}, {0xea46,0x9d72}, {0xea47,0x9d89}, {0xea48,0x9d87}, {0xea49,0x9dab}, {0xea4a,0x9d6f}, {0xea4b,0x9d7a}, {0xea4c,0x9d9a}, {0xea4d,0x9da4}, {0xea4e,0x9da9}, {0xea4f,0x9db2}, {0xea50,0x9dc4}, {0xea51,0x9dc1}, {0xea52,0x9dbb}, {0xea53,0x9db8}, {0xea54,0x9dba}, {0xea55,0x9dc6}, {0xea56,0x9dcf}, {0xea57,0x9dc2}, {0xea58,0x9dd9}, {0xea59,0x9dd3}, {0xea5a,0x9df8}, {0xea5b,0x9de6}, {0xea5c,0x9ded}, {0xea5d,0x9def}, {0xea5e,0x9dfd}, {0xea5f,0x9e1a}, {0xea60,0x9e1b}, {0xea61,0x9e1e}, {0xea62,0x9e75}, {0xea63,0x9e79}, {0xea64,0x9e7d}, {0xea65,0x9e81}, {0xea66,0x9e88}, {0xea67,0x9e8b}, {0xea68,0x9e8c}, {0xea69,0x9e92}, {0xea6a,0x9e95}, {0xea6b,0x9e91}, {0xea6c,0x9e9d}, {0xea6d,0x9ea5}, {0xea6e,0x9ea9}, {0xea6f,0x9eb8}, {0xea70,0x9eaa}, {0xea71,0x9ead}, {0xea72,0x9761}, {0xea73,0x9ecc}, {0xea74,0x9ece}, {0xea75,0x9ecf}, {0xea76,0x9ed0}, {0xea77,0x9ed4}, {0xea78,0x9edc}, {0xea79,0x9ede}, {0xea7a,0x9edd}, {0xea7b,0x9ee0}, {0xea7c,0x9ee5}, {0xea7d,0x9ee8}, {0xea7e,0x9eef}, {0xea80,0x9ef4}, {0xea81,0x9ef6}, {0xea82,0x9ef7}, {0xea83,0x9ef9}, {0xea84,0x9efb}, {0xea85,0x9efc}, {0xea86,0x9efd}, {0xea87,0x9f07}, {0xea88,0x9f08}, {0xea89,0x76b7}, {0xea8a,0x9f15}, {0xea8b,0x9f21}, {0xea8c,0x9f2c}, {0xea8d,0x9f3e}, {0xea8e,0x9f4a}, {0xea8f,0x9f52}, {0xea90,0x9f54}, {0xea91,0x9f63}, {0xea92,0x9f5f}, {0xea93,0x9f60}, {0xea94,0x9f61}, {0xea95,0x9f66}, {0xea96,0x9f67}, {0xea97,0x9f6c}, {0xea98,0x9f6a}, {0xea99,0x9f77}, {0xea9a,0x9f72}, {0xea9b,0x9f76}, {0xea9c,0x9f95}, {0xea9d,0x9f9c}, {0xea9e,0x9fa0}, {0xea9f,0x582f}, {0xeaa0,0x69c7}, {0xeaa1,0x9059}, {0xeaa2,0x7464}, {0xeaa3,0x51dc}, {0xeaa4,0x7199}, {0xeaa5,0xffff}, {0xeaa6,0x5de2}, {0xeaa7,0x5e14}, {0xeaa8,0x5e18}, {0xeaa9,0x5e58}, {0xeaaa,0x5e5e}, {0xeaab,0x5ebe}, {0xeaac,0xf928}, {0xeaad,0x5ecb}, {0xeaae,0x5ef9}, {0xeaaf,0x5f00}, {0xeab0,0x5f02}, {0xeab1,0x5f07}, {0xeab2,0x5f1d}, {0xeab3,0x5f23}, {0xeab4,0x5f34}, {0xeab5,0x5f36}, {0xeab6,0x5f3d}, {0xeab7,0x5f40}, {0xeab8,0x5f45}, {0xeab9,0x5f54}, {0xeaba,0x5f58}, {0xeabb,0x5f64}, {0xeabc,0x5f67}, {0xeabd,0x5f7d}, {0xeabe,0x5f89}, {0xeabf,0x5f9c}, {0xeac0,0x5fa7}, {0xeac1,0x5faf}, {0xeac2,0x5fb5}, {0xeac3,0x5fb7}, {0xeac4,0x5fc9}, {0xeac5,0x5fde}, {0xeac6,0x5fe1}, {0xeac7,0x5fe9}, {0xeac8,0x600d}, {0xeac9,0x6014}, {0xeaca,0x6018}, {0xeacb,0x6033}, {0xeacc,0x6035}, {0xeacd,0x6047}, {0xeace,0x0}, {0xeacf,0x609d}, {0xead0,0x609e}, {0xead1,0x60cb}, {0xead2,0x60d4}, {0xead3,0x60d5}, {0xead4,0x60dd}, {0xead5,0x60f8}, {0xead6,0x611c}, {0xead7,0x612b}, {0xead8,0x6130}, {0xead9,0x6137}, {0xeada,0x0}, {0xeadb,0x618d}, {0xeadc,0x0}, {0xeadd,0x61bc}, {0xeade,0x61b9}, {0xeadf,0x0}, {0xeae0,0x6222}, {0xeae1,0x623e}, {0xeae2,0x6243}, {0xeae3,0x6256}, {0xeae4,0x625a}, {0xeae5,0x626f}, {0xeae6,0x6285}, {0xeae7,0x62c4}, {0xeae8,0x62d6}, {0xeae9,0x62fc}, {0xeaea,0x630a}, {0xeaeb,0x6318}, {0xeaec,0x6339}, {0xeaed,0x6343}, {0xeaee,0x6365}, {0xeaef,0x637c}, {0xeaf0,0x63e5}, {0xeaf1,0x63ed}, {0xeaf2,0x63f5}, {0xeaf3,0x6410}, {0xeaf4,0x6414}, {0xeaf5,0x6422}, {0xeaf6,0x6479}, {0xeaf7,0x6451}, {0xeaf8,0x6460}, {0xeaf9,0x646d}, {0xeafa,0x64ce}, {0xeafb,0x64be}, {0xeafc,0x64bf}, {0xeb40,0x64c4}, {0xeb41,0x64ca}, {0xeb42,0x64d0}, {0xeb43,0x64f7}, {0xeb44,0x64fb}, {0xeb45,0x6522}, {0xeb46,0x6529}, {0xeb47,0x0}, {0xeb48,0x6567}, {0xeb49,0x659d}, {0xeb4a,0x0}, {0xeb4b,0x6600}, {0xeb4c,0x6609}, {0xeb4d,0x6615}, {0xeb4e,0x661e}, {0xeb4f,0x663a}, {0xeb50,0x6622}, {0xeb51,0x6624}, {0xeb52,0x662b}, {0xeb53,0x6630}, {0xeb54,0x6631}, {0xeb55,0x6633}, {0xeb56,0x66fb}, {0xeb57,0x6648}, {0xeb58,0x664c}, {0xeb59,0x0}, {0xeb5a,0x6659}, {0xeb5b,0x665a}, {0xeb5c,0x6661}, {0xeb5d,0x6665}, {0xeb5e,0x6673}, {0xeb5f,0x6677}, {0xeb60,0x6678}, {0xeb61,0x668d}, {0xeb62,0x0}, {0xeb63,0x66a0}, {0xeb64,0x66b2}, {0xeb65,0x66bb}, {0xeb66,0x66c6}, {0xeb67,0x66c8}, {0xeb68,0x3b22}, {0xeb69,0x66db}, {0xeb6a,0x66e8}, {0xeb6b,0x66fa}, {0xeb6c,0x6713}, {0xeb6d,0xf929}, {0xeb6e,0x6733}, {0xeb6f,0x6766}, {0xeb70,0x6747}, {0xeb71,0x6748}, {0xeb72,0x677b}, {0xeb73,0x6781}, {0xeb74,0x6793}, {0xeb75,0x6798}, {0xeb76,0x679b}, {0xeb77,0x67bb}, {0xeb78,0x67f9}, {0xeb79,0x67c0}, {0xeb7a,0x67d7}, {0xeb7b,0x67fc}, {0xeb7c,0x6801}, {0xeb7d,0x6852}, {0xeb7e,0x681d}, {0xeb80,0x682c}, {0xeb81,0x6831}, {0xeb82,0x685b}, {0xeb83,0x6872}, {0xeb84,0x6875}, {0xeb85,0x0}, {0xeb86,0x68a3}, {0xeb87,0x68a5}, {0xeb88,0x68b2}, {0xeb89,0x68c8}, {0xeb8a,0x68d0}, {0xeb8b,0x68e8}, {0xeb8c,0x68ed}, {0xeb8d,0x68f0}, {0xeb8e,0x68f1}, {0xeb8f,0x68fc}, {0xeb90,0x690a}, {0xeb91,0x6949}, {0xeb92,0x0}, {0xeb93,0x6935}, {0xeb94,0x6942}, {0xeb95,0x6957}, {0xeb96,0x6963}, {0xeb97,0x6964}, {0xeb98,0x6968}, {0xeb99,0x6980}, {0xeb9a,0xfa14}, {0xeb9b,0x69a5}, {0xeb9c,0x69ad}, {0xeb9d,0x69cf}, {0xeb9e,0x3bb6}, {0xeb9f,0x3bc3}, {0xeba0,0x69e2}, {0xeba1,0x69e9}, {0xeba2,0x0}, {0xeba3,0x69f5}, {0xeba4,0x69f6}, {0xeba5,0x6a0f}, {0xeba6,0x6a15}, {0xeba7,0x0}, {0xeba8,0x6a3b}, {0xeba9,0x6a3e}, {0xebaa,0x6a45}, {0xebab,0x6a50}, {0xebac,0x6a56}, {0xebad,0x6a5b}, {0xebae,0x6a6b}, {0xebaf,0x6a73}, {0xebb0,0x0}, {0xebb1,0x6a89}, {0xebb2,0x6a94}, {0xebb3,0x6a9d}, {0xebb4,0x6a9e}, {0xebb5,0x6aa5}, {0xebb6,0x6ae4}, {0xebb7,0x6ae7}, {0xebb8,0x3c0f}, {0xebb9,0xf91d}, {0xebba,0x6b1b}, {0xebbb,0x6b1e}, {0xebbc,0x6b2c}, {0xebbd,0x6b35}, {0xebbe,0x6b46}, {0xebbf,0x6b56}, {0xebc0,0x6b60}, {0xebc1,0x6b65}, {0xebc2,0x6b67}, {0xebc3,0x6b77}, {0xebc4,0x6b82}, {0xebc5,0x6ba9}, {0xebc6,0x6bad}, {0xebc7,0xf970}, {0xebc8,0x6bcf}, {0xebc9,0x6bd6}, {0xebca,0x6bd7}, {0xebcb,0x6bff}, {0xebcc,0x6c05}, {0xebcd,0x6c10}, {0xebce,0x6c33}, {0xebcf,0x6c59}, {0xebd0,0x6c5c}, {0xebd1,0x6caa}, {0xebd2,0x6c74}, {0xebd3,0x6c76}, {0xebd4,0x6c85}, {0xebd5,0x6c86}, {0xebd6,0x6c98}, {0xebd7,0x6c9c}, {0xebd8,0x6cfb}, {0xebd9,0x6cc6}, {0xebda,0x6cd4}, {0xebdb,0x6ce0}, {0xebdc,0x6ceb}, {0xebdd,0x6cee}, {0xebde,0x0}, {0xebdf,0x6d04}, {0xebe0,0x6d0e}, {0xebe1,0x6d2e}, {0xebe2,0x6d31}, {0xebe3,0x6d39}, {0xebe4,0x6d3f}, {0xebe5,0x6d58}, {0xebe6,0x6d65}, {0xebe7,0x0}, {0xebe8,0x6d82}, {0xebe9,0x6d87}, {0xebea,0x6d89}, {0xebeb,0x6d94}, {0xebec,0x6daa}, {0xebed,0x6dac}, {0xebee,0x6dbf}, {0xebef,0x6dc4}, {0xebf0,0x6dd6}, {0xebf1,0x6dda}, {0xebf2,0x6ddb}, {0xebf3,0x6ddd}, {0xebf4,0x6dfc}, {0xebf5,0x0}, {0xebf6,0x6e34}, {0xebf7,0x6e44}, {0xebf8,0x6e5c}, {0xebf9,0x6e5e}, {0xebfa,0x6eab}, {0xebfb,0x6eb1}, {0xebfc,0x6ec1}, {0xec40,0x6ec7}, {0xec41,0x6ece}, {0xec42,0x6f10}, {0xec43,0x6f1a}, {0xec44,0x0}, {0xec45,0x6f2a}, {0xec46,0x6f2f}, {0xec47,0x6f33}, {0xec48,0x6f51}, {0xec49,0x6f59}, {0xec4a,0x6f5e}, {0xec4b,0x6f61}, {0xec4c,0x6f62}, {0xec4d,0x6f7e}, {0xec4e,0x6f88}, {0xec4f,0x6f8c}, {0xec50,0x6f8d}, {0xec51,0x6f94}, {0xec52,0x6fa0}, {0xec53,0x6fa7}, {0xec54,0x6fb6}, {0xec55,0x6fbc}, {0xec56,0x6fc7}, {0xec57,0x6fca}, {0xec58,0x6ff9}, {0xec59,0x6ff0}, {0xec5a,0x6ff5}, {0xec5b,0x7005}, {0xec5c,0x7006}, {0xec5d,0x7028}, {0xec5e,0x704a}, {0xec5f,0x705d}, {0xec60,0x705e}, {0xec61,0x704e}, {0xec62,0x7064}, {0xec63,0x7075}, {0xec64,0x7085}, {0xec65,0x70a4}, {0xec66,0x70ab}, {0xec67,0x70b7}, {0xec68,0x70d4}, {0xec69,0x70d8}, {0xec6a,0x70e4}, {0xec6b,0x710f}, {0xec6c,0x712b}, {0xec6d,0x711e}, {0xec6e,0x7120}, {0xec6f,0x712e}, {0xec70,0x7130}, {0xec71,0x7146}, {0xec72,0x7147}, {0xec73,0x7151}, {0xec74,0x0}, {0xec75,0x7152}, {0xec76,0x715c}, {0xec77,0x7160}, {0xec78,0x7168}, {0xec79,0xfa15}, {0xec7a,0x7185}, {0xec7b,0x7187}, {0xec7c,0x7192}, {0xec7d,0x71c1}, {0xec7e,0x71ba}, {0xec80,0x71c4}, {0xec81,0x71fe}, {0xec82,0x7200}, {0xec83,0x7215}, {0xec84,0x7255}, {0xec85,0x7256}, {0xec86,0x3e3f}, {0xec87,0x728d}, {0xec88,0x729b}, {0xec89,0x72be}, {0xec8a,0x72c0}, {0xec8b,0x72fb}, {0xec8c,0x0}, {0xec8d,0x7327}, {0xec8e,0x7328}, {0xec8f,0xfa16}, {0xec90,0x7350}, {0xec91,0x7366}, {0xec92,0x737c}, {0xec93,0x7395}, {0xec94,0x739f}, {0xec95,0x73a0}, {0xec96,0x73a2}, {0xec97,0x73a6}, {0xec98,0x73ab}, {0xec99,0x73c9}, {0xec9a,0x73cf}, {0xec9b,0x73d6}, {0xec9c,0x73d9}, {0xec9d,0x73e3}, {0xec9e,0x73e9}, {0xec9f,0x7407}, {0xeca0,0x740a}, {0xeca1,0x741a}, {0xeca2,0x741b}, {0xeca3,0x0}, {0xeca4,0x7426}, {0xeca5,0x7428}, {0xeca6,0x742a}, {0xeca7,0x742b}, {0xeca8,0x742c}, {0xeca9,0x742e}, {0xecaa,0x742f}, {0xecab,0x7430}, {0xecac,0x7444}, {0xecad,0x7446}, {0xecae,0x7447}, {0xecaf,0x744b}, {0xecb0,0x7457}, {0xecb1,0x7462}, {0xecb2,0x746b}, {0xecb3,0x746d}, {0xecb4,0x7486}, {0xecb5,0x7487}, {0xecb6,0x7489}, {0xecb7,0x7498}, {0xecb8,0x749c}, {0xecb9,0x749f}, {0xecba,0x74a3}, {0xecbb,0x7490}, {0xecbc,0x74a6}, {0xecbd,0x74a8}, {0xecbe,0x74a9}, {0xecbf,0x74b5}, {0xecc0,0x74bf}, {0xecc1,0x74c8}, {0xecc2,0x74c9}, {0xecc3,0x74da}, {0xecc4,0x74ff}, {0xecc5,0x7501}, {0xecc6,0x7517}, {0xecc7,0x752f}, {0xecc8,0x756f}, {0xecc9,0x7579}, {0xecca,0x7592}, {0xeccb,0x3f72}, {0xeccc,0x75ce}, {0xeccd,0x75e4}, {0xecce,0x7600}, {0xeccf,0x7602}, {0xecd0,0x7608}, {0xecd1,0x7615}, {0xecd2,0x7616}, {0xecd3,0x7619}, {0xecd4,0x761e}, {0xecd5,0x762d}, {0xecd6,0x7635}, {0xecd7,0x7643}, {0xecd8,0x764b}, {0xecd9,0x7664}, {0xecda,0x7665}, {0xecdb,0x766d}, {0xecdc,0x766f}, {0xecdd,0x7671}, {0xecde,0x7681}, {0xecdf,0x769b}, {0xece0,0x769d}, {0xece1,0x769e}, {0xece2,0x76a6}, {0xece3,0x76aa}, {0xece4,0x76b6}, {0xece5,0x76c5}, {0xece6,0x76cc}, {0xece7,0x76ce}, {0xece8,0x76d4}, {0xece9,0x76e6}, {0xecea,0x76f1}, {0xeceb,0x76fc}, {0xecec,0x770a}, {0xeced,0x7719}, {0xecee,0x7734}, {0xecef,0x7736}, {0xecf0,0x7746}, {0xecf1,0x774d}, {0xecf2,0x774e}, {0xecf3,0x775c}, {0xecf4,0x775f}, {0xecf5,0x7762}, {0xecf6,0x777a}, {0xecf7,0x7780}, {0xecf8,0x7794}, {0xecf9,0x77aa}, {0xecfa,0x77e0}, {0xecfb,0x782d}, {0xecfc,0x0}, {0xed40,0x7843}, {0xed41,0x784e}, {0xed42,0x784f}, {0xed43,0x7851}, {0xed44,0x7868}, {0xed45,0x786e}, {0xed46,0x0}, {0xed47,0x78b0}, {0xed48,0x0}, {0xed49,0x78ad}, {0xed4a,0x78e4}, {0xed4b,0x78f2}, {0xed4c,0x7900}, {0xed4d,0x78f7}, {0xed4e,0x791c}, {0xed4f,0x792e}, {0xed50,0x7931}, {0xed51,0x7934}, {0xed52,0x0}, {0xed53,0x0}, {0xed54,0x7945}, {0xed55,0x7946}, {0xed56,0x0}, {0xed57,0x0}, {0xed58,0x0}, {0xed59,0x795c}, {0xed5a,0x0}, {0xed5b,0xfa19}, {0xed5c,0xfa1a}, {0xed5d,0x7979}, {0xed5e,0x0}, {0xed5f,0x0}, {0xed60,0xfa1b}, {0xed61,0x7998}, {0xed62,0x79b1}, {0xed63,0x79b8}, {0xed64,0x79c8}, {0xed65,0x79ca}, {0xed66,0x0}, {0xed67,0x79d4}, {0xed68,0x79de}, {0xed69,0x79eb}, {0xed6a,0x79ed}, {0xed6b,0x7a03}, {0xed6c,0x0}, {0xed6d,0x7a39}, {0xed6e,0x7a5d}, {0xed6f,0x7a6d}, {0xed70,0x0}, {0xed71,0x7a85}, {0xed72,0x7aa0}, {0xed73,0x0}, {0xed74,0x7ab3}, {0xed75,0x7abb}, {0xed76,0x7ace}, {0xed77,0x7aeb}, {0xed78,0x7afd}, {0xed79,0x7b12}, {0xed7a,0x7b2d}, {0xed7b,0x7b3b}, {0xed7c,0x7b47}, {0xed7d,0x7b4e}, {0xed7e,0x7b60}, {0xed80,0x7b6d}, {0xed81,0x7b6f}, {0xed82,0x7b72}, {0xed83,0x7b9e}, {0xed84,0x0}, {0xed85,0x7bd7}, {0xed86,0x7bd9}, {0xed87,0x7c01}, {0xed88,0x7c31}, {0xed89,0x7c1e}, {0xed8a,0x7c20}, {0xed8b,0x7c33}, {0xed8c,0x7c36}, {0xed8d,0x4264}, {0xed8e,0x0}, {0xed8f,0x7c59}, {0xed90,0x7c6d}, {0xed91,0x7c79}, {0xed92,0x7c8f}, {0xed93,0x7c94}, {0xed94,0x7ca0}, {0xed95,0x7cbc}, {0xed96,0x7cd5}, {0xed97,0x7cd9}, {0xed98,0x7cdd}, {0xed99,0x7d07}, {0xed9a,0x7d08}, {0xed9b,0x7d13}, {0xed9c,0x7d1d}, {0xed9d,0x7d23}, {0xed9e,0x7d31}, {0xed9f,0x7d41}, {0xeda0,0x7d48}, {0xeda1,0x7d53}, {0xeda2,0x7d5c}, {0xeda3,0x7d7a}, {0xeda4,0x7d83}, {0xeda5,0x7d8b}, {0xeda6,0x7da0}, {0xeda7,0x7da6}, {0xeda8,0x7dc2}, {0xeda9,0x7dcc}, {0xedaa,0x7dd6}, {0xedab,0x7de3}, {0xedac,0x0}, {0xedad,0x7e28}, {0xedae,0x7e08}, {0xedaf,0x7e11}, {0xedb0,0x7e15}, {0xedb1,0x0}, {0xedb2,0x7e47}, {0xedb3,0x7e52}, {0xedb4,0x7e61}, {0xedb5,0x7e8a}, {0xedb6,0x7e8d}, {0xedb7,0x7f47}, {0xedb8,0x0}, {0xedb9,0x7f91}, {0xedba,0x7f97}, {0xedbb,0x7fbf}, {0xedbc,0x7fce}, {0xedbd,0x7fdb}, {0xedbe,0x7fdf}, {0xedbf,0x7fec}, {0xedc0,0x7fee}, {0xedc1,0x7ffa}, {0xedc2,0x0}, {0xedc3,0x8014}, {0xedc4,0x8026}, {0xedc5,0x8035}, {0xedc6,0x8037}, {0xedc7,0x803c}, {0xedc8,0x80ca}, {0xedc9,0x80d7}, {0xedca,0x80e0}, {0xedcb,0x80f3}, {0xedcc,0x8118}, {0xedcd,0x814a}, {0xedce,0x8160}, {0xedcf,0x8167}, {0xedd0,0x8168}, {0xedd1,0x816d}, {0xedd2,0x81bb}, {0xedd3,0x81ca}, {0xedd4,0x81cf}, {0xedd5,0x81d7}, {0xedd6,0x0}, {0xedd7,0x4453}, {0xedd8,0x445b}, {0xedd9,0x8260}, {0xedda,0x8274}, {0xeddb,0x0}, {0xeddc,0x828e}, {0xeddd,0x82a1}, {0xedde,0x82a3}, {0xeddf,0x82a4}, {0xede0,0x82a9}, {0xede1,0x82ae}, {0xede2,0x82b7}, {0xede3,0x82be}, {0xede4,0x82bf}, {0xede5,0x82c6}, {0xede6,0x82d5}, {0xede7,0x82fd}, {0xede8,0x82fe}, {0xede9,0x8300}, {0xedea,0x8301}, {0xedeb,0x8362}, {0xedec,0x8322}, {0xeded,0x832d}, {0xedee,0x833a}, {0xedef,0x8343}, {0xedf0,0x8347}, {0xedf1,0x8351}, {0xedf2,0x8355}, {0xedf3,0x837d}, {0xedf4,0x8386}, {0xedf5,0x8392}, {0xedf6,0x8398}, {0xedf7,0x83a7}, {0xedf8,0x83a9}, {0xedf9,0x83bf}, {0xedfa,0x83c0}, {0xedfb,0x83c7}, {0xedfc,0x83cf}, {0xee40,0x83d1}, {0xee41,0x83e1}, {0xee42,0x83ea}, {0xee43,0x8401}, {0xee44,0x8406}, {0xee45,0x840a}, {0xee46,0x0}, {0xee47,0x8448}, {0xee48,0x845f}, {0xee49,0x8470}, {0xee4a,0x8473}, {0xee4b,0x8485}, {0xee4c,0x849e}, {0xee4d,0x84af}, {0xee4e,0x84b4}, {0xee4f,0x84ba}, {0xee50,0x84c0}, {0xee51,0x84c2}, {0xee52,0x0}, {0xee53,0x8532}, {0xee54,0x851e}, {0xee55,0x8523}, {0xee56,0x852f}, {0xee57,0x8559}, {0xee58,0x8564}, {0xee59,0xfa1f}, {0xee5a,0x85ad}, {0xee5b,0x857a}, {0xee5c,0x858c}, {0xee5d,0x858f}, {0xee5e,0x85a2}, {0xee5f,0x85b0}, {0xee60,0x85cb}, {0xee61,0x85ce}, {0xee62,0x85ed}, {0xee63,0x8612}, {0xee64,0x85ff}, {0xee65,0x8604}, {0xee66,0x8605}, {0xee67,0x8610}, {0xee68,0x0}, {0xee69,0x8618}, {0xee6a,0x8629}, {0xee6b,0x8638}, {0xee6c,0x8657}, {0xee6d,0x865b}, {0xee6e,0xf936}, {0xee6f,0x8662}, {0xee70,0x459d}, {0xee71,0x866c}, {0xee72,0x8675}, {0xee73,0x8698}, {0xee74,0x86b8}, {0xee75,0x86fa}, {0xee76,0x86fc}, {0xee77,0x86fd}, {0xee78,0x870b}, {0xee79,0x8771}, {0xee7a,0x8787}, {0xee7b,0x8788}, {0xee7c,0x87ac}, {0xee7d,0x87ad}, {0xee7e,0x87b5}, {0xee80,0x45ea}, {0xee81,0x87d6}, {0xee82,0x87ec}, {0xee83,0x8806}, {0xee84,0x880a}, {0xee85,0x8810}, {0xee86,0x8814}, {0xee87,0x881f}, {0xee88,0x8898}, {0xee89,0x88aa}, {0xee8a,0x88ca}, {0xee8b,0x88ce}, {0xee8c,0x0}, {0xee8d,0x88f5}, {0xee8e,0x891c}, {0xee8f,0x0}, {0xee90,0x8918}, {0xee91,0x8919}, {0xee92,0x891a}, {0xee93,0x8927}, {0xee94,0x8930}, {0xee95,0x8932}, {0xee96,0x8939}, {0xee97,0x8940}, {0xee98,0x8994}, {0xee99,0x0}, {0xee9a,0x89d4}, {0xee9b,0x89e5}, {0xee9c,0x89f6}, {0xee9d,0x8a12}, {0xee9e,0x8a15}, {0xee9f,0x8a22}, {0xeea0,0x8a37}, {0xeea1,0x8a47}, {0xeea2,0x8a4e}, {0xeea3,0x8a5d}, {0xeea4,0x8a61}, {0xeea5,0x8a75}, {0xeea6,0x8a79}, {0xeea7,0x8aa7}, {0xeea8,0x8ad0}, {0xeea9,0x8adf}, {0xeeaa,0x8af4}, {0xeeab,0x8af6}, {0xeeac,0xfa22}, {0xeead,0x0}, {0xeeae,0x0}, {0xeeaf,0x8b46}, {0xeeb0,0x8b54}, {0xeeb1,0x8b59}, {0xeeb2,0x8b69}, {0xeeb3,0x8b9d}, {0xeeb4,0x8c49}, {0xeeb5,0x8c68}, {0xeeb6,0x0}, {0xeeb7,0x8ce1}, {0xeeb8,0x8cf4}, {0xeeb9,0x8cf8}, {0xeeba,0x8cfe}, {0xeebb,0x0}, {0xeebc,0x8d12}, {0xeebd,0x8d1b}, {0xeebe,0x8daf}, {0xeebf,0x8dce}, {0xeec0,0x8dd1}, {0xeec1,0x8dd7}, {0xeec2,0x8e20}, {0xeec3,0x8e23}, {0xeec4,0x8e3d}, {0xeec5,0x8e70}, {0xeec6,0x8e7b}, {0xeec7,0x0}, {0xeec8,0x8ec0}, {0xeec9,0x4844}, {0xeeca,0x8efa}, {0xeecb,0x8f1e}, {0xeecc,0x8f2d}, {0xeecd,0x8f36}, {0xeece,0x8f54}, {0xeecf,0x0}, {0xeed0,0x8fa6}, {0xeed1,0x8fb5}, {0xeed2,0x8fe4}, {0xeed3,0x8fe8}, {0xeed4,0x8fee}, {0xeed5,0x9008}, {0xeed6,0x902d}, {0xeed7,0x0}, {0xeed8,0x9088}, {0xeed9,0x9095}, {0xeeda,0x9097}, {0xeedb,0x9099}, {0xeedc,0x909b}, {0xeedd,0x90a2}, {0xeede,0x90b3}, {0xeedf,0x90be}, {0xeee0,0x90c4}, {0xeee1,0x90c5}, {0xeee2,0x90c7}, {0xeee3,0x90d7}, {0xeee4,0x90dd}, {0xeee5,0x90de}, {0xeee6,0x90ef}, {0xeee7,0x90f4}, {0xeee8,0xfa26}, {0xeee9,0x9114}, {0xeeea,0x9115}, {0xeeeb,0x9116}, {0xeeec,0x9122}, {0xeeed,0x9123}, {0xeeee,0x9127}, {0xeeef,0x912f}, {0xeef0,0x9131}, {0xeef1,0x9134}, {0xeef2,0x913d}, {0xeef3,0x9148}, {0xeef4,0x915b}, {0xeef5,0x9183}, {0xeef6,0x919e}, {0xeef7,0x91ac}, {0xeef8,0x91b1}, {0xeef9,0x91bc}, {0xeefa,0x91d7}, {0xeefb,0x91fb}, {0xeefc,0x91e4}, {0xef40,0x91e5}, {0xef41,0x91ed}, {0xef42,0x91f1}, {0xef43,0x9207}, {0xef44,0x9210}, {0xef45,0x9238}, {0xef46,0x9239}, {0xef47,0x923a}, {0xef48,0x923c}, {0xef49,0x9240}, {0xef4a,0x9243}, {0xef4b,0x924f}, {0xef4c,0x9278}, {0xef4d,0x9288}, {0xef4e,0x92c2}, {0xef4f,0x92cb}, {0xef50,0x92cc}, {0xef51,0x92d3}, {0xef52,0x92e0}, {0xef53,0x92ff}, {0xef54,0x9304}, {0xef55,0x931f}, {0xef56,0x9321}, {0xef57,0x9325}, {0xef58,0x9348}, {0xef59,0x9349}, {0xef5a,0x934a}, {0xef5b,0x9364}, {0xef5c,0x9365}, {0xef5d,0x936a}, {0xef5e,0x9370}, {0xef5f,0x939b}, {0xef60,0x93a3}, {0xef61,0x93ba}, {0xef62,0x93c6}, {0xef63,0x93de}, {0xef64,0x93df}, {0xef65,0x9404}, {0xef66,0x93fd}, {0xef67,0x9433}, {0xef68,0x944a}, {0xef69,0x9463}, {0xef6a,0x946b}, {0xef6b,0x9471}, {0xef6c,0x9472}, {0xef6d,0x958e}, {0xef6e,0x959f}, {0xef6f,0x95a6}, {0xef70,0x95a9}, {0xef71,0x95ac}, {0xef72,0x95b6}, {0xef73,0x95bd}, {0xef74,0x95cb}, {0xef75,0x95d0}, {0xef76,0x95d3}, {0xef77,0x49b0}, {0xef78,0x95da}, {0xef79,0x95de}, {0xef7a,0x9658}, {0xef7b,0x9684}, {0xef7c,0xf9dc}, {0xef7d,0x969d}, {0xef7e,0x96a4}, {0xef80,0x96a5}, {0xef81,0x96d2}, {0xef82,0x96de}, {0xef83,0x0}, {0xef84,0x96e9}, {0xef85,0x96ef}, {0xef86,0x9733}, {0xef87,0x973b}, {0xef88,0x974d}, {0xef89,0x974e}, {0xef8a,0x974f}, {0xef8b,0x975a}, {0xef8c,0x976e}, {0xef8d,0x9773}, {0xef8e,0x9795}, {0xef8f,0x97ae}, {0xef90,0x97ba}, {0xef91,0x97c1}, {0xef92,0x97c9}, {0xef93,0x97de}, {0xef94,0x97db}, {0xef95,0x97f4}, {0xef96,0x0}, {0xef97,0x980a}, {0xef98,0x981e}, {0xef99,0x982b}, {0xef9a,0x9830}, {0xef9b,0x0}, {0xef9c,0x9852}, {0xef9d,0x9853}, {0xef9e,0x9856}, {0xef9f,0x9857}, {0xefa0,0x9859}, {0xefa1,0x985a}, {0xefa2,0xf9d0}, {0xefa3,0x9865}, {0xefa4,0x986c}, {0xefa5,0x98ba}, {0xefa6,0x98c8}, {0xefa7,0x98e7}, {0xefa8,0x9958}, {0xefa9,0x999e}, {0xefaa,0x9a02}, {0xefab,0x9a03}, {0xefac,0x9a24}, {0xefad,0x9a2d}, {0xefae,0x9a2e}, {0xefaf,0x9a38}, {0xefb0,0x9a4a}, {0xefb1,0x9a4e}, {0xefb2,0x9a52}, {0xefb3,0x9ab6}, {0xefb4,0x9ac1}, {0xefb5,0x9ac3}, {0xefb6,0x9ace}, {0xefb7,0x9ad6}, {0xefb8,0x9af9}, {0xefb9,0x9b02}, {0xefba,0x9b08}, {0xefbb,0x9b20}, {0xefbc,0x4c17}, {0xefbd,0x0}, {0xefbe,0x9b5e}, {0xefbf,0x9b79}, {0xefc0,0x9b66}, {0xefc1,0x9b72}, {0xefc2,0x9b75}, {0xefc3,0x9b84}, {0xefc4,0x9b8a}, {0xefc5,0x9b8f}, {0xefc6,0x9b9e}, {0xefc7,0x9ba7}, {0xefc8,0x9bc1}, {0xefc9,0x9bce}, {0xefca,0x9be5}, {0xefcb,0x9bf8}, {0xefcc,0x9bfd}, {0xefcd,0x9c00}, {0xefce,0x9c23}, {0xefcf,0x9c41}, {0xefd0,0x9c4f}, {0xefd1,0x9c50}, {0xefd2,0x9c53}, {0xefd3,0x9c63}, {0xefd4,0x9c65}, {0xefd5,0x9c77}, {0xefd6,0x9d1d}, {0xefd7,0x9d1e}, {0xefd8,0x9d43}, {0xefd9,0x9d47}, {0xefda,0x9d52}, {0xefdb,0x9d63}, {0xefdc,0x9d70}, {0xefdd,0x9d7c}, {0xefde,0x9d8a}, {0xefdf,0x9d96}, {0xefe0,0x9dc0}, {0xefe1,0x9dac}, {0xefe2,0x9dbc}, {0xefe3,0x9dd7}, {0xefe4,0x0}, {0xefe5,0x9de7}, {0xefe6,0x9e07}, {0xefe7,0x9e15}, {0xefe8,0x9e7c}, {0xefe9,0x9e9e}, {0xefea,0x9ea4}, {0xefeb,0x9eac}, {0xefec,0x9eaf}, {0xefed,0x9eb4}, {0xefee,0x9eb5}, {0xefef,0x9ec3}, {0xeff0,0x9ed1}, {0xeff1,0x9f10}, {0xeff2,0x9f39}, {0xeff3,0x9f57}, {0xeff4,0x9f90}, {0xeff5,0x9f94}, {0xeff6,0x9f97}, {0xeff7,0x9fa2}, {0xeff8,0xffff}, {0xeff9,0xffff}, {0xeffa,0xffff}, {0xeffb,0xffff}, {0xeffc,0xffff}, {0xf040,0x0}, {0xf041,0x4e02}, {0xf042,0x4e0f}, {0xf043,0x4e12}, {0xf044,0x4e29}, {0xf045,0x4e2b}, {0xf046,0x4e2e}, {0xf047,0x4e40}, {0xf048,0x4e47}, {0xf049,0x4e48}, {0xf04a,0x0}, {0xf04b,0x4e51}, {0xf04c,0x3406}, {0xf04d,0x0}, {0xf04e,0x4e5a}, {0xf04f,0x4e69}, {0xf050,0x4e9d}, {0xf051,0x342c}, {0xf052,0x342e}, {0xf053,0x4eb9}, {0xf054,0x4ebb}, {0xf055,0x0}, {0xf056,0x4ebc}, {0xf057,0x4ec3}, {0xf058,0x4ec8}, {0xf059,0x4ed0}, {0xf05a,0x4eeb}, {0xf05b,0x4eda}, {0xf05c,0x4ef1}, {0xf05d,0x4ef5}, {0xf05e,0x4f00}, {0xf05f,0x4f16}, {0xf060,0x4f64}, {0xf061,0x4f37}, {0xf062,0x4f3e}, {0xf063,0x4f54}, {0xf064,0x4f58}, {0xf065,0x0}, {0xf066,0x4f77}, {0xf067,0x4f78}, {0xf068,0x4f7a}, {0xf069,0x4f7d}, {0xf06a,0x4f82}, {0xf06b,0x4f85}, {0xf06c,0x4f92}, {0xf06d,0x4f9a}, {0xf06e,0x4fe6}, {0xf06f,0x4fb2}, {0xf070,0x4fbe}, {0xf071,0x4fc5}, {0xf072,0x4fcb}, {0xf073,0x4fcf}, {0xf074,0x4fd2}, {0xf075,0x346a}, {0xf076,0x4ff2}, {0xf077,0x5000}, {0xf078,0x5010}, {0xf079,0x5013}, {0xf07a,0x501c}, {0xf07b,0x501e}, {0xf07c,0x5022}, {0xf07d,0x3468}, {0xf07e,0x5042}, {0xf080,0x5046}, {0xf081,0x504e}, {0xf082,0x5053}, {0xf083,0x5057}, {0xf084,0x5063}, {0xf085,0x5066}, {0xf086,0x506a}, {0xf087,0x5070}, {0xf088,0x50a3}, {0xf089,0x5088}, {0xf08a,0x5092}, {0xf08b,0x5093}, {0xf08c,0x5095}, {0xf08d,0x5096}, {0xf08e,0x509c}, {0xf08f,0x50aa}, {0xf090,0x0}, {0xf091,0x50b1}, {0xf092,0x50ba}, {0xf093,0x50bb}, {0xf094,0x50c4}, {0xf095,0x50c7}, {0xf096,0x50f3}, {0xf097,0x0}, {0xf098,0x50ce}, {0xf099,0x0}, {0xf09a,0x50d4}, {0xf09b,0x50d9}, {0xf09c,0x50e1}, {0xf09d,0x50e9}, {0xf09e,0x3492}, {0xf140,0x5108}, {0xf141,0x0}, {0xf142,0x5117}, {0xf143,0x511b}, {0xf144,0x0}, {0xf145,0x5160}, {0xf146,0x0}, {0xf147,0x5173}, {0xf148,0x5183}, {0xf149,0x518b}, {0xf14a,0x34bc}, {0xf14b,0x5198}, {0xf14c,0x51a3}, {0xf14d,0x51ad}, {0xf14e,0x34c7}, {0xf14f,0x51bc}, {0xf150,0x0}, {0xf151,0x0}, {0xf152,0x51f3}, {0xf153,0x51f4}, {0xf154,0x5202}, {0xf155,0x5212}, {0xf156,0x5216}, {0xf157,0x0}, {0xf158,0x5255}, {0xf159,0x525c}, {0xf15a,0x526c}, {0xf15b,0x5277}, {0xf15c,0x5284}, {0xf15d,0x5282}, {0xf15e,0x0}, {0xf15f,0x5298}, {0xf160,0x0}, {0xf161,0x52a4}, {0xf162,0x52a6}, {0xf163,0x52af}, {0xf164,0x52ba}, {0xf165,0x52bb}, {0xf166,0x52ca}, {0xf167,0x351f}, {0xf168,0x52d1}, {0xf169,0x0}, {0xf16a,0x52f7}, {0xf16b,0x530a}, {0xf16c,0x530b}, {0xf16d,0x5324}, {0xf16e,0x5335}, {0xf16f,0x533e}, {0xf170,0x5342}, {0xf171,0x0}, {0xf172,0x0}, {0xf173,0x5367}, {0xf174,0x536c}, {0xf175,0x537a}, {0xf176,0x53a4}, {0xf177,0x53b4}, {0xf178,0x0}, {0xf179,0x53b7}, {0xf17a,0x53c0}, {0xf17b,0x0}, {0xf17c,0x355d}, {0xf17d,0x355e}, {0xf17e,0x53d5}, {0xf180,0x53da}, {0xf181,0x3563}, {0xf182,0x53f4}, {0xf183,0x53f5}, {0xf184,0x5455}, {0xf185,0x5424}, {0xf186,0x5428}, {0xf187,0x356e}, {0xf188,0x5443}, {0xf189,0x5462}, {0xf18a,0x5466}, {0xf18b,0x546c}, {0xf18c,0x548a}, {0xf18d,0x548d}, {0xf18e,0x5495}, {0xf18f,0x54a0}, {0xf190,0x54a6}, {0xf191,0x54ad}, {0xf192,0x54ae}, {0xf193,0x54b7}, {0xf194,0x54ba}, {0xf195,0x54bf}, {0xf196,0x54c3}, {0xf197,0x0}, {0xf198,0x54ec}, {0xf199,0x54ef}, {0xf19a,0x54f1}, {0xf19b,0x54f3}, {0xf19c,0x5500}, {0xf19d,0x5501}, {0xf19e,0x5509}, {0xf19f,0x553c}, {0xf1a0,0x5541}, {0xf1a1,0x35a6}, {0xf1a2,0x5547}, {0xf1a3,0x554a}, {0xf1a4,0x35a8}, {0xf1a5,0x5560}, {0xf1a6,0x5561}, {0xf1a7,0x5564}, {0xf1a8,0x0}, {0xf1a9,0x557d}, {0xf1aa,0x5582}, {0xf1ab,0x5588}, {0xf1ac,0x5591}, {0xf1ad,0x35c5}, {0xf1ae,0x55d2}, {0xf1af,0x0}, {0xf1b0,0x0}, {0xf1b1,0x55bf}, {0xf1b2,0x55c9}, {0xf1b3,0x55cc}, {0xf1b4,0x55d1}, {0xf1b5,0x55dd}, {0xf1b6,0x35da}, {0xf1b7,0x55e2}, {0xf1b8,0x0}, {0xf1b9,0x55e9}, {0xf1ba,0x5628}, {0xf1bb,0x0}, {0xf1bc,0x5607}, {0xf1bd,0x5610}, {0xf1be,0x5630}, {0xf1bf,0x5637}, {0xf1c0,0x35f4}, {0xf1c1,0x563d}, {0xf1c2,0x563f}, {0xf1c3,0x5640}, {0xf1c4,0x5647}, {0xf1c5,0x565e}, {0xf1c6,0x5660}, {0xf1c7,0x566d}, {0xf1c8,0x3605}, {0xf1c9,0x5688}, {0xf1ca,0x568c}, {0xf1cb,0x5695}, {0xf1cc,0x569a}, {0xf1cd,0x569d}, {0xf1ce,0x56a8}, {0xf1cf,0x56ad}, {0xf1d0,0x56b2}, {0xf1d1,0x56c5}, {0xf1d2,0x56cd}, {0xf1d3,0x56df}, {0xf1d4,0x56e8}, {0xf1d5,0x56f6}, {0xf1d6,0x56f7}, {0xf1d7,0x0}, {0xf1d8,0x5715}, {0xf1d9,0x5723}, {0xf1da,0x0}, {0xf1db,0x5729}, {0xf1dc,0x0}, {0xf1dd,0x5745}, {0xf1de,0x5746}, {0xf1df,0x574c}, {0xf1e0,0x574d}, {0xf1e1,0x0}, {0xf1e2,0x5768}, {0xf1e3,0x576f}, {0xf1e4,0x5773}, {0xf1e5,0x5774}, {0xf1e6,0x5775}, {0xf1e7,0x577b}, {0xf1e8,0x0}, {0xf1e9,0x0}, {0xf1ea,0x57ac}, {0xf1eb,0x579a}, {0xf1ec,0x579d}, {0xf1ed,0x579e}, {0xf1ee,0x57a8}, {0xf1ef,0x57d7}, {0xf1f0,0x0}, {0xf1f1,0x57cc}, {0xf1f2,0x0}, {0xf1f3,0x0}, {0xf1f4,0x57de}, {0xf1f5,0x57e6}, {0xf1f6,0x57f0}, {0xf1f7,0x364a}, {0xf1f8,0x57f8}, {0xf1f9,0x57fb}, {0xf1fa,0x57fd}, {0xf1fb,0x5804}, {0xf1fc,0x581e}, {0xf240,0x5820}, {0xf241,0x5827}, {0xf242,0x5832}, {0xf243,0x5839}, {0xf244,0x0}, {0xf245,0x5849}, {0xf246,0x584c}, {0xf247,0x5867}, {0xf248,0x588a}, {0xf249,0x588b}, {0xf24a,0x588d}, {0xf24b,0x588f}, {0xf24c,0x5890}, {0xf24d,0x5894}, {0xf24e,0x589d}, {0xf24f,0x58aa}, {0xf250,0x58b1}, {0xf251,0x0}, {0xf252,0x58c3}, {0xf253,0x58cd}, {0xf254,0x58e2}, {0xf255,0x58f3}, {0xf256,0x58f4}, {0xf257,0x5905}, {0xf258,0x5906}, {0xf259,0x590b}, {0xf25a,0x590d}, {0xf25b,0x5914}, {0xf25c,0x5924}, {0xf25d,0x0}, {0xf25e,0x3691}, {0xf25f,0x593d}, {0xf260,0x3699}, {0xf261,0x5946}, {0xf262,0x3696}, {0xf263,0x0}, {0xf264,0x595b}, {0xf265,0x595f}, {0xf266,0x0}, {0xf267,0x5975}, {0xf268,0x5976}, {0xf269,0x597c}, {0xf26a,0x599f}, {0xf26b,0x59ae}, {0xf26c,0x59bc}, {0xf26d,0x59c8}, {0xf26e,0x59cd}, {0xf26f,0x59de}, {0xf270,0x59e3}, {0xf271,0x59e4}, {0xf272,0x59e7}, {0xf273,0x59ee}, {0xf274,0x0}, {0xf275,0x0}, {0xf276,0x36cf}, {0xf277,0x5a0c}, {0xf278,0x5a0d}, {0xf279,0x5a17}, {0xf27a,0x5a27}, {0xf27b,0x5a2d}, {0xf27c,0x5a55}, {0xf27d,0x5a65}, {0xf27e,0x5a7a}, {0xf280,0x5a8b}, {0xf281,0x5a9c}, {0xf282,0x5a9f}, {0xf283,0x5aa0}, {0xf284,0x5aa2}, {0xf285,0x5ab1}, {0xf286,0x5ab3}, {0xf287,0x5ab5}, {0xf288,0x5aba}, {0xf289,0x5abf}, {0xf28a,0x5ada}, {0xf28b,0x5adc}, {0xf28c,0x5ae0}, {0xf28d,0x5ae5}, {0xf28e,0x5af0}, {0xf28f,0x5aee}, {0xf290,0x5af5}, {0xf291,0x5b00}, {0xf292,0x5b08}, {0xf293,0x5b17}, {0xf294,0x5b34}, {0xf295,0x5b2d}, {0xf296,0x5b4c}, {0xf297,0x5b52}, {0xf298,0x5b68}, {0xf299,0x5b6f}, {0xf29a,0x5b7c}, {0xf29b,0x5b7f}, {0xf29c,0x5b81}, {0xf29d,0x5b84}, {0xf29e,0x0}, {0xf09f,0x5b96}, {0xf0a0,0x5bac}, {0xf0a1,0x3761}, {0xf0a2,0x5bc0}, {0xf0a3,0x3762}, {0xf0a4,0x5bce}, {0xf0a5,0x5bd6}, {0xf0a6,0x376c}, {0xf0a7,0x376b}, {0xf0a8,0x5bf1}, {0xf0a9,0x5bfd}, {0xf0aa,0x3775}, {0xf0ab,0x5c03}, {0xf0ac,0x5c29}, {0xf0ad,0x5c30}, {0xf0ae,0x0}, {0xf0af,0x5c5f}, {0xf0b0,0x5c63}, {0xf0b1,0x5c67}, {0xf0b2,0x5c68}, {0xf0b3,0x5c69}, {0xf0b4,0x5c70}, {0xf0b5,0x0}, {0xf0b6,0x0}, {0xf0b7,0x5c7c}, {0xf0b8,0x0}, {0xf0b9,0x0}, {0xf0ba,0x5c88}, {0xf0bb,0x5c8a}, {0xf0bc,0x37c1}, {0xf0bd,0x0}, {0xf0be,0x0}, {0xf0bf,0x5ca0}, {0xf0c0,0x5ca2}, {0xf0c1,0x5ca6}, {0xf0c2,0x5ca7}, {0xf0c3,0x0}, {0xf0c4,0x5cad}, {0xf0c5,0x5cb5}, {0xf0c6,0x0}, {0xf0c7,0x5cc9}, {0xf0c8,0x0}, {0xf0c9,0x0}, {0xf0ca,0x5d06}, {0xf0cb,0x5d10}, {0xf0cc,0x5d2b}, {0xf0cd,0x5d1d}, {0xf0ce,0x5d20}, {0xf0cf,0x5d24}, {0xf0d0,0x5d26}, {0xf0d1,0x5d31}, {0xf0d2,0x5d39}, {0xf0d3,0x5d42}, {0xf0d4,0x37e8}, {0xf0d5,0x5d61}, {0xf0d6,0x5d6a}, {0xf0d7,0x37f4}, {0xf0d8,0x5d70}, {0xf0d9,0x0}, {0xf0da,0x37fd}, {0xf0db,0x5d88}, {0xf0dc,0x3800}, {0xf0dd,0x5d92}, {0xf0de,0x5d94}, {0xf0df,0x5d97}, {0xf0e0,0x5d99}, {0xf0e1,0x5db0}, {0xf0e2,0x5db2}, {0xf0e3,0x5db4}, {0xf0e4,0x0}, {0xf0e5,0x5db9}, {0xf0e6,0x5dd1}, {0xf0e7,0x5dd7}, {0xf0e8,0x5dd8}, {0xf0e9,0x5de0}, {0xf0ea,0x0}, {0xf0eb,0x5de4}, {0xf0ec,0x5de9}, {0xf0ed,0x382f}, {0xf0ee,0x5e00}, {0xf0ef,0x3836}, {0xf0f0,0x5e12}, {0xf0f1,0x5e15}, {0xf0f2,0x3840}, {0xf0f3,0x5e1f}, {0xf0f4,0x5e2e}, {0xf0f5,0x5e3e}, {0xf0f6,0x5e49}, {0xf0f7,0x385c}, {0xf0f8,0x5e56}, {0xf0f9,0x3861}, {0xf0fa,0x5e6b}, {0xf0fb,0x5e6c}, {0xf0fc,0x5e6d}, {0xf29f,0x5e6e}, {0xf2a0,0x0}, {0xf2a1,0x5ea5}, {0xf2a2,0x5eaa}, {0xf2a3,0x5eac}, {0xf2a4,0x5eb9}, {0xf2a5,0x5ebf}, {0xf2a6,0x5ec6}, {0xf2a7,0x5ed2}, {0xf2a8,0x5ed9}, {0xf2a9,0x0}, {0xf2aa,0x5efd}, {0xf2ab,0x5f08}, {0xf2ac,0x5f0e}, {0xf2ad,0x5f1c}, {0xf2ae,0x0}, {0xf2af,0x5f1e}, {0xf2b0,0x5f47}, {0xf2b1,0x5f63}, {0xf2b2,0x5f72}, {0xf2b3,0x5f7e}, {0xf2b4,0x5f8f}, {0xf2b5,0x5fa2}, {0xf2b6,0x5fa4}, {0xf2b7,0x5fb8}, {0xf2b8,0x5fc4}, {0xf2b9,0x38fa}, {0xf2ba,0x5fc7}, {0xf2bb,0x5fcb}, {0xf2bc,0x5fd2}, {0xf2bd,0x5fd3}, {0xf2be,0x5fd4}, {0xf2bf,0x5fe2}, {0xf2c0,0x5fee}, {0xf2c1,0x5fef}, {0xf2c2,0x5ff3}, {0xf2c3,0x5ffc}, {0xf2c4,0x3917}, {0xf2c5,0x6017}, {0xf2c6,0x6022}, {0xf2c7,0x6024}, {0xf2c8,0x391a}, {0xf2c9,0x604c}, {0xf2ca,0x607f}, {0xf2cb,0x608a}, {0xf2cc,0x6095}, {0xf2cd,0x60a8}, {0xf2ce,0x0}, {0xf2cf,0x60b0}, {0xf2d0,0x60b1}, {0xf2d1,0x60be}, {0xf2d2,0x60c8}, {0xf2d3,0x60d9}, {0xf2d4,0x60db}, {0xf2d5,0x60ee}, {0xf2d6,0x60f2}, {0xf2d7,0x60f5}, {0xf2d8,0x6110}, {0xf2d9,0x6112}, {0xf2da,0x6113}, {0xf2db,0x6119}, {0xf2dc,0x611e}, {0xf2dd,0x613a}, {0xf2de,0x396f}, {0xf2df,0x6141}, {0xf2e0,0x6146}, {0xf2e1,0x6160}, {0xf2e2,0x617c}, {0xf2e3,0x0}, {0xf2e4,0x6192}, {0xf2e5,0x6193}, {0xf2e6,0x6197}, {0xf2e7,0x6198}, {0xf2e8,0x61a5}, {0xf2e9,0x61a8}, {0xf2ea,0x61ad}, {0xf2eb,0x0}, {0xf2ec,0x61d5}, {0xf2ed,0x61dd}, {0xf2ee,0x61df}, {0xf2ef,0x61f5}, {0xf2f0,0x0}, {0xf2f1,0x6215}, {0xf2f2,0x6223}, {0xf2f3,0x6229}, {0xf2f4,0x6246}, {0xf2f5,0x624c}, {0xf2f6,0x6251}, {0xf2f7,0x6252}, {0xf2f8,0x6261}, {0xf2f9,0x6264}, {0xf2fa,0x627b}, {0xf2fb,0x626d}, {0xf2fc,0x6273}, {0xf340,0x6299}, {0xf341,0x62a6}, {0xf342,0x62d5}, {0xf343,0x0}, {0xf344,0x62fd}, {0xf345,0x6303}, {0xf346,0x630d}, {0xf347,0x6310}, {0xf348,0x0}, {0xf349,0x0}, {0xf34a,0x6332}, {0xf34b,0x6335}, {0xf34c,0x633b}, {0xf34d,0x633c}, {0xf34e,0x6341}, {0xf34f,0x6344}, {0xf350,0x634e}, {0xf351,0x0}, {0xf352,0x6359}, {0xf353,0x0}, {0xf354,0x0}, {0xf355,0x636c}, {0xf356,0x6384}, {0xf357,0x6399}, {0xf358,0x0}, {0xf359,0x6394}, {0xf35a,0x63bd}, {0xf35b,0x63f7}, {0xf35c,0x63d4}, {0xf35d,0x63d5}, {0xf35e,0x63dc}, {0xf35f,0x63e0}, {0xf360,0x63eb}, {0xf361,0x63ec}, {0xf362,0x63f2}, {0xf363,0x6409}, {0xf364,0x641e}, {0xf365,0x6425}, {0xf366,0x6429}, {0xf367,0x642f}, {0xf368,0x645a}, {0xf369,0x645b}, {0xf36a,0x645d}, {0xf36b,0x6473}, {0xf36c,0x647d}, {0xf36d,0x6487}, {0xf36e,0x6491}, {0xf36f,0x649d}, {0xf370,0x649f}, {0xf371,0x64cb}, {0xf372,0x64cc}, {0xf373,0x64d5}, {0xf374,0x64d7}, {0xf375,0x0}, {0xf376,0x64e4}, {0xf377,0x64e5}, {0xf378,0x64ff}, {0xf379,0x6504}, {0xf37a,0x3a6e}, {0xf37b,0x650f}, {0xf37c,0x6514}, {0xf37d,0x6516}, {0xf37e,0x3a73}, {0xf380,0x651e}, {0xf381,0x6532}, {0xf382,0x6544}, {0xf383,0x6554}, {0xf384,0x656b}, {0xf385,0x657a}, {0xf386,0x6581}, {0xf387,0x6584}, {0xf388,0x6585}, {0xf389,0x658a}, {0xf38a,0x65b2}, {0xf38b,0x65b5}, {0xf38c,0x65b8}, {0xf38d,0x65bf}, {0xf38e,0x65c2}, {0xf38f,0x65c9}, {0xf390,0x65d4}, {0xf391,0x3ad6}, {0xf392,0x65f2}, {0xf393,0x65f9}, {0xf394,0x65fc}, {0xf395,0x6604}, {0xf396,0x6608}, {0xf397,0x6621}, {0xf398,0x662a}, {0xf399,0x6645}, {0xf39a,0x6651}, {0xf39b,0x664e}, {0xf39c,0x3aea}, {0xf39d,0x0}, {0xf39e,0x6657}, {0xf39f,0x665b}, {0xf3a0,0x6663}, {0xf3a1,0x0}, {0xf3a2,0x0}, {0xf3a3,0x666a}, {0xf3a4,0x666b}, {0xf3a5,0x666c}, {0xf3a6,0x666d}, {0xf3a7,0x667b}, {0xf3a8,0x6680}, {0xf3a9,0x6690}, {0xf3aa,0x6692}, {0xf3ab,0x6699}, {0xf3ac,0x3b0e}, {0xf3ad,0x66ad}, {0xf3ae,0x66b1}, {0xf3af,0x66b5}, {0xf3b0,0x3b1a}, {0xf3b1,0x66bf}, {0xf3b2,0x3b1c}, {0xf3b3,0x66ec}, {0xf3b4,0x3ad7}, {0xf3b5,0x6701}, {0xf3b6,0x6705}, {0xf3b7,0x6712}, {0xf3b8,0x0}, {0xf3b9,0x6719}, {0xf3ba,0x0}, {0xf3bb,0x0}, {0xf3bc,0x674c}, {0xf3bd,0x674d}, {0xf3be,0x6754}, {0xf3bf,0x675d}, {0xf3c0,0x0}, {0xf3c1,0x0}, {0xf3c2,0x0}, {0xf3c3,0x6774}, {0xf3c4,0x6776}, {0xf3c5,0x0}, {0xf3c6,0x6792}, {0xf3c7,0x0}, {0xf3c8,0x8363}, {0xf3c9,0x6810}, {0xf3ca,0x67b0}, {0xf3cb,0x67b2}, {0xf3cc,0x67c3}, {0xf3cd,0x67c8}, {0xf3ce,0x67d2}, {0xf3cf,0x67d9}, {0xf3d0,0x67db}, {0xf3d1,0x67f0}, {0xf3d2,0x67f7}, {0xf3d3,0x0}, {0xf3d4,0x0}, {0xf3d5,0x0}, {0xf3d6,0x6818}, {0xf3d7,0x681f}, {0xf3d8,0x682d}, {0xf3d9,0x0}, {0xf3da,0x6833}, {0xf3db,0x683b}, {0xf3dc,0x683e}, {0xf3dd,0x6844}, {0xf3de,0x6845}, {0xf3df,0x6849}, {0xf3e0,0x684c}, {0xf3e1,0x6855}, {0xf3e2,0x6857}, {0xf3e3,0x3b77}, {0xf3e4,0x686b}, {0xf3e5,0x686e}, {0xf3e6,0x687a}, {0xf3e7,0x687c}, {0xf3e8,0x6882}, {0xf3e9,0x6890}, {0xf3ea,0x6896}, {0xf3eb,0x3b6d}, {0xf3ec,0x6898}, {0xf3ed,0x6899}, {0xf3ee,0x689a}, {0xf3ef,0x689c}, {0xf3f0,0x68aa}, {0xf3f1,0x68ab}, {0xf3f2,0x68b4}, {0xf3f3,0x68bb}, {0xf3f4,0x68fb}, {0xf3f5,0x0}, {0xf3f6,0x0}, {0xf3f7,0xfa13}, {0xf3f8,0x68c3}, {0xf3f9,0x68c5}, {0xf3fa,0x68cc}, {0xf3fb,0x68cf}, {0xf3fc,0x68d6}, {0xf440,0x68d9}, {0xf441,0x68e4}, {0xf442,0x68e5}, {0xf443,0x68ec}, {0xf444,0x68f7}, {0xf445,0x6903}, {0xf446,0x6907}, {0xf447,0x3b87}, {0xf448,0x3b88}, {0xf449,0x0}, {0xf44a,0x693b}, {0xf44b,0x3b8d}, {0xf44c,0x6946}, {0xf44d,0x6969}, {0xf44e,0x696c}, {0xf44f,0x6972}, {0xf450,0x697a}, {0xf451,0x697f}, {0xf452,0x6992}, {0xf453,0x3ba4}, {0xf454,0x6996}, {0xf455,0x6998}, {0xf456,0x69a6}, {0xf457,0x69b0}, {0xf458,0x69b7}, {0xf459,0x69ba}, {0xf45a,0x69bc}, {0xf45b,0x69c0}, {0xf45c,0x69d1}, {0xf45d,0x69d6}, {0xf45e,0x0}, {0xf45f,0x0}, {0xf460,0x6a30}, {0xf461,0x0}, {0xf462,0x0}, {0xf463,0x69e3}, {0xf464,0x69ee}, {0xf465,0x69ef}, {0xf466,0x69f3}, {0xf467,0x3bcd}, {0xf468,0x69f4}, {0xf469,0x69fe}, {0xf46a,0x6a11}, {0xf46b,0x6a1a}, {0xf46c,0x6a1d}, {0xf46d,0x0}, {0xf46e,0x6a32}, {0xf46f,0x6a33}, {0xf470,0x6a34}, {0xf471,0x6a3f}, {0xf472,0x6a46}, {0xf473,0x6a49}, {0xf474,0x6a7a}, {0xf475,0x6a4e}, {0xf476,0x6a52}, {0xf477,0x6a64}, {0xf478,0x0}, {0xf479,0x6a7e}, {0xf47a,0x6a83}, {0xf47b,0x6a8b}, {0xf47c,0x3bf0}, {0xf47d,0x6a91}, {0xf47e,0x6a9f}, {0xf480,0x6aa1}, {0xf481,0x0}, {0xf482,0x6aab}, {0xf483,0x6abd}, {0xf484,0x6ac6}, {0xf485,0x6ad4}, {0xf486,0x6ad0}, {0xf487,0x6adc}, {0xf488,0x6add}, {0xf489,0x0}, {0xf48a,0x0}, {0xf48b,0x6aec}, {0xf48c,0x6af1}, {0xf48d,0x6af2}, {0xf48e,0x6af3}, {0xf48f,0x6afd}, {0xf490,0x0}, {0xf491,0x6b0b}, {0xf492,0x6b0f}, {0xf493,0x6b10}, {0xf494,0x6b11}, {0xf495,0x0}, {0xf496,0x6b17}, {0xf497,0x3c26}, {0xf498,0x6b2f}, {0xf499,0x6b4a}, {0xf49a,0x6b58}, {0xf49b,0x6b6c}, {0xf49c,0x6b75}, {0xf49d,0x6b7a}, {0xf49e,0x6b81}, {0xf49f,0x6b9b}, {0xf4a0,0x6bae}, {0xf4a1,0x0}, {0xf4a2,0x6bbd}, {0xf4a3,0x6bbe}, {0xf4a4,0x6bc7}, {0xf4a5,0x6bc8}, {0xf4a6,0x6bc9}, {0xf4a7,0x6bda}, {0xf4a8,0x6be6}, {0xf4a9,0x6be7}, {0xf4aa,0x6bee}, {0xf4ab,0x6bf1}, {0xf4ac,0x6c02}, {0xf4ad,0x6c0a}, {0xf4ae,0x6c0e}, {0xf4af,0x6c35}, {0xf4b0,0x6c36}, {0xf4b1,0x6c3a}, {0xf4b2,0x0}, {0xf4b3,0x6c3f}, {0xf4b4,0x6c4d}, {0xf4b5,0x6c5b}, {0xf4b6,0x6c6d}, {0xf4b7,0x6c84}, {0xf4b8,0x6c89}, {0xf4b9,0x3cc3}, {0xf4ba,0x6c94}, {0xf4bb,0x6c95}, {0xf4bc,0x6c97}, {0xf4bd,0x6cad}, {0xf4be,0x6cc2}, {0xf4bf,0x6cd0}, {0xf4c0,0x3cd2}, {0xf4c1,0x6cd6}, {0xf4c2,0x6cda}, {0xf4c3,0x6cdc}, {0xf4c4,0x6ce9}, {0xf4c5,0x6cec}, {0xf4c6,0x6ced}, {0xf4c7,0x0}, {0xf4c8,0x6d00}, {0xf4c9,0x6d0a}, {0xf4ca,0x6d24}, {0xf4cb,0x6d26}, {0xf4cc,0x6d27}, {0xf4cd,0x6c67}, {0xf4ce,0x6d2f}, {0xf4cf,0x6d3c}, {0xf4d0,0x6d5b}, {0xf4d1,0x6d5e}, {0xf4d2,0x6d60}, {0xf4d3,0x6d70}, {0xf4d4,0x6d80}, {0xf4d5,0x6d81}, {0xf4d6,0x6d8a}, {0xf4d7,0x6d8d}, {0xf4d8,0x6d91}, {0xf4d9,0x6d98}, {0xf4da,0x0}, {0xf4db,0x6e17}, {0xf4dc,0x0}, {0xf4dd,0x0}, {0xf4de,0x0}, {0xf4df,0x6dab}, {0xf4e0,0x6dae}, {0xf4e1,0x6db4}, {0xf4e2,0x6dc2}, {0xf4e3,0x6d34}, {0xf4e4,0x6dc8}, {0xf4e5,0x6dce}, {0xf4e6,0x6dcf}, {0xf4e7,0x6dd0}, {0xf4e8,0x6ddf}, {0xf4e9,0x6de9}, {0xf4ea,0x6df6}, {0xf4eb,0x6e36}, {0xf4ec,0x6e1e}, {0xf4ed,0x6e22}, {0xf4ee,0x6e27}, {0xf4ef,0x3d11}, {0xf4f0,0x6e32}, {0xf4f1,0x6e3c}, {0xf4f2,0x6e48}, {0xf4f3,0x6e49}, {0xf4f4,0x6e4b}, {0xf4f5,0x6e4c}, {0xf4f6,0x6e4f}, {0xf4f7,0x6e51}, {0xf4f8,0x6e53}, {0xf4f9,0x6e54}, {0xf4fa,0x6e57}, {0xf4fb,0x6e63}, {0xf4fc,0x3d1e}, {0xf540,0x6e93}, {0xf541,0x6ea7}, {0xf542,0x6eb4}, {0xf543,0x6ebf}, {0xf544,0x6ec3}, {0xf545,0x6eca}, {0xf546,0x6ed9}, {0xf547,0x6f35}, {0xf548,0x6eeb}, {0xf549,0x6ef9}, {0xf54a,0x6efb}, {0xf54b,0x6f0a}, {0xf54c,0x6f0c}, {0xf54d,0x6f18}, {0xf54e,0x6f25}, {0xf54f,0x6f36}, {0xf550,0x6f3c}, {0xf551,0x0}, {0xf552,0x6f52}, {0xf553,0x6f57}, {0xf554,0x6f5a}, {0xf555,0x6f60}, {0xf556,0x6f68}, {0xf557,0x6f98}, {0xf558,0x6f7d}, {0xf559,0x6f90}, {0xf55a,0x6f96}, {0xf55b,0x6fbe}, {0xf55c,0x6f9f}, {0xf55d,0x6fa5}, {0xf55e,0x6faf}, {0xf55f,0x3d64}, {0xf560,0x6fb5}, {0xf561,0x6fc8}, {0xf562,0x6fc9}, {0xf563,0x6fda}, {0xf564,0x6fde}, {0xf565,0x6fe9}, {0xf566,0x0}, {0xf567,0x6ffc}, {0xf568,0x7000}, {0xf569,0x7007}, {0xf56a,0x700a}, {0xf56b,0x7023}, {0xf56c,0x0}, {0xf56d,0x7039}, {0xf56e,0x703a}, {0xf56f,0x703c}, {0xf570,0x7043}, {0xf571,0x7047}, {0xf572,0x704b}, {0xf573,0x3d9a}, {0xf574,0x7054}, {0xf575,0x7065}, {0xf576,0x7069}, {0xf577,0x706c}, {0xf578,0x706e}, {0xf579,0x7076}, {0xf57a,0x707e}, {0xf57b,0x7081}, {0xf57c,0x7086}, {0xf57d,0x7095}, {0xf57e,0x7097}, {0xf580,0x70bb}, {0xf581,0x0}, {0xf582,0x709f}, {0xf583,0x70b1}, {0xf584,0x0}, {0xf585,0x70ec}, {0xf586,0x70ca}, {0xf587,0x70d1}, {0xf588,0x70d3}, {0xf589,0x70dc}, {0xf58a,0x7103}, {0xf58b,0x7104}, {0xf58c,0x7106}, {0xf58d,0x7107}, {0xf58e,0x7108}, {0xf58f,0x710c}, {0xf590,0x3dc0}, {0xf591,0x712f}, {0xf592,0x7131}, {0xf593,0x7150}, {0xf594,0x714a}, {0xf595,0x7153}, {0xf596,0x715e}, {0xf597,0x3dd4}, {0xf598,0x7196}, {0xf599,0x7180}, {0xf59a,0x719b}, {0xf59b,0x71a0}, {0xf59c,0x71a2}, {0xf59d,0x71ae}, {0xf59e,0x71af}, {0xf59f,0x71b3}, {0xf59f,0x71b3}, {0xf5a0,0x0}, {0xf5a0,0x0}, {0xf5a1,0x71cb}, {0xf5a1,0x71cb}, {0xf5a2,0x71d3}, {0xf5a2,0x71d3}, {0xf5a3,0x71d9}, {0xf5a3,0x71d9}, {0xf5a4,0x71dc}, {0xf5a4,0x71dc}, {0xf5a5,0x7207}, {0xf5a5,0x7207}, {0xf5a6,0x3e05}, {0xf5a6,0x3e05}, {0xf5a7,0x0}, {0xf5a7,0x0}, {0xf5a8,0x722b}, {0xf5a8,0x722b}, {0xf5a9,0x7234}, {0xf5a9,0x7234}, {0xf5aa,0x7238}, {0xf5aa,0x7238}, {0xf5ab,0x7239}, {0xf5ab,0x7239}, {0xf5ac,0x4e2c}, {0xf5ac,0x4e2c}, {0xf5ad,0x7242}, {0xf5ad,0x7242}, {0xf5ae,0x7253}, {0xf5ae,0x7253}, {0xf5af,0x7257}, {0xf5af,0x7257}, {0xf5b0,0x7263}, {0xf5b0,0x7263}, {0xf5b1,0x0}, {0xf5b1,0x0}, {0xf5b2,0x726e}, {0xf5b2,0x726e}, {0xf5b3,0x726f}, {0xf5b3,0x726f}, {0xf5b4,0x7278}, {0xf5b4,0x7278}, {0xf5b5,0x727f}, {0xf5b5,0x727f}, {0xf5b6,0x728e}, {0xf5b6,0x728e}, {0xf5b7,0x0}, {0xf5b7,0x0}, {0xf5b8,0x72ad}, {0xf5b8,0x72ad}, {0xf5b9,0x72ae}, {0xf5b9,0x72ae}, {0xf5ba,0x72b0}, {0xf5ba,0x72b0}, {0xf5bb,0x72b1}, {0xf5bb,0x72b1}, {0xf5bc,0x72c1}, {0xf5bc,0x72c1}, {0xf5bd,0x3e60}, {0xf5bd,0x3e60}, {0xf5be,0x72cc}, {0xf5be,0x72cc}, {0xf5bf,0x3e66}, {0xf5bf,0x3e66}, {0xf5c0,0x3e68}, {0xf5c0,0x3e68}, {0xf5c1,0x72f3}, {0xf5c1,0x72f3}, {0xf5c2,0x72fa}, {0xf5c2,0x72fa}, {0xf5c3,0x7307}, {0xf5c3,0x7307}, {0xf5c4,0x7312}, {0xf5c4,0x7312}, {0xf5c5,0x7318}, {0xf5c5,0x7318}, {0xf5c6,0x7319}, {0xf5c6,0x7319}, {0xf5c7,0x3e83}, {0xf5c7,0x3e83}, {0xf5c8,0x7339}, {0xf5c8,0x7339}, {0xf5c9,0x732c}, {0xf5c9,0x732c}, {0xf5ca,0x7331}, {0xf5ca,0x7331}, {0xf5cb,0x7333}, {0xf5cb,0x7333}, {0xf5cc,0x733d}, {0xf5cc,0x733d}, {0xf5cd,0x7352}, {0xf5cd,0x7352}, {0xf5ce,0x3e94}, {0xf5ce,0x3e94}, {0xf5cf,0x736b}, {0xf5cf,0x736b}, {0xf5d0,0x736c}, {0xf5d0,0x736c}, {0xf5d1,0x0}, {0xf5d1,0x0}, {0xf5d2,0x736e}, {0xf5d2,0x736e}, {0xf5d3,0x736f}, {0xf5d3,0x736f}, {0xf5d4,0x7371}, {0xf5d4,0x7371}, {0xf5d5,0x7377}, {0xf5d5,0x7377}, {0xf5d6,0x7381}, {0xf5d6,0x7381}, {0xf5d7,0x7385}, {0xf5d7,0x7385}, {0xf5d8,0x738a}, {0xf5d8,0x738a}, {0xf5d9,0x7394}, {0xf5d9,0x7394}, {0xf5da,0x7398}, {0xf5da,0x7398}, {0xf5db,0x739c}, {0xf5db,0x739c}, {0xf5dc,0x739e}, {0xf5dc,0x739e}, {0xf5dd,0x73a5}, {0xf5dd,0x73a5}, {0xf5de,0x73a8}, {0xf5de,0x73a8}, {0xf5df,0x73b5}, {0xf5df,0x73b5}, {0xf5e0,0x73b7}, {0xf5e0,0x73b7}, {0xf5e1,0x73b9}, {0xf5e1,0x73b9}, {0xf5e2,0x73bc}, {0xf5e2,0x73bc}, {0xf5e3,0x73bf}, {0xf5e3,0x73bf}, {0xf5e4,0x73c5}, {0xf5e4,0x73c5}, {0xf5e5,0x73cb}, {0xf5e5,0x73cb}, {0xf5e6,0x73e1}, {0xf5e6,0x73e1}, {0xf5e7,0x73e7}, {0xf5e7,0x73e7}, {0xf5e8,0x73f9}, {0xf5e8,0x73f9}, {0xf5e9,0x7413}, {0xf5e9,0x7413}, {0xf5ea,0x73fa}, {0xf5ea,0x73fa}, {0xf5eb,0x7401}, {0xf5eb,0x7401}, {0xf5ec,0x7424}, {0xf5ec,0x7424}, {0xf5ed,0x7431}, {0xf5ed,0x7431}, {0xf5ee,0x7439}, {0xf5ee,0x7439}, {0xf5ef,0x7453}, {0xf5ef,0x7453}, {0xf5f0,0x7440}, {0xf5f0,0x7440}, {0xf5f1,0x7443}, {0xf5f1,0x7443}, {0xf5f2,0x744d}, {0xf5f2,0x744d}, {0xf5f3,0x7452}, {0xf5f3,0x7452}, {0xf5f4,0x745d}, {0xf5f4,0x745d}, {0xf5f5,0x7471}, {0xf5f5,0x7471}, {0xf5f6,0x7481}, {0xf5f6,0x7481}, {0xf5f7,0x7485}, {0xf5f7,0x7485}, {0xf5f8,0x7488}, {0xf5f8,0x7488}, {0xf5f9,0x0}, {0xf5f9,0x0}, {0xf5fa,0x7492}, {0xf5fa,0x7492}, {0xf5fb,0x7497}, {0xf5fb,0x7497}, {0xf5fc,0x7499}, {0xf5fc,0x7499}, {0xf640,0x74a0}, {0xf641,0x74a1}, {0xf642,0x74a5}, {0xf643,0x74aa}, {0xf644,0x74ab}, {0xf645,0x74b9}, {0xf646,0x74bb}, {0xf647,0x74ba}, {0xf648,0x74d6}, {0xf649,0x74d8}, {0xf64a,0x74de}, {0xf64b,0x74ef}, {0xf64c,0x74eb}, {0xf64d,0x0}, {0xf64e,0x74fa}, {0xf64f,0x0}, {0xf650,0x7520}, {0xf651,0x7524}, {0xf652,0x752a}, {0xf653,0x3f57}, {0xf654,0x0}, {0xf655,0x753d}, {0xf656,0x753e}, {0xf657,0x7540}, {0xf658,0x7548}, {0xf659,0x754e}, {0xf65a,0x7550}, {0xf65b,0x7552}, {0xf65c,0x756c}, {0xf65d,0x7572}, {0xf65e,0x7571}, {0xf65f,0x757a}, {0xf660,0x757d}, {0xf661,0x757e}, {0xf662,0x7581}, {0xf663,0x0}, {0xf664,0x758c}, {0xf665,0x3f75}, {0xf666,0x75a2}, {0xf667,0x3f77}, {0xf668,0x75b0}, {0xf669,0x75b7}, {0xf66a,0x75bf}, {0xf66b,0x75c0}, {0xf66c,0x75c6}, {0xf66d,0x75cf}, {0xf66e,0x75d3}, {0xf66f,0x75dd}, {0xf670,0x75df}, {0xf671,0x75e0}, {0xf672,0x75e7}, {0xf673,0x75ec}, {0xf674,0x75ee}, {0xf675,0x75f1}, {0xf676,0x75f9}, {0xf677,0x7603}, {0xf678,0x7618}, {0xf679,0x7607}, {0xf67a,0x760f}, {0xf67b,0x3fae}, {0xf67c,0x0}, {0xf67d,0x7613}, {0xf67e,0x761b}, {0xf680,0x761c}, {0xf681,0x0}, {0xf682,0x7625}, {0xf683,0x7628}, {0xf684,0x763c}, {0xf685,0x7633}, {0xf686,0x0}, {0xf687,0x3fc9}, {0xf688,0x7641}, {0xf689,0x0}, {0xf68a,0x7649}, {0xf68b,0x7655}, {0xf68c,0x3fd7}, {0xf68d,0x766e}, {0xf68e,0x7695}, {0xf68f,0x769c}, {0xf690,0x76a1}, {0xf691,0x76a0}, {0xf692,0x76a7}, {0xf693,0x76a8}, {0xf694,0x76af}, {0xf695,0x0}, {0xf696,0x76c9}, {0xf697,0x0}, {0xf698,0x76e8}, {0xf699,0x76ec}, {0xf69a,0x0}, {0xf69b,0x7717}, {0xf69c,0x771a}, {0xf69d,0x772d}, {0xf69e,0x7735}, {0xf69f,0x0}, {0xf6a0,0x4039}, {0xf6a1,0x0}, {0xf6a2,0x0}, {0xf6a3,0x7758}, {0xf6a4,0x7760}, {0xf6a5,0x776a}, {0xf6a6,0x0}, {0xf6a7,0x7772}, {0xf6a8,0x777c}, {0xf6a9,0x777d}, {0xf6aa,0x0}, {0xf6ab,0x4058}, {0xf6ac,0x779a}, {0xf6ad,0x779f}, {0xf6ae,0x77a2}, {0xf6af,0x77a4}, {0xf6b0,0x77a9}, {0xf6b1,0x77de}, {0xf6b2,0x77df}, {0xf6b3,0x77e4}, {0xf6b4,0x77e6}, {0xf6b5,0x77ea}, {0xf6b6,0x77ec}, {0xf6b7,0x4093}, {0xf6b8,0x77f0}, {0xf6b9,0x77f4}, {0xf6ba,0x77fb}, {0xf6bb,0x0}, {0xf6bc,0x7805}, {0xf6bd,0x7806}, {0xf6be,0x7809}, {0xf6bf,0x780d}, {0xf6c0,0x7819}, {0xf6c1,0x7821}, {0xf6c2,0x782c}, {0xf6c3,0x7847}, {0xf6c4,0x7864}, {0xf6c5,0x786a}, {0xf6c6,0x0}, {0xf6c7,0x788a}, {0xf6c8,0x7894}, {0xf6c9,0x78a4}, {0xf6ca,0x789d}, {0xf6cb,0x789e}, {0xf6cc,0x789f}, {0xf6cd,0x78bb}, {0xf6ce,0x78c8}, {0xf6cf,0x78cc}, {0xf6d0,0x78ce}, {0xf6d1,0x78d5}, {0xf6d2,0x78e0}, {0xf6d3,0x78e1}, {0xf6d4,0x78e6}, {0xf6d5,0x78f9}, {0xf6d6,0x78fa}, {0xf6d7,0x78fb}, {0xf6d8,0x78fe}, {0xf6d9,0x0}, {0xf6da,0x7910}, {0xf6db,0x791b}, {0xf6dc,0x7930}, {0xf6dd,0x7925}, {0xf6de,0x793b}, {0xf6df,0x794a}, {0xf6e0,0x7958}, {0xf6e1,0x795b}, {0xf6e2,0x4105}, {0xf6e3,0x7967}, {0xf6e4,0x7972}, {0xf6e5,0x7994}, {0xf6e6,0x7995}, {0xf6e7,0x7996}, {0xf6e8,0x799b}, {0xf6e9,0x79a1}, {0xf6ea,0x79a9}, {0xf6eb,0x79b4}, {0xf6ec,0x79bb}, {0xf6ed,0x79c2}, {0xf6ee,0x79c7}, {0xf6ef,0x79cc}, {0xf6f0,0x79cd}, {0xf6f1,0x79d6}, {0xf6f2,0x4148}, {0xf6f3,0x0}, {0xf6f4,0x0}, {0xf6f5,0x414f}, {0xf6f6,0x7a0a}, {0xf6f7,0x7a11}, {0xf6f8,0x7a15}, {0xf6f9,0x7a1b}, {0xf6fa,0x7a1e}, {0xf6fb,0x4163}, {0xf6fc,0x7a2d}, {0xf740,0x7a38}, {0xf741,0x7a47}, {0xf742,0x7a4c}, {0xf743,0x7a56}, {0xf744,0x7a59}, {0xf745,0x7a5c}, {0xf746,0x7a5f}, {0xf747,0x7a60}, {0xf748,0x7a67}, {0xf749,0x7a6a}, {0xf74a,0x7a75}, {0xf74b,0x7a78}, {0xf74c,0x7a82}, {0xf74d,0x7a8a}, {0xf74e,0x7a90}, {0xf74f,0x7aa3}, {0xf750,0x7aac}, {0xf751,0x0}, {0xf752,0x41b4}, {0xf753,0x7ab9}, {0xf754,0x7abc}, {0xf755,0x7abe}, {0xf756,0x41bf}, {0xf757,0x7acc}, {0xf758,0x7ad1}, {0xf759,0x7ae7}, {0xf75a,0x7ae8}, {0xf75b,0x7af4}, {0xf75c,0x0}, {0xf75d,0x0}, {0xf75e,0x7b07}, {0xf75f,0x0}, {0xf760,0x7b3d}, {0xf761,0x7b27}, {0xf762,0x7b2a}, {0xf763,0x7b2e}, {0xf764,0x7b2f}, {0xf765,0x7b31}, {0xf766,0x41e6}, {0xf767,0x41f3}, {0xf768,0x7b7f}, {0xf769,0x7b41}, {0xf76a,0x41ee}, {0xf76b,0x7b55}, {0xf76c,0x7b79}, {0xf76d,0x7b64}, {0xf76e,0x7b66}, {0xf76f,0x7b69}, {0xf770,0x7b73}, {0xf771,0x0}, {0xf772,0x4207}, {0xf773,0x7b90}, {0xf774,0x7b91}, {0xf775,0x7b9b}, {0xf776,0x420e}, {0xf777,0x7baf}, {0xf778,0x7bb5}, {0xf779,0x7bbc}, {0xf77a,0x7bc5}, {0xf77b,0x7bca}, {0xf77c,0x0}, {0xf77d,0x0}, {0xf77e,0x7bd4}, {0xf780,0x7bd6}, {0xf781,0x7bda}, {0xf782,0x7bea}, {0xf783,0x7bf0}, {0xf784,0x7c03}, {0xf785,0x7c0b}, {0xf786,0x7c0e}, {0xf787,0x7c0f}, {0xf788,0x7c26}, {0xf789,0x7c45}, {0xf78a,0x7c4a}, {0xf78b,0x7c51}, {0xf78c,0x7c57}, {0xf78d,0x7c5e}, {0xf78e,0x7c61}, {0xf78f,0x7c69}, {0xf790,0x7c6e}, {0xf791,0x7c6f}, {0xf792,0x7c70}, {0xf793,0x0}, {0xf794,0x0}, {0xf795,0x0}, {0xf796,0x7ca6}, {0xf797,0x0}, {0xf798,0x7cb6}, {0xf799,0x7cb7}, {0xf79a,0x7cbf}, {0xf79b,0x0}, {0xf79c,0x7cc4}, {0xf79d,0x0}, {0xf79e,0x7cc8}, {0xf79f,0x7ccd}, {0xf7a0,0x0}, {0xf7a1,0x7cd7}, {0xf7a2,0x0}, {0xf7a3,0x7ce6}, {0xf7a4,0x7ceb}, {0xf7a5,0x0}, {0xf7a6,0x7cf5}, {0xf7a7,0x7d03}, {0xf7a8,0x7d09}, {0xf7a9,0x42c6}, {0xf7aa,0x7d12}, {0xf7ab,0x7d1e}, {0xf7ac,0x0}, {0xf7ad,0x0}, {0xf7ae,0x7d3d}, {0xf7af,0x7d3e}, {0xf7b0,0x7d40}, {0xf7b1,0x7d47}, {0xf7b2,0x0}, {0xf7b3,0x0}, {0xf7b4,0x42d6}, {0xf7b5,0x7d59}, {0xf7b6,0x7d5a}, {0xf7b7,0x7d6a}, {0xf7b8,0x7d70}, {0xf7b9,0x42dd}, {0xf7ba,0x7d7f}, {0xf7bb,0x0}, {0xf7bc,0x7d86}, {0xf7bd,0x7d88}, {0xf7be,0x7d8c}, {0xf7bf,0x7d97}, {0xf7c0,0x0}, {0xf7c1,0x7d9d}, {0xf7c2,0x7da7}, {0xf7c3,0x7daa}, {0xf7c4,0x7db6}, {0xf7c5,0x7db7}, {0xf7c6,0x7dc0}, {0xf7c7,0x7dd7}, {0xf7c8,0x7dd9}, {0xf7c9,0x7de6}, {0xf7ca,0x7df1}, {0xf7cb,0x7df9}, {0xf7cc,0x4302}, {0xf7cd,0x0}, {0xf7ce,0x0}, {0xf7cf,0x7e10}, {0xf7d0,0x7e17}, {0xf7d1,0x7e1d}, {0xf7d2,0x7e20}, {0xf7d3,0x7e27}, {0xf7d4,0x7e2c}, {0xf7d5,0x7e45}, {0xf7d6,0x7e73}, {0xf7d7,0x7e75}, {0xf7d8,0x7e7e}, {0xf7d9,0x7e86}, {0xf7da,0x7e87}, {0xf7db,0x432b}, {0xf7dc,0x7e91}, {0xf7dd,0x7e98}, {0xf7de,0x7e9a}, {0xf7df,0x4343}, {0xf7e0,0x7f3c}, {0xf7e1,0x7f3b}, {0xf7e2,0x7f3e}, {0xf7e3,0x7f43}, {0xf7e4,0x7f44}, {0xf7e5,0x7f4f}, {0xf7e6,0x34c1}, {0xf7e7,0x0}, {0xf7e8,0x7f52}, {0xf7e9,0x0}, {0xf7ea,0x7f61}, {0xf7eb,0x7f63}, {0xf7ec,0x7f64}, {0xf7ed,0x7f6d}, {0xf7ee,0x7f7d}, {0xf7ef,0x7f7e}, {0xf7f0,0x0}, {0xf7f1,0x7f90}, {0xf7f2,0x517b}, {0xf7f3,0x0}, {0xf7f4,0x7f96}, {0xf7f5,0x7f9c}, {0xf7f6,0x7fad}, {0xf7f7,0x0}, {0xf7f8,0x7fc3}, {0xf7f9,0x7fcf}, {0xf7fa,0x7fe3}, {0xf7fb,0x7fe5}, {0xf7fc,0x7fef}, {0xf840,0x7ff2}, {0xf841,0x8002}, {0xf842,0x800a}, {0xf843,0x8008}, {0xf844,0x800e}, {0xf845,0x8011}, {0xf846,0x8016}, {0xf847,0x8024}, {0xf848,0x802c}, {0xf849,0x8030}, {0xf84a,0x8043}, {0xf84b,0x8066}, {0xf84c,0x8071}, {0xf84d,0x8075}, {0xf84e,0x807b}, {0xf84f,0x8099}, {0xf850,0x809c}, {0xf851,0x80a4}, {0xf852,0x80a7}, {0xf853,0x80b8}, {0xf854,0x0}, {0xf855,0x80c5}, {0xf856,0x80d5}, {0xf857,0x80d8}, {0xf858,0x80e6}, {0xf859,0x0}, {0xf85a,0x810d}, {0xf85b,0x80f5}, {0xf85c,0x80fb}, {0xf85d,0x43ee}, {0xf85e,0x8135}, {0xf85f,0x8116}, {0xf860,0x811e}, {0xf861,0x43f0}, {0xf862,0x8124}, {0xf863,0x8127}, {0xf864,0x812c}, {0xf865,0x0}, {0xf866,0x813d}, {0xf867,0x4408}, {0xf868,0x8169}, {0xf869,0x4417}, {0xf86a,0x8181}, {0xf86b,0x441c}, {0xf86c,0x8184}, {0xf86d,0x8185}, {0xf86e,0x4422}, {0xf86f,0x8198}, {0xf870,0x81b2}, {0xf871,0x81c1}, {0xf872,0x81c3}, {0xf873,0x81d6}, {0xf874,0x81db}, {0xf875,0x0}, {0xf876,0x81e4}, {0xf877,0x0}, {0xf878,0x81ec}, {0xf879,0x0}, {0xf87a,0x81fd}, {0xf87b,0x81ff}, {0xf87c,0x0}, {0xf87d,0x8204}, {0xf87e,0x0}, {0xf880,0x8219}, {0xf881,0x8221}, {0xf882,0x8222}, {0xf883,0x0}, {0xf884,0x8232}, {0xf885,0x8234}, {0xf886,0x823c}, {0xf887,0x8246}, {0xf888,0x8249}, {0xf889,0x8245}, {0xf88a,0x0}, {0xf88b,0x824b}, {0xf88c,0x4476}, {0xf88d,0x824f}, {0xf88e,0x447a}, {0xf88f,0x8257}, {0xf890,0x0}, {0xf891,0x825c}, {0xf892,0x8263}, {0xf893,0x0}, {0xf894,0x0}, {0xf895,0x0}, {0xf896,0x8279}, {0xf897,0x4491}, {0xf898,0x827d}, {0xf899,0x827f}, {0xf89a,0x8283}, {0xf89b,0x828a}, {0xf89c,0x8293}, {0xf89d,0x82a7}, {0xf89e,0x82a8}, {0xf89f,0x82b2}, {0xf8a0,0x82b4}, {0xf8a1,0x82ba}, {0xf8a2,0x82bc}, {0xf8a3,0x82e2}, {0xf8a4,0x82e8}, {0xf8a5,0x82f7}, {0xf8a6,0x8307}, {0xf8a7,0x8308}, {0xf8a8,0x830c}, {0xf8a9,0x8354}, {0xf8aa,0x831b}, {0xf8ab,0x831d}, {0xf8ac,0x8330}, {0xf8ad,0x833c}, {0xf8ae,0x8344}, {0xf8af,0x8357}, {0xf8b0,0x44be}, {0xf8b1,0x837f}, {0xf8b2,0x44d4}, {0xf8b3,0x44b3}, {0xf8b4,0x838d}, {0xf8b5,0x8394}, {0xf8b6,0x8395}, {0xf8b7,0x839b}, {0xf8b8,0x839d}, {0xf8b9,0x83c9}, {0xf8ba,0x83d0}, {0xf8bb,0x83d4}, {0xf8bc,0x83dd}, {0xf8bd,0x83e5}, {0xf8be,0x83f9}, {0xf8bf,0x840f}, {0xf8c0,0x8411}, {0xf8c1,0x8415}, {0xf8c2,0x0}, {0xf8c3,0x8417}, {0xf8c4,0x8439}, {0xf8c5,0x844a}, {0xf8c6,0x844f}, {0xf8c7,0x8451}, {0xf8c8,0x8452}, {0xf8c9,0x8459}, {0xf8ca,0x845a}, {0xf8cb,0x845c}, {0xf8cc,0x0}, {0xf8cd,0x8465}, {0xf8ce,0x8476}, {0xf8cf,0x8478}, {0xf8d0,0x847c}, {0xf8d1,0x8481}, {0xf8d2,0x450d}, {0xf8d3,0x84dc}, {0xf8d4,0x8497}, {0xf8d5,0x84a6}, {0xf8d6,0x84be}, {0xf8d7,0x4508}, {0xf8d8,0x84ce}, {0xf8d9,0x84cf}, {0xf8da,0x84d3}, {0xf8db,0x0}, {0xf8dc,0x84e7}, {0xf8dd,0x84ea}, {0xf8de,0x84ef}, {0xf8df,0x84f0}, {0xf8e0,0x84f1}, {0xf8e1,0x84fa}, {0xf8e2,0x84fd}, {0xf8e3,0x850c}, {0xf8e4,0x851b}, {0xf8e5,0x8524}, {0xf8e6,0x8525}, {0xf8e7,0x852b}, {0xf8e8,0x8534}, {0xf8e9,0x854f}, {0xf8ea,0x856f}, {0xf8eb,0x4525}, {0xf8ec,0x4543}, {0xf8ed,0x853e}, {0xf8ee,0x8551}, {0xf8ef,0x8553}, {0xf8f0,0x855e}, {0xf8f1,0x8561}, {0xf8f2,0x8562}, {0xf8f3,0x0}, {0xf8f4,0x857b}, {0xf8f5,0x857d}, {0xf8f6,0x857f}, {0xf8f7,0x8581}, {0xf8f8,0x8586}, {0xf8f9,0x8593}, {0xf8fa,0x859d}, {0xf8fb,0x859f}, {0xf8fc,0x0}, {0xf940,0x0}, {0xf941,0x0}, {0xf942,0x85b7}, {0xf943,0x85bc}, {0xf944,0x85c7}, {0xf945,0x85ca}, {0xf946,0x85d8}, {0xf947,0x85d9}, {0xf948,0x85df}, {0xf949,0x85e1}, {0xf94a,0x85e6}, {0xf94b,0x85f6}, {0xf94c,0x8600}, {0xf94d,0x8611}, {0xf94e,0x861e}, {0xf94f,0x8621}, {0xf950,0x8624}, {0xf951,0x8627}, {0xf952,0x0}, {0xf953,0x8639}, {0xf954,0x863c}, {0xf955,0x0}, {0xf956,0x8640}, {0xf957,0xfa20}, {0xf958,0x8653}, {0xf959,0x8656}, {0xf95a,0x866f}, {0xf95b,0x8677}, {0xf95c,0x867a}, {0xf95d,0x8687}, {0xf95e,0x8689}, {0xf95f,0x868d}, {0xf960,0x8691}, {0xf961,0x869c}, {0xf962,0x869d}, {0xf963,0x86a8}, {0xf964,0xfa21}, {0xf965,0x86b1}, {0xf966,0x86b3}, {0xf967,0x86c1}, {0xf968,0x86c3}, {0xf969,0x86d1}, {0xf96a,0x86d5}, {0xf96b,0x86d7}, {0xf96c,0x86e3}, {0xf96d,0x86e6}, {0xf96e,0x45b8}, {0xf96f,0x8705}, {0xf970,0x8707}, {0xf971,0x870e}, {0xf972,0x8710}, {0xf973,0x8713}, {0xf974,0x8719}, {0xf975,0x871f}, {0xf976,0x8721}, {0xf977,0x8723}, {0xf978,0x8731}, {0xf979,0x873a}, {0xf97a,0x873e}, {0xf97b,0x8740}, {0xf97c,0x8743}, {0xf97d,0x8751}, {0xf97e,0x8758}, {0xf980,0x8764}, {0xf981,0x8765}, {0xf982,0x8772}, {0xf983,0x877c}, {0xf984,0x0}, {0xf985,0x0}, {0xf986,0x87a7}, {0xf987,0x8789}, {0xf988,0x878b}, {0xf989,0x8793}, {0xf98a,0x87a0}, {0xf98b,0x0}, {0xf98c,0x45e5}, {0xf98d,0x87be}, {0xf98e,0x0}, {0xf98f,0x87c1}, {0xf990,0x87ce}, {0xf991,0x87f5}, {0xf992,0x87df}, {0xf993,0x0}, {0xf994,0x87e3}, {0xf995,0x87e5}, {0xf996,0x87e6}, {0xf997,0x87ea}, {0xf998,0x87eb}, {0xf999,0x87ed}, {0xf99a,0x8801}, {0xf99b,0x8803}, {0xf99c,0x880b}, {0xf99d,0x8813}, {0xf99e,0x8828}, {0xf99f,0x882e}, {0xf9a0,0x8832}, {0xf9a1,0x883c}, {0xf9a2,0x460f}, {0xf9a3,0x884a}, {0xf9a4,0x8858}, {0xf9a5,0x885f}, {0xf9a6,0x8864}, {0xf9a7,0x0}, {0xf9a8,0x0}, {0xf9a9,0x8869}, {0xf9aa,0x0}, {0xf9ab,0x886f}, {0xf9ac,0x88a0}, {0xf9ad,0x88bc}, {0xf9ae,0x88bd}, {0xf9af,0x88be}, {0xf9b0,0x88c0}, {0xf9b1,0x88d2}, {0xf9b2,0x0}, {0xf9b3,0x88d1}, {0xf9b4,0x88d3}, {0xf9b5,0x88db}, {0xf9b6,0x88f0}, {0xf9b7,0x88f1}, {0xf9b8,0x4641}, {0xf9b9,0x8901}, {0xf9ba,0x0}, {0xf9bb,0x8937}, {0xf9bc,0x0}, {0xf9bd,0x8942}, {0xf9be,0x8945}, {0xf9bf,0x8949}, {0xf9c0,0x0}, {0xf9c1,0x4665}, {0xf9c2,0x8962}, {0xf9c3,0x8980}, {0xf9c4,0x8989}, {0xf9c5,0x8990}, {0xf9c6,0x899f}, {0xf9c7,0x89b0}, {0xf9c8,0x89b7}, {0xf9c9,0x89d6}, {0xf9ca,0x89d8}, {0xf9cb,0x89eb}, {0xf9cc,0x46a1}, {0xf9cd,0x89f1}, {0xf9ce,0x89f3}, {0xf9cf,0x89fd}, {0xf9d0,0x89ff}, {0xf9d1,0x46af}, {0xf9d2,0x8a11}, {0xf9d3,0x8a14}, {0xf9d4,0x0}, {0xf9d5,0x8a21}, {0xf9d6,0x8a35}, {0xf9d7,0x8a3e}, {0xf9d8,0x8a45}, {0xf9d9,0x8a4d}, {0xf9da,0x8a58}, {0xf9db,0x8aae}, {0xf9dc,0x8a90}, {0xf9dd,0x8ab7}, {0xf9de,0x8abe}, {0xf9df,0x8ad7}, {0xf9e0,0x8afc}, {0xf9e1,0x0}, {0xf9e2,0x8b0a}, {0xf9e3,0x8b05}, {0xf9e4,0x8b0d}, {0xf9e5,0x8b1c}, {0xf9e6,0x8b1f}, {0xf9e7,0x8b2d}, {0xf9e8,0x8b43}, {0xf9e9,0x470c}, {0xf9ea,0x8b51}, {0xf9eb,0x8b5e}, {0xf9ec,0x8b76}, {0xf9ed,0x8b7f}, {0xf9ee,0x8b81}, {0xf9ef,0x8b8b}, {0xf9f0,0x8b94}, {0xf9f1,0x8b95}, {0xf9f2,0x8b9c}, {0xf9f3,0x8b9e}, {0xf9f4,0x8c39}, {0xf9f5,0x0}, {0xf9f6,0x8c3d}, {0xf9f7,0x0}, {0xf9f8,0x0}, {0xf9f9,0x8c45}, {0xf9fa,0x8c47}, {0xf9fb,0x8c4f}, {0xf9fc,0x8c54}, {0xfa40,0x8c57}, {0xfa41,0x8c69}, {0xfa42,0x8c6d}, {0xfa43,0x8c73}, {0xfa44,0x0}, {0xfa45,0x8c93}, {0xfa46,0x8c92}, {0xfa47,0x8c99}, {0xfa48,0x4764}, {0xfa49,0x8c9b}, {0xfa4a,0x8ca4}, {0xfa4b,0x8cd6}, {0xfa4c,0x8cd5}, {0xfa4d,0x8cd9}, {0xfa4e,0x0}, {0xfa4f,0x8cf0}, {0xfa50,0x8cf1}, {0xfa51,0x0}, {0xfa52,0x8d09}, {0xfa53,0x8d0e}, {0xfa54,0x8d6c}, {0xfa55,0x8d84}, {0xfa56,0x8d95}, {0xfa57,0x8da6}, {0xfa58,0x0}, {0xfa59,0x8dc6}, {0xfa5a,0x8dc8}, {0xfa5b,0x8dd9}, {0xfa5c,0x8dec}, {0xfa5d,0x8e0c}, {0xfa5e,0x47fd}, {0xfa5f,0x8dfd}, {0xfa60,0x8e06}, {0xfa61,0x0}, {0xfa62,0x8e14}, {0xfa63,0x8e16}, {0xfa64,0x8e21}, {0xfa65,0x8e22}, {0xfa66,0x8e27}, {0xfa67,0x0}, {0xfa68,0x4816}, {0xfa69,0x8e36}, {0xfa6a,0x8e39}, {0xfa6b,0x8e4b}, {0xfa6c,0x8e54}, {0xfa6d,0x8e62}, {0xfa6e,0x8e6c}, {0xfa6f,0x8e6d}, {0xfa70,0x8e6f}, {0xfa71,0x8e98}, {0xfa72,0x8e9e}, {0xfa73,0x8eae}, {0xfa74,0x8eb3}, {0xfa75,0x8eb5}, {0xfa76,0x8eb6}, {0xfa77,0x8ebb}, {0xfa78,0x0}, {0xfa79,0x8ed1}, {0xfa7a,0x8ed4}, {0xfa7b,0x484e}, {0xfa7c,0x8ef9}, {0xfa7d,0x0}, {0xfa7e,0x8f00}, {0xfa80,0x8f08}, {0xfa81,0x8f17}, {0xfa82,0x8f2b}, {0xfa83,0x8f40}, {0xfa84,0x8f4a}, {0xfa85,0x8f58}, {0xfa86,0x0}, {0xfa87,0x8fa4}, {0xfa88,0x8fb4}, {0xfa89,0x0}, {0xfa8a,0x8fb6}, {0xfa8b,0x0}, {0xfa8c,0x8fc1}, {0xfa8d,0x8fc6}, {0xfa8e,0xfa24}, {0xfa8f,0x8fca}, {0xfa90,0x8fcd}, {0xfa91,0x8fd3}, {0xfa92,0x8fd5}, {0xfa93,0x8fe0}, {0xfa94,0x8ff1}, {0xfa95,0x8ff5}, {0xfa96,0x8ffb}, {0xfa97,0x9002}, {0xfa98,0x900c}, {0xfa99,0x9037}, {0xfa9a,0x0}, {0xfa9b,0x9043}, {0xfa9c,0x9044}, {0xfa9d,0x905d}, {0xfa9e,0x0}, {0xfa9f,0x0}, {0xfaa0,0x9085}, {0xfaa1,0x908c}, {0xfaa2,0x9090}, {0xfaa3,0x961d}, {0xfaa4,0x90a1}, {0xfaa5,0x48b5}, {0xfaa6,0x90b0}, {0xfaa7,0x90b6}, {0xfaa8,0x90c3}, {0xfaa9,0x90c8}, {0xfaaa,0x0}, {0xfaab,0x90dc}, {0xfaac,0x90df}, {0xfaad,0x0}, {0xfaae,0x90f6}, {0xfaaf,0x90f2}, {0xfab0,0x9100}, {0xfab1,0x90eb}, {0xfab2,0x90fe}, {0xfab3,0x90ff}, {0xfab4,0x9104}, {0xfab5,0x9106}, {0xfab6,0x9118}, {0xfab7,0x911c}, {0xfab8,0x911e}, {0xfab9,0x9137}, {0xfaba,0x9139}, {0xfabb,0x913a}, {0xfabc,0x9146}, {0xfabd,0x9147}, {0xfabe,0x9157}, {0xfabf,0x9159}, {0xfac0,0x9161}, {0xfac1,0x9164}, {0xfac2,0x9174}, {0xfac3,0x9179}, {0xfac4,0x9185}, {0xfac5,0x918e}, {0xfac6,0x91a8}, {0xfac7,0x91ae}, {0xfac8,0x91b3}, {0xfac9,0x91b6}, {0xfaca,0x91c3}, {0xfacb,0x91c4}, {0xfacc,0x91da}, {0xfacd,0x0}, {0xface,0x0}, {0xfacf,0x91ec}, {0xfad0,0x91ee}, {0xfad1,0x9201}, {0xfad2,0x920a}, {0xfad3,0x9216}, {0xfad4,0x9217}, {0xfad5,0x0}, {0xfad6,0x9233}, {0xfad7,0x9242}, {0xfad8,0x9247}, {0xfad9,0x924a}, {0xfada,0x924e}, {0xfadb,0x9251}, {0xfadc,0x9256}, {0xfadd,0x9259}, {0xfade,0x9260}, {0xfadf,0x9261}, {0xfae0,0x9265}, {0xfae1,0x9267}, {0xfae2,0x9268}, {0xfae3,0x0}, {0xfae4,0x0}, {0xfae5,0x927c}, {0xfae6,0x927d}, {0xfae7,0x927f}, {0xfae8,0x9289}, {0xfae9,0x928d}, {0xfaea,0x9297}, {0xfaeb,0x9299}, {0xfaec,0x929f}, {0xfaed,0x92a7}, {0xfaee,0x92ab}, {0xfaef,0x0}, {0xfaf0,0x0}, {0xfaf1,0x92b2}, {0xfaf2,0x92bf}, {0xfaf3,0x92c0}, {0xfaf4,0x92c6}, {0xfaf5,0x92ce}, {0xfaf6,0x92d0}, {0xfaf7,0x92d7}, {0xfaf8,0x92d9}, {0xfaf9,0x92e5}, {0xfafa,0x92e7}, {0xfafb,0x9311}, {0xfafc,0x0}, {0xfb40,0x0}, {0xfb41,0x92f7}, {0xfb42,0x92f9}, {0xfb43,0x92fb}, {0xfb44,0x9302}, {0xfb45,0x930d}, {0xfb46,0x9315}, {0xfb47,0x931d}, {0xfb48,0x931e}, {0xfb49,0x9327}, {0xfb4a,0x9329}, {0xfb4b,0x0}, {0xfb4c,0x0}, {0xfb4d,0x9347}, {0xfb4e,0x9351}, {0xfb4f,0x9357}, {0xfb50,0x935a}, {0xfb51,0x936b}, {0xfb52,0x9371}, {0xfb53,0x9373}, {0xfb54,0x93a1}, {0xfb55,0x0}, {0xfb56,0x0}, {0xfb57,0x9388}, {0xfb58,0x938b}, {0xfb59,0x938f}, {0xfb5a,0x939e}, {0xfb5b,0x93f5}, {0xfb5c,0x0}, {0xfb5d,0x0}, {0xfb5e,0x93f1}, {0xfb5f,0x93c1}, {0xfb60,0x93c7}, {0xfb61,0x93dc}, {0xfb62,0x93e2}, {0xfb63,0x93e7}, {0xfb64,0x9409}, {0xfb65,0x940f}, {0xfb66,0x9416}, {0xfb67,0x9417}, {0xfb68,0x93fb}, {0xfb69,0x9432}, {0xfb6a,0x9434}, {0xfb6b,0x943b}, {0xfb6c,0x9445}, {0xfb6d,0x0}, {0xfb6e,0x0}, {0xfb6f,0x946d}, {0xfb70,0x946f}, {0xfb71,0x9578}, {0xfb72,0x9579}, {0xfb73,0x9586}, {0xfb74,0x958c}, {0xfb75,0x958d}, {0xfb76,0x0}, {0xfb77,0x95ab}, {0xfb78,0x95b4}, {0xfb79,0x0}, {0xfb7a,0x95c8}, {0xfb7b,0x0}, {0xfb7c,0x0}, {0xfb7d,0x962c}, {0xfb7e,0x9633}, {0xfb80,0x9634}, {0xfb81,0x0}, {0xfb82,0x963c}, {0xfb83,0x9641}, {0xfb84,0x9661}, {0xfb85,0x0}, {0xfb86,0x9682}, {0xfb87,0x0}, {0xfb88,0x969a}, {0xfb89,0x0}, {0xfb8a,0x49e7}, {0xfb8b,0x96a9}, {0xfb8c,0x96af}, {0xfb8d,0x96b3}, {0xfb8e,0x96ba}, {0xfb8f,0x96bd}, {0xfb90,0x49fa}, {0xfb91,0x0}, {0xfb92,0x96d8}, {0xfb93,0x96da}, {0xfb94,0x96dd}, {0xfb95,0x4a04}, {0xfb96,0x9714}, {0xfb97,0x9723}, {0xfb98,0x4a29}, {0xfb99,0x9736}, {0xfb9a,0x9741}, {0xfb9b,0x9747}, {0xfb9c,0x9755}, {0xfb9d,0x9757}, {0xfb9e,0x975b}, {0xfb9f,0x976a}, {0xfba0,0x0}, {0xfba1,0x0}, {0xfba2,0x9796}, {0xfba3,0x979a}, {0xfba4,0x979e}, {0xfba5,0x97a2}, {0xfba6,0x97b1}, {0xfba7,0x97b2}, {0xfba8,0x97be}, {0xfba9,0x97cc}, {0xfbaa,0x97d1}, {0xfbab,0x97d4}, {0xfbac,0x97d8}, {0xfbad,0x97d9}, {0xfbae,0x97e1}, {0xfbaf,0x97f1}, {0xfbb0,0x9804}, {0xfbb1,0x980d}, {0xfbb2,0x980e}, {0xfbb3,0x9814}, {0xfbb4,0x9816}, {0xfbb5,0x4abc}, {0xfbb6,0x0}, {0xfbb7,0x9823}, {0xfbb8,0x9832}, {0xfbb9,0x9833}, {0xfbba,0x9825}, {0xfbbb,0x9847}, {0xfbbc,0x9866}, {0xfbbd,0x98ab}, {0xfbbe,0x98ad}, {0xfbbf,0x98b0}, {0xfbc0,0x0}, {0xfbc1,0x98b7}, {0xfbc2,0x98b8}, {0xfbc3,0x98bb}, {0xfbc4,0x98bc}, {0xfbc5,0x98bf}, {0xfbc6,0x98c2}, {0xfbc7,0x98c7}, {0xfbc8,0x98cb}, {0xfbc9,0x98e0}, {0xfbca,0x0}, {0xfbcb,0x98e1}, {0xfbcc,0x98e3}, {0xfbcd,0x98e5}, {0xfbce,0x98ea}, {0xfbcf,0x98f0}, {0xfbd0,0x98f1}, {0xfbd1,0x98f3}, {0xfbd2,0x9908}, {0xfbd3,0x4b3b}, {0xfbd4,0x0}, {0xfbd5,0x9916}, {0xfbd6,0x9917}, {0xfbd7,0x0}, {0xfbd8,0x991a}, {0xfbd9,0x991b}, {0xfbda,0x991c}, {0xfbdb,0x0}, {0xfbdc,0x9931}, {0xfbdd,0x9932}, {0xfbde,0x9933}, {0xfbdf,0x993a}, {0xfbe0,0x993b}, {0xfbe1,0x993c}, {0xfbe2,0x9940}, {0xfbe3,0x9941}, {0xfbe4,0x9946}, {0xfbe5,0x994d}, {0xfbe6,0x994e}, {0xfbe7,0x995c}, {0xfbe8,0x995f}, {0xfbe9,0x9960}, {0xfbea,0x99a3}, {0xfbeb,0x99a6}, {0xfbec,0x99b9}, {0xfbed,0x99bd}, {0xfbee,0x99bf}, {0xfbef,0x99c3}, {0xfbf0,0x99c9}, {0xfbf1,0x99d4}, {0xfbf2,0x99d9}, {0xfbf3,0x99de}, {0xfbf4,0x0}, {0xfbf5,0x99f0}, {0xfbf6,0x99f9}, {0xfbf7,0x99fc}, {0xfbf8,0x9a0a}, {0xfbf9,0x9a11}, {0xfbfa,0x9a16}, {0xfbfb,0x9a1a}, {0xfbfc,0x9a20}, {0xfc40,0x9a31}, {0xfc41,0x9a36}, {0xfc42,0x9a44}, {0xfc43,0x9a4c}, {0xfc44,0x9a58}, {0xfc45,0x4bc2}, {0xfc46,0x9aaf}, {0xfc47,0x4bca}, {0xfc48,0x9ab7}, {0xfc49,0x4bd2}, {0xfc4a,0x9ab9}, {0xfc4b,0x0}, {0xfc4c,0x9ac6}, {0xfc4d,0x9ad0}, {0xfc4e,0x9ad2}, {0xfc4f,0x9ad5}, {0xfc50,0x4be8}, {0xfc51,0x9adc}, {0xfc52,0x9ae0}, {0xfc53,0x9ae5}, {0xfc54,0x9ae9}, {0xfc55,0x9b03}, {0xfc56,0x9b0c}, {0xfc57,0x9b10}, {0xfc58,0x9b12}, {0xfc59,0x9b16}, {0xfc5a,0x9b1d}, {0xfc5b,0x9b2b}, {0xfc5c,0x9b33}, {0xfc5d,0x9b3d}, {0xfc5e,0x4c20}, {0xfc5f,0x9b4b}, {0xfc60,0x9b63}, {0xfc61,0x9b65}, {0xfc62,0x9b6b}, {0xfc63,0x9b6c}, {0xfc64,0x9b73}, {0xfc65,0x9b76}, {0xfc66,0x9b77}, {0xfc67,0x9ba6}, {0xfc68,0x9bac}, {0xfc69,0x9bb1}, {0xfc6a,0x0}, {0xfc6b,0x0}, {0xfc6c,0x9bb2}, {0xfc6d,0x9bb8}, {0xfc6e,0x9bbe}, {0xfc6f,0x9bc7}, {0xfc70,0x9bf3}, {0xfc71,0x9bd8}, {0xfc72,0x9bdd}, {0xfc73,0x9be7}, {0xfc74,0x9bea}, {0xfc75,0x9beb}, {0xfc76,0x9bef}, {0xfc77,0x9bee}, {0xfc78,0x0}, {0xfc79,0x9bfa}, {0xfc7a,0x0}, {0xfc7b,0x9bf7}, {0xfc7c,0x0}, {0xfc7d,0x9c16}, {0xfc7e,0x9c18}, {0xfc80,0x9c19}, {0xfc81,0x9c1a}, {0xfc82,0x9c1d}, {0xfc83,0x9c22}, {0xfc84,0x9c27}, {0xfc85,0x9c29}, {0xfc86,0x9c2a}, {0xfc87,0x0}, {0xfc88,0x9c31}, {0xfc89,0x9c36}, {0xfc8a,0x9c37}, {0xfc8b,0x9c45}, {0xfc8c,0x9c5c}, {0xfc8d,0x0}, {0xfc8e,0x9c49}, {0xfc8f,0x9c4a}, {0xfc90,0x0}, {0xfc91,0x9c54}, {0xfc92,0x9c58}, {0xfc93,0x9c5b}, {0xfc94,0x9c5d}, {0xfc95,0x9c5f}, {0xfc96,0x9c69}, {0xfc97,0x9c6a}, {0xfc98,0x9c6b}, {0xfc99,0x9c6d}, {0xfc9a,0x9c6e}, {0xfc9b,0x9c70}, {0xfc9c,0x9c72}, {0xfc9d,0x9c75}, {0xfc9e,0x9c7a}, {0xfc9f,0x9ce6}, {0xfca0,0x9cf2}, {0xfca1,0x9d0b}, {0xfca2,0x9d02}, {0xfca3,0x0}, {0xfca4,0x9d11}, {0xfca5,0x9d17}, {0xfca6,0x9d18}, {0xfca7,0x0}, {0xfca8,0x4cc4}, {0xfca9,0x0}, {0xfcaa,0x9d32}, {0xfcab,0x4cd1}, {0xfcac,0x9d42}, {0xfcad,0x9d4a}, {0xfcae,0x9d5f}, {0xfcaf,0x9d62}, {0xfcb0,0x0}, {0xfcb1,0x9d69}, {0xfcb2,0x9d6b}, {0xfcb3,0x0}, {0xfcb4,0x9d73}, {0xfcb5,0x9d76}, {0xfcb6,0x9d77}, {0xfcb7,0x9d7e}, {0xfcb8,0x9d84}, {0xfcb9,0x9d8d}, {0xfcba,0x9d99}, {0xfcbb,0x9da1}, {0xfcbc,0x9dbf}, {0xfcbd,0x9db5}, {0xfcbe,0x9db9}, {0xfcbf,0x9dbd}, {0xfcc0,0x9dc3}, {0xfcc1,0x9dc7}, {0xfcc2,0x9dc9}, {0xfcc3,0x9dd6}, {0xfcc4,0x9dda}, {0xfcc5,0x9ddf}, {0xfcc6,0x9de0}, {0xfcc7,0x9de3}, {0xfcc8,0x9df4}, {0xfcc9,0x4d07}, {0xfcca,0x9e0a}, {0xfccb,0x9e02}, {0xfccc,0x9e0d}, {0xfccd,0x9e19}, {0xfcce,0x9e1c}, {0xfccf,0x9e1d}, {0xfcd0,0x9e7b}, {0xfcd1,0x0}, {0xfcd2,0x9e80}, {0xfcd3,0x9e85}, {0xfcd4,0x9e9b}, {0xfcd5,0x9ea8}, {0xfcd6,0x0}, {0xfcd7,0x9ebd}, {0xfcd8,0x0}, {0xfcd9,0x9edf}, {0xfcda,0x9ee7}, {0xfcdb,0x9eee}, {0xfcdc,0x9eff}, {0xfcdd,0x9f02}, {0xfcde,0x4d77}, {0xfcdf,0x9f03}, {0xfce0,0x9f17}, {0xfce1,0x9f19}, {0xfce2,0x9f2f}, {0xfce3,0x9f37}, {0xfce4,0x9f3a}, {0xfce5,0x9f3d}, {0xfce6,0x9f41}, {0xfce7,0x9f45}, {0xfce8,0x9f46}, {0xfce9,0x9f53}, {0xfcea,0x9f55}, {0xfceb,0x9f58}, {0xfcec,0x0}, {0xfced,0x9f5d}, {0xfcee,0x0}, {0xfcef,0x9f69}, {0xfcf0,0x0}, {0xfcf1,0x9f6d}, {0xfcf2,0x9f70}, {0xfcf3,0x9f75}, {0xfcf4,0x0}, {0xfcf5,0xffff}, {0xfcf6,0xffff}, {0xfcf7,0xffff}, {0xfcf8,0xffff}, {0xfcf9,0xffff}, {0xfcfa,0xffff}, {0xfcfb,0xffff}, {0xfcfc,0xffff}, {0xfcfc,0xffff}, {0,0} }; void initSJIS2UTF16() { int i = 0; sjis_2_utf16 = new unsigned short[0xfcfc - 0x8140 + 1]; while( sjis_2_utf16_org[i][0] ){ sjis_2_utf16[sjis_2_utf16_org[i][0] - 0x8140] = sjis_2_utf16_org[i][1]; i++; } } unsigned short convSJIS2UTF16( unsigned short in ) { return sjis_2_utf16[ in - 0x8140 ]; } int convUTF16ToUTF8( unsigned char dst[4], unsigned short src ) { if (src & 0xff80){ if (src & 0xf800){ // UCS-2 = U+0800 - U+FFFF -> UTF-8 (3 bytes) dst[0] = 0xe0 | (src >> 12); dst[1] = 0x80 | ((src >> 6) & 0x3f); dst[2] = 0x80 | (src & 0x3f); dst[3] = 0; return 3; } // UCS-2 = U+0080 - U+07FF -> UTF-8 (2 bytes) dst[0] = 0xc0 | (src >> 6); dst[1] = 0x80 | (src & 0x3f); dst[2] = 0; return 2; } // UCS-2 = U+0000 - U+007F -> UTF-8 (1 byte) dst[0] = src; dst[1] = 0; return 1; } onscripter-20150820/version.h0000644017777601777760000000006712565174244015641 0ustar nobodynogroup#define ONS_VERSION "20150820" #define NSC_VERSION 296 onscripter-20150820/DirtyRect.h0000644017777601777760000000256612565174244016073 0ustar nobodynogroup/* -*- C++ -*- * * DirtyRect.h - Invalid region on text_surface which should be updated * * Copyright (c) 2001-2012 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __DIRTY_RECT__ #define __DIRTY_RECT__ #include struct DirtyRect { DirtyRect(); DirtyRect( const DirtyRect &d ); DirtyRect& operator =( const DirtyRect &d ); ~DirtyRect(); void setDimension(int w, int h); void add( SDL_Rect src ); void clear(); void fill( int w, int h ); SDL_Rect calcBoundingBox( SDL_Rect src1, SDL_Rect &src2 ); int screen_width, screen_height; SDL_Rect bounding_box; }; #endif // __DIRTY_RECT__ onscripter-20150820/ScriptParser_command.cpp0000644017777601777760000011541312565174244020630 0ustar nobodynogroup/* -*- C++ -*- * * ScriptParser_command.cpp - Define command executer of ONScripter * * Copyright (c) 2001-2015 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "ScriptParser.h" #include #ifndef M_PI #define M_PI 3.14159265358979323846 #endif int ScriptParser::zenkakkoCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "zenkakko: not in the define section" ); zenkakko_flag = true; return RET_CONTINUE; } int ScriptParser::windowchipCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "windowchip: not in the define section" ); windowchip_sprite_no = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::windowbackCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "windowback: not in the define section" ); windowback_flag = true; return RET_CONTINUE; } int ScriptParser::versionstrCommand() { delete[] version_str; script_h.readStr(); const char *save_buf = script_h.saveStringBuffer(); const char *buf = script_h.readStr(); version_str = new char[ strlen( save_buf ) + strlen( buf ) + strlen("\n") * 2 + 1 ]; sprintf( version_str, "%s\n%s\n", save_buf, buf ); return RET_CONTINUE; } int ScriptParser::usewheelCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "usewheel: not in the define section" ); usewheel_flag = true; return RET_CONTINUE; } int ScriptParser::useescspcCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "useescspc: not in the define section" ); if ( !force_button_shortcut_flag ) useescspc_flag = true; return RET_CONTINUE; } int ScriptParser::underlineCommand() { underline_value = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::transmodeCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "transmode: not in the define section" ); if ( script_h.compareString("leftup") ) trans_mode = AnimationInfo::TRANS_TOPLEFT; else if ( script_h.compareString("copy") ) trans_mode = AnimationInfo::TRANS_COPY; else if ( script_h.compareString("alpha") ) trans_mode = AnimationInfo::TRANS_ALPHA; else if ( script_h.compareString("righttup") ) trans_mode = AnimationInfo::TRANS_TOPRIGHT; script_h.readLabel(); return RET_CONTINUE; } int ScriptParser::timeCommand() { time_t t = time(NULL); struct tm *tm = localtime( &t ); script_h.readVariable(); script_h.setInt( &script_h.current_variable, tm->tm_hour ); script_h.readVariable(); script_h.setInt( &script_h.current_variable, tm->tm_min ); script_h.readVariable(); script_h.setInt( &script_h.current_variable, tm->tm_sec ); return RET_CONTINUE; } int ScriptParser::textgosubCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "textgosub: not in the define section" ); setStr( &textgosub_label, script_h.readStr()+1 ); script_h.enableTextgosub(true); return RET_CONTINUE; } int ScriptParser::tanCommand() { script_h.readInt(); script_h.pushVariable(); int val = script_h.readInt(); script_h.setInt(&script_h.pushed_variable, (int)(tan(M_PI*val/180.0)*1000.0)); return RET_CONTINUE; } int ScriptParser::subCommand() { int val1 = script_h.readInt(); script_h.pushVariable(); int val2 = script_h.readInt(); script_h.setInt( &script_h.pushed_variable, val1 - val2 ); return RET_CONTINUE; } int ScriptParser::straliasCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "stralias: not in the define section" ); script_h.readLabel(); const char *save_buf = script_h.saveStringBuffer(); const char *buf = script_h.readStr(); script_h.addStrAlias( save_buf, buf ); return RET_CONTINUE; } int ScriptParser::soundpressplginCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "soundpressplgin: not in the define section" ); const char *buf = script_h.readStr(); char buf2[12]; memcpy(buf2, buf, 12); // only nbzplgin.dll is supported for (int i=0 ; i<12 ; i++) if (buf2[i] >= 'A' && buf2[i] <= 'Z') buf2[i] += 'a' - 'A'; if (strncmp(buf2, "nbzplgin.dll", 12)){ fprintf( stderr, " *** plugin %s is not available, ignored. ***\n", buf); return RET_CONTINUE; } while(*buf && *buf != '|') buf++; if (*buf == 0) return RET_CONTINUE; buf++; script_h.cBR->registerCompressionType( buf, BaseReader::NBZ_COMPRESSION ); return RET_CONTINUE; } int ScriptParser::skipCommand() { int val = script_h.readInt(); if (val == 0) val = 1; int line = current_label_info.start_line + current_line + val; char *buf = script_h.getAddressByLine( line ); current_label_info = script_h.getLabelByAddress( buf ); current_line = script_h.getLineByAddress( buf ); script_h.setCurrent( buf ); return RET_CONTINUE; } int ScriptParser::sinCommand() { script_h.readInt(); script_h.pushVariable(); int val = script_h.readInt(); script_h.setInt(&script_h.pushed_variable, (int)(sin(M_PI*val/180.0)*1000.0)); return RET_CONTINUE; } int ScriptParser::shadedistanceCommand() { shade_distance[0] = script_h.readInt() * screen_ratio1 / screen_ratio2; if (shade_distance[0] == 0) shade_distance[0] = 1; shade_distance[1] = script_h.readInt() * screen_ratio1 / screen_ratio2; if (shade_distance[1] == 0) shade_distance[1] = 1; return RET_CONTINUE; } int ScriptParser::setkinsokuCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "setkinsoku: not in the define section" ); script_h.readStr(); char *start = script_h.saveStringBuffer(); const char *end = script_h.readStr(); setKinsoku(start, end, false); return RET_CONTINUE; } int ScriptParser::selectvoiceCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "selectvoice: not in the define section" ); for ( int i=0 ; inext = new RMenuLink(); const char *buf = script_h.readStr(); setStr( &link->next->label, buf ); if ( rmenu_link_width < strlen( buf )/2 + 1 ) rmenu_link_width = strlen( buf )/2 + 1; link->next->system_call_no = getSystemCallNo( script_h.readLabel() ); link = link->next; rmenu_link_num++; comma_flag = script_h.getEndStatus() & ScriptHandler::END_COMMA; } return RET_CONTINUE; } int ScriptParser::returnCommand() { if ( !last_nest_info->previous || last_nest_info->nest_mode != NestInfo::LABEL ) errorAndExit( "return: not in gosub" ); current_label_info = script_h.getLabelByAddress( last_nest_info->next_script ); current_line = script_h.getLineByAddress( last_nest_info->next_script ); const char *label = script_h.readStr(); if (label[0] != '*') script_h.setCurrent( last_nest_info->next_script ); else setCurrentLabel( label+1 ); bool textgosub_flag = last_nest_info->textgosub_flag; char *wait_script = last_nest_info->wait_script; last_nest_info = last_nest_info->previous; delete last_nest_info->next; last_nest_info->next = NULL; if (textgosub_flag){ if (wait_script && label[0] != '*'){ script_h.setCurrent(wait_script); return RET_CONTINUE; } // if this is the end of the line, pretext becomes enabled line_enter_status = 0; page_enter_status = 0; } return RET_CONTINUE; } int ScriptParser::pretextgosubCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "pretextgosub: not in the define section" ); setStr( &pretextgosub_label, script_h.readStr()+1 ); return RET_CONTINUE; } int ScriptParser::pagetagCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "pagetag: not in the define section" ); pagetag_flag = true; return RET_CONTINUE; } int ScriptParser::numaliasCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "numalias: numalias: not in the define section" ); script_h.readLabel(); const char *save_buf = script_h.saveStringBuffer(); int no = script_h.readInt(); script_h.addNumAlias( save_buf, no ); return RET_CONTINUE; } int ScriptParser::nsadirCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "nsadir: not in the define section" ); const char *buf = script_h.readStr(); if ( nsa_path ) delete[] nsa_path; nsa_path = new char[ strlen(buf) + 2 ]; sprintf( nsa_path, RELATIVEPATH "%s%c", buf, DELIMITER ); return RET_CONTINUE; } int ScriptParser::nsaCommand() { if ( script_h.isName("ns2") ){ nsa_offset = 1; } else if ( script_h.isName("ns3") ){ nsa_offset = 2; } delete script_h.cBR; script_h.cBR = new NsaReader( nsa_offset, archive_path, BaseReader::ARCHIVE_TYPE_NSA|BaseReader::ARCHIVE_TYPE_NS2, key_table ); if ( script_h.cBR->open( nsa_path ) ){ fprintf( stderr, " *** failed to open nsa or ns2 archive, ignored. ***\n"); } return RET_CONTINUE; } int ScriptParser::nextCommand() { if (!last_nest_info->previous || last_nest_info->nest_mode != NestInfo::FOR) errorAndExit("next: not in for loop\n"); int val; if ( !break_flag ){ val = script_h.getVariableData(last_nest_info->var_no).num; script_h.setNumVariable( last_nest_info->var_no, val + last_nest_info->step ); } val = script_h.getVariableData(last_nest_info->var_no).num; if ( break_flag || (last_nest_info->step > 0 && val > last_nest_info->to) || (last_nest_info->step < 0 && val < last_nest_info->to) ){ break_flag = false; last_nest_info = last_nest_info->previous; delete last_nest_info->next; last_nest_info->next = NULL; } else{ script_h.setCurrent( last_nest_info->next_script ); current_label_info = script_h.getLabelByAddress( last_nest_info->next_script ); current_line = script_h.getLineByAddress( last_nest_info->next_script ); } return RET_CONTINUE; } int ScriptParser::mulCommand() { int val1 = script_h.readInt(); script_h.pushVariable(); int val2 = script_h.readInt(); script_h.setInt( &script_h.pushed_variable, val1*val2 ); return RET_CONTINUE; } int ScriptParser::movCommand() { int count = 1; if ( script_h.isName( "mov10" ) ){ count = 10; } else if ( script_h.isName( "movl" ) ){ count = -1; // infinite } else if ( script_h.getStringBuffer()[3] >= '3' && script_h.getStringBuffer()[3] <= '9' ){ count = script_h.getStringBuffer()[3] - '0'; } script_h.readVariable(); if ( script_h.current_variable.type == ScriptHandler::VAR_INT || script_h.current_variable.type == ScriptHandler::VAR_ARRAY ){ script_h.pushVariable(); bool loop_flag = (script_h.getEndStatus() & ScriptHandler::END_COMMA); int i=0; while ( (count==-1 || i= strlen(save_buf) ){ vd.str = NULL; } else{ if ( start+len > strlen(save_buf ) ) len = strlen(save_buf) - start; vd.str = new char[len+1]; memcpy( vd.str, save_buf+start, len ); vd.str[len] = '\0'; } return RET_CONTINUE; } int ScriptParser::menusetwindowCommand() { menu_font.ttf_font[0] = NULL; menu_font.ttf_font[1] = NULL; menu_font.font_size_xy[0] = script_h.readInt(); menu_font.font_size_xy[1] = script_h.readInt(); menu_font.pitch_xy[0] = script_h.readInt() + menu_font.font_size_xy[0]; menu_font.pitch_xy[1] = script_h.readInt() + menu_font.font_size_xy[1]; menu_font.is_bold = script_h.readInt()?true:false; menu_font.is_shadow = script_h.readInt()?true:false; const char *buf = script_h.readStr(); if ( strlen(buf) ){ // Comma may or may not be appeared in this case. readColor( &menu_font.window_color, buf ); } else{ menu_font.window_color[0] = menu_font.window_color[1] = menu_font.window_color[2] = 0x99; } return RET_CONTINUE; } int ScriptParser::menuselectvoiceCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "menuselectvoice: not in the define section" ); for ( int i=0 ; i= 'a' && cmd[0] <= 'z'){ UserFuncHash &ufh = user_func_hash[cmd[0]-'a']; ufh.last->next = new UserFuncLUT(); ufh.last = ufh.last->next; ufh.last->lua_flag = true; setStr( &ufh.last->command, cmd ); } return RET_CONTINUE; } int ScriptParser::luacallCommand() { const char *label = script_h.readLabel(); #ifdef USE_LUA lua_handler.addCallback(label); #endif return RET_CONTINUE; } int ScriptParser::lookbackspCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "lookbacksp: not in the define section" ); for ( int i=0 ; i<2 ; i++ ) lookback_sp[i] = script_h.readInt(); if ( filelog_flag ){ script_h.findAndAddLog( script_h.log_info[ScriptHandler::FILE_LOG], DEFAULT_LOOKBACK_NAME0, true ); script_h.findAndAddLog( script_h.log_info[ScriptHandler::FILE_LOG], DEFAULT_LOOKBACK_NAME1, true ); script_h.findAndAddLog( script_h.log_info[ScriptHandler::FILE_LOG], DEFAULT_LOOKBACK_NAME2, true ); script_h.findAndAddLog( script_h.log_info[ScriptHandler::FILE_LOG], DEFAULT_LOOKBACK_NAME3, true ); } return RET_CONTINUE; } int ScriptParser::lookbackcolorCommand() { const char *buf = script_h.readStr(); readColor( &lookback_color, buf ); return RET_CONTINUE; } int ScriptParser::loadgosubCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "loadgosub: not in the define section" ); setStr( &loadgosub_label, script_h.readStr()+1 ); return RET_CONTINUE; } int ScriptParser::linepageCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "linepage: not in the define section" ); if ( script_h.isName( "linepage2" ) ){ linepage_mode = 2; clickstr_line = script_h.readInt(); } else linepage_mode = 1; script_h.setLinepage(true); return RET_CONTINUE; } int ScriptParser::lenCommand() { script_h.readInt(); script_h.pushVariable(); const char *buf = script_h.readStr(); script_h.setInt( &script_h.pushed_variable, strlen( buf ) ); return RET_CONTINUE; } int ScriptParser::labellogCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "labellog: not in the define section" ); labellog_flag = true; readLog( script_h.log_info[ScriptHandler::LABEL_LOG] ); return RET_CONTINUE; } int ScriptParser::kidokuskipCommand() { kidokuskip_flag = true; script_h.loadKidokuData(); return RET_CONTINUE; } int ScriptParser::kidokumodeCommand() { if ( script_h.readInt() == 1 ) kidokumode_flag = true; else kidokumode_flag = false; return RET_CONTINUE; } int ScriptParser::itoaCommand() { bool itoa2_flag = false; if ( script_h.isName( "itoa2" ) ) itoa2_flag = true; script_h.readVariable(); if ( script_h.current_variable.type != ScriptHandler::VAR_STR ) errorAndExit( "itoa: no string variable." ); int no = script_h.current_variable.var_no; int val = script_h.readInt(); char val_str[20]; if (itoa2_flag) script_h.getStringFromInteger(val_str, val, -1); else sprintf( val_str, "%d", val ); setStr( &script_h.getVariableData(no).str, val_str ); return RET_CONTINUE; } int ScriptParser::intlimitCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "intlimit: not in the define section" ); int no = script_h.readInt(); script_h.getVariableData(no).num_limit_flag = true; script_h.getVariableData(no).num_limit_lower = script_h.readInt(); script_h.getVariableData(no).num_limit_upper = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::incCommand() { int val = script_h.readInt(); script_h.setInt( &script_h.current_variable, val+1 ); return RET_CONTINUE; } int ScriptParser::ifCommand() { //printf("ifCommand\n"); int condition_status = 0; // 0 ... none, 1 ... and, 2 ... or bool f = false, condition_flag = false; char *op_buf; const char *buf; bool if_flag = true; if ( script_h.isName( "notif" ) ) if_flag = false; while(1){ if (script_h.compareString("fchk")){ script_h.readLabel(); buf = script_h.readStr(); f = (script_h.findAndAddLog( script_h.log_info[ScriptHandler::FILE_LOG], buf, false ) != NULL); //printf("fchk %s(%d) ", tmp_string_buffer, (findAndAddFileLog( tmp_string_buffer, fasle )) ); } else if (script_h.compareString("lchk")){ script_h.readLabel(); buf = script_h.readStr(); f = (script_h.findAndAddLog( script_h.log_info[ScriptHandler::LABEL_LOG], buf+1, false ) != NULL); //printf("lchk %s (%d)\n", buf, f ); } else{ int no = script_h.readInt(); if (script_h.current_variable.type & ScriptHandler::VAR_INT || script_h.current_variable.type & ScriptHandler::VAR_ARRAY){ int left_value = no; //printf("left (%d) ", left_value ); op_buf = script_h.getNext(); if ( (op_buf[0] == '>' && op_buf[1] == '=') || (op_buf[0] == '<' && op_buf[1] == '=') || (op_buf[0] == '=' && op_buf[1] == '=') || (op_buf[0] == '!' && op_buf[1] == '=') || (op_buf[0] == '<' && op_buf[1] == '>') ) script_h.setCurrent(op_buf+2); else if ( op_buf[0] == '<' || op_buf[0] == '>' || op_buf[0] == '=' ) script_h.setCurrent(op_buf+1); //printf("current %c%c ", op_buf[0], op_buf[1] ); int right_value = script_h.readInt(); //printf("right (%d) ", right_value ); if (op_buf[0] == '>' && op_buf[1] == '=') f = (left_value >= right_value); else if (op_buf[0] == '<' && op_buf[1] == '=') f = (left_value <= right_value); else if (op_buf[0] == '=' && op_buf[1] == '=') f = (left_value == right_value); else if (op_buf[0] == '!' && op_buf[1] == '=') f = (left_value != right_value); else if (op_buf[0] == '<' && op_buf[1] == '>') f = (left_value != right_value); else if (op_buf[0] == '<') f = (left_value < right_value); else if (op_buf[0] == '>') f = (left_value > right_value); else if (op_buf[0] == '=') f = (left_value == right_value); } else{ script_h.setCurrent(script_h.getCurrent()); buf = script_h.readStr(); const char *save_buf = script_h.saveStringBuffer(); op_buf = script_h.getNext(); if ( (op_buf[0] == '>' && op_buf[1] == '=') || (op_buf[0] == '<' && op_buf[1] == '=') || (op_buf[0] == '=' && op_buf[1] == '=') || (op_buf[0] == '!' && op_buf[1] == '=') || (op_buf[0] == '<' && op_buf[1] == '>') ) script_h.setCurrent(op_buf+2); else if ( op_buf[0] == '<' || op_buf[0] == '>' || op_buf[0] == '=' ) script_h.setCurrent(op_buf+1); buf = script_h.readStr(); int val = strcmp( save_buf, buf ); if (op_buf[0] == '>' && op_buf[1] == '=') f = (val >= 0); else if (op_buf[0] == '<' && op_buf[1] == '=') f = (val <= 0); else if (op_buf[0] == '=' && op_buf[1] == '=') f = (val == 0); else if (op_buf[0] == '!' && op_buf[1] == '=') f = (val != 0); else if (op_buf[0] == '<' && op_buf[1] == '>') f = (val != 0); else if (op_buf[0] == '<') f = (val < 0); else if (op_buf[0] == '>') f = (val > 0); else if (op_buf[0] == '=') f = (val == 0); } } f = if_flag ? f : !f; condition_flag |= f; op_buf = script_h.getNext(); if ( op_buf[0] == '|' ){ if (condition_status == 1) errorAndExit( "if: using & and | at the same time is not supported." ); while(*op_buf == '|') op_buf++; script_h.setCurrent(op_buf); condition_status = 2; continue; } if ((condition_status == 2 && !condition_flag) || (condition_status != 2 && !f)) return RET_SKIP_LINE; if ( op_buf[0] == '&' ){ if (condition_status == 2) errorAndExit( "if: using & and | at the same time is not supported." ); while(*op_buf == '&') op_buf++; script_h.setCurrent(op_buf); condition_status = 1; continue; } break; }; /* Execute command */ return RET_CONTINUE; } int ScriptParser::humanzCommand() { z_order = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::gotoCommand() { setCurrentLabel( script_h.readStr()+1 ); return RET_CONTINUE; } void ScriptParser::gosubReal( const char *label, char *next_script, bool textgosub_flag ) { last_nest_info->next = new NestInfo(); last_nest_info->next->previous = last_nest_info; last_nest_info = last_nest_info->next; last_nest_info->next_script = next_script; if (textgosub_flag){ last_nest_info->textgosub_flag = true; last_nest_info->wait_script = script_h.getWait(); } setCurrentLabel( label ); } int ScriptParser::gosubCommand() { const char *buf = script_h.readStr(); gosubReal( buf+1, script_h.getNext() ); return RET_CONTINUE; } int ScriptParser::globalonCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "globalon: not in the define section" ); globalon_flag = true; return RET_CONTINUE; } int ScriptParser::getparamCommand() { if ( !last_nest_info->previous || last_nest_info->nest_mode != NestInfo::LABEL ) errorAndExit( "getparam: not in a subroutine" ); bool getparam2_flag = false; if ( script_h.isName( "getparam2") ) getparam2_flag = true; int end_status, end_status2; do{ script_h.readVariable(); end_status2 = script_h.getEndStatus(); script_h.pushVariable(); script_h.pushCurrent(last_nest_info->next_script); if ( script_h.pushed_variable.type & ScriptHandler::VAR_PTR ){ script_h.readVariable(); script_h.setInt( &script_h.pushed_variable, script_h.current_variable.var_no ); } else if ( script_h.pushed_variable.type & ScriptHandler::VAR_INT || script_h.pushed_variable.type & ScriptHandler::VAR_ARRAY ){ script_h.setInt( &script_h.pushed_variable, script_h.readInt() ); } else if ( script_h.pushed_variable.type & ScriptHandler::VAR_STR ){ const char *buf = script_h.readStr(); setStr( &script_h.getVariableData(script_h.pushed_variable.var_no).str, buf ); } end_status = script_h.getEndStatus(); last_nest_info->next_script = script_h.getNext(); script_h.popCurrent(); } while(end_status & ScriptHandler::END_COMMA); if (getparam2_flag){ while (end_status2 & ScriptHandler::END_COMMA){ script_h.readVariable(); end_status2 = script_h.getEndStatus(); if ( script_h.current_variable.type & ScriptHandler::VAR_PTR ){ script_h.setInt( &script_h.current_variable, 0 ); } else if ( script_h.current_variable.type & ScriptHandler::VAR_INT || script_h.current_variable.type & ScriptHandler::VAR_ARRAY ){ script_h.setInt( &script_h.current_variable, 0 ); } else if ( script_h.current_variable.type & ScriptHandler::VAR_STR ){ setStr( &script_h.getVariableData(script_h.current_variable.var_no).str, NULL ); } } } return RET_CONTINUE; } int ScriptParser::forCommand() { last_nest_info->next = new NestInfo(); last_nest_info->next->previous = last_nest_info; last_nest_info = last_nest_info->next; last_nest_info->nest_mode = NestInfo::FOR; script_h.readVariable(); if ( script_h.current_variable.type != ScriptHandler::VAR_INT ) errorAndExit( "for: no integer variable." ); last_nest_info->var_no = script_h.current_variable.var_no; script_h.pushVariable(); if ( !script_h.compareString("=") ) errorAndExit( "for: missing '='" ); script_h.setCurrent(script_h.getNext() + 1); int from = script_h.readInt(); script_h.setInt( &script_h.pushed_variable, from ); if ( !script_h.compareString("to") ) errorAndExit( "for: missing 'to'" ); script_h.readLabel(); last_nest_info->to = script_h.readInt(); if ( script_h.compareString("step") ){ script_h.readLabel(); last_nest_info->step = script_h.readInt(); } else{ last_nest_info->step = 1; } if ((last_nest_info->step > 0 && from > last_nest_info->to) || (last_nest_info->step < 0 && from < last_nest_info->to)) break_flag = true; else break_flag = false; /* ---------------------------------------- */ /* Step forward callee's label info */ last_nest_info->next_script = script_h.getNext(); return RET_CONTINUE; } int ScriptParser::filelogCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "filelog: not in the define section" ); filelog_flag = true; readLog( script_h.log_info[ScriptHandler::FILE_LOG] ); return RET_CONTINUE; } int ScriptParser::englishCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "english: not in the define section." ); //english_mode = true; script_h.setEnglishMode(true); return RET_CONTINUE; } int ScriptParser::effectcutCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "effectcut: not in the define section." ); effect_cut_flag = true; return RET_CONTINUE; } int ScriptParser::effectblankCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "effectblank: not in the define section" ); effect_blank = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::effectCommand() { EffectLink *elink; if ( script_h.isName( "windoweffect") ){ elink = &window_effect; } else{ if ( current_mode != DEFINE_MODE ) errorAndExit( "effect: not in the define section" ); elink = new EffectLink(); elink->no = script_h.readInt(); if (elink->no < 2 || elink->no > 255) errorAndExit( "effect: effect number out of range" ); last_effect_link->next = elink; last_effect_link = last_effect_link->next; } readEffect( elink ); return RET_CONTINUE; } int ScriptParser::divCommand() { int val1 = script_h.readInt(); script_h.pushVariable(); int val2 = script_h.readInt(); script_h.setInt( &script_h.pushed_variable, val1/val2 ); return RET_CONTINUE; } int ScriptParser::dimCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "dim: not in the define section" ); script_h.declareDim(); return RET_CONTINUE; } int ScriptParser::defvoicevolCommand() { voice_volume = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::defsubCommand() { const char *cmd = script_h.readLabel(); if (cmd[0] >= 'a' && cmd[0] <= 'z'){ UserFuncHash &ufh = user_func_hash[cmd[0]-'a']; ufh.last->next = new UserFuncLUT(); ufh.last = ufh.last->next; setStr( &ufh.last->command, cmd ); } return RET_CONTINUE; } int ScriptParser::defsevolCommand() { se_volume = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::defmp3volCommand() { music_volume = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::defaultspeedCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "defaultspeed: not in the define section" ); for ( int i=0 ; i<3 ; i++ ) default_text_speed[i] = script_h.readInt(); return RET_CONTINUE; } int ScriptParser::defaultfontCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "defaultfont: not in the define section" ); setStr( &default_env_font, script_h.readStr() ); return RET_CONTINUE; } int ScriptParser::decCommand() { int val = script_h.readInt(); script_h.setInt( &script_h.current_variable, val-1 ); return RET_CONTINUE; } int ScriptParser::dateCommand() { time_t t = time(NULL); struct tm *tm = localtime( &t ); script_h.readInt(); script_h.setInt( &script_h.current_variable, tm->tm_year % 100 ); script_h.readInt(); script_h.setInt( &script_h.current_variable, tm->tm_mon + 1 ); script_h.readInt(); script_h.setInt( &script_h.current_variable, tm->tm_mday ); return RET_CONTINUE; } int ScriptParser::cosCommand() { script_h.readInt(); script_h.pushVariable(); int val = script_h.readInt(); script_h.setInt(&script_h.pushed_variable, (int)(cos(M_PI*val/180.0)*1000.0)); return RET_CONTINUE; } int ScriptParser::cmpCommand() { script_h.readInt(); script_h.pushVariable(); script_h.readStr(); char *save_buf = script_h.saveStringBuffer(); const char *buf = script_h.readStr(); int val = strcmp( save_buf, buf ); if ( val > 0 ) val = 1; else if ( val < 0 ) val = -1; script_h.setInt( &script_h.pushed_variable, val ); return RET_CONTINUE; } int ScriptParser::clickvoiceCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "clickvoice: not in the define section" ); for ( int i=0 ; iprevious || last_nest_info->nest_mode != NestInfo::FOR) errorAndExit("break: not in for loop\n"); char *buf = script_h.getNext(); if ( buf[0] == '*' ){ last_nest_info = last_nest_info->previous; delete last_nest_info->next; last_nest_info->next = NULL; setCurrentLabel( script_h.readStr()+1 ); } else{ break_flag = true; } return RET_CONTINUE; } int ScriptParser::atoiCommand() { script_h.readInt(); script_h.pushVariable(); const char *buf = script_h.readStr(); script_h.setInt( &script_h.pushed_variable, atoi(buf) ); return RET_CONTINUE; } int ScriptParser::arcCommand() { const char *buf = script_h.readStr(); char *buf2 = new char[ strlen( buf ) + 1 ]; strcpy( buf2, buf ); int i = 0; while ( buf2[i] != '|' && buf2[i] != '\0' ) i++; buf2[i] = '\0'; if ( strcmp( script_h.cBR->getArchiveName(), "direct" ) == 0 ){ delete script_h.cBR; script_h.cBR = new SarReader( archive_path, key_table ); if ( script_h.cBR->open( buf2 ) ){ fprintf( stderr, " *** failed to open archive %s, ignored. ***\n", buf2 ); } } else if ( strcmp( script_h.cBR->getArchiveName(), "sar" ) == 0 ){ if ( script_h.cBR->open( buf2 ) ){ fprintf( stderr, " *** failed to open archive %s, ignored. ***\n", buf2 ); } } // skip "arc" commands after "ns?" command delete[] buf2; return RET_CONTINUE; } int ScriptParser::addkinsokuCommand() { if ( current_mode != DEFINE_MODE ) errorAndExit( "addkinsoku: not in the define section" ); script_h.readStr(); char *start = script_h.saveStringBuffer(); const char *end = script_h.readStr(); setKinsoku(start, end, true); return RET_CONTINUE; } int ScriptParser::addCommand() { script_h.readVariable(); if ( script_h.current_variable.type == ScriptHandler::VAR_INT || script_h.current_variable.type == ScriptHandler::VAR_ARRAY ){ int val = script_h.getIntVariable( &script_h.current_variable ); script_h.pushVariable(); script_h.setInt( &script_h.pushed_variable, val+script_h.readInt() ); } else if ( script_h.current_variable.type == ScriptHandler::VAR_STR ){ int no = script_h.current_variable.var_no; const char *buf = script_h.readStr(); ScriptHandler::VariableData &vd = script_h.getVariableData(no); char *tmp_buffer = vd.str; if ( tmp_buffer ){ vd.str = new char[ strlen( tmp_buffer ) + strlen( buf ) + 1 ]; strcpy( vd.str, tmp_buffer ); strcat( vd.str, buf ); delete[] tmp_buffer; } else{ vd.str = new char[ strlen( buf ) + 1 ]; strcpy( vd.str, buf ); } } else errorAndExit( "add: no variable." ); return RET_CONTINUE; } onscripter-20150820/NsaReader.h0000644017777601777760000000432712565174244016023 0ustar nobodynogroup/* -*- C++ -*- * * NsaReader.h - Reader from a NSA archive * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __NSA_READER_H__ #define __NSA_READER_H__ #include "SarReader.h" #define MAX_EXTRA_ARCHIVE 9 #define MAX_NS2_ARCHIVE 100 class NsaReader : public SarReader { public: NsaReader( unsigned int nsa_offset=0, char *path=NULL, int archive_type=ARCHIVE_TYPE_NSA, const unsigned char *key_table=NULL ); ~NsaReader(); int open( const char *nsa_path=NULL ); const char *getArchiveName() const; int getNumFiles(); size_t getFileLength( const char *file_name ); size_t getFile( const char *file_name, unsigned char *buf, int *location=NULL ); FileInfo getFileByIndex( unsigned int index ); int openForConvert( char *nsa_name, int archive_type=ARCHIVE_TYPE_NSA, unsigned int nsa_offset=0 ); int writeHeader( FILE *fp, int archive_type=ARCHIVE_TYPE_NSA, int nsa_offset=0 ); size_t putFile( FILE *fp, int no, size_t offset, size_t length, size_t original_length, int compression_type, bool modified_flag, unsigned char *buffer ); private: bool sar_flag; int nsa_offset; int archive_type; int num_of_nsa_archives; int num_of_ns2_archives; const char *nsa_archive_ext; const char *ns2_archive_ext; ArchiveInfo archive_info2[MAX_EXTRA_ARCHIVE]; ArchiveInfo archive_info_ns2[MAX_NS2_ARCHIVE]; size_t getFileLengthSub( ArchiveInfo *ai, const char *file_name ); }; #endif // __NSA_READER_H__ onscripter-20150820/BaseReader.h0000644017777601777760000000574312565174244016157 0ustar nobodynogroup/* -*- C++ -*- * * BaseReader.h - Base class of archive reader * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __BASE_READER_H__ #define __BASE_READER_H__ #include #ifndef SEEK_END #define SEEK_END 2 #endif #if defined(LINUX) || defined(MACOSX) #define DELIMITER '/' #elif defined(WIN32) #define DELIMITER '\\' #elif defined(MACOS9) #define DELIMITER ':' #define RELATIVEPATH ":" #define RELATIVEPATHLENGTH 1 #else #define DELIMITER '/' #endif #ifndef RELATIVEPATH #define RELATIVEPATH "" #define RELATIVEPATHLENGTH 0 #endif struct BaseReader { enum { NO_COMPRESSION = 0, SPB_COMPRESSION = 1, LZSS_COMPRESSION = 2, NBZ_COMPRESSION = 4 }; enum { ARCHIVE_TYPE_NONE = 0, ARCHIVE_TYPE_SAR = 1, ARCHIVE_TYPE_NSA = 2, ARCHIVE_TYPE_NS2 = 4 //new format since NScr2.91, uses ext ".ns2" }; struct FileInfo{ char name[256]; int compression_type; size_t offset; size_t length; size_t original_length; }; struct ArchiveInfo{ ArchiveInfo *next; FILE *file_handle; int power_resume_number; // currently only for PSP char *file_name; FileInfo *fi_list; unsigned int num_of_files; unsigned long base_offset; ArchiveInfo(){ next = NULL; file_handle = NULL; power_resume_number = 0; file_name = NULL; fi_list = NULL; num_of_files = 0; } ~ArchiveInfo(){ if (file_handle) fclose( file_handle ); if (file_name) delete[] file_name; if (fi_list) delete[] fi_list; } }; virtual ~BaseReader(){}; virtual int open( const char *name=NULL ) = 0; virtual int close() = 0; virtual const char *getArchiveName() const = 0; virtual int getNumFiles() = 0; virtual void registerCompressionType( const char *ext, int type ) = 0; virtual FileInfo getFileByIndex( unsigned int index ) = 0; virtual size_t getFileLength( const char *file_name ) = 0; virtual size_t getFile( const char *file_name, unsigned char *buffer, int *location=NULL ) = 0; }; #endif // __BASE_READER_H__ onscripter-20150820/DirectReader.cpp0000644017777601777760000004234712565174244017053 0ustar nobodynogroup//$Id:$ -*- C++ -*- /* * DirectReader.cpp - Reader from independent files * * Copyright (c) 2001-2014 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include "DirectReader.h" #include #if !defined(WIN32) && !defined(MACOS9) && !defined(PSP) && !defined(__OS2__) #include #endif #define IS_TWO_BYTE(x) \ ( ((x) & 0xe0) == 0xe0 || ((x) & 0xe0) == 0x80 ) extern unsigned short convSJIS2UTF16( unsigned short in ); extern int convUTF16ToUTF8( unsigned char dst[4], unsigned short src ); #ifndef SEEK_END #define SEEK_END 2 #endif #define READ_LENGTH 4096 #define WRITE_LENGTH 5000 #define EI 8 #define EJ 4 #define P 1 /* If match length <= P then output one character */ #define N (1 << EI) /* buffer size */ #define F ((1 << EJ) + P) /* lookahead buffer size */ DirectReader::DirectReader( const char *path, const unsigned char *key_table ) { file_full_path = NULL; file_sub_path = NULL; file_path_len = 0; capital_name = new char[MAX_FILE_NAME_LENGTH*2+1]; capital_name_tmp = new char[MAX_FILE_NAME_LENGTH*3+1]; if ( path ){ archive_path = new char[ strlen(path) + 1 ]; memcpy( archive_path, path, strlen(path) + 1 ); } else{ archive_path = new char[1]; archive_path[0] = 0; } int i; if (key_table){ key_table_flag = true; for (i=0 ; i<256 ; i++) this->key_table[i] = key_table[i]; } else{ key_table_flag = false; for (i=0 ; i<256 ; i++) this->key_table[i] = i; } read_buf = new unsigned char[READ_LENGTH]; decomp_buffer = new unsigned char[N*2]; decomp_buffer_len = N*2; last_registered_compression_type = &root_registered_compression_type; registerCompressionType( "NBZ", NBZ_COMPRESSION ); registerCompressionType( "SPB", SPB_COMPRESSION ); registerCompressionType( "JPG", NO_COMPRESSION ); registerCompressionType( "GIF", NO_COMPRESSION ); } DirectReader::~DirectReader() { if (file_full_path) delete[] file_full_path; if (file_sub_path) delete[] file_sub_path; delete[] capital_name; delete[] capital_name_tmp; delete[] read_buf; delete[] decomp_buffer; last_registered_compression_type = root_registered_compression_type.next; while ( last_registered_compression_type ){ RegisteredCompressionType *cur = last_registered_compression_type; last_registered_compression_type = last_registered_compression_type->next; delete cur; } } FILE *DirectReader::fopen(const char *path, const char *mode) { size_t len = strlen(archive_path) + strlen(path) + 1; if (file_path_len < len){ file_path_len = len; if (file_full_path) delete[] file_full_path; file_full_path = new char[file_path_len]; if (file_sub_path) delete[] file_sub_path; file_sub_path = new char[file_path_len]; } sprintf( file_full_path, "%s%s", archive_path, path ); FILE *fp = ::fopen( file_full_path, mode ); if (fp) return fp; #if !defined(WIN32) && !defined(MACOS9) && !defined(PSP) && !defined(__OS2__) char *cur_p = NULL; DIR *dp = NULL; len = strlen(archive_path); if (len > 0) dp = opendir(archive_path); else dp = opendir("."); cur_p = file_full_path+len; while(1){ if (dp == NULL) return NULL; char *delim_p = NULL; while(1){ delim_p = strchr( cur_p, (char)DELIMITER ); if (delim_p != cur_p) break; cur_p++; } if (delim_p) len = delim_p - cur_p; else len = strlen(cur_p); memcpy(file_sub_path, cur_p, len); file_sub_path[len] = '\0'; struct dirent *entp; while ( (entp = readdir(dp)) != NULL ){ if ( !strcasecmp( file_sub_path, entp->d_name ) ){ memcpy(cur_p, entp->d_name, len); break; } } closedir( dp ); if (entp == NULL) return NULL; if (delim_p == NULL) break; memcpy(file_sub_path, file_full_path, delim_p-file_full_path); file_sub_path[delim_p-file_full_path]='\0'; dp = opendir(file_sub_path); cur_p = delim_p+1; } fp = ::fopen( file_full_path, mode ); #endif return fp; } unsigned char DirectReader::readChar( FILE *fp ) { unsigned char ret; fread( &ret, 1, 1, fp ); return key_table[ret]; } unsigned short DirectReader::readShort( FILE *fp ) { unsigned short ret; unsigned char buf[2]; fread( &buf, 1, 2, fp ); ret = key_table[buf[0]] << 8 | key_table[buf[1]]; return ret; } unsigned long DirectReader::readLong( FILE *fp ) { unsigned long ret; unsigned char buf[4]; fread( &buf, 1, 4, fp ); ret = key_table[buf[0]]; ret = ret << 8 | key_table[buf[1]]; ret = ret << 8 | key_table[buf[2]]; ret = ret << 8 | key_table[buf[3]]; return ret; } void DirectReader::writeChar( FILE *fp, unsigned char ch ) { fwrite( &ch, 1, 1, fp ); } void DirectReader::writeShort( FILE *fp, unsigned short ch ) { unsigned char buf[2]; buf[0] = (ch>>8) & 0xff; buf[1] = ch & 0xff; fwrite( &buf, 1, 2, fp ); } void DirectReader::writeLong( FILE *fp, unsigned long ch ) { unsigned char buf[4]; buf[0] = (unsigned char)((ch>>24) & 0xff); buf[1] = (unsigned char)((ch>>16) & 0xff); buf[2] = (unsigned char)((ch>>8) & 0xff); buf[3] = (unsigned char)(ch & 0xff); fwrite( &buf, 1, 4, fp ); } unsigned short DirectReader::swapShort( unsigned short ch ) { return ((ch & 0xff00) >> 8) | ((ch & 0x00ff) << 8); } unsigned long DirectReader::swapLong( unsigned long ch ) { return ((ch & 0xff000000) >> 24) | ((ch & 0x00ff0000) >> 8 ) | ((ch & 0x0000ff00) << 8) | ((ch & 0x000000ff) << 24); } int DirectReader::open( const char *name ) { return 0; } int DirectReader::close() { return 0; } const char *DirectReader::getArchiveName() const { return "direct"; } int DirectReader::getNumFiles() { return 0; } void DirectReader::registerCompressionType( const char *ext, int type ) { last_registered_compression_type->next = new RegisteredCompressionType(ext, type); last_registered_compression_type = last_registered_compression_type->next; } int DirectReader::getRegisteredCompressionType( const char *file_name ) { const char *ext_buf = file_name + strlen(file_name); while( *ext_buf != '.' && ext_buf != file_name ) ext_buf--; ext_buf++; strcpy( capital_name, ext_buf ); for ( unsigned int i=0 ; i= 'a' && capital_name[i] <= 'z' ) capital_name[i] += 'A' - 'a'; RegisteredCompressionType *reg = root_registered_compression_type.next; while (reg){ if ( !strcmp( capital_name, reg->ext ) ) return reg->type; reg = reg->next; } return NO_COMPRESSION; } struct DirectReader::FileInfo DirectReader::getFileByIndex( unsigned int index ) { DirectReader::FileInfo fi; return fi; } FILE *DirectReader::getFileHandle( const char *file_name, int &compression_type, size_t *length ) { FILE *fp; unsigned int i; compression_type = NO_COMPRESSION; size_t len = strlen( file_name ); if ( len > MAX_FILE_NAME_LENGTH ) len = MAX_FILE_NAME_LENGTH; memcpy( capital_name, file_name, len ); capital_name[ len ] = '\0'; for ( i=0 ; i 0x80 ) i++; } #if defined(UTF8_FILESYSTEM) convertFromSJISToUTF8(capital_name_tmp, capital_name); strcpy(capital_name, capital_name_tmp); len = strlen(capital_name); #elif defined(LINUX) convertFromSJISToEUC(capital_name); #endif *length = 0; if ( (fp = fopen( capital_name, "rb" )) != NULL && len >= 3 ){ compression_type = getRegisteredCompressionType( capital_name ); if ( compression_type == NBZ_COMPRESSION || compression_type == SPB_COMPRESSION ){ *length = getDecompressedFileLength( compression_type, fp, 0 ); } else{ fseek( fp, 0, SEEK_END ); *length = ftell( fp ); } } return fp; } size_t DirectReader::getFileLength( const char *file_name ) { int compression_type; size_t len; FILE *fp = getFileHandle( file_name, compression_type, &len ); if ( fp ) fclose( fp ); return len; } size_t DirectReader::getFile( const char *file_name, unsigned char *buffer, int *location ) { int compression_type; size_t len, c, total = 0; FILE *fp = getFileHandle( file_name, compression_type, &len ); if ( fp ){ if ( compression_type & NBZ_COMPRESSION ) return decodeNBZ( fp, 0, buffer ); else if ( compression_type & SPB_COMPRESSION ) return decodeSPB( fp, 0, buffer ); fseek( fp, 0, SEEK_SET ); total = len; while( len > 0 ){ if ( len > READ_LENGTH ) c = READ_LENGTH; else c = len; len -= c; fread( buffer, 1, c, fp ); buffer += c; } fclose( fp ); if ( location ) *location = ARCHIVE_TYPE_NONE; } return total; } void DirectReader::convertFromSJISToEUC( char *buf ) { int i = 0; while ( buf[i] ) { if ( (unsigned char)buf[i] > 0x80 ) { unsigned char c1, c2; c1 = buf[i]; c2 = buf[i+1]; c1 -= (c1 <= 0x9f) ? 0x71 : 0xb1; c1 = c1 * 2 + 1; if (c2 > 0x9e) { c2 -= 0x7e; c1++; } else if (c2 >= 0x80) { c2 -= 0x20; } else { c2 -= 0x1f; } buf[i] = c1 | 0x80; buf[i+1] = c2 | 0x80; i++; } i++; } } void DirectReader::convertFromSJISToUTF8( char *dst_buf, const char *src_buf ) { int i, c; unsigned short unicode; unsigned char utf8_buf[4]; while(*src_buf){ if (IS_TWO_BYTE(*src_buf)){ unsigned short index = *(unsigned char*)src_buf++; index = index << 8 | (*(unsigned char*)src_buf++); unicode = convSJIS2UTF16( index ); c = convUTF16ToUTF8(utf8_buf, unicode); for (i=0 ; i 0 ){ if ( count >= READ_LENGTH ) len = BZ2_bzRead( &err, bfp, buf, READ_LENGTH ); else len = BZ2_bzRead( &err, bfp, buf, count ); count -= len; buf += len; } BZ2_bzReadGetUnused(&err, bfp, &unused, &nunused ); BZ2_bzReadClose( &err, bfp ); return original_length - count; } size_t DirectReader::encodeNBZ( FILE *fp, size_t length, unsigned char *buf ) { unsigned int bytes_in, bytes_out; int err; BZFILE *bfp = BZ2_bzWriteOpen( &err, fp, 9, 0, 30 ); if ( bfp == NULL || err != BZ_OK ) return 0; while( err == BZ_OK && length > 0 ){ if ( length >= WRITE_LENGTH ){ BZ2_bzWrite( &err, bfp, buf, WRITE_LENGTH ); buf += WRITE_LENGTH; length -= WRITE_LENGTH; } else{ BZ2_bzWrite( &err, bfp, buf, length ); break; } } BZ2_bzWriteClose( &err, bfp, 0, &bytes_in, &bytes_out ); return bytes_out; } int DirectReader::getbit( FILE *fp, int n ) { int i, x = 0; static int getbit_buf; for ( i=0 ; i>= 1; } return x; } size_t DirectReader::decodeSPB( FILE *fp, size_t offset, unsigned char *buf ) { unsigned int count; unsigned char *pbuf, *psbuf; size_t i, j, k; int c, n, m; getbit_mask = 0; getbit_len = getbit_count = 0; fseek( fp, offset, SEEK_SET ); size_t width = readShort( fp ); size_t height = readShort( fp ); size_t width_pad = (4 - width * 3 % 4) % 4; size_t total_size = (width * 3 + width_pad) * height + 54; /* ---------------------------------------- */ /* Write header */ memset( buf, 0, 54 ); buf[0] = 'B'; buf[1] = 'M'; buf[2] = total_size & 0xff; buf[3] = (total_size >> 8) & 0xff; buf[4] = (total_size >> 16) & 0xff; buf[5] = (total_size >> 24) & 0xff; buf[10] = 54; // offset to the body buf[14] = 40; // header size buf[18] = width & 0xff; buf[19] = (width >> 8) & 0xff; buf[22] = height & 0xff; buf[23] = (height >> 8) & 0xff; buf[26] = 1; // the number of the plane buf[28] = 24; // bpp buf[34] = total_size - 54; // size of the body buf += 54; if (decomp_buffer_len < width*height+4){ if (decomp_buffer) delete[] decomp_buffer; decomp_buffer_len = width*height+4; decomp_buffer = new unsigned char[decomp_buffer_len]; } for ( i=0 ; i<3 ; i++ ){ count = 0; decomp_buffer[count++] = c = getbit( fp, 8 ); while ( count < (unsigned)(width * height) ){ n = getbit( fp, 3 ); if ( n == 0 ){ decomp_buffer[count++] = c; decomp_buffer[count++] = c; decomp_buffer[count++] = c; decomp_buffer[count++] = c; continue; } else if ( n == 7 ){ m = getbit( fp, 1 ) + 1; } else{ m = n + 2; } for ( j=0 ; j<4 ; j++ ){ if ( m == 8 ){ c = getbit( fp, 8 ); } else{ k = getbit( fp, m ); if ( k & 1 ) c += (k>>1) + 1; else c -= (k>>1); } decomp_buffer[count++] = c; } } pbuf = buf + (width * 3 + width_pad)*(height-1) + i; psbuf = decomp_buffer; for ( j=0 ; jfile_handle, ai->fi_list[no].offset, SEEK_SET ); memset( decomp_buffer, 0, N-F ); r = N - F; while ( count < ai->fi_list[no].original_length ){ if ( getbit( ai->file_handle, 1 ) ) { if ((c = getbit( ai->file_handle, 8 )) == EOF) break; buf[ count++ ] = c; decomp_buffer[r++] = c; r &= (N - 1); } else { if ((i = getbit( ai->file_handle, EI )) == EOF) break; if ((j = getbit( ai->file_handle, EJ )) == EOF) break; for (k = 0; k <= j + 1 ; k++) { c = decomp_buffer[(i + k) & (N - 1)]; buf[ count++ ] = c; decomp_buffer[r++] = c; r &= (N - 1); } } } return count; } size_t DirectReader::getDecompressedFileLength( int type, FILE *fp, size_t offset ) { size_t length=0; fseek( fp, offset, SEEK_SET ); if ( type == NBZ_COMPRESSION ){ length = readLong( fp ); } else if ( type == SPB_COMPRESSION ){ size_t width = readShort( fp ); size_t height = readShort( fp ); size_t width_pad = (4 - width * 3 % 4) % 4; length = (width * 3 +width_pad) * height + 54; } return length; } onscripter-20150820/simple_aviplay.cpp0000644017777601777760000000304012565174244017517 0ustar nobodynogroup/* -*- C++ -*- * * simple_aviplay.cpp - sample program for AVIWrapper class * * Copyright (c) 2001-2004 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #include #include #include #include #include #include "AVIWrapper.h" #define DEFAULT_AUDIOBUF 4096 #define ONS_MIX_CHANNELS 50 int main( int argc, char **argv ) { if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO ) < 0 ){ fprintf( stderr, "Couldn't initialize SDL: %s\n", SDL_GetError() ); exit(-1); } AVIWrapper avi; if ( avi.init( argv[1], true ) ) exit(-1); SDL_Surface *screen_surface = SDL_SetVideoMode( avi.getWidth(), avi.getHeight(), 32, SDL_SWSURFACE ); if ( avi.initAV( screen_surface, true ) ) exit(-1); avi.play( true ); exit(0); } onscripter-20150820/AnimationInfo.h0000644017777601777760000001177112565174244016713 0ustar nobodynogroup/* -*- C++ -*- * * AnimationInfo.h - General image storage class of ONScripter * * Copyright (c) 2001-2013 Ogapee. All rights reserved. * * ogapee@aqua.dti2.ne.jp * * 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 */ #ifndef __ANIMATION_INFO_H__ #define __ANIMATION_INFO_H__ #include #include #ifndef _SDL_pixels_h #define SDL_PIXELFORMAT_RGB565 0 #define SDL_PIXELFORMAT_ABGR8888 1 #define SDL_PIXELFORMAT_ARGB8888 2 #endif typedef unsigned char uchar3[3]; class AnimationInfo{ public: #if defined(BPP16) typedef Uint16 ONSBuf; #else typedef Uint32 ONSBuf; #endif enum { TRANS_ALPHA = 1, TRANS_TOPLEFT = 2, TRANS_COPY = 3, TRANS_STRING = 4, TRANS_DIRECT = 5, TRANS_PALLETTE = 6, TRANS_TOPRIGHT = 7, TRANS_MASK = 8 }; bool is_copy; // allocated buffers should not be deleted from a copied instance /* variables set from the image tag */ int trans_mode; uchar3 direct_color; int pallette_number; uchar3 color; SDL_Rect orig_pos; // position and size of the image before resizing SDL_Rect pos; // position and size of the current cell int num_of_cells; int current_cell; int direction; int *duration_list; uchar3 *color_list; int loop_mode; bool is_animatable; bool is_single_line; bool is_tight_region; // valid under TRANS_STRING, if false, ruby is parsed bool is_ruby_drawable; char *file_name; char *mask_file_name; /* Variables from AnimationInfo */ bool visible; bool abs_flag; bool affine_flag; int trans; char *image_name; char *surface_name; // used to avoid reloading images char *mask_surface_name; // used to avoid reloading images SDL_Surface *image_surface; unsigned char *alpha_buf; /* Variables for extended sprite (lsp2, drawsp2, etc.) */ int scale_x, scale_y, rot; int mat[2][2], inv_mat[2][2]; int corner_xy[4][2]; SDL_Rect bounding_rect; enum { BLEND_NORMAL = 0, BLEND_ADD = 1, BLEND_SUB = 2 }; int blending_mode; int cos_i, sin_i; int font_size_xy[2]; // used by prnum and lsp string int font_pitch[2]; // used by lsp string int remaining_time; int param; // used by prnum and bar int max_param; // used by bar int max_width; // used by bar AnimationInfo(); AnimationInfo(const AnimationInfo &anim); ~AnimationInfo(); AnimationInfo& operator =(const AnimationInfo &anim); void scalePosXY(int screen_ratio1, int screen_ratio2){ pos.x = orig_pos.x * screen_ratio1 / screen_ratio2; pos.y = orig_pos.y * screen_ratio1 / screen_ratio2; }; void scalePosWH(int screen_ratio1, int screen_ratio2){ pos.w = orig_pos.w * screen_ratio1 / screen_ratio2; pos.h = orig_pos.h * screen_ratio1 / screen_ratio2; }; void reset(); void deleteImageName(); void setImageName( const char *name ); void deleteSurface(bool delete_surface_name=true); void remove(); void removeTag(); void stepAnimation(int t); bool proceedAnimation(); void setCell(int cell); static int doClipping( SDL_Rect *dst, SDL_Rect *clip, SDL_Rect *clipped=NULL ); void blendOnSurface( SDL_Surface *dst_surface, int dst_x, int dst_y, SDL_Rect &clip, int alpha=255 ); void blendOnSurface2( SDL_Surface *dst_surface, int dst_x, int dst_y, SDL_Rect &clip, int alpha=255 ); void blendText( SDL_Surface *surface, int dst_x, int dst_y, SDL_Color &color, SDL_Rect *clip, bool rotate_flag ); void calcAffineMatrix(); static SDL_Surface *allocSurface( int w, int h, Uint32 texture_format ); static SDL_Surface *alloc32bitSurface( int w, int h, Uint32 texture_format ); void allocImage( int w, int h, Uint32 texture_format ); void copySurface( SDL_Surface *surface, SDL_Rect *src_rect, SDL_Rect *dst_rect = NULL ); void fill( Uint8 r, Uint8 g, Uint8 b, Uint8 a ); SDL_Surface *setupImageAlpha( SDL_Surface *surface, SDL_Surface *surface_m, bool has_alpha ); void setImage( SDL_Surface *surface, Uint32 texture_format ); unsigned char getAlpha(int x, int y); }; #endif // __ANIMATION_INFO_H__ onscripter-20150820/Makefile.Pandora0000644017777601777760000000420712565174244017026 0ustar nobodynogroup# -*- Makefile -*- # # Makefile.Pandora - Makefile rules for Pandora # PNDSDK = $(HOME)/pandora-dev/arm-2011.09 EXESUFFIX = OBJSUFFIX = .o .SUFFIXES: .SUFFIXES: $(OBJSUFFIX) .cpp .h TARGET = onscripter$(EXESUFFIX) EXT_OBJS = # mandatory: SDL, SDL_ttf, SDL_image, SDL_mixer, bzip2, libjpeg DEFS = -DPANDORA -DLINUX -DBPP16 INCS = -I$(PNDSDK)/usr/include -I$(PNDSDK)/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT LIBS = -L$(PNDSDK)/usr/lib -Wl,-rpath-link,$(PNDSDK)/usr/lib -lSDL -lpthread -lSDL_ttf -lSDL_image -lSDL_mixer -lbz2 -ljpeg -lm # recommended: smpeg DEFS += -DUSE_SMPEG INCS += -I$(PNDSDK)/usr/include/smpeg LIBS += -lsmpeg # recommended: fontconfig (to get default font) DEFS += -DUSE_FONTCONFIG LIBS += -lfontconfig # recommended: OggVorbis #DEFS += -DUSE_OGG_VORBIS #LIBS += -logg -lvorbis -lvorbisfile # optional: Integer OggVorbis DEFS += -DUSE_OGG_VORBIS -DINTEGER_OGG_VORBIS LIBS += -lvorbisidec # optional: support CD audio DEFS += -DUSE_CDROM # optional: avifile #DEFS += -DUSE_AVIFILE #INCS += `avifile-config --cflags` #LIBS += `avifile-config --libs` #TARGET += simple_aviplay$(EXESUFFIX) #EXT_OBJS += AVIWrapper$(OBJSUFFIX) # optional: lua DEFS += -DUSE_LUA INCS += -I$(PNDSDK)/usr/include LIBS += -llua -ldl EXT_OBJS += LUAHandler$(OBJSUFFIX) # optional: force screen width for PDA #DEFS += -DPDA_WIDTH=640 DEFS += -DPDA_AUTOSIZE # optional: enable English mode #DEFS += -DENABLE_1BYTE_CHAR -DFORCE_1BYTE_CHAR # for GNU g++ CC = $(PNDSDK)/bin/arm-none-linux-gnueabi-g++ LD = $(PNDSDK)/bin/arm-none-linux-gnueabi-g++ -o MFLAGS = -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -fassociative-math -funsafe-math-optimizations #CFLAGS = -g -Wall $(MFLAGS) -pipe -c $(INCS) $(DEFS) CFLAGS = -Os -Wall -fomit-frame-pointer $(MFLAGS) -pipe -c $(INCS) $(DEFS) # for GCC on PowerPC specfied #CC = powerpc-unknown-linux-gnu-g++ #LD = powerpc-unknown-linux-gnu-g++ -o #CFLAGS = -O3 -mtune=G4 -maltivec -mabi=altivec -mpowerpc-gfxopt -mmultiple -mstring -Wall -fomit-frame-pointer -pipe -c $(INCS) $(DEFS) # for Intel compiler #CC = icc #LD = icc -o #CFLAGS = -O3 -tpp6 -xK -c $(INCS) $(DEFS) RM = rm -f include Makefile.onscripter