VOGONS

Common searches


Search results

Display options

Re: DOSBox-X branch

I think this would better meet the implementation recommended by jmarsh and krcroft. Tested the values for unsigned 8-bit mono sound only. This saves the xor operation, but one report suggests that the xor may use less than a cpu cycle. I think that the data value should have a casting operator, but …

Re: DOSBox-X branch

If that was set to >127 instead of 128, then i = 128 would access the path for correcting the bias in the conversion. The way it is currently written, the i = 128 results in a table value of 0 which is expected.

Re: DOSBox-X branch

That is a good analysis. The table function runs at the start of emulation only, so it is not as crucial to optimize there. And as you said, the compiler may help where optimizing. I also had verified that function for accuracy in its calculation and then moved to the other part. That avoids the …

Re: DOSBox-X branch

Here is an updated version because the previous version of the code seemed to have lower performance than expected. I noticed this where patching pcem with the same. This version was additionally tested against the boundary values of -128, 127, and all testing was for the signed 8-bit mono sound …

Re: DOSBox-X branch

Thank you, krcroft, for the help with the use of a second array to handle the 8-bit values. I wonder whether that would show better performance than the use of the xor operations that are used in the version below. I think that this code is now functional. I had to fix the dereferencing of the …

Re: DOSBox-X branch

That is great news, krcroft. Thank you for your work. I think there is a possible way, as I think jmarsh suggested, to avoid the xor operation on the data values. Something like this: tablePtr = signeddata ? &Sample_16_Table[128] : &Sample_16_Table[0]; I verified that the values are correct, but I …

Re: DOSBox-X branch

Thank you. I think that the code could be verified and possibly extended to save a few more instructions at the machine level. It is simpler now to read, but I think that xr can be removed and another set of table entries added (as per jmarsh's recommendation), but I think that it requires an …

Re: DOSBox-X branch

This is not yet compiled, but I followed your suggestion as best that I could and tried to fix the calculations. Sample_16_Table[] holds the sorted values, from low to high of the "scaled" 16-bit signed integer. static Bit16s Sample_16_Table[256]; // call function during mixer init void Mixer_ …

Re: DOSBox-X branch

This code is untested, but it seems like it is structured correctly for inclusion in the mixer.cpp file: static Bit16s Sample_16_Table[256]; // call function during mixer init void Mixer_SetSample16Table(void) { for (Bitu i=0;i<256;i++) { if (i > 128) Sample_16_Table[i]=((i-128) << 8) | (2 * (i-128) …

Re: DOSBox-X branch

That is a powerful tool, krcroft. Thank you for the instructions, too. A look-up table is a great idea. Below is a modification of krcroft's code to output the look-up table in human readable format. // gcc convert-8bit-16bit.c -o convert-8bit-16bit.exe short scale_uto16(unsigned char val) { if (val …

Re: DOSBox-X branch

Given the overflow does not occur, would this work: if (sizeof(Type) == 1) { const Bit8u xr = signeddata ? 0x00 : 0x80; + Bit8s d; len--; - current[0] = ((Bit8s)((*data++) ^ xr)) << 8; + d = (Bit8s)((*data++) ^ xr); + current[0] = d > xr ? (d << 8) | (2 * d + 1) : d << 8; - if (stereo) + if (stereo) …

Re: DOSBox-X branch

Shifting negative values results in undefined behavior: https://github.com/dosbox-staging/dosbox-staging/pull/1005 if (sizeof(Type) == 1) { const Bit8u xr = signeddata ? 0x00 : 0x80; len--; - current[0] = ((Bit8s)((*data++) ^ xr)) << 8; - if (stereo) - current[1] = ((Bit8s)((*data++) ^ xr)) << 8; - …

Re: Game Port OS Compatibility

OpenTTD has versions that work in early Windows, possibly 9x, such as v1.22 or v1.23. Hint for custom build: ./configure --without-threads --disable-unicode --disable-network --disable-assert --enable-strip --without-lzma --without-liblzo2 It is possible to backport OpenTTD v1.33 to Win95. Hexen and …

Re: Privateer 2 slow down in space

Have you tried DOSBox-X with both the fixed cycle setting and a customized vmemdelay value other than 0 (such as -1 or 1000)? PCem by default would generally account for the video memory delay. Wing Commander for DOS has a similar issue, but there was a report that the vmemdelay option does not …

Page 1 of 19