Browse Source

add fx9860g emulator integrated to the folder

clean LaunchUI() func (proper switch etc..)
dev
Milang 3 years ago
parent
commit
8ab8a4cd7a
  1. 12
      AddinInfo.txt
  2. BIN
      MainIcon.bmp
  3. 77
      SuperCbr.c
  4. 112
      SuperCbr.dlw
  5. BIN
      SuperCbr.g1a
  6. 15
      SuperCbr.g1w
  7. BIN
      eActivityIcon.bmp
  8. 2
      include/levelchanger.h
  9. 10
      include/score.h
  10. 2
      src/bonus.c
  11. 12
      src/ennemi.c
  12. 4
      src/keyboard.c
  13. 87
      src/levelchanger.c
  14. 2
      src/main.c
  15. 15
      src/score.c

12
AddinInfo.txt

@ -0,0 +1,12 @@
//------------------------------------------------------------------
// Addin-Application header control file, created with the CASIO SDK
//------------------------------------------------------------------
[OUTPUT] : "SUPERCBR.G1A"
[BINDATA] : "FXADDINror.bin"
[DISPNAME] : "SuperCbr"
[APPNAME] : "@SUPERCB"
[VERSION] : "01.00.0000"
[APL_ICON] : "MainIcon.bmp"
[MODULE_NUM] : 0
[MOD1_TITLE] : "SuperCbr"
[MOD1_ICON] : "eActivityIcon.bmp"

BIN
MainIcon.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

77
SuperCbr.c

@ -0,0 +1,77 @@
/*****************************************************************/
/* */
/* CASIO fx-9860G SDK Library */
/* */
/* File name : [ProjectName].c */
/* */
/* Copyright (c) 2006 CASIO COMPUTER CO., LTD. */
/* */
/*****************************************************************/
#include "fxlib.h"
//****************************************************************************
// AddIn_main (Sample program main function)
//
// param : isAppli : 1 = This application is launched by MAIN MENU.
// : 0 = This application is launched by a strip in eACT application.
//
// OptionNum : Strip number (0~3)
// (This parameter is only used when isAppli parameter is 0.)
//
// retval : 1 = No error / 0 = Error
//
//****************************************************************************
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int key;
Bdisp_AllClr_DDVRAM();
locate(1,4);
Print((unsigned char*)"This application is");
locate(1,5);
Print((unsigned char*)" sample Add-In.");
while(1){
GetKey(&key);
}
return 1;
}
//****************************************************************************
//************** ****************
//************** 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

112
SuperCbr.dlw

@ -0,0 +1,112 @@
[DLSimWorkSpace]
[_1]
Type=5
Order=5
Top=15
Left=2235
Height=4740
Width=5565
State=0
Flags=00000020
OptionA=0
[_2]
Type=1
Order=4
Top=15
Left=7800
Height=4740
Width=5535
State=0
Flags=00000001
OptionA=15
OptionB=15
[_3]
Type=6
Order=2
Top=4740
Left=7800
Height=6390
Width=5535
State=0
Flags=00000001
OptionA=0
[_4]
Type=7
Order=1
Top=4740
Left=2220
Height=3165
Width=5565
State=0
Flags=00000000
OptionA=0
[_5]
Type=8
Order=0
Top=7905
Left=2220
Height=3225
Width=5580
State=0
Flags=00000000
OptionA=0
[_6]
Type=3
Order=9
Top=0
Left=10788
Height=6348
Width=2232
State=16
Flags=00000000
OptionA=0
[_7]
Type=2
Order=8
Top=6348
Left=7800
Height=3588
Width=5220
State=16
Flags=00000000
OptionA=0
[_8]
Type=17
Order=3
Top=15
Left=-15
Height=11115
Width=2235
State=0
Flags=00000000
OptionA=0
[_9]
Type=15
Order=6
Top=4740
Left=2232
Height=6348
Width=5592
State=16
Flags=00000000
OptionA=0
[_32]
Type=16
Order=7
Top=0
Left=2208
Height=4584
Width=5592
State=16
Flags=00000020
OptionA=0

BIN
SuperCbr.g1a

Binary file not shown.

15
SuperCbr.g1w

@ -0,0 +1,15 @@
[DLSimProject]
Name=SuperCbr
Version=1.00.0000
Model=:fx-9860G.dlm
SourcePath=SRC
MemoryPath=INIT
MemCardPath=SDCard
[Program1]
Program=SUPERCBR.G1A
Debug=Debug\FXADDINror.dbg
LoadAddress=80000000:90100000
[Files]
SourceFile=:SuperCbr.c

BIN
eActivityIcon.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

2
include/levelchanger.h

@ -1,6 +1,6 @@
#ifndef LEVEL_CHANGE_H
#define LEVEL_CHANGE_H
void launch_ui();
void LaunchUI();
#endif

10
include/score.h

@ -16,10 +16,14 @@ void score_display();
void score_add_coin();
void new_level();
void new_game();
int lifes_get();
void lifes_lose();
void lifes_add();
int get_time_spent();
/* Lifes Management */
int LifesGet();
void LifesSet(int);
void LifesAdd(int);
#endif

2
src/bonus.c

@ -74,7 +74,7 @@ void bonus_move() //+collision
{
bonus_set(BONUS_NONE,0,0);
score_add(1000);
lifes_add();
LifesAdd(1);
}
if (bonus.type==BONUS_STAR)
{

12
src/ennemi.c

@ -4,19 +4,13 @@
#include "tile.h"
#include "world.h"
#include "score.h"
#include <base.h>
#include <camera.h>
#include <level.h>
#include <gint/std/string.h>
#include <stdbool.h>
static int sgn(int x)
{
if (x==0)
return 0;
else if (x>0)
return 1;
return -1;
}
const int ennemi_widths [NOMBRE_ENNEMIS] = {0, 8, 8, 8, 8 , 8};
const int ennemi_heights[NOMBRE_ENNEMIS] = {0, 8, 12, 9, 12, 9};

4
src/keyboard.c

@ -67,8 +67,6 @@ static int menu_pause() // 1 exit, 0 continue
case KEY_MENU:
return 1;
case KEY_OPTN:
choice=2;
// fall through
case KEY_EXE:
if (choice==2)
@ -142,7 +140,7 @@ void mkb_update()
if(e.key==KEY_DOWN)
k=MK_DOWN;
if(e.key==KEY_ALPHA)
if(e.key==KEY_OPTN)
k=MK_RUN;
if(keydown(KEY_EXIT))

87
src/levelchanger.c

@ -19,7 +19,7 @@
static void levelchanger(int w)
{
int play_level(int w, int l);
int play_level(int w, int l); // déclaration de la fonction codée plus bas
extern image_t img_levelchanger;
@ -96,19 +96,19 @@ static void levelchanger(int w)
get_lvl_id(w, i, lvl);
dtext(53,28, lvl, C_WHITE, C_BLACK);
sprintf(lvl, "%d", lifes_get());
sprintf(lvl, "%d", LifesGet());
dtext(65,54, lvl, C_WHITE, C_BLACK);
dupdate();
sleep_ms(3,2000);
int a=play_level(w, i);
if (a==0)
lifes_lose();
LifesAdd(-1);
if (a==1)
i++;
if (a==-1)
break;
if (lifes_get()==0)
if (LifesGet()==0)
{
extern image_t img_game_over;
dimage(0,0,&img_game_over);
@ -128,7 +128,7 @@ static void levelchanger(int w)
get_lvl_id(w, choice, lvl);
dtext(53,28, lvl, C_WHITE, C_BLACK);
sprintf(lvl, "%d", lifes_get());
sprintf(lvl, "%d", LifesGet());
dtext(65,54, lvl, C_WHITE, C_BLACK);
dupdate();
sleep_ms(3,2000);
@ -161,17 +161,18 @@ static void levelchanger(int w)
void launch_ui()
void LaunchUI() // Main Menu
{
extern image_t img_mainmenu;
const int xt=17,yt=9;
int choice_x=0, choice_y=0;
unsigned int choice_x=0, choice_y=0;
while (1)
{
mkb_clear();
dimage(0,0,&img_mainmenu);
// Draw world images, but only unlocked ones
//Show unlocked worlds
extern image_t img_w1, img_w2, img_w3, img_w4, img_w5;
@ -193,44 +194,60 @@ void launch_ui()
dimage(xt, yt, &img_w1);
}
// invert color of selected world
drect(xt+24*choice_x,yt+24*choice_y, xt+24*choice_x+20,yt+24*choice_y+20, C_INVERT);
dupdate();
//int key=getkey_opt(GETKEY_REP_ARROWS,0).key;
int key=mkb_getkey();
if (key==KEY_UP && choice_y>0)
choice_y--;
if (key==KEY_LEFT && choice_x>0)
choice_x--;
if (key==KEY_DOWN && choice_y<1)
choice_y++;
if (key==KEY_RIGHT && choice_x<3)
choice_x++;
if (key==KEY_EXE || key==KEY_SHIFT)
//int key=getkey_opt(GETKEY_REP_ARROWS,0).key;
switch (mkb_getkey())
{
// Determine mode
if (choice_x==3 && choice_y==1)
break;
if (choice_x==2 && choice_y==1)
case KEY_UP:
if (choice_y) // >0
choice_y--;
break;
case KEY_LEFT:
if (choice_x) // >0
choice_x--;
break;
case (KEY_DOWN):
if (!choice_y) // ==0
choice_y++;
break;
case (KEY_RIGHT):
if (choice_x!=3) // <3
choice_x++;
break;
case KEY_EXE:
// fall through
case KEY_SHIFT:
switch (4*choice_y+choice_x)
{
case 5: // No idea yet !
break;
case 6:
configmenu();
}
if (choice_y*choice_x==0)
{
int world_chosen=0;
if (choice_y==1)
world_chosen=4;
else
world_chosen=choice_x;
if (world_chosen<=get_progress_status())
levelchanger(world_chosen);
break;
case 7:
return;
default:
if (4*choice_y+choice_x<=get_progress_status())
levelchanger(4*choice_y+choice_x);
}
}
if (key==KEY_EXIT || key==KEY_MENU)
break;
case KEY_EXIT:
// fall through
case KEY_MENU:
return;
}
}
}

2
src/main.c

@ -30,7 +30,7 @@ int main(void)
ll_set_panic();
//ll_set_level(LEVEL_QUIET);
launch_ui();
LaunchUI();
return 1;
}

15
src/score.c

@ -128,17 +128,8 @@ int get_time_spent()
int lifes_get()
{
return lifes;
}
int LifesGet() { return lifes; }
void lifes_lose()
{
lifes --;
}
void LifesSet(int l) { lifes = l; }
void lifes_add()
{
lifes ++;
}
void LifesAdd(int l) { lifes += l; }
Loading…
Cancel
Save