void Java_org_puder_trs80_XTRS_run(JNIEnv* env, jclass clazz) { clear_paste_string(); if (!setjmp(ex_buf)) { screenUpdateRequired = 1; reset_required = 0; while (isRunning) { z80_run(0); if (screenUpdateRequired) { trigger_screen_update(isForcedScreenUpdateRequired); } if (reset_required) { reset_required = 0; clear_paste_string(); trs_timer_init(); trs_reset(0); } } } else { // Got not implemented exception } OpenSLWrap_Shutdown(); }
void reader_mmi_trigger_screen_update(screen_t screen) { #ifdef USE_DOUBLE_FRAME_BUFFER trigger_screen_update(screen); #endif }
void reader_mmi_update_screen(screen_t screen, unsigned short *content, int page_number) { page_t *page = reader_pages + page_number; int i, j; int lines; int last_line_chars; unsigned short page_number_str[16]; int fs = reader_get_font_size(); int header = get_header_blank(fs); int max_line = reader_get_max_line(fs); int start_x = reader_get_start_x(fs); unsigned short *bmpbuf; unsigned short pic_name[READER_FILENAME_MAX]; if (reader_option_bg_pic_enabled()) { reader_full_pic_name(pic_name, reader_option_bg_pic()); if ((bmpbuf = reader_load_bmp(pic_name)) != NULL) { fill_screen_bitmap(screen, bmpbuf); } else { //can not load bg pic reader_option_disable_bg_pic(); fill_screen(screen, reader_bg_color); } } else { fill_screen(screen, reader_bg_color); } if (page_number >= reader_total_pages) { //erase screen anyway #ifdef USE_DOUBLE_FRAME_BUFFER trigger_screen_update(screen); #endif return; } content += page->page_offset; if (page_number == reader_total_pages - 1) { //last page lines = reader_last_page_lines; } else { lines = max_line; } if (! info_visible) { header += 6; } for (i = 0; i < lines - 1; i++) { reader_textout(screen, start_x, i * (fs + LINE_INTERVAL) + header, content + page->line_offest[i], page->line_offest[i + 1] - page->line_offest[i], fs); } if (page_number == reader_total_pages - 1) { last_line_chars = reader_last_line_chars; } else { last_line_chars = reader_pages[page_number + 1].page_offset - (reader_pages[page_number].page_offset + page->line_offest[i]); } reader_textout(screen, start_x, i * (fs + LINE_INTERVAL) + header, content + page->line_offest[i], last_line_chars, fs); if (info_visible) { //show page number at the bottom line page_number ++; //start from index 0, show from 1 if (page_number & 1) { //show page number in left screen if (page_number > reader_total_pages) { page_number = reader_total_pages; } i = reader_itoa(page_number, page_number_str); page_number_str[i ++] = '/'; j = reader_itoa(reader_total_pages, page_number_str + i); assert(i + j < 12); if (reader_get_layout()) { //append compact layout flag reader_wcsncpy(&page_number_str[i+j], READER_STR(compact_layout_flag), 3); page_number_str[i + j + 3] = 0; } else { page_number_str[i + j] = 0; } reader_textout_ex(screen, 0, max_line * (fs + LINE_INTERVAL) + header, page_number_str, 16, fs, READER_COLOR_BLUE, 0); i = reader_itoa(page_number * 100 / reader_total_pages, page_number_str); page_number_str[i ++] = '%'; reader_textout_ex(screen, READER_SCREEN_WIDTH - 1, max_line * (fs + LINE_INTERVAL) + header, page_number_str, i, fs, READER_COLOR_BLUE, TEXT_OUT_ALIGN_RIGHT); } else { //show progress bar in right screen int y1 = max_line * (fs + LINE_INTERVAL) + header + 6; int x_cur = page_number * (READER_SCREEN_WIDTH - 5) / reader_total_pages; reader_rectangle(screen, 0, y1, READER_SCREEN_WIDTH - 1, y1 + 3, READER_COLOR_BLUE, 1); reader_rectangle(screen, x_cur, y1, x_cur + 3, y1 + 3, READER_COLOR_YELLOW, 1); } } #ifdef USE_DOUBLE_FRAME_BUFFER trigger_screen_update(screen); #endif }
void reader_mmi_fill_screen_trigger(screen_t screen, color_t color) { fill_screen(screen, color); trigger_screen_update(screen); }