joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.59k stars 375 forks source link

Copper bars "demo" not working right #5113

Open aybe opened 2 weeks ago

aybe commented 2 weeks ago

Describe the bug

Almost 30 years ago, I bought this book: 🤣

301653922

TTF output didn't work but switching to surface finally shows something:

image

But I vividly remember these bars would mix like so:

2c8a1f65fadc33da6b7b104be2707d6c

As it was a programming book, the code was provided:

COPPER.zip

Just in case, the archived CD for the book:

https://www.abandonware-france.org/bibliotheque/livres/le-meilleur-programmation-jeux-3d-27/

Thanks! 😀

Steps to reproduce the behaviour

Switch to 'surface' output, start COPPER.EXE.

Expected behavior

No response

What operating system(s) this bug have occurred on?

Windows 11

What version(s) of DOSBox-X have this bug?

2024.03.01

Used configuration

No response

Output log

No response

Additional information

No response

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

joncampbell123 commented 2 weeks ago

I don't think this demo intended for the red and green bars to additive blend. Notice how the bars are made to look like they are rotating around each other, switching whichever one is on top as they go.

The TTF output isn't meant for this kind of demo effect. It's intended to display text, that's it.

aybe commented 2 weeks ago

My bad, you are right...

But I didn't dream, went through all demos in the CD and it was another one!!!🥳:

image

image

AARDVARK.zip

Funny how memories can be at the same time accurate and not...


Another one, it's supposed to wobble but it isn't:

image

WOBBLER.zip

According to the sources, I pressed a key once to get the effect started, waited, but nothing changed.

Other than that, the other demos in the CD do work quite well!

Thanks!!!

joncampbell123 commented 2 weeks ago

The wobble one was probably coded for some SVGA chipsets that allow it (I know ATI chipsets do). Most SVGA chipsets don't support it.

The common technique is to play with the HPEL horizontal panning register per scanline. Most cards latch that at display start, so changes mid frame don't count. ATI chipsets let you change it at any time which means it takes effect next line.

The less common one, used by the 1992 demo "Copper" plays with the placement of the hsync pulse and depends on your analog CRT monitor's phase lock loop to make it wobble.

joncampbell123 commented 2 weeks ago

S3 chipsets (which is what DOSBox, DOSBox-X, and most forks emulate by default) don't allow changing HPEL per scanline.

To enable it anyway, add to your dosbox.conf:

[video]
allow hpel effects=true
aybe commented 2 weeks ago

I tried what you suggested but that didn't change anything:

[dosbox]
machine=svga_s3

[sdl]
output=surface

[video]
allow hpel effects=true

[cpu]
cycles=20000

[render]
scaler=normal2x forced