Merge pull request #34 from rkitover/lion_build
Mac OS X 10.7 (Lion) build and runtime support
This commit is contained in:
commit
0e9e003a02
|
@ -1,7 +1,7 @@
|
||||||
#ifndef SYSTEM_H
|
#ifndef SYSTEM_H
|
||||||
#define SYSTEM_H
|
#define SYSTEM_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "common/cstdint.h"
|
||||||
|
|
||||||
#ifndef __LIBRETRO__
|
#ifndef __LIBRETRO__
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef PATCH_H
|
#ifndef PATCH_H
|
||||||
#define PATCH_H
|
#define PATCH_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "cstdint.h"
|
||||||
|
|
||||||
bool applyPatch(const char *patchname, uint8_t **rom, int *size);
|
bool applyPatch(const char *patchname, uint8_t **rom, int *size);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef PORT_H
|
#ifndef PORT_H
|
||||||
#define PORT_H
|
#define PORT_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "cstdint.h"
|
||||||
|
|
||||||
#ifdef __CELLOS_LV2__
|
#ifdef __CELLOS_LV2__
|
||||||
/* PlayStation3 */
|
/* PlayStation3 */
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
#if defined(__has_include)
|
||||||
|
# if __has_include(<cstdint>)
|
||||||
|
# include <cstdint>
|
||||||
|
// necessary on Mac OS X Lion 10.7 or any clang <= 3.0
|
||||||
|
# elif __has_include(<tr1/cstdint>)
|
||||||
|
# include <tr1/cstdint>
|
||||||
|
# else
|
||||||
|
// throw error
|
||||||
|
# include <cstdint>
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# include <cstdint>
|
||||||
|
#endif
|
|
@ -1,5 +1,5 @@
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
uint8_t* gbMemoryMap[16];
|
uint8_t* gbMemoryMap[16];
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef GBGLOBALS_H
|
#ifndef GBGLOBALS_H
|
||||||
#define GBGLOBALS_H
|
#define GBGLOBALS_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
extern int gbRomSizeMask;
|
extern int gbRomSizeMask;
|
||||||
extern int gbRomSize;
|
extern int gbRomSize;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef GBMEMORY_H
|
#ifndef GBMEMORY_H
|
||||||
#define GBMEMORY_H
|
#define GBMEMORY_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
struct mapperMBC1 {
|
struct mapperMBC1 {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef VBA_BKS_H
|
#ifndef VBA_BKS_H
|
||||||
#define VBA_BKS_H
|
#define VBA_BKS_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
#define readWord(addr) \
|
#define readWord(addr) \
|
||||||
((map[(addr) >> 24].address[(addr)&map[(addr) >> 24].mask]) + ((map[(addr + 1) >> 24].address[(addr + 1) & map[(addr + 1) >> 24].mask]) << 8) + ((map[(addr + 2) >> 24].address[(addr + 2) & map[(addr + 2) >> 24].mask]) << 16) + ((map[(addr + 3) >> 24].address[(addr + 3) & map[(addr + 3) >> 24].mask]) << 24))
|
((map[(addr) >> 24].address[(addr)&map[(addr) >> 24].mask]) + ((map[(addr + 1) >> 24].address[(addr + 1) & map[(addr + 1) >> 24].mask]) << 8) + ((map[(addr + 2) >> 24].address[(addr + 2) & map[(addr + 2) >> 24].mask]) << 16) + ((map[(addr + 3) >> 24].address[(addr + 3) & map[(addr + 3) >> 24].mask]) << 24))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef EEPROM_H
|
#ifndef EEPROM_H
|
||||||
#define EEPROM_H
|
#define EEPROM_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#ifdef __LIBRETRO__
|
#ifdef __LIBRETRO__
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef FLASH_H
|
#ifndef FLASH_H
|
||||||
#define FLASH_H
|
#define FLASH_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
#define FLASH_128K_SZ 0x20000
|
#define FLASH_128K_SZ 0x20000
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef GBA_H
|
#ifndef GBA_H
|
||||||
#define GBA_H
|
#define GBA_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
#include "../System.h"
|
#include "../System.h"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
#include <SFML/Network.hpp>
|
#include <SFML/Network.hpp>
|
||||||
|
|
||||||
class GBASockClient {
|
class GBASockClient {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef SRAM_H
|
#ifndef SRAM_H
|
||||||
#define SRAM_H
|
#define SRAM_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
uint8_t sramRead(uint32_t address);
|
uint8_t sramRead(uint32_t address);
|
||||||
void sramWrite(uint32_t address, uint8_t byte);
|
void sramWrite(uint32_t address, uint8_t byte);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
#include <OpenGL/OpenGL.h>
|
||||||
#include <OpenGL/glext.h>
|
#include <OpenGL/glext.h>
|
||||||
#include <OpenGL/glu.h>
|
#include <OpenGL/glu.h>
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#ifndef VBA_SDL_FILTERS_H
|
#ifndef VBA_SDL_FILTERS_H
|
||||||
#define VBA_SDL_FILTERS_H
|
#define VBA_SDL_FILTERS_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
#include "../System.h"
|
#include "../System.h"
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,14 @@ double HiDPIAware::HiDPIScaleFactor()
|
||||||
{
|
{
|
||||||
if (hidpi_scale_factor == 0) {
|
if (hidpi_scale_factor == 0) {
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
hidpi_scale_factor = [[(NSView*)GetWindow()->GetHandle() window] backingScaleFactor];
|
NSWindow* window = [(NSView*)GetWindow()->GetHandle() window];
|
||||||
|
|
||||||
|
if ([window respondsToSelector:@selector(backingScaleFactor)]) {
|
||||||
|
hidpi_scale_factor = [window backingScaleFactor];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hidpi_scale_factor = 1.0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
hidpi_scale_factor = 1.0;
|
hidpi_scale_factor = 1.0;
|
||||||
#endif
|
#endif
|
||||||
|
@ -2017,7 +2024,11 @@ GLDrawingPanel::GLDrawingPanel(wxWindow* parent, int _width, int _height)
|
||||||
, DrawingPanel(_width, _height)
|
, DrawingPanel(_width, _height)
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
[(NSView *)GetHandle() setWantsBestResolutionOpenGLSurface:YES];
|
NSView* view = (NSView*)GetHandle();
|
||||||
|
|
||||||
|
if ([view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
|
||||||
|
[view setWantsBestResolutionOpenGLSurface:YES];
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if wxCHECK_VERSION(2, 9, 0)
|
#if wxCHECK_VERSION(2, 9, 0)
|
||||||
ctx = new wxGLContext(this);
|
ctx = new wxGLContext(this);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
version=0.1
|
version=0.6
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
# parse options
|
# parse options
|
||||||
|
@ -32,7 +32,7 @@ main() {
|
||||||
|
|
||||||
mktmp
|
mktmp
|
||||||
|
|
||||||
app_bundle=$(echo "$1" | fully_resolve_links | sed 's,/*$,,')
|
app_bundle=$(echo "$1" | fully_resolve_links)
|
||||||
|
|
||||||
case "$app_bundle" in
|
case "$app_bundle" in
|
||||||
*.app|*.APP)
|
*.app|*.APP)
|
||||||
|
@ -146,10 +146,14 @@ lib_scan() {
|
||||||
|
|
||||||
fully_resolve_links() {
|
fully_resolve_links() {
|
||||||
while read -r file; do
|
while read -r file; do
|
||||||
|
# get initial part for non-absolute path, or blank for absolute
|
||||||
|
path=${file%%/*}
|
||||||
|
# and set $file to the rest
|
||||||
|
file=${file#*/}
|
||||||
|
|
||||||
OLDIFS=$IFS
|
OLDIFS=$IFS
|
||||||
IFS='
|
IFS='
|
||||||
'
|
'
|
||||||
path=
|
|
||||||
for part in $(echo "$file" | sed 's,^/*,,; s,/*$,,; s,//*,\
|
for part in $(echo "$file" | sed 's,^/*,,; s,/*$,,; s,//*,\
|
||||||
,g'); do
|
,g'); do
|
||||||
path=$(resolve_link "$path/$part")
|
path=$(resolve_link "$path/$part")
|
||||||
|
@ -168,6 +172,9 @@ fully_resolve_links() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# remove trailing /s
|
||||||
|
path=$(echo "$path" | sed 's,/*$,,')
|
||||||
|
|
||||||
echo "$path"
|
echo "$path"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -176,7 +183,7 @@ resolve_link() {
|
||||||
file="$1"
|
file="$1"
|
||||||
|
|
||||||
while [ -h "$file" ]; do
|
while [ -h "$file" ]; do
|
||||||
ls0=`ls -l "$file"`
|
ls0=`ls -ld "$file"`
|
||||||
new_link=`expr "$ls0" : '.* -> \(.*\)$'`
|
new_link=`expr "$ls0" : '.* -> \(.*\)$'`
|
||||||
if expr "$new_link" : '/.*' > /dev/null; then
|
if expr "$new_link" : '/.*' > /dev/null; then
|
||||||
file="$new_link"
|
file="$new_link"
|
||||||
|
@ -234,9 +241,28 @@ relink() {
|
||||||
head -1
|
head -1
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ -n "$lib_link_path" ]; then
|
[ -z "$lib_link_path" ] && return 0
|
||||||
install_name_tool -change "$lib_link_path" "@rpath/$lib_basename" "$target"
|
|
||||||
|
# check that the shorter basename is the prefix of the longer basename
|
||||||
|
# that is, the lib versions match
|
||||||
|
lib1=${lib_basename%.dylib}
|
||||||
|
lib2=${lib_link_path##*/}
|
||||||
|
lib2=${lib2%.dylib}
|
||||||
|
|
||||||
|
if [ "${#lib1}" -le "${#lib2}" ]; then
|
||||||
|
shorter=$lib1
|
||||||
|
longer=$lib2
|
||||||
|
else
|
||||||
|
shorter=$lib2
|
||||||
|
longer=$lib1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case "$longer" in
|
||||||
|
"$shorter"*)
|
||||||
|
# and if so, relink target to the lib
|
||||||
|
install_name_tool -change "$lib_link_path" "@rpath/$lib_basename" "$target"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# try with sudo in case it fails,
|
# try with sudo in case it fails,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// these are all the viewer dialogs except for the ones with graphical areas
|
// these are all the viewer dialogs except for the ones with graphical areas
|
||||||
// they can be instantiated multiple times
|
// they can be instantiated multiple times
|
||||||
|
|
||||||
#include <cstdint>
|
#include "../common/cstdint.h"
|
||||||
|
|
||||||
#include "../gba/armdis.h"
|
#include "../gba/armdis.h"
|
||||||
#include "viewsupt.h"
|
#include "viewsupt.h"
|
||||||
|
|
Loading…
Reference in New Issue