|
From: Tim R. <row...@us...> - 2003-02-04 21:10:32
|
Update of /cvsroot/squeak/squeak/platforms/RiscOS/vm
In directory sc8-pr-cvs1:/tmp/cvs-serv13713/vm
Modified Files:
osExports.c sqPlatformSpecific.h sqRPCEvents.c
sqRPCExternalPrims.c sqRPCWindows.c
Log Message:
Rework makefile to combine theold makeplug & makeplugin
Fix problems with fullscreen, change display handling to avoid ugly
'displayBits' hack.
Other minor changes to support compiling with latest Castle/Acorn CC tools.
Index: osExports.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/RiscOS/vm/osExports.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** osExports.c 24 Apr 2002 17:56:36 -0000 1.1
--- osExports.c 4 Feb 2003 21:10:20 -0000 1.2
***************
*** 9,13 ****
extern void setSocketPollFunction(int spf );
void *os_exports[][3] = {
- // #include "platform.exports"
XFN(setSocketPollFunction)
{NULL, NULL, NULL}
--- 9,12 ----
Index: sqPlatformSpecific.h
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/RiscOS/vm/sqPlatformSpecific.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sqPlatformSpecific.h 14 Jan 2003 03:41:09 -0000 1.5
--- sqPlatformSpecific.h 4 Feb 2003 21:10:20 -0000 1.6
***************
*** 28,31 ****
--- 28,37 ----
#define sqFilenameFromString(dst, src, num) sqFilenameFromString(dst, src, num)
+ #undef sqImageFileRead
+ size_t sqImageFileRead(void *ptr, size_t sz, size_t count, FILE* f);
+
+ #undef sqImageFileWrite
+ size_t sqImageFileWrite(void *ptr, size_t sz, size_t count, FILE* f);
+
int sqCopyFilesizetosize(char *srcName, int srcNameSize, char *dstName, int dstNameSize);
Index: sqRPCEvents.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/RiscOS/vm/sqRPCEvents.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqRPCEvents.c 14 Jan 2003 03:41:09 -0000 1.3
--- sqRPCEvents.c 4 Feb 2003 21:10:21 -0000 1.4
***************
*** 21,24 ****
--- 21,28 ----
#include "sqArguments.h"
+ #define longAt(i) (*((int *) (i)))
+
+ //#define DEBUG
+
extern wimp_w sqWindowHandle;
wimp_block wimpPollBlock;
***************
*** 28,31 ****
--- 32,37 ----
extern os_coord pointerOffset;
extern os_coord scalingFactor, scrollOffset, visibleArea;
+ int displayBitmapIndex;
+ extern unsigned int * displaySpriteBits;
/*** Variables -- Event Recording ***/
***************
*** 61,79 ****
#define KEYBUF_SIZE 64
int keyBuf[KEYBUF_SIZE]; /* circular buffer */
! int keyBufGet = 0; /* ndex of next item of keyBuf to read */
! int keyBufPut = 0; /* ndex of next item of keyBuf to write */
int keyBufOverflows = 0; /* number of characters dropped */
! int buttonState = 0; /* mouse button and modifier state */
os_coord savedMousePosition; /* mouse position; not modified when window is inactive */
! int mouseButtonDown; /* keep track of curent mouse button state - for drags outside window */
extern int getInterruptKeycode(void);
! extern int setInterruptPending(int value);
extern int setInterruptCheckCounter(int value);
int scanLine, startX, xLen, startY, stopY, pixelsPerWord, pixelsPerWordShift;
void (*reverserFunction)(void);
! extern int displayBits;
! void (*socketPollFunction)(int delay, int extraFd) = null;
--- 67,84 ----
#define KEYBUF_SIZE 64
int keyBuf[KEYBUF_SIZE]; /* circular buffer */
! int keyBufGet = 0; /* index of next item of keyBuf to read */
! int keyBufPut = 0; /* index of next item of keyBuf to write */
int keyBufOverflows = 0; /* number of characters dropped */
! int buttonState = 0; /* mouse button and modifier state */
os_coord savedMousePosition; /* mouse position; not modified when window is inactive */
! int mouseButtonDown; /* keep track of curent mouse button state - for drags outside window */
extern int getInterruptKeycode(void);
! extern int setInterruptPending(int value);
extern int setInterruptCheckCounter(int value);
int scanLine, startX, xLen, startY, stopY, pixelsPerWord, pixelsPerWordShift;
void (*reverserFunction)(void);
! void (*socketPollFunction)(int delay, int extraFd) = null;
***************
*** 243,247 ****
void WindowOpen( wimp_open * wblock);
extern void claimCaret(wimp_pointer * wblock);
- extern void aioPollForIO(int, int); /* see sqRPCNetwork.c */
extern void receivedClaimEntity(wimp_message * wblock);
extern void receivedDataRequest(wimp_message * wmessage);
--- 248,251 ----
***************
*** 251,270 ****
void eventBufAppendMouseUp(int buttons, int x, int y);
void eventBufAppendMouseMove(int x, int y);
! extern void platReportError( os_error * e);
- //#define dbg
-
void setSocketPollFunction(int spf ) {
socketPollFunction = (void(*)(int, int))spf;
! #ifdef dbg
{
! extern os_error privateErr;
!
! privateErr.errnum = (bits)0;
! sprintf(privateErr.errmess, "socketPoll %0x", (int)socketPollFunction);
! platReportError((os_error *)&privateErr);
! }
#endif
}
--- 255,271 ----
void eventBufAppendMouseUp(int buttons, int x, int y);
void eventBufAppendMouseMove(int x, int y);
! extern void platReportError( os_error * e);
void setSocketPollFunction(int spf ) {
socketPollFunction = (void(*)(int, int))spf;
! #ifdef DEBUG
{
! extern os_error privateErr;
! privateErr.errnum = (bits)0;
! sprintf(privateErr.errmess, "socketPoll %0x", (int)socketPollFunction);
! platReportError((os_error *)&privateErr);
! }
#endif
}
***************
*** 308,319 ****
if(socketPollFunction) {
socketPollFunction(microSecondsToDelay, 0);
! #ifdef dbg
{
! extern os_error privateErr;
! privateErr.errnum = (bits)0;
! sprintf(privateErr.errmess, "socketPoll %0x", (int)socketPollFunction);
! platReportError((os_error *)&privateErr);
! }
#endif
}
--- 309,320 ----
if(socketPollFunction) {
socketPollFunction(microSecondsToDelay, 0);
! #ifdef DEBUG
{
! extern os_error privateErr;
! privateErr.errnum = (bits)0;
! sprintf(privateErr.errmess, "socketPoll %0x", (int)socketPollFunction);
! platReportError((os_error *)&privateErr);
! }
#endif
}
***************
*** 322,343 ****
xwimp_poll_idle((wimp_MASK_POLLWORD| wimp_MASK_GAIN | wimp_MASK_LOSE | wimp_SAVE_FP) , &wimpPollBlock, (os_t)pollDelay, &wimpPollWord, (wimp_event_no*)&wimpPollEvent);
switch ( wimpPollEvent ) {
! case wimp_NULL_REASON_CODE : /* null means no more interesting events, so return */
! return false ; break;
! case wimp_REDRAW_WINDOW_REQUEST : DisplayPixmap(); break;
! case wimp_OPEN_WINDOW_REQUEST : WindowOpen(&wimpPollBlock.open); break;
! case wimp_CLOSE_WINDOW_REQUEST : WindowClose(&wimpPollBlock.close); break;
! case wimp_POINTER_LEAVING_WINDOW : PointerLeaveWindow(&wimpPollBlock); break;
! case wimp_POINTER_ENTERING_WINDOW: PointerEnterWindow(&wimpPollBlock); break;
! case wimp_MOUSE_CLICK : MouseButtons(&wimpPollBlock.pointer); break;
! case wimp_USER_DRAG_BOX : DoNothing(); break;
! case wimp_KEY_PRESSED : KeyPressed( &wimpPollBlock.key); break;
! case wimp_MENU_SELECTION : DoNothing(); break;
! case wimp_SCROLL_REQUEST : DoNothing(); break;
// dont use gain/lose when using clipboard protocols
! //case wimp_LOSE_CARET : DeactivateWindow(&wimpPollBlock); break;
! //case wimp_GAIN_CARET : ActivateWindow(&wimpPollBlock); break;
! case wimp_USER_MESSAGE : UserMessage(&wimpPollBlock.message); break;
! case wimp_USER_MESSAGE_RECORDED : UserMessage(&wimpPollBlock.message); break;
! case wimp_USER_MESSAGE_ACKNOWLEDGE : UserMessage(&wimpPollBlock.message); break;
}
}
--- 323,361 ----
xwimp_poll_idle((wimp_MASK_POLLWORD| wimp_MASK_GAIN | wimp_MASK_LOSE | wimp_SAVE_FP) , &wimpPollBlock, (os_t)pollDelay, &wimpPollWord, (wimp_event_no*)&wimpPollEvent);
switch ( wimpPollEvent ) {
! case wimp_NULL_REASON_CODE:
! /* null means no more interesting events,
! so return */
! return false ; break;
! case wimp_REDRAW_WINDOW_REQUEST :
! DisplayPixmap(); break;
! case wimp_OPEN_WINDOW_REQUEST :
! WindowOpen(&wimpPollBlock.open); break;
! case wimp_CLOSE_WINDOW_REQUEST :
! WindowClose(&wimpPollBlock.close); break;
! case wimp_POINTER_LEAVING_WINDOW :
! PointerLeaveWindow(&wimpPollBlock); break;
! case wimp_POINTER_ENTERING_WINDOW:
! PointerEnterWindow(&wimpPollBlock); break;
! case wimp_MOUSE_CLICK :
! MouseButtons(&wimpPollBlock.pointer); break;
! case wimp_USER_DRAG_BOX :
! DoNothing(); break;
! case wimp_KEY_PRESSED :
! KeyPressed( &wimpPollBlock.key); break;
! case wimp_MENU_SELECTION :
! DoNothing(); break;
! case wimp_SCROLL_REQUEST :
! DoNothing(); break;
// dont use gain/lose when using clipboard protocols
! //case wimp_LOSE_CARET :
! // DeactivateWindow(&wimpPollBlock); break;
! //case wimp_GAIN_CARET :
! // ActivateWindow(&wimpPollBlock); break;
! case wimp_USER_MESSAGE :
! UserMessage(&wimpPollBlock.message); break;
! case wimp_USER_MESSAGE_RECORDED :
! UserMessage(&wimpPollBlock.message); break;
! case wimp_USER_MESSAGE_ACKNOWLEDGE :
! UserMessage(&wimpPollBlock.message); break;
}
}
***************
*** 349,361 ****
void reverse_image_1bpps(void) {
! unsigned int * linePtr, *pixPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! linePtr = (unsigned int *)(displayBits + 4) + j;
! pixPtr = linePtr + startX;
{ int i, k;
unsigned int w, nw;
! for (i=xLen; i--; pixPtr++) {
! w = (unsigned int ) *pixPtr;
nw = w & 0x1;
for (k=31; k--;) {
--- 367,379 ----
void reverse_image_1bpps(void) {
! unsigned int * srcPtr, *dstPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! srcPtr = (unsigned int *)displayBitmapIndex + j + startX;
! dstPtr = displaySpriteBits + j + startX;
{ int i, k;
unsigned int w, nw;
! for (i=xLen; i--; srcPtr++, dstPtr++) {
! w = (unsigned int ) *srcPtr;
nw = w & 0x1;
for (k=31; k--;) {
***************
*** 363,367 ****
nw = (nw << 1) | (w & 0x1);
}
! *pixPtr = nw;
}
}
--- 381,385 ----
nw = (nw << 1) | (w & 0x1);
}
! *dstPtr = nw;
}
}
***************
*** 370,382 ****
void reverse_image_2bpps(void) {
! unsigned int * linePtr, *pixPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! linePtr = (unsigned int *)(displayBits + 4) + j;
! pixPtr = linePtr + startX;
{ int i, k;
unsigned int w, nw;
! for (i=xLen; i--; pixPtr++) {
! w = (unsigned int ) *pixPtr;
nw = w & 0x3;
for (k=15; k--;) {
--- 388,400 ----
void reverse_image_2bpps(void) {
! unsigned int * srcPtr, *dstPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! srcPtr = (unsigned int *)displayBitmapIndex + j + startX;
! dstPtr = displaySpriteBits + j + startX;
{ int i, k;
unsigned int w, nw;
! for (i=xLen; i--; srcPtr++, dstPtr++) {
! w = (unsigned int ) *srcPtr;
nw = w & 0x3;
for (k=15; k--;) {
***************
*** 384,388 ****
nw = (nw << 2) | (w & 0x3);
}
! *pixPtr = nw;
}
}
--- 402,406 ----
nw = (nw << 2) | (w & 0x3);
}
! *dstPtr = nw;
}
}
***************
*** 391,403 ****
void reverse_image_4bpps(void) {
! unsigned int * linePtr, *pixPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! linePtr = (unsigned int *)(displayBits + 4) + j;
! pixPtr = linePtr + startX;
{ int i;
unsigned int w, nw;
! for (i=xLen; i--; pixPtr++) {
! w = (unsigned int ) *pixPtr;
nw = w & 0xF;
w = w >> 4;
--- 409,421 ----
void reverse_image_4bpps(void) {
! unsigned int * srcPtr, *dstPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! srcPtr = (unsigned int *)displayBitmapIndex + j + startX;
! dstPtr = displaySpriteBits + j + startX;
{ int i;
unsigned int w, nw;
! for (i=xLen; i--; srcPtr++, dstPtr++) {
! w = (unsigned int ) *srcPtr;
nw = w & 0xF;
w = w >> 4;
***************
*** 415,419 ****
w = w >> 4;
nw = (nw << 4) | (w & 0xF);
! *pixPtr = nw;
}
}
--- 433,437 ----
w = w >> 4;
nw = (nw << 4) | (w & 0xF);
! *dstPtr = nw;
}
}
***************
*** 422,441 ****
void reverse_image_bytes(void) {
! unsigned int *linePtr, *pixPtr;
! unsigned char * bytePtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! linePtr = (unsigned int *)(displayBits + 4) + j;
! pixPtr = linePtr + startX;
{ int i;
! unsigned int pix;
! for (i=xLen; i--; pixPtr++) {
! pix = *pixPtr;
! bytePtr = (unsigned char *)pixPtr;
! bytePtr[3] = pix & 0xFF;
! bytePtr[2] = (pix >> 8) & 0xFF;
! bytePtr[1] = (pix >> 16) & 0xFF;
! bytePtr[0] = (pix >> 24);
! /* *pixPtr = (((((pix >> 24)) & 255) + (((pix >> 8)) & 65280)) + (((pix << 8)) & 16711680)) + (((pix << 24)) & 4278190080U); */
}
}
--- 440,460 ----
void reverse_image_bytes(void) {
! unsigned int * srcPtr, *dstPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! srcPtr = (unsigned int *)displayBitmapIndex + j + startX;
! dstPtr = displaySpriteBits + j + startX;
{ int i;
! unsigned int w, nw;
! for (i=xLen; i--; srcPtr++, dstPtr++) {
! w = *srcPtr;
! nw = w & 0xFF;
! w = w >>8;
! nw = (nw << 8) | (w & 0xFF);
! w = w >>8;
! nw = (nw << 8) | (w & 0xFF);
! w = w >>8;
! nw = (nw << 8) | (w & 0xFF);
! *dstPtr = nw;
}
}
***************
*** 444,456 ****
void reverse_image_words(void) {
! unsigned int * linePtr, *pixPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! linePtr = (unsigned int *)(displayBits + 4) + j;
! pixPtr = linePtr + startX;
{ int i;
unsigned int w, nw;
! for (i=xLen; i--; pixPtr++) {
! w = (unsigned int ) *pixPtr;
nw = w & 0x1F;
w = w >> 5;
--- 463,475 ----
void reverse_image_words(void) {
! unsigned int * srcPtr, *dstPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! srcPtr = (unsigned int *)displayBitmapIndex + j + startX;
! dstPtr = displaySpriteBits + j + startX;
{ int i;
unsigned int w, nw;
! for (i=xLen; i--; srcPtr++, dstPtr++) {
! w = (unsigned int ) *srcPtr;
nw = w & 0x1F;
w = w >> 5;
***************
*** 464,468 ****
w = w >> 5;
nw = (nw << 5) | (w & 0x1F);
! *pixPtr = nw;
}
}
--- 483,487 ----
w = w >> 5;
nw = (nw << 5) | (w & 0x1F);
! *dstPtr = nw;
}
}
***************
*** 471,483 ****
void reverse_image_longs(void) {
! unsigned int * linePtr, *pixPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! linePtr = (unsigned int *)(displayBits + 4) + j;
! pixPtr = linePtr + startX;
{ int i;
unsigned int w, nw;
! for (i=xLen; i--; pixPtr++) {
! w = (unsigned int ) *pixPtr;
nw = w & 0xFF;
w = w >> 8;
--- 490,502 ----
void reverse_image_longs(void) {
! unsigned int * srcPtr, *dstPtr;
int j;
for(j = startY; j < stopY; j += scanLine) {
! srcPtr = (unsigned int *)displayBitmapIndex + j + startX;
! dstPtr = displaySpriteBits + j + startX;
{ int i;
unsigned int w, nw;
! for (i=xLen; i--; srcPtr++, dstPtr++) {
! w = (unsigned int ) *srcPtr;
nw = w & 0xFF;
w = w >> 8;
***************
*** 485,489 ****
w = w >> 8;
nw = (nw << 8) | (w & 0xFF);
! *pixPtr = nw;
}
}
--- 504,508 ----
w = w >> 8;
nw = (nw << 8) | (w & 0xFF);
! *dstPtr = nw;
}
}
***************
*** 505,511 ****
default: reverserFunction = reverseNothing; return;
}
pixelsPerWordShift = 5-log2Depth;
! pixelsPerWord= 1 << pixelsPerWordShift; /* was = 32/depth */
! scanLine= (squeakDisplaySize.x + pixelsPerWord-1) >> pixelsPerWordShift; /* words per scan line */
}
--- 524,531 ----
default: reverserFunction = reverseNothing; return;
}
+ /* work out words per scan line */
pixelsPerWordShift = 5-log2Depth;
! pixelsPerWord= 1 << pixelsPerWordShift;
! scanLine= (squeakDisplaySize.x + pixelsPerWord-1) >> pixelsPerWordShift;
}
***************
*** 526,536 ****
extern osspriteop_header *displaySprite;
extern osspriteop_trans_tab * pixelTranslationTable;
! //bool more;
! int more;
wimp_draw wblock;
os_error * e;
int xA, yA, xB, yB;
! if ( sqWindowHandle == null ) return;
wblock.w = sqWindowHandle;
more = wimp_redraw_window( &wblock );
DisplayReverseSetup();
--- 546,575 ----
extern osspriteop_header *displaySprite;
extern osspriteop_trans_tab * pixelTranslationTable;
! extern int displayObject(void);
! osbool more;
wimp_draw wblock;
os_error * e;
int xA, yA, xB, yB;
! if ( displaySpriteBits == NULL ) {
! #ifdef DEBUG
! {
! extern os_error privateErr;
! privateErr.errnum = (bits)0;
! sprintf(privateErr.errmess, "DisplayPixmap NULL");
! platReportError((os_error *)&privateErr);
! }
! #endif
! /* flush the damage rectangles */
! wblock.w = sqWindowHandle;
! more = wimp_redraw_window( &wblock );
! while ( more ) {
! xwimp_get_rectangle (&wblock, &more);
! }
! return;
! }
wblock.w = sqWindowHandle;
+ /* Find latest address of source Bitmap.
+ Sensitive to object format */
+ displayBitmapIndex = longAt((displayObject() + 4)+(0 * 4)) + 4;
more = wimp_redraw_window( &wblock );
DisplayReverseSetup();
***************
*** 542,548 ****
DisplayReverseAreaSetup(xA, yA, xB, yB);
reverserFunction();
! if ((e = xosspriteop_put_sprite_scaled (osspriteop_USER_AREA, spriteAreaPtr,
! (osspriteop_id)&(displaySprite->name), wblock.box.x0, wblock.box.y0,
! os_ACTION_OVERWRITE | osspriteop_GIVEN_WIDE_ENTRIES, (os_factors const *)0,pixelTranslationTable)) != NULL) {
if ( spriteAreaPtr != null) {
platReportError(e);
--- 581,590 ----
DisplayReverseAreaSetup(xA, yA, xB, yB);
reverserFunction();
! if ((e = xosspriteop_put_sprite_scaled (osspriteop_USER_AREA,
! spriteAreaPtr,
! (osspriteop_id)&(displaySprite->name),
! wblock.box.x0, wblock.box.y0,
! os_ACTION_OVERWRITE | osspriteop_GIVEN_WIDE_ENTRIES,
! (os_factors const *)0,pixelTranslationTable)) != NULL) {
if ( spriteAreaPtr != null) {
platReportError(e);
***************
*** 550,554 ****
}
}
- reverserFunction();
xwimp_get_rectangle (&wblock, &more);
}
--- 592,595 ----
***************
*** 584,590 ****
DisplayReverseAreaSetup(xA, yA, xB, yB);
reverserFunction();
! if ((e = xosspriteop_put_sprite_scaled (osspriteop_USER_AREA, spriteAreaPtr,
! (osspriteop_id)&(displaySprite->name), wblock.box.x0, wblock.box.y0,
! os_ACTION_OVERWRITE | osspriteop_GIVEN_WIDE_ENTRIES, (os_factors const *)0,pixelTranslationTable)) != NULL) {
if ( spriteAreaPtr != null) {
platReportError(e);
--- 625,634 ----
DisplayReverseAreaSetup(xA, yA, xB, yB);
reverserFunction();
! if ((e = xosspriteop_put_sprite_scaled (osspriteop_USER_AREA,
! spriteAreaPtr,
! (osspriteop_id)&(displaySprite->name),
! wblock.box.x0, wblock.box.y0,
! os_ACTION_OVERWRITE | osspriteop_GIVEN_WIDE_ENTRIES,
! (os_factors const *)0,pixelTranslationTable)) != NULL) {
if ( spriteAreaPtr != null) {
platReportError(e);
***************
*** 592,596 ****
}
}
- reverserFunction();
xwimp_get_rectangle (&wblock, &more);
}
--- 636,639 ----
Index: sqRPCExternalPrims.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/RiscOS/vm/sqRPCExternalPrims.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqRPCExternalPrims.c 14 Jan 2003 03:41:09 -0000 1.3
--- sqRPCExternalPrims.c 4 Feb 2003 21:10:21 -0000 1.4
***************
*** 13,18 ****
// define this to get lots of debug notifiers
! //#define dbg
! #ifdef dbg
#define FPRINTF(s)\
{\
--- 13,18 ----
// define this to get lots of debug notifiers
! //#define DEBUG
! #ifdef DEBUG
#define FPRINTF(s)\
{\
***************
*** 31,48 ****
int ioFindExternalFunctionIn(char *symbol, int moduleHandle) {
// find the function named symbol in the known loaded module moduleHandle
! int fnIndex, address;
! char * foundName;
! fnIndex = 0;
! FPRINTF((privateErr.errmess, "ioFindExternalFunctionIn: (%d)%s", strlen(symbol), symbol));
! do {
! address = (int)rink_enum_named((rink_seghandle)moduleHandle, &fnIndex, &foundName);
if ( strcmp(foundName, symbol) == 0) {
return address;
}
! } while(fnIndex >= 0);
// failed to find the function...
! FPRINTF((privateErr.errmess, " did not find: %s",foundName));
return 0;
}
--- 31,48 ----
int ioFindExternalFunctionIn(char *symbol, int moduleHandle) {
// find the function named symbol in the known loaded module moduleHandle
! int fnIndex= 0, address;
! const char * foundName;
! FPRINTF((privateErr.errmess, "ioFindExternalFunctionIn: %s", symbol));
+ while ( (address = (int)rink_enum_named((rink_seghandle)moduleHandle, &fnIndex, &foundName)), fnIndex >= 0) {
if ( strcmp(foundName, symbol) == 0) {
+ FPRINTF((privateErr.errmess, "found: %s",foundName));
return address;
}
! }
!
// failed to find the function...
! FPRINTF((privateErr.errmess, " did not find: %s", symbol));
return 0;
}
***************
*** 52,75 ****
// of the directory the code and links files are stored in
extern char vmPath[];
! rink_version *Version;
! _kernel_oserror * e;
rink_seghandle moduleHandle;
char codeName[256];
! char linksName[256];
! rink_check CheckBlock;
! // make filename of the code and links
! sprintf(codeName, "%splugins.%s.Code", vmPath, modName);
! sprintf(linksName, "%splugins.%s.Links", vmPath, modName);
FPRINTF((privateErr.errmess, "Load: %s",modName));
!
! // set up the check block
! strcpy(CheckBlock.id, "SqueakSO");
! CheckBlock.main_version = 100;
! CheckBlock.code_version = 0;
!
// load the segment...
! if((e = rink_load(codeName, linksName, &moduleHandle, &CheckBlock)) != NULL) {
FPRINTF((privateErr.errmess, "Plugin load failed: %s", codeName));
return 0;
--- 52,68 ----
// of the directory the code and links files are stored in
extern char vmPath[];
! const rink_version *Version;
! const _kernel_oserror * e;
rink_seghandle moduleHandle;
char codeName[256];
! const rink_check CheckBlock = {"SqueakSO", 100, 0};
! // make filename of the code
! sprintf(codeName, "%splugins.%s", vmPath, modName);
FPRINTF((privateErr.errmess, "Load: %s",modName));
!
// load the segment...
! if((e = rink_load(&CheckBlock, codeName, &moduleHandle)) != NULL) {
FPRINTF((privateErr.errmess, "Plugin load failed: %s", codeName));
return 0;
Index: sqRPCWindows.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/RiscOS/vm/sqRPCWindows.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** sqRPCWindows.c 14 Jan 2003 03:41:09 -0000 1.3
--- sqRPCWindows.c 4 Feb 2003 21:10:24 -0000 1.4
***************
*** 24,27 ****
--- 24,29 ----
#define longAt(i) (*((int *) (i)))
+ //#define DEBUG
+
/*** Variables -- Imported from Virtual Machine ***/
extern unsigned char *memory;
***************
*** 74,78 ****
wimp_version_no actualOSLevel;
[...1088 lines suppressed...]
--- 1297,1301 ----
initGlobalStructure();
! dummyWimpPoll();
/* read the image file and allocate memory for Squeak heap */
***************
*** 1290,1294 ****
privateErr.errnum = (bits)0;
sprintf(privateErr.errmess, "Could not open the Squeak image file '%s'\n", imageName);
! platReportFatalError((os_error *)&privateErr);
ioExit();
}
--- 1305,1310 ----
privateErr.errnum = (bits)0;
sprintf(privateErr.errmess, "Could not open the Squeak image file '%s'\n", imageName);
! platReportError((os_error *)&privateErr);
! helpMessage(vmPath, "!ImName");
ioExit();
}
|