tschak909 Posted November 20, 2018 Share Posted November 20, 2018 Apologies for the long post, but I am trying to tackle a somewhat complex problem, and I REALLY need some help from experienced Amiga application coders (people who have actually used the Operating System routines, and don’t just man-handle the hardware) The program I am writing must run on 1.x as well as later machines, so I need to always use pre V36 operating system calls. I am porting a PLATO terminal to the Amiga. PLATO terminals are graphical terminals that also output text at arbitrary pixel positions. To do this, I have a character set, that is word-aligned, and one bitplane e.g. unsigned short chardata[]={0x0000,0xffff,0x00AA...}; with each character being defined, one right after the other. There are multiple font sizes, but I will only mention one, 8x12, which is used for the 640x400 mode to provide a 64 column by 32 line display IF the characters are laid end to end. There are two character sets, the PLATO alphanumeric font, and the user downloadable font, and the code first checks to see which to use, and point to it. There is also an offset, so that I store only the printable characters and ignore the first 32 control characters in the ASCII set. There is a current foreground, and a current background color, (which are dynamically added to the palette of the screen, as needed, and cleared on screen clear) All of this is being rendered to a 4bpp (16 color palette) display. There are four major text output modes, which specify how to treat the set and unset pixels in the bitmap: * Write – Only plot set pixels in foreground color * Rewrite – Plot set pixels in foreground color, plot unset pixels in background color. * Erase – Plot set pixels in the background color. * Inverse – Plot set pixels in background color, plot unset pixels in foreground color. In addition, there is also a Bold mode, where two pixels are plotted for every one pixel set, doubling the size of the character to 16x24 pixels. At the end of character output, the cursor is either advanced by 8 (or 16 pixels), or devanced by 8 (or 16 pixels) if Reverse mode is enabled. This is currently rendered with the following code: https://gist.github.com/tschak909/76736d770d689130a259ff93349018b9 As you can probably guess, it’s slower than Gramma on Nyquil and whiskey… I am trying to speed this up, and as I see it, I have a couple of options: (1) use BltBitMapRastPort, this would give the ability to specify a transfer mode, so that I could easily deal with the inverse, erase, etc… but it would mean that I would need to copy the monochrome bitmap into the target bitplanes and do it in two passes (one to handle the background color, if in Rewrite or inverse, and one to handle the foreground color) (2) use Intuition’s DrawImage, Similar issues with BltBitMapRastPort, but it can transfer images with lesser bitplanes onto viewports with more bitplanes using PickPlanes and PlaneOnOff fields in the Image struct, or (3) use the built in Font code. I would like to do this, except that I haven’t been able to figure out how to embed a font into the application itself (two fonts would need to be embedded, one for the PLATO alphanumeric font, and one blank font for the user font download.) As it requires a message struct as part of the Font record, which I am not sure how to fill in. but if I could use it, I could use the existing pen colors and things would wind up in the right bitplanes, and would not have to do any crazy gymnastics to make things work. Which approach should I focus on? -Thom Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.