cocoa port compile fixes

This commit is contained in:
gecko_reverse 2008-09-16 03:20:08 +00:00
parent 6c81c25c70
commit cfffc5927a
7 changed files with 135 additions and 123 deletions

View File

@ -1,122 +1,129 @@
/* Copyright (C) 2006 yopyop
yopyop156@ifrance.com
yopyop156.ifrance.com
Copyright (C) 2006-2008 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "GPU_osd.h"
#include "mem.h"
extern u8 GPU_screen[4*256*192];
#include "font_eng.inc"
OSDCLASS::OSDCLASS(int core)
{
int i;
memset(screen, 0, sizeof(screen));
memset(name,0,7);
mode=core;
offset=0;
if (core==0)
memcpy(name,"Core A",6);
else
if (core==1)
memcpy(name,"Core B",6);
else
{
memcpy(name,"Main",6);
mode=255;
}
printlog("OSD_Init (%s)\n",name);
}
OSDCLASS::~OSDCLASS()
{
printlog("OSD_Deinit (%s)\n",name);
}
void OSDCLASS::setOffset(int ofs)
{
offset=ofs;
}
void INLINE OSDCLASS::printChar(int x, int y, char c)
{
int i, j;
int ofs=c*OSD_FONT_HEIGHT;
unsigned char bits[9]={256, 128, 64, 32, 16, 8, 4, 2, 1};
u8 *dst=screen;
dst+=(y*256)+x;
for (i = 0; i < OSD_FONT_HEIGHT; i++)
{
for (j = 0; j < OSD_FONT_WIDTH; j++)
if (font_eng[ofs] & bits[j]) dst[j]=1;
else dst[j]=0;
dst+=256;
ofs++;
}
}
void OSDCLASS::update() // don't optimized
{
u8 *dst=GPU_screen;
if (mode!=255)
dst+=offset*512;
for (int i=0; i<256*192; i++)
{
if (screen[i])
{
T2WriteWord(dst,(i << 1),0x8F);
}
}
}
void OSDCLASS::addLines(const char *fmt, ...)
{
}
void OSDCLASS::addFixed(int x, int y, const char *fmt, ...)
{
/* Copyright (C) 2006 yopyop
yopyop156@ifrance.com
yopyop156.ifrance.com
Copyright (C) 2006-2008 DeSmuME team
This file is part of DeSmuME
DeSmuME is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DeSmuME is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DeSmuME; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "GPU_osd.h"
#include "mem.h"
#include <string.h> //mem funcs
#include <stdarg.h> //va_start, etc
extern u8 GPU_screen[4*256*192];
#include "font_eng.inc"
OSDCLASS::OSDCLASS(int core)
{
int i;
memset(screen, 0, sizeof(screen));
memset(name,0,7);
mode=core;
offset=0;
if (core==0)
memcpy(name,"Core A",6);
else
if (core==1)
memcpy(name,"Core B",6);
else
{
memcpy(name,"Main",6);
mode=255;
}
printlog("OSD_Init (%s)\n",name);
}
OSDCLASS::~OSDCLASS()
{
printlog("OSD_Deinit (%s)\n",name);
}
void OSDCLASS::setOffset(int ofs)
{
offset=ofs;
}
void INLINE OSDCLASS::printChar(int x, int y, char c)
{
int i, j;
int ofs=c*OSD_FONT_HEIGHT;
unsigned char bits[9]={256, 128, 64, 32, 16, 8, 4, 2, 1};
u8 *dst=screen;
dst+=(y*256)+x;
for (i = 0; i < OSD_FONT_HEIGHT; i++)
{
for (j = 0; j < OSD_FONT_WIDTH; j++)
if (font_eng[ofs] & bits[j]) dst[j]=1;
else dst[j]=0;
dst+=256;
ofs++;
}
}
void OSDCLASS::update() // don't optimized
{
u8 *dst=GPU_screen;
if (mode!=255)
dst+=offset*512;
for (int i=0; i<256*192; i++)
{
if (screen[i])
{
T2WriteWord(dst,(i << 1),0x8F);
}
}
}
void OSDCLASS::addLines(const char *fmt, ...)
{
}
void OSDCLASS::addFixed(int x, int y, const char *fmt, ...)
{
va_list list;
char msg[512];
DWORD tmp;
//DWORD tmp;
memset(msg,0,512);
va_start(list,fmt);
#ifdef _MSC_VER
_vsnprintf(msg,511,fmt,list);
va_end(list);
int len=strlen(msg);
for (int i=0; i<len; i++)
{
printChar(x, y, msg[i]);
x+=OSD_FONT_WIDTH+2;
}
#else
vsnprintf(msg,511,fmt,list);
#endif
va_end(list);
int len=strlen(msg);
for (int i=0; i<len; i++)
{
printChar(x, y, msg[i]);
x+=OSD_FONT_WIDTH+2;
}
}

View File

@ -76,8 +76,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]]>
<Add option="-O3" />
<Add option="-fpascal-strings -fasm-blocks" />
<Add option="-DDESMUME_OBJ_C" />
<Add directory="dialogs" />
<Add directory="../cocoa" />
</Compiler>
<Linker>
<Add option="-framework Cocoa" />
@ -94,6 +92,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA]]>
<Unit filename="../FIFO.h" />
<Unit filename="../GPU.cpp" />
<Unit filename="../GPU.h" />
<Unit filename="../GPU_osd.cpp" />
<Unit filename="../GPU_osd.h" />
<Unit filename="../MMU.cpp" />
<Unit filename="../MMU.h" />
<Unit filename="../NDSSystem.cpp" />

View File

@ -39,6 +39,7 @@
7277B6E50D9E045700D283BD /* Japanese.nib in Resources */ = {isa = PBXBuildFile; fileRef = 7277B6E10D9E045700D283BD /* Japanese.nib */; };
7277B6E60D9E045700D283BD /* Japanese.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7277B6E20D9E045700D283BD /* Japanese.strings */; };
7277B8EB0D9F25F700D283BD /* about.m in Sources */ = {isa = PBXBuildFile; fileRef = 7277B8EA0D9F25F700D283BD /* about.m */; };
728E5E210E7F54CC00608344 /* GPU_osd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 728E5E1F0E7F54CC00608344 /* GPU_osd.cpp */; };
729BEC6F0D9D55DB00ED561B /* cocoa_util.m in Sources */ = {isa = PBXBuildFile; fileRef = 729BEC5A0D9D55DB00ED561B /* cocoa_util.m */; };
729BEC710D9D55DB00ED561B /* input.m in Sources */ = {isa = PBXBuildFile; fileRef = 729BEC5E0D9D55DB00ED561B /* input.m */; };
729BEC730D9D55DB00ED561B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 729BEC600D9D55DB00ED561B /* main.m */; };
@ -94,6 +95,8 @@
7277B6E10D9E045700D283BD /* Japanese.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = Japanese.nib; sourceTree = "<group>"; };
7277B6E20D9E045700D283BD /* Japanese.strings */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; path = Japanese.strings; sourceTree = "<group>"; };
7277B8EA0D9F25F700D283BD /* about.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = about.m; sourceTree = "<group>"; };
728E5E1F0E7F54CC00608344 /* GPU_osd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GPU_osd.cpp; path = ../GPU_osd.cpp; sourceTree = SOURCE_ROOT; };
728E5E200E7F54CC00608344 /* GPU_osd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GPU_osd.h; path = ../GPU_osd.h; sourceTree = SOURCE_ROOT; };
729BEC5A0D9D55DB00ED561B /* cocoa_util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cocoa_util.m; sourceTree = SOURCE_ROOT; };
729BEC5C0D9D55DB00ED561B /* globals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = globals.h; sourceTree = SOURCE_ROOT; };
729BEC5D0D9D55DB00ED561B /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = SOURCE_ROOT; };
@ -177,9 +180,6 @@
729BEC620D9D55DB00ED561B /* main_window.m */,
729BEC630D9D55DB00ED561B /* nds_control.h */,
729BEC640D9D55DB00ED561B /* nds_control.mm */,
7248E45E0E7E0B0E004DCFFE /* gfx3d.cpp */,
7248E45F0E7E0B0E004DCFFE /* gfx3d.h */,
7248E4600E7E0B0E004DCFFE /* OGLRender.cpp */,
729BEC650D9D55DB00ED561B /* preferences.h */,
729BEC660D9D55DB00ED561B /* preferences.m */,
729BEC670D9D55DB00ED561B /* rom_info.h */,
@ -236,6 +236,11 @@
29B97315FDCFA39411CA2CEA /* Core */ = {
isa = PBXGroup;
children = (
728E5E200E7F54CC00608344 /* GPU_osd.h */,
7248E45E0E7E0B0E004DCFFE /* gfx3d.cpp */,
7248E45F0E7E0B0E004DCFFE /* gfx3d.h */,
7248E4600E7E0B0E004DCFFE /* OGLRender.cpp */,
728E5E1F0E7F54CC00608344 /* GPU_osd.cpp */,
7248E4610E7E0B0E004DCFFE /* OGLRender.h */,
7227644A0E78E18100AEDC8B /* arm_instructions.cpp */,
7227644B0E78E18100AEDC8B /* armcpu.cpp */,
@ -445,6 +450,7 @@
722764780E78E18100AEDC8B /* wifi.cpp in Sources */,
7248E4620E7E0B0E004DCFFE /* gfx3d.cpp in Sources */,
7248E4630E7E0B0E004DCFFE /* OGLRender.cpp in Sources */,
728E5E210E7F54CC00608344 /* GPU_osd.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -18,7 +18,7 @@
*/
#import <Cocoa/Cocoa.h>
#import "nds_control.h"
#import "../nds_control.h"
@interface SpeedLimitSelectionWindow : NSWindow
{

View File

@ -27,7 +27,7 @@
#import "input.h"
#import "rom_info.h"
#import "preferences.h"
#import "speed_limit_selection_window.h"
#import "dialogs/speed_limit_selection_window.h"
//How much padding to put around the video output
#define WINDOW_BORDER_PADDING 5

View File

@ -65,7 +65,6 @@ struct NDS_fw_config_data firmware;
bool opengl_init()
{
NSLog(@"OPENGL INIT");
return true;
}

View File

@ -58,7 +58,7 @@
#ifdef DESMUME_OBJ_C
#define __declspec(ignore)
#define printlog(ignore)
inline void printlog(char *s, ...) {}
#ifdef __BIG_ENDIAN__
#define WORDS_BIGENDIAN
#endif