VOGONS

Common searches


Reply 21 of 90, by augnober

User metadata
Rank Member
Rank
Member

h-a-l-9000:
I like this patch a lot. I've been trying it on some demos, and some of my own apps.. and also integrated it with the vsync patch I was working on. Here's a small bug report.

Update: I think it's not a real bug afterall. In fact, I think your patch fixed dosbox to work more like real hardware. After looking through the write_p3c0() code in vga_attr.cpp, I noticed that my code probably should be outputting 0x33 to 0x3c0 instead of 0x13. After making that change, my apps work fine under your patch. I'd still be curious to see what happens on real hardware though to be sure. The rest below was written before this update.

I noticed that it breaks the rendering of my vsync test apps. I already had them attached on the forums at the following location, as a part of the vsync patch diff (source for vsync.com is distributed too.. and forever.com is 45 bytes and hence readable/debuggable):
download link-
download.php?id=2439
thread link (first page, second post from bottom)-
Vertical retrace sync patch

It's because when I just modify the horizontal pel scrolling register and wait for retrace, VGA_DrawSingleLine() draws black rows instead of the row contents. I noticed this comment - "TODO else draw overscan color line black line should be good enough for now (DoWhackaDo)". If I remove the DoWhackaDo case from the code (and instead always use the 'vga.attr.enabled' case), then the apps work perfectly.

It would be best to test the apps on a real system too of course. I've only ever run them in Dosbox. So until it is tried on a real machine, I have to accept the possibility that your changes may have actually caused it to work correctly for the first time 😉

Reply 22 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I just tested it in real hardware before reading your update - vsync.com doesn't work there.
My suggested fix is to write 0x20 to 3c0 after you are done updating the PEL. Writing 0x33 is illegal I think.

1+1=10

Reply 23 of 90, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

The patch doesn't work well anymore. With latest CVS, I get random crashes (weird ones, looking like buffer overflows) or misbehaviour (patch simply stopping to work). Has something important changed?

Since the crashes are not happening at the place they are caused, I had no luck tracking them down with gdb.

Reply 24 of 90, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Writing 0x33 is illegal I think.

I've seen this done in some ega bios though, not sure what it's
supposed to do but it looks like the value should be changed
accordingly and the protection set after that (like 0x20 does).
Doesn't make too much sense to me though.

Reply 25 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Illegal might have been the wrong word - just having the 0x20 bit set disables screen output. So if we want to see something we should always clear it after writing the other registers. The DoWhackaDo demo uses it to hide a part of the screen that would otherwise look corrupted.

I'm attaching the re-merged patch which works for me. Might be some patching problem?

Attachments

  • Filename
    demovga2.diff
    File size
    21.42 KiB
    Downloads
    57 downloads
    File license
    Fair use/fair dealing exception

Reply 26 of 90, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Tried it, behaves a bit better, but still not good enough:

Tried latest CVS, core normal or dynamic, cycles max or 2000, X-Mas Lemmings. Mission briefing shows up correct (top half: winter palette, bottom half: brownish one), but it still reliably crashes at some mode switch. No crash with the same executable and machine=vga.

Note that this is a 64-bit build on a high-end dual core machine.

Reply 27 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

crashes at some mode switch.

Good hint - maybe adding PIC_RemoveEvents(VGA_DrawSingleLine); in vga_draw.cpp line 1119 helps?

if (( width != vga.draw.width) || (height != vga.draw.height) ||
(aspect_ratio != vga.draw.aspect_ratio) ||
(vga.mode != vga.lastmode)) {
vga.lastmode = vga.mode;
PIC_RemoveEvents(VGA_VerticalTimer);
PIC_RemoveEvents(VGA_VerticalDisplayEnd);
PIC_RemoveEvents(VGA_DrawPart);
PIC_RemoveEvents(VGA_DrawSingleLine);
vga.draw.width = width;
vga.draw.height = height;
vga.draw.doublewidth = doublewidth;

Reply 29 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

In VGA_KillDrawing too?

If you really like that patch maybe try to comment out the "if(!vga.demomode) {" in render.cpp. It will break the output but maybe it doesn't crash anymore. I didn't really know what I did there 😉

Or change the

typedef struct {
struct {
Bit8u red;
Bit8u green;
Bit8u blue;
Bit8u unused;
} rgb[256];
union {
Bit16u b16[256];
Bit32u b32[256];
} lut;
bool changed;
Bit8u modified[256];
Bitu first;
Bitu last;
} RenderPal_t;

the 256 to higher values.

Reply 30 of 90, by `Moe`

User metadata
Rank Oldbie
Rank
Oldbie

Got it!

In vga_draw.c, at the end of VGA_DrawSingleLine, I added a check for vga.draw.resizing, and while it is not a proper fix, it demonstrates the problem:

    if (!vga.draw.resizing && vga.draw.lines_done < vga.draw.lines_total) {
if(readd) PIC_AddEvent(VGA_DrawSingleLine,vga.draw.delay.virtline);

} else {
RENDER_EndUpdate();
}

I don't have a complete overview of the vga hardware emulation, but it seems to be a race condition. Dual-core is the key: SDL event handlers run in a different thread on Linux (I checked that with gdb), so a race condition with the main emulation loop is possible, and dual-cores exhibit those more readily.

The reason why this isn't enough is that at certain cycles values, it still crashes, at other values there is heavy flickering in lemmings, where there is a palette change mid-screen, and sometimes that palette switch gets "stuck", i.e., doesn't happen anymore. Quite typical for a race condition, although I don't understand the code well enough yet.

Reply 32 of 90, by Great Hierophant

User metadata
Rank l33t
Rank
l33t
Miki Maus wrote:

Just a note.
With latest DOSBox 0.72 CVS build from ykhwong and machine set to demovga, Pinball Fantasies show correct colors in table select menus. 😎

The demovga option does not seem to want to work in fullscreen with direct3d. It would be perfect if these two options could be made compatible.

Reply 33 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Update:

- new approach that should have less issues
(translate to 16bpp instead of changing the renderer palette)
- updated to apply to CVS

To activate:
machine=vgaonly

ibmtiming is replaced by:

[cpu]
screenflip=value

(useful values are 0-1500 or thereabouts, 0 is default, it's the microseconds delay of latching the new screen address, change it if you have a game with flicker issues).

Attachments

  • Filename
    dvga_2.diff
    File size
    18.2 KiB
    Downloads
    62 downloads
    File license
    Fair use/fair dealing exception
Last edited by h-a-l-9000 on 2007-12-22, 14:41. Edited 1 time in total.

1+1=10

Reply 35 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Little hack for DoWhackaDo in scanline emulation mode.

Attachments

  • Filename
    crtc_dowhackado.diff
    File size
    714 Bytes
    Downloads
    55 downloads
    File license
    Fair use/fair dealing exception

1+1=10

Reply 36 of 90, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Fix for the Wish demo (they use both A0000 and B0000 for video memory access)

Attachments

  • Filename
    wish_memory2.diff
    File size
    2.89 KiB
    Downloads
    57 downloads
    File license
    Fair use/fair dealing exception
Last edited by h-a-l-9000 on 2008-02-03, 19:26. Edited 1 time in total.

1+1=10

Reply 38 of 90, by jal

User metadata
Rank Oldbie
Rank
Oldbie
zaphod77 wrote:

MasterBlazer (ballblazer for PCs) does multiple palette shifts during gameplay. it's a good test case.

So did you test it? Or just recommend someone else does?

JAL

Reply 39 of 90, by Srecko

User metadata
Rank Member
Rank
Member

"Copper" relies on a fancy dac or crtc programming, some effects don't work with vgaonly (after copper bars, there should be stretching of a helicopter screen but it remains static, also "zooming" effect is problematic)
http://www.pouet.net/prod.php?which=2048

Also I couldn't get proper colors in Pinball fantasies yet (I tested using only latest version) 🙁

Great patch btw.

edit: The "Plasma" intro
(ftp://ftp.scene.org/mirrors/hornet/demos/1992/plasma.zip)
draws only one line if machine is set to "vgaonly". Draws full screen with "vga". although with graphical issues.

Last edited by Srecko on 2007-12-22, 15:36. Edited 1 time in total.