Author Topic: [MiniSDK] how to draw on screen sprites converted with SourceCoder  (Read 5184 times)

0 Members and 1 Guest are viewing this topic.

Offline helder7

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 185
  • Rating: +33/-1
    • View Profile
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?

Offline Reo

  • LV3 Member (Next: 100)
  • ***
  • Posts: 64
  • Rating: +15/-0
    • View Profile
Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
« Reply #1 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.
« Last Edit: April 01, 2012, 06:39:16 pm by Reo »

Offline helder7

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 185
  • Rating: +33/-1
    • View Profile
Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
« Reply #2 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


Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
« Reply #3 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.


I'll be back.

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
« Reply #4 on: April 02, 2012, 10:55:22 am »
Color= insigned short

Offline helder7

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 185
  • Rating: +33/-1
    • View Profile
Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
« Reply #5 on: April 03, 2012, 01:20:32 pm »
when I call the image, it is always is behind the G3A_main



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?
« Last Edit: April 03, 2012, 05:59:24 pm by helder7 »

Offline SimonLothar

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 129
  • Rating: +35/-1
    • View Profile
Re: [MiniSDK] how to draw on screen sprites converted with SourceCoder
« Reply #6 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.
I'll be back.