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

Commit 2cf59b4

Browse files
authored
Merge pull request #1523 from reicast/fh/master-merge
Tons of fixes, much improved naomi support, atomiswave support, imgui UI, arm64 dynarec, improved x64 dynarec, dsp interpreter + arm64 + x64, others
2 parents 69ab16a + 1ef8caf commit 2cf59b4

File tree

510 files changed

+323688
-18798
lines changed

Some content is hidden

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

510 files changed

+323688
-18798
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,28 @@ DerivedData
2929
*.hmap
3030
emulator.xccheckout
3131
reicast.xccheckout
32+
build/*
33+
*.so
34+
*Karen_angelXwind*
35+
local.properties
36+
ant.properties
37+
*build_obj
38+
*.d
39+
Workdir/data
40+
Workdir/reicast*
41+
Workdir/vmu*
42+
Workdir/webui*
43+
Workdir/emu.cfg
44+
Workdir/lib*ant.properties
3245
reicast-ios.xccheckout
3346

3447
# Linux General
3548
shell/linux/.map
3649
shell/linux/nosym-reicast.elf
3750
shell/linux/reicast.elf
51+
shell/linux/reicast_naomi.elf
52+
shell/linux/reicast_awave.elf
53+
shell/linux/dispframe.elf
3854

3955
# Visual Studio
4056
generated

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ script:
5353
before_deploy:
5454
- cd ../../
5555
- mkdir -p artifacts/$GIT_BUILD/
56-
- cp shell/android-studio/reicast/build/outputs/apk/debug/reicast-debug.apk artifacts/$GIT_BUILD/reicast-android-debug-$GIT_HASH.apk
56+
- cp shell/android-studio/reicast/build/outputs/apk/dreamcast/debug/reicast-dreamcast-debug.apk artifacts/$GIT_BUILD/reicast-android-debug-$GIT_HASH.apk
5757
deploy:
5858
provider: s3
5959
access_key_id: AKIAJR5J3OHAQUP5BHHQ

appveyor.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
version: git-{branch}-{build}
2-
os: Visual Studio 2015
2+
image: Visual Studio 2017
33

44
environment:
55
matrix:
6-
- Toolset: v140
6+
- EXTRA_PATH: C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\
7+
LAUNCH_BUILD: mingw32-make platform=win32
8+
LAUNCH_PATH: shell\linux\
79

8-
platform:
9-
- x86
10-
- x64
11-
12-
configuration:
13-
- Release-140
14-
# - Debug-140
10+
build_script:
11+
- cmd: >-
12+
set PATH=%EXTRA_PATH%;%PATH%
13+
14+
cd %LAUNCH_PATH%
15+
16+
%LAUNCH_BUILD%
1517
16-
build:
17-
project: shell/reicast.sln
18-
parallel: true
19-
verbosity: minimal
20-
2118
after_build:
19+
- cmd: cd ..\..
2220
- cmd: mkdir artifacts
23-
- cmd: set PLATFORM2=%PLATFORM:x86=Win32%
24-
- cmd: move WorkDir\reicast_%PLATFORM2%_%CONFIGURATION%.exe artifacts/reicast-win_%PLATFORM%-%CONFIGURATION%-%APPVEYOR_REPO_COMMIT%.exe
21+
- cmd: move shell\linux\reicast.exe artifacts/reicast-win_x64-fast-%APPVEYOR_REPO_COMMIT%.exe
22+
- cmd: copy %EXTRA_PATH%\libgcc_s_seh-1.dll artifacts
23+
- cmd: copy %EXTRA_PATH%\libwinpthread-1.dll artifacts
24+
- cmd: copy %EXTRA_PATH%\libgomp-1.dll artifacts
2525

2626
artifacts:
2727
- path: artifacts
28-
name: reicast-win_$(platform)-$(configuration)-$(APPVEYOR_REPO_COMMIT)
28+
name: reicast-win_x64-fast-$(APPVEYOR_REPO_COMMIT)
2929

3030
deploy:
3131
- provider: S3
@@ -35,5 +35,5 @@ deploy:
3535
region: eu-west-1
3636
bucket: reicast-builds-windows
3737
folder: 'builds/heads/$(APPVEYOR_REPO_BRANCH)-$(APPVEYOR_REPO_COMMIT)'
38-
artifact: reicast-win_$(platform)-$(configuration)-$(APPVEYOR_REPO_COMMIT)
38+
artifact: reicast-win_x64-fast-$(APPVEYOR_REPO_COMMIT)
3939
set_public: true

core/archive/7zArchive.cpp

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
Created on: Nov 22, 2018
3+
4+
Copyright 2018 flyinghead
5+
6+
This file is part of reicast.
7+
8+
reicast is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 2 of the License, or
11+
(at your option) any later version.
12+
13+
reicast is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with reicast. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
#include "7zArchive.h"
22+
#include "deps/lzma/7z.h"
23+
#include "deps/lzma/7zCrc.h"
24+
#include "deps/lzma/Alloc.h"
25+
26+
#define kInputBufSize ((size_t)1 << 18)
27+
28+
static bool crc_tables_generated;
29+
30+
bool SzArchive::Open(const char* path)
31+
{
32+
SzArEx_Init(&szarchive);
33+
34+
if (InFile_Open(&archiveStream.file, path))
35+
return false;
36+
FileInStream_CreateVTable(&archiveStream);
37+
LookToRead2_CreateVTable(&lookStream, false);
38+
lookStream.buf = (Byte *)ISzAlloc_Alloc(&g_Alloc, kInputBufSize);
39+
if (lookStream.buf == NULL)
40+
return false;
41+
lookStream.bufSize = kInputBufSize;
42+
lookStream.realStream = &archiveStream.vt;
43+
LookToRead2_Init(&lookStream);
44+
45+
if (!crc_tables_generated)
46+
{
47+
CrcGenerateTable();
48+
crc_tables_generated = true;
49+
}
50+
SRes res = SzArEx_Open(&szarchive, &lookStream.vt, &g_Alloc, &g_Alloc);
51+
52+
return (res == SZ_OK);
53+
}
54+
55+
ArchiveFile* SzArchive::OpenFile(const char* name)
56+
{
57+
u16 fname[512];
58+
for (int i = 0; i < szarchive.NumFiles; i++)
59+
{
60+
unsigned isDir = SzArEx_IsDir(&szarchive, i);
61+
if (isDir)
62+
continue;
63+
64+
int len = SzArEx_GetFileNameUtf16(&szarchive, i, fname);
65+
char szname[512];
66+
int j = 0;
67+
for (; j < len && j < sizeof(szname) - 1; j++)
68+
szname[j] = fname[j];
69+
szname[j] = 0;
70+
if (strcmp(name, szname))
71+
continue;
72+
73+
size_t offset = 0;
74+
size_t out_size_processed = 0;
75+
SRes res = SzArEx_Extract(&szarchive, &lookStream.vt, i, &block_idx, &out_buffer, &out_buffer_size, &offset, &out_size_processed, &g_Alloc, &g_Alloc);
76+
if (res != SZ_OK)
77+
return NULL;
78+
79+
return new SzArchiveFile(out_buffer, offset, (u32)out_size_processed);
80+
}
81+
return NULL;
82+
}
83+
84+
SzArchive::~SzArchive()
85+
{
86+
if (lookStream.buf != NULL)
87+
{
88+
File_Close(&archiveStream.file);
89+
ISzAlloc_Free(&g_Alloc, lookStream.buf);
90+
if (out_buffer != NULL)
91+
ISzAlloc_Free(&g_Alloc, out_buffer);
92+
SzArEx_Free(&szarchive, &g_Alloc);
93+
}
94+
}

core/archive/7zArchive.h

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Created on: Nov 23, 2018
3+
4+
Copyright 2018 flyinghead
5+
6+
This file is part of reicast.
7+
8+
reicast is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 2 of the License, or
11+
(at your option) any later version.
12+
13+
reicast is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with reicast. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef CORE_ARCHIVE_7ZARCHIVE_H_
23+
#define CORE_ARCHIVE_7ZARCHIVE_H_
24+
25+
#include "archive.h"
26+
#include "deps/lzma/7z.h"
27+
#include "deps/lzma/7zFile.h"
28+
29+
class SzArchive : public Archive
30+
{
31+
public:
32+
SzArchive() : out_buffer(NULL) {
33+
memset(&archiveStream, 0, sizeof(archiveStream));
34+
memset(&lookStream, 0, sizeof(lookStream));
35+
}
36+
virtual ~SzArchive();
37+
38+
virtual ArchiveFile* OpenFile(const char* name) override;
39+
40+
private:
41+
virtual bool Open(const char* path) override;
42+
43+
CSzArEx szarchive;
44+
UInt32 block_idx; /* it can have any value before first call (if outBuffer = 0) */
45+
Byte *out_buffer; /* it must be 0 before first call for each new archive. */
46+
size_t out_buffer_size; /* it can have any value before first call (if outBuffer = 0) */
47+
CFileInStream archiveStream;
48+
CLookToRead2 lookStream;
49+
50+
};
51+
52+
class SzArchiveFile : public ArchiveFile
53+
{
54+
public:
55+
SzArchiveFile(u8 *data, u32 offset, u32 length) : data(data), offset(offset), length(length) {}
56+
virtual u32 Read(void *buffer, u32 length) override
57+
{
58+
length = min(length, this->length);
59+
memcpy(buffer, data + offset, length);
60+
return length;
61+
}
62+
63+
private:
64+
u8 *data;
65+
u32 offset;
66+
u32 length;
67+
};
68+
69+
#endif /* CORE_ARCHIVE_7ZARCHIVE_H_ */

core/archive/ZipArchive.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
Created on: Nov 23, 2018
3+
4+
Copyright 2018 flyinghead
5+
6+
This file is part of reicast.
7+
8+
reicast is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 2 of the License, or
11+
(at your option) any later version.
12+
13+
reicast is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with reicast. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
#include "ZipArchive.h"
22+
23+
ZipArchive::~ZipArchive()
24+
{
25+
zip_close(zip);
26+
}
27+
28+
bool ZipArchive::Open(const char* path)
29+
{
30+
zip = zip_open(path, 0, NULL);
31+
return (zip != NULL);
32+
}
33+
34+
ArchiveFile* ZipArchive::OpenFile(const char* name)
35+
{
36+
zip_file *zip_file = zip_fopen(zip, name, 0);
37+
if (zip_file == NULL)
38+
return NULL;
39+
40+
return new ZipArchiveFile(zip_file);
41+
}
42+
43+
u32 ZipArchiveFile::Read(void* buffer, u32 length)
44+
{
45+
return zip_fread(zip_file, buffer, length);
46+
}

core/archive/ZipArchive.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Created on: Nov 23, 2018
3+
4+
Copyright 2018 flyinghead
5+
6+
This file is part of reicast.
7+
8+
reicast is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 2 of the License, or
11+
(at your option) any later version.
12+
13+
reicast is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with reicast. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef CORE_ARCHIVE_ZIPARCHIVE_H_
23+
#define CORE_ARCHIVE_ZIPARCHIVE_H_
24+
#include "archive.h"
25+
#include "deps/libzip/zip.h"
26+
27+
class ZipArchive : public Archive
28+
{
29+
public:
30+
ZipArchive() : zip(NULL) {}
31+
virtual ~ZipArchive();
32+
33+
virtual ArchiveFile* OpenFile(const char* name) override;
34+
35+
private:
36+
virtual bool Open(const char* path) override;
37+
38+
struct zip *zip;
39+
};
40+
41+
class ZipArchiveFile : public ArchiveFile
42+
{
43+
public:
44+
ZipArchiveFile(struct zip_file *zip_file) : zip_file(zip_file) {}
45+
virtual ~ZipArchiveFile() { zip_fclose(zip_file); }
46+
virtual u32 Read(void* buffer, u32 length) override;
47+
48+
private:
49+
struct zip_file *zip_file;
50+
};
51+
52+
#endif /* CORE_ARCHIVE_ZIPARCHIVE_H_ */

0 commit comments

Comments
 (0)