Ok i got it a little further, heres my code:
#include "fxlib.h"
#include "stdlib.h"
#include "stdio.h"
#include "libg85.c"
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int key;
Bdisp_AllClr_DDVRAM();
drawSprite(5,7,30,19);
while(1){
GetKey(&key);
}
return 1;
}
typedef char*(*sc_cpv)(void);
const unsigned int sc0135[] = { 0xD201D002, 0x422B0009, 0x80010070, 0x0135 };
#define Disp_GetVRAMPtr (*(sc_cpv)sc0135)
void drawSprite(const unsigned char *bmp, int x, int y, int width, int height)
{
unsigned short line;
char shift, *screen, *p=(char*)&line;
int i, j, begin=0, end=height, real_width=(width-1>>3<<3)+8;
if(!bmp || x<0 || x>128-width || y<1-height || y>63 || width<1 || height<1) return;
if(y < 0) begin = -y;
if(y+height > 64) end = 64-y;
shift = 8-(x&7);
screen = Disp_GetVRAMPtr()+(y+begin<<4)+(x>>3);
for(i=begin ; i<end ; i++)
{
for(j=0 ; j<width-1>>3 ; j++)
{
line = bmp[i*(real_width>>3)+j]<<shift;
screen[j] |= *p;
if(shift!=8) screen[j+1] |= *(p+1);
}
line = (bmp[i*(real_width>>3)+j] & -1<<(real_width-width))<<shift;
screen[j] |= *p;
if(shift!=8 && x+real_width<129) screen[j+1] |= *(p+1);
screen += 16;
}
}
const unsigned char imagedata[] = {0x41,
0x38,0x00,0x00,0x41,0x44,0x00,0x00,0x63,0x40,0x00,0x00,0x63,0x40,0x00,0x00,0x55,0x38,0x00,0x00,0x55,0x04,0x00,0x00,0x49,
0x04,0x00,0x00,0x49,0x44,0x00,0x00,0x41,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x3E,0x00,0x00,0x44,0x41,0x1C,0x00,0x42,
0x80,0xA2,0x00,0x42,0x80,0xA0,0x00,0x42,0x80,0xA0,0x00,0x42,0x80,0x9C,0x00,0x42,0x80,0x82,0x00,0x44,0x80,0x82,0x00,0x78,
0x41,0x22,0x00};
//****************************************************************************
//************** ****************
//************** Notice! ****************
//************** ****************
//************** Please do not change the following source. ****************
//************** ****************
//****************************************************************************
#pragma section _BR_Size
unsigned long BR_Size;
#pragma section
#pragma section _TOP
//****************************************************************************
// InitializeSystem
//
// param : isAppli : 1 = Application / 0 = eActivity
// OptionNum : Option Number (only eActivity)
//
// retval : 1 = No error / 0 = Error
//
//****************************************************************************
int InitializeSystem(int isAppli, unsigned short OptionNum)
{
return INIT_ADDIN_APPLICATION(isAppli, OptionNum);
}
#pragma section
It seems to work better than the other code, but it still has 1 error when i attempt to compile. The output:
Executing Hitachi SH C/C++ Compiler/Assembler phase
set SHC_INC=C:\Program Files\CASIO\fx-9860G SDK\OS\SH\include
set PATH=C:\Program Files\CASIO\fx-9860G SDK\OS\SH\bin
set SHC_LIB=C:\Program Files\CASIO\fx-9860G SDK\OS\SH\bin
set SHC_TMP=C:\Users\Owner\Desktop\Calc Dev Projects\Image Real\Debug
"C:\Program Files\CASIO\fx-9860G SDK\OS\SH\bin\shc.exe" -subcommand=C:\Users\Owner\AppData\Local\Temp\hmk9904.tmp
C:\Users\Owner\Desktop\Calc Dev Projects\Image Real\realimag.c(23) : C2144 (E) Type mismatch
HMAKE MAKE UTILITY Ver. 1.1
Copyright (C) Hitachi Micro Systems Europe Ltd. 1998
Copyright (C) Hitachi Ltd. 1998
ERROR: Process failed with return code: 1
Build was not successful.
Any ideas?
Edited by shinolife63, 21 April 2013 - 09:29 PM.