• Please review our updated Terms and Rules here

CGA card issue (freeze)

ZeroG1972

Member
Joined
Jul 22, 2019
Messages
13
Location
France, Pont-à-Mousson
Hi,

I am currently restoring an IBM PC XT 5160 (8088 ).

I solved the problems of access to the hard disk by low-level formatting, but I encounter a strange issue with the CGA graphics card: the display is correct until the text reaches the last line of the screen (ex: dir C: ). Then the display freezes but the cursor continues to flash, instead of scrolling.

I replaced the CGA card with a VGA card (Cirrus Logic 5401 16-bit ISA) and the display works correctly.
I would like to diagnose and repair the CGA card but visually, everything looks correct.

If you have already encountered this problem, thank you in advance for your help.

Thierry (from France)
 
Hello. Welcome to these forums.

I suggest that you run some diagnostic software against the card. CheckIt is an example (from the main menu, [TESTS] then [VIDEO]).
 
A defect of this kind might be a defective card, but honestly it sounds like the problem is software-related. Is your CGA card a true IBM CGA card, or a clone? What DOS are you booting? Are you loading any TSRs or other programs in your CONFIG.SYS or AUTOEXEC.BAT?
 
A defect of this kind might be a defective card, but honestly it sounds like the problem is software-related. Is your CGA card a true IBM CGA card, or a clone? What DOS are you booting? Are you loading any TSRs or other programs in your CONFIG.SYS or AUTOEXEC.BAT?

It's IBM CGA Card and I booting with same DOS disk to test VGA and CGA cards.

Motherboard's switchs seems OK : 5=ON , 6=OFF : CGA, at 80 column by 25 line mode
 
If I remember correctly, the CGA BIOS routines wait to do the memory shuffle for scrolling until there's a vertical blanking interval to avoid "snow" on the display. If your CGA card isn't correctly indicating the retrace, that would cause things to behave the way you describe.
 
If I remember correctly, the CGA BIOS routines wait to do the memory shuffle for scrolling until there's a vertical blanking interval to avoid "snow" on the display. If your CGA card isn't correctly indicating the retrace, that would cause things to behave the way you describe.


This is an interesting track: I have just visually checked the connectors of the CGA card and the screen (IBM 5153), but I do not see anything particular. But can be a problem of false contact? oxidation?
 
This is an interesting track: I have just visually checked the connectors of the CGA card and the screen (IBM 5153), but I do not see anything particular. But can be a problem of false contact? oxidation?

Could be that vertical retrace simply isn't generated on this card because of a bad IC. Probably time for a logic probe or a bit of programming.
 
I don't recall, but does the 5160 BIOS check for retrace even in 40-column mode? After all there should be no snow problem there.

If it doesn't, that could help test for this specific problem at least.
 
Only in 80x25 text mode. From the BIOS source:

Code:
;---- HANDLE COMMON SCROLL SET UP HERE

SCROLL_POSITION PROC	NEAR
	CMP	CRT_MODE,2		; TEST FOR SPECIAL CASE HERE
	JB	N9			; HAVE TO HANDLE 80X25 SEPARATELY
	CMP	CRT_MODE,3
	JA	N9

;----- 80X25 COLOR CARD SCROLL

	PUSH	DX
	MOV	DX,3DAH			; GUARANTEED TO BE COLOR CARD HERE
	PUSH	AX
N8:					; WAIT_DISP_ENABLE
	IN	AL,DX			; GET PORT
	TEST	AL,8			; WAIT FOR VERTICAL RETRACE
	JZ	N8			; WAIT_DISP_ENABLE
	MOV	AL,25H
	MOV	DL,0D8H			; DX=3D8
	OUT	DX,AL			; TURN OFF VIDEO
	POP	AX			; DURING VERTICAL RETRACE
	POP	DX
N9:
	CALL	POSITION		; CONVERT TO REGEN POINTER
	ADD	AX,CRT_START		; OFFSET OF ACTIVE PAGE
	MOV	DI,AX			; TO ADDRESS FOR SCROLL
	MOV	SI,AX			; FROM ADDRESS FOR SCROLL
	SUB	DX,CX			; DX = # ROWS, # COLS IN BLOCK
	INC	DH
	INC	DL			; INCREMENT FOR 0 ORIGIN
	XOR	CH,CH			; SET HIGH BYTE OF COUNT TO ZERO
	MOV	BP,CRT_COLS		; GET NUMBER OF COLUMNS IN DISPLAY
	ADD	BP,BP			; TIMES 2 FOR ATTRIBUTE BYTE
	MOV	AL,BL			; GET LINE COUNT
	MUL	BYTE PTR CRT_COLS	; DETERMINE OFFSET TO FROM ADDRESS
	ADD	AX,AX			; *2 FOR ATTRIBUTE BYTE
	PUSH	ES			; ESTABLISH ADDRESSING TO REGEN BUFFER
	POP	DS			; FOR BOTH POINTERS
	CMP	BL,0			; 0 SCROLL MEANS BLANK FIELD
	RET				; RETURN WITH FLAGS SET
SCROLL_POSITION ENDP

You can see how, if the retrace status is missing, an 80x25 scroll would freeze solid.
 
I don't recall, but does the 5160 BIOS check for retrace even in 40-column mode? After all there should be no snow problem there.

If it doesn't, that could help test for this specific problem at least.

Yes ! problem solved by 40-column mode ! Thank you for this tips, now I can use my original monitor with CGA card !
 
Back
Top