Remove HIGHRES compile-time tests: all palm releases will have HIGHRES

support now; build in different directories.
This commit is contained in:
ehouse 2006-03-31 10:57:01 +00:00
parent 3da83805cc
commit 3388fc9f7b
6 changed files with 68 additions and 165 deletions

View file

@ -15,45 +15,60 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
PLATFORM=palm PLATFORM=obj_palm
LANG=en_US
ROOTNAME = Crosswords ifeq ($(MEMDEBUG),TRUE)
BITMAPS = ./bmps PLATFORM := $(PLATFORM)_memdebug
NAME ?= "Crosswords" CFLAGS += -DMEM_DEBUG -DDEBUG -g -O0
TYPE = appl CSFLAGS += -O0 -g
ICONTEXT ?= "Crosswords" NAME = "CrossDbg"
ICONTEXT = "CrossDbg"
APPID ?= Xwdb
else
PLATFORM := $(PLATFORM)_rel
CFLAGS += -O2 -fomit-frame-pointer
# The -Os flag breaks multilink, at least as I'm using it
CSFLAGS += -OS -fomit-frame-pointer
NAME = "Crosswords"
ICONTEXT = "Crosswords"
APPID ?= Xwr4 APPID ?= Xwr4
endif
LANG=en_US
ROOTNAME = $(NAME)
BITMAPS = ./bmps
TYPE = appl
MLPREFIX = /usr MLPREFIX = /usr
DICT = $(shell echo $$BASENG_PATH) DICT = $(shell echo $$BASENG_PATH)
ARCH ?= ARM_ONLY ARCH ?= ARM_ONLY
ifeq ($(ARCH),ARM_ONLY) ifeq ($(ARCH),ARM_ONLY)
PLATFORM := $(PLATFORM)_armonly
BUILD_AS_PNOLET = 1 BUILD_AS_PNOLET = 1
FEATURE_HIGHRES = -DFEATURE_HIGHRES
TARGET=$(PLATFORM)/xw4_ARM.prc TARGET=$(PLATFORM)/xw4_ARM.prc
else else
ifeq ($(ARCH),68K_ONLY) ifeq ($(ARCH),68K_ONLY)
FEATURE_HIGHRES = -DFEATURE_HIGHRES PLATFORM := $(PLATFORM)_68konly
TARGET=$(PLATFORM)/xw4_68K.prc TARGET=$(PLATFORM)/xw4_68K.prc
else else
ifeq ($(ARCH),SONY) ifeq ($(ARCH),SONY)
# No highres in sony build case # No highres in sony build case
PLATFORM := $(PLATFORM)_sony
BUILD_AS_PNOLET = 1 BUILD_AS_PNOLET = 1
FEATURE_PNOAND68K = -DFEATURE_PNOAND68K FEATURE_PNOAND68K = -DFEATURE_PNOAND68K
TARGET=$(PLATFORM)/xw4_SONY.prc TARGET=$(PLATFORM)/xw4_SONY.prc
else else
ifeq ($(ARCH),COMBINED) ifeq ($(ARCH),COMBINED)
PLATFORM := $(PLATFORM)_combined
BUILD_AS_PNOLET = 1 BUILD_AS_PNOLET = 1
FEATURE_PNOAND68K = -DFEATURE_PNOAND68K FEATURE_PNOAND68K = -DFEATURE_PNOAND68K
FEATURE_HIGHRES = -DFEATURE_HIGHRES
TARGET=$(PLATFORM)/xwords4.prc TARGET=$(PLATFORM)/xwords4.prc
endif endif
endif endif
endif endif
endif endif
DEBUG_SET = APPID=Xwdb ICONTEXT="CrossDbg" NAME="CrossDbg" DONT_OMIT=true
APPNAME = "$(NAME)" APPNAME = "$(NAME)"
@ -117,8 +132,6 @@ else
MYDEFS_COMMON += -DIR_SUPPORT -DIR_EXCHMGR MYDEFS_COMMON += -DIR_SUPPORT -DIR_EXCHMGR
endif endif
MYDEFS_COMMON += $(FEATURE_HIGHRES)
MYDEFS_ARM = -D__LITTLE_ENDIAN -DXW_TARGET_PNO $(MYDEFS_COMMON) MYDEFS_ARM = -D__LITTLE_ENDIAN -DXW_TARGET_PNO $(MYDEFS_COMMON)
MYDEFS_68K = -DPLATFORM_PALM -D__BIG_ENDIAN $(MYDEFS_COMMON) -DAPPNAME=\"$(APPNAME)\" MYDEFS_68K = -DPLATFORM_PALM -D__BIG_ENDIAN $(MYDEFS_COMMON) -DAPPNAME=\"$(APPNAME)\"
@ -148,12 +161,10 @@ ifneq (x$(HS_DUO_SUPPORT)x, xx)
FNAVS = ./fnav03e9.bin FNAVS = ./fnav03e9.bin
endif endif
ifneq (x$(FEATURE_HIGHRES)x, xx) INCLUDES += -I/usr/local/share/palmdev/sdk-5r3/include/SonyIncs
INCLUDES += -I/usr/local/share/palmdev/sdk-5r3/include/SonyIncs INCLUDES += -I/usr/local/share/palmdev/sdk-5r3/include/SonyIncs/System
INCLUDES += -I/usr/local/share/palmdev/sdk-5r3/include/SonyIncs/System INCLUDES += -I/usr/local/share/palmdev/sdk-5r3/include/SonyIncs/Libraries
INCLUDES += -I/usr/local/share/palmdev/sdk-5r3/include/SonyIncs/Libraries MYDEFS_68K += -DCPU_TYPE=CPU_68K
MYDEFS_68K += -DCPU_TYPE=CPU_68K
endif
include ../common/config.mk include ../common/config.mk
@ -191,14 +202,10 @@ MYDEFS_ARM += $(FEATURE_PNOAND68K)
include ../common/rules.mk include ../common/rules.mk
CSFLAGS = -O2 -g -S -Wall -DAPPID=\'$(APPID)\' $(MYDEFS_68K) $(INCLUDES) CSFLAGS += -S -Wall -DAPPID=\'$(APPID)\' $(MYDEFS_68K) $(INCLUDES)
CFLAGS = -O2 -g -Wall -DAPPID=\'$(APPID)\' $(MYDEFS_68K) $(INCLUDES) CFLAGS += -Wall -DAPPID=\'$(APPID)\' $(MYDEFS_68K) $(INCLUDES)
# In the non-debug mode (for which DONT_OMIT is undefined) build without # In the non-debug mode (for which DONT_OMIT is undefined) build without
# the frame pointer. # the frame pointer.
ifneq ($(DONT_OMIT), true)
CSFLAGS += -fomit-frame-pointer
CFLAGS += -fomit-frame-pointer
endif
$(TARGET): $(PLATFORM)/objs.prc $(PLATFORM)/res.prc $(TARGET): $(PLATFORM)/objs.prc $(PLATFORM)/res.prc
$(PAR) -c -a 'resource|backup' -v 4 $@ $(NAME) $(TYPE) $(APPID) $^ $(PAR) -c -a 'resource|backup' -v 4 $@ $(NAME) $(TYPE) $(APPID) $^
@ -211,12 +218,6 @@ endif
solo: solo:
$(MAKE) XWFEATURE_STANDALONE_ONLY=1 $(MAKE) XWFEATURE_STANDALONE_ONLY=1
debug:
$(MAKE) PASSTHRU="-DDEBUG" $(DEBUG_SET)
memdebug:
$(MAKE) PASSTHRU="-DDEBUG -DMEM_DEBUG" $(DEBUG_SET)
gremlins: gremlins:
$(MAKE) PASSTHRU="-DDEBUG -DMEM_DEBUG -DFOR_GREMLINS" DONT_OMIT=true $(MAKE) PASSTHRU="-DDEBUG -DMEM_DEBUG -DFOR_GREMLINS" DONT_OMIT=true
@ -281,7 +282,7 @@ ifneq (x$(BUILD_AS_PNOLET)x, xx)
.PHONY : pnolet .PHONY : pnolet
pnolet: LocalizedStrIncludes.h pnolet: LocalizedStrIncludes.h
$(MAKE) -f Makefile.PNO MYDEFS="$(MYDEFS_ARM) -DAPPID=\'$(APPID)\' \ $(MAKE) -f Makefile.PNO MEMDEBUG=$(MEMDEBUG) MYDEFS="$(MYDEFS_ARM) -DAPPID=\'$(APPID)\' \
-DAPPNAME=\\\"$(APPNAME)\\\"" -DAPPNAME=\\\"$(APPNAME)\\\""
endif endif
@ -307,9 +308,8 @@ endif
# mv code0001.tmp.grc $@ ; rm *.tmp.grc # mv code0001.tmp.grc $@ ; rm *.tmp.grc
help: help:
@echo make [ARCH=(ARM_ONLY|68K_ONLY|SONY|COMBINED)] @echo "make [ARCH=(ARM_ONLY|68K_ONLY|SONY|COMBINED)] [MEMDEBUG=TRUE] [LANG=fr_FR|en_US|es_ES|es_CT|sv_SE|de_DE] [clean]"
@echo make memdebug OR @echo OR
@echo make LANG=en_US OR @echo "make ship-all"
@echo make ship-all OR @echo OR
@echo make gremlins OR @echo "make gremlins"
@echo make clean

View file

@ -46,67 +46,48 @@ BITMAP ID SHOWTRAY_BUTTON_BMP_RES_ID "bmps/showtray.pbitm" AUTOCOMPRESS
BITMAP ID DOWN_ARROW_RESID AUTOCOMPRESS BITMAP ID DOWN_ARROW_RESID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/downarrow.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/downarrow.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/downarrowhd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/downarrowhd.pbitm" BPP 1 DENSITY 144
#endif
END END
BITMAP ID RIGHT_ARROW_RESID AUTOCOMPRESS BITMAP ID RIGHT_ARROW_RESID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/rightarrow.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/rightarrow.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/rightarrowhd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/rightarrowhd.pbitm" BPP 1 DENSITY 144
#endif
END END
/* bitmap family for inclding highres version */ /* bitmap family for inclding highres version */
BITMAP ID TRAY_BUTTONS_BMP_RES_ID AUTOCOMPRESS BITMAP ID TRAY_BUTTONS_BMP_RES_ID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/traybuttons.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/traybuttons.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/traybuttonshd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/traybuttonshd.pbitm" BPP 1 DENSITY 144
#endif
END END
BITMAP ID STAR_BMP_RES_ID AUTOCOMPRESS BITMAP ID STAR_BMP_RES_ID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/startmark.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/startmark.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/startmarkhd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/startmarkhd.pbitm" BPP 1 DENSITY 144
#endif
END END
BITMAP ID FLIP_BUTTON_BMP_RES_ID AUTOCOMPRESS BITMAP ID FLIP_BUTTON_BMP_RES_ID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/flipbutton.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/flipbutton.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/flipbuttonhd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/flipbuttonhd.pbitm" BPP 1 DENSITY 144
#endif
END END
BITMAP ID HINT_BUTTON_BMP_RES_ID AUTOCOMPRESS BITMAP ID HINT_BUTTON_BMP_RES_ID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/lightbulb.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/lightbulb.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/lightbulbhd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/lightbulbhd.pbitm" BPP 1 DENSITY 144
#endif
END END
BITMAP ID VALUE_BUTTON_BMP_RES_ID AUTOCOMPRESS BITMAP ID VALUE_BUTTON_BMP_RES_ID AUTOCOMPRESS
BEGIN BEGIN
BITMAP "bmps/valuebutton.pbitm" BPP 1 DENSITY 72 BITMAP "bmps/valuebutton.pbitm" BPP 1 DENSITY 72
#ifdef FEATURE_HIGHRES
BITMAP "bmps/valuebuttonhd.pbitm" BPP 1 DENSITY 144 BITMAP "bmps/valuebuttonhd.pbitm" BPP 1 DENSITY 144
#endif
END END
#ifdef FEATURE_HIGHRES #define TBH TRAY_BUTTON_HEIGHT_HR
# define TBH TRAY_BUTTON_HEIGHT_HR #define TBY TRAY_BUTTONS_Y_HR
# define TBY TRAY_BUTTONS_Y_HR
#else
# define TBH TRAY_BUTTON_HEIGHT_LR
# define TBY TRAY_BUTTONS_Y_LR
#endif
FORM ID XW_MAIN_FORM AT (0 0 160 160) FORM ID XW_MAIN_FORM AT (0 0 160 160)
USABLE USABLE

View file

@ -56,7 +56,6 @@ static void palm_clr_draw_clearRect( DrawCtx* p_dctx, const XP_Rect* rectP );
static void palm_draw_drawMiniWindow( DrawCtx* p_dctx, const XP_UCHAR* text, static void palm_draw_drawMiniWindow( DrawCtx* p_dctx, const XP_UCHAR* text,
const XP_Rect* rect, void** closureP ); const XP_Rect* rect, void** closureP );
#ifdef FEATURE_HIGHRES
#define HIGHRES_PUSH_LOC( dctx ) \ #define HIGHRES_PUSH_LOC( dctx ) \
{ \ { \
XP_U16 oldVal = 0; \ XP_U16 oldVal = 0; \
@ -83,13 +82,6 @@ static void palm_draw_drawMiniWindow( DrawCtx* p_dctx, const XP_UCHAR* text,
(void)WinSetCoordinateSystem( (dctx)->oldCoord ); \ (void)WinSetCoordinateSystem( (dctx)->oldCoord ); \
(dctx)->oldCoord = 0; \ (dctx)->oldCoord = 0; \
} }
#else
#define HIGHRES_PUSH(dctx)
#define HIGHRES_PUSH_LOC(dctx)
#define HIGHRES_PUSH_NOPOP(dctx)
#define HIGHRES_POP(dctx)
#define HIGHRES_POP_LOC(dctx)
#endif
static void static void
eraseRect( /* PalmDrawCtx* dctx, */const XP_Rect* rect ) eraseRect( /* PalmDrawCtx* dctx, */const XP_Rect* rect )
@ -188,14 +180,12 @@ measureFace( PalmDrawCtx* dctx, XP_UCHAR face, PalmFontHtInfo* fhi )
(void)WinSetDrawWindow( oldWin ); (void)WinSetDrawWindow( oldWin );
WinDeleteWindow( win, false ); WinDeleteWindow( win, false );
#ifdef FEATURE_HIGHRES
/* There should be a way to avoid this, but HIGHRES_PUSH after /* There should be a way to avoid this, but HIGHRES_PUSH after
WinSetDrawWindow isn't working... Fix this... */ WinSetDrawWindow isn't working... Fix this... */
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
top *= 2; top *= 2;
bottom *= 2; bottom *= 2;
} }
#endif
fhi->topOffset = top; fhi->topOffset = top;
fhi->height = bottom - top + 1; fhi->height = bottom - top + 1;
@ -458,6 +448,8 @@ palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
} }
} else if ( !!bitmap ) { } else if ( !!bitmap ) {
XP_Bool doColor = (able == COLOR) && (owner >= 0); XP_Bool doColor = (able == COLOR) && (owner >= 0);
XP_U16 x = localR.left+1;
XP_U16 y = localR.top+1;
/* cheating again; this belongs in a palm_clr method. But the /* cheating again; this belongs in a palm_clr method. But the
special bitmaps are rare enough that we shouldn't change the palm special bitmaps are rare enough that we shouldn't change the palm
draw state every time. */ draw state every time. */
@ -465,7 +457,13 @@ palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
WinSetForeColor( WinSetForeColor(
dctx->drawingPrefs->drawColors[COLOR_PLAYER1+owner] ); dctx->drawingPrefs->drawColors[COLOR_PLAYER1+owner] );
} }
WinDrawBitmap( (BitmapPtr)bitmap, localR.left+1, localR.top+1 );
if ( dctx->doHiRes ) {
++x;
++y;
}
WinDrawBitmap( (BitmapPtr)bitmap, x, y );
if ( doColor ) { if ( doColor ) {
WinSetForeColor( dctx->drawingPrefs->drawColors[COLOR_BLACK] ); WinSetForeColor( dctx->drawingPrefs->drawColors[COLOR_BLACK] );
} }
@ -488,12 +486,10 @@ palm_common_draw_drawCell( DrawCtx* p_dctx, const XP_Rect* rect,
r.topLeft.x = localR.left + ((PALM_BOARD_SCALE-1)/2); r.topLeft.x = localR.left + ((PALM_BOARD_SCALE-1)/2);
r.topLeft.y = localR.top + ((PALM_BOARD_SCALE-1)/2); r.topLeft.y = localR.top + ((PALM_BOARD_SCALE-1)/2);
#ifdef FEATURE_HIGHRES
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
r.topLeft.x += PALM_BOARD_SCALE/2; r.topLeft.x += PALM_BOARD_SCALE/2;
r.topLeft.y += PALM_BOARD_SCALE/2; r.topLeft.y += PALM_BOARD_SCALE/2;
} }
#endif
if ( globals->romVersion >= 35 ) { if ( globals->romVersion >= 35 ) {
WinDrawPixel( r.topLeft.x, r.topLeft.y ); WinDrawPixel( r.topLeft.x, r.topLeft.y );
@ -582,7 +578,6 @@ palm_bnw_draw_trayFinished( DrawCtx* p_dctx )
WinSetClip( &dctx->oldTrayClip ); WinSetClip( &dctx->oldTrayClip );
} /* palm_draw_trayFinished */ } /* palm_draw_trayFinished */
#ifdef FEATURE_HIGHRES
static void static void
smallBoldStringAt( const char* str, XP_U16 len, XP_S16 x, XP_U16 y ) smallBoldStringAt( const char* str, XP_U16 len, XP_S16 x, XP_U16 y )
{ {
@ -600,7 +595,6 @@ smallBoldStringAt( const char* str, XP_U16 len, XP_S16 x, XP_U16 y )
FntSetFont( curFont ); FntSetFont( curFont );
WinSetScalingMode( oldMode ); WinSetScalingMode( oldMode );
} /* smallBoldStringAt */ } /* smallBoldStringAt */
#endif
static void static void
palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect, palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
@ -613,11 +607,9 @@ palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
XP_U16 len, width; XP_U16 len, width;
XP_U16 doubler = 1; XP_U16 doubler = 1;
#ifdef FEATURE_HIGHRES
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
doubler = 2; doubler = 2;
} }
#endif
draw_clearRect( p_dctx, &localR ); draw_clearRect( p_dctx, &localR );
@ -637,12 +629,10 @@ palm_draw_drawTile( DrawCtx* p_dctx, const XP_Rect* rect,
len = XP_STRLEN((const char*)valBuf); len = XP_STRLEN((const char*)valBuf);
if ( 0 ) { if ( 0 ) {
#ifdef FEATURE_HIGHRES
} else if ( dctx->doHiRes && dctx->oneDotFiveAvail ) { } else if ( dctx->doHiRes && dctx->oneDotFiveAvail ) {
smallBoldStringAt( valBuf, len, smallBoldStringAt( valBuf, len,
-(localR.left + localR.width), -(localR.left + localR.width),
localR.top + localR.height - dctx->fntHeight - 1 ); localR.top + localR.height - dctx->fntHeight - 1 );
#endif
} else { } else {
width = FntCharsWidth( valBuf, len ); width = FntCharsWidth( valBuf, len );
WinDrawChars( valBuf, len, localR.left + localR.width - width, WinDrawChars( valBuf, len, localR.left + localR.width - width,
@ -842,11 +832,9 @@ palmMeasureDrawText( PalmDrawCtx* dctx, XP_Rect* bounds, XP_UCHAR* txt,
XP_UCHAR* second = NULL; XP_UCHAR* second = NULL;
XP_U16 doubler = 1; XP_U16 doubler = 1;
#ifdef FEATURE_HIGHRES
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
doubler = 2; doubler = 2;
} }
#endif
widths[0] = FntCharsWidth( (const char*)txt, len ) + 1; widths[0] = FntCharsWidth( (const char*)txt, len ) + 1;
@ -895,11 +883,9 @@ palmMeasureDrawText( PalmDrawCtx* dctx, XP_Rect* bounds, XP_UCHAR* txt,
y += 1; y += 1;
} else { } else {
y -= 2; y -= 2;
#ifdef FEATURE_HIGHRES
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
--y; /* tweak it up one high-res pixel */ --y; /* tweak it up one high-res pixel */
} }
#endif
} }
WinDrawChars( (const char*)txt, len, x, y ); WinDrawChars( (const char*)txt, len, x, y );
@ -1086,18 +1072,12 @@ palm_draw_score_pendingScore( DrawCtx* p_dctx, const XP_Rect* rect,
/* There's no room for the pts string if we're in highres mode and /* There's no room for the pts string if we're in highres mode and
WinSetScalingMode isn't available. */ WinSetScalingMode isn't available. */
#ifdef FEATURE_HIGHRES if ( !dctx->doHiRes || dctx->oneDotFiveAvail ) {
if ( !dctx->doHiRes || dctx->oneDotFiveAvail )
#endif
{
XP_UCHAR* str = (*dctx->getResStrFunc)( dctx->globals, STR_PTS ); XP_UCHAR* str = (*dctx->getResStrFunc)( dctx->globals, STR_PTS );
if ( 0 ) { if ( dctx->oneDotFiveAvail ) {
#ifdef FEATURE_HIGHRES
} else if ( dctx->oneDotFiveAvail ) {
smallBoldStringAt( (const char*)str, XP_STRLEN((const char*)str), smallBoldStringAt( (const char*)str, XP_STRLEN((const char*)str),
x, rect->top ); x, rect->top );
#endif
} else { } else {
WinDrawChars( (const char*)str, WinDrawChars( (const char*)str,
XP_STRLEN((const char*)str), x, rect->top ); XP_STRLEN((const char*)str), x, rect->top );
@ -1171,13 +1151,11 @@ palm_draw_drawTimer( DrawCtx* p_dctx, const XP_Rect* rInner,
} }
y = localR.top - 2; y = localR.top - 2;
#ifdef FEATURE_HIGHRES
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
y -= 1; /* tweak it up one high-res pixel */ y -= 1; /* tweak it up one high-res pixel */
} else { } else {
localR.height += 1; localR.height += 1;
} }
#endif
WinGetClip( &saveClip ); WinGetClip( &saveClip );
WinSetClip( (RectangleType*)&localR ); WinSetClip( (RectangleType*)&localR );
@ -1247,11 +1225,8 @@ splitString( const XP_UCHAR* str, XP_U16* nBufsP, XP_UCHAR** bufs )
static XP_U16 static XP_U16
getMiniLineHt( PalmDrawCtx* dctx ) getMiniLineHt( PalmDrawCtx* dctx )
{ {
if ( 0 ) { if ( dctx->doHiRes ) {
#ifdef FEATURE_HIGHRES
} else if ( dctx->doHiRes ) {
return VALUE_HINT_RECT_HEIGHT_HR; return VALUE_HINT_RECT_HEIGHT_HR;
#endif
} else { } else {
return VALUE_HINT_RECT_HEIGHT; return VALUE_HINT_RECT_HEIGHT;
} }
@ -1355,9 +1330,7 @@ palm_draw_eraseMiniWindow( DrawCtx* p_dctx, const XP_Rect* rect,
void** closure, XP_Bool* invalUnder ) void** closure, XP_Bool* invalUnder )
{ {
PalmMiniWinData* data = (PalmMiniWinData*)*closure; PalmMiniWinData* data = (PalmMiniWinData*)*closure;
#if defined MEM_DEBUG || defined FEATURE_HIGHRES
PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx; PalmDrawCtx* dctx = (PalmDrawCtx*)p_dctx;
#endif
if ( !!closure && !!*closure ) { if ( !!closure && !!*closure ) {
HIGHRES_PUSH_LOC(dctx); HIGHRES_PUSH_LOC(dctx);
@ -1391,9 +1364,7 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able,
MPASSIGN(dctx->mpool, mpool); MPASSIGN(dctx->mpool, mpool);
dctx->able = able; dctx->able = able;
#ifdef FEATURE_HIGHRES
dctx->doHiRes = globals->hasHiRes && globals->width == 320; dctx->doHiRes = globals->hasHiRes && globals->width == 320;
#endif
dctx->globals = globals; dctx->globals = globals;
dctx->getResStrFunc = getRSF; dctx->getResStrFunc = getRSF;
dctx->drawingPrefs = drawprefs; dctx->drawingPrefs = drawprefs;
@ -1459,12 +1430,10 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able,
cWinWidth = CHARRECT_WIDTH; cWinWidth = CHARRECT_WIDTH;
cWinHeight = CHARRECT_HEIGHT; cWinHeight = CHARRECT_HEIGHT;
#ifdef FEATURE_HIGHRES
if ( dctx->doHiRes ) { if ( dctx->doHiRes ) {
cWinWidth *= 2; cWinWidth *= 2;
cWinHeight *= 2; cWinHeight *= 2;
} }
#endif
if ( able == COLOR ) { if ( able == COLOR ) {
} else { } else {
@ -1476,9 +1445,7 @@ palm_drawctxt_make( MPFORMAL GraphicsAbility able,
} }
dctx->fntHeight = FntBaseLine(); dctx->fntHeight = FntBaseLine();
#ifdef FEATURE_HIGHRES
dctx->oneDotFiveAvail = globals->oneDotFiveAvail; dctx->oneDotFiveAvail = globals->oneDotFiveAvail;
#endif
return (DrawCtx*)dctx; return (DrawCtx*)dctx;
} /* palm_drawctxt_make */ } /* palm_drawctxt_make */

View file

@ -31,11 +31,9 @@
#include <FeatureMgr.h> #include <FeatureMgr.h>
#include <NotifyMgr.h> #include <NotifyMgr.h>
#include <unix_stdarg.h> #include <unix_stdarg.h>
#ifdef FEATURE_HIGHRES #include <FileStream.h>
# include <FileStream.h> #ifdef FEATURE_SILK
# ifdef FEATURE_SILK #include <SonyCLIE.h>
# include <SonyCLIE.h>
# endif
#endif #endif
#include "comtypes.h" #include "comtypes.h"
@ -247,7 +245,6 @@ cur_screen_depth( void )
} /* cur_screen_depth */ } /* cur_screen_depth */
#endif #endif
#ifdef FEATURE_HIGHRES
static void static void
getSizes( PalmAppGlobals* globals ) getSizes( PalmAppGlobals* globals )
{ {
@ -288,11 +285,7 @@ getSizes( PalmAppGlobals* globals )
globals->width = width; globals->width = width;
globals->height = height; globals->height = height;
} /* getSizes */ } /* getSizes */
#else
# define getSizes(g)
#endif
#ifdef FEATURE_HIGHRES
/* The resources place the tray-related buttons for the high-res case. If /* The resources place the tray-related buttons for the high-res case. If
* the device is going to want them in the higher low-res position, move them * the device is going to want them in the higher low-res position, move them
* here. And resize 'em too. * here. And resize 'em too.
@ -329,18 +322,11 @@ locateTrayButtons( PalmAppGlobals* globals )
} }
} }
} /* locateTrayButtons */ } /* locateTrayButtons */
#else
# define locateTrayButtons(g)
#endif
static XP_Bool static XP_Bool
positionBoard( PalmAppGlobals* globals ) positionBoard( PalmAppGlobals* globals )
{ {
#ifdef FEATURE_HIGHRES
XP_U16 bWidth = globals->width; XP_U16 bWidth = globals->width;
#else
# define bWidth 160
#endif
XP_Bool erase = XP_FALSE; XP_Bool erase = XP_FALSE;
XP_Bool isLefty = globals->isLefty; XP_Bool isLefty = globals->isLefty;
XP_U16 nCols, leftEdge; XP_U16 nCols, leftEdge;
@ -351,11 +337,7 @@ positionBoard( PalmAppGlobals* globals )
XP_U16 timerWidth, timerLeft; XP_U16 timerWidth, timerLeft;
XP_U16 freeSpaceH; XP_U16 freeSpaceH;
XP_Bool showGrid = globals->gState.showGrid; XP_Bool showGrid = globals->gState.showGrid;
XP_U16 doubler = XP_U16 doubler = globals->useHiRes? 2 : 1;
#ifdef FEATURE_HIGHRES
globals->useHiRes? 2:
#endif
1;
#ifdef SHOW_PROGRESS #ifdef SHOW_PROGRESS
RectangleType bounds; RectangleType bounds;
#endif #endif
@ -383,11 +365,9 @@ positionBoard( PalmAppGlobals* globals )
} }
scale = scale * doubler; scale = scale * doubler;
scaleV = scaleH = scale; scaleV = scaleH = scale;
#ifdef FEATURE_HIGHRES
if ( globals->useHiRes ) { if ( globals->useHiRes ) {
scaleV -= 2; scaleV -= 2;
} }
#endif
freeSpaceH = ((PALM_MAX_COLS-nCols)/2) * scaleH; freeSpaceH = ((PALM_MAX_COLS-nCols)/2) * scaleH;
if ( isLefty ) { if ( isLefty ) {
@ -455,21 +435,16 @@ positionBoard( PalmAppGlobals* globals )
globals->needsScrollbar = false; /* default */ globals->needsScrollbar = false; /* default */
boardHeight = scaleV * nCols; boardHeight = scaleV * nCols;
if ( 0 ) { if ( globals->useHiRes ) {
#ifdef FEATURE_HIGHRES
} else if ( globals->useHiRes ) {
trayTop = ((160 - TRAY_HEIGHT_HR) * doubler) - 1; trayTop = ((160 - TRAY_HEIGHT_HR) * doubler) - 1;
globals->needsScrollbar = false; globals->needsScrollbar = false;
#endif
} else { } else {
trayTop = 160 - TRAY_HEIGHT_LR; trayTop = 160 - TRAY_HEIGHT_LR;
globals->needsScrollbar = showGrid && (nCols == PALM_MAX_COLS); globals->needsScrollbar = showGrid && (nCols == PALM_MAX_COLS);
} }
trayScaleV = trayScaleV =
#ifdef FEATURE_HIGHRES
globals->useHiRes? (TRAY_HEIGHT_HR*doubler) + 1: globals->useHiRes? (TRAY_HEIGHT_HR*doubler) + 1:
#endif
TRAY_HEIGHT_LR; TRAY_HEIGHT_LR;
board_setTrayLoc( globals->game.board, board_setTrayLoc( globals->game.board,
(isLefty? PALM_TRAY_LEFT_LH:PALM_TRAY_LEFT_RH) * doubler, (isLefty? PALM_TRAY_LEFT_LH:PALM_TRAY_LEFT_RH) * doubler,
@ -1012,7 +987,6 @@ doCallbackReg( PalmAppGlobals* globals, XP_Bool reg )
} }
} /* doCallbackReg */ } /* doCallbackReg */
#ifdef FEATURE_HIGHRES
/* temp workarounds for some sony include file trouble */ /* temp workarounds for some sony include file trouble */
# ifdef FEATURE_SILK # ifdef FEATURE_SILK
extern Err SilkLibEnableResizeFoo(UInt16 refNum) extern Err SilkLibEnableResizeFoo(UInt16 refNum)
@ -1075,10 +1049,6 @@ uninitHighResGlobals( PalmAppGlobals* globals )
} }
#endif #endif
} /* uninitHighResGlobals */ } /* uninitHighResGlobals */
#else
# define initHighResGlobals(g)
# define uninitHighResGlobals(g)
#endif
static XP_Bool static XP_Bool
canConvertPrefs( XWords4PreferenceType* prefs, UInt16 prefSize, XP_S16 vers ) canConvertPrefs( XWords4PreferenceType* prefs, UInt16 prefSize, XP_S16 vers )
@ -2065,7 +2035,6 @@ tryLoadSavedGame( PalmAppGlobals* globals, XP_U16 newIndex )
return loaded; return loaded;
} /* tryLoadSavedGame */ } /* tryLoadSavedGame */
#ifdef FEATURE_HIGHRES
static XP_U16 static XP_U16
hresX( PalmAppGlobals* globals, XP_U16 screenX ) hresX( PalmAppGlobals* globals, XP_U16 screenX )
{ {
@ -2095,12 +2064,6 @@ hresRect( PalmAppGlobals* globals, RectangleType* r )
} }
} }
#else
# define hresX( g, n ) (n)
# define hresY( g, n ) (n)
# define hresRect( g, r )
#endif
/***************************************************************************** /*****************************************************************************
* *
****************************************************************************/ ****************************************************************************/
@ -2241,11 +2204,11 @@ mainViewHandleEvent( EventPtr event )
break; break;
case penDownEvent: case penDownEvent:
globals->penDown = handled;
draw = board_handlePenDown( globals->game.board, draw = board_handlePenDown( globals->game.board,
hresX(globals, event->screenX), hresX(globals, event->screenX),
hresY(globals, event->screenY), hresY(globals, event->screenY),
&handled ); &handled );
globals->penDown = handled;
break; break;
case penMoveEvent: case penMoveEvent:

View file

@ -83,11 +83,9 @@ typedef struct PalmDrawCtx {
GraphicsAbility able; GraphicsAbility able;
#ifdef FEATURE_HIGHRES
UInt16 oldCoord; UInt16 oldCoord;
XP_Bool doHiRes; XP_Bool doHiRes;
XP_Bool oneDotFiveAvail; XP_Bool oneDotFiveAvail;
#endif
#ifdef TALL_FONTS #ifdef TALL_FONTS
XP_LangCode fontLangCode; XP_LangCode fontLangCode;
@ -284,14 +282,12 @@ struct PalmAppGlobals {
ProgressCtxt progress; ProgressCtxt progress;
#endif #endif
#ifdef FEATURE_HIGHRES
XP_U16 width, height; XP_U16 width, height;
XP_U16 sonyLibRef; XP_U16 sonyLibRef;
XP_Bool doVSK; XP_Bool doVSK;
XP_Bool hasHiRes; XP_Bool hasHiRes;
XP_Bool oneDotFiveAvail; XP_Bool oneDotFiveAvail;
XP_Bool useHiRes; XP_Bool useHiRes;
#endif
#ifdef XWFEATURE_SEARCHLIMIT #ifdef XWFEATURE_SEARCHLIMIT
XP_Bool askTrayLimits; XP_Bool askTrayLimits;

View file

@ -30,13 +30,9 @@
#define TRAY_HEIGHT_LR 21 #define TRAY_HEIGHT_LR 21
#define TRAY_BUTTON_HEIGHT_LR 10 #define TRAY_BUTTON_HEIGHT_LR 10
#ifdef FEATURE_HIGHRES
# define TRAY_HEIGHT_HR 16 #define TRAY_HEIGHT_HR 16
# define TRAY_BUTTON_HEIGHT_HR 8 #define TRAY_BUTTON_HEIGHT_HR 8
#else
# define TRAY_HEIGHT_HR TRAY_HEIGHT_LR
# define TRAY_BUTTON_HEIGHT_HR TRAY_BUTTON_HEIGHT_LR
#endif
#define TRAY_BUTTON_WIDTH 9 #define TRAY_BUTTON_WIDTH 9
#define FLIP_BUTTON_WIDTH 8 #define FLIP_BUTTON_WIDTH 8