Clean up more very old or unusable code
This commit is contained in:
parent
f477b87e50
commit
91f8dca1cb
|
@ -1,6 +1,6 @@
|
|||
/* <platform.h> file for CASIO Graph 90+E / fx-CG 50 hardware */
|
||||
#ifndef PLATFORM_H
|
||||
#define PLATFORM_H
|
||||
// real Casio fx-CG HW
|
||||
|
||||
//---
|
||||
// WAD file access method (enable exactly one)
|
||||
|
@ -23,40 +23,12 @@
|
|||
|
||||
//---
|
||||
|
||||
typedef struct{
|
||||
int x;
|
||||
int y;
|
||||
int xofs;
|
||||
int yofs;
|
||||
int width;
|
||||
int height;
|
||||
char colormode;
|
||||
char zero4;
|
||||
char P20_1;
|
||||
char P20_2;
|
||||
int bitmap;
|
||||
char color_idx1;
|
||||
char color_idx2;
|
||||
char color_idx3;
|
||||
char P20_3;
|
||||
char writemodify;
|
||||
char writekind;
|
||||
char zero6;
|
||||
char one1;
|
||||
int transparency;
|
||||
} TDispGraph;
|
||||
|
||||
#include "keyboard.hpp"
|
||||
#include "keyboard_syscalls.h"
|
||||
//#include "display_syscalls.h"
|
||||
//#include "display_tools.h"
|
||||
#include "APP_syscalls.h"
|
||||
#include "CONVERT_syscalls.h"
|
||||
#include "SYSTEM_syscalls.h"
|
||||
//#include "heap_syscalls.h"
|
||||
#include "RTC_syscalls.h"
|
||||
//#include "STD_syscalls.h"
|
||||
//#include "convert_tools.h"
|
||||
#include "MCS_syscalls.h"
|
||||
#include "fxcg/display.h"
|
||||
#include "fxcg/misc.h"
|
||||
|
@ -67,47 +39,16 @@ typedef struct{
|
|||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#define WIDTH 384
|
||||
#define HEIGHT 216
|
||||
#define dbgprint(a)
|
||||
#define dbgprint1(a,b)
|
||||
#define dbgprint2(a,b,c)
|
||||
#define dbgprint3(a,b,c,d)
|
||||
#define dbgprint4(a,b,c,d,e)
|
||||
|
||||
//#define VRAM ((unsigned short *)0xA8000000)
|
||||
//#define NULL 0
|
||||
|
||||
#define KEY_PRGM_OPTN 68
|
||||
#define KEY_PRGM_MENU 48
|
||||
#define KEY_PRGM_POWER 57
|
||||
#define KEY_PRGM_EXE 31
|
||||
|
||||
#if 0
|
||||
typedef int (*TSysCallFuncPtr)( int R4, int R5, int R6, int R7, int FNo );
|
||||
extern TSysCallFuncPtr fnSysCallFuncPtr;
|
||||
|
||||
|
||||
//syscall 0x1BB7: int Serial_Open( unsigned char *mode );
|
||||
#define Serial_Open(mode) fnSysCallFuncPtr((int)mode,0,0,0,0x1BB7)
|
||||
//syscall 0x1BBC: int Serial_BufferedTransmitOneByte( unsigned char byte_to_transmit );
|
||||
#define Serial_BufferedTransmitOneByte(byte_to_transmit) fnSysCallFuncPtr((int)byte_to_transmit,0,0,0,0x1BBC)
|
||||
//syscall 0x1BB8: int Serial_Close( int mode );
|
||||
#define Serial_Close(mode) fnSysCallFuncPtr((int)mode,0,0,0,0x1BB8)
|
||||
//syscall 0x1BB9: int Serial_ReadOneByte( unsigned char*result );
|
||||
#define Serial_ReadOneByte(pResult) fnSysCallFuncPtr((int)pResult,0,0,0,0x1BB9)
|
||||
|
||||
#define Bfile_OpenFile_OS(filename,mode,...) fnSysCallFuncPtr((int)filename,mode,0,0,0x1DA3)
|
||||
#define Bfile_CloseFile_OS(HANDLE) fnSysCallFuncPtr(HANDLE,0,0,0,0x1DA4)
|
||||
#define Bfile_ReadFile_OS(HANDLE,buf,size,readpos) fnSysCallFuncPtr(HANDLE,(int)buf,size,readpos,0x1DAC)
|
||||
#endif
|
||||
|
||||
|
||||
#define EmulHack_Sleep(x)
|
||||
|
||||
#define ASSERT(x)
|
||||
|
||||
#define InitFlashSimu(filename)
|
||||
|
||||
#endif //#ifndef PLATFORM_H
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
#include "platform.h"
|
||||
#include "os.h"
|
||||
|
||||
|
@ -173,7 +172,6 @@ void CGDstrncpy(char *pszBuf,const char *pszText,int iLen)
|
|||
pszBuf[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
int CGDstrcmp (const char*s1,const char*s2)
|
||||
{
|
||||
while(s1[0])
|
||||
|
@ -189,13 +187,6 @@ int CGDstrcmp (const char*s1,const char*s2)
|
|||
}
|
||||
return (unsigned char)s2[0]>0;
|
||||
}
|
||||
/*int CGDstrcmp (const char*s1,const char*s2)
|
||||
{
|
||||
int i = CGDstrcmpX(s1,s2);
|
||||
ASSERT(!i==!strcmp(s1,s2));
|
||||
return i;
|
||||
}*/
|
||||
|
||||
|
||||
int CGDstrncmp (const char*s1,const char*s2,int iLen)
|
||||
{
|
||||
|
@ -224,12 +215,6 @@ int CGDstrncmp (const char*s1,const char*s2,int iLen)
|
|||
}
|
||||
return (unsigned char)s2[0]>0;
|
||||
}
|
||||
/*int CGDstrncmp (const char*s1,const char*s2,int iLen)
|
||||
{
|
||||
int i = CGDstrncmpX(s1,s2,iLen);
|
||||
ASSERT(!i==!strncmp(s1,s2,iLen));
|
||||
return i;
|
||||
}*/
|
||||
|
||||
static unsigned char Upper(unsigned char c)
|
||||
{
|
||||
|
@ -267,15 +252,6 @@ int CGDstrnicmp (const char*s1,const char*s2,int iLen)
|
|||
return (unsigned char)s2[0]>0;
|
||||
}
|
||||
|
||||
/*int CGDstrnicmp (const char*s1,const char*s2,int iLen)
|
||||
{
|
||||
int i = CGDstrnicmpX(s1,s2,iLen);
|
||||
int j = strnicmp(s1,s2,iLen);
|
||||
ASSERT(!i==!j);
|
||||
return i;
|
||||
}
|
||||
*/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// WAD file access mechanism
|
||||
//
|
||||
|
@ -333,44 +309,6 @@ void ResetData(FileMapping *pMap)
|
|||
pMap->miCurrentLength = 0;
|
||||
}
|
||||
|
||||
|
||||
static int memcmp32(const int *p1,const int *p2,int count)
|
||||
{
|
||||
while(count)
|
||||
{
|
||||
if(*p1 != *p2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
p1++;
|
||||
p2++;
|
||||
count--;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//I was able to use memcmp(), it compiled but it seems it returned always 0
|
||||
// quick fix fot now
|
||||
/*int Xmemcmp(const char *p1,const char *p2,int len)
|
||||
{
|
||||
if(!(len & 3))
|
||||
{
|
||||
return memcmp32((int*)p1,(int*)p2,len >>2);
|
||||
}
|
||||
while(len)
|
||||
{
|
||||
if(*p1 != *p2)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
p1++;
|
||||
p2++;
|
||||
len--;
|
||||
}
|
||||
return 0;
|
||||
}*/
|
||||
#define Xmemcmp memcmp
|
||||
|
||||
int CreateFileMapping(const unsigned short *pFileName,FileMapping *pMap){
|
||||
int iResult = 0;
|
||||
char cBuffer[FLASH_PAGE_SIZE];
|
||||
|
@ -391,7 +329,7 @@ int CreateFileMapping(const unsigned short *pFileName,FileMapping *pMap){
|
|||
|
||||
for(;iPageIndx < FLASH_PAGE_COUNT;iPageIndx++)
|
||||
{
|
||||
if(!Xmemcmp(pTgt,cBuffer,iLength))
|
||||
if(!memcmp(pTgt,cBuffer,iLength))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
@ -431,7 +369,7 @@ int CreateFileMapping(const unsigned short *pFileName,FileMapping *pMap){
|
|||
{
|
||||
break;
|
||||
}
|
||||
if(Xmemcmp(pTgt,cBuffer,iLength))
|
||||
if(memcmp(pTgt,cBuffer,iLength))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue