mirror of
https://github.com/dwsJason/xrick2gs.git
synced 2025-01-22 16:32:37 +00:00
introMain is up and working
This commit is contained in:
parent
bd18a221e3
commit
2e2effd3e5
@ -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;
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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*/
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
19
src/sysvid.c
19
src/sysvid.c
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
src/xrick.c
17
src/xrick.c
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user