Skip to content

Latest commit

 

History

History
93 lines (74 loc) · 2.71 KB

viocalls.c

File metadata and controls

93 lines (74 loc) · 2.71 KB
 
Oct 27, 2016
Oct 27, 2016
1
#include "os2native16.h"
Sep 30, 2016
Sep 30, 2016
2
#include "viocalls.h"
Sep 30, 2016
Sep 30, 2016
3
Oct 27, 2016
Oct 27, 2016
4
5
6
APIRET16 VioGetMode(PVIOMODEINFO pvioModeInfo, HVIO hvio)
{
TRACE_NATIVE("VioGetMode(%p, %u)", pvioModeInfo, (uint) hvio);
Oct 27, 2016
Oct 27, 2016
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if (hvio != 0)
return ERROR_VIO_INVALID_HANDLE; // !!! FIXME: can be non-zero when VioCreatePS() is implemented.
else if (pvioModeInfo == NULL)
return ERROR_VIO_INVALID_PARMS;
else if (pvioModeInfo->cb != sizeof (*pvioModeInfo))
return ERROR_VIO_INVALID_LENGTH;
memset(pvioModeInfo, '\0', sizeof (*pvioModeInfo));
pvioModeInfo->cb = sizeof (*pvioModeInfo);
pvioModeInfo->fbType = VGMT_OTHER;
pvioModeInfo->color = 8; // bits?
pvioModeInfo->col = 80;
pvioModeInfo->row = 25;
FIXME("I don't know what most of these fields do");
//pvioModeInfo->hres = 640;
//pvioModeInfo->vres = 480;
//UCHAR fmt_ID;
//UCHAR attrib;
//ULONG buf_addr;
//ULONG buf_length;
//ULONG full_length;
//ULONG partial_length;
//PCHAR ext_data_addr;
return NO_ERROR;
Oct 27, 2016
Oct 27, 2016
33
34
35
36
37
38
39
40
41
} // VioGetMode
static APIRET16 bridge16to32_VioGetMode(uint8 *args)
{
const HVIO hvio = *((HVIO *) args); args += 2;
PVIOMODEINFO pvmi = (PVIOMODEINFO) GLoaderState->convert1616to32(*((uint32*) args)); //args += 4;
return VioGetMode(pvmi, hvio);
} // bridge16to32_VioGetMode
Oct 27, 2016
Oct 27, 2016
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
APIRET16 VioGetCurPos(PUSHORT pusRow, PUSHORT pusColumn, HVIO hvio)
{
TRACE_NATIVE("VioGetCurPos(%p, %p, %u)", pusRow, pusColumn, (uint) hvio);
if (hvio != 0)
return ERROR_VIO_INVALID_HANDLE; // !!! FIXME: can be non-zero when VioCreatePS() is implemented.
FIXME("write me");
if (pusRow)
*pusRow = 0;
if (pusColumn)
*pusColumn = 0;
return NO_ERROR;
} // VioGetCurPos
static APIRET16 bridge16to32_VioGetCurPos(uint8 *args)
{
const HVIO hvio = *((HVIO *) args); args += 2;
PUSHORT pusRow = GLoaderState->convert1616to32(*((uint32*) args)); args += 4;
PUSHORT pusColumn = GLoaderState->convert1616to32(*((uint32*) args)); args += 4;
return VioGetCurPos(pusRow, pusColumn, hvio);
} // bridge16to32_VioGetCurPos
LX_NATIVE_MODULE_16BIT_SUPPORT()
LX_NATIVE_MODULE_16BIT_API(VioGetCurPos)
LX_NATIVE_MODULE_16BIT_API(VioGetMode)
LX_NATIVE_MODULE_16BIT_SUPPORT_END()
LX_NATIVE_MODULE_DEINIT({
LX_NATIVE_MODULE_DEINIT_16BIT_SUPPORT();
})
static int initViocalls(void)
Oct 27, 2016
Oct 27, 2016
79
80
{
LX_NATIVE_MODULE_INIT_16BIT_SUPPORT()
Oct 27, 2016
Oct 27, 2016
81
LX_NATIVE_INIT_16BIT_BRIDGE(VioGetCurPos, 6)
Oct 27, 2016
Oct 27, 2016
82
83
84
85
86
LX_NATIVE_INIT_16BIT_BRIDGE(VioGetMode, 6)
LX_NATIVE_MODULE_INIT_16BIT_SUPPORT_END()
return 1;
} // initViocalls
Oct 27, 2016
Oct 27, 2016
87
88
LX_NATIVE_MODULE_INIT({ if (!initViocalls()) return NULL; })
LX_NATIVE_EXPORT16(VioGetCurPos, 9),
Oct 27, 2016
Oct 27, 2016
89
LX_NATIVE_EXPORT16(VioGetMode, 21)
Oct 2, 2016
Oct 2, 2016
90
LX_NATIVE_MODULE_INIT_END()
91
92
// end of viocalls.c ...