Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 71d7f90

Browse files
author
Flyinghead
committed
Merge upstream
2 parents 09eab8c + a5cf540 commit 71d7f90

File tree

234 files changed

+3898
-3509
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+3898
-3509
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ shell/linux/nosym-reicast.elf
5151
shell/linux/reicast.elf
5252

5353
reicast-ios.xccheckout
54+
55+
# Android Studio
56+
.gradle
57+
.idea
58+
*.iml
59+
.externalNativeBuild
60+
shell/android-studio/app/src/main/assets/build

.travis.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,55 @@ notifications:
33
language: android
44
android:
55
components:
6-
- platform-tools
7-
- tools
8-
- build-tools-22.0.0
9-
- android-21
6+
- platform-tools
7+
- tools
8+
- build-tools-27.0.3
9+
- android-25
10+
- extra-google-m2repository
11+
- extra-android-m2repository
12+
licenses:
13+
- android-sdk-preview-license-.+
14+
- android-sdk-license-.+
1015
sudo: false
16+
before_cache:
17+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
18+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
19+
cache:
20+
directories:
21+
- "$HOME/.gradle/caches/"
22+
- "$HOME/.gradle/wrapper/"
23+
- "$HOME/.android/build-cache"
1124
before_install:
12-
- test -z "$encrypted_c726d225a9d9_key" || openssl aes-256-cbc -K $encrypted_c726d225a9d9_key -iv $encrypted_c726d225a9d9_iv
13-
-in debug.keystore.enc -out debug.keystore -d
25+
- test -z "$encrypted_c726d225a9d9_key" || openssl aes-256-cbc -K $encrypted_c726d225a9d9_key -iv $encrypted_c726d225a9d9_iv -in secure.tar.enc -out secure.tar -d
26+
- test -z "$encrypted_c726d225a9d9_key" || tar -xvf secure.tar
27+
- test -z "$encrypted_c726d225a9d9_key" || mv reicast-beta-cd.jks shell/android-studio/reicast-beta-cd.jks
28+
- test -z "$encrypted_c726d225a9d9_key" || mv reicast-beta-cd.p12 shell/android-studio/reicast-beta-cd.p12
1429
- GIT_HASH=`git log --pretty=format:'%h' -n 1`
1530
- GIT_BUILD=`git describe --all --always`-$GIT_HASH
31+
- mkdir "$ANDROID_HOME/licenses" || true
32+
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
33+
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
34+
- chmod +x shell/android-studio/gradlew
1635
install:
1736
- sudo apt-get -qq update
18-
- sudo apt-get install ant
19-
- wget http://dl.google.com/android/ndk/android-ndk-r10d-linux-x86_64.bin
20-
- chmod +x android-ndk-r10d-linux-x86_64.bin
21-
- ./android-ndk-r10d-linux-x86_64.bin -y | grep -v Extracting
22-
- mv android-ndk-r10d android-ndk
23-
- rm android-ndk-r10d-linux-x86_64.bin
24-
- export NDK=$(pwd)/android-ndk
25-
- export ANDROID_NDK=$(pwd)/android-ndk
37+
- touch ~/.android/repositories.cfg
38+
- echo y | sdkmanager 'ndk-bundle'
39+
- export NDK=ANDROID_NDK=ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle
2640
- export PATH=${PATH}:$ANDROID_HOME/tools
2741
- export PATH=${PATH}:$ANDROID_HOME/platform-tools
2842
- export PATH=${PATH}:$NDK
2943
- mkdir -p ~/.android
3044
- test -z "$encrypted_c726d225a9d9_key" || mv debug.keystore ~/.android/debug.keystore
3145
before_script:
3246
script:
33-
- cd shell/android
34-
- android update project -p . --target "android-21"
47+
- cd shell/android-studio
3548
- export NUMBER_OF_PROCESSORS=2
36-
- ant debug
49+
- "./gradlew build"
50+
- test -z "$encrypted_c726d225a9d9_key" || ./travis-release.sh
3751
before_deploy:
3852
- cd ../../
3953
- mkdir -p artifacts/$GIT_BUILD/
40-
- cp shell/android/bin/reicast-debug.apk artifacts/$GIT_BUILD/reicast-android-debug-$GIT_HASH.apk
54+
- cp shell/android-studio/app/build/outputs/apk/debug/app-debug.apk artifacts/$GIT_BUILD/reicast-android-debug-$GIT_HASH.apk
4155
deploy:
4256
provider: s3
4357
access_key_id: AKIAJR5J3OHAQUP5BHHQ

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ reicast is a multi-platform Sega Dreamcast emulator.
44

55
This is a developer-oriented resource, if you just want bins head over to http://reicast.com/
66

7-
For development discussion, [join #reicast in freenode](https://webchat.freenode.net/?channels=reicast)
7+
For development discussion, join [#reicast in freenode](https://webchat.freenode.net/?channels=reicast)
8+
or stop by the [reicast Discord server](http://discord.gg/Hc6CF72)
89

910
Caution
1011
-------
@@ -16,6 +17,15 @@ If you are interested into further porting/adapting/whatever, *please* don't for
1617

1718
Let's try to keep everything under a single project :)
1819

20+
Submitting Issues
21+
----------------
22+
Please take a moment to search the open issues for one similar to yours and add your info to it.
23+
If you cannot find a similar issue, click the 'New Issue' button and make sure to fill out the form.
24+
25+
*Please Note:*
26+
Duplicate issues may be closed with a link to the existing issue.
27+
Bugs that do not include a form may be closed until it is filled out.
28+
1929
Contributing
2030
------------
2131
For small/one-off fixes a PR from a github fork is alright. For longer term collaboration we prefer to use namespaced branches in the form of `<username>/<whatever>` in the main repo.

core/arm_emitter/E_DataOp.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,21 @@ ADD.SP.REG 0x008D0000
153153
for (int i=0;i<=30;i+=2)
154154
{
155155
u32 immv=(imm32<<i) | (imm32>>(32-i));
156+
if (i == 0)
157+
immv = imm32;
156158
if (immv<256)
157159
{
158160
return ((i/2)<<8) | immv;
159161
}
160162
}
161-
163+
162164
return -1;
163165
}
164166

165167
static u32 ARMImmid8r4(u32 imm8r4)
166168
{
167169
u32 rv = ARMImmid8r4_enc(imm8r4);
170+
168171
verify(rv!=-1);
169172
return rv;
170173
}

core/core.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ ifdef NO_REC
104104
endif
105105

106106
ifdef USE_GLES
107-
RZDCY_CFLAGS += -DGLES
107+
RZDCY_CFLAGS += -DGLES -fPIC
108108
endif
109109

110110
ifdef HAS_SOFTREND

core/deps/libwebsocket/context.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#define LWS_BUILD_HASH "unknown-build-hash"
2626
#endif
2727

28+
#ifdef WIN32
29+
#define getdtablesize() 30000
30+
#endif
31+
2832
static const char *library_version = LWS_LIBRARY_VERSION " " LWS_BUILD_HASH;
2933

3034
/**
@@ -122,7 +126,11 @@ libwebsocket_create_context(struct lws_context_creation_info *info)
122126
context->options = info->options;
123127
context->iface = info->iface;
124128
/* to reduce this allocation, */
125-
context->max_fds = getdtablesize();
129+
#ifdef WIN32
130+
context->max_fds = getdtablesize ();
131+
#else
132+
context->max_fds = sysconf(_SC_OPEN_MAX);
133+
#endif
126134
lwsl_notice(" static allocation: %u + (%u x %u fds) = %u bytes\n",
127135
sizeof(struct libwebsocket_context),
128136
sizeof(struct libwebsocket_pollfd) +

core/emitter/x86_emitter.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,22 @@ struct /*__declspec(dllexport)*/ x86_ptr_imm
228228
{
229229
this->ptr=ptr;
230230
}
231+
232+
#if HOST_CPU != CPU_X64
233+
#ifndef WIN32
234+
template<typename Rv, typename ...Args>
235+
x86_ptr_imm(Rv(* ptr)(Args...))
236+
{
237+
this->ptr= reinterpret_cast<void*>(ptr);
238+
}
239+
#endif
240+
241+
template<typename Rv, typename ...Args>
242+
x86_ptr_imm(Rv(DYNACALL * ptr)(Args...))
243+
{
244+
this->ptr= reinterpret_cast<void*>(ptr);
245+
}
246+
#endif
231247
};
232248

233249
enum x86_mrm_mod

core/hw/arm7/arm7.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ void armv_prof(OpType opt,u32 op,u32 flg);
790790

791791
extern "C" void arm_dispatch();
792792
extern "C" void arm_exit();
793-
extern "C" void DYNACALL arm_mainloop(u32 cycl);
793+
extern "C" void DYNACALL arm_mainloop(u32 cycl, void* regs, void* entrypoints);
794794
extern "C" void DYNACALL arm_compilecode();
795795

796796
template <bool L, bool B>
@@ -1470,7 +1470,7 @@ naked void DYNACALL arm_compilecode()
14701470
}
14711471
}
14721472

1473-
naked void DYNACALL arm_mainloop(u32 cycl)
1473+
naked void DYNACALL arm_mainloop(u32 cycl, void* regs, void* entrypoints)
14741474
{
14751475
__asm
14761476
{
@@ -1590,8 +1590,13 @@ void armv_end(void* codestart, u32 cycl)
15901590
SUB(r5,r5,cycl,true);
15911591
else
15921592
{
1593-
SUB(r5,r5,256);
1594-
SUB(r5,r5,cycl-256,true);
1593+
u32 togo = cycl;
1594+
while(ARMImmid8r4_enc(togo) == -1)
1595+
{
1596+
SUB(r5,r5,256);
1597+
togo -= 256;
1598+
}
1599+
SUB(r5,r5,togo,true);
15951600
}
15961601
JUMP((u32)&arm_exit,CC_MI); //statically predicted as not taken
15971602
JUMP((u32)&arm_dispatch);
@@ -1620,7 +1625,7 @@ void arm_Run(u32 CycleCount)
16201625

16211626
for (int i=0;i<32;i++)
16221627
{
1623-
arm_mainloop(CycleCount/32);
1628+
arm_mainloop(CycleCount/32, arm_Reg, EntryPoints);
16241629
libAICA_TimeStep();
16251630
}
16261631

core/hw/pvr/ta_ctx.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,28 @@ tad_context ta_tad;
1515
TA_context* vd_ctx;
1616
rend_context vd_rc;
1717

18+
#if ANDROID
19+
#include <errno.h>
20+
#include <malloc.h>
21+
22+
int posix_memalign(void** memptr, size_t alignment, size_t size) {
23+
if ((alignment & (alignment - 1)) != 0 || alignment == 0) {
24+
return EINVAL;
25+
}
26+
27+
if (alignment % sizeof(void*) != 0) {
28+
return EINVAL;
29+
}
30+
31+
*memptr = memalign(alignment, size);
32+
if (*memptr == NULL) {
33+
return errno;
34+
}
35+
36+
return 0;
37+
}
38+
#endif
39+
1840
// helper for 32 byte aligned memory allocation
1941
void* OS_aligned_malloc(size_t align, size_t size)
2042
{

core/linux-dist/evdev.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,7 @@
471471
break;
472472
}
473473
}
474+
return true;
474475
}
475476

476477
void input_evdev_rumble(EvdevController* controller, u16 pow_strong, u16 pow_weak)

0 commit comments

Comments
 (0)