VOGONS


First post, by Cyclone31

User metadata
Rank Newbie
Rank
Newbie

I just started playing around with dosbox to get some of my favorite games to work. I want to start by saying how impressed I am with how well dosbox works. Excellent work guys. 😁

I also want to comment on the improvements I am seeing running Lemmings2 under the latest CVS (01/20/2004) vs. 0.60 (Running Linux kernel 2.6, Pentium 3 500 MhZ, 256MB Ram) :

1) Overall performance with CVS is better. Using the dynamic core, I can run the game with flawless sound and music at higher cycles (5400 vs. 2800) and fewer skipped frames (4 vs. 5). This might not seem like much, but the increase cycles especially seem to make a large difference in load times.

2) 0.60 wouldn't play the intro sequence at all. It would fail with a message about an unhandled CPU opcode. With the latest CVS, the intro sequence almost completes before failing with an unhandled CPU opcode.

The only issues I notice now are:

1) Odd graphical glitches during intro sequence - While playing certain parts of the intro animation, certain sprites seem to be duplicated partially on another part of the screen. ie. There's a lemming in the animation in the lower part of the screen and you also see a "scratchy" version of this same lemming incorrectly drawn in the upper left (I'll try to post a screenshot later)

2) Intro still fails with unhandled CPU opcode. -- I'll have to try this again later with the other cores to see if this is only related to using the dynamic core.

I'd love to try and squash these bugs (if only to make dosbox more complete) if anyone wants to point me in the direction of using the debugger.

Reply 1 of 12, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

configure with --enable-debug

and start from an xterminal
when playing press - on numeric keyboard.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 12, by taiken7

User metadata
Rank Member
Rank
Member

There are no graphics errors if you disable EMS in the config file
(but there are also no sound effects). Now to figure out why ...
it may be the Int10 (function 3) scrollers (have yet to confirm this)
Notice that only animated bits make it into the upper "ghosting" images.

The scrollers work by copying on-screen to just off-screen and then
swapping (interlacing) the scroll. What might be happening is that
just-off screen happens to be the second page of page-flipped image
in EMS. So the scratch buffer is overwriting the second screen.
(Notice also the ghosting "blinks", suggesting 'good frame'/'bad frame' )

Alternatively it could be a similar result from internal rendering -
with the expectation that the second page of EMS will be reloaded
every frame render. (This is why the opcode-crash, data eventually is
corrupted like the video memory).

*Update - Not int10/3, so must be something internal. Or problem with
EMS emulation.

Reply 4 of 12, by Cyclone31

User metadata
Rank Newbie
Rank
Newbie

taiken,
Your analysis sounds good to me. Got any ideas of what else I can test to try to track this down? Also, I'm not sure exactly why disabling EMS disables sound. I believe the game is just as happy with XMS as EMS.

Reply 5 of 12, by taiken7

User metadata
Rank Member
Rank
Member

Heres a work-in-progress view ..
mem a000:0000 (usually final render memory);
not quite what I was expecting,

From analysis of e000:0000 suggests that the EMS is being
used exclusively for audio events (has "creative voice file" signatures)
The page demand also follows audio events rather than video.

Here's hoping they're using page flipping instead of lodsb's ..
there are plenty of those and they'll be trickier to debug.
Will check port 3d5 - function C/D ..

Attachments

  • Mem00.png
    Filename
    Mem00.png
    File size
    13.79 KiB
    Views
    2244 views
    File comment
    first pass, 320x200x8bit = masks?!
    File license
    Fair use/fair dealing exception
  • Mem01.png
    Filename
    Mem01.png
    File size
    8.4 KiB
    Views
    2244 views
    File comment
    Second pass, 80x200x8bit= Stretched mask
    File license
    Fair use/fair dealing exception
  • Mem02.png
    Filename
    Mem02.png
    File size
    14.46 KiB
    Views
    2244 views
    File comment
    Final pass, using 80x200x32bit->8bit
    (Colour codes the masks)
    File license
    Fair use/fair dealing exception

Reply 6 of 12, by Srecko

User metadata
Rank Member
Rank
Member

Hmm, "F14" ("F14 Fleet defender") might suffer from the same problem (uses EMS).

If I configure game to use soundblaster pro for both sound and music,
it plays digitized music in the menu. Sound (music) slowly becomes corrupted,
as if something owerwrites memory blocks in which sound data is stored.

Reply 8 of 12, by taiken7

User metadata
Rank Member
Rank
Member

I just realised the worst case scenario -- the memory model;
The problem occurs when you mix EMS with graphics (with the VGA PEL Mask (port 3C6h).

What the mask does is grab some free memory and apply masking, finally returning a final image .. that memory was in the middle
of an EMS page! (or at least immediately after the last page accessed)
Not sure how to fix it except to reserve a page or 2
at startup for VGA "scratch" buffer.
(This could also be what causes the VESA 2 problems).

*EDIT* No VGA seems well behaved, it seems to be the *AUDIO BUFFER*
(If you disable audio from the start menu, everything proceeds really well)
So now its just a matter of following up audio side.

Reply 9 of 12, by taiken7

User metadata
Rank Member
Rank
Member

Hmm.. it seems only ~2k changes between "blinks"
Still not sure where they're hiding the final frame,
doesnt appear to be paged in via EMS, so might be in XMS?

The following diff file shows the various changes that occur
with each blink.

(Taken with memdump 0000:0000 fffff, since it has locked addresse>= ff:*)

Attachments

  • Filename
    delta.txt
    File size
    34.47 KiB
    Downloads
    191 downloads
    File license
    Fair use/fair dealing exception

Reply 10 of 12, by taiken7

User metadata
Rank Member
Rank
Member

Finally some sensible progress to report;

Modifying L2.ini:

Music = 1
SoundFX = 1
Mono = 0
SoundName = "music\sblast.bin" --> Even better try "music\roland.bin"
SoundWord1 = 544
SoundWord2 = 263
FXName = "music\sblast.bin"

This has the effect of disabling music .. but this FIXES the graphics
glitches.. [but there was never music in the Intro background anyway(?!)]

So it seems ADLIB+(SB+EMS) = glitches. So it must be in the mixer,
or the pairing of SB + ADLIB...
Now to figure out how to improve on that ...

*Edit* Well, the Roland stuff sounds nifty, and it doesnt have problems
so it must be the adlib emulation meets SB that causes problems..

Reply 11 of 12, by Cyclone31

User metadata
Rank Newbie
Rank
Newbie

Wow. Excellent work. I've been busy lately, so I havn't had much timet to tinker. However, it probably doesn't matter, since it sounds like things are a bit beyond me at this point. I did manage the other night to get the glitches to appear once while playing the game itself, but only briefly and not consistently.

Reply 12 of 12, by taiken7

User metadata
Rank Member
Rank
Member

Progress is slow but here is the next update;

Compare the ADLIB logs with ROLAND you will notice that After loading "waking.gal"
the ADLIB-SB sample sizes are 5k,5k,17k... = 27k
the ROLAND-SB sample sizes are 22k,22k,3k... = 47k

So the graphic errors are caused by ~ 20k audio being "misplaced".

(Could be adlib buffer is very close to a page-boundary).

[ADLIB]

 312283119: FILES:file open command 0 file introdat\scripts\waking.gal
312293217: SBLASTER:DMA enabled,starting output
7: 312293217: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 5792
312570879: SBLASTER:DMA enabled,starting output
8: 312570879: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 5792
313726222: DMA:8-bit Channel 1 reached terminal count
313726222: SBLASTER:Raising IRQ
313726294: SBLASTER:DMA enabled,starting output
9:313726294: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 17104
316181237: SBLASTER:DMA enabled,starting output
10: 316181237: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 3974
316970988: DMA:8-bit Channel 1 reached terminal count
316970988: SBLASTER:Raising IRQ
320424951: SBLASTER:DMA enabled,starting output
11: 320424951: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 5330
321487107: DMA:8-bit Channel 1 reached terminal count
321487107: SBLASTER:Raising IRQ
323743858: SBLASTER:DMA enabled,starting output
12: 323743858: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 940
323931570: DMA:8-bit Channel 1 reached terminal count
323931570: SBLASTER:Raising IRQ
324844568: SBLASTER:DMA enabled,starting output
13: 324844568: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 940
325029541: DMA:8-bit Channel 1 reached terminal count
325029541: SBLASTER:Raising IRQ
325794892: SBLASTER:DMA enabled,starting output
14: 325794892: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 940
325982153: DMA:8-bit Channel 1 reached terminal count
325982153: SBLASTER:Raising IRQ
327717995: SBLASTER:DMA enabled,starting output
15: 327717995: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 8547 size 5792
329340929: DMA:8-bit Channel 1 reached terminal count
329340929: SBLASTER:Raising IRQ
329341025: SBLASTER:DMA enabled,starting output

[ROLAND]

 474431264: FILES:file open command 0 file introdat\gfxiffs\waking.iff
474514916: MOUSE:Define Hortizontal range min:0 max:320
474514922: MOUSE:Define Vertical range min:0 max:200
474515163: FILES:file open command 0 file introdat\scripts\waking.gal
474522538: SBLASTER:DMA enabled,starting output
7: 474522538: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 22896
475296742: SBLASTER:DMA enabled,starting output
8: 475296742: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 22896
475377238: PIT:PIT 0 Timer at 18.2 Hz mode 2
489353514: SBLASTER:DMA enabled,starting output
9: 489353514: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 3974
493403985: DMA:8-bit Channel 1 reached terminal count
493403985: SBLASTER:Raising IRQ
519595972: SBLASTER:DMA enabled,starting output
10: 519595972: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 5330
527975872: DMA:8-bit Channel 1 reached terminal count
527975872: SBLASTER:Raising IRQ
545708378: SBLASTER:DMA enabled,starting output
11: 545708378: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 940
547178579: DMA:8-bit Channel 1 reached terminal count
547178579: SBLASTER:Raising IRQ
553358689: SBLASTER:DMA enabled,starting output
12: 553358689: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 940
554376894: DMA:8-bit Channel 1 reached terminal count
554376894: SBLASTER:Raising IRQ
558598366: PIT:PIT 0 Timer at 75.8 Hz mode 2
558630187: SBLASTER:DMA enabled,starting output
13: 558630187: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 940
559647330: DMA:8-bit Channel 1 reached terminal count
559647330: SBLASTER:Raising IRQ
569195451: SBLASTER:DMA enabled,starting output
14: 569195451: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 8547 size 10422
583566389: SBLASTER:DMA enabled,starting output
15: 583566389: SBLASTER:DMA Transfer:8-Bit Single Cycle rate 12048 size 1320