BASIC drawing on something other than 320x200@256 color?

All aspects of programming on the Commander X16.
Post Reply
Fruggs
Posts: 4
Joined: Thu Oct 24, 2024 10:29 pm

BASIC drawing on something other than 320x200@256 color?

Post by Fruggs »

Hi, thanks for looking at my questions.

Looking at SCREEN and the values listed in the Modes table in Chapter 3: Editor, it looks like BASIC can only access one bitmap mode, 320x200@256 color. Is the documentation outdated or is that really the only bitmap mode?

VERA has registers that look like I can set a 640x480 bitmap mode. For my use, I might want to mess around with 4 colors at this resolution, so I think I'll be okay with the VRAM limitations. If I poke in the values to set this mode, will BASIC drawing commands (FRAME, RECT, RING, OVAL, etc) work?
User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

Re: BASIC drawing on something other than 320x200@256 color?

Post by ahenry3068 »

Fruggs wrote: Thu Oct 24, 2024 10:47 pm Hi, thanks for looking at my questions.

Looking at SCREEN and the values listed in the Modes table in Chapter 3: Editor, it looks like BASIC can only access one bitmap mode, 320x200@256 color. Is the documentation outdated or is that really the only bitmap mode?

VERA has registers that look like I can set a 640x480 bitmap mode. For my use, I might want to mess around with 4 colors at this resolution, so I think I'll be okay with the VRAM limitations. If I poke in the values to set this mode, will BASIC drawing commands (FRAME, RECT, RING, OVAL, etc) work?

You can set other modes on VERA with BASIC Poke. At that point your on your own because the BASIC drawing commands only work in Mode $80. As a matter of fact even getting into the FB_ & GRAPH_ routines in ROM they are all 8 bit 320x240 specific.

As far as 640x480 4bpp. I made the same mistake. There is not quite the VRAM to handle that mode. You can do 640x480 in 1bpp or 2bpp. If you want a very interesting programming issue You could create a 640x400 4bpp graphics buffer but with no room left for sprites or tiles. Everything would have to be done in Graphics even your text (if any).
kelli217
Posts: 531
Joined: Sun Jul 05, 2020 11:27 pm

Re: BASIC drawing on something other than 320x200@256 color?

Post by kelli217 »

They do say 4 colors, so that is only 2 bits per pixel... ;)
User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

Re: BASIC drawing on something other than 320x200@256 color?

Post by ahenry3068 »

kelli217 wrote: Fri Oct 25, 2024 3:11 pm They do say 4 colors, so that is only 2 bits per pixel... ;)
I guess I misread a little. The main point though is after you set the mode BASIC & the ROM has no builtin
support for other graphics modes.
User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: BASIC drawing on something other than 320x200@256 color?

Post by desertfish »

@fruggs, where did you read it's 320x200? because that was a LONG time ago it has been 320x240 (x256 colors) for a pretty long while now. Talking about screen mode 128.
DragWx
Posts: 341
Joined: Tue Mar 07, 2023 9:07 pm

Re: BASIC drawing on something other than 320x200@256 color?

Post by DragWx »

desertfish wrote: Fri Oct 25, 2024 4:08 pm @fruggs, where did you read it's 320x200? because that was a LONG time ago it has been 320x240 (x256 colors) for a pretty long while now. Talking about screen mode 128.
I'm not the OP, but it looks like the Kernal page of the docs is out of date, and says 320x200 by mistake. I checked the latest revision of the ROM just to be sure.
User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: BASIC drawing on something other than 320x200@256 color?

Post by desertfish »

I've created 2 github PR's to correct this in the documentation.
Fruggs
Posts: 4
Joined: Thu Oct 24, 2024 10:29 pm

Re: BASIC drawing on something other than 320x200@256 color?

Post by Fruggs »

Thanks for the info, cool insights 8-)
Post Reply