This is fantastic, thank you Alekmaul! I'll always have a special place in my heart for the TG-16.
I also think that turbo-fire would be a great addition. (ie: Y=turbofire B, X=turbofire A)
Like a fine wine, the Dingoo keeps getting better with age.
Welcome | |
---|---|
Welcome to a320
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today! |
Moderator: Moderators
void bitmap_scale(int viswidth, int visheight, uint16_t *bmpline) {
uint16_t* buffer_scr = gfx_render_target->address;
unsigned int W,H,ix,iy,x,y;
x=0;
y=0;
W=320;
H=240;
ix=(viswidth<<16)/W;
iy=(visheight<<16)/H;
do
{
uint16_t *buffer_mem=&bmpline[(y>>16)*SYSVID_WIDTH+0x20];
W=320; x=0;
do {
*buffer_scr++=buffer_mem[x>>16];
x+=ix;
} while (--W);
y+=iy;
} while (--H);
}
int main(int argc, char** argv) {
strcpy(gameName,argv[2]);
int ref = EXIT_SUCCESS;
srand(OSTimeGet());
control_init();
control_lock(timer_resolution / 4);
gfx_init();
gfx_render_target_clear(gfx_color_rgb(0x00, 0x00, 0x00));
gfx_render_target_swap();
gameTimer = timer_create();
_audio_music = waveout_open(&tempArgs);
m_Flag = GF_GAMEINIT;
sndLevel=20;
m_ScreenRatio=1; // 0 = original show, 1 = full screen
render_screen = m_ScreenRatio == 1 ? bitmap_scale : bitmap_noscale;
uint32_t tempTick = 0;
uint32_t tempPauseOS = 0;
int sysref;
while (m_Flag != GF_GAMEQUIT) {
sysref = _sys_judge_event(NULL);
if (sysref < 0) {
break;
}
switch (m_Flag) {
--- /// -----
--- something here without any interest ----
--- /// -----
case GF_GAMERUNNING:
tempTick += timer_delta(gameTimer);
if (tempTick < gameTickRate) {
tempPauseOS = (((gameTickRate - tempTick) * OS_TICKS_PER_SEC) / timer_resolution);
if(tempPauseOS > 0) OSTimeDly(tempPauseOS);
while(tempTick < gameTickRate)
tempTick += timer_delta(gameTimer);
}
// Do a one step emulation
do_frame();
render_screen(disp_width,disp_height,buf16RGB);
gfx_render_target_swap();
waveout_write(_audio_music, rawSoundBuf, PCESND_STEP);
--- /// -----
--- something here without any interest ----
--- /// -----
break;
}
}
timer_delete(gameTimer);
waveout_close(_audio_music);
gfx_term();
control_term();
return ref;
}
Users browsing this forum: No registered users and 1 guest