![]() |
Forum Index : Microcontroller and PC projects : CMM2: V5.07.00b10 - Selectable display page
Author | Message | ||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
If you want to confuse yourself Please try V5.07.00b10 http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip This has the ability to select which page(s) are displayed on the screen Syntax is: PAGE DISPLAY n [,page] Normal example of use is: PAGE DISPLAY 3. This says show on the screen the current contents of page 3. The command does not impact the current write page In 12 bit mode you can also use: PAGE DISPAY 4,1 This sets the page to display for the top layer The command executes in the next screen blanking period. When a program ends for any reason the normal display page 0 is restored e.g. page write 1 cls rgb(red) page write 2 cls rgb(green) do page display 1 pause 100 page display 2 pause 100 loop |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
Does the underlying Chrom-ART hardware only allow for page ORing in the 12 bit mode or could it work in 8 bit CLUT mode too? Visit Vegipete's *Mite Library for cool programs. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
It can work in 4-bit CLUT mode AL44. Early versions of the firmware had this but it was pretty much useless with just 16 colours and needed lots of extra code to support. Full list of modes in LTDC are #define LTDC_PIXEL_FORMAT_ARGB8888 0x00000000U /*!< ARGB8888 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_RGB888 0x00000001U /*!< RGB888 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_RGB565 0x00000002U /*!< RGB565 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_ARGB1555 0x00000003U /*!< ARGB1555 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_ARGB4444 0x00000004U /*!< ARGB4444 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_L8 0x00000005U /*!< L8 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_AL44 0x00000006U /*!< AL44 LTDC pixel format */ #define LTDC_PIXEL_FORMAT_AL88 0x00000007U /*!< AL88 LTDC pixel format */ |
||||
Nelno![]() Regular Member ![]() Joined: 22/01/2021 Location: United StatesPosts: 59 |
Woah, awesome! Thanks for enabling this. While I agree this can be confusing, it might also enable some neat tricks, especialyl with the higher-res / bit-depth modes! |
||||
Nelno![]() Regular Member ![]() Joined: 22/01/2021 Location: United StatesPosts: 59 |
There appears to be an issue with PAGE DISPLAY in some modes. The following program (attached as pagedisplay2.zip) will show the issue for mode 7. Basically, this mode ends up showing 2 pages at once for any page other than page 0. dim numPages = 43 mode 7,8,0 dim colors(4) colors(0) = rgb(white) colors(1) = rgb(red) colors(2) = rgb(green) colors(3) = rgb(blue) for i = 0 to numPages - 1 page write i cls colors(i MOD 4) text 0,0,"Page " + str$(i) next i ' wait for monitor to sync to mode ' hit a key to go to next page for i = 0 to numPages - 1 page display i a$ = "" do while a$ = "" a$ = inkey$ loop next i end pagedisplay2.zip Note also that PAGE DISPLAY 5 fails with "Error in line 20: Address" even though my understanding is there should be 43 pages available to display in mode 7, 8 bit. PAGE DISPLAY seems to work fine in mode 1 and 2 at all bit depths, but I haven't tried it in all other modes. As for the utility of PAGE DISPLAY. I'm definitely finding uses for it. When I found the mode 7 issue I was working on a tile-based renderer that uses swapping. It's not going to be feasible without CSUBs in higher res modes just due to the double-loop required to blit a screen full of tiles, but it looks like it might be quite reasonable at 320x240 resolutions. As a working example I've attached box2.zip, which just renders a wireframe cube. This isn't using DRAW3D as I was having fun working out the rendering and optimizations myself for now. box2.zip This program can't maintain 60Hz @ 16 bits using PAGE COPY, but it can at 16 bits using PAGE DISPLAY, with about 13 ms of time left over per frame to do something else (shown as "wd:" in the stats). Furthermore, this is almost exactly the same amount of time that is left over in 8-bit depth mode at the same resolution, since the only work being done is the rendering of the text and cube (twice, once to erase the cube at the previous position and again to render the current position). I think this definitely will allow BASIC to do some things at higher resolutions that it wouldn't be able to otherwise, at least not without CSUBs, and may be particularly useful for demo effects. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
My bad There should be an error check on PAGE DISPLAY. This can't currently work in modes 3 or 5 or 6 or 7 or 12 or 13. I'll make some changes in the next beta in the meantime don't use PAGE DISPLAY for these modes. |
||||
johnd Newbie ![]() Joined: 22/10/2020 Location: United StatesPosts: 30 |
@Neino: I think this might be because the smaller resolutions are stored as single scan-line format in pages 1+, while page 0 is stored in the double scan-line format. Hmm, this is too bad actually, because the single scan-line format gives us almost twice as many pages to work with. If it comes down to having one or the other I'm not sure which I would prefer as there are advantages to both. Do I want double the off-screen pages in low-res modes (stored as single scan-lines) but have to always do a page copy to page 0, or do I want half as many off-screen pages (stored as double scan-lines like page 0) but the ability to immediately display the page without having to do a page copy. Edited 2021-02-13 18:39 by johnd |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
See the new beta |
||||
Nelno![]() Regular Member ![]() Joined: 22/01/2021 Location: United StatesPosts: 59 |
Thanks! I'll try that now. |
||||
Nelno![]() Regular Member ![]() Joined: 22/01/2021 Location: United StatesPosts: 59 |
I think I'd be fine with the ability to just swap between page 0 and 1 right now so that I can use one page for composition while displaying the other. For debugging it's actually nice to be able to directly visualize your other pages sometimes, but it's not vital. |
||||
Nelno![]() Regular Member ![]() Joined: 22/01/2021 Location: United StatesPosts: 59 |
Working as expected in mode 7 now. Thanks! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |