Cc65: tgi for C128 - interlace?

Created on 27 Nov 2018  路  8Comments  路  Source: cc65/cc65

Dont know if this is an appropriate request here or not, but could we add or amend a function that will allow 80x50 interlace text mode on the 128 VDC, and 640x480 interlace on bitmap? Text mode interlace may not necessarily belong in the tgi lib though as i think thats reserved for graphics.

The equivalent BASIC for text mode is:

1 REM 80X50 TEXT SCREEN
10 SYSDEC("CDCC"),DEC("34"),4
20 SYSDEC("CDCC"),DEC("32"),6
30 SYSDEC("CDCC"),DEC("33"),7
40 SYSDEC("CDCC"),3 ,8
50 SYSDEC("CDCC"),DEC("EA"),9
55 : rem Double screen & attribute areas and clear them
60 POKEDEC("A2F"),16:SYSDEC("CDCC"),16,20
70 POKEDEC("A2E"),8 :SYSDEC("CDCC"),8, 12:SCNCLR
80 POKEDEC("A2E"),0 :SYSDEC("CDCC"),0, 12:SCNCLR
90 LIST

and, for bitmap:

100 REM 640X480 BMM (REQ. 64K VIDEO RAM!) F.BOWEN 9/88
110 :
120 FAST: TRAP410
130 SYSDEC("CDCC"),DEC("7E"),0
140 SYSDEC("CDCC"),DEC("50"),1
150 SYSDEC("CDCC"),DEC("66"),2
160 SYSDEC("CDCC"),DEC("4C"),4
170 SYSDEC("CDCC"),6 ,5
180 SYSDEC("CDCC"),DEC("4C"),6
190 SYSDEC("CDCC"),DEC("47"),7
200 SYSDEC("CDCC"),3 ,8
210 SYSDEC("CDCC"),6 ,9
220 SYSDEC("CDCC"),0 ,24
230 SYSDEC("CDCC"),128+7 ,25
240 SYSDEC("CDCC"),0 ,27
250 SYSDEC("CDCC"),16 ,28
260 SYSDEC("CDCC"),0,12 :SYSDEC("CDCC"),0,13 :SYSDEC("CDCC"),240,26
270 : rem Clear the bitmap using block fills
280 SYSDEC("CDCC"),0,18 :SYSDEC("CDCC"),0,19 :SYSDEC("CDCC"),0,31
290 FORI=0TO255:SYSDEC("CDCC"),0,30 :NEXT
300 : rem Draw a box around the border, rendering into odd & even frames
310 FORI=1TO480/2: EVEN=0+I*80-1: EH=INT(EV/256):EW=(EV-EH*256)
320 : ODD=21360+I*80-1:OH=INT(OD/256):OL=(OD-OH*256)
330 :SYSDEC("CDCC"),OH,18:SYSDEC("CDCC"),OL,19:SYSDEC("CDCA"),1:SYSDEC("CDCA"),128
340 :SYSDEC("CDCC"),EH,18:SYSDEC("CDCC"),EW,19:SYSDEC("CDCA"),1:SYSDEC("CDCA"),128
350 :NEXT
360 SYSDEC("CDCC"),0,18:SYSDEC("CDCC"),0,19
370 SYSDEC("CDCC"),255,31 :SYSDEC("CDCC"),79,30: rem use block fill for top of box
380 SYSDEC("CDCC"),OH,18:SYSDEC("CDCC"),OL+1,19
390 SYSDEC("CDCC"),255,31 :SYSDEC("CDCC"),79,30: rem ditto for bottom of box
400 GETKEYA$
410 SYSDEC("E179") :SYSDEC("FF62"): SCNCLR : rem restore screen, d/l chr def's
enhancement

Most helpful comment

It would be

videomode(VIDEOMODE_80X50);

All 8 comments

Well, we have already c128-vdc2.tgi so you may remove the second part.
How about a "soft50" solution like soft80?

I dont have a preference really. Interlace text is really just a few system calls, so it might be easier to just add it to an existing c128 specific library and make it one of the 128 specific functions like fast() etc.

It would be

videomode(VIDEOMODE_80X50);

Im going to suggest this item be retracted after further investigation.

The Commodore 128 memory map says location 224-229 contain the screen editor variable tables. Pg 71 (Compute's Mapping the 128): " Since the tables have only 25 valid entries, the screen editor cannot support an output window with more than 25 rows."

So essentially we would have to write our own 50 row screen editor routines, which I believe would be out of scope for the C128 library. Perhaps someone (me :) ) may want to write a small add-on library to do it, but after giving it some thought - this doesnt belong in the compiler. Agree? More as an external extension, such as the C64 soft 80 conio library. (which is what @polluks was saying)

The first example code demonstrates the issue. The machine is happy to accomodate the first 25 lines, but after that, the screen editor doesnt care. It would be up to us to modify all the screen editor routines.

capture

In contrast to TGI the CONIO interface doesn't have the notion of replaceable drivers. So one C library can only come with one CONIO implementation. videomode() is only useful if the modes in question can share (nearly) all CONIO code. We don't want the single C library CONIO implementation to get bloated for supporting some alternative video mode.
These were thoughts that led to the way the C64 soft80 CONIO implementation is designed. I hope this background helps to decide how tackle a C128 80x50 CONIO.

We don't want the single C library CONIO implementation to get bloated for supporting some alternative video mode.

Yep, and a rather rare one at that. I think we agree. If anyone else wants to comment, then perhaps we can close this issue. Im trying to help clean up some of my tickets - either work on them, or pull them.

Im trying to help clean up some of my tickets - either work on them, or pull them.

Thanks, it's appreciated :-)

Was this page helpful?
0 / 5 - 0 ratings