int numberOfScreens(const machine_config *config) { const screen_device_config *screen = screen_first(*config); int i=0; for (; screen != NULL; screen = screen_next(screen)) { i++; } return i; }
BOOL isDriverVector(const machine_config *config) { const screen_device_config *screen = screen_first(*config); if (screen != NULL) { // parse "vector.ini" for vector games if (SCREEN_TYPE_VECTOR == screen->screen_type()) { return TRUE; } } return FALSE; }
static void pick_best_mode(win_window_info *window) { dd_info *dd = (dd_info *)window->drawdata; mode_enum_info einfo; HRESULT result; // determine the minimum width/height for the selected target // note: technically we should not be calling this from an alternate window // thread; however, it is only done during init time, and the init code on // the main thread is waiting for us to finish, so it is safe to do so here render_target_get_minimum_size(window->target, &einfo.minimum_width, &einfo.minimum_height); // use those as the target for now einfo.target_width = einfo.minimum_width * MAX(1, video_config.prescale); einfo.target_height = einfo.minimum_height * MAX(1, video_config.prescale); // determine the refresh rate of the primary screen einfo.target_refresh = 60.0; const screen_device_config *primary_screen = screen_first(*window->machine->config); if (primary_screen != NULL) einfo.target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh()); printf("Target refresh = %f\n", einfo.target_refresh); // if we're not stretching, allow some slop on the minimum since we can handle it if (!video_config.hwstretch) { einfo.minimum_width -= 4; einfo.minimum_height -= 4; } // if we are stretching, aim for a mode approximately 2x the game's resolution else if (video_config.prescale <= 1) { einfo.target_width *= 2; einfo.target_height *= 2; } // fill in the rest of the data einfo.window = window; einfo.best_score = 0.0f; // enumerate the modes mame_printf_verbose(_WINDOWS("DirectDraw: Selecting video mode...\n")); result = IDirectDraw7_EnumDisplayModes(dd->ddraw, DDEDM_REFRESHRATES, NULL, &einfo, enum_modes_callback); if (result != DD_OK) mame_printf_verbose(_WINDOWS("DirectDraw: Error %08X during EnumDisplayModes call\n"), (int)result); mame_printf_verbose(_WINDOWS("DirectDraw: Mode selected = %4dx%4d@%3dHz\n"), dd->width, dd->height, dd->refresh); }
running_machine::running_machine(const game_driver &driver, const machine_config &_config, core_options &options, bool exit_to_game_select) : m_regionlist(m_respool), m_devicelist(m_respool), config(&_config), m_config(_config), firstcpu(NULL), gamedrv(&driver), m_game(driver), primary_screen(NULL), palette(NULL), pens(NULL), colortable(NULL), shadow_table(NULL), priority_bitmap(NULL), sample_rate(options_get_int(&options, OPTION_SAMPLERATE)), debug_flags(0), ui_active(false), mame_data(NULL), timer_data(NULL), state_data(NULL), memory_data(NULL), palette_data(NULL), tilemap_data(NULL), streams_data(NULL), devices_data(NULL), romload_data(NULL), sound_data(NULL), input_data(NULL), input_port_data(NULL), ui_input_data(NULL), cheat_data(NULL), debugcpu_data(NULL), generic_machine_data(NULL), generic_video_data(NULL), generic_audio_data(NULL), m_debug_view(NULL), driver_data(NULL), m_logerror_list(NULL), m_scheduler(*this), m_options(options), m_basename(driver.name), m_current_phase(MACHINE_PHASE_PREINIT), m_paused(false), m_hard_reset_pending(false), m_exit_pending(false), m_exit_to_game_select(exit_to_game_select), m_new_driver_pending(NULL), m_soft_reset_timer(NULL), m_saveload_schedule(SLS_NONE), m_saveload_schedule_time(attotime_zero), m_saveload_searchpath(NULL), m_rand_seed(0x9d14abd7) { memset(gfx, 0, sizeof(gfx)); memset(&generic, 0, sizeof(generic)); memset(m_notifier_list, 0, sizeof(m_notifier_list)); memset(&m_base_time, 0, sizeof(m_base_time)); /* attach this machine to all the devices in the configuration */ m_devicelist.import_config_list(m_config.m_devicelist, *this); /* allocate the driver data (after devices) */ if (m_config.m_driver_data_alloc != NULL) driver_data = (*m_config.m_driver_data_alloc)(*this); /* find devices */ primary_screen = screen_first(*this); for (device_t *device = m_devicelist.first(); device != NULL; device = device->next()) if (dynamic_cast<cpu_device *>(device) != NULL) { firstcpu = downcast<cpu_device *>(device); break; } cpu[0] = firstcpu; for (cpunum = 1; cpunum < ARRAY_LENGTH(cpu) && cpu[cpunum - 1] != NULL; cpunum++) cpu[cpunum] = cpu[cpunum - 1]->typenext(); /* fetch core options */ if (options_get_bool(&m_options, OPTION_DEBUG)) debug_flags = (DEBUG_FLAG_ENABLED | DEBUG_FLAG_CALL_HOOK) | (options_get_bool(&m_options, OPTION_DEBUG_INTERNAL) ? 0 : DEBUG_FLAG_OSD_ENABLED); }
int main() { Baslat(); double first_screen=1; double still_run; int choose_control; int choose_tema; LOCK_VARIABLE(speed_counter); LOCK_FUNCTION(increment_speed_counter); install_int_ex(increment_speed_counter,BPS_TO_TIMER(60)); BITMAP *bmp_first_screen = create_bitmap(SCREEN_WW,SCREEN_HH); BITMAP *bmp = create_bitmap(MAP_W,MAP_H); BITMAP *arka_fon_defter = load_bitmap("defter.bmp",NULL); BITMAP *arka_fon_su_damlasi = load_bitmap("su_damlasi.bmp",NULL); BITMAP *arka_fon_karatahta = load_bitmap("karatahta.bmp",NULL); BITMAP *sprite = load_bitmap("mouse_icon_purple.bmp",NULL); BITMAP *sprite_game = load_bitmap("mouse_icon_blue.bmp",NULL); color_feature_t yem_color; color_feature_t player_color; int depth; depth=desktop_color_depth(); set_color_depth(depth); //ILK EKRAN still_run=screen_first(first_screen,bmp_first_screen,sprite); //PLAYER KONTROLU SECILIR choose_control=player_control(bmp_first_screen,sprite,still_run); //TEMA VE KARAKTER SECILIR choose_thema(bmp,sprite,still_run, &choose_tema, &yem_color, &player_color); //ARKA FON SECIMI if(choose_tema==1) { //OYUN game(still_run,bmp,arka_fon_defter,sprite_game,choose_control, yem_color, player_color); } else if(choose_tema==2) { //OYUN game(still_run,bmp,arka_fon_su_damlasi,sprite_game,choose_control, yem_color, player_color); } else { //OYUN game(still_run,bmp,arka_fon_karatahta,sprite_game,choose_control, yem_color, player_color); } destroy_bitmap (bmp); destroy_bitmap (arka_fon_defter); destroy_bitmap (arka_fon_su_damlasi); destroy_bitmap (arka_fon_karatahta); Bitir(); return 0; }