Hey so im compleatly new to programing calculatores and whated to see how i could draw 2d shapes and hopefully get to the point where I can draw a .png (or any other image file). Any help would be greatly appreciated.

I've been on WikiPrizm for days trying to find somthing that will work just to draw 1 pixle and nothing but errores or nothing happerning. (I normaly program in python so this is very new to me, but casio python doesnt let you draw to my understanding)
https://prizm.cemetech.net/index.php?title=Display

You blit data into VRAM, then call BDisp_PutDisp_DD to push it to the display.
tripmeup wrote:
Hey so im compleatly new to programing calculatores and whated to see how i could draw 2d shapes and hopefully get to the point where I can draw a .png (or any other image file). Any help would be greatly appreciated.

I've been on WikiPrizm for days trying to find somthing that will work just to draw 1 pixle and nothing but errores or nothing happerning. (I normaly program in python so this is very new to me, but casio python doesnt let you draw to my understanding)


ComputerNerd has written an image viewer for PNGs on the Prizm, however you may need a bit more experience with the syscalls to fully understand it.
The basic idea of drawing a PNG to screen is decode it to pixels then render the pixels to display. The OS helps at step 2 with syscalls. The harder part is decoding PNG, a library is needed here.
Tari wrote:
https://prizm.cemetech.net/index.php?title=Display

You blit data into VRAM, then call BDisp_PutDisp_DD to push it to the display.


I am verry new to this but could you break down how you can "blit data into VRAM"

Im not sure what I am doing but i tried doing this:

Code:

Bdisp_SetPoint_VRAM(10,10,0xffffffff); //this I assumed would change the pixle at 10,10 to black
Bdisp_PutDisp_DD(); //this I assumed would updated it


Right now I am just looking at drawing singular pixles
tripmeup wrote:
Tari wrote:
https://prizm.cemetech.net/index.php?title=Display

You blit data into VRAM, then call BDisp_PutDisp_DD to push it to the display.


I am verry new to this but could you break down how you can "blit data into VRAM"

Im not sure what I am doing but i tried doing this:

Code:

Bdisp_SetPoint_VRAM(10,10,0xffffffff); //this I assumed would change the pixle at 10,10 to black
Bdisp_PutDisp_DD(); //this I assumed would updated it


Right now I am just looking at drawing singular pixles


The Prizm has 2 types of colours, char colours and unsigned short colours.
Bdisp_SetPoint_VRAM uses an unsigned short, so this is actually using RGB 5-6-5 instead of 8-8-8, as you would be used to. There are many constants in <fxcg/display.h>, starting with COLOR_, which represent some example colours you can use. If you want to make it black, you would use


Code:

Bdisp_SetPoint_VRAM(10,10,0x0000);
Bdisp_PutDisp_DD();
// OR
Bdisp_SetPoint_VRAM(10,10,COLOR_BLACK);
Bdisp_PutDisp_DD();


Also, the first 24 pixels at the top of the screen are underneath the 'status area' which contains the battery icon, alpha/shift icons, etc. This means you might want to try drawing a dot at (10,34) instead.
dr-carlos wrote:
tripmeup wrote:
Tari wrote:
https://prizm.cemetech.net/index.php?title=Display

You blit data into VRAM, then call BDisp_PutDisp_DD to push it to the display.


I am verry new to this but could you break down how you can "blit data into VRAM"

Im not sure what I am doing but i tried doing this:

Code:

Bdisp_SetPoint_VRAM(10,10,0xffffffff); //this I assumed would change the pixle at 10,10 to black
Bdisp_PutDisp_DD(); //this I assumed would updated it


Right now I am just looking at drawing singular pixles


The Prizm has 2 types of colours, char colours and unsigned short colours.
Bdisp_SetPoint_VRAM uses an unsigned short, so this is actually using RGB 5-6-5 instead of 8-8-8, as you would be used to. There are many constants in <fxcg/display.h>, starting with COLOR_, which represent some example colours you can use. If you want to make it black, you would use


Code:

Bdisp_SetPoint_VRAM(10,10,0x0000);
Bdisp_PutDisp_DD();
// OR
Bdisp_SetPoint_VRAM(10,10,COLOR_BLACK);
Bdisp_PutDisp_DD();


Also, the first 24 pixels at the top of the screen are underneath the 'status area' which contains the battery icon, alpha/shift icons, etc. This means you might want to try drawing a dot at (10,34) instead.


ok yes that works perfectly thank you, I then have to aske the question is it posible to draw over the status area as i have some games that do that as well, and a followup question the white bars at the side look horible is there a way to change there colour or turn thoes pixles off? thank you
tripmeup wrote:
dr-carlos wrote:
tripmeup wrote:
Tari wrote:
https://prizm.cemetech.net/index.php?title=Display

You blit data into VRAM, then call BDisp_PutDisp_DD to push it to the display.


I am verry new to this but could you break down how you can "blit data into VRAM"

Im not sure what I am doing but i tried doing this:

Code:

Bdisp_SetPoint_VRAM(10,10,0xffffffff); //this I assumed would change the pixle at 10,10 to black
Bdisp_PutDisp_DD(); //this I assumed would updated it


Right now I am just looking at drawing singular pixles


The Prizm has 2 types of colours, char colours and unsigned short colours.
Bdisp_SetPoint_VRAM uses an unsigned short, so this is actually using RGB 5-6-5 instead of 8-8-8, as you would be used to. There are many constants in <fxcg/display.h>, starting with COLOR_, which represent some example colours you can use. If you want to make it black, you would use


Code:

Bdisp_SetPoint_VRAM(10,10,0x0000);
Bdisp_PutDisp_DD();
// OR
Bdisp_SetPoint_VRAM(10,10,COLOR_BLACK);
Bdisp_PutDisp_DD();


Also, the first 24 pixels at the top of the screen are underneath the 'status area' which contains the battery icon, alpha/shift icons, etc. This means you might want to try drawing a dot at (10,34) instead.


ok yes that works perfectly thank you, I then have to aske the question is it posible to draw over the status area as i have some games that do that as well, and a followup question the white bars at the side look horible is there a way to change there colour or turn thoes pixles off? thank you


The status area can be disabled with EnableStatusArea(3);
There may be a way to draw over the side bars (Someone else will know), however you can set them to an unsigned short color (COLOR_), with FrameColor(1, color);
You cannot draw over the side bars with OS APIs, this is by design from Bdisp_PutDisp_DD().
Lephe wrote:
You cannot draw over the side bars with OS APIs, this is by design from Bdisp_PutDisp_DD().


what is

Code:
FrameColor(1, color)

ment to do then?

also do you know of any bypass to this? I just want to set them a different colour or turn them off all together

also do you know of any function that is like sleep(10)?
Well, yes, It's supposed to change the color of the rim. But "drawing over" would be controlling each pixel individually.

You can bypass it by using your own display driver. gint does this by default and natively has a resolution of 396x224. But that means the OS VRAM is now too small, so another one needs to be used...
tripmeup wrote:
Lephe wrote:
You cannot draw over the side bars with OS APIs, this is by design from Bdisp_PutDisp_DD().


what is

Code:
FrameColor(1, color)

ment to do then?

also do you know of any bypass to this? I just want to set them a different colour or turn them off all together

also do you know of any function that is like sleep(10)?

FrameColor(1, color) sets the colour of the frames to 'color'.

Yes, OS_InnerWait_ms(milliseconds) sleeps for milliseconds. 'milliseconds' can be from 1 to 2000 (2 seconds). If you want to sleep for more than 2 seconds, you need to run it again.
dr-carlos wrote:
tripmeup wrote:
Lephe wrote:
You cannot draw over the side bars with OS APIs, this is by design from Bdisp_PutDisp_DD().


what is

Code:
FrameColor(1, color)

ment to do then?

also do you know of any bypass to this? I just want to set them a different colour or turn them off all together

also do you know of any function that is like sleep(10)?

FrameColor(1, color) sets the colour of the frames to 'color'.

Yes, OS_InnerWait_ms(milliseconds) sleeps for milliseconds. 'milliseconds' can be from 1 to 2000 (2 seconds). If you want to sleep for more than 2 seconds, you need to run it again.



OK so the Wait works perfectly but im still having trouble with the frame when I try FrameColor then it stays white but if I then spam open the file then it will flash that colour for half a second
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement