Commit b9658e2c authored by Libretro-Admin's avatar Libretro-Admin
Browse files

(MacOS) Add ARM 64bit MacOS support + warning fixes

parent 913881b5
......@@ -33,6 +33,10 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-x64.yml'
# MacOS ARM 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-arm64.yml'
################################## CELLULAR ################################
# Android
- project: 'libretro-infrastructure/ci-templates'
......@@ -104,6 +108,12 @@ libretro-build-osx-x64:
- .libretro-osx-x64-make-default
- .core-defs
# MacOS ARM 64-bit
libretro-build-osx-arm64:
extends:
- .libretro-osx-arm64-make-default
- .core-defs
################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
......
......@@ -476,7 +476,7 @@ int LoadFDI(FDIDisk *D,const char *FileName,int Format)
/* Build disk information */
memset(P+16,0,I-16);
memcpy(P+0x08E2,TRDDiskInfo,sizeof(TRDDiskInfo));
strncpy(P+0x08F5,"SPECCY",8);
strncpy((char*)P+0x08F5,"SPECCY",8);
K = D->Sectors+N;
J = D->Sectors*D->Tracks*D->Sides-K;
P[0x8E1] = K%D->Sectors; /* First free sector */
......
......@@ -382,14 +382,14 @@ byte *DSKLoad(const char *Name,byte *Dsk)
/* Scan, read, store files */
while(retro_readdir(D))
if(Path=malloc(strlen(Name)+strlen(retro_dirent_get_name(D))+5))
if((Path = malloc(strlen(Name)+strlen(retro_dirent_get_name(D))+5)))
{
const char *name = retro_dirent_get_name(D);
/* Compose full input file name */
strcpy(Path,Name);
I=strlen(Path);
strcpy((char*)Path,Name);
I=strlen((const char*)Path);
if(Path[I-1]!='/') Path[I++]='/';
strcpy(Path+I, name);
strcpy((char*)Path+I, name);
/* Compose 8.3 file name */
for(J=0;(J<8)&& name[J]&&(name[J]!='.');J++)
......@@ -403,17 +403,17 @@ byte *DSKLoad(const char *Name,byte *Dsk)
FN[I]='\0';
/* Open input file */
if(!stat(Path,&FS)&&S_ISREG(FS.st_mode)&&FS.st_size)
if(F=fopen(Path,"rb"))
if(!stat((const char*)Path,&FS)&&S_ISREG(FS.st_mode)&&FS.st_size)
if((F = fopen((const char*)Path,"rb")))
{
/* Allocate input buffer */
if(Buf=malloc(FS.st_size))
if((Buf = malloc(FS.st_size)))
{
/* Read file into the buffer */
if(fread(Buf,1,FS.st_size,F)==FS.st_size)
{
/* Create and write floppy file */
if(I=DSKFile(Dsk1,FN))
if((I = DSKFile(Dsk1,(const char*)FN)))
if(DSKWrite(Dsk1,I,Buf,FS.st_size)!=FS.st_size)
DSKDelete(Dsk1,I);
}
......@@ -460,8 +460,8 @@ const byte *DSKSave(const char *Name,const byte *Dsk)
/* Compose path name */
Path=malloc(strlen(Name)+20);
if(!Path) return(0);
strcpy(Path,Name);
I=strlen(Path);
strcpy((char*)Path,Name);
I=strlen((const char*)Path);
if(Path[I-1]!='/') Path[I++]='/';
/* Scan, read, dump files */
......@@ -477,10 +477,10 @@ const byte *DSKSave(const char *Name,const byte *Dsk)
*P='\0';
/* Read and dump file */
if(P=malloc(DSKFileSize(Dsk,J)))
if((P = malloc(DSKFileSize(Dsk,J))))
{
if(K=DSKRead(Dsk,J,P,DSKFileSize(Dsk,J)))
if(F=fopen(Path,"wb")) { fwrite(P,1,K,F);fclose(F); }
if((K = DSKRead(Dsk,J,P,DSKFileSize(Dsk,J))))
if((F = fopen((const char*)Path,"wb"))) { fwrite(P,1,K,F);fclose(F); }
free(P);
}
}
......
......@@ -451,7 +451,7 @@ int StartMSX(int NewMode,int NewRAMPages,int NewVRAMPages)
/* Save current directory */
if(ProgDir)
if(WorkDir=getcwd(cwd, sizeof(cwd))) Chunks[NChunks++]=WorkDir;
if((WorkDir = getcwd(cwd, sizeof(cwd)))) Chunks[NChunks++]=WorkDir;
/* Set invalid modes and RAM/VRAM sizes before calling ResetMSX() */
Mode = ~NewMode;
......@@ -481,11 +481,11 @@ int StartMSX(int NewMode,int NewRAMPages,int NewVRAMPages)
else memcpy(RTC,RTCInit,sizeof(RTC));
/* Try loading Kanji alphabet ROM */
if(Kanji=LoadROM("KANJI.ROM",0x20000,0))
if((Kanji = LoadROM("KANJI.ROM",0x20000,0)))
{ if(Verbose) printf("KANJI.ROM.."); }
/* Try loading RS232 support ROM to slot */
if(P=LoadROM("RS232.ROM",0x4000,0))
if((P = LoadROM("RS232.ROM",0x4000,0)))
{
if(Verbose) printf("RS232.ROM..");
MemMap[3][3][2]=P;
......@@ -538,7 +538,7 @@ int StartMSX(int NewMode,int NewRAMPages,int NewVRAMPages)
else
{
if(Verbose) printf("Redirecting serial I/O to %s...",ComName);
if(!(ComOStream=ComIStream=fopen(ComName,"r+b")))
if(!(ComOStream = ComIStream = fopen(ComName,"r+b")))
{ ComIStream=stdin;ComOStream=stdout; }
PRINTRESULT(ComOStream!=stdout);
}
......@@ -597,7 +597,7 @@ void TrashMSX(void)
if(SaveCMOS)
{
if(Verbose) printf("Writing CMOS.ROM...");
if(!(F=fopen("CMOS.ROM","wb"))) SaveCMOS=0;
if(!(F = fopen("CMOS.ROM","wb"))) SaveCMOS=0;
else
{
if(fwrite(RTC,1,sizeof(RTC),F)!=sizeof(RTC)) SaveCMOS=0;
......@@ -839,7 +839,7 @@ int ResetMSX(int NewMode,int NewRAMPages,int NewVRAMPages)
if(NewRAMPages!=RAMPages)
{
if(Verbose) printf("Allocating %dkB for RAM...",NewRAMPages*16);
if(P1=GetMemory(NewRAMPages*0x4000))
if((P1 = GetMemory(NewRAMPages*0x4000)))
{
memset(P1,NORAM,NewRAMPages*0x4000);
FreeMemory(RAMData);
......@@ -854,7 +854,7 @@ int ResetMSX(int NewMode,int NewRAMPages,int NewVRAMPages)
if(NewVRAMPages!=VRAMPages)
{
if(Verbose) printf("Allocating %dkB for VRAM...",NewVRAMPages*16);
if(P1=GetMemory(NewVRAMPages*0x4000))
if((P1 = GetMemory(NewVRAMPages*0x4000)))
{
memset(P1,0x00,NewVRAMPages*0x4000);
FreeMemory(VRAM);
......@@ -2319,7 +2319,7 @@ char *MakeFileName(const char *FileName,const char *Extension)
if(!Result) return(0);
strcpy(Result,FileName);
if(P=strrchr(Result,'.')) strcpy(P,Extension); else strcat(Result,Extension);
if((P = strrchr(Result,'.'))) strcpy(P,Extension); else strcat(Result,Extension);
return(Result);
}
......@@ -2444,7 +2444,7 @@ int GuessROM(const byte *Buf,int Size)
FILE *F;
/* Try opening file with CRCs */
if(F=fopen("CARTS.CRC","rb"))
if((F = fopen("CARTS.CRC","rb")))
{
/* Compute ROM's CRC */
for(J=K=0;J<Size;++J) K+=Buf[J];
......@@ -2459,7 +2459,7 @@ int GuessROM(const byte *Buf,int Size)
}
/* Try opening file with SHA1 sums */
if(F=fopen("CARTS.SHA","rb"))
if((F = fopen("CARTS.SHA","rb")))
{
char S1[41],S2[41];
SHA1 C;
......@@ -2624,10 +2624,10 @@ int FindState(const char *Name)
int Result = 0;
/* Remove old state name */
FreeMemory((char *)STAName);
FreeMemory((byte *)STAName);
/* If STAName gets created... */
if(STAName=MakeFileName(Name,".sta"))
if((STAName = MakeFileName(Name,".sta")))
{
/* Try loading state */
if(Verbose) printf("Loading state from %s...",STAName);
......@@ -2881,7 +2881,7 @@ int LoadCart(const char *FileName,int Slot,int Type)
{
/* Free previous SRAM resources */
FreeMemory(SRAMData[Slot]);
FreeMemory(SRAMName[Slot]);
FreeMemory((byte*)SRAMName[Slot]);
/* Get SRAM memory */
SRAMData[Slot]=GetMemory(0x4000);
......@@ -2897,14 +2897,14 @@ int LoadCart(const char *FileName,int Slot,int Type)
}
/* Generate SRAM file name and load SRAM contents */
if(SRAMName[Slot]=GetMemory(strlen(FileName)+5))
if((SRAMName[Slot] = GetMemory(strlen(FileName)+5)))
{
/* Compose SRAM file name */
strcpy(SRAMName[Slot],FileName);
P=strrchr(SRAMName[Slot],'.');
if(P) strcpy(P,".sav"); else strcat(SRAMName[Slot],".sav");
P = (byte*)(const char*)strrchr(SRAMName[Slot],'.');
if(P) strcpy((char*)P,".sav"); else strcat(SRAMName[Slot],".sav");
/* Try opening file... */
if(F=fopen(SRAMName[Slot],"rb"))
if((F = fopen(SRAMName[Slot],"rb")))
{
/* Read SRAM file */
Len=fread(SRAMData[Slot],1,0x4000,F);
......
......@@ -703,7 +703,7 @@ unsigned int WriteAudio(sample *Data,unsigned int Length)
}
return audio_batch_cb(audio_buf, Length);
return audio_batch_cb((const int16_t*)audio_buf, Length);
}
unsigned int Joystick(void)
......@@ -717,6 +717,7 @@ void Keyboard(void)
unsigned int Mouse(byte N)
{
return 0;
}
unsigned int GetJoystick(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment