|
|
| version 1.1, 2005/02/07 16:56:32 | version 1.3, 2005/02/27 18:22:06 |
|---|---|
| Line 16 typedef struct tagLocals3216{ | Line 16 typedef struct tagLocals3216{ |
| #define PalmAPI(a,b) (gCall68KFuncP)(gEmulStateP,PceNativeTrapNo(a),&b,sizeof(b)) | #define PalmAPI(a,b) (gCall68KFuncP)(gEmulStateP,PceNativeTrapNo(a),&b,sizeof(b)) |
| #define setAddress(a,b) a.hi=ByteSwap16(b>>16);a.lo=ByteSwap16(b&0xffff) | |
| void ARM_TYPE_pointerinvoid (void* ptr, UINT trapID) { | void ARM_TYPE_pointerinvoid (void* ptr, UINT trapID) { |
| ArgOne params; | ArgOne params; |
| params.ptr = ByteSwap32(ptr); | params.ptr = ByteSwap32(ptr); |
| Line 37 void ARM_TYPE_ptr16ptrinvoid(void* frm, | Line 39 void ARM_TYPE_ptr16ptrinvoid(void* frm, |
| typedef struct tagLocals{ | typedef struct tagLocals{ |
| UInt32 ptr; | UInt32 ptr; |
| UINT16 objid; | UINT16 objid; |
| UINT16 texthi; | UINT16 hi; |
| UINT16 textlo; | UINT16 lo; |
| } Locals; | } Locals; |
| Locals params; | Locals params; |
| params.ptr = ByteSwap32(frm); | params.ptr = ByteSwap32(frm); |
| params.objid = ByteSwap16(id); | params.objid = ByteSwap16(id); |
| params.texthi = ByteSwap16(text >> 16); | setAddress(params, text); |
| params.textlo = ByteSwap16(text & 0xffff); | |
| PalmAPI(trapID, params); | PalmAPI(trapID, params); |
| } | } |
| Line 144 Err ARM_SndStreamSetVolume(UInt32 stream | Line 145 Err ARM_SndStreamSetVolume(UInt32 stream |
| return((Err)PalmAPI(sysTrapSndStreamSetVolume, params)); | return((Err)PalmAPI(sysTrapSndStreamSetVolume, params)); |
| } | } |
| /* | |
| UInt32 ARM_SysTicksPerSecond(void){ | |
| typedef struct _tagLocals { | |
| UInt8 noArgs; | |
| } Locals; | |
| Locals params; | |
| params.noArgs = 0; | |
| return ((UInt32)((gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapSysTicksPerSecond), ¶ms, sizeof(params) | kPceNativeWantA0))); | |
| } | |
| */ | |
| void ARM_MemSet(void* destP, Int32 numBytes, UInt8 value) { | void ARM_MemSet(void* destP, Int32 numBytes, UInt8 value) { |
| Int32 i; | Int32 i; |
| char *p=(char *)destP; | char *p=(char *)destP; |
| Line 310 char* ARM_LstGetSelectionText(ListType* | Line 300 char* ARM_LstGetSelectionText(ListType* |
| return ((char*)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapLstGetSelectionText), ¶ms, sizeof(params) | kPceNativeWantA0)); | return ((char*)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapLstGetSelectionText), ¶ms, sizeof(params) | kPceNativeWantA0)); |
| } | } |
| /* | |
| MemHandle ARM_FldGetTextHandle(FieldType* fld) { | |
| ArgOne params; | |
| params.ptr = ByteSwap32(fld); | |
| return ((MemHandle)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapFldGetTextHandle), ¶ms, sizeof(params) | kPceNativeWantA0)); | |
| } | |
| char* ARM_FldGetTextPtr(FieldType* fld) { | |
| ArgOne params; | |
| params.ptr = ByteSwap32(fld); | |
| return ((char*)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapFldGetTextPtr), ¶ms, sizeof(params) | kPceNativeWantA0)); | |
| } | |
| char* ARM_MemHandleLock(MemHandle ptr) { | |
| ArgOne params; | |
| params.ptr = ByteSwap32(ptr); | |
| return ((char*)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapMemHandleLock), ¶ms, sizeof(params) | kPceNativeWantA0)); | |
| } | |
| */ | |
| void ARM_TimSecondsToDateTime(UInt32 seconds, DateTimeType* dateTimeP) { | void ARM_TimSecondsToDateTime(UInt32 seconds, DateTimeType* dateTimeP) { |
| typedef struct tagLocals{ | typedef struct tagLocals{ |
| UInt32 data; | UInt32 data; |
| Line 345 void ARM_TimSecondsToDateTime(UInt32 sec | Line 317 void ARM_TimSecondsToDateTime(UInt32 sec |
| UINT32 palmos_gettick(void) { | UINT32 palmos_gettick(void) { |
| return( ARM_TimGetTicks() * (1000 / systicks)); | return( ARM_TimGetTicks() * (1000 / systicks)); |
| } | } |
| /* | |
| UInt8* ARM_BmpGetBits(BitmapType *bmpPtr) | |
| { | |
| UInt32 arg; | |
| arg = ByteSwap32(bmpPtr); | |
| return (UInt8*)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapBmpGetBits), &arg, 4 | kPceNativeWantA0); | |
| } | |
| void ARM_BmpGetDimensions(BitmapType *bmpPtr, Int16 *width, Int16 *height, UInt16 *rowBytes) | |
| { | |
| UInt32 args[4]; | |
| args[0] = ByteSwap32(bmpPtr); | |
| args[1] = ByteSwap32(width); | |
| args[2] = ByteSwap32(height); | |
| args[3] = ByteSwap32(rowBytes); | |
| (gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapBmpGetDimensions), &args, 16); | |
| *width = ByteSwap16(*width); | |
| *height = ByteSwap16(*height); | |
| *rowBytes = ByteSwap16(*rowBytes); | |
| } | |
| */ | |
| /* | |
| BitmapType* ARM_BmpCreate(Coord width, Coord height, UInt8 depth, ColorTableType* colortableP, UInt16* err) { | |
| typedef struct tagLocals{ | |
| Coord w; | |
| Coord h; | |
| UInt8 d; | |
| UInt32 c; | |
| UInt32 e; | |
| } Locals; | |
| Locals params; | |
| params.w = ByteSwap32(width); | |
| params.h = ByteSwap32(height); | |
| params.d = ByteSwap32(depth); | |
| params.c = ByteSwap32(colortableP); | |
| params.e = ByteSwap32(err); | |
| return( (BitmapType*)(gCall68KFuncP)(gEmulStateP, PceNativeTrapNo(sysTrapBmpCreate), ¶ms, sizeof(params) | kPceNativeWantA0) ); | |
| } | |
| BitmapTypeV3* ARM_BmpCreateBitmapV3(const BitmapType* bitmapP, UInt16 density, const void* bitsP, ColorTableType* colortableP) { | |
| UInt32 args[4]; | |
| args[0] = ByteSwap32(bitmapP); | |
| args[1] = ByteSwap32(density); | |
| args[2] = ByteSwap32(bitsP); | |
| args[3] = ByteSwap32(colortableP); | |
| return((BitmapTypeV3*)(gCall68KFuncP)(gEmulStateP, (unsigned long)Callback_m68k, &args, 16 | kPceNativeWantA0)); | |
| } | |
| */ | |
| void ARM_EvtGetEvent(EventType *event, Int32 timeout) { | void ARM_EvtGetEvent(EventType *event, Int32 timeout) { |
| typedef struct tagLocals{ | typedef struct tagLocals{ |
| UInt32 event; | UInt32 event; |
| Line 481 void print(char *format, ...) { | Line 398 void print(char *format, ...) { |
| (gCall68KFuncP)(gEmulStateP, (unsigned long)Callback_print, &arg, 4); | (gCall68KFuncP)(gEmulStateP, (unsigned long)Callback_print, &arg, 4); |
| } | } |
| UINT16 ARM_SysBatteryInfo(UINT8* battery) { | |
| typedef struct tagLocals{ | |
| UInt8 nul[22]; | |
| UInt16 hi; | |
| UInt16 lo; | |
| } Locals; | |
| Locals params; | |
| ZeroMemory(params.nul, 22); | |
| setAddress(params, battery); | |
| return((UINT16)PalmAPI(sysTrapSysBatteryInfo, params)); | |
| } | |