Post by warty on Jan 26, 2018 3:37:26 GMT
Hi All,
I have been getting back into C= programming the last couple winters. Re-teaching myself assembly, and re-teaching myself VDC fun (which I last did in 1997, which was the last time my Commodores saw the light of day).
Anyway, I've been going through all the VDC information I could find from old books, articles, web sites, and forums. I don't have a specific "use" in mind, but if I can remain ambitious, a game of some kind.
I'm trying to figure out how to do 640x200 bitmap with 2 colors per 8x2 pixel block. Playing around with VDC registers, I got it basically working on VICE. But on my C128DCR, if I touch register 9 and set it to anything less than 7, I lose the display. For the half second or so I can see it, it looks like something bad is happening to sync. I'm not certain it would happen with a real multi sync monitor. What I have is a Gonbes 8220 unit hooked up to a BIT-C 128. Maybe the combination isn't able to handle sync differences as well as a real multi sync monitor would?
So I could use some help here:
1) is there a better set of register settings I could use? I did play around a bit with adjusting vsync, but couldn't hit upon a solution.
2) is this maybe just impossible with a DAC?
3) am I misunderstanding how people achieve more color on VDC?
4) if register 9 is the way to go, do I even need to set register 23 to 2?
I've been converting all the articles and chapters I find on VDC and collecting them in an Ebook, and I'll try to write this up as a tutorial article if I can get it working. I understand a lot of material was lost when commodore128.net went offline.
"success" shot on VICE:
Code:
(note: I don't have a good way to get stuff to my C128 yet, so I have some unnecessary stuff in this code just in case I need some extra space when testing on the C128 (I don't have assembler on it, just the monitor).
I have been getting back into C= programming the last couple winters. Re-teaching myself assembly, and re-teaching myself VDC fun (which I last did in 1997, which was the last time my Commodores saw the light of day).
Anyway, I've been going through all the VDC information I could find from old books, articles, web sites, and forums. I don't have a specific "use" in mind, but if I can remain ambitious, a game of some kind.
I'm trying to figure out how to do 640x200 bitmap with 2 colors per 8x2 pixel block. Playing around with VDC registers, I got it basically working on VICE. But on my C128DCR, if I touch register 9 and set it to anything less than 7, I lose the display. For the half second or so I can see it, it looks like something bad is happening to sync. I'm not certain it would happen with a real multi sync monitor. What I have is a Gonbes 8220 unit hooked up to a BIT-C 128. Maybe the combination isn't able to handle sync differences as well as a real multi sync monitor would?
So I could use some help here:
1) is there a better set of register settings I could use? I did play around a bit with adjusting vsync, but couldn't hit upon a solution.
2) is this maybe just impossible with a DAC?
3) am I misunderstanding how people achieve more color on VDC?
4) if register 9 is the way to go, do I even need to set register 23 to 2?
I've been converting all the articles and chapters I find on VDC and collecting them in an Ebook, and I'll try to write this up as a tutorial article if I can get it working. I understand a lot of material was lost when commodore128.net went offline.
"success" shot on VICE:
Code:
(note: I don't have a good way to get stuff to my C128 yet, so I have some unnecessary stuff in this code just in case I need some extra space when testing on the C128 (I don't have assembler on it, just the monitor).
setAttrSize:
// Character total (vertical). default = $E7
// The number of scan lines, minus one, used to create each character on the screen.
// the setting for R9 below works in VICE, but kills VDC display in my C128DCR
ldx #9
lda #1 // # of pixels per character -1. In bitmap mode, this determines scope of each byte of attribute data.
// as the vertical size gets smaller, the start of drawing space moves up
// for values under 4, probably start of screen will be out of displayable area, unless adjusted
jsr writer
//.byte $ea,$ea,$ea,$ea,$ea,$ea,$ea
// Character displayed (vertical). default = $e8.
// The number of vertical scan lines displayed for each character. This register determines the height of screen characters.
// C128PRG: R23 can be equal to or less than R9. If they are equal, then the displayed part of the character is equal to
// the total character, and the entire character is displayed, with no vertical intercharacter spacing.
ldx #23
lda #2 // # of pixels per character (1-8). In bitmap mode, this determines scope of each byte of attribute data
jsr writer
// set vertical sync position. default = $20
ldx #7
lda #$20
jsr writer
// vertical total adjust. default = $e0
// The number of scan lines added to the end of the display frame for adjustment of the vertical sync rate.
ldx #5
lda #$e0
jsr writer
// Vertical displayed. dfeault = $19
// The number of characters displayed in a frame. This register sets the height of the frame.
// if using half-height color cells, need 50 rows, not 25.
ldx #6
lda #50
jsr writer