View Single Post
Old 27 December 2012, 16:41   #14
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,479
Regarding the half-rate CIA-B TOD tick with genlock, here's a "smoking gun" from the graphics.library blitter interrupt code.

There could be a noticeable difference between how the current non-beta WinUAE works with genlock connected option checked, and a real Amiga (with or without genlock). It could show up if you drag several icons around the screen on Workbench. There might be more tearing in WinUAE than on a real Amiga since graphics.library isn't waiting for the correct beam position. Probably easier to notice any difference if you use a disk which has very large icons. (Are there any test/demo programs which use QBSBlit() a lot???)

The important bit happens near the .WaitForBeamPos label.
Code:
BltSrv_Code	MOVE.W	#INTF_BLIT,(intreq,A0)
		MOVE.L	(gb_blthd,A1),D0
		BEQ.B	JustRTS

		BTST	#1,(gb_Flags+1,A1)
		BEQ.B	JustRTS

		MOVEA.L	A1,A6
		MOVEA.L	D0,A1
		TST.B	(dmaconr,A0)
lbC02F2F8	BTST	#6,(dmaconr,A0)	;BBUSY-8	
		BEQ.B	lbC02F318

		TST.B	(_ciaa).L
		TST.B	(_ciaa).L
		MOVE.W	(intreqr,A0),D0
		AND.W	#INTF_VERTB,D0
		BEQ.B	lbC02F2F8

		BRA.B	lbC02F2C2

lbC02F318	TST.B	(dmaconr,A0)
		BCLR	#7,(gb_Flags+1,A6)
		BNE.B	lbC02F34A

		MOVE.W	(bn_beamsync,A1),D0
		BPL.B	lbC02F340

		BCLR	#15,D0
		MOVE.W	D0,(bn_beamsync,A1)
		MOVE.L	(vposr,A0),D1
		LSR.L	#8,D1
		AND.W	#$7FF,D1
		CMP.W	D0,D1
		BLO.B	.WaitForBeamPos

lbC02F340	MOVEA.L	(bn_function,A1),A5
		JSR	(A5)
		BRA.W	lbC02F2BA

lbC02F34A	BTST	#CLEANMEn,(bn_stat,A1)
		BEQ.B	lbC02F35C

		MOVEA.L	(bn_cleanup,A1),A5
		JSR	(A5)
		MOVEA.L	(gb_blthd,A6),A1
lbC02F35C	MOVE.L	(A1),(gb_blthd,A6)
		BNE.B	lbC02F374

		ANDI.W	#$FFFD,(gb_Flags,A6)
		MOVE.W	#INTF_BLIT,(_custom+intena).L
		JMP	(_LVODisownBlitter,A6)

lbC02F374	TST.W	(gb_BlitLock,A6)
		BEQ.B	lbC02F39A

		CLR.L	(gb_blthd,A6)
		ANDI.W	#$FFFD,(gb_Flags,A6)
		MOVE.W	#INTF_BLIT,(_custom+intena).L
		JSR	(_LVODisownBlitter,A6)
		MOVE.L	(A1),(gb_blthd,A6)
		ADDQ.W	#1,(gb_BlitLock,A6)
		RTS

lbC02F39A	MOVE.W	#(INTF_BLIT|INTF_SETCLR),(_custom+intreq).L
		RTS

.WaitForBeamPos	BTST	#1,(gb_system_bplcon0+1,A6)	;ERSY
		BEQ.B	.NoGenlock

		LSR.W	#1,D0	;CIA-B TOD counts at half rate with genlock!
.NoGenlock	LEA	(_ciab).L,A0
		MOVEA.L	A6,A1
		MOVEM.L	D0/A0/A1,-(SP)
		MOVEQ	#-1,D0
		MOVE.B	#0,(ciatodhi,A0)
		MOVE.B	D0,(ciatodmid,A0)
		MOVE.B	D0,(ciatodlow,A0)
		MOVEA.L	(gb_cia,A6),A6
		MOVEQ	#CIAICRF_ALRM,D0
		JSR	(_LVOSetICR,A6)
		MOVEM.L	(SP)+,D0/A0/A1
		BSET	#6,(gb_Flags+1,A1)
		ROR.W	#8,D0
		MOVE.B	D0,(ciatodmid,A0)
		ROL.W	#8,D0
		MOVE.B	D0,(ciatodlow,A0)
		MOVEQ	#$7F,D0
		ADDQ.L	#5,D0	;$84 = CIAICRF_SETCLR|CIAICRF_ALRM
		JSR	(_LVOAbleICR,A6)
		RTS
mark_k is offline  
 
Page generated in 0.04666 seconds with 9 queries