|
Post by remark on Feb 21, 2020 13:27:54 GMT
Changing the border color from black to green in pixel double width bitmap mode I noticed there is a thin black line at te right of the screen (see photo). Analyzing this further I noticed that the screen is actually shifted half a pixel to the left. This (obviously) has something to do with reg 25 smooth horizontal scroll. Reg 22 (char disp, char total hor.) is initilized differently in pixel double width mode and reg 25 doesn't seem take that into account (on my C128 only?). The same happens in pixel double width text mode, although the thin line flashes there. Also I noticed, I cannot use color 14 (light gray) and color 15 (white) for background/border color in both modes. Or...is my VDC damaged?
I have created two BASIC test programs, to demonstrate this. One is for bitmap mode, the other for text mode. The program first loops from 0 to 15, changing the smooth horizontal scroll register. Then the border color loops from 0 to 15. My 8563 is a rev 9.
So if someone would be so kind to execute these programs on their setup? Thank you.
100 rem initialize vdc pixel double width text mode 110 bank 15: wr=dec("cdcc"): rd=dec("cdda") 120 for i = 1 to 6:read r,v: sys wr,v,r: next i 130 sys rd,,25:rreg ac: sys wr,(ac or 80),25: rem 0101 xxxx 140 sys wr,0,18:sys wr,0,19: sys wr,1,31: rem 'a' 150 sys wr,0,18:sys wr,2,19: sys wr,1,31 160 sys wr,8,18:sys wr,0,19: sys wr,71,31: rem reverse 170 sys wr,8,18:sys wr,2,19: sys wr,71,31 180 rem change reg 25 hor. smooth scroll from 0 to 15 190 for i = 80 to 95: sys wr,i,25 200 print i-80: sleep 1: next i 210 sys wr,87,25 220 rem change bordercolor from 0 to 15 230 for i = 0 to 15: sys wr,i,26 240 print i: sleep 1: next i 250 sys wr,4,26 260 rem vdc data 270 data 0,63,1,40,2,55,3,69,22,137,26,4
100 rem initialize vdc pixel double width bitmap 110 bank 15: wr=dec("cdcc"): rd=dec("cdda") 120 for i = 1 to 10:read r,v: sys wr,v,r: next i 130 sys rd,,25:rreg ac: sys wr,(ac or 208),25: rem 1101 xxxx 140 rem clear video ram 150 sys wr,0,18: sys wr,0,19: sys wr,0,31 160 for i = 1 to 32: sys wr,0,30: next i 170 rem set attributes (bg/fg) 180 sys wr,32,18: sys wr,0,19 190 for i = 1 to 4 200 sys wr,68,31: rem green/green 210 sys wr,0,30 220 next i 230 rem write 8 bytes upper left corner 240 b=0: for i = 1 to 8 250 bh = int(b/256): bl=b-int(b/256)*256 260 sys wr,bh,18: sys wr,bl,19: sys wr,129,31: rem byte 1000 0001 270 b=b+40: next i 280 sys wr,8192/256,18: sys wr,0,19: sys wr,103,31: rem cyan/light cyan 290 sleep 5 300 rem change reg 25 hor. smooth scroll from 0 to 15 310 for i = 208 to 223: sys wr,i,25 320 print i-208: sleep 1: next i 330 sys wr,215,25 340 rem change bordercolor from 0 to 15 350 for i = 0 to 15: sys wr,i,26 360 print i: sleep 1: next i 370 sys wr,4,26 380 rem vdc data 390 data 0,63,1,40,2,55,3,69,12,0,13,0,20,32,21,0,22,137,26,4
Attachments:
bitmap.prg (931 B)
textmode.prg (610 B)
|
|
|
Post by tokra on Feb 21, 2020 20:32:06 GMT
The result I am getting with your program on my 1901 are very strange. I don't see the line, but my screen-background stays dark all the time. This is probably due to registers 34 and 35 not initialized properly. Also I don't think you need to set register 3, I always keep it untouched. However if you do you need to adjust register 2 as well, and then also adjust registers 34 and 35 again with register 2 so they don't cause problems. With a correct setting you should be able to see all the colors, if the values are off, some colors will look darker or not work at all. I assume this is because the sync-pulse interferes. Registers 34 and 35 are tricky to set, they are called "DISPLAY ENABLE BEGIN" and "DISPLAY ENABLE END". The whole display here is 64 cycles (value of reg 0 +1) and you need to set the start right near the end of the current line so it is enabled in the next line, that's why register 34 is set to 63. Then after cycle 50 (reg 35) the display is disabled and the sync-pulse can come at cycle 51 (reg 0). So, the sync pulse can appear in the area between reg 35 and reg 34 (50-63).
In double-width-text-mode I also like to set reg 27 to 40 and set a WINDOWS 0,0,39,24 - so the screen can be worked with properly.
Anyway, my register setttings are 0,63,1,40,2,51,3,73,22,137,26,4,27,40,34,63,35,50 You also need to adjust the for-next-loop in line 120 to count up to 9 values instead of 6.
|
|
|
Post by remark on Feb 22, 2020 9:20:36 GMT
Thanks for you help Tokra! Adding registers 34 and 35 solves the bordercolor issue! The 0.5 pixel left shift and black line remain though. I can change register 3 between 65 and 76 and the picture remains stable, so not changing that makes sense. On my monitor setting r2/r35 to 51/50 makes the left border twice as big as the right border, 55/54 or 53/52 centers the screen more. For now I will consider the left shift issue a problem with my computer.
|
|
|
Post by willymanilly on Feb 22, 2020 10:55:51 GMT
On my 1084s monitor I get the same result as your attached image. I have noticed this behaviour before and have tried to emulate parts of it but I need to do more research. I removed it from bitmap mode emulation as a result of the discussion starting here. From your program it seems smooth x scrolling plays a part in the width of the black line at the right of the screen...
|
|
|
Post by remark on Feb 22, 2020 14:54:54 GMT
On my 1024s monitor I get the same result as your attached image. I have noticed this behaviour before and have tried to emulate parts of it but I need to do more research. I removed it from bitmap mode emulation as a result of the discussion starting here. From your program it seems smooth x scrolling plays a part in the width of the black line at the right of the screen... So it is actually a VDC 'feature bug' :-). It might be interesting to look at that scrolling demo from oziphantom with a different border color.
|
|
|
Post by tokra on Feb 22, 2020 15:48:39 GMT
Just to confirm, I have the strange line on the right as well (in textmode and bitmap-mode). I can however get rid of the line by writing 40 (or any value other than 0) to reg 27. The C128 Programmer's reference guide even states:
"A nonzero value in R27 is necessary to allow horizontal smooth-scrolling." on page 332 in the VDC-register-descriptions.
|
|
|
Post by remark on Feb 23, 2020 12:42:21 GMT
Just to confirm, I have the strange line on the right as well (in textmode and bitmap-mode). I can however get rid of the line by writing 40 (or any value other than 0) to reg 27. The C128 Programmer's reference guide even states: "A nonzero value in R27 is necessary to allow horizontal smooth-scrolling." on page 332 in the VDC-register-descriptions. Yes, that is a good workaround, it will take 200+25 extra video memory bytes though. If you don't mind having one visible column less, then you can also use r1=39 (instead of 40) and r27=1.
|
|