MCPcopy Create free account
hub / github.com/JHRobotics/softgpu / device_parse

Function device_parse

windrv.c:115–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115BOOL device_parse(const char *hw_ident, vga_device_t *dev)
116{
117 char *ptr;
118
119 if(strstr(hw_ident, "PCI\\") == hw_ident)
120 {
121 ptr = strstr(hw_ident, "VEN_");
122 if(ptr)
123 {
124 dev->pci.ven = strtoul(ptr+4, NULL, 16);
125 ptr = strstr(hw_ident, "DEV_");
126 if(ptr)
127 {
128 dev->pci.dev = strtoul(ptr+4, NULL, 16);
129 ptr = strstr(hw_ident, "SUBSYS_");
130 if(ptr)
131 {
132 dev->pci.subsys = strtoul(ptr+7, NULL, 16);
133 dev->pci.has_subsys = TRUE;
134 }
135 else
136 {
137 dev->pci.subsys = 0;
138 dev->pci.has_subsys = FALSE;
139 }
140
141 ptr = strstr(hw_ident, "CC_");
142 if(ptr)
143 {
144 //printf("class=%s\n", ptr);
145 dev->pci.cc = strtoul(ptr+3, NULL, 16);
146 }
147 else
148 {
149 dev->pci.cc = 0;
150 }
151
152 //printf("parsed: %04X %04X %08X\n", dev->pci.ven, dev->pci.dev, dev->pci.subsys);
153
154 dev->type = VGA_DEVICE_PCI;
155 return TRUE;
156 }
157 }
158 }
159 else if(strstr(hw_ident, "*PNP") == hw_ident)
160 {
161 dev->type = VGA_DEVICE_ISA;
162 dev->isa.pnp = strtoul(hw_ident+4, NULL, 16);
163 return TRUE;
164 }
165
166 return FALSE;
167}
168
169void device_str(vga_device_t *dev, char *buf, BOOL shorter)
170{

Callers 2

getVGAadapterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected