diff --git a/colortables.cc b/colortables.cc index 3f5f6a3..2ed9004 100644 --- a/colortables.cc +++ b/colortables.cc @@ -2,10 +2,7 @@ #include #include - -unsigned char *bigcoltab640a = NULL; -unsigned char *bigcoltab640b = NULL; -unsigned char *bigcoltab320 = NULL; +#include "colortables.h" const unsigned char coltab320[] = { /* bbgggrrr - incoming pixel data */ @@ -81,18 +78,6 @@ const unsigned char coltab640[] = { /* 11111 */ 0xAA,0xAA,0xAA,0xAA,0xFF,0xFF,0xFF,0xFF }; -BOOLEAN AllocateBigColorTables (void) -{ - bigcoltab640a = malloc(65536); - bigcoltab640b = malloc(65536); - bigcoltab320 = malloc(65536); - - if (bigcoltab640a==NULL || bigcoltab640b==NULL || bigcoltab320==NULL) - return FALSE; - - return TRUE; -} - /* iters = number of iterations to do (must be > 0) */ BOOLEAN MakeBigColorTables (unsigned int iters) { diff --git a/colortables.h b/colortables.h index fc22244..ed33131 100644 --- a/colortables.h +++ b/colortables.h @@ -5,5 +5,4 @@ extern unsigned char *bigcoltab640a; extern unsigned char *bigcoltab640b; extern unsigned char *bigcoltab320; -BOOLEAN AllocateBigColorTables(void); BOOLEAN MakeBigColorTables(unsigned int); diff --git a/make b/make index b4eeded..05f4ad9 100644 --- a/make +++ b/make @@ -26,6 +26,16 @@ for file in vncview vncsession vncdisplay colortables \ end end +for file in tables + unset exit + newer {file}.a {file}.asm + if {status} != 0 + set exit on + assemble {file}.asm keep={file} + set link true + end +end + unset exit newer vncview.rezfork vncview.rez if {status} != 0 @@ -35,7 +45,7 @@ if {status} != 0 end if {link} == true - link vncview vncsession vncdisplay colortables \ + link vncview vncsession vncdisplay colortables tables \ desktopsize mouse keyboard copyrect raw hextile clipboard \ keep=VNCview.GS filetype VNCview.GS S16 $DB03 diff --git a/tables.asm b/tables.asm new file mode 100644 index 0000000..d60c30a --- /dev/null +++ b/tables.asm @@ -0,0 +1,32 @@ + case on + +* Color tables +* 64k each, each in its own segment + +BCT640A data COLTAB640A + ds $10000 + end + +BCT640B data COLTAB640B + ds $10000 + end + +BCT320 data COLTAB320 + ds $10000 + end + +* Pointers to color tables, used for accessing them from C +* These must be in the blank load segment so they can be accessed as C globals +* (in the small memory model). + +bigcoltab640a data + dc i4'BCT640A' + end + +bigcoltab640b data + dc i4'BCT640B' + end + +bigcoltab320 data + dc i4'BCT320' + end diff --git a/vncview.cc b/vncview.cc index cfb5ea1..33a8e58 100644 --- a/vncview.cc +++ b/vncview.cc @@ -355,12 +355,6 @@ void Quit (void) { if (readBufferHndl) DisposeHandle(readBufferHndl); /* Get rid of TCPIP read buffer hndl */ - if (bigcoltab320) - free(bigcoltab320); - if (bigcoltab640a) - free(bigcoltab640a); - if (bigcoltab640b) - free(bigcoltab640b); if (cursor) free(cursor); @@ -421,13 +415,6 @@ int main (void) { Quit(); } - if (!AllocateBigColorTables()) { - SysBeep(); - InitCursor(); - AlertWindow(awResource, NULL, outOfMemoryError); - Quit(); - } - InitScreen(); /* Set up color tables */ LoadScrap(); /* put scrap in memory */