trunk/src/mame/drivers/comebaby.c
| r243267 | r243268 | |
| 2 | 2 | (c) 2000 ExPotato Co. Ltd (Excellent Potato) |
| 3 | 3 | |
| 4 | 4 | TODO: |
| 5 | | Can't be emulated without proper motherboard BIOS |
| 5 | Nearly everything. |
| 6 | 6 | |
| 7 | | There also appears to be a sequel which may be running on the same hardware, which might not have been released. |
| 7 | There also appears to be a sequel which may be running on the same hardware, but which does not seem to have been released. |
| 8 | 8 | Come On Baby - Ballympic Heroes! (c) 2001 |
| 9 | 9 | |
| 10 | 10 | Other games in this series include: |
| r243267 | r243268 | |
| 16 | 16 | This is a Korean PC based board running Windows. The game runs fully from |
| 17 | 17 | the hard disk making these things rather fragile and prone to damage. |
| 18 | 18 | |
| 19 | | Very little is known about the actual PC at this time, and the driver is |
| 20 | | just a skeleton placeholder for the CHD dump of the hard disk. |
| 19 | PC Motherboard: PC Partner BXAS1-928 |
| 20 | BIOS String: 07/03/2000-440BX-ITE8671-2A69KV3IC-00 |
| 21 | aka. BIOS-I-2M |
| 22 | Award BIOS |
| 23 | B1120IAG.BIN For Super IO = ITE 8671 |
| 24 | Clock Gen IC : Winbond-39A |
| 25 | (Nov/2000 built) |
| 26 | |
| 27 | CPU - Slot 1 Celeron 633MHz (66x9.5) |
| 28 | Memory - 65536k SDRAM PC100 |
| 21 | 29 | |
| 22 | | The donor PC looks like a standard Windows98 setup. |
| 30 | Brief motherboard overview (from PC Partner BXAS1-928 motherboard manual) |
| 31 | -- |
| 32 | |
| 33 | HARDWARE CONFIGURATION |
| 34 | This motherboard is based on Intel 82440BX chipset. The chipset is a |
| 35 | highly integrated solution for a cost-effective and compact motherboard. |
| 36 | The motherboard supports standard DIMM module, PC-100 DIMM module or |
| 37 | Registered DIMM Module. |
| 38 | |
| 39 | Features on-board include.... |
| 40 | super-I/O, Ultra DMA33 (Ultra DMA66 optional for VIA chipset), PCI bus master IDE, AGP Ver 1.0, PCI Ver 2.1 compliance, |
| 41 | USB, VRM 8.4 compliance, ECC, ATX specification 2.01 compliance, hardware monitoring (optional), On-board PCI Sound |
| 42 | Sub-system(optional). Supports PC-100 DIMM Module. |
| 43 | |
| 44 | Key Features: |
| 45 | |
| 46 | Processor |
| 47 | - Full support for the Intel Pentium II & Intel Pentium III, Intel Celeron and Deschutes processors using Slot 1 connector. |
| 48 | - Slot 1 connector for Intel Pentium II & Intel Pentium III microprocessors. |
| 49 | - Supports 66MHz and 100MHz bus speed including all Pentium II & Pentium III processors and future processor. |
| 50 | |
| 51 | CPU Speed Setting |
| 52 | - Jumper setting or no jumper is needed to set for various speed of CPU (Factory optional). |
| 53 | |
| 54 | VRM (Voltage Regulator Modules) on Board |
| 55 | - Flexible motherboard design with on-board VRM 8.4, easy to upgrade with |
| 56 | Future Intel Pentium II & Pentium III processors. |
| 57 | |
| 58 | Cache |
| 59 | - Pentium II & Pentium III Processor built-in L2 cache. |
| 60 | |
| 61 | System Memory |
| 62 | - Up to 384MB (SDRAM) or 768MB (Registered SDRAM) - for 440BX. |
| 63 | - A total of three 168-pin DIMM sockets for 440BX. |
| 64 | - Supports SDRAM (only for 66MHz bus speed). |
| 65 | - Supports PC-100. |
| 66 | |
| 67 | Memory Organization |
| 68 | - Supports single-density DIMMs of 1MB, 2MB, 4MB, 8MB and 16MB depth (x64 or 72). |
| 69 | - Supports double-density DIMMs of 2MB, 4MB, 8MB, 16MB and 32MB depth |
| 70 | (x64 or 72). |
| 71 | - Supports error checking correction (ECC) using parity DRAM modules (for 440BX). |
| 72 | - Banks of different DRAM types depths can be mixed. |
| 73 | |
| 74 | Expansion Slots |
| 75 | - Supports SB-LINK Port for Creative Sound PCI Card. |
| 76 | - 1 AGP slot (ver. 1.0, 1x/2x mode supported). |
| 77 | - 5 PCI bus master slots (rev. 2.1 compliant, with 1 PCI slot sharing with 1 ISA slot) |
| 78 | - 2 ISA slots (1 ISA slot sharing with 1 PCI slot). |
| 79 | |
| 80 | On-Board I/O |
| 81 | - Two PCI fast IDE ports supporting up to 4 ATA2, Ultra DMA33 IDE HDDs, Ultra DMA66 (optional only for VIA Chipset) |
| 82 | IDE HDDs, CD-Roms, ZIP devices and LS-120 drives as boot drive. |
| 83 | - Supports bus master IDE, PIO mode 4 (up to 16M bytes/sec), Ultra DMA33 (up |
| 84 | to 33M bytes/sec) transfer. |
| 85 | - One ECP/EPP parallel port . |
| 86 | - Two 16550-compatible UART serial ports. |
| 87 | - One floppy port supporting two FDDs of 360KB, 720KB, 1.2MB, 1.44MB |
| 88 | or 2.88MB formated capacity. |
| 89 | - Two USB ports. |
| 90 | - PS/2 keyboard port. |
| 91 | - PS/2 mouse port. |
| 92 | - Infrared (IrDA) support (via a header). |
| 93 | - One Line / Speaker out, one Mic in, one Line in and MIDI / Gameport |
| 94 | |
| 95 | System BIOS |
| 96 | - 2MB flash BIOS supporting PnP, APM, ATAPI, ACPI and DMI; |
| 97 | - Jumper selection for 5V or 12V flash memory voltage. |
| 98 | - Auto detects and supports LBA hard disks with formatted capacities over |
| 99 | 8.4GB. |
| 100 | - Easily upgradable by end-user. |
| 101 | |
| 102 | Plug-and-Play |
| 103 | - Supports Plug-and-Play Specification 1.1. |
| 104 | - Plug-and-play for DOS, Windows 3.X, Windows 95 as well as Windows 98. |
| 105 | - Fully steerable PCI interrupts. |
| 106 | |
| 107 | Power Management |
| 108 | - Supports SMM, APM and ACPI. |
| 109 | - Break switch for instant suspend/resume on system operation. |
| 110 | - Energy star "Green PC" compliant . |
| 111 | - Supports WAKE-ON-LAN (WOL). |
| 112 | - Supports Wake on Ring for External Modem. |
| 113 | - Supports ATX specification 2.01. |
| 114 | |
| 115 | Creative PCI Sound (optional) |
| 116 | - Full DOS game support (DDMA, PC/PCI, CLS). |
| 117 | - PCI 2.1 Bus Master, hardware sound acceleration. |
| 118 | - Direct sound and sound Blaster Compatible. |
| 119 | - Full Duplex, 3D Enhancement, Software wavetable. |
| 120 | - PNP and APM 1.2 support. |
| 121 | - Win95/98, NT drivers ready. |
| 122 | |
| 123 | Keyboard Password Turn ON |
| 124 | - Special feature for system security. |
| 125 | |
| 126 | System monitoring (optional) |
| 127 | - Hardware monitoring circuitry is supported, provides voltages, temperature, fan speeds etc. monitoring. |
| 128 | |
| 129 | -- |
| 130 | |
| 131 | The donor PC looks like a standard Windows 98 setup. |
| 23 | 132 | The only exceptions we see are that there's a game logo.sys/logo.bmp in the |
| 24 | | root directory to hide the Windows98 startup screen, and a shortcut to |
| 133 | root directory to hide the Windows 98 startup screen, and a shortcut to |
| 25 | 134 | the game in the startup programs. |
| 26 | | Also of interest, Windows98 was installed from a setup folder on the HD. |
| 135 | Also of interest, Windows 98 was installed from a setup folder on the HD. |
| 27 | 136 | To me this hints that there may have been some expectation of the disk |
| 28 | 137 | being plugged into random hardware. |
| 29 | 138 | |
| 30 | | The game is pretty much standard PC game running on Windows98 PC. |
| 31 | | It uses DirectSound and the Microsoft MCI interfaces and Glide for video. |
| 139 | The game is pretty much a standard PC game running on a Windows 98 PC. |
| 140 | It uses DirectSound and the Microsoft MCI interfaces and 3dfx Glide for video. |
| 32 | 141 | The PC that the game was dumped from has Sound Blaster and Ensoniq drivers, |
| 33 | 142 | but it works fine with some other sound configurations. |
| 34 | | The donor PC has a 3dfxvoodoo3 driver installation directory, but it works |
| 143 | The donor PC has a "3dfxvoodoo3" driver installation directory, but it works |
| 35 | 144 | fine with a Voodoo4 4500. |
| 36 | 145 | |
| 37 | 146 | The game itself has some protection, it expects a file C:\\WINDOWS\win386p.swp of 84 bytes |
| 38 | 147 | to have the hard disk volume serial number in ascii number (not hex) format at offset 4. |
| 39 | 148 | |
| 40 | | The game appears to use parallel port (0x378,0x379)for I/O. |
| 41 | | The direct port access means it won't run on XP |
| 149 | The game appears to use parallel port (0x378,0x379) for I/O. |
| 150 | The direct port access means it won't run on XP. |
| 42 | 151 | For the controls, it writes a device select to 0x378, and reads the device value from 0x379. |
| 43 | 152 | There is some other output, maybe lights? |
| 44 | 153 | -------------------------------------------- |
| r243267 | r243268 | |
| 126 | 235 | |
| 127 | 236 | |
| 128 | 237 | ROM_START(comebaby) |
| 129 | | ROM_REGION32_LE(0x20000, "maincpu", 0) /* motherboard bios */ |
| 130 | | ROM_LOAD("comeonbaby.pcbios", 0x000000, 0x10000, NO_DUMP ) |
| 238 | ROM_REGION32_LE(0x80000, "maincpu", 0) /* motherboard bios */ |
| 239 | ROM_LOAD("b1120iag.bin", 0x000000, 0x40000, CRC(9b6f95f1) SHA1(65d6a2fea9911593f093b2e2a43d1534b54d60b3) ) |
| 131 | 240 | |
| 132 | 241 | DISK_REGION( "disks" ) |
| 133 | 242 | DISK_IMAGE( "comebaby", 0, SHA1(ea57919319c0b6a1d4abd7822cff028855bf082f) ) |
trunk/src/osd/sdl/video.c
| r243267 | r243268 | |
| 156 | 156 | #if defined(SDLMAME_WIN32) // Win32 version |
| 157 | 157 | MONITORINFOEX info; |
| 158 | 158 | info.cbSize = sizeof(info); |
| 159 | | GetMonitorInfo((HMONITOR)monitor->handle, (LPMONITORINFO)&info); |
| 160 | | monitor->m_dimensions.x = monitor->m_dimensions.y = 0; |
| 161 | | monitor->m_center_width = monitor->m_dimensions.w = info.rcMonitor.right - info.rcMonitor.left; |
| 162 | | monitor->m_center_height = monitor->m_dimensions.h = info.rcMonitor.bottom - info.rcMonitor.top; |
| 159 | GetMonitorInfo((HMONITOR)m_handle, (LPMONITORINFO)&info); |
| 160 | m_dimensions.x = m_dimensions.y = 0; |
| 161 | m_center_width = m_dimensions.w = info.rcMonitor.right - info.rcMonitor.left; |
| 162 | m_center_height = m_dimensions.h = info.rcMonitor.bottom - info.rcMonitor.top; |
| 163 | 163 | char *temp = utf8_from_wstring(info.szDevice); |
| 164 | | strcpy(monitor->monitor_device, temp); |
| 164 | strcpy(m_monitor_device, temp); |
| 165 | 165 | osd_free(temp); |
| 166 | 166 | #elif defined(SDLMAME_MACOSX) // Mac OS X Core Imaging version |
| 167 | 167 | CGDirectDisplayID primary; |
| r243267 | r243268 | |
| 171 | 171 | primary = CGMainDisplayID(); |
| 172 | 172 | dbounds = CGDisplayBounds(primary); |
| 173 | 173 | |
| 174 | | monitor->center_width = monitor->monitor_width = dbounds.size.width - dbounds.origin.x; |
| 175 | | monitor->center_height = monitor->monitor_height = dbounds.size.height - dbounds.origin.y; |
| 176 | | strcpy(monitor->monitor_device, "Mac OS X display"); |
| 174 | m_dimensions.x = m_dimensions.y = 0; |
| 175 | m_center_width = m_dimensions.w = dbounds.size.width - dbounds.origin.x; |
| 176 | m_center_height = m_dimensions.h = dbounds.size.height - dbounds.origin.y; |
| 177 | strcpy(m_monitor_device, "Mac OS X display"); |
| 177 | 178 | #elif defined(SDLMAME_X11) || defined(SDLMAME_NO_X11) // X11 version |
| 178 | 179 | { |
| 179 | 180 | #if defined(SDLMAME_X11) |
| r243267 | r243268 | |
| 185 | 186 | if ( SDL_GetWMInfo(&info) && (info.subsystem == SDL_SYSWM_X11) ) |
| 186 | 187 | { |
| 187 | 188 | screen = DefaultScreen(info.info.x11.display); |
| 188 | | SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1); |
| 189 | | monitor->monitor_width = DisplayWidth(info.info.x11.display, screen); |
| 190 | | monitor->monitor_height = DisplayHeight(info.info.x11.display, screen); |
| 189 | SDL_VideoDriverName(m_monitor_device, sizeof(m_monitor_device)-1); |
| 190 | m_dimensions.x = m_dimensions.y = 0; |
| 191 | m_dimensions.w = DisplayWidth(info.info.x11.display, screen); |
| 192 | m_dimensions.h = DisplayHeight(info.info.x11.display, screen); |
| 191 | 193 | |
| 192 | 194 | if ((XineramaIsActive(info.info.x11.display)) && video_config.restrictonemonitor) |
| 193 | 195 | { |
| r243267 | r243268 | |
| 196 | 198 | |
| 197 | 199 | xineinfo = XineramaQueryScreens(info.info.x11.display, &numscreens); |
| 198 | 200 | |
| 199 | | monitor->center_width = xineinfo[0].width; |
| 200 | | monitor->center_height = xineinfo[0].height; |
| 201 | m_center_width = xineinfo[0].width; |
| 202 | m_center_height = xineinfo[0].height; |
| 201 | 203 | |
| 202 | 204 | XFree(xineinfo); |
| 203 | 205 | } |
| 204 | 206 | else |
| 205 | 207 | { |
| 206 | | monitor->center_width = monitor->monitor_width; |
| 207 | | monitor->center_height = monitor->monitor_height; |
| 208 | m_center_width = m_dimensions.w; |
| 209 | m_center_height = m_dimensions.h; |
| 208 | 210 | } |
| 209 | 211 | } |
| 210 | 212 | else |
| r243267 | r243268 | |
| 213 | 215 | static int first_call=0; |
| 214 | 216 | static int cw = 0, ch = 0; |
| 215 | 217 | |
| 216 | | SDL_VideoDriverName(monitor->monitor_device, sizeof(monitor->monitor_device)-1); |
| 218 | SDL_VideoDriverName(m_monitor_device, sizeof(m_monitor_device)-1); |
| 217 | 219 | if (first_call==0) |
| 218 | 220 | { |
| 219 | 221 | const char *dimstr = osd_getenv(SDLENV_DESKTOPDIM); |
| r243267 | r243268 | |
| 233 | 235 | } |
| 234 | 236 | if ((cw==0) || (ch==0)) |
| 235 | 237 | { |
| 236 | | osd_printf_warning("WARNING: SDL_GetVideoInfo() for driver <%s> is broken.\n", monitor->monitor_device); |
| 238 | osd_printf_warning("WARNING: SDL_GetVideoInfo() for driver <%s> is broken.\n", m_monitor_device); |
| 237 | 239 | osd_printf_warning(" You should set SDLMAME_DESKTOPDIM to your desktop size.\n"); |
| 238 | 240 | osd_printf_warning(" e.g. export SDLMAME_DESKTOPDIM=800x600\n"); |
| 239 | 241 | osd_printf_warning(" Assuming 1024x768 now!\n"); |
| r243267 | r243268 | |
| 242 | 244 | } |
| 243 | 245 | } |
| 244 | 246 | } |
| 245 | | monitor->monitor_width = cw; |
| 246 | | monitor->monitor_height = ch; |
| 247 | | monitor->center_width = cw; |
| 248 | | monitor->center_height = ch; |
| 247 | m_dimensions.w = cw; |
| 248 | m_dimensions.h = ch; |
| 249 | m_center_width = cw; |
| 250 | m_center_height = ch; |
| 249 | 251 | } |
| 250 | 252 | } |
| 251 | 253 | #elif defined(SDLMAME_OS2) // OS2 version |
| 252 | | monitor->center_width = monitor->monitor_width = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN ); |
| 253 | | monitor->center_height = monitor->monitor_height = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN ); |
| 254 | | strcpy(monitor->monitor_device, "OS/2 display"); |
| 254 | m_dimensions.x = m_dimensions.y = 0; |
| 255 | m_center_width = m_dimensions.w = WinQuerySysValue( HWND_DESKTOP, SV_CXSCREEN ); |
| 256 | m_center_height = m_dimensions.h = WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN ); |
| 257 | strcpy(m_monitor_device, "OS/2 display"); |
| 255 | 258 | #else |
| 256 | 259 | #error Unknown SDLMAME_xx OS type! |
| 257 | 260 | #endif |
| r243267 | r243268 | |
| 260 | 263 | static int info_shown=0; |
| 261 | 264 | if (!info_shown) |
| 262 | 265 | { |
| 263 | | osd_printf_verbose("SDL Device Driver : %s\n", monitor->monitor_device); |
| 264 | | osd_printf_verbose("SDL Monitor Dimensions: %d x %d\n", monitor->monitor_width, monitor->monitor_height); |
| 266 | osd_printf_verbose("SDL Device Driver : %s\n", m_monitor_device); |
| 267 | osd_printf_verbose("SDL Monitor Dimensions: %d x %d\n", m_dimensions.w, m_dimensions.h); |
| 265 | 268 | info_shown = 1; |
| 266 | 269 | } |
| 267 | 270 | } |
| r243267 | r243268 | |
| 323 | 326 | //============================================================ |
| 324 | 327 | |
| 325 | 328 | #if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2) |
| 326 | | static void add_primary_monitor(void *data) |
| 329 | void sdl_monitor_info::add_primary_monitor(void *data) |
| 327 | 330 | { |
| 328 | 331 | sdl_monitor_info ***tailptr = (sdl_monitor_info ***)data; |
| 329 | 332 | sdl_monitor_info *monitor; |
| r243267 | r243268 | |
| 332 | 335 | monitor = global_alloc_clear(sdl_monitor_info); |
| 333 | 336 | |
| 334 | 337 | // copy in the data |
| 335 | | monitor->handle = 1; |
| 338 | monitor->m_handle = 1; |
| 336 | 339 | |
| 337 | | sdlvideo_monitor_refresh(monitor); |
| 340 | monitor->refresh(); |
| 338 | 341 | |
| 339 | 342 | // guess the aspect ratio assuming square pixels |
| 340 | | monitor->aspect = (float)(monitor->monitor_width) / (float)(monitor->monitor_height); |
| 343 | monitor->m_aspect = (float)(monitor->m_dimensions.w) / (float)(monitor->m_dimensions.h); |
| 341 | 344 | |
| 342 | 345 | // save the primary monitor handle |
| 343 | 346 | primary_monitor = monitor; |
| 344 | 347 | |
| 345 | 348 | // hook us into the list |
| 346 | 349 | **tailptr = monitor; |
| 347 | | *tailptr = &monitor->next; |
| 350 | *tailptr = &monitor->m_next; |
| 348 | 351 | } |
| 349 | 352 | #endif |
| 350 | 353 | |
| r243267 | r243268 | |
| 367 | 370 | assert(result); |
| 368 | 371 | (void)result; // to silence gcc 4.6 |
| 369 | 372 | |
| 370 | | // allocate a new monitor info |
| 371 | | monitor = global_alloc_clear(sdl_monitor_info); |
| 373 | // guess the aspect ratio assuming square pixels |
| 374 | float aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top); |
| 372 | 375 | |
| 373 | | // copy in the data |
| 374 | | |
| 375 | | #ifdef PTR64 |
| 376 | | monitor->handle = (UINT64)handle; |
| 377 | | #else |
| 378 | | monitor->handle = (UINT32)handle; |
| 379 | | #endif |
| 380 | | monitor->monitor_width = info.rcMonitor.right - info.rcMonitor.left; |
| 381 | | monitor->monitor_height = info.rcMonitor.bottom - info.rcMonitor.top; |
| 382 | | monitor->center_width = monitor->monitor_width; |
| 383 | | monitor->center_height = monitor->monitor_height; |
| 376 | // allocate a new monitor info |
| 384 | 377 | char *temp = utf8_from_wstring(info.szDevice); |
| 385 | | strcpy(monitor->monitor_device, temp); |
| 378 | // copy in the data |
| 379 | monitor = global_alloc(sdl_monitor_info((UINT64) handle, temp, aspect)); |
| 386 | 380 | osd_free(temp); |
| 387 | 381 | |
| 388 | | // guess the aspect ratio assuming square pixels |
| 389 | | monitor->aspect = (float)(info.rcMonitor.right - info.rcMonitor.left) / (float)(info.rcMonitor.bottom - info.rcMonitor.top); |
| 390 | | |
| 391 | 382 | // save the primary monitor handle |
| 392 | 383 | if (info.dwFlags & MONITORINFOF_PRIMARY) |
| 393 | | primary_monitor = monitor; |
| 384 | sdl_monitor_info::primary_monitor = monitor; |
| 394 | 385 | |
| 395 | 386 | // hook us into the list |
| 396 | 387 | **tailptr = monitor; |
| 397 | | *tailptr = &monitor->next; |
| 388 | *tailptr = &monitor->m_next; |
| 398 | 389 | |
| 399 | 390 | // enumerate all the available monitors so to list their names in verbose mode |
| 400 | 391 | return TRUE; |
| r243267 | r243268 | |
| 449 | 440 | |
| 450 | 441 | // hook us into the list |
| 451 | 442 | *tailptr = monitor; |
| 452 | | tailptr = &monitor->next; |
| 443 | tailptr = &monitor->m_next; |
| 453 | 444 | } |
| 454 | 445 | } |
| 455 | 446 | osd_printf_verbose("Leave init_monitors\n"); |
| r243267 | r243268 | |
| 466 | 457 | while (sdl_monitor_info::list != NULL) |
| 467 | 458 | { |
| 468 | 459 | sdl_monitor_info *temp = sdl_monitor_info::list; |
| 469 | | sdl_monitor_info::list = temp->next; |
| 460 | sdl_monitor_info::list = temp->next(); |
| 470 | 461 | global_free(temp); |
| 471 | 462 | } |
| 472 | 463 | } |
| r243267 | r243268 | |
| 498 | 489 | // look for a match in the name first |
| 499 | 490 | if (scrname != NULL) |
| 500 | 491 | { |
| 501 | | for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next) |
| 492 | for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next()) |
| 502 | 493 | { |
| 503 | 494 | moncount++; |
| 504 | 495 | if (strcmp(scrname, monitor->device()) == 0) |
| r243267 | r243268 | |
| 508 | 499 | |
| 509 | 500 | // didn't find it; alternate monitors until we hit the jackpot |
| 510 | 501 | index %= moncount; |
| 511 | | for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next) |
| 502 | for (monitor = sdl_monitor_info::list; monitor != NULL; monitor = monitor->next()) |
| 512 | 503 | if (index-- == 0) |
| 513 | 504 | goto finishit; |
| 514 | 505 | |
| r243267 | r243268 | |
| 523 | 514 | return monitor; |
| 524 | 515 | } |
| 525 | 516 | #else |
| 526 | | static sdl_monitor_info *pick_monitor(sdl_options &options, int index) |
| 517 | sdl_monitor_info *sdl_monitor_info::pick_monitor(sdl_options &options, int index) |
| 527 | 518 | { |
| 528 | 519 | sdl_monitor_info *monitor; |
| 529 | 520 | float aspect; |
| r243267 | r243268 | |
| 536 | 527 | |
| 537 | 528 | if (aspect != 0) |
| 538 | 529 | { |
| 539 | | monitor->aspect = aspect; |
| 530 | monitor->m_aspect = aspect; |
| 540 | 531 | } |
| 541 | 532 | return monitor; |
| 542 | 533 | } |
trunk/src/osd/sdl/video.h
| r243267 | r243268 | |
| 58 | 58 | int height; |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | // FIXME: This is sort of ugly ... and should be a real interface only |
| 61 | 62 | class sdl_monitor_info |
| 62 | 63 | { |
| 63 | 64 | public: |
| 64 | | sdl_monitor_info * next; // pointer to next monitor in list |
| 65 | 65 | |
| 66 | sdl_monitor_info() |
| 67 | : m_next(NULL), m_handle(0), m_aspect(0.0f), |
| 68 | m_center_width(0), m_center_height(0) |
| 69 | {} |
| 70 | sdl_monitor_info(const UINT64 handle, const char *monitor_device, float aspect) |
| 71 | : m_next(NULL), m_handle(handle), m_aspect(aspect), |
| 72 | m_center_width(0), m_center_height(0) |
| 73 | { |
| 74 | strncpy(m_monitor_device, monitor_device, 64); |
| 75 | refresh(); |
| 76 | } |
| 77 | |
| 66 | 78 | const UINT64 handle() { return m_handle; } |
| 67 | 79 | const SDL_Rect &position_size() { refresh(); return m_dimensions; } |
| 68 | 80 | |
| 69 | 81 | const char *device() { return m_monitor_device; } |
| 70 | 82 | |
| 71 | 83 | float aspect(); |
| 84 | |
| 72 | 85 | int center_width() { refresh(); return m_center_width; } |
| 73 | 86 | int center_height() { refresh(); return m_center_height; } |
| 74 | 87 | |
| r243267 | r243268 | |
| 78 | 91 | static void init(); |
| 79 | 92 | static void exit(); |
| 80 | 93 | static sdl_monitor_info *pick_monitor(sdl_options &options, int index); |
| 94 | #if !defined(SDLMAME_WIN32) && !(SDLMAME_SDL2) |
| 95 | static void add_primary_monitor(void *data); |
| 96 | #endif |
| 81 | 97 | |
| 98 | sdl_monitor_info * next() { return m_next; } // pointer to next monitor in list |
| 99 | |
| 100 | // STATIC |
| 101 | static sdl_monitor_info *primary_monitor; |
| 102 | static sdl_monitor_info *list; |
| 103 | |
| 104 | // FIXME: shouldn't be here - see windows enumeration callback |
| 105 | sdl_monitor_info * m_next; // pointer to next monitor in list |
| 82 | 106 | private: |
| 83 | 107 | void refresh(); |
| 84 | 108 | |
| r243267 | r243268 | |
| 89 | 113 | int m_center_width; // width of first physical screen for centering |
| 90 | 114 | int m_center_height; // height of first physical screen for centering |
| 91 | 115 | |
| 92 | | // STATIC |
| 93 | | static sdl_monitor_info *primary_monitor; |
| 94 | | static sdl_monitor_info *list; |
| 95 | 116 | |
| 96 | 117 | }; |
| 97 | 118 | |