You could use the XORSprite routine instead of CopySprite and erase the cursor just by drawing it again.
Replace moveCursor with this, if you want it to go 2px:
Code:
Code:
void moveCursor(struct Coord* cursor) {
if( keydown(KEY_PRGM_UP) && cursor->y>0) cursor->y-=2;
if( keydown(KEY_PRGM_DOWN) && cursor->y<LCD_HEIGHT_PX) cursor->y+=2;
if( keydown(KEY_PRGM_LEFT) && cursor->x>0) cursor->x-=2;
if( keydown(KEY_PRGM_RIGHT) && cursor->x<LCD_WIDTH_PX) cursor->x+=2;
}
Hehe. I'm going to make people think I have internet on my Prizm.
Big Pic:
http://i43.tinypic.com/357n91k.jpg
Another Pic:
http://i39.tinypic.com/34q4t5g.jpg
Big Pic:
http://i43.tinypic.com/357n91k.jpg
Another Pic:
http://i39.tinypic.com/34q4t5g.jpg
Spenceboy98 wrote:
Hehe. I'm going to make people think I have internet on my Prizm.
I really have internet on my Prizm
Hint: FXTerm + linux + lynx
MPoupe wrote:
Spenceboy98 wrote:
Hehe. I'm going to make people think I have internet on my Prizm.
I really have internet on my Prizm
Hint: FXTerm + linux + lynx
Someone needs to write an X Window server or a VNC viewer (preferably a VNC viewer) for the Prizm that can work over the serial port. Then you can easily have a full graphical Web browser on your Prizm.
If I had a Prizm I'd totally write a VNC viewer. VNC is not terribly complicated (about as complicated as a VT100 emulator). I wrote a simple one in Linux already in about a day.
MPoupe wrote:
Spenceboy98 wrote:
Hehe. I'm going to make people think I have internet on my Prizm.
I really have internet on my Prizm
Hint: FXTerm + linux + lynx
I don't have linux. Besides, I'm thinking wireless. They will probably believe it too. I looked up what a VNC is, and I think it would be awesome to make a viewer for the Prizm. Too bad I don't know how to make one....
How do you do an text input function in C? Also, how do you do different fonts if possible? If I did do text input, could I put it anywhere on the screen?
Note: I didn't edit last post because this post has nothing to do with it.
Note: I didn't edit last post because this post has nothing to do with it.
souvik1997 wrote:
I suggest you go through a C tutorial somewhere to learn the basics of C, such as pointers, variables, loops, and such.
I agree completely with this. Knowing C will help the questions be minimal. Although if you have any hard questions be sure to ask.
christop wrote:
MPoupe wrote:
Spenceboy98 wrote:
Hehe. I'm going to make people think I have internet on my Prizm.
I really have internet on my Prizm
Hint: FXTerm + linux + lynx
Someone needs to write an X Window server or a VNC viewer (preferably a VNC viewer) for the Prizm that can work over the serial port. Then you can easily have a full graphical Web browser on your Prizm.
If I had a Prizm I'd totally write a VNC viewer. VNC is not terribly complicated (about as complicated as a VT100 emulator). I wrote a simple one in Linux already in about a day.
Maybe, when you have enough money, you can buy a Prizm. You could try to find a cheap one somewhere.
Spenceboy98 wrote:
christop wrote:
MPoupe wrote:
Spenceboy98 wrote:
Hehe. I'm going to make people think I have internet on my Prizm.
I really have internet on my Prizm
Hint: FXTerm + linux + lynx
Someone needs to write an X Window server or a VNC viewer (preferably a VNC viewer) for the Prizm that can work over the serial port. Then you can easily have a full graphical Web browser on your Prizm.
If I had a Prizm I'd totally write a VNC viewer. VNC is not terribly complicated (about as complicated as a VT100 emulator). I wrote a simple one in Linux already in about a day.
Maybe, when you have enough money, you can buy a Prizm. You could try to find a cheap one somewhere.
http://www.ebay.com/itm/BRAND-NEW-Casio-PRIZM-fx-CG10-Graphic-Calculator-FULL-COLOR-DISPLAY-FREE-SHIPPNG-/330716972693?pt=Calculators&hash=item4d00448695
Links to my calculator projects
I lurk #cemetech, if you want to contact me that and email are probably best.
I lurk #cemetech, if you want to contact me that and email are probably best.
If you don't know how to create variables, that mean you never read anything about programming in C. There is a lot of tutorials on web, read some of them otherwise you will never understand anything.
Programming is like making a magic potion. You can't obtain the desired result just by mixing magical ingredients without understanding their properties.
Programming is like making a magic potion. You can't obtain the desired result just by mixing magical ingredients without understanding their properties.
hehe nice one Pierrot, also I bought my Prizm for $90 so I think it is reasonably priced. I am sure Ebay has them for cheap though.
Haha, thanks for the links to Prizms for sale, guys, but I didn't mean that I actually wanted to buy one. You could say that I'm semi-retired from the calculator community; right now I develop programs for only the TI calculators that I already have (such as my TI-86 that I bought 14 years ago when I was 14 years old!). If I were still in high school or college I'd possibly buy and write programs for the Prizm instead of the TI calculators.
How do I make the cursor sprite have a clear background? It shows up in a white box and it is bothering me. It was clear in the regular picture, but I guess sourceCoder modified it.
Edit: So, I'm not sure what to replace in my code:
Code:
What do I replace with:
Code:
Edit: So, I'm not sure what to replace in my code:
Code:
#include "keyboard.hpp"
#include "color.h"
#include "display.h"
#include "keyboard_syscalls.h"
void CopySprite(const void* datar, int x, int y, int width, int height) {
color_t*data = (color_t*) datar;
color_t* VRAM = (color_t*)0xA8000000;
VRAM += LCD_WIDTH_PX*y + x;
for(int j=y; j<y+height; j++) {
for(int i=x; i<x+width; i++) {
*(VRAM++) = *(data++);
}
VRAM += LCD_WIDTH_PX-width;
}
}
int PRGM_GetKey(){
unsigned char buffer[12];
PRGM_GetKey_OS( buffer );
return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 );
}
[Sprite Data]
struct Coord {
int x;
int y;
};
int keydown(int basic_keycode)
{
const unsigned short* keyboard_register = (unsigned short*)0xA44B0000;
int row, col, word, bit;
row = basic_keycode%10;
col = basic_keycode/10-1;
word = row>>1;
bit = col + 8*(row&1);
return (0 != (keyboard_register[word] & 1<<bit));
}
void moveCursor(struct Coord* cursor) {
if( keydown(KEY_PRGM_UP) && cursor->y>0) cursor->y-=4;
if( keydown(KEY_PRGM_DOWN) && cursor->y<LCD_HEIGHT_PX) cursor->y+=4;
if( keydown(KEY_PRGM_LEFT) && cursor->x>0) cursor->x-=4;
if( keydown(KEY_PRGM_RIGHT) && cursor->x<LCD_WIDTH_PX) cursor->x+=4;
}
int main() {
struct Coord cur;
cur.x = 0;
cur.y = 0;
while(1) {
int key = PRGM_GetKey();
if(key == KEY_PRGM_MENU) { GetKey(&key); }
moveCursor(&cur);
CopySprite(Google, 0, 0, 384, 216);
if(cur.y < 148 || cur.x < 121 || cur.y > 168 || cur.x > 181)
CopySprite(BigCursor, cur.x, cur.y, 12, 21);
if(cur.y >= 148 && cur.x >= 121 && cur.y <= 168 && cur.x <= 181)
CopySprite(CursorClick, cur.x-3, cur.y-3, 18, 24);
Bdisp_PutDisp_DD();
Bdisp_AllCr_VRAM();
}
return 0;
}
What do I replace with:
Code:
void CopySpriteMasked(const void*datar, int x, int y, int width, int height, int maskcolor) {
color_t*data = (color_t*) datar;
color_t* VRAM = (color_t*)0xA8000000;
VRAM += LCD_WIDTH_PX*y + x;
for(int j=y; j<y+height; j++) {
for(int i=x; i<x+width; i++) {
if (*(data) != maskcolor) {
*(VRAM++) = *(data++);
You use the CopySprite instead of the CopySpriteMasked routine. The only difference is that one of the colors has a special meaning (transparent) instead of literally being that color.
So, do I just replace the CopySprite with CopySpriteMasked? Or do I replace it with the whole bunch of CopySpriteMask code? Do I have to put the "void"?
You must include the function definition in your source code somewhere as it isn't defined yet. Then replace CopySprite(...) with CopySpriteMasked(...) only for images that have a mask color. Remember to also pass the mask color to it.
What do you mean "also pass the mask color to it"?
Is this the function definition?
Code:
Edit: Never mind. I figured it out. I feel stupid.
Is this the function definition?
Code:
void CopySprite(const void* datar, int x, int y, int width, int height) {
color_t*data = (color_t*) datar;
color_t* VRAM = (color_t*)0xA8000000;
VRAM += LCD_WIDTH_PX*y + x;
for(int j=y; j<y+height; j++) {
for(int i=x; i<x+width; i++) {
*(VRAM++) = *(data++);
}
VRAM += LCD_WIDTH_PX-width;
}
}
Edit: Never mind. I figured it out. I feel stupid.
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
» Go to Registration page
» Goto page Previous 1, 2, 3, 4 Next
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 2 of 4
» 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
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