Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMDFIFO writes with len = 8 and 16 #216

Closed
Vort opened this issue Jan 12, 2024 · 2 comments
Closed

CMDFIFO writes with len = 8 and 16 #216

Vort opened this issue Jan 12, 2024 · 2 comments

Comments

@Vort
Copy link
Contributor

Vort commented Jan 12, 2024

In attempts to find which Voodoo 3 driver works best with Windows XP, I installed AmigaSport V3.0 WinXP/Win2K.
After software starts 3D rendering (for example Half-Life in OpenGL mode), Bochs logs begins to fill with messages like
CMDFIFO #0 write with len = 8 redirected to LFB
CMDFIFO #0 write with len = 16 redirected to LFB
I made hackfix and it allowed Half-Life to work, but something more robust should be implemented.
Also my tests were made with latest hack from #178 included, I don't know if it is required for AmigaSport driver.

diff --git a/bochs/iodev/display/banshee.cc b/bochs/iodev/display/banshee.cc
index b63d0f001..130bfef21 100644
--- a/bochs/iodev/display/banshee.cc
+++ b/bochs/iodev/display/banshee.cc
@@ -962,7 +962,15 @@ void bx_banshee_c::mem_write(bx_phy_address addr, unsigned len, void *data)
     if (v->fbi.cmdfifo[0].enabled && (offset >= v->fbi.cmdfifo[0].base) &&
         (offset < v->fbi.cmdfifo[0].end)) {
       if (len == 4) {
-        cmdfifo_w(&v->fbi.cmdfifo[0], offset, value);
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 0, *((Bit32u*)data + 0));
+      } else if (len == 8) {
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 0, *((Bit32u*)data + 0));
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 4, *((Bit32u*)data + 1));
+      } else if (len == 16) {
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 0, *((Bit32u*)data + 0));
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 4, *((Bit32u*)data + 1));
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 8, *((Bit32u*)data + 2));
+        cmdfifo_w(&v->fbi.cmdfifo[0], offset + 12, *((Bit32u*)data + 3));
       } else {
         BX_ERROR(("CMDFIFO #0 write with len = %d redirected to LFB", len));
         mem_write_linear(offset, value, len); 

Version: 1679428.

@vruppert
Copy link
Contributor

Please try the latest Banshee code, since I have no test case here. It doesn't include the changes in other files.

@Vort
Copy link
Contributor Author

Vort commented Jan 12, 2024

Looks like success. Thank you.

image

@Vort Vort closed this as completed Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants