You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
5.8 KiB
C++

#include "lowlevellib.h"
extern s_rect llgfx_WD;
int os_main(
int argc,
char **argv,
char **envp
)
{
CDebug::WriteLn("Open display 320,240,16");
llgfx_SetDisplayMode( 320, 240, 16, 0 );
CDebug::WriteLn("llgfx_enable_singlebuffer=%d",llgfx_enable_singlebuffer);
CDebug::WriteLn("llgfx_enable_stretchwindow=%d",llgfx_enable_stretchwindow);
CDebug::WriteLn("llgfx_force_vidmem=%d",llgfx_force_vidmem);
CDebug::WriteLn("llgfx_force_sysmem=%d",llgfx_force_sysmem);
CDebug::WriteLn("llgfx_clearcolor=%x",llgfx_clearcolor);
CDebug::WriteLn("llgfx_window_scale=%f",llgfx_window_scale);
#ifdef LLGFX_ENABLE_DIRTYRECT
CDebug::WriteLn("llgfx_dirtyrect_enabled=%d",llgfx_dirtyrect_enabled);
#endif
CDebug::WriteLn("llgfx_displaywidth=%d",llgfx_displaywidth);
CDebug::WriteLn("llgfx_displayheight=%d",llgfx_displayheight);
CDebug::WriteLn("llgfx_bitspixel=%d",llgfx_bitspixel);
CDebug::WriteLn("llgfx_refreshrate=%d",llgfx_refreshrate);
CDebug::WriteLn("llgfx_frame_counter=%d",llgfx_frame_counter);
CDebug::WriteLn("llgfx_fullscreen=%d",llgfx_fullscreen);
//CDebug::WriteLn("llgfx_sGfxBuffer=%d",llgfx_sGfxBuffer);
CDebug::WriteLn("llgfx_rgb=%x %x %x %x %d",llgfx_rgb.amask, llgfx_rgb.rmask, llgfx_rgb.gmask, llgfx_rgb.bmask, llgfx_rgb.pixsize);
CDebug::WriteLn("llgfx_displaymodes=%d",llgfx_displaymodes.InQueue());
CDebug::WriteLn("llgfx_displaychanged=%d",llgfx_displaychanged);
CDebug::WriteLn("llgfx_dirtyrects=%d",llgfx_dirtyrects.InQueue());
CDebug::WriteLn("llgfx_text_xpos=%d",llgfx_text_xpos);
CDebug::WriteLn("llgfx_text_ypos=%d",llgfx_text_ypos);
CDebug::WriteLn("llgfx_font_height=%d",llgfx_font_height);
CDebug::WriteLn("llgfx_font_width=%d",llgfx_font_width);
CDebug::WriteLn("llgfx_VD=%d %d %d %d",llgfx_VD.x,llgfx_VD.y,llgfx_VD.x2,llgfx_VD.y2);
CDebug::WriteLn("llgfx_WD=%d %d %d %d",llgfx_WD.x,llgfx_WD.y,llgfx_WD.x2,llgfx_WD.y2);
CDebug::WriteLn("llfile_GetPath(LLFILE_CUR_DIR) = %s", llfile_GetPath(LLFILE_CUR_DIR));
CDebug::WriteLn("llfile_GetPath(LLFILE_APP_DIR) = %s", llfile_GetPath(LLFILE_APP_DIR));
CDebug::WriteLn("llfile_GetPath(LLFILE_APP_NAME) = %s", llfile_GetPath(LLFILE_APP_NAME));
char buf[256];
drv_path_cur_dir(buf,256);
CDebug::WriteLn("drv_path_cur_dir = %s",buf);
drv_path_app_path(buf,256);
CDebug::WriteLn("drv_path_app_path= %s",buf);
drv_path_app_dir(buf,256);
CDebug::WriteLn("drv_path_app_dir= %s",buf);
drv_path_app_name(buf,256);
CDebug::WriteLn("drv_path_app_name= %s",buf);
drv_path_app_ext(buf,256);
CDebug::WriteLn("drv_path_app_ext= %s",buf);
drv_path_temp_dir(buf,256);
CDebug::WriteLn("drv_path_temp_dir= %s",buf);
drv_path_temp_name(buf,256);
CDebug::WriteLn("drv_path_temp_name= %s",buf);
CDebug::WriteLn("llinput_MouseX=%d",llinput_MouseX);
CDebug::WriteLn("llinput_MouseY=%d",llinput_MouseY);
CDebug::WriteLn("llinput_MouseZ=%d",llinput_MouseZ);
CDebug::WriteLn("llinput_MouseRelX=%d",llinput_MouseRelX);
CDebug::WriteLn("llinput_MouseRelY=%d",llinput_MouseRelY);
CDebug::WriteLn("llinput_MouseRelZ=%d",llinput_MouseRelZ);
CDebug::WriteLn("llinput_MouseBtn1=%d",llinput_MouseBtn1);
CDebug::WriteLn("llinput_MouseBtn2=%d",llinput_MouseBtn2);
CDebug::WriteLn("llinput_MouseBtn3=%d",llinput_MouseBtn3);
CDebug::WriteLn("llinput_MouseBtn4=%d",llinput_MouseBtn4);
CDebug::WriteLn("llinput_MouseBtn5=%d",llinput_MouseBtn5);
CDebug::WriteLn("llinput_MouseBtn6=%d",llinput_MouseBtn6);
CDebug::WriteLn("llinput_MouseBtn7=%d",llinput_MouseBtn7);
CDebug::WriteLn("llinput_MouseBtn8=%d",llinput_MouseBtn8);
llgfx_GetGFXptr(0);
CDebug::WriteLn("llgfx_sGfxBuffer.baseptr=%x ", llgfx_sGfxBuffer.baseptr );
CDebug::WriteLn("llgfx_sGfxBuffer.pitch=%d", llgfx_sGfxBuffer.pitch );
CDebug::WriteLn("llgfx_sGfxBuffer.pix_pitch=%d", llgfx_sGfxBuffer.pix_pitch );
CDebug::WriteLn("llgfx_sGfxBuffer.pix_modulo=%d", llgfx_sGfxBuffer.pix_modulo );
CDebug::WriteLn("llgfx_sGfxBuffer.byte_modulo=%d", llgfx_sGfxBuffer.byte_modulo );
CDebug::WriteLn("llgfx_sGfxBuffer.rgb.amask=%x", llgfx_sGfxBuffer.rgb.amask );
CDebug::WriteLn("llgfx_sGfxBuffer.rgb.rmask=%x", llgfx_sGfxBuffer.rgb.rmask );
CDebug::WriteLn("llgfx_sGfxBuffer.rgb.gmask=%x", llgfx_sGfxBuffer.rgb.gmask );
CDebug::WriteLn("llgfx_sGfxBuffer.rgb.bmask=%x", llgfx_sGfxBuffer.rgb.bmask );
CDebug::WriteLn("llgfx_sGfxBuffer.rgb.pixsize=%x", llgfx_sGfxBuffer.rgb.pixsize );
llgfx_UnGetGFXptr(0);
for( int f = 0; f < 16; f ++ )
{
for( int j = 0; j < 16; j ++ )
{
CDebug::Write("%02d ", llinput_Keys[f*16+j] );
}
CDebug::WriteLn("");
}
int i = 0;
int j = 0;
float totaltime = 0;
int frames = 0;
int xx, jj;
xx=0;
jj=0;
//llgfx_id logo = llgfx_LoadGfx("one03.tga",LLGFX_COLORKEY);
//llgfx_id background = llgfx_LoadGfx("background.tga",LLGFX_COLORKEY);
//llgfx_EnableColorKey(logo);
while(osmain_endgame==false)
{
float difftime = llirq_GetDeltaTime();
totaltime += difftime;
frames ++;
if( frames & 1)
llgfx_ClearScreen(0xFF00FF);
else
llgfx_ClearScreen(0x00FF00);
/* int r = 10;
while( r-- > 0 )
{
llgfx_DrawLine(0,0,0,320,j, RED );
llgfx_DrawLine(0,320,0,0,j, GREEN );
llgfx_DrawLine(0,i,0,160,240, BLUE );
i++;
j++;
if( i > 320 ) i = 0;
if( j > 240 ) j = 0;
}
*/
//llgfx_TILE_BLIT(0,background,xx,jj);
//llgfx_BLIT(0,logo);
xx++;
jj++;
DebugOutLn("flipscreen frame%d",frames);
llgfx_FlipScreen(1);
/* PtrInputEvent ev = llinput_GetEvent();
if(ev)
{
CDebug::WriteLn("ev.devicename =%s",ev->devicename);
CDebug::WriteLn("ev.eventname =%s",ev->eventname );
CDebug::WriteLn("ev.state =%x",ev->state );
CDebug::WriteLn("");
}
llinput_Update();
*/
//if( llinput_Keys[LLINPUT_KEY_A] )
// osmain_endgame = true;
if( frames > 20 )
osmain_endgame = true;
}
CDebug::WriteLn("Osmain_endgame=true");
CDebug::WriteLn("overage frametime=%f", totaltime / (frames+1) );
CDebug::WriteLn("maxpeak memory = %d", llmem_maxpeak_allocated_memory );
return 0;
}