A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / diwstrt/diwstop/ddfstrt/ddfstop and overscan

 

Author Message
sdw
Member
#1 - Posted: 27 Jul 2013 00:51
Reply Quote
Hi Amiga coders!

No matter how much I read, I can't seem to maek sense of the entire diwstrt/diwstop/ddfstrt/ddfstop registers .

First of all, for normal 320x256 resolution, I can't seem to get a picture that looks centered and nice.
The best I can come up with is:
diwstrt=0x2981, diwstop=0x29c1
Still not entirely centered on my C1084, but no matter what values I use, I can't seem to move it a bit more left like I want it to.
What values do you usually put in here?

Then to my next question - overscan. At the moment I would ideally want a bit more overscan below and above picture, but not on sides, so something like 320x288 or so, how would I go about setting that up?
dalton
Member
#2 - Posted: 27 Jul 2013 11:14
Reply Quote
I agree, those registers are kind of tricky. I'll just say though, that it's probably not a very good idea to center the picture according to your own monitor. The values $2c81 and $2cc1 are proper for a centered 320x256 display.

Change the diwstrt from $2cxx to $1cxx and stop from $2cxx to $3cxx and you'll add 16 lines on top and bottom of the display. The really tricky part is how to set the ddfstrt/stop regs. But when it comes to adding lines I think it's pretty straight forward.
Angry Retired Bastard
Member
#3 - Posted: 29 Jul 2013 15:50 - Edited
Reply Quote
I've used (equivalents to) this approach forever without really caring about the how's and why's. :) Has worked ok'ish for me, although I've rarely attempted any really weird settings. No idea where I got the original code / info though.


XSTRT = 129
XSTOP = 129+320
YSTRT = 44
YSTOP = 44+256
HSTRT = 129
WIDTH = 320 ; actual bpl width (excluding modulos)
RES = 8 ;8=lores, 4=hires


And the register setting, in this case through a copperlist but whatever.. ;-)

dc.w $008e,XSTRT+(YSTRT*256)
dc.w $0090,(XSTOP-256)+(YSTOP-256)*256
dc.w $0092,(HSTRT/2-RES)
dc.w $0094,(HSTRT/2-RES)+(8*((WIDTH/16)-1))
sdw
Member
#4 - Posted: 30 Jul 2013 14:52
Reply Quote
Thanks dalton, turns out that doing the y-overscan I wanted was simple, just changing the DIWSTRT and DIWSTOP as you said and nothing more needed.

A.R.B : Thanks, that seems like a good piece of code!
dalton
Member
#5 - Posted: 31 Jul 2013 09:45
Reply Quote
Glad that worked out for you. I'd like to add that I read somewhere recently that the horizontal starting position must be an odd number (like 129). Maybe that could be the reason you have problems moving the display window sideways?
sdw
Member
#6 - Posted: 2 Apr 2016 00:45 - Edited
Reply Quote
Sorry to bump this old thread again, but I'm tinkering with some stuff again, and thought I would set up a good generic code to handle this (in C)
Using the stuff from Angry Retired Bastard, I ended up with something like this:


#define WIDTH 320
#define HEIGHT 256
#define XSTRT 129
#define XSTOP XSTRT+WIDTH
#define YSTRT 44
#define YSTOP YSTRT+HEIGHT
#define HSTRT 129
#define RES 8 // 8 = lores, 4 = hires

custom.diwstrt=XSTRT+(YSTRT*256);
custom.diwstop=(XSTOP-256)+(YSTOP-256)*256;
custom.ddfstrt=(HSTRT/2-RES);
custom.ddfstop=(HSTRT/2-RES)+(8*((WIDTH/16)-1));


I worked with the assumption that the 129 on the XSTRT/XSTOP should be the same constant, and 44 on YSTRT/YSTOP the same as well, is that correct?
What about the 129 on HSTRT, should the be the same as well (ie. #define HSTRT XSTRT) or should these values be separate?



Angry Retired Bastard
Member
#7 - Posted: 2 Apr 2016 14:53 - Edited
Reply Quote
sdw:
What about the 129 on HSTRT, should the be the same as well (ie. #define HSTRT XSTRT) or should these values be separate?


Separate HSTRT and XSTRT. You also want to have separate Widhts for fetch and display (XWIDTH and HWIDTH, if you will).

Typically for having a display window that's smaller than the image you're scrolling around in.

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0