VOGONS


Video Refresh Control Bug !

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by Lassar

User metadata
Rank Newbie
Rank
Newbie

😳

I was using PowerBasic compiler and found the following bug.

DosBox will not blank the screen when using the following interrupt.

It works perfect in dos but messes up in dosbox.

It has to do with :

INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS, VGA) - VIDEO REFRESH CONTROL
AH = 12h
BL = 36h
AL = new state
00h enable refresh
01h disable refresh
Return: AL = 12h if function supported
Desc: specify whether the contents of video memory should be displayed on
the screen; disabling refresh effectively blanks the screen
Note: when display refresh is disabled, the entire screen displays the color
specified by the DAC color register 00h; thus to actually blank the
screen, the application must first ensure that that register has been
set to black

You can test out this bug by downloading tTestBnk.exe from:

RadioTelephoneTutor.com/TestBnk.zip

Or using powerbasic demo from http://powerbasic.com to compile it.

http://www.powerbasic.com/support/downloads/f … les/TryPB32.zip

Here is the Code I used

-------------------------------------------------------------------------------------

SCREEN 12
CLS
PRINT "Press AnyKey to LoadScreen"
DO:LOOP UNTIL INKEY$ <> ""
VidOff
DrawScreen
VidOn
PRINT "Can You see the Screen Now ?"
PRINT "Press AnyKey to Quit"
DO:LOOP UNTIL INKEY$<>""
SCREEN 0
END


SUB VidOff
! PUSH DS
! MOV AX ,&H1201
! MOV BL ,&H36
! INT &H10
! POP DS
END SUB

SUB VidOn
! PUSH DS
! MOV AX ,&H1200
! MOV BL ,&H36
! INT &H10
! POP DS
END SUB

SUB DrawScreen()
FOR i% = 1 TO 15
FOR c% = 0 TO 15
12 IF INKEY$ = "Q" THEN 14
x% = RND(TIMER) * 1000
y% = RND(TIMER + 1) * 1000
z% = RND(TIMER + 2) * 1000
w% = RND(TIMER + 3) * 1000
a% = RND(TIMER + 4) * 1000
b% = RND(TIMER + 5) * 1000
IF x% > 640 THEN 12
IF y% > 480 THEN 12
IF w% > 640 THEN 12
IF z% > 480 THEN 12
IF a% > 640 THEN 12
IF b% > 480 THEN 12
LINE (x%, y%)-(a%, b%), c%
LINE (a%, b%)-(w%, z%), c%
LINE (x%, y%)-(w%, z%), c%
FOR ZZ! = 1 TO 50000:NEXT ZZ!
IF INKEY$ = CHR$(27) THEN EXIT SUB
NEXT c%
NEXT i%
14
END SUB

----------------------------------------------------------------------------------

Last edited by Lassar on 2008-04-02, 21:59. Edited 1 time in total.

Conquer the FCC GROL, & Amatuer Radio test

Reply 1 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

well it is a bug if a game doesn't work from it 😀

Here is our code 😀

                case 0x36:                                                      /* VGA Refresh control */
if (!IS_VGA_ARCH) break;
if ((svgaCard==SVGA_S3Trio) && (reg_al>1)) {
reg_al=0;
break;
}
/*
Call disables/enables the vga from outputting video,
don't support it, but fake a success return
*/
reg_al=0x12;
break;

We don't even log anymore if games uses this. So it's of near zero priority to add this 😀

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

Reply 3 of 9, by Lassar

User metadata
Rank Newbie
Rank
Newbie

I would like to get my Illinois Drvier's Tutor to work properly in DosBox.

Doesn't sound like a hard bug to fix if you ask me.
I think it would be very easy for to fix this bug.

After all a bug is a bug. This bug looks especially easy to fix.

Conquer the FCC GROL, & Amatuer Radio test

Reply 5 of 9, by dvwjr

User metadata
Rank Member
Rank
Member
Lassar wrote:
I would like to get my Illinois Drvier's Tutor to work properly in DosBox. […]
Show full quote

I would like to get my Illinois Drvier's Tutor to work properly in DosBox.

Doesn't sound like a hard bug to fix if you ask me.
I think it would be very easy for to fix this bug.

After all a bug is a bug. This bug looks especially easy to fix.

Why don't you use your PowerBasic program in the Windows NTVDM instead of Dosbox? 😒 Except for a lack of EMS memory on some systems, it works for many PowerBasic programs. Or are you running Dosbox on an Linux-based system?

dvwjr

Reply 6 of 9, by Lassar

User metadata
Rank Newbie
Rank
Newbie

It works real good under XP; but I want other OS's to be able to use it.

I want to use DosBox for multiplatform support.

Which means Linux and Mac OS X. I realize Linux has dosemu which is better then DosBox for my program.

But this still leaves Mac OS X. The best and probably only dos emulator for it is DosBox .

I have have been thinking this over. And I realize it would be a extremely easy fix for this interrupt.

To blank the screen, all you have to do is create a array or image descriptor and copy the screen to it. Change Screen pointer to array adress or image descriptor. Write all zeros to present screen.

Then when you restore the screen; reset the screen pointer to the screen.
And copy back over to present screen and destroy array or image descriptor.

Being such a easy fix I think it should be fixed right away.

Conquer the FCC GROL, & Amatuer Radio test

Reply 8 of 9, by dvwjr

User metadata
Rank Member
Rank
Member
Lassar wrote:
I want to use DosBox for multiplatform support. . . . I have have been thinking this over. And I realize it would be a extremely […]
Show full quote

I want to use DosBox for multiplatform support.
.
.
.
I have have been thinking this over. And I realize it would be a extremely easy fix for this interrupt.
.
.
.
Being such a easy fix I think it should be fixed right away.

That is a novel strategy to use Dosbox as an multi-platform application run-time environment for your application, but perhaps a bit flawed. The goal of Dosbox is to execute DOS GAMES, if any non-GAME applications happen to work, that's good as a fallout. Sometimes an potential improvement which could 'fix' an application might happen to attract the interest of the Dosbox Team if it can be related to stability or whatnot... So don't count on 'fixes' to Dosbox to help plain-jane applications.

I thought that the PowerBasic folks had created compilers for Windows environments, not sure about Linux... How about a set of current PowerBase compilers for each of your current Operating System targets instead of using an emulated DOS environment to run the output of an old compiler?

Don't lose hope, as a programmer you can always fix Dosbox yourself. The source code is freely available and interested parties are constantly providing potential additions to the Dosbox code-base by adding enhancements to Dosbox and submitting the code to the Dosbox Team for possible inclusion in the CVS. You yourself could implement the necessary code for "INT 10 - VIDEO - ALTERNATE FUNCTION SELECT (PS, VGA) - VIDEO REFRESH CONTROL", compile it (with a free C compiler) and then submit your potential code additions to the CVS for consideration. After all, you have described a fix in PowerBasic, just switch from wearing your 'PowerBasic' hat to your 'C' hat and get programming - after all, it's just code...

Think of it as the "stone-soup" method of creating a functionally richer Dosbox...

Best of luck,

dvwjr