void init_iapetus(int res) { int i; interrupt_set_level_mask(0xF); for (i = 0; i < 0x80; i++) bios_set_sh2_interrupt(i, 0); for (i = 0x40; i < 0x60; i++) bios_set_scu_interrupt(i, 0); // Make sure all interrupts have been called bios_change_scu_interrupt_mask(0, 0); bios_change_scu_interrupt_mask(0xFFFFFFFF, 0xFFFFFFFF); vdp_init(res); per_init(); commlink_stop_service(); cl_set_service_func(cl_check2); #ifdef DEBUG debug_init(); #endif // If DSP is running, stop it if (dsp_is_exec()) dsp_stop(); if (interrupt_get_level_mask() > 0x7) interrupt_set_level_mask(0x7); }
void installer_init() { screen_settings_struct settings; init_iapetus(RES_320x224); // Setup a screen for us draw on settings.is_bitmap = TRUE; settings.bitmap_size = BG_BITMAP512x256; settings.transparent_bit = 0; settings.color = BG_256COLOR; settings.special_priority = 0; settings.special_color_calc = 0; settings.extra_palette_num = 0; settings.map_offset = 0; settings.rotation_mode = 0; settings.parameter_addr = 0x25E60000; vdp_rbg0_init(&settings); // Use the default palette vdp_set_default_palette(); // Setup the default 8x16 1BPP font main_font.data = font_8x8; main_font.width = 8; main_font.height = 8; main_font.bpp = 1; main_font.out = (u8 *)0x25E00000; vdp_set_font(SCREEN_RBG0, &main_font, 1); // Display everything vdp_disp_on(); if (ud_detect() == IAPETUS_ERR_OK) cl_set_service_func(ud_check); }
void do_tests(const char *testname, int x, int y) { int i; u8 stage=0; u8 line=0; // Clear out test log area memset((void *)TEST_LOG_ADDRESS, 0, TEST_LOG_SIZE); *((u32 *)TEST_LOG_ADDRESS) = TEST_LOG_ADDRESS+4; // Print messages and cursor vdp_printf(&test_disp_font, x * 8, y * 8, 0xF, (char *)testname); auto_test_section_start((char *)testname); for(;;) { vdp_vsync(); if (stage_status != STAGESTAT_BUSY && stage_status != STAGESTAT_WAITINGFORINT) { int textx = x * 8; int texty = (y + line + 2) * 8; int textstatx = (x + 38) * 8; if (stage_status == STAGESTAT_DONE) { vdp_printf(&test_disp_font, textstatx, texty, 0xA, "OK"); auto_test_send_result("PASS"); } else if (stage_status < 0) { // Handle error switch (stage_status) { case STAGESTAT_BADTIMING: vdp_printf(&test_disp_font, textstatx, texty, 0xE, "BT"); auto_test_send_result("FAIL (Bad Timing)"); break; case STAGESTAT_BADDATA: vdp_printf(&test_disp_font, textstatx, texty, 0xC, "BD"); auto_test_send_result("FAIL (Bad Data)"); break; case STAGESTAT_BADSIZE: vdp_printf(&test_disp_font, textstatx, texty, 0xC, "BS"); auto_test_send_result("FAIL (Bad Size)"); break; case STAGESTAT_BADINTERRUPT: vdp_printf(&test_disp_font, textstatx, texty, 0xC, "BI"); auto_test_send_result("FAIL (Bad Interrupt)"); break; case STAGESTAT_NOTEST: vdp_printf(&test_disp_font, textstatx, texty, 0xF, "NT"); auto_test_send_result("FAIL (No Test)"); break; default: vdp_printf(&test_disp_font, textstatx, texty, 0xC, "failed"); auto_test_send_result("FAIL"); break; } } if (stage >= numtests) { vdp_printf(&test_disp_font, textx, texty+8, 0xF, "All tests done."); break; } #ifndef BUILD_AUTOMATED_TESTING else if (line >= 23) { vdp_printf(&test_disp_font,textx, texty+8, 0xF, "Press any button to continue"); tests_wait_press(); // Clear window vdp_clear_screen(&test_disp_font); vdp_printf(&test_disp_font, x * 8, y * 8, 0xF, (char *)testname); line = 0; texty = (y + line + 2) * 8; } #endif stage_status = STAGESTAT_BUSY; if (tests[stage].name) { vdp_printf(&test_disp_font, textx, texty+8, 0xF, (char *)tests[stage].name); auto_test_sub_test_start((char *)tests[stage].name); } if (tests[stage].testfunc) tests[stage].testfunc(); waitcounter = 60 * 5; stage++; line++; } else { if (stage_status == STAGESTAT_WAITINGFORINT) { // decrement waitcounter waitcounter--; if (waitcounter <= 0) stage_status = STAGESTAT_BADINTERRUPT; #ifdef DEBUG vdp_printf(&test_disp_font, 0 * 8, 23 * 8, 0xF, "%08X", waitcounter); #endif } } } interrupt_set_level_mask(0xF); // Reset all interrupts for (i = 0; i < 0x80; i++) bios_set_sh2_interrupt(i, 0); for (i = 0x40; i < 0x60; i++) bios_set_scu_interrupt(i, 0); // Make sure all interrupts have been called bios_change_scu_interrupt_mask(0, 0); bios_change_scu_interrupt_mask(0xFFFFFFFF, 0xFFFFFFFF); auto_test_section_end(); // Enable commlink connection cl_set_service_func(ud_check); commlink_start_service(); tests_wait_press(); commlink_stop_service(); }