Fixes for the Hall of Fame, Direct Export the Xrick Splash into a C1 so that B2S doesn't screw up the palette, now we can see the the compiled tiles render

This commit is contained in:
dwsJason 2018-08-18 20:05:59 -04:00
parent 5ecc2034c8
commit 19dfb38262
8 changed files with 90 additions and 38 deletions

View File

@ -19,7 +19,7 @@ iOffset equ 5
iTileNo equ 7
phb
lda iOffset,s
tay
lda iTileNo,s
@ -28,20 +28,26 @@ iTileNo equ 7
anop ; adjust the stack
anop ; Copy the Return address
lda 1,s
sta iTileNo-2,s
lda 3,s
sta iTileNo,s
lda 1,s
sta iTileNo-2,s
pla
lda #$0101
sta 1,s
plb
plb
TILEBANK gequ *
TILEBANK2 entry
lda >$880005,x
sta >TILEBANK+1
TILEBANK entry
jsl >$880000
plb
rtl
*-------------------------------------------------------------------------------
@ -53,6 +59,7 @@ iBank equ 4
sep #$30
lda iBank,s
sta >TILEBANK+3
sta >TILEBANK2+3
rep #$30
lda 2,s
sta iBank,s

View File

@ -69,6 +69,67 @@ void savePixelsGS(MYBMP *pBitmap, const char* pFilename)
}
}
//
//
//
void savePixelsGSc1(MYBMP *pBitmap, const char* pFilename)
{
FILE* gsfile = fopen( pFilename, "wb" );
if (gsfile)
{
unsigned char* pPixels = pBitmap->map;
for (int y = 0; y < pBitmap->height; ++y)
{
for (int x = 0; x < pBitmap->width; x+=2)
{
unsigned char* pPixel = pPixels + (y*pBitmap->width) + x;
unsigned char GS_PIXEL = 0;
GS_PIXEL = (pPixel[0] << 4) | (pPixel[1] & 0xF);
putc(GS_PIXEL, gsfile);
}
}
for (int idx = 0; idx < 256; ++idx)
{
putc(0, gsfile); // SCBs + Screen holes
}
for (int palnum = 0; palnum < 16; ++palnum)
{
for (int idx = 0; idx < 16; idx++)
{
u16 pixel = 0;
u16 red = pBitmap->palette[ (idx * 3)+0 ];
u16 green = pBitmap->palette[ (idx * 3)+1 ];
u16 blue = pBitmap->palette[ (idx * 3)+2 ];
red>>=4;
green>>=4;
blue>>=4;
pixel |= red << 8;
pixel |= green << 4;
pixel |= blue;
putc(pixel & 0xff, gsfile);
putc(pixel >> 8, gsfile);
}
}
fclose(gsfile);
}
else
{
fprintf(stderr,"\nERROR Unable to create output file: %s\n", pFilename);
exit(1);
}
}
//
// Save the RawBMP Data as a PNG
//
@ -412,6 +473,7 @@ int main(int argc, char **argv)
pBitmap = loadPic( pic_splash, 320, 200 );
savePng(pBitmap, "splash.png");
savePixelsGSc1(pBitmap, "splash.c1");
pBitmap = loadImage( IMG_SPLASH );
savePng(pBitmap, "img_splash.png");

View File

@ -6,32 +6,11 @@ rem
echo Y |del data.lib
if exist "bmp" (
echo Y |del bmp\*
rmdir bmp
)
rem
rem bmp directory if it doesn't exist
rem
if not exist "bmp" (
mkdir bmp
)
rem
rem convert all the pngs to bmp
rem
png2bmp -D bmp data\pics\*.png
rem
rem for now just convert the splash screen, to GS format
rem
b2s bmp\splash.bmp
b2s bmp\img_splash16.bmp
rem
rem Compress the title page
rem
lz4 -c2 bmp\splash.SHR#C10000 data\splash.lz4
lz4 -c2 bmp\img_splash16.SHR#C10000 data\img_splash16.lz4
lz4 -c2 data\pics\splash.c1 data\splash.lz4
lz4 -c2 data\pics\img_splash.c1 data\img_splash16.lz4
rem
rem Hall of Fame
rem

BIN
data/pics/img_splash.c1 Normal file

Binary file not shown.

BIN
data/pics/splash.c1 Normal file

Binary file not shown.

View File

@ -88,7 +88,7 @@ extern void sys_sleep(int);
*/
#define SYSVID_ZOOM 2
#define SYSVID_MAXZOOM 4
#ifdef GS
#ifdef IIGS
#define SYSVID_WIDTH 160
#else
#define SYSVID_WIDTH 320
@ -180,7 +180,7 @@ extern volatile unsigned long* tick;
// GS Rendering Stuff
extern void SetTileBank(short bank);
extern void DrawTile(short offset, short tileNo);
extern void DrawTile(int offset, int tileNo);
// ADB Support Code
extern char KeyArray[128];

View File

@ -111,7 +111,7 @@ static U8 *fb; /* frame buffer pointer */
void
draw_setfb(U16 x, U16 y)
{
#ifdef GSGFX
#ifdef IIGS
fb = sysvid_fb + (x>>1) + (y * SYSVID_WIDTH);
#else
fb = sysvid_fb + x + y * SYSVID_WIDTH;
@ -242,7 +242,10 @@ draw_tile(U8 tileNumber)
int tileNo = (draw_tilesBank*256)+tileNumber;
DrawTile((short)fb,tileNo);
//printf("fb=%04x tileNo=%04x\n", (int)fb, tileNo);
//sys_sleep(1000); // Wait 1 second
DrawTile(((int)fb),tileNo);
fb += 4; /* next tile */
#else

View File

@ -226,8 +226,8 @@ sysvid_init(void)
{
#ifdef IIGS
handle hndl; // "generic memory handle"
void* directPageHandle;
void* tilesPageHandle;
U32* directPageHandle;
U32* tilesPageHandle;
// PushLong #0 ;/* Ask Shadowing Screen ($8000 bytes from $01/2000)*/
// PushLong #$8000
@ -270,7 +270,7 @@ sysvid_init(void)
// Allocate Some Direct Page memory
printf("Allocate Direct Page space 512 bytes\n");
directPageHandle = NewHandle( 0x200, userid(), 0xC005, 0 );
directPageHandle = (U32*)NewHandle( 0x200, userid(), 0xC005, 0 );
if (toolerror())
{
printf("Unable to allocate 512 bytes Direct Page\n");
@ -282,7 +282,7 @@ sysvid_init(void)
//BlitFieldHndl = NewHandle(0x10000, userid(), 0xC014, 0);
printf("Allocate Bank for 8x8 Tiles\n");
tilesPageHandle = NewHandle(0x10000, userid(), 0xC014, 0);
tilesPageHandle = (U32*)NewHandle(0x10000, userid(), 0xC014, 0);
if (toolerror())
{
printf("Unable to allocate 64k Tiles Bank\n");
@ -291,13 +291,14 @@ sysvid_init(void)
exit(1);
}
printf("SUCCESS\n");
SetTileBank(((U8*)*tilesPageHandle)[2]);
SetTileBank((*tilesPageHandle)>>16);
LZ4_Unpack((char*)*tilesPageHandle, &tiles_lz4);
sysvid_fb = (U8*)0x12000;
// SHR ON
//*VIDEO_REGISTER|=0xC0;
*VIDEO_REGISTER|=0xC0;
// ENABLE Shadowing of SHR
*SHADOW_REGISTER&=~0x08; // Shadow Enable
@ -505,7 +506,7 @@ sysvid_clear(void)
#ifndef IIGS
memset(sysvid_fb, 0, SYSVID_WIDTH * SYSVID_HEIGHT);
#else
size_t length = SYSVID_WIDTH /2 * SYSVID_HEIGHT;
size_t length = SYSVID_WIDTH * SYSVID_HEIGHT;
//printf("sysvid_clear: target = %08p\n", sysvid_fb);
//printf("sysvid_clear: length = %08p\n", length);
//sys_sleep(10000);