Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
jaxe
Commits
c1b7c7c7
Commit
c1b7c7c7
authored
Jan 21, 2022
by
Vladimir Serbinenko
Browse files
LIBRETRO: Add compilation for old Windows (98SE and up)
parent
3cac057f
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
c1b7c7c7
...
...
@@ -23,6 +23,18 @@ include:
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-i686-mingw.yml'
# Windows msvc10 64-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-x64-msvc10-msys2.yml'
# Windows msvc10 32-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-i686-msvc10-msys2.yml'
# Windows msvc05 32-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-i686-msvc05-msys2.yml'
# Linux 64-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/linux-x64.yml'
...
...
@@ -129,6 +141,24 @@ libretro-build-windows-i686:
-
.libretro-windows-i686-mingw-make-default
-
.core-defs
# Windows msvc10 64-bit
libretro-build-windows-msvc10-x64
:
extends
:
-
.libretro-windows-x64-msvc10-msys2-make-default
-
.core-defs
# Windows msvc10 32-bit
libretro-build-windows-msvc10-i686
:
extends
:
-
.libretro-windows-i686-msvc10-msys2-make-default
-
.core-defs
# Windows msvc05 32-bit
libretro-build-windows-msvc05-i686
:
extends
:
-
.libretro-windows-i686-msvc05-msys2-make-default
-
.core-defs
# Linux 64-bit
libretro-build-linux-x64
:
extends
:
...
...
Makefile.libretro
View file @
c1b7c7c7
...
...
@@ -384,57 +384,65 @@ else ifneq (,$(findstring windows_msvc2017,$(platform)))
LDFLAGS
+=
-DLL
# Windows MSVC 2010 x64
else
ifeq
($(platform), windows_msvc2010_x64)
CC
=
cl.exe
CC
=
cl.exe
-TP
CXX
=
cl.exe
CFLAGS
+=
-wd4711
-wd4514
-wd4820
-DUSE_RGB565
=
1
CXXFLAGS
+=
-wd4711
-wd4514
-wd4820
-DUSE_RGB565
=
1
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/bin/amd64"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../IDE"
)
LIB
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/lib/amd64"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/include"
)
WindowsSdkDir
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
0
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
lib/x64
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
1
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
lib/x64
WindowsSdkDir
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
1
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
0
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
WindowsSdkDirInc
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.0A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
Include
WindowsSdkDirInc
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.1A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
Include
WindowsSDKIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude"
)
WindowsSDKGlIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\g
l"
)
WindowsSDKLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib
\x
64"
)
INCFLAGS_PLATFORM
=
-I
"
$(WindowsSdkDirInc)
"
export
INCLUDE
:=
$(INCLUDE)
export
LIB
:=
$(LIB)
;
$(WindowsSdkDir)
export
INCLUDE
:=
$(INCLUDE)
;
$(WindowsSDKIncludeDir)
;
$(WindowsSDKGlIncludeDir)
export
LIB
:=
$(LIB)
;
$(WindowsSDKLibDir)
TARGET
:=
$(TARGET_NAME)
_libretro.dll
PSS_STYLE
:=
2
LDFLAGS
+=
-DLL
LIBS
=
# Windows MSVC 2010 x86
else
ifeq
($(platform), windows_msvc2010_x86)
CC
=
cl.exe
CC
=
cl.exe
-TP
CXX
=
cl.exe
CFLAGS
+=
-wd4711
-wd4514
-wd4820
-DUSE_RGB565
=
1
CXXFLAGS
+=
-wd4711
-wd4514
-wd4820
-DUSE_RGB565
=
1
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/bin"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../IDE"
)
LIB
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
-w
"
$(VS100COMNTOOLS)
../../VC/lib"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/include"
)
WindowsSdkDir
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
0
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
lib
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
1
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
lib
WindowsSdkDir
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
1
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.
0
A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
WindowsSdkDirInc
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.0A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
Include
WindowsSdkDirInc
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.1A"
-v
"InstallationFolder"
|
grep
-o
'[A-Z]:\\.*'
)
Include
WindowsSDKIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude"
)
WindowsSDKGlIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\g
l"
)
WindowsSDKLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib"
)
INCFLAGS_PLATFORM
=
-I
"
$(WindowsSdkDirInc)
"
export
INCLUDE
:=
$(INCLUDE)
export
LIB
:=
$(LIB)
;
$(WindowsS
dk
Dir)
export
INCLUDE
:=
$(INCLUDE)
;
$(WindowsSDKIncludeDir)
;
$(WindowsSDKGlIncludeDir)
export
LIB
:=
$(LIB)
;
$(WindowsS
DKLib
Dir)
TARGET
:=
$(TARGET_NAME)
_libretro.dll
PSS_STYLE
:=
2
LDFLAGS
+=
-DLL
LIBS
=
# Windows MSVC 2005 x86
else
ifeq
($(platform), windows_msvc2005_x86)
CC
=
cl.exe
CC
=
cl.exe
-TP
CXX
=
cl.exe
CFLAGS
+=
-wd4711
-wd4514
-wd4820
-DUSE_RGB565
=
1
CXXFLAGS
+=
-wd4711
-wd4514
-wd4820
-DUSE_RGB565
=
1
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../../VC/bin"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../IDE"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../../VC/include"
)
...
...
include/chip8.h
View file @
c1b7c7c7
...
...
@@ -8,7 +8,17 @@
#include <sys/time.h>
#endif
#endif
#if defined(_MSC_VER) && _MSC_VER < 1800
#ifdef __LIBRETRO__
#include "libretro.h"
#else
#define bool int
#define true 1
#define false 0
#endif
#else
#include <stdbool.h>
#endif
#include <stdint.h>
#define ONE_SEC 1000000
...
...
src/chip8.c
View file @
c1b7c7c7
...
...
@@ -168,6 +168,7 @@ void chip8_load_font(CHIP8 *chip8)
}
}
#ifndef __LIBRETRO__
bool
chip8_load_rom
(
CHIP8
*
chip8
,
char
*
filename
)
{
FILE
*
rom
=
fopen
(
filename
,
"rb"
);
...
...
@@ -189,6 +190,7 @@ bool chip8_load_rom(CHIP8 *chip8, char *filename)
fprintf
(
stderr
,
"Unable to open ROM file %s
\n
"
,
filename
);
return
false
;
}
#endif
void
chip8_load_rom_buffer
(
CHIP8
*
chip8
,
const
void
*
raw
,
size_t
sz
)
{
size_t
maxsz
=
MAX_RAM
-
chip8
->
pc_start_addr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment