diff options
author | R. Belmont <rb6502@users.noreply.github.com> | 2010-01-15 21:05:29 +0000 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2010-01-15 21:05:29 +0000 |
commit | 9ba62e6bce2539b6f312a89109a1aa989c8a88a4 (patch) | |
tree | 30e1993f05ad2042ce0d99d2d75be59689236361 | |
parent | 3997330a94e0ec1b061689a945cdb98c7de718a5 (diff) |
SDLMAME: improved OS X and SDL 1.3 SVN support, try to autodetect SDLMAME targets [Couriersud]
-rw-r--r-- | makefile | 18 | ||||
-rw-r--r-- | src/osd/sdl/SDLMain_tmpl.m | 10 | ||||
-rw-r--r-- | src/osd/sdl/debugosx.m | 8 | ||||
-rw-r--r-- | src/osd/sdl/draw13.c | 4 | ||||
-rw-r--r-- | src/osd/sdl/drawsdl.c | 2 | ||||
-rw-r--r-- | src/osd/sdl/sdl.mak | 2 | ||||
-rw-r--r-- | src/osd/sdl/sdlos_macosx.c | 28 | ||||
-rw-r--r-- | src/osd/sdl/video.c | 1 |
8 files changed, 58 insertions, 15 deletions
@@ -64,10 +64,24 @@ ifndef TARGETOS ifeq ($(OS),Windows_NT) TARGETOS = win32 else + +UNAME = $(shell uname -a) + +ifeq ($(filter Linux,$(UNAME)),Linux) TARGETOS = unix endif +ifeq ($(filter Solaris,$(UNAME)),Solaris) +TARGETOS = solaris +endif +ifeq ($(filter FreeBSD,$(UNAME)),FreeBSD) +TARGETOS = freebsd +endif +ifeq ($(filter Darwin,$(UNAME)),Darwin) +TARGETOS = macosx endif +endif +endif #------------------------------------------------- @@ -608,5 +622,7 @@ $(OBJ)/%.a: ifeq ($(TARGETOS),macosx) $(OBJ)/%.o: $(SRC)/%.m | $(OSPREBUILD) @echo Objective-C compiling $<... - $(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ + #$(CC) -x objective-c++ $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -c $< -o $@ + $(CC) -x objective-c++ $(CDEFS) $(CCOMFLAGS) -c $< -o $@ + #$(CC) $(CDEFS) $(CFLAGS) -c $< -o $@ endif diff --git a/src/osd/sdl/SDLMain_tmpl.m b/src/osd/sdl/SDLMain_tmpl.m index 78645c15e1f..e2e302b0b53 100644 --- a/src/osd/sdl/SDLMain_tmpl.m +++ b/src/osd/sdl/SDLMain_tmpl.m @@ -21,7 +21,7 @@ #define SDL_USE_NIB_FILE 0 /* Use this flag to determine whether we use CPS (docking) or not */ -#define SDL_USE_CPS 1 +#define SDL_USE_CPS 0 #ifdef SDL_USE_CPS /* Portions of CPS.h */ typedef struct CPSProcessSerNum @@ -30,9 +30,9 @@ typedef struct CPSProcessSerNum UInt32 hi; } CPSProcessSerNum; -extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); -extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); -extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); +extern "C" OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); +extern "C" OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); +extern "C" OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); #endif /* SDL_USE_CPS */ @@ -319,7 +319,7 @@ static void CustomApplicationMain (int argc, char **argv) NSString *result; bufferSize = selfLen + aStringLen - aRange.length; - buffer = NSAllocateMemoryPages(bufferSize*sizeof(unichar)); + buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); /* Get first part into buffer */ localRange.location = 0; diff --git a/src/osd/sdl/debugosx.m b/src/osd/sdl/debugosx.m index cf6516dbb52..763d2cbc3ee 100644 --- a/src/osd/sdl/debugosx.m +++ b/src/osd/sdl/debugosx.m @@ -25,7 +25,7 @@ #import <Cocoa/Cocoa.h> // MAME headers -#include "driver.h" +#include "emu.h" #include "debug/debugvw.h" #include "debug/debugcon.h" #include "debug/debugcpu.h" @@ -1147,7 +1147,7 @@ void console_create_window(running_machine *machine) - (IBAction)showRightColumn:(id)sender { - disasm_view_set_right_column(view, [sender tag]); + disasm_view_set_right_column(view, (disasm_right_column) [sender tag]); } @@ -1555,7 +1555,7 @@ void console_create_window(running_machine *machine) - (void)showDebugger:(NSNotification *)notification { - const device_config *device = [[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue]; + const device_config *device = (const device_config *) [[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue]; if (device->machine == machine) { if (![window isVisible] && ![window isMiniaturized]) [window orderFront:self]; @@ -1801,7 +1801,7 @@ void console_create_window(running_machine *machine) - (void)showDebugger:(NSNotification *)notification { - const device_config *device = [[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue]; + const device_config *device = (const device_config * )[[[notification userInfo] objectForKey:@"MAMEDebugDevice"] pointerValue]; if (device->machine == machine) { [self setCPU:device]; [window makeKeyAndOrderFront:self]; diff --git a/src/osd/sdl/draw13.c b/src/osd/sdl/draw13.c index 696e82ded49..fc49eed1693 100644 --- a/src/osd/sdl/draw13.c +++ b/src/osd/sdl/draw13.c @@ -714,7 +714,7 @@ static int draw13_window_draw(sdl_window_info *window, UINT32 dc, int update) /* SDL Underlays need alpha = 0 ! */ SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); SDL_SetRenderDrawColor(0,0,0,0 /*255*/); - SDL_RenderFill(NULL); + SDL_RenderFillRect(NULL); sdl->blittimer--; } @@ -766,7 +766,7 @@ static int draw13_window_draw(sdl_window_info *window, UINT32 dc, int update) SDL_SetRenderDrawBlendMode(map_blendmode(PRIMFLAG_GET_BLENDMODE(prim->flags))); SDL_SetRenderDrawColor(sr, sg, sb, sa); - SDL_RenderLine(prim->bounds.x0 + hofs, prim->bounds.y0 + vofs, + SDL_RenderDrawLine(prim->bounds.x0 + hofs, prim->bounds.y0 + vofs, prim->bounds.x1 + hofs, prim->bounds.y1 + vofs); break; case RENDER_PRIMITIVE_QUAD: diff --git a/src/osd/sdl/drawsdl.c b/src/osd/sdl/drawsdl.c index 06fcc1d2319..169f2879480 100644 --- a/src/osd/sdl/drawsdl.c +++ b/src/osd/sdl/drawsdl.c @@ -724,7 +724,7 @@ static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update) { /* SDL Underlays need alpha = 0 ! */ SDL_SetRenderDrawColor(0,0,0,0); - SDL_RenderFill(NULL); + SDL_RenderFillRect(NULL); //SDL_RenderFill(0,0,0,0 /*255*/,NULL); sdl->blittimer--; } diff --git a/src/osd/sdl/sdl.mak b/src/osd/sdl/sdl.mak index 71a160842ac..9d6ca008c36 100644 --- a/src/osd/sdl/sdl.mak +++ b/src/osd/sdl/sdl.mak @@ -165,7 +165,7 @@ endif endif ifeq ($(TARGETOS),macosx) -DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX +DEFS += -DSDLMAME_UNIX -DSDLMAME_MACOSX SYNC_IMPLEMENTATION = ntc MAINLDFLAGS = -Xlinker -all_load ifdef BIGENDIAN diff --git a/src/osd/sdl/sdlos_macosx.c b/src/osd/sdl/sdlos_macosx.c index 5b4ae1ccb54..7ea714811c7 100644 --- a/src/osd/sdl/sdlos_macosx.c +++ b/src/osd/sdl/sdlos_macosx.c @@ -26,7 +26,7 @@ #include <mach/mach_time.h> // MAME headers -#include "osdepend.h" +//#include "osdepend.h" #include "osdcore.h" //============================================================ @@ -207,3 +207,29 @@ void osd_break_into_debugger(const char *message) #endif } +//============================================================ +// osd_malloc +//============================================================ + +void *osd_malloc(size_t size) +{ +#ifndef MALLOC_DEBUG + return malloc(size); +#else +#error "MALLOC_DEBUG not yet supported" +#endif +} + + +//============================================================ +// osd_free +//============================================================ + +void osd_free(void *ptr) +{ +#ifndef MALLOC_DEBUG + free(ptr); +#else +#error "MALLOC_DEBUG not yet supported" +#endif +} diff --git a/src/osd/sdl/video.c b/src/osd/sdl/video.c index 38e1d179289..cd89fe955ef 100644 --- a/src/osd/sdl/video.c +++ b/src/osd/sdl/video.c @@ -20,6 +20,7 @@ #endif #ifdef SDLMAME_MACOSX +#undef Status #include <Carbon/Carbon.h> #endif |