mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
Fixed bug of 32-bit mode interface detection and save-restore mechanism
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2255 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
11001c4164
commit
a1856898dc
@ -153,7 +153,7 @@ int vbeSaveState(void **data)
|
||||
r.edx = 0x01;
|
||||
r.ecx = 0x0f;
|
||||
r.es = VirtToPhysSeg(rm_space);
|
||||
r.edi = VirtToPhysOff(rm_space);
|
||||
r.ebx = VirtToPhysOff(rm_space);
|
||||
if(!LRMI_int(0x10,&r))
|
||||
{
|
||||
LRMI_free_real(rm_space);
|
||||
@ -179,7 +179,7 @@ int vbeRestoreState(void *data)
|
||||
r.edx = 0x02;
|
||||
r.ecx = 0x0f;
|
||||
r.es = VirtToPhysSeg(data);
|
||||
r.edi = VirtToPhysOff(data);
|
||||
r.ebx = VirtToPhysOff(data);
|
||||
retval = LRMI_int(0x10,&r);
|
||||
LRMI_free_real(data);
|
||||
if(!retval) return VBE_VM86_FAIL;
|
||||
@ -208,7 +208,6 @@ int vbeGetWindow(unsigned *win_num)
|
||||
int vbeSetWindow(unsigned win_num,unsigned win_gran)
|
||||
{
|
||||
int retval;
|
||||
#if 0
|
||||
if(vbe_pm_info.SetWindowCall)
|
||||
{
|
||||
/* 32-bit function call is much better of int 10h */
|
||||
@ -217,10 +216,10 @@ int vbeSetWindow(unsigned win_num,unsigned win_gran)
|
||||
"movl %1, %%ebx\n"
|
||||
::"a"(0x4f05),"S"(win_num & 0x0f),"d"(win_gran):"memory");
|
||||
(*vbe_pm_info.SetWindowCall)();
|
||||
__asm __volatile("popl %%ebx":"=a"(retval)::"memory");
|
||||
__asm __volatile("popl %%ebx":::"memory");
|
||||
retval = VBE_OK;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
struct LRMI_regs r;
|
||||
memset(&r,0,sizeof(struct LRMI_regs));
|
||||
@ -229,8 +228,8 @@ int vbeSetWindow(unsigned win_num,unsigned win_gran)
|
||||
r.edx = win_gran;
|
||||
if(!LRMI_int(0x10,&r)) return VBE_VM86_FAIL;
|
||||
retval = r.eax & 0xffff;
|
||||
}
|
||||
if(retval == 0x4f) retval = VBE_OK;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
@ -246,6 +245,7 @@ int vbeGetProtModeInfo(struct VesaProtModeInterface *pm_info)
|
||||
{
|
||||
struct LRMI_regs r;
|
||||
int retval;
|
||||
unsigned info_offset;
|
||||
struct realVesaProtModeInterface *rm_info;
|
||||
memset(&r,0,sizeof(struct LRMI_regs));
|
||||
r.eax = 0x4f0a;
|
||||
@ -254,11 +254,12 @@ int vbeGetProtModeInfo(struct VesaProtModeInterface *pm_info)
|
||||
retval = r.eax & 0xffff;
|
||||
if(retval == 0x4f)
|
||||
{
|
||||
rm_info = PhysToVirtSO(r.es,r.edi&0xffff);
|
||||
pm_info->SetWindowCall = PhysToVirtSO(r.es,rm_info->SetWindowCall);
|
||||
pm_info->SetDisplayStart = PhysToVirtSO(r.es,rm_info->SetDisplayStart);
|
||||
pm_info->SetPaletteData = PhysToVirtSO(r.es,rm_info->SetPaletteData);
|
||||
pm_info->iopl_ports = PhysToVirtSO(r.es,rm_info->iopl_ports);
|
||||
info_offset = r.edi&0xffff;
|
||||
rm_info = PhysToVirtSO(r.es,info_offset);
|
||||
pm_info->SetWindowCall = PhysToVirtSO(r.es,info_offset+rm_info->SetWindowCall);
|
||||
pm_info->SetDisplayStart = PhysToVirtSO(r.es,info_offset+rm_info->SetDisplayStart);
|
||||
pm_info->SetPaletteData = PhysToVirtSO(r.es,info_offset+rm_info->SetPaletteData);
|
||||
pm_info->iopl_ports = PhysToVirtSO(r.es,info_offset+rm_info->iopl_ports);
|
||||
retval = VBE_OK;
|
||||
}
|
||||
return retval;
|
||||
|
@ -16,6 +16,12 @@ typedef struct tagFarPtr
|
||||
unsigned short seg;
|
||||
}FarPtr;
|
||||
|
||||
#define VBE_DAC_8BIT (1 << 0)
|
||||
#define VBE_NONVGA_CRTC (1 << 1)
|
||||
#define VBE_SNOWED_RAMDAC (1 << 2)
|
||||
#define VBE_STEREOSCOPIC (1 << 3)
|
||||
#define VBE_STEREO_EVC (1 << 4)
|
||||
|
||||
struct VbeInfoBlock {
|
||||
char VESASignature[4]; /* 'VESA' 4 byte signature */
|
||||
short VESAVersion; /* VBE version number */
|
||||
@ -23,7 +29,7 @@ struct VbeInfoBlock {
|
||||
long Capabilities; /* Capabilities of video card */
|
||||
unsigned short* VideoModePtr; /* Pointer to supported modes */
|
||||
short TotalMemory; /* Number of 64kb memory blocks */
|
||||
/* VBE 3.0 and above */
|
||||
/* VBE 2.0 and above */
|
||||
short OemSoftwareRev;
|
||||
char * OemVendorNamePtr;
|
||||
char * OemProductNamePtr;
|
||||
@ -170,7 +176,7 @@ struct VesaProtModeInterface
|
||||
void (*SetDisplayStart)(void);
|
||||
void (*SetPaletteData)(void);
|
||||
unsigned short * iopl_ports;
|
||||
}__attribute__ ((packed));
|
||||
};
|
||||
|
||||
/*
|
||||
All functions below return:
|
||||
@ -183,8 +189,8 @@ struct VesaProtModeInterface
|
||||
#define VBE_VM86_FAIL -1
|
||||
#define VBE_OUT_OF_DOS_MEM -2
|
||||
#define VBE_OUT_OF_MEM -3
|
||||
#define VBE_VESA_ERROR_MASK 0x4f00
|
||||
#define VBE_VESA_ERRCODE_MASK 0xff
|
||||
#define VBE_VESA_ERROR_MASK 0x004f
|
||||
#define VBE_VESA_ERRCODE_MASK 0xff00
|
||||
|
||||
extern int vbeInit( void );
|
||||
extern int vbeDetroy( void );
|
||||
|
Loading…
Reference in New Issue
Block a user