English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 22 April 2018, 11:09   #21
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
WaitNotLine0 can incorrectly detect 255 to 256 change as line 0. Custom registers are always word wide: $dff004.l access requires 2 back to back reads and register content can change between reads if read at the end of scanline.

More reliable method is to only poll $dff004.w bit zero 1 to 0 change.
Toni Wilen is online now  
Old 22 April 2018, 12:32   #22
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
WaitNotLine0 can incorrectly detect 255 to 256 change as line 0. Custom registers are always word wide: $dff004.l access requires 2 back to back reads and register content can change between reads if read at the end of scanline.
Furthermore it is always a good idea to read VHPOSR before VPOSR because of a x position roll-up to 0 before y update (that can be nasty if you wait for y precise line position).
Quote:
More reliable method is to only poll $dff004.w bit zero 1 to 0 change.
I normally do the $dff006 then $dff004 read and check (because of generic line wait), but like you suggested for VBL only, code like this is good:
Code:
	lea	$dff004,a0
	
.l1	move.w	(a0),d0
	lsr.w	#1,d0
	bcc.b	.l1
.l2	move.w	(a0),d0
	lsr.w	#1,d0
	bcs.b	.l2
Just out of curiosity .. I never do illegal access to custom registers (writing on read only and vice versa or byte access), but to make more compact code there is actually some consequence writing such this?
Code:
	lea	$dff004,a0
	
.l1	lsr	(a0)
	bcc.b	.l1	
.l2	lsr	(a0)
	bcs.b	.l2
Thanks
ross is offline  
Old 22 April 2018, 12:45   #23
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Writing to read-only register does nothing (but I still wouldn't do it, it can get annoying when using debuggers that detect illegal accesses) but extra write access can be waste of time (especially if 68020+).

Everyone uses byte wide custom register reads anyway. (Most common is blitter busy bit check, KS code does it too).
Toni Wilen is online now  
Old 22 April 2018, 12:57   #24
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Toni Wilen View Post
Writing to read-only register does nothing (but I still wouldn't do it, it can get annoying when using debuggers that detect illegal accesses) but extra write access can be waste of time (especially if 68020+).
Yes, only for compact code and register shortage

Quote:
Everyone uses byte wide custom register reads anyway. (Most common is blitter busy bit check, KS code does it too).
I avoid also this :
Code:
	lea	$dff002,a0
	
.l1	move.w	(a0),d0
	add.w	d0,d0
	bmi.s	.l1
ross is offline  
Old 25 April 2018, 22:18   #25
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Quote:
Originally Posted by Toni Wilen View Post
DMACON write is correct, it is supposed to clear the bits
Hehe. Yeah, I guess I was confused about the purpose by the bit backwards code at the time. It was written clearly in the first post, though.

If you just want to pump out data to bpl1, the easiest and fastest way is with the Copper, something like:

Code:
	dc.w $1b29,$fffe
	REPT 24
	dc.w $110,0
	ENDR
	dc.w $1c29,$fffe
	...
And then you'd fill the zeros with the Blitter.

You can emulate the Copper by triggering a Copper interrupt each line a bit before that (HPOS+6px) to have your data ready in time, and poll it, then pump out the data. But it would be 2x slower (+VAT) than Copper+Blitter. For spamming bplcon1 it has its uses, maybe one could be invented for bplxdat?
Photon is offline  
Old 26 April 2018, 10:11   #26
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Photon View Post
[..] For spamming bplcon1 it has its uses, maybe one could be invented for bplxdat?
Problem here is that if you activate BPLCON0 BPUx bit then DMA channels fetch data from memory.
Only exceptions are the fake 7-planes mode with only 4 channel fetch plus BPL5/6DAT, and BPL1DAT like the previous message.
So pumping BPLxDAT is not useful.. Or I miss something?

[EDIT]
hmm, and if you disable BPLEN in DMACON and use BPUx bit AND pump BPLxDAT what is the result?

[EDIT2]
Just tried in WinUAE.. results are "strange"
Something seems to work but not as expected..

[EDIT3]
better set FMODE=0
all works properly, maybe some effect can be made


There is only one thing that I need a confirmation.
It seems that the condition for display is BPLCON1 x-pos and "every 16 pixels" BPL1DAT strobe (all BPLxDAT are anyway buffered).
This is really copper intensive for a complex display.. (opposed to 7-planes mode where strobe is DMA triggered).
Toni?

Last edited by ross; 26 April 2018 at 11:30. Reason: spell...
ross is offline  
Old 26 April 2018, 22:02   #27
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
Quote:
Originally Posted by ross View Post
There is only one thing that I need a confirmation.
It seems that the condition for display is BPLCON1 x-pos and "every 16 pixels" BPL1DAT strobe (all BPLxDAT are anyway buffered).
This is really copper intensive for a complex display.. (opposed to 7-planes mode where strobe is DMA triggered).
Toni?
It would be quite pointless to fully emulate bitplane DMA with copper but it would be very cheap way to make horizontal 16-pixel (with as many planes as you want) repeating pattern. Perhaps it can make something interesting when combined with HAM mode.
Toni Wilen is online now  
Old 27 April 2018, 20:35   #28
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,333
Quote:
Originally Posted by Toni Wilen View Post
WaitNotLine0 can incorrectly detect 255 to 256 change as line 0. Custom registers are always word wide: $dff004.l access requires 2 back to back reads and register content can change between reads if read at the end of scanline.
Thanks. That problem never seemed to happen if running from chip/slow RAM, but does from Zorro II fast RAM.
mark_k is offline  
Old 06 May 2018, 21:51   #29
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,333
I've uploaded a bug-fixed version of the scroll test program to The Zone. Archive contains two versions, one with 4-pixel-wide bars, the other 8. Colours are different too: colour 0 is yellow, colour 1 blue.
mark_k is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Maximum Size Disk and Partition AMIGASYSTEM support.WinUAE 3 09 November 2017 21:04
Hard Maximum File Size AMIGASYSTEM support.WinUAE 6 13 August 2016 15:41
Maximum Hard Drive Size Limit On A Cyberstorm MK3 CU_AMiGA support.Hardware 9 29 November 2010 10:07
Whats the MAXIMUM card size to be used with PCMCIA ? Kakaboy support.Hardware 13 11 May 2010 00:03
Maximum partition size for a 1.3 setup coze support.Hardware 2 23 August 2006 17:26

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:58.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13900 seconds with 13 queries