int XQueryColor(Display* display, Colormap colormap, XColor* def_in_out)
| 1369 | |
| 1370 | // int XQueryColor(Display* display, Colormap colormap, XColor* def_in_out) |
| 1371 | static void x11_QueryColor(CPU* cpu) { |
| 1372 | KMemory* memory = cpu->memory; |
| 1373 | XServer* server = XServer::getServer(); |
| 1374 | XColorMapPtr colorMap = server->getColorMap(ARG2); |
| 1375 | |
| 1376 | if (!colorMap) { |
| 1377 | EAX = BadColor; |
| 1378 | return; |
| 1379 | } |
| 1380 | U32 colorAddress = ARG3; |
| 1381 | |
| 1382 | U32 index = memory->readd(colorAddress); |
| 1383 | if (index >= MAX_COLORMAP_SIZE) { |
| 1384 | EAX = BadValue; |
| 1385 | return; |
| 1386 | } |
| 1387 | XColorMapColor& c = colorMap->colors[index]; |
| 1388 | memory->writew(colorAddress + 4, (U16)(c.r << 8)); |
| 1389 | memory->writew(colorAddress + 6, (U16)(c.g << 8)); |
| 1390 | memory->writew(colorAddress + 8, (U16)(c.b << 8)); |
| 1391 | |
| 1392 | EAX = Success; |
| 1393 | } |
| 1394 | |
| 1395 | // Status XAllocColor(Display* display, Colormap colormap, XColor* screen_in_out) |
| 1396 | static void x11_AllocColor(CPU* cpu) { |
nothing calls this directly
no test coverage detected