Changeset 2558 in vbox for trunk/src/VBox
- Timestamp:
- May 9, 2007 1:10:57 PM (18 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r2557 r2558 52 52 POINTL ptlOrg; // Where this display is anchored in 53 53 // the virtual desktop. 54 POINTL ptlDevOrg; // Device origin for DualView (0,0 for primary view).55 54 ULONG ulMode; // Mode the mini-port driver is in. 56 55 LONG lDeltaScreen; // Distance from one scan to the next. … … 116 115 } CLIPRECTS; 117 116 118 /** Escape codes used to communicate with the VBox display119 * driver from userland.120 */121 #define VBOX_ESC_QUERY_SUPPORT 1110122 117 123 118 BOOL vboxVbvaEnable (PPDEV ppdev); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/enable.c
r2557 r2558 26 26 { INDEX_DrvDisableSurface, (PFN) DrvDisableSurface }, // 4 27 27 { INDEX_DrvAssertMode, (PFN) DrvAssertMode }, // 5 28 { INDEX_DrvOffset, (PFN) DrvOffset }, // 6 28 29 { INDEX_DrvDisableDriver, (PFN) DrvDisableDriver }, // 8 29 30 { INDEX_DrvRealizeBrush, (PFN) DrvRealizeBrush }, // 12 … … 66 67 } 67 68 69 ULONG APIENTRY DrvEscape( 70 SURFOBJ *pso, 71 ULONG iEsc, 72 ULONG cjIn, 73 PVOID pvIn, 74 ULONG cjOut, 75 PVOID pvOut 76 ) 77 { 78 DISPDBG((0, "Experimental %s: %p, %p, %p, %p, %p, %p\n", __FUNCTION__, pso, iEsc, cjIn, pvIn, cjOut, pvOut)); 79 return 0; 80 } 81 68 82 BOOL DrvConnect (PVOID x1, PVOID x2, PVOID x3, PVOID x4) 69 83 { … … 124 138 DISPDBG((0, "Experimental %s: %p, %p, %p, %p\n", __FUNCTION__, dhpdev, pCallBacks, pSurfaceCallBacks, pPaletteCallBacks)); 125 139 return FALSE; 126 }127 128 /******************************Public*Routine******************************\129 * DrvEscape130 *131 * Called by GDI in response to user level ExtEscape() calls132 *133 * Currently unused, but could be useful if we needed to communicate with the134 * display driver and/or miniport from userspace apps.135 *136 \**************************************************************************/137 138 ULONG DrvEscape(139 SURFOBJ *pso,140 ULONG iEsc,141 ULONG cjIn,142 PVOID pvIn,143 ULONG cjOut,144 PVOID pvOut)145 {146 ULONG ulResult = 0;147 148 DISPDBG((0, "Experimental %s: %p, %p, %p, %p, %p, %p\n", __FUNCTION__, pso, iEsc, cjIn, pvIn, cjOut, pvOut));149 150 switch(iEsc)151 {152 case VBOX_ESC_QUERY_SUPPORT:153 DISPDBG((3, "VBOX_ESC_QUERY_SUPPORT (PSO = %p)\n", pso));154 ulResult = 1;155 break;156 default:157 DISPDBG((3, "unknown escape %d\n", iEsc));158 }159 return ulResult;160 140 } 161 141 … … 187 167 { INDEX_DrvSaveScreenBits, (PFN) DrvSaveScreenBits }, // 40 0x28 188 168 { INDEX_DrvGetModes, (PFN) DrvGetModes }, // 41 0x29 189 { INDEX_DrvNotify, (PFN) DrvNotify }, // 87 0x57190 169 // /* Experimental. */ 191 // { INDEX_DrvEscape, (PFN) DrvEscape }, // 24 0x18192 170 // { 0x7, (PFN) DrvResetPDEV }, // 0x7 193 171 // { 0x5b, (PFN) DrvNineGrid }, // 0x5b 194 172 // { 0x2b, (PFN) DrvDestroyFont }, // 0x2b 173 // { 0x18, (PFN) DrvEscape }, // 0x18 195 174 // { 0x4d, (PFN) DrvConnect }, // 0x4d 196 175 // { 0x4e, (PFN) DrvDisconnect }, // 0x4e … … 425 404 426 405 EngFreeMem(dhpdev); 406 } 407 408 /******************************Public*Routine******************************\ 409 * VOID DrvOffset 410 * 411 * DescriptionText 412 * 413 \**************************************************************************/ 414 415 BOOL DrvOffset( 416 SURFOBJ* pso, 417 LONG x, 418 LONG y, 419 FLONG flReserved) 420 { 421 PDEV* ppdev = (PDEV*) pso->dhpdev; 422 423 // Add back last offset that we subtracted. I could combine the next 424 // two statements, but I thought this was more clear. It's not 425 // performance critical anyway. 426 427 ppdev->pjScreen += ((ppdev->ptlOrg.y * ppdev->lDeltaScreen) + 428 (ppdev->ptlOrg.x * ((ppdev->ulBitCount+1) >> 3))); 429 430 // Subtract out new offset 431 432 ppdev->pjScreen -= ((y * ppdev->lDeltaScreen) + 433 (x * ((ppdev->ulBitCount+1) >> 3))); 434 435 ppdev->ptlOrg.x = x; 436 ppdev->ptlOrg.y = y; 437 438 return(TRUE); 427 439 } 428 440 … … 810 822 } 811 823 812 /******************************Public*Routine******************************\813 * DrvNotify814 *815 * Called by GDI to notify us of certain "interesting" events816 *817 * DN_DEVICE_ORIGIN is used to communicate the X/Y offsets of individual monitors818 * when DualView is in effect.819 *820 \**************************************************************************/821 822 VOID DrvNotify(823 SURFOBJ *pso,824 ULONG iType,825 PVOID pvData)826 {827 PDEV* ppdev = (PDEV*) pso->dhpdev;828 829 DISPDBG((0, "VBoxDisp::DrvNotify called.\n"));830 831 switch(iType)832 {833 case DN_DEVICE_ORIGIN:834 ppdev->ptlDevOrg = *(PPOINTL)pvData;835 DISPDBG((3, "DN_DEVICE_ORIGIN: %d, %d (PSO = %p)\n", ppdev->ptlDevOrg.x,836 ppdev->ptlDevOrg.y, pso));837 break;838 case DN_DRAWING_BEGIN:839 DISPDBG((3, "DN_DRAWING_BEGIN (PSO = %p)\n", pso));840 break;841 }842 } -
trunk/src/VBox/Devices/Storage/fdc.c
r2557 r2558 147 147 } fdisk_flags_t; 148 148 149 #ifdef VBOX150 typedef enum fdrive_drate_t {151 FDRIVE_RATE_500K = 0x00, /* 500 Kbps */152 FDRIVE_RATE_300K = 0x01, /* 300 Kbps */153 FDRIVE_RATE_250K = 0x02, /* 250 Kbps */154 FDRIVE_RATE_1M = 0x03 /* 1 Mbps */155 } fdrive_drate_t;156 #endif157 158 149 typedef struct fdrive_t { 159 150 #ifndef VBOX … … 181 172 /** The Diskette present/missing flag. */ 182 173 bool fMediaPresent; 183 /** Data rate required by media. */184 fdrive_drate_t media_rate;185 174 #endif 186 175 /* Drive status */ … … 285 274 fdrive_type_t drive; 286 275 fdisk_type_t disk; 287 fdrive_drate_t rate;288 276 uint8_t last_sect; 289 277 uint8_t max_track; … … 295 283 /* First entry is default format */ 296 284 /* 1.44 MB 3"1/2 floppy disks */ 297 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,18, 80, 1, "1.44 MB 3\"1/2", },298 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,20, 80, 1, "1.6 MB 3\"1/2", },299 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,21, 80, 1, "1.68 MB 3\"1/2", },300 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,21, 82, 1, "1.72 MB 3\"1/2", },301 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,21, 83, 1, "1.74 MB 3\"1/2", },302 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,22, 80, 1, "1.76 MB 3\"1/2", },303 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,23, 80, 1, "1.84 MB 3\"1/2", },304 { FDRIVE_DRV_144, FDRIVE_DISK_144, FDRIVE_RATE_500K,24, 80, 1, "1.92 MB 3\"1/2", },285 { FDRIVE_DRV_144, FDRIVE_DISK_144, 18, 80, 1, "1.44 MB 3\"1/2", }, 286 { FDRIVE_DRV_144, FDRIVE_DISK_144, 20, 80, 1, "1.6 MB 3\"1/2", }, 287 { FDRIVE_DRV_144, FDRIVE_DISK_144, 21, 80, 1, "1.68 MB 3\"1/2", }, 288 { FDRIVE_DRV_144, FDRIVE_DISK_144, 21, 82, 1, "1.72 MB 3\"1/2", }, 289 { FDRIVE_DRV_144, FDRIVE_DISK_144, 21, 83, 1, "1.74 MB 3\"1/2", }, 290 { FDRIVE_DRV_144, FDRIVE_DISK_144, 22, 80, 1, "1.76 MB 3\"1/2", }, 291 { FDRIVE_DRV_144, FDRIVE_DISK_144, 23, 80, 1, "1.84 MB 3\"1/2", }, 292 { FDRIVE_DRV_144, FDRIVE_DISK_144, 24, 80, 1, "1.92 MB 3\"1/2", }, 305 293 /* 2.88 MB 3"1/2 floppy disks */ 306 { FDRIVE_DRV_288, FDRIVE_DISK_288, FDRIVE_RATE_500K,36, 80, 1, "2.88 MB 3\"1/2", },307 { FDRIVE_DRV_288, FDRIVE_DISK_288, FDRIVE_RATE_500K,39, 80, 1, "3.12 MB 3\"1/2", },308 { FDRIVE_DRV_288, FDRIVE_DISK_288, FDRIVE_RATE_500K,40, 80, 1, "3.2 MB 3\"1/2", },309 { FDRIVE_DRV_288, FDRIVE_DISK_288, FDRIVE_RATE_500K,44, 80, 1, "3.52 MB 3\"1/2", },310 { FDRIVE_DRV_288, FDRIVE_DISK_288, FDRIVE_RATE_500K,48, 80, 1, "3.84 MB 3\"1/2", },294 { FDRIVE_DRV_288, FDRIVE_DISK_288, 36, 80, 1, "2.88 MB 3\"1/2", }, 295 { FDRIVE_DRV_288, FDRIVE_DISK_288, 39, 80, 1, "3.12 MB 3\"1/2", }, 296 { FDRIVE_DRV_288, FDRIVE_DISK_288, 40, 80, 1, "3.2 MB 3\"1/2", }, 297 { FDRIVE_DRV_288, FDRIVE_DISK_288, 44, 80, 1, "3.52 MB 3\"1/2", }, 298 { FDRIVE_DRV_288, FDRIVE_DISK_288, 48, 80, 1, "3.84 MB 3\"1/2", }, 311 299 /* 720 kB 3"1/2 floppy disks */ 312 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,9, 80, 1, "720 kB 3\"1/2", },313 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,10, 80, 1, "800 kB 3\"1/2", },314 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,10, 82, 1, "820 kB 3\"1/2", },315 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,10, 83, 1, "830 kB 3\"1/2", },316 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,13, 80, 1, "1.04 MB 3\"1/2", },317 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,14, 80, 1, "1.12 MB 3\"1/2", },300 { FDRIVE_DRV_144, FDRIVE_DISK_720, 9, 80, 1, "720 kB 3\"1/2", }, 301 { FDRIVE_DRV_144, FDRIVE_DISK_720, 10, 80, 1, "800 kB 3\"1/2", }, 302 { FDRIVE_DRV_144, FDRIVE_DISK_720, 10, 82, 1, "820 kB 3\"1/2", }, 303 { FDRIVE_DRV_144, FDRIVE_DISK_720, 10, 83, 1, "830 kB 3\"1/2", }, 304 { FDRIVE_DRV_144, FDRIVE_DISK_720, 13, 80, 1, "1.04 MB 3\"1/2", }, 305 { FDRIVE_DRV_144, FDRIVE_DISK_720, 14, 80, 1, "1.12 MB 3\"1/2", }, 318 306 /* 1.2 MB 5"1/4 floppy disks */ 319 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_500K,15, 80, 1, "1.2 kB 5\"1/4", },320 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_500K,18, 80, 1, "1.44 MB 5\"1/4", },321 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_500K,18, 82, 1, "1.48 MB 5\"1/4", },322 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_500K,18, 83, 1, "1.49 MB 5\"1/4", },323 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_500K,20, 80, 1, "1.6 MB 5\"1/4", },307 { FDRIVE_DRV_120, FDRIVE_DISK_288, 15, 80, 1, "1.2 kB 5\"1/4", }, 308 { FDRIVE_DRV_120, FDRIVE_DISK_288, 18, 80, 1, "1.44 MB 5\"1/4", }, 309 { FDRIVE_DRV_120, FDRIVE_DISK_288, 18, 82, 1, "1.48 MB 5\"1/4", }, 310 { FDRIVE_DRV_120, FDRIVE_DISK_288, 18, 83, 1, "1.49 MB 5\"1/4", }, 311 { FDRIVE_DRV_120, FDRIVE_DISK_288, 20, 80, 1, "1.6 MB 5\"1/4", }, 324 312 /* 720 kB 5"1/4 floppy disks */ 325 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_250K,9, 80, 1, "720 kB 5\"1/4", },326 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_250K,11, 80, 1, "880 kB 5\"1/4", },313 { FDRIVE_DRV_120, FDRIVE_DISK_288, 9, 80, 1, "720 kB 5\"1/4", }, 314 { FDRIVE_DRV_120, FDRIVE_DISK_288, 11, 80, 1, "880 kB 5\"1/4", }, 327 315 /* 360 kB 5"1/4 floppy disks */ 328 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_300K,9, 40, 1, "360 kB 5\"1/4", },329 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_300K,9, 40, 0, "180 kB 5\"1/4", },330 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_300K,10, 41, 1, "410 kB 5\"1/4", },331 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_300K,10, 42, 1, "420 kB 5\"1/4", },316 { FDRIVE_DRV_120, FDRIVE_DISK_288, 9, 40, 1, "360 kB 5\"1/4", }, 317 { FDRIVE_DRV_120, FDRIVE_DISK_288, 9, 40, 0, "180 kB 5\"1/4", }, 318 { FDRIVE_DRV_120, FDRIVE_DISK_288, 10, 41, 1, "410 kB 5\"1/4", }, 319 { FDRIVE_DRV_120, FDRIVE_DISK_288, 10, 42, 1, "420 kB 5\"1/4", }, 332 320 /* 320 kB 5"1/4 floppy disks */ 333 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_250K,8, 40, 1, "320 kB 5\"1/4", },334 { FDRIVE_DRV_120, FDRIVE_DISK_288, FDRIVE_RATE_250K,8, 40, 0, "160 kB 5\"1/4", },321 { FDRIVE_DRV_120, FDRIVE_DISK_288, 8, 40, 1, "320 kB 5\"1/4", }, 322 { FDRIVE_DRV_120, FDRIVE_DISK_288, 8, 40, 0, "160 kB 5\"1/4", }, 335 323 /* 360 kB must match 5"1/4 better than 3"1/2... */ 336 { FDRIVE_DRV_144, FDRIVE_DISK_720, FDRIVE_RATE_250K,9, 80, 0, "360 kB 3\"1/2", },324 { FDRIVE_DRV_144, FDRIVE_DISK_720, 9, 80, 0, "360 kB 3\"1/2", }, 337 325 /* end */ 338 { FDRIVE_DRV_NONE, FDRIVE_DISK_NONE, FDRIVE_RATE_1M,-1, -1, 0, NULL, },326 { FDRIVE_DRV_NONE, FDRIVE_DISK_NONE, -1, -1, 0, NULL, }, 339 327 }; 340 328 … … 417 405 drv->ro = ro; 418 406 #ifdef VBOX 419 drv->media_rate = parse->rate;420 407 drv->fMediaPresent = true; 421 408 #endif … … 478 465 static void fdctrl_write_data (fdctrl_t *fdctrl, uint32_t value); 479 466 static uint32_t fdctrl_read_dir (fdctrl_t *fdctrl); 480 #ifdef VBOX481 static void fdctrl_write_ccr (fdctrl_t *fdctrl, uint32_t value);482 #endif483 467 484 468 enum { … … 550 534 /* precompensation */ 551 535 uint8_t precomp_trk; 552 #ifdef VBOX553 /* data rate */554 uint8_t drate;555 #endif556 536 uint8_t config; 557 537 uint8_t lock; … … 625 605 fdctrl_write_data(fdctrl, value); 626 606 break; 627 #ifdef VBOX628 case 0x07:629 fdctrl_write_ccr(fdctrl, value);630 break;631 #endif632 607 default: 633 608 break; … … 774 749 /* Initialise controller */ 775 750 fdctrl->cur_drv = 0; 776 #ifdef VBOX777 fdctrl->drate = 2; /* Default to 250 Kbps*/778 #endif779 751 /* FIFO state */ 780 752 fdctrl->data_pos = 0; … … 951 923 } 952 924 /* // fdctrl.precomp = (value >> 2) & 0x07; */ 953 #ifdef VBOX954 fdctrl->drate = value & 0x03;955 #endif956 925 } 957 926 … … 978 947 return retval; 979 948 } 980 981 #ifdef VBOX982 /* Configuration control register : 0x07 (write) */983 static void fdctrl_write_ccr (fdctrl_t *fdctrl, uint32_t value)984 {985 FLOPPY_DPRINTF("configuration control register set to 0x%02x\n", value);986 fdctrl->drate = value & 0x03;987 }988 #endif989 949 990 950 /* FIFO state control */ … … 1100 1060 break; 1101 1061 } 1102 #ifdef VBOX1103 /* Check that selected data rate is correct.1104 * NB: Software may deduce media type from selected data rate, eg. 250Kbps1105 * in a 3.5" drive implies 720KB media, while 500Kbps implies 1.44MB.1106 */1107 if (fdctrl->drate != cur_drv->media_rate) {1108 FLOPPY_DPRINTF("Data rate mismatch (controller 0x%02x, media 0x%02x)\n", fdctrl->drate, cur_drv->media_rate);1109 fdctrl_stop_transfer(fdctrl, 0x40, 0x04, 0x00);1110 fdctrl->fifo[3] = kt;1111 fdctrl->fifo[4] = kh;1112 fdctrl->fifo[5] = ks;1113 return;1114 }1115 #endif1116 1062 /* Set the FIFO state */ 1117 1063 fdctrl->data_dir = direction; … … 2493 2439 qemu_put_8s (f, &s->timer1); 2494 2440 qemu_put_8s (f, &s->precomp_trk); 2495 qemu_put_8s (f, &s->drate);2496 2441 qemu_put_8s (f, &s->config); 2497 2442 qemu_put_8s (f, &s->lock); … … 2550 2495 qemu_get_8s (f, &s->timer1); 2551 2496 qemu_get_8s (f, &s->precomp_trk); 2552 qemu_get_8s (f, &s->drate);2553 2497 qemu_get_8s (f, &s->config); 2554 2498 qemu_get_8s (f, &s->lock);
Note:
See TracChangeset
for help on using the changeset viewer.