vbox的更動 49887 路徑 trunk/src/VBox/Devices/Graphics/DevVGA.cpp
- 時間撮記:
- 2013-12-12 下午03:10:49 (11 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r49884 r49887 112 112 #include <VBox/vmm/pgm.h> 113 113 #ifdef IN_RING3 114 # include <iprt/cdefs.h> 114 115 # include <iprt/alloc.h> 115 116 # include <iprt/ctype.h> … … 134 135 #endif 135 136 136 #include "vl_vbox.h"137 137 #include "VBoxDD.h" 138 138 #include "VBoxDD2.h" … … 1175 1175 1176 1176 /* called for accesses between 0xa0000 and 0xc0000 */ 1177 static uint32_t vga_mem_readb(PVGASTATE pThis, target_phys_addr_taddr, int *prc)1177 static uint32_t vga_mem_readb(PVGASTATE pThis, RTGCPHYS addr, int *prc) 1178 1178 { 1179 1179 int memory_map_mode, plane; … … 1256 1256 1257 1257 /* called for accesses between 0xa0000 and 0xc0000 */ 1258 static int vga_mem_writeb(PVGASTATE pThis, target_phys_addr_taddr, uint32_t val)1258 static int vga_mem_writeb(PVGASTATE pThis, RTGCPHYS addr, uint32_t val) 1259 1259 { 1260 1260 int memory_map_mode, plane, write_mode, b, func_select, mask; … … 2201 2201 addr = (addr & ~(1 << 16)) | ((y1 & 2) << 15); 2202 2202 } 2203 page0 = addr & TARGET_PAGE_MASK;2204 page1 = (addr + bwidth - 1) & TARGET_PAGE_MASK;2203 page0 = addr & ~PAGE_OFFSET_MASK; 2204 page1 = (addr + bwidth - 1) & ~PAGE_OFFSET_MASK; 2205 2205 bool update = full_update | vga_is_dirty(pThis, page0) | vga_is_dirty(pThis, page1); 2206 if (page1 - page0 > TARGET_PAGE_SIZE) {2206 if (page1 - page0 > PAGE_SIZE) { 2207 2207 /* if wide line, can use another page */ 2208 update |= vga_is_dirty(pThis, page0 + TARGET_PAGE_SIZE);2208 update |= vga_is_dirty(pThis, page0 + PAGE_SIZE); 2209 2209 } 2210 2210 /* explicit invalidation for the hardware cursor */ … … 2252 2252 /* reset modified pages */ 2253 2253 if (page_max != -1 && reset_dirty) { 2254 vga_reset_dirty(pThis, page_min, page_max + TARGET_PAGE_SIZE);2254 vga_reset_dirty(pThis, page_min, page_max + PAGE_SIZE); 2255 2255 } 2256 2256 memset(pThis->invalidated_y_table, 0, ((height + 31) >> 5) * 4); … … 2391 2391 } 2392 2392 2393 static void vga_save( QEMUFile *f, PVGASTATE pThis)2393 static void vga_save(PSSMHANDLE pSSM, PVGASTATE pThis) 2394 2394 { 2395 2395 int i; 2396 2396 2397 qemu_put_be32s(f, &pThis->latch);2398 qemu_put_8s(f, &pThis->sr_index);2399 qemu_put_buffer(f, pThis->sr, 8);2400 qemu_put_8s(f, &pThis->gr_index);2401 qemu_put_buffer(f, pThis->gr, 16);2402 qemu_put_8s(f, &pThis->ar_index);2403 qemu_put_buffer(f, pThis->ar, 21);2404 qemu_put_be32s(f, &pThis->ar_flip_flop);2405 qemu_put_8s(f, &pThis->cr_index);2406 qemu_put_buffer(f, pThis->cr, 256);2407 qemu_put_8s(f, &pThis->msr);2408 qemu_put_8s(f, &pThis->fcr);2409 qemu_put_8s(f, &pThis->st00);2410 qemu_put_8s(f, &pThis->st01);2411 2412 qemu_put_8s(f, &pThis->dac_state);2413 qemu_put_8s(f, &pThis->dac_sub_index);2414 qemu_put_8s(f, &pThis->dac_read_index);2415 qemu_put_8s(f, &pThis->dac_write_index);2416 qemu_put_buffer(f, pThis->dac_cache, 3);2417 qemu_put_buffer(f, pThis->palette, 768);2418 2419 qemu_put_be32s(f, &pThis->bank_offset);2397 SSMR3PutU32(pSSM, pThis->latch); 2398 SSMR3PutU8(pSSM, pThis->sr_index); 2399 SSMR3PutMem(pSSM, pThis->sr, 8); 2400 SSMR3PutU8(pSSM, pThis->gr_index); 2401 SSMR3PutMem(pSSM, pThis->gr, 16); 2402 SSMR3PutU8(pSSM, pThis->ar_index); 2403 SSMR3PutMem(pSSM, pThis->ar, 21); 2404 SSMR3PutU32(pSSM, pThis->ar_flip_flop); 2405 SSMR3PutU8(pSSM, pThis->cr_index); 2406 SSMR3PutMem(pSSM, pThis->cr, 256); 2407 SSMR3PutU8(pSSM, pThis->msr); 2408 SSMR3PutU8(pSSM, pThis->fcr); 2409 SSMR3PutU8(pSSM, pThis->st00); 2410 SSMR3PutU8(pSSM, pThis->st01); 2411 2412 SSMR3PutU8(pSSM, pThis->dac_state); 2413 SSMR3PutU8(pSSM, pThis->dac_sub_index); 2414 SSMR3PutU8(pSSM, pThis->dac_read_index); 2415 SSMR3PutU8(pSSM, pThis->dac_write_index); 2416 SSMR3PutMem(pSSM, pThis->dac_cache, 3); 2417 SSMR3PutMem(pSSM, pThis->palette, 768); 2418 2419 SSMR3PutU32(pSSM, pThis->bank_offset); 2420 2420 #ifdef CONFIG_BOCHS_VBE 2421 qemu_put_byte(f, 1);2422 qemu_put_be16s(f, &pThis->vbe_index);2421 SSMR3PutU8(pSSM, 1); 2422 SSMR3PutU16(pSSM, pThis->vbe_index); 2423 2423 for(i = 0; i < VBE_DISPI_INDEX_NB_SAVED; i++) 2424 qemu_put_be16s(f, &pThis->vbe_regs[i]);2425 qemu_put_be32s(f, &pThis->vbe_start_addr);2426 qemu_put_be32s(f, &pThis->vbe_line_offset);2424 SSMR3PutU16(pSSM, pThis->vbe_regs[i]); 2425 SSMR3PutU32(pSSM, pThis->vbe_start_addr); 2426 SSMR3PutU32(pSSM, pThis->vbe_line_offset); 2427 2427 #else 2428 qemu_put_byte(f, 0);2428 SSMR3PutU8(pSSM, 0); 2429 2429 #endif 2430 2430 } 2431 2431 2432 static int vga_load( QEMUFile *f, PVGASTATE pThis, int version_id)2432 static int vga_load(PSSMHANDLE pSSM, PVGASTATE pThis, int version_id) 2433 2433 { 2434 2434 int is_vbe, i; 2435 2435 uint32_t u32Dummy; 2436 2437 qemu_get_be32s(f, &pThis->latch); 2438 qemu_get_8s(f, &pThis->sr_index); 2439 qemu_get_buffer(f, pThis->sr, 8); 2440 qemu_get_8s(f, &pThis->gr_index); 2441 qemu_get_buffer(f, pThis->gr, 16); 2442 qemu_get_8s(f, &pThis->ar_index); 2443 qemu_get_buffer(f, pThis->ar, 21); 2444 qemu_get_be32s(f, (uint32_t *)&pThis->ar_flip_flop); 2445 qemu_get_8s(f, &pThis->cr_index); 2446 qemu_get_buffer(f, pThis->cr, 256); 2447 qemu_get_8s(f, &pThis->msr); 2448 qemu_get_8s(f, &pThis->fcr); 2449 qemu_get_8s(f, &pThis->st00); 2450 qemu_get_8s(f, &pThis->st01); 2451 2452 qemu_get_8s(f, &pThis->dac_state); 2453 qemu_get_8s(f, &pThis->dac_sub_index); 2454 qemu_get_8s(f, &pThis->dac_read_index); 2455 qemu_get_8s(f, &pThis->dac_write_index); 2456 qemu_get_buffer(f, pThis->dac_cache, 3); 2457 qemu_get_buffer(f, pThis->palette, 768); 2458 2459 qemu_get_be32s(f, (uint32_t *)&pThis->bank_offset); 2460 is_vbe = qemu_get_byte(f); 2436 uint8_t u8; 2437 2438 SSMR3GetU32(pSSM, &pThis->latch); 2439 SSMR3GetU8(pSSM, &pThis->sr_index); 2440 SSMR3GetMem(pSSM, pThis->sr, 8); 2441 SSMR3GetU8(pSSM, &pThis->gr_index); 2442 SSMR3GetMem(pSSM, pThis->gr, 16); 2443 SSMR3GetU8(pSSM, &pThis->ar_index); 2444 SSMR3GetMem(pSSM, pThis->ar, 21); 2445 SSMR3GetU32(pSSM, (uint32_t *)&pThis->ar_flip_flop); 2446 SSMR3GetU8(pSSM, &pThis->cr_index); 2447 SSMR3GetMem(pSSM, pThis->cr, 256); 2448 SSMR3GetU8(pSSM, &pThis->msr); 2449 SSMR3GetU8(pSSM, &pThis->fcr); 2450 SSMR3GetU8(pSSM, &pThis->st00); 2451 SSMR3GetU8(pSSM, &pThis->st01); 2452 2453 SSMR3GetU8(pSSM, &pThis->dac_state); 2454 SSMR3GetU8(pSSM, &pThis->dac_sub_index); 2455 SSMR3GetU8(pSSM, &pThis->dac_read_index); 2456 SSMR3GetU8(pSSM, &pThis->dac_write_index); 2457 SSMR3GetMem(pSSM, pThis->dac_cache, 3); 2458 SSMR3GetMem(pSSM, pThis->palette, 768); 2459 2460 SSMR3GetU32(pSSM, (uint32_t *)&pThis->bank_offset); 2461 SSMR3GetU8(pSSM, &u8); 2462 is_vbe = !!u8; 2461 2463 #ifdef CONFIG_BOCHS_VBE 2462 2464 if (!is_vbe) … … 2465 2467 return VERR_SSM_DATA_UNIT_FORMAT_CHANGED; 2466 2468 } 2467 qemu_get_be16s(f, &pThis->vbe_index);2469 SSMR3GetU16(pSSM, &pThis->vbe_index); 2468 2470 for(i = 0; i < VBE_DISPI_INDEX_NB_SAVED; i++) 2469 qemu_get_be16s(f, &pThis->vbe_regs[i]);2471 SSMR3GetU16(pSSM, &pThis->vbe_regs[i]); 2470 2472 if (version_id <= VGA_SAVEDSTATE_VERSION_INV_VHEIGHT) 2471 2473 recalculate_data(pThis, false); /* <- re-calculate the pThis->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] since it might be invalid */ 2472 qemu_get_be32s(f, &pThis->vbe_start_addr);2473 qemu_get_be32s(f, &pThis->vbe_line_offset);2474 SSMR3GetU32(pSSM, &pThis->vbe_start_addr); 2475 SSMR3GetU32(pSSM, &pThis->vbe_line_offset); 2474 2476 if (version_id < 2) 2475 qemu_get_be32s(f, &u32Dummy);2477 SSMR3GetU32(pSSM, &u32Dummy); 2476 2478 pThis->vbe_bank_max = (pThis->vram_size >> 16) - 1; 2477 2479 #else
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器