//
//	hsp3cnv(3.31b2) generated source
//	[button_test.ax]
//
#include "hsp3r.h"

#define _HSP3CNV_DATE "2012/06/29"
#define _HSP3CNV_TIME "00:00:00"
#define _HSP3CNV_MAXVAR 12
#define _HSP3CNV_MAXHPI 0
#define _HSP3CNV_VERSION 0x301
#define _HSP3CNV_BOOTOPT 4096

/*-----------------------------------------------------------*/

static PVal *Var_0;
static PVal *Var_1;
static PVal *Var_2;
static PVal *Var_3;
static PVal *Var_4;
static PVal *Var_5;
static PVal *Var_6;
static PVal *Var_7;
static PVal *Var_8;
static PVal *Var_9;
static PVal *Var_10;
static PVal *Var_11;

/*-----------------------------------------------------------*/

void __HspEntry( void ) {
	// Var initalize
	Var_0 = &mem_var[0];
	Var_1 = &mem_var[1];
	Var_2 = &mem_var[2];
	Var_3 = &mem_var[3];
	Var_4 = &mem_var[4];
	Var_5 = &mem_var[5];
	Var_6 = &mem_var[6];
	Var_7 = &mem_var[7];
	Var_8 = &mem_var[8];
	Var_9 = &mem_var[9];
	Var_10 = &mem_var[10];
	Var_11 = &mem_var[11];

	// _HspVar0 =ginfo(26)
	PushFuncEnd(); 	PushInt(26); 
PushExtvar(256,1); 
	VarSet(Var_0,0);
	// _HspVar1 =ginfo(27)
	PushFuncEnd(); 	PushInt(27); 
PushExtvar(256,1); 
	VarSet(Var_1,0);
	// _HspVar2 =sysinfo(0)
	PushFuncEnd(); 	PushInt(0); 
PushExtvar(259,1); 
	VarSet(Var_2,0);
	// _HspVar3 =sysinfo(1)
	PushFuncEnd(); 	PushInt(1); 
PushExtvar(259,1); 
	VarSet(Var_3,0);
	// _HspVar4 =sysinfo(2)
	PushFuncEnd(); 	PushInt(2); 
PushExtvar(259,1); 
	VarSet(Var_4,0);
	// _HspVar5 =0
	PushInt(0); 
	VarSet(Var_5,0);
	// _HspVar6 =0
	PushInt(0); 
	VarSet(Var_6,0);
	// _HspVar7 =0
	PushInt(0); 
	VarSet(Var_7,0);
	// if instr(_HspVar2, 0, "iOS")>=0
	PushFuncEnd(); 	PushStr("iOS"); 
		PushInt(0); 
		PushVAP(Var_2,0); 
	PushIntfunc(15,3); PushInt(0); CalcGtEqI(); 
	if (HspIf()) { TaskSwitch(6); return; }
	// _HspVar5 =1
	PushInt(1); 
	VarSet(Var_5,0);
	TaskSwitch(6);
}

static void L0006( void ) {
	// if instr(_HspVar2, 0, "android")>=0
	PushFuncEnd(); 	PushStr("android"); 
		PushInt(0); 
		PushVAP(Var_2,0); 
	PushIntfunc(15,3); PushInt(0); CalcGtEqI(); 
	if (HspIf()) { TaskSwitch(7); return; }
	// _HspVar6 =1
	PushInt(1); 
	VarSet(Var_6,0);
	TaskSwitch(7);
}

static void L0007( void ) {
	// if instr(_HspVar2, 0, "Windows")>=0
	PushFuncEnd(); 	PushStr("Windows"); 
		PushInt(0); 
		PushVAP(Var_2,0); 
	PushIntfunc(15,3); PushInt(0); CalcGtEqI(); 
	if (HspIf()) { TaskSwitch(8); return; }
	// _HspVar7 =1
	PushInt(1); 
	VarSet(Var_7,0);
	TaskSwitch(8);
}

static void L0008( void ) {
	// _HspVar8 (0)=0
	PushInt(0); 
	PushInt(0); 
	VarSet(Var_8,1);
	// _HspVar9 (0)=0
	PushInt(0); 
	PushInt(0); 
	VarSet(Var_9,1);
	// _HspVar10 (0)=255
	PushInt(255); 
	PushInt(0); 
	VarSet(Var_10,1);
	// _HspVar8 (1)=_HspVar0
	PushVar(Var_0,0); 
	PushInt(1); 
	VarSet(Var_8,1);
	// _HspVar9 (1)=0
	PushInt(0); 
	PushInt(1); 
	VarSet(Var_9,1);
	// _HspVar10 (1)=65535
	PushInt(65535); 
	PushInt(1); 
	VarSet(Var_10,1);
	// _HspVar8 (2)=_HspVar0
	PushVar(Var_0,0); 
	PushInt(2); 
	VarSet(Var_8,1);
	// _HspVar9 (2)=_HspVar1
	PushVar(Var_1,0); 
	PushInt(2); 
	VarSet(Var_9,1);
	// _HspVar10 (2)=16711680
	PushInt(16711680); 
	PushInt(2); 
	VarSet(Var_10,1);
	// _HspVar8 (3)=0
	PushInt(0); 
	PushInt(3); 
	VarSet(Var_8,1);
	// _HspVar9 (3)=_HspVar1
	PushVar(Var_1,0); 
	PushInt(3); 
	VarSet(Var_9,1);
	// _HspVar10 (3)=16711935
	PushInt(16711935); 
	PushInt(3); 
	VarSet(Var_10,1);
	// objsize 160, 40
	PushInt(40); 
	PushInt(160); 
	Extcmd(22,2);
	// if _HspVar5=0
	PushVar(Var_5,0); PushInt(0); CalcEqI(); 
	if (HspIf()) { TaskSwitch(9); return; }
	// button 	goto "TEST END", *L0000
	PushLabel(0); 
	PushStr("TEST END"); 
	PushInt(0); Extcmd(0,3);
	TaskSwitch(9);
}

static void L0009( void ) {
	// button 	gosub "URL", *L0001
	PushLabel(1); 
	PushStr("URL"); 
	PushInt(1); Extcmd(0,3);
	// if _HspVar6=0
	PushVar(Var_6,0); PushInt(0); CalcEqI(); 
	if (HspIf()) { TaskSwitch(10); return; }
	// button 	gosub "DIALOG", *L0002
	PushLabel(2); 
	PushStr("DIALOG"); 
	PushInt(1); Extcmd(0,3);
	TaskSwitch(10);
}

static void L0010( void ) {
	// if _HspVar6
	PushVAP(Var_6,0); 
	if (HspIf()) { TaskSwitch(11); return; }
	// button 	gosub "DIAL", *L0003
	PushLabel(3); 
	PushStr("DIAL"); 
	PushInt(1); Extcmd(0,3);
	TaskSwitch(11);
}

static void L0011( void ) {
	// gmode 0
	PushInt(0); 
	Extcmd(32,1);
	// repeat
	PushLabel(4); 
	PushLabel(12); Prgcmd(4,2); return;
	TaskSwitch(12);
}

static void L0012( void ) {
	// _HspVar11 =sin(0.100000*cnt)*32
	PushFuncEnd(); 	PushDouble(0.100000); PushSysvar(4,0); CalcMulI(); 
PushIntfunc(384,1); PushInt(32); CalcMulI(); 
	VarSet(Var_11,0);
	// redraw 0
	PushInt(0); 
	Extcmd(27,1);
	// gsquare -257, _HspVar8, _HspVar9, _HspVar10
	PushVAP(Var_10,0); 
	PushVAP(Var_9,0); 
	PushVAP(Var_8,0); 
	PushInt(-257); 
	Extcmd(55,4);
	// color 255, 255, 255
	PushInt(255); 
	PushInt(255); 
	PushInt(255); 
	Extcmd(24,3);
	// pos 0, 360
	PushInt(360); 
	PushInt(0); 
	Extcmd(17,2);
	// mes "OS:"+_HspVar2
	PushStr("OS:"); PushVar(Var_2,0); CalcAddI(); 
	Extcmd(15,1);
	// mes "USER:"+_HspVar3
	PushStr("USER:"); PushVar(Var_3,0); CalcAddI(); 
	Extcmd(15,1);
	// mes "NAME:"+_HspVar4
	PushStr("NAME:"); PushVar(Var_4,0); CalcAddI(); 
	Extcmd(15,1);
	// gradf 0, 180+_HspVar11, 320, 100, 1, 16711935, 16777215
	PushInt(16777215); 
	PushInt(16711935); 
	PushInt(1); 
	PushInt(100); 
	PushInt(320); 
	PushInt(180); PushVar(Var_11,0); CalcAddI(); 
	PushInt(0); 
	Extcmd(56,7);
	// color 0, 0, 128
	PushInt(128); 
	PushInt(0); 
	PushInt(0); 
	Extcmd(24,3);
	// font "‚l‚r ƒSƒVƒbƒN", 30, 1
	PushInt(1); 
	PushInt(30); 
	PushStr("‚l‚r ƒSƒVƒbƒN"); 
	Extcmd(20,3);
	// pos 64, 210+_HspVar11
	PushInt(210); PushVar(Var_11,0); CalcAddI(); 
	PushInt(64); 
	Extcmd(17,2);
	// mes "HSP3Dish Test"
	PushStr("HSP3Dish Test"); 
	Extcmd(15,1);
	// redraw 1
	PushInt(1); 
	Extcmd(27,1);
	// await 1000/60
	PushInt(16);/*OPT*/ 
	Prgcmd(8,1);
	TaskSwitch(13);
}

static void L0013( void ) {
	// loop 
	Prgcmd(5,0);
	return;
	TaskSwitch(1);
}

static void L0001( void ) {
	TaskSwitch(4);
}

static void L0004( void ) {
	// exec "http://hsp.tv", 16
	PushInt(16); 
	PushStr("http://hsp.tv"); 
	Extcmd(2,2);
	TaskSwitch(14);
}

static void L0014( void ) {
	// return 
	Prgcmd(2,0);
	return;
	TaskSwitch(3);
}

static void L0003( void ) {
	// exec "tel:0123456789", 16
	PushInt(16); 
	PushStr("tel:0123456789"); 
	Extcmd(2,2);
	TaskSwitch(15);
}

static void L0015( void ) {
	// return 
	Prgcmd(2,0);
	return;
	TaskSwitch(2);
}

static void L0002( void ) {
	// dialog "OK"
	PushStr("OK"); 
	Extcmd(3,1);
	TaskSwitch(16);
}

static void L0016( void ) {
	// return 
	Prgcmd(2,0);
	return;
	TaskSwitch(0);
}

static void L0000( void ) {
	// end 
	Prgcmd(16,0);
	return;
	TaskSwitch(5);
}

static void L0005( void ) {
	// stop 
	Prgcmd(17,0);
	return;
	// goto 
	Prgcmd(0,0);
	return;
}

//-End of Source-------------------------------------------

CHSP3_TASK __HspTaskFunc[]={
(CHSP3_TASK) L0000,
(CHSP3_TASK) L0001,
(CHSP3_TASK) L0002,
(CHSP3_TASK) L0003,
(CHSP3_TASK) L0004,
(CHSP3_TASK) L0005,
(CHSP3_TASK) L0006,
(CHSP3_TASK) L0007,
(CHSP3_TASK) L0008,
(CHSP3_TASK) L0009,
(CHSP3_TASK) L0010,
(CHSP3_TASK) L0011,
(CHSP3_TASK) L0012,
(CHSP3_TASK) L0013,
(CHSP3_TASK) L0014,
(CHSP3_TASK) L0015,
(CHSP3_TASK) L0016,
(CHSP3_TASK) 0,

};

/*-----------------------------------------------------------*/


/*-----------------------------------------------------------*/

void __HspInit( Hsp3r *hsp3 ) {
	hsp3->Reset( _HSP3CNV_MAXVAR, _HSP3CNV_MAXHPI );
	hsp3->SetDataName( 0 );
	hsp3->SetFInfo( 0, 0 );
	hsp3->SetLInfo( 0, 0 );
	hsp3->SetMInfo( 0, 0 );
}

/*-----------------------------------------------------------*/

