projects
/
dosdemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- VBE banked mode fixes backported from rbench
[dosdemo]
/
src
/
screen.c
diff --git
a/src/screen.c
b/src/screen.c
index
ea9bb94
..
15eb57c
100644
(file)
--- a/
src/screen.c
+++ b/
src/screen.c
@@
-25,6
+25,7
@@
struct screen *metaballs_screen(void);
struct screen *greets_screen(void);
struct screen *infcubes_screen(void);
struct screen *hairball_screen(void);
struct screen *greets_screen(void);
struct screen *infcubes_screen(void);
struct screen *hairball_screen(void);
+struct screen *cybersun_screen(void);
void start_loadscr(void);
void end_loadscr(void);
void start_loadscr(void);
void end_loadscr(void);
@@
-37,6
+38,9
@@
static int num_screens;
static struct screen *cur, *prev, *next;
static long trans_start, trans_dur;
static struct screen *cur, *prev, *next;
static long trans_start, trans_dur;
+const char *dbg_curscr_name;
+int dbg_curscr_name_len, dbg_curscr_name_pos;
+
int scr_init(void)
{
int i, idx = 0;
int scr_init(void)
{
int i, idx = 0;
@@
-76,6
+80,9
@@
int scr_init(void)
if(!(scr[idx++] = hairball_screen())) {
return -1;
}
if(!(scr[idx++] = hairball_screen())) {
return -1;
}
+ if(!(scr[idx++] = cybersun_screen())) {
+ return -1;
+ }
num_screens = idx;
assert(num_screens <= NUM_SCR);
num_screens = idx;
assert(num_screens <= NUM_SCR);
@@
-183,10
+190,20
@@
int scr_change(struct screen *s, long trans_time)
/* loading screen */
extern uint16_t loading_pixels[];
/* loading screen */
extern uint16_t loading_pixels[];
+static long prev_load_msec;
+static long load_delay = 180;
void start_loadscr(void)
{
void start_loadscr(void)
{
+ char *env;
+ if((env = getenv("MLAPSE_LOADDELAY"))) {
+ load_delay = atoi(env);
+ printf("load delay: %ld ms\n", load_delay);
+ }
+
swap_buffers(loading_pixels);
swap_buffers(loading_pixels);
+ sleep_msec(load_delay * 2);
+ prev_load_msec = get_msec();
}
#define SPLAT_X 288
}
#define SPLAT_X 288
@@
-201,10
+218,9
@@
void start_loadscr(void)
void end_loadscr(void)
{
blitfb(loading_pixels + SPLAT_Y * 320 + SPLAT_X, loading_pixels + 320 * 240, 32, 72, 32);
void end_loadscr(void)
{
blitfb(loading_pixels + SPLAT_Y * 320 + SPLAT_X, loading_pixels + 320 * 240, 32, 72, 32);
- blitfb_key(loading_pixels + FING_Y * 320 + FING_LAST_X, loading_pixels + 247 * 320 + 64,
- FING_W, FING_H, FING_W, 0);
+ blit_key(loading_pixels + FING_Y * 320 + FING_LAST_X, 320, loading_pixels + 247 * 320 + 64, FING_W, FING_H, FING_W, 0);
swap_buffers(loading_pixels);
swap_buffers(loading_pixels);
- sleep_msec(300);
+ sleep_msec(load_delay * 4);
}
void loadscr(int n, int count)
}
void loadscr(int n, int count)
@@
-212,17
+228,22
@@
void loadscr(int n, int count)
int xoffs = 75 * n / (count - 1);
static int prev_xoffs;
uint16_t *sptr, *dptr;
int xoffs = 75 * n / (count - 1);
static int prev_xoffs;
uint16_t *sptr, *dptr;
+ long delta;
sptr = loading_pixels + 247 * 320 + 64;
dptr = loading_pixels + FING_Y * 320 + FING_X + prev_xoffs;
while(prev_xoffs < xoffs) {
sptr = loading_pixels + 247 * 320 + 64;
dptr = loading_pixels + FING_Y * 320 + FING_X + prev_xoffs;
while(prev_xoffs < xoffs) {
- blitfb_key(dptr, sptr, FING_W, FING_H, FING_W, 0);
+ blit_key(dptr, 320, sptr, FING_W, FING_H, FING_W, 0);
dptr++;
prev_xoffs++;
}
swap_buffers(loading_pixels);
dptr++;
prev_xoffs++;
}
swap_buffers(loading_pixels);
- /*sleep_msec(200);*/
+ delta = get_msec() - prev_load_msec;
+ if(delta < load_delay) {
+ sleep_msec(load_delay - delta);
+ }
+ prev_load_msec = get_msec();
}
}