Omnimaga

Calculator Community => Casio Calculators => Topic started by: helder7 on April 01, 2012, 06:21:17 pm

Title: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: helder7 on April 01, 2012, 06:21:17 pm
Hello, i tried convert sprites with cemetech sourcecoder, for use in an application developed with miniSDK

to show images, i used the routine CopySprite by Kerm:

Code: [Select]
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;
   }
}

I called the image with the following function

Code: [Select]
void xxx() {

    Bdisp_EnableColor(1);
    CopySprite(spritename, 0, 0, 40, 40);
    Bdisp_PutDisp_DD();
}

but, when i compile the source, the sdk gives me the following errors:


Code: [Select]
Execute: C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT.INI
"C:\Users\HELDER\Documents\CASIO\MiniSDK\BIN\SHCPP.EXE" -SUB=TEMP.TXT INSIGHT 000E12F2
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(29) : C5020 (E) Identifier "color_t" is undefined
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(29) : C5020 (E) Identifier "data" is undefined
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(29) : C5029 (E) Expected an expression
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(29) : C5065 (E) Expected a ";"
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(30) : C5020 (E) Identifier "VRAM" is undefined
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(30) : C5029 (E) Expected an expression
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(30) : C5065 (E) Expected a ";"
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(31) : C5020 (E) Identifier "LCD_WIDTH_PX" is undefined
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(269) : C5192 (W) Unrecognized character escape sequence
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(365) : C5020 (E) Identifier "Bdisp_EnableColor" is undefined
C:\Users\HELDER\Documents\CASIO\MiniSDK\projects\INSIGHT\INSIGHT.CPP(393) : C5020 (E) Identifier "Bdisp_EnableColor" is undefined
Dependency: "C:\Users\HELDER\Documents\CASIO\MiniSDK\objects\INSIGHT.obj" does not exist!
Dependency: "C:\Users\HELDER\Documents\CASIO\MiniSDK\objects\INSIGHT.obj" does not exist!
Ready

someone can help me?
Title: Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: Reo on April 01, 2012, 06:24:49 pm
You're missing an include file which defines some of these things. I'm thinking it's one (or more) of these three: display_syscalls.h, display.h, and/or disp_tools.hpp.
Title: Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: helder7 on April 02, 2012, 04:33:19 am
You're missing an include file which defines some of these things. I'm thinking it's one (or more) of these three: display_syscalls.h, display.h, and/or disp_tools.hpp.
I have all these files

(http://i.imgur.com/1NtVQ.jpg)
Title: Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: SimonLothar on April 02, 2012, 10:02:14 am
color_t seems to be unsigned short
LCD_WIDTH_PX should be 0x180

Bdisp_EnableColor is EnableColor with the miniSDK.


Title: Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: Eiyeron on April 02, 2012, 10:55:22 am
Color= insigned short
Title: Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: helder7 on April 03, 2012, 01:20:32 pm
when I call the image, it is always is behind the G3A_main

(http://i.imgur.com/E03S9.gif)

function to call the image:
Code: [Select]
void image() {
    Bdisp_AllClr_VRAM();
    EnableColor(1);
    CopySprite(prizma, 0, 0, 319, 186);
    Bdisp_PutDisp_DD();
}

POST EDITED: bug fixed

Code: [Select]
  void image() {
  int key;
  Bdisp_AllClr_VRAM();
    EnableColor(1);
    CopySprite(prizma, 0, 0, 319, 186);
    Bdisp_PutDisp_DD();
GetKey( &key );
}

now i need a way to clear the Status Area, does anyone know?
Title: Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
Post by: SimonLothar on April 04, 2012, 10:45:52 am
You will find some information in fx_calculators_SuperH_based_10.chm.
see fx-CG20 - Syscalls, display

F. i. syscall: 0x02B7, 0x02B8, 0x02B9, 0x02BA, 0x02BB, 0x1D7B, 0x1D81, 0x1D86.

As for application examples investigate INSIGHT.CPP.