introMain is up and working

This commit is contained in:
dwsJason 2018-08-05 16:49:16 -04:00
parent bd18a221e3
commit 2e2effd3e5
9 changed files with 52 additions and 17 deletions

View File

@ -20,14 +20,18 @@ typedef struct {
U8 r, g, b, nothing; U8 r, g, b, nothing;
} img_color_t; } img_color_t;
#ifdef IIGS
typedef void img_t;
#else
typedef struct { typedef struct {
U16 w, h; U16 w, h;
U16 ncolors; U16 ncolors;
img_color_t *colors; img_color_t *colors;
U8 *pixels; U8 *pixels;
} img_t; } img_t;
#endif
//segment "screen";
extern img_t *IMG_SPLASH; extern img_t *IMG_SPLASH;

View File

@ -169,6 +169,10 @@ extern void sysjoy_init(void);
extern void sysjoy_shutdown(void); extern void sysjoy_shutdown(void);
#endif #endif
#ifdef IIGS
// GS Specific Stuff
extern int LZ4_Unpack(char* pDest, char* pPackedSource);
#endif
#endif #endif

View File

@ -695,16 +695,17 @@ draw_pic(U16 x, U16 y, U16 w, U16 h, U32 *pic)
void void
draw_img(img_t *i) draw_img(img_t *i)
{ {
#ifdef IIGS
LZ4_Unpack(sysvid_fb, (char*)i);
#else
U16 k; U16 k;
draw_setfb(0, 0); draw_setfb(0, 0);
if (i->ncolors > 0) if (i->ncolors > 0)
sysvid_setPalette(i->colors, i->ncolors); sysvid_setPalette(i->colors, i->ncolors);
#ifndef IIGS
for (k = 0; k < SYSVID_WIDTH * SYSVID_HEIGHT; k++) for (k = 0; k < SYSVID_WIDTH * SYSVID_HEIGHT; k++)
fb[k] = i->pixels[k]; fb[k] = i->pixels[k];
#endif #endif
} }

View File

@ -228,7 +228,7 @@ game_run(void)
tmx = tm; tm = sys_gettime(); tmx = tm - tmx; tmx = tm; tm = sys_gettime(); tmx = tm - tmx;
if (tmx < game_period) sys_sleep(game_period - tmx); if (tmx < game_period) sys_sleep(game_period - tmx);
printf("tmx=%x\n"); // printf("tmx=%x\n");
/* video */ /* video */
/*DEBUG*//*game_rects=&draw_SCREENRECT;*//*DEBUG*/ /*DEBUG*//*game_rects=&draw_SCREENRECT;*//*DEBUG*/

View File

@ -1,3 +1,4 @@
#ifndef IIGS
static U8 IMG_ICON_PIXELS[] = { static U8 IMG_ICON_PIXELS[] = {
0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,
211,108,211,108,52,52,52,52,52,52,52,52,52,0,0,0, 211,108,211,108,52,52,52,52,52,52,52,52,52,0,0,0,
@ -76,4 +77,4 @@ static img_t IMG_ICON_OBJECT = {
}; };
img_t *IMG_ICON = &IMG_ICON_OBJECT; img_t *IMG_ICON = &IMG_ICON_OBJECT;
#endif

View File

@ -4013,7 +4013,11 @@ static img_t IMG_SPLASH_OBJECT = {
}; };
img_t *IMG_SPLASH = &IMG_SPLASH_OBJECT; img_t *IMG_SPLASH = &IMG_SPLASH_OBJECT;
#else #else
img_t *IMG_SPLASH = 0; // On the GS it's a packed $C1
extern U8 img_splash_lz4;
extern U8 splash_lz4;
img_t *IMG_SPLASH = &img_splash_lz4;
#endif #endif

View File

@ -24,6 +24,7 @@
#ifdef IIGS #ifdef IIGS
#pragma noroot #pragma noroot
segment "screen"; segment "screen";
extern img_t splash_lz4;
#endif #endif
/* /*
@ -78,6 +79,10 @@ screen_introMain(void)
draw_pic(0, 0, 0x140, 0xc8, pic_splash); draw_pic(0, 0, 0x140, 0xc8, pic_splash);
#endif #endif
#ifdef GFXGS
draw_img(&splash_lz4);
#endif
seq = 2; seq = 2;
break; break;

View File

@ -46,6 +46,12 @@ rect_t SCREENRECT = {0, 0, SYSVID_WIDTH, SYSVID_HEIGHT, NULL}; /* whole fb */
static SDL_Color palette[256]; static SDL_Color palette[256];
static SDL_Surface *screen; static SDL_Surface *screen;
#endif #endif
#ifdef IIGS
volatile char *VIDEO_REGISTER = (char*)0xC029;
volatile char *SHADOW_REGISTER = (char*)0xC035;
#endif
static U32 videoFlags; static U32 videoFlags;
static U8 zoom = SYSVID_ZOOM; /* actual zoom level */ static U8 zoom = SYSVID_ZOOM; /* actual zoom level */
@ -244,6 +250,13 @@ sysvid_init(void)
//BlitFieldHndl = NewHandle(0x10000, userid(), 0xC014, 0); //BlitFieldHndl = NewHandle(0x10000, userid(), 0xC014, 0);
sysvid_fb = (U8*)0x12000; sysvid_fb = (U8*)0x12000;
// SHR ON
*VIDEO_REGISTER|=0xC0;
// ENABLE Shadowing of SHR
*SHADOW_REGISTER&=~0x08; // Shadow Enable
#endif #endif
#ifndef IIGS #ifndef IIGS
SDL_Surface *s; SDL_Surface *s;
@ -412,6 +425,12 @@ sysvid_clear(void)
{ {
#ifndef IIGS #ifndef IIGS
memset(sysvid_fb, 0, SYSVID_WIDTH * SYSVID_HEIGHT); memset(sysvid_fb, 0, SYSVID_WIDTH * SYSVID_HEIGHT);
#else
size_t length = SYSVID_WIDTH /2 * SYSVID_HEIGHT;
//printf("sysvid_clear: target = %08p\n", sysvid_fb);
//printf("sysvid_clear: length = %08p\n", length);
//sys_sleep(10000);
memset(sysvid_fb, 0, length);
#endif #endif
} }

View File

@ -18,10 +18,8 @@
#include <SDL.h> #include <SDL.h>
#endif #endif
extern char img_splash_lz4;
extern char splash_lz4; extern void* IMG_SPLASH;
volatile char *VIDEO = (char*)0xC029;
extern int LZ4_Unpack(char* pDest, char* pPackedSource);
/* /*
* main * main
@ -31,12 +29,11 @@ main(int argc, char *argv[])
{ {
printf("Hello from xrick IIgs\n"); printf("Hello from xrick IIgs\n");
printf("Unpacking Splash!\n"); // printf("Unpacking Splash!\n");
// LZ4_Unpack((char*)(0xE12000), &img_splash_lz4);
LZ4_Unpack((char*)(0xE12000), &splash_lz4); // printf("%08x\n", &img_splash_lz4 );
// printf("%08x\n", IMG_SPLASH );
// SHR ON // sys_sleep(10000);
// *VIDEO|=0xC0;
sys_init(argc, argv); sys_init(argc, argv);
if (sysarg_args_data) if (sysarg_args_data)