mirror of
https://github.com/dwsJason/xrick2gs.git
synced 2025-01-06 18:29:59 +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;
|
||||
} img_color_t;
|
||||
|
||||
#ifdef IIGS
|
||||
|
||||
typedef void img_t;
|
||||
|
||||
#else
|
||||
typedef struct {
|
||||
U16 w, h;
|
||||
U16 ncolors;
|
||||
img_color_t *colors;
|
||||
U8 *pixels;
|
||||
} img_t;
|
||||
|
||||
//segment "screen";
|
||||
#endif
|
||||
|
||||
extern img_t *IMG_SPLASH;
|
||||
|
||||
|
@ -169,6 +169,10 @@ extern void sysjoy_init(void);
|
||||
extern void sysjoy_shutdown(void);
|
||||
#endif
|
||||
|
||||
#ifdef IIGS
|
||||
// GS Specific Stuff
|
||||
extern int LZ4_Unpack(char* pDest, char* pPackedSource);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -695,16 +695,17 @@ draw_pic(U16 x, U16 y, U16 w, U16 h, U32 *pic)
|
||||
void
|
||||
draw_img(img_t *i)
|
||||
{
|
||||
#ifdef IIGS
|
||||
LZ4_Unpack(sysvid_fb, (char*)i);
|
||||
#else
|
||||
U16 k;
|
||||
|
||||
draw_setfb(0, 0);
|
||||
if (i->ncolors > 0)
|
||||
sysvid_setPalette(i->colors, i->ncolors);
|
||||
#ifndef IIGS
|
||||
for (k = 0; k < SYSVID_WIDTH * SYSVID_HEIGHT; k++)
|
||||
fb[k] = i->pixels[k];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -228,7 +228,7 @@ game_run(void)
|
||||
tmx = tm; tm = sys_gettime(); tmx = tm - tmx;
|
||||
if (tmx < game_period) sys_sleep(game_period - tmx);
|
||||
|
||||
printf("tmx=%x\n");
|
||||
// printf("tmx=%x\n");
|
||||
|
||||
/* video */
|
||||
/*DEBUG*//*game_rects=&draw_SCREENRECT;*//*DEBUG*/
|
||||
|
@ -1,3 +1,4 @@
|
||||
#ifndef IIGS
|
||||
static U8 IMG_ICON_PIXELS[] = {
|
||||
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,
|
||||
@ -76,4 +77,4 @@ static img_t 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;
|
||||
|
||||
#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
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#ifdef IIGS
|
||||
#pragma noroot
|
||||
segment "screen";
|
||||
extern img_t splash_lz4;
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -78,6 +79,10 @@ screen_introMain(void)
|
||||
draw_pic(0, 0, 0x140, 0xc8, pic_splash);
|
||||
#endif
|
||||
|
||||
#ifdef GFXGS
|
||||
draw_img(&splash_lz4);
|
||||
#endif
|
||||
|
||||
seq = 2;
|
||||
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_Surface *screen;
|
||||
#endif
|
||||
|
||||
#ifdef IIGS
|
||||
volatile char *VIDEO_REGISTER = (char*)0xC029;
|
||||
volatile char *SHADOW_REGISTER = (char*)0xC035;
|
||||
#endif
|
||||
|
||||
static U32 videoFlags;
|
||||
|
||||
static U8 zoom = SYSVID_ZOOM; /* actual zoom level */
|
||||
@ -244,6 +250,13 @@ sysvid_init(void)
|
||||
//BlitFieldHndl = NewHandle(0x10000, userid(), 0xC014, 0);
|
||||
sysvid_fb = (U8*)0x12000;
|
||||
|
||||
// SHR ON
|
||||
*VIDEO_REGISTER|=0xC0;
|
||||
|
||||
// ENABLE Shadowing of SHR
|
||||
*SHADOW_REGISTER&=~0x08; // Shadow Enable
|
||||
|
||||
|
||||
#endif
|
||||
#ifndef IIGS
|
||||
SDL_Surface *s;
|
||||
@ -412,6 +425,12 @@ sysvid_clear(void)
|
||||
{
|
||||
#ifndef IIGS
|
||||
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
|
||||
}
|
||||
|
||||
|
17
src/xrick.c
17
src/xrick.c
@ -18,10 +18,8 @@
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
|
||||
|
||||
extern char splash_lz4;
|
||||
volatile char *VIDEO = (char*)0xC029;
|
||||
extern int LZ4_Unpack(char* pDest, char* pPackedSource);
|
||||
extern char img_splash_lz4;
|
||||
extern void* IMG_SPLASH;
|
||||
|
||||
/*
|
||||
* main
|
||||
@ -31,12 +29,11 @@ main(int argc, char *argv[])
|
||||
{
|
||||
printf("Hello from xrick IIgs\n");
|
||||
|
||||
printf("Unpacking Splash!\n");
|
||||
|
||||
LZ4_Unpack((char*)(0xE12000), &splash_lz4);
|
||||
|
||||
// SHR ON
|
||||
// *VIDEO|=0xC0;
|
||||
// printf("Unpacking Splash!\n");
|
||||
// LZ4_Unpack((char*)(0xE12000), &img_splash_lz4);
|
||||
// printf("%08x\n", &img_splash_lz4 );
|
||||
// printf("%08x\n", IMG_SPLASH );
|
||||
// sys_sleep(10000);
|
||||
|
||||
sys_init(argc, argv);
|
||||
if (sysarg_args_data)
|
||||
|
Loading…
Reference in New Issue
Block a user