Shop OBEX P1 Docs P2 Docs Learn Events
[FYI] VGA, 40x15, single cog, per cell colour/palette, ROM font — Parallax Forums

[FYI] VGA, 40x15, single cog, per cell colour/palette, ROM font

kuronekokuroneko Posts: 3,623
edited 2013-10-19 15:35 in Propeller 1
Based on [post=1210076]Jim's wishlist[/post]:
  • uses only 1 cog
  • provides 640x480 VGA with 40 columns x 15 rows
  • consumes little memory (1-2 words/char)
  • provides multiple colors (at least 4 colors/screen and at least 2 or 3 colors/line, not just 2 over the entire screen)
  • displays characters using the full 16x32 built-in ROM font.
'' mailbox layout - full colour driver
''
'' long[par][0]: screen: [!Z]:addr = 16:16 -> zero (accepted), 2n
'' long[par][2]: colour: [!Z]:addr = 16:16 -> zero (accepted), 4n
'' long[par][3]: frame indicator
'' mailbox layout - paletted driver, 4/4 split
''
'' long[par][0]:   screen:   [!Z]:addr =   16:16 -> zero (accepted), 2n
'' long[par][1]: pal/user: u:[!Z]:addr = 1:15:16 -> zero (accepted), 2n/4n
'' long[par][2]:   colour:   [!Z]:addr =   16:16 -> zero (accepted), 2n
'' long[par][3]: frame indicator, [COLOR="#FF0000"]vcfg on startup (14:9:9)[/COLOR]
''
'' The pal/user parameter is encoded as follows:
''  %0--//--- palette address if not zero
''  %1--//--- custom character base address
«1

Comments

  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-10-01 16:12
    Looks great. Any chance you could put this in the Obex please :)
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-01 17:27
    Is today Christmas? I woke up this morning and found that it had snowed overnight and Santa had left a great big package.

    That "Santa" is Kuroneko, of course, and that "great big package" is a versatile new 40x15 VGA text driver (eh, I'm not sure what the "snow" is in this analogy).

    Yes, it appears that you hit all of my wish list and then some! That's just fantastic! Cool beans!

    So far, I've only had a cursory look at the code as I was enjoying playing with the driver to put text on the screen.

    But from that quick inspection, it looks like your main buffers in the "waitvid.40x15.ui" object consume only 600 bytes for the scrn[] buffer for the text and 1,200 bytes for the plte[] buffer for the colors (do correct me if I'm wrong). So, you've implemented this using the Propeller's full 64 VGA colors (2^2 * 2^2 * 2^2). So, we can have any combination of foreground and background colors that we desire.

    That's why I say it goes beyond what I wished for, as I would have been pretty happy with just 4 or 8 total colors. But I'll take it!!! Well, it does come at a price of an extra 600 bytes, but it should generally be worth it, assuming one has memory for it.

    But that does make me wonder if it would be (theoretically) possible to create a version that used a single byte for the colors similar to Chip's 32x15 VGA text driver, the one with the eight combinations of foreground and background colors. Maybe there's something about how the driver itself handles things that would make that difficult, don't know.

    By the way, I was curious about why the user needs to specify 4 octal digits for each of the foreground and background colors instead of three. The last (least significant) digit will always be "3" won't it (or maybe it's a "don't-care")? Maybe those bits relate to the HV bits somehow, but, offhand, I'd guess they'd get masked off. Anyway, does the user specifying 4 digits instead of 3 at the top level speed up fills or something in the .ui object or something similar? Or was that just a convenient way to code it? Whatever the reason, we can surely type another "3" here and there.

    Anyway, my memory target was 1 to 2 words per character, and you're right in the middle of that at 1.5 words/char.

    By the way, I was curious about the rationale behind that mailbox object. Guess I should look at that again. Also, it seems like you name your objects in the style of Java or something, almost like we had name spaces. You seem super organized. I guess you have to be organized (among other things) to be able to crank out a driver as fast as you did this one.

    Okay, I want to get back to "playing" with this new driver. Thanks so much for pushing the envelope on this one!!!
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-01 17:42
    That's why I say it goes beyond what I wished for, as I would have been pretty happy with just 4 or 8 total colors. But I'll take it!!! Well, it does come at a price of an extra 600 bytes, but it should generally be worth it, assuming one has memory for it.
    A paletted version can probably be arranged (have to look into it). What would be the desired split, 6/2 or 4/4 for fg/bg?
    By the way, I was curious about why the user needs to specify 4 octal digits for each of the foreground and background colors instead of three. The last (least significant) digit will always be "3" won't it (or maybe it's a "don't-care")? Maybe those bits relate to the HV bits somehow, but, offhand, I'd guess they'd get masked off. Anyway, does the user specifying 4 digits instead of 3 at the top level speed up fills or something in the .ui object or something similar? Or was that just a convenient way to code it? Whatever the reason, we can surely type another "3" here and there.
    If the colour components are part of a string you can't have 0 bytes in the middle of it. So the sync locations are a convenient place to avoid that (the driver ignores sync in colour anyway). Regardless, even leaving them 0 would force you to specify 4 octals because sync is in the least significant digit (%%rgbs). For the two out calls in the random section they are redundant (force of habit I guess).

    You can obviously change the UI to accept %%rgb and adjust for the internal format (unnecessary overhead) but if you write to the palette buffer directly then %%rgb? is required.
    By the way, I was curious about the rationale behind that mailbox object.
    Can you elaborate? Mailboxes are usually used to communicate with the driver, in this case only the frame sync is delivered but the UI ignores it. Other driver models allow for dynamic relocation of screen/colour/font buffers so they need some space to communicate.

    The important thing is just the driver. UI and demo are just for showing something, feel free to put you own creation(s) on top of it.
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-01 17:47
    Oh, forgot to mention that the driver's output is absolutely *rock steady* so far on the 7" display (with driver board) I'm currently using ("Of course," kuroneko and Chip replied in unison). I looked at it with a magnifying glass and I don't see any crawling or flicker or other anomalies. Well, I've just checked regular text on it, not any of those special electronics symbols in the font (it's conceivable that they might jitter a bit being narrower and due to A/D conversion or the LCD or whatever). By the way, does your comment at the top of the PASM driver saying "%11 sync locked" mean anything other than the two least significant bits being used for H&V? I suppose not. Anyway, the output is rock solid!
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-01 17:54
    About my "mailbox" musing, I was deliberately vague, as I didn't exactly know what to ask and don't recall ever using an object here on the forum with that feature (but I haven't used that many objects). Thanks for the explanation, and sorry about being vague. If I do have a specific question, maybe I can ask later. Good morning, and thanks for all of your above replies; they make perfect sense.
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-01 17:56
    By the way, does your comment at the top of the PASM driver saying "%11 sync locked" mean anything other than the two least significant bits being used for H&V?
    Admittedly that's misleading since there is a constant for it. 640x480x60 comes with negative sync polarity so idle is %11. I have other drivers which use %00 (any 800x600 variety) and in this case the code can be simplified which literally means locked as in can't be changed (easily). Consider it a don't touch.
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-01 18:11
    I see. Thanks. Also, I was curious if you thought an 800x480 (50x15) version of this was possible. Wonder if there's enough time in the HSYNC period for an extra 8 characters. I'm just curious. I'm not requesting that, per se, as I'm perfectly happy with this 40-column version. In fact, I think I prefer the way 40 columns gets stretched on my WVGA screen. They're more bold or something. They seem "just right" even though stretched. Well, 50 columns also looked good and matches the actual resolution of the display I'm using (800x480), so I'm surprised to see myself saying that, but 40 characters stretched across the display do look quite good. Nevertheless, there are times that one may need more columns, and the "native" 50 looks pretty good, too, of course. Again, I'm not asking for such a driver (they do say, "Give them an inch and they take a mile" but I'm super pleased with the current driver). Such a 50-column driver has its uses, of course, but also ups the memory requirements.
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-02 00:26
    A paletted version can probably be arranged (have to look into it). What would be the desired split, 6/2 or 4/4 for fg/bg?

    So, do the "6/2" and "4/4" splits for the fg/bg colors refer to a total of 8 bits (1 byte)? That is, there could be either 4 or 6 bits for an index for the foreground color, with the remaining bits as an index for the background. I mean, would a palette selection byte for each character exist and be split up into two index parts, either 6 bits and 2 bits or 4 bits and 4 bits?

    If so, I believe that, for each character, the former would provide for any one of the 64 possible colors as a foreground color on any one of 4 background colors (selected from the 64 possible). And the latter would give any one of 16 possible colors (selected from the 64 possible) as a foreground color on any one of 16 colors (selected from the 64 possible) as a background color, again for each character. That's assuming that you don't need to reserve the last 2 bits for H&V, as I suppose the driver would look up the actual color values from the table and shift things to make room for H&V. Anyway, the bit patterns (of the split) would be indexes into a color table, not the actual colors themselves (which is why I guess you said palette). Have I got that right?

    Offhand, I think I'd prefer an even split, as I'd like to be able to do reverse video colors for several combinations of fg/bg on the screen. For example, I might want a red bar (made from spaces) across the top of the screen, a blue center text area, a white bar across the bottom and maybe a text field in the blue area somewhere. If so, I've already used up my 4 possible background colors. And I still might want to do some other text on a different background as a special effect.

    As a side note, I might want to wire up only 3 pins for for VGA (one pin for each color), as opposed to the full 6, not including HV. In that case, 3 pins only allows for 8 colors (2^1 * 2^1 * 2^1). However, offhand, I think the same analysis applies about wanting more background color possibilites to choose from than just 4.

    Anyway, 16 possible foreground colors (on 16 backgrounds, even if they used the same color set as the foreground) is a lot of possible colors on the screen at one time. And I think the user would be hard pressed to tell that we didn't have the full 64 available (for the foreground, anyway) on screen at one time.

    By the way, would we be able to change the palette colors at will (in the table), such as to change colors sets between pages or to maybe do blinking characters without rewriting the text, just by changing the colors in the palette table corresponding to the fg/bg byte(s) of the characters that we wanted to blink/change? That might be nice.

    Anyway, I realize you've got your hands full at the present time, so don't feel compelled to think about this, if ever, of course. But I noticed that I hadn't responded to your question above and I wanted to address it (it turned out to be more complex than I realized). Also, I'm partly just trying to confirm my understanding of what you were asking. I'm afraid I've overlooked something, and you might not be able to access the font data and apply the colors fast enough (though the current driver is working).
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-02 02:34
    So, do the "6/2" and "4/4" splits for the fg/bg colors refer to a total of 8 bits (1 byte)? That is, there could be either 4 or 6 bits for an index for the foreground color, with the remaining bits as an index for the background. I mean, would a palette selection byte for each character exist and be split up into two index parts, either 6 bits and 2 bits or 4 bits and 4 bits?
    I will answer in more detail later but have a look at the [thread=139112]128xP driver[/thread] which uses a 6/2 split (6bit foreground (%%rgb), 2bit palette index for background). So basically colour info is reduced to a byte, question is what should it mean?
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-02 19:36
    Just to tidy things up. Yes, the intention is to cut down colour info to a byte. A 6/2 split would then be the real foreground colour (no point for a lookup) and an index for the background colour. A 4/4 split OTOH would provide 2 indices which could either point to the same colour table (max 16 colours on screen) or even have separate tables for fg/bg colours (max 32 colours on screen). Palette update would happen once per frame. HTH
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-02 21:29
    Yeah, duh! A 6-bit foreground portion basically has no need to use indices on a 64-color system. However, I guess an exception to that is if one wanted to change the color of text characters associated with a particular index on the fly nearly instantly (in ~1/60th of a second) without user code redrawing anything, such as blinking text or text that disappeared without needing to clear the screen or draw over the text.

    Also, if using indices, as a somewhat special case, one could have two different indices that resolved to the same color from the color table (two entries in the table with the same value). For example, all the blue text on screen of exactly the same shade might be linked to the color table by two (or more) indices. Thus, when one of the color entries in the color table was changed (for one of the blues), only the blue text that corresponded to that table entry would change color, not the other blue text. But using that to change text color probably isn't so common, other than for blinking/flashing text, which can also be done pretty effectively for a limited amount of text by simply drawing over it, so no big loss if it isn't there.

    As an aside, where such instant color changing capability would come in handy is with complex graphics shapes (which we don't have in a text driver, of course), where the entire shape, even discontinuous, could have its color changed instantly by changing the corresponding entry in the color table (that's one reason I like the color table of the P2). For example, say one had an app with country flags which needed to be colored appropriately by cycling through various colors by clicking. With a color table, the color could be changed without having to redraw any potentially weird/complex shapes. Such would be good for highlighting button presses, too (though I'll admit that video graphics these days are powerful enough to redraw everything without using such a table trick and basically need to anyway to do animation).

    But, again, for text, there's not much of a use case for instantaneous changes to text color (although one could fake clearing a portion of text that way by setting it to the background color). So, actual colors in the 6-bit portion of the color byte seems the way to go and saves the memory that would be needed for a foreground color table.

    But as far as what's the best spit, 6/2 or 4/4, though I said what I said above about being worried about not having enough background colors on screen at one time, I guess 4 is pretty good for most cases (but I definitely wouldn't want less). So, don't let that cloud your decision if you decide to attempt a new driver, i.e., code it as you see fit (we will gladly use it either way).

    And if using a 4/4 split, I'm guessing just one table is enough: [1] for text, I think 16 colors is more than enough, as that's a slew of color combinations, and, [2] one table, as opposed to two, would save memory, maybe only 16 bytes for the table plus space for the code loaded via eeprom, but every byte counts on the Prop and I'm not sure there's much advantage to having a separate set for the background colors. Actually, I didn't try to come up with a use. I guess if people are picky about the available color combinations, there might be something to having two tables. It is actually a bit tricky to choose fg/bg combinations that work well, though high contrast usually works best.

    Anyway, 6/2 or 4/4 (the latter with 1 or 2 tables): we'll be thrilled whatever way you go, if you do take a stab at it (and from what I've seen of you recently, you're probably just putting the finishing touches on the code now).
  • jazzedjazzed Posts: 11,803
    edited 2013-10-03 09:14
    Nice work so far!

    Small is very important, and it looks like this is going the right direction.

    The number of rows is a bit limiting though. Is there no way to get 40x30 out of this driver?

    The standard VgaText.spin driver will do 32x30 just by redefining cols and rows. That is very useful for program text editing.

    Regardless of my own requirements, it looks like I'll have no trouble making simple libraries with this 40x15 code or variations of it.

    Thanks Marko.
    --Steve
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-03 16:26
    jazzed wrote: »
    The standard VgaText.spin driver will do 32x30 just by redefining cols and rows. That is very useful for program text editing.
    Looks like it's not that simple. Using the VGA_Text_Demo with 32x30 in VGA_Text doesn't give me a valid signal. What else do I need? VGA_Text uses this default setup (rate = clkfreq >> 2).
    vga_params              long    0               'status
                            long    1               'enable
                            long    0               'pins
                            long    %1000           'mode
                            long    0               'videobase
                            long    0               'colorbase
                            long    cols            'hc
                            long    rows            'vc
                            long    1               'hx
                            long    1               'vx
                            long    0               'ho
                            long    0               'vo
                            long    512             'hd
                            long    10              'hf
                            long    75              'hs
                            long    43              'hb
                            long    480             'vd
                            long    11              'vf
                            long    2               'vs
                            long    31              'vb
                            long    0               'rate
    
  • PropGuy2PropGuy2 Posts: 360
    edited 2013-10-03 16:38
    I also like the 40 x 15 VGA single cog driver - very nice and stable too. Nice to have would be an easy-to-use color palette table, and a curser command to set the screen row & column using Variables instead of Constants.
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-03 16:52
    PropGuy2 wrote: »
    I also like the 40 x 15 VGA single cog driver - very nice and stable too. Nice to have would be an easy-to-use color palette table, and a curser command to set the screen row & column using Variables instead of Constants.
    Grrr. I should have skipped this one and go straight for the [thread=150636]50x18 release[/thread] :)

    Palette support is on the way (seems there is enough demand now). As for cursor positioning, what's wrong with the ESC sequence? But yes, a method (e.g. gotoXY) is easy enough to implement.
    PUB gotoXY(cx, cy)
    
      if flag.byte{0} == "="
        flag := 0                                           ' cancel ESC sequence (optional)
    
      x := 0 #> cx <# constant(columns -1)
      y := 0 #> cy <# constant(rows -1)
    
    Note that the UI object I use is just part of the driver demo. Feel free to wrap anything else around the low level driver depending on what you are used to or what you need.
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-03 17:45
    PropGuy2 wrote: »
    Nice to have would be an easy-to-use color palette table, ...
    Just for clarification, full colour support as it is now is too much? You specifically want palette support?
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-03 19:50
    Maybe he means passing one parameter to select a FG/BG pair. As for greedy me, I'd just like to see another 600 bytes shaved off. By the way, this is a great driver. I think people will progressively catch on.
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-03 20:34
    Attached is a palette demo (4/4 split). Foreground and background palettes have 16 entries each. During startup (overrides default colour) and normal operation the palette can be updated by providing a 32byte array with the required colours. Once this is finalised I move this driver to the top post.
    '' mailbox layout
    ''
    '' long[par][0]:  screen: [!Z]:addr = 16:16 -> zero (accepted), 2n
    '' long[par][1]: palette: [!Z]:addr = 16:16 -> zero (accepted), 2n
    '' long[par][2]:  colour: [!Z]:addr = 16:16 -> zero (accepted), 2n
    '' long[par][3]: frame indicator
    
    Note that index two has been renamed to colour, index 1 is now use for a real palette.
  • jazzedjazzed Posts: 11,803
    edited 2013-10-03 23:39
    Hi Marko,

    You're right. My parameters are a bit different (and in C).

    Can you try the attached binary?

    Thanks.
    vga->status = 0;
        vga->enable = 1;
        vga->pins   = basepin | 0x7;
        vga->mode   = 0b1100;
        vga->screen = (long) gVgaScreen;
        vga->colors = (long) gcolors;
        vga->ht = VGA_TEXT_COLS;
        vga->vt = VGA_TEXT_ROWS;
        vga->hx = 1;
        vga->vx = 1;
        vga->ho = 0;
        vga->vo = 0;
        vga->hd = 512;
        vga->hf = 15;
        vga->hs = 74;
        vga->hb = 43;
        vga->vd = 480;
        vga->vf = 14;
        vga->vs = 2;
        vga->vb = 31;
        vga->rate = CLKFREQ >> 2;
    

    kuroneko wrote: »
    Looks like it's not that simple. Using the VGA_Text_Demo with 32x30 in VGA_Text doesn't give me a valid signal. What else do I need? VGA_Text uses this default setup (rate = clkfreq >> 2).
    vga_params              long    0               'status
                            long    1               'enable
                            long    0               'pins
                            long    00           'mode
                            long    0               'videobase
                            long    0               'colorbase
                            long    cols            'hc
                            long    rows            'vc
                            long    1               'hx
                            long    1               'vx
                            long    0               'ho
                            long    0               'vo
                            long    512             'hd
                            long    10              'hf
                            long    75              'hs
                            long    43              'hb
                            long    480             'vd
                            long    11              'vf
                            long    2               'vs
                            long    31              'vb
                            long    0               'rate
    
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-04 00:01
    jazzed wrote: »
    Can you try the attached binary?
    While the monitor now recognises a signal all I get is a black screen with a slightly shaky menu display. Applying your settings to VGA_Text results in the same black screen. I assume my LCD monitor simply doesn't cope with the interlaced scan mode (%1100).
  • jazzedjazzed Posts: 11,803
    edited 2013-10-04 09:20
    kuroneko wrote: »
    While the monitor now recognises a signal all I get is a black screen with a slightly shaky menu display. Applying your settings to VGA_Text results in the same black screen. I assume my LCD monitor simply doesn't cope with the interlaced scan mode (%1100).

    Thanks Marko.

    This is a good data point. My monitor must be very forgiving.
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-05 02:02
    Memory-saving palette version, FANTASTIC! See post 19 for the download link (maybe it could be added to the first post, too).

    Thanks for doing this, Marko. This new version together with the original version are bound to be quite useful to many folks.

    So far, I've only put a few letters on the screen, but it seems to work as advertised. For now, the user interface to the driver has been "left as an exercise to the reader," as they say, but that's totally understandable, as people can program it the way they want (and also this is early version of the driver, not necessarily the final one).

    Regarding going for the 4/4 split, I think that was a good choice (such that the BG colors aren't limited to 4 simultaneous ones). And as far as using 2 tables for the FG and BG colors, that was a good judgement call on your part (I was being too greedy to care about saving a few bytes there); it's more flexible at little cost.

    Again, to anyone reading, I think this looks great on the common/smallish 800x480 screens, stretched from 640. And getting an extra 8 columns helps a lot and makes for more normal-looking characters (as I feel that 32 columns gets stretched a bit much on a WVGA screen).

    Also, the Parallax font, which consistently has font strokes that are three pixels wide, is a beautiful font and looks really good displayed full-form at 16x32 (which is not to say that it wouldn't also look good displayed with half-height characters for 30 rows, particularly on larger screens).

    Thanks again, Marko, for putting this together and figuring it out. Bruce, in "Bruce Almighty" was "Mr. Exclusive"; you're Mr. (Mission) Impossible.

    Red Alert: 1200 bytes, people! 600 for characters, 600 for the fg/bg color pairs, one pair per character. What more could you ask for!
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-05 06:19
    The top post now contains the latest driver versions for both full colour and paletted driver. If there are any issues let me know.
  • PropGuy2PropGuy2 Posts: 360
    edited 2013-10-11 14:14
    kuroneko - I recently downloaded your 1 cog VGA 40x15 driver demo. Thank you so much for writing it, really appreciated. For the past few days I have thoroughly gone thru the code, and checked the V & H sync pulses on a scope. Everything checked out well, good clean sync pulses. With your blessing and approval (hopefully), I cleaned up some of the code, and condensed some of the modules to make it more user friendly and understandable. Still on my "To Do List" is (1) to try to add a "user defined font" (using OUT(256), and above) ) - (2) add a second VGA driver for a second VGA monitor screen. Thanks again. See attachment for "VGA_40x15_demo" (edited & updated 10-11-2013)
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-11 15:19
    PropGuy2 wrote: »
    With you blessing and approval (hopefully), I cleaned up some of the code, and condensed some of the modules to make it more user friendly and understandable.
    FWIW, I'd be happy to just release the actual driver (but know that that's not enough) and let people do their own frontend. So feel free to adjust the existing code. The only thing I'd ask for is that you add a note at the top pointing out the changes you made (and adjust the version number).

    In the UI object, the init method issues an out(FF{== 12}) (clear screen) which doesn't work anymore with your changes (you should use $01 now). Also note, FF is not $FF.
  • StephenMooreStephenMoore Posts: 188
    edited 2013-10-14 22:33
    This is an excellent driver!

    Clean, great color, fast and easy to use.

    It amazes me how freely some of the best I've ever come across offer their talents to us plebes... thanks Kuroneko.

    This video driver will find it's way to all of my vga applications.

    Regards,

    sm
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-14 23:10
    @StephenMoore: Glad you find it useful. Thank you!
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-18 21:09
    An update to the paletted driver has been released. Characters 0..31 can now be customised (by default they use the ROM font).
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-10-19 02:57
    Hey, Marko. Your driver just keeps getting better and better!! And it was already great to start with. I've only ran your demo and glanced at the code for a couple minutes, but I noticed that it appears the VAR section of the demo reserves 32 longs per custom font character (128 bytes/char for a total of 4K) instead of 32 words for each (64 bytes/char for a total of 2K) and was curious as to the reason. Maybe the "extra" storage is necessary to make this remapping possible, don't know. Also I haven't defined any characters yet, but I'm wondering if we have to do any interleaving in the definition (hopefully not, though it would be understandable). I'm headed out now but will try to check that tomorrow. Apologies for the quick inspection. Thanks for your continuing work on this useful and increasingly *versatile* driver. --Jim
  • kuronekokuroneko Posts: 3,623
    edited 2013-10-19 03:33
    ... but I noticed that it appears the VAR section of the demo reserves 32 longs per custom font character (128 bytes/char for a total of 4K) instead of 32 words for each (64 bytes/char for a total of 2K) and was curious as to the reason.
    Ah yes, something felt wrong (well spotted). 32*32/2 are enough (32 longs for an interleaved pair). It follows the ROM format since all that's changed is the source where the pattern is read from. If you check localroger's driver, it includes a painless example of how interleaved characters can be defined with the exception that his font is only 16x16. I uploaded a fix.

    Note that you don't necessarily need to define(/reserve space for) the whole array if you use less characters.
Sign In or Register to comment.