English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 07 June 2011, 23:35   #1
jman
Registered User
 
Join Date: Nov 2010
Location: .
Posts: 385
Understanding DIWHIGH register

Hello,

yet another basic concept I cannot grasp.
I "discovered" that it would be interesting to use the ECS register DIWHIGH instead of writing DIWSTRT+DIWSTOP.

There's unfortunately a basic concept I cannot understand: how to set bit values in this register, as explained here.

According to the documention I should distribute the usual window coordinates (DIWSTRT=$2c81, DIWSTOP=$2cc1) like the following scheme. I'm colouring the relevant bits to show where I think I should pick them from DIWSTRT+DIWSTOP and set in DIWHIGH):

DIWSTRT $2c81 %0010 1100 1000 0001 VSTART,HSTART
DIWSTOP $2cc1 %0010 1100 1100 0001 VSTOP,HSTOP

....................5432 1098 7654 3210 bit position
DIWHIGH.......0010 0001 0010 0001

cyan = Horizontal stop, most significant bit.
green = Vertical stop, most significant 3 bits.
red = Horizontal start, most significant bit.

Please bear with me once more and help me with this, it's driving me crazy. Am I calculating the bits correctly? (answer: no, idiot)

Why do I have to put twice the 3 msb of VSTOP? I sort of expected this register to contain all 4 coordinates (vstart&vstop, hstart&hstop)

Finally, is there a PDF of the AHRM, third edition? Probably I can look up a complete explaination in there.

Thank you, again.

Last edited by jman; 08 June 2011 at 21:49.
jman is offline  
Old 08 June 2011, 12:57   #2
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Is the DIWHIGH register not used in addition to DIWSTRT / STOP rather than instead of...?

To me, the docs at the link you posted seem to be saying that DIWHIGH either has no effect on DIWSTRT / STOP if it's not written to at all or effects DIWSTRT / STOP to work for direct start / stop positions if it's written last.

That would seem to hold true taken in relation to the bit descriptions too ie. DIWHIGH defines the most significant start / stop bits for vertical (V8, V9, V10) and horizontal (H8) while DIWSTRT / STOP defines the less significant start / stop bits (V0-7 & H0-7)

To put it another way, doesn't DIWHIGH just override the implied V8 & H8 = 0 for start positions or implied V8 & H8 = 1 for stop positions in DIWSTRT / STOP...?
pmc is offline  
Old 08 June 2011, 13:10   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
Quote:
Originally Posted by pmc View Post
To put it another way, doesn't DIWHIGH just override the implied V8 & H8 = 0 for start positions or implied V8 & H8 = 1 for stop positions in DIWSTRT / STOP...?
Yes. Pre-ECS "hidden" V8+ and H8 can be modified using DIWHIGH. (H8 bits require ECS Denise or AGA, V8+ bits require ECS Agnus or AGA)

Note that it is also easy to get caught in hidden trap when using DIWHIGH. For example you will get unexpected result if you set DIWSTRT V0-V7 to zero and then update DIWHIGH VSTART8 = 1 if current vertical position = 0.
Toni Wilen is offline  
Old 08 June 2011, 22:16   #4
jman
Registered User
 
Join Date: Nov 2010
Location: .
Posts: 385
I have read again the register description and it is consistent with your suggestions.
However I don't understand how to use it to increase the size of the usable screen.
What would be useful is probably a couple of examples. I'll note this issue as I progress and check the documentation around.

Thanks.
jman is offline  
Old 10 June 2011, 09:02   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
Quote:
Originally Posted by jman View Post
However I don't understand how to use it to increase the size of the usable screen.
You don't.

DIWHIGH/DIWSTRT/DIWSTOP only configures location and size of display window.

If you want more scanlines or horizontal size, you need programmed screen mode (non-PAL/NTSC compatible) which is something much more complex and usually not worth the trouble.
Toni Wilen is offline  
Old 11 June 2011, 10:43   #6
jman
Registered User
 
Join Date: Nov 2010
Location: .
Posts: 385
Quote:
Originally Posted by Toni Wilen View Post
You don't.
DIWHIGH/DIWSTRT/DIWSTOP only configures location and size of display window.
So, according to the description of the registers, DIWHIGH "allows larger start and stop ranges" and - according to what you and pmc suggested - this register will override the otherwise defined DIWSTRT+DIWSTOP display position.
Isn't it equal to say that the display size is extended?
Maybe I'm using "display size" improperly, I'm talking about how many pixels of usable display I have.

If I write:
Code:
 dc.w $2cc1,diwstrt
or:
Code:
 dc.w $2ac1,diwstrt
Am I not actually enlarging the display area? (let's forget for a moment the consequences of displaying an area larger then the image size).

Thanks :-)
jman is offline  
Old 11 June 2011, 12:29   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,575
Quote:
Originally Posted by jman View Post
So, according to the description of the registers, DIWHIGH "allows larger start and stop ranges"
It only means register range is larger (more width/height combinations possible).

Actually DIWHIGH (on PAL/NTSC modes) allows smaller display sizes than was possible on OCS machines

DIWSTRT and DIWSTOP (without DIWHIGH) already allows maximum (again, PAL/NTSC) display size.
Toni Wilen 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
diwhigh/diwstart problems Jherek Carnelia Coders. General 4 07 April 2011 19:08
Understanding the Copper BippyM Coders. Tutorials 38 04 September 2010 12:18
Anyone like to help understanding this bootblock ??? Joe Maroni Coders. Tutorials 2 15 February 2007 17:33
Understanding ASM Routine Crackersixx Coders. Tutorials 13 10 February 2006 02:58
understanding the COLORXX regs... Joe Maroni Coders. General 2 14 February 2005 07:50

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 13:22.

Top

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