This commit is contained in:
Scott Duensing 2026-08-25 16:44:58 -05:00
parent 5527130145
commit c40b596968
4 changed files with 84 additions and 6 deletions

View file

@ -100,7 +100,39 @@
"Bash(msexpand:*)", "Bash(msexpand:*)",
"Bash(import -window root /tmp/dosbox_video/et4000_demo.png)", "Bash(import -window root /tmp/dosbox_video/et4000_demo.png)",
"Bash(git lfs:*)", "Bash(git lfs:*)",
"Bash(while read f)" "Bash(while read f)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(git push:*)",
"Bash(import:*)",
"Bash(xdotool search:*)",
"Bash(xargs:*)",
"Bash(scrot:*)",
"Bash(grep:*)",
"Bash(/tmp/dosbox_ttf_test.conf:*)",
"Bash(/tmp/dosbox_vbesvga_test.conf:*)",
"Bash(git reset:*)",
"Bash(/tmp/dosbox_demo8.conf:*)",
"Bash(DISPLAY=:0 python3:*)",
"Bash(flatpak kill:*)",
"WebFetch(domain:gitlab.winehq.org)",
"Bash(wmctrl -l:*)",
"Bash(WID=81788948)",
"Bash(xdotool windowactivate:*)",
"Bash(gnome-screenshot:*)",
"Bash(xdotool key:*)",
"Bash(# Check where DOSBox-X saves screenshots find ~/.var/app/com.dosbox_x.DOSBox-X -name \"\"*.png\"\")",
"Bash(xdpyinfo:*)",
"Bash(DISPLAY=:0 xdotool:*)",
"Bash(DISPLAY=:0 xwd:*)",
"Bash(convert:*)",
"Bash(export:*)",
"WebFetch(domain:rndtrash.github.io)",
"WebFetch(domain:www.compuphase.com)",
"WebFetch(domain:www.cs.odu.edu)",
"WebFetch(domain:eisbox.net)",
"WebFetch(domain:lospec.com)",
"WebFetch(domain:chalier.fr)"
] ]
} }
} }

View file

@ -93,6 +93,9 @@ uint32_t color = wdrvGetPixel(drv, x, y);
Point16T pts[] = {{0, 0}, {100, 100}}; Point16T pts[] = {{0, 0}, {100, 100}};
wdrvPolyline(drv, pts, 2, MAKE_RGB(0, 0, 255)); wdrvPolyline(drv, pts, 2, MAKE_RGB(0, 0, 255));
// Rectangle outline
wdrvRectangle(drv, 10, 10, 100, 50, MAKE_RGB(255, 255, 0));
// Screen-to-screen blit // Screen-to-screen blit
WdrvBitBltParamsT bp = { .srcX=0, .srcY=0, .dstX=320, .dstY=240, WdrvBitBltParamsT bp = { .srcX=0, .srcY=0, .dstX=320, .dstY=240,
.width=160, .height=120, .rop3=SRCCOPY }; .width=160, .height=120, .rop3=SRCCOPY };
@ -103,6 +106,26 @@ void *fb = wdrvGetFramebuffer(drv);
int32_t pitch = wdrvGetPitch(drv); int32_t pitch = wdrvGetPitch(drv);
``` ```
### Text Rendering
```c
// Opaque text: white on blue (built-in 8x16 font)
wdrvExtTextOut(drv, 10, 10, "Hello", 5,
MAKE_RGB(255, 255, 255), MAKE_RGB(0, 0, 170), true, NULL);
// Load and use a TrueType font
WdrvFontT ttf = wdrvLoadFontTtf("LIBSANS.TTF", 20);
wdrvExtTextOut(drv, 10, 30, "TrueType", 8,
MAKE_RGB(255, 255, 0), MAKE_RGB(0, 0, 0), true, ttf);
wdrvUnloadFont(ttf);
// Load from Windows .FON file
WdrvFontT fon = wdrvLoadFontFon("COURE.FON", 1);
wdrvExtTextOut(drv, 10, 50, "Courier", 7,
MAKE_RGB(0, 255, 255), MAKE_RGB(0, 0, 0), true, fon);
wdrvUnloadFont(fon);
```
### Error Handling ### Error Handling
All functions return `WDRV_OK` (0) on success or a negative error code. All functions return `WDRV_OK` (0) on success or a negative error code.
@ -234,8 +257,8 @@ wait for the graphics engine to become idle between operations.
| File | Lines | Description | | File | Lines | Description |
|---|---|---| |---|---|---|
| `windrv.h` | 189 | Public API: initialization, driver loading, drawing, errors | | `windrv.h` | 250 | Public API: initialization, driver loading, drawing, errors |
| `windrv.c` | 3223 | DDI wrappers, GDI object management, interrupt handlers, binary patching | | `windrv.c` | 4478 | DDI wrappers, GDI object management, interrupt handlers, binary patching |
| `neload.h` | 118 | NE loader API | | `neload.h` | 118 | NE loader API |
| `neload.c` | 962 | NE format parser: headers, segments, relocations, exports | | `neload.c` | 962 | NE format parser: headers, segments, relocations, exports |
| `neformat.h` | 215 | NE/MZ header structures, segment/relocation/entry table formats, DDI ordinals | | `neformat.h` | 215 | NE/MZ header structures, segment/relocation/entry table formats, DDI ordinals |
@ -243,7 +266,7 @@ wait for the graphics engine to become idle between operations.
| `thunk.c` | 1021 | 32/16-bit relay, callback dispatch, DOS memory management | | `thunk.c` | 1021 | 32/16-bit relay, callback dispatch, DOS memory management |
| `winstub.h` | 257 | Stub declarations, KERNEL/GDI/USER/DIBENG ordinal constants | | `winstub.h` | 257 | Stub declarations, KERNEL/GDI/USER/DIBENG ordinal constants |
| `winstub.c` | 1400 | ~80 Windows API stub implementations | | `winstub.c` | 1400 | ~80 Windows API stub implementations |
| `winddi.h` | 261 | DDI structures: GDIINFO, PDEVICE, DRAWMODE, brushes, pens | | `winddi.h` | 334 | DDI structures: GDIINFO, PDEVICE, DRAWMODE, brushes, pens, fonts |
| `wintypes.h` | 153 | Win16 basic types, far pointers, colors, ROP codes | | `wintypes.h` | 153 | Win16 basic types, far pointers, colors, ROP codes |
| `log.h` | 37 | Logging API | | `log.h` | 37 | Logging API |
| `log.c` | 83 | Log file output | | `log.c` | 83 | Log file output |
@ -252,12 +275,14 @@ wait for the graphics engine to become idle between operations.
| File | Description | | File | Description |
|---|---| |---|---|
| `demo.c` | Demo program: loads driver, draws rectangles/pixels/lines/blits | | `demo.c` | Demo program: rectangles, pixels, lines, blits, text, fonts, colors |
| `Makefile` | Top-level build: compiles demo, links with libwindrv.a | | `Makefile` | Top-level build: compiles demo, links with libwindrv.a |
| `win31drv/Makefile` | Library build: compiles sources into libwindrv.a | | `win31drv/Makefile` | Library build: compiles sources into libwindrv.a |
| `dosbox-x.conf` | DOSBox-X configuration for S3 Trio64 testing | | `dosbox-x.conf` | DOSBox-X configuration for S3 Trio64 testing |
| `tools/TEST.BAT` | Quick-test batch file for DOSBox-X | | `tools/TEST.BAT` | Quick-test batch file for DOSBox-X |
| `drivers/*.DRV` | Windows 3.x display driver binaries | | `drivers/*.DRV` | Windows 3.x display driver binaries |
| `fon/*.FON` | Windows 3.x bitmap fonts (.FON containers) |
| `ttf/*.TTF` | TrueType fonts (Liberation family) |
| `tools/cwsdpmi.zip` | CWSDPMI DPMI host (extracted during build) | | `tools/cwsdpmi.zip` | CWSDPMI DPMI host (extracted during build) |
| `tools/lib/libfl.so.2` | Shared library needed by DJGPP binutils | | `tools/lib/libfl.so.2` | Shared library needed by DJGPP binutils |
@ -267,7 +292,6 @@ wait for the graphics engine to become idle between operations.
GDIINFO reports 640x480. Drawing works within the 640x480 region. GDIINFO reports 640x480. Drawing works within the 640x480 region.
- **ET4000 is software-only**: DOSBox-X does not emulate the ET4000 - **ET4000 is software-only**: DOSBox-X does not emulate the ET4000
accelerator engine; all drawing is CPU-rendered by the driver. accelerator engine; all drawing is CPU-rendered by the driver.
- **No text output**: ExtTextOut is not yet wired up.
- **Single driver instance**: Only one driver can be loaded at a time. - **Single driver instance**: Only one driver can be loaded at a time.
## License ## License

View file

@ -190,6 +190,20 @@ typedef struct __attribute__((packed)) {
int16_t csColor; // Planes * bitsPixel int16_t csColor; // Planes * bitsPixel
} CursorInfo16T; } CursorInfo16T;
// ============================================================================
// BITMAP - Off-screen bitmap descriptor (passed to CreateBitmap/BitmapBits)
// ============================================================================
typedef struct __attribute__((packed)) {
int16_t bmType; // 0 = memory bitmap
int16_t bmWidth; // Width in pixels
int16_t bmHeight; // Height in pixels
int16_t bmWidthBytes; // Bytes per scan line
uint8_t bmPlanes; // Number of color planes
uint8_t bmBitsPixel; // Bits per pixel
uint32_t bmBits; // Far pointer to bits (seg:off as DWORD)
} Bitmap16T;
// ============================================================================ // ============================================================================
// Enable() style parameter values // Enable() style parameter values
// ============================================================================ // ============================================================================

View file

@ -1056,6 +1056,14 @@ static uint32_t stubGetPrivateProfileString(uint16_t *p, uint16_t n)
result = "on"; result = "on";
} else if (strcasecmp(key, "ELLIPSE-SUPPORT") == 0) { } else if (strcasecmp(key, "ELLIPSE-SUPPORT") == 0) {
result = "on"; result = "on";
} else if (strcasecmp(key, "HWPOLYGON-SUPPORT") == 0) {
result = "on";
} else if (strcasecmp(key, "HWPOLYLINE-SUPPORT") == 0) {
result = "on";
} else if (strcasecmp(key, "HARDWARE-SCANLINES") == 0) {
result = "on";
} else if (strcasecmp(key, "HARDWARE-POLYLINES") == 0) {
result = "on";
} else if (strcasecmp(key, "SCACHE") == 0) { } else if (strcasecmp(key, "SCACHE") == 0) {
result = "on"; result = "on";
} else if (strcasecmp(key, "TEXTRMW") == 0) { } else if (strcasecmp(key, "TEXTRMW") == 0) {