Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/reicast/reicast-emulator
Browse files Browse the repository at this point in the history
…into lowering_rendering_resolution_option
  • Loading branch information
mar753 committed Jan 8, 2019
2 parents e285d7f + 6936bc2 commit 7e900a4
Show file tree
Hide file tree
Showing 239 changed files with 45,572 additions and 5,558 deletions.
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[![Snap Status](https://build.snapcraft.io/badge/reicast/reicast-emulator.svg)](https://build.snapcraft.io/user/reicast/reicast-emulator)

reicast
===========
reicast is a multi-platform Sega Dreamcast emulator.
**reicast** is a multi-platform Sega Dreamcast emulator.

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

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

Caution
-------
The source is a mess, and dragons might eat your cat when you clone this project. We're working on cleaning things up, but don't hold your breath. Why don't you lend a hand?

Rebranding/(hard)forks
----------------
If you are interested into further porting/adapting/whatever, *please* don't fork off. I hate that. Really.
If you are interested into further porting/adapting/whatever, *please* do not fork off.
We hate that. **Really**.

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

Expand All @@ -28,7 +27,8 @@ Bugs that do not include a form may be closed until it is filled out.

Contributing
------------
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.
- 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.

Before you work on something major, make sure to check the issue tracker to coordinate with other contributors, and open an issue to get feedback before doing big changes/PRs. It is always polite to check the history of the code you're working on and collaborate with the people that have worked on it. You can introduce yourself in [Meet the team](https://github.com/reicast/reicast-emulator/issues/1113).

Expand Down Expand Up @@ -109,23 +109,26 @@ Or open the .xcodeproj in Xcode and hit "Build".

Building for Linux
------------------
Requirements:
* build-essential
* libasound2
* libegl1-mesa-dev
* libgles2-mesa-dev
* libasound2-dev
* mesa-common-dev
* libgl1-mesa-dev

From project root directory:

### Using traditional make
- Requirements:
* build-essential
* libasound2
* libegl1-mesa-dev
* libgles2-mesa-dev
* libasound2-dev
* mesa-common-dev
* libgl1-mesa-dev

- From project root directory:
```
cd shell/linux
make
```

### Using snap
- Refer to our [snap README](https://github.com/reicast/reicast-emulator/tree/master/snap/README.md)

Translations
------------
New and updated translations are always appreciated!
Expand Down Expand Up @@ -178,11 +181,11 @@ Our IRC channel is [#reicast @ chat.freenode.net](irc://chat.freenode.net/reicas
The original reicast team consisted of drk||Raziel (mostly just writing code),
PsyMan (debugging/testing and everything else) and a little bit of gb_away


Special thanks
--------------
In previous iterations a lot of people have worked on this, notably David
Miller (aka, ZeZu), the nullDC team, friends from #pcsx2 and all over the world :)

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/reicast/reicast-emulator/trend.png)](https://bitdeli.com/free "Bitdeli Badge")


18 changes: 14 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
version: git-{branch}-{build}
configuration: Debug
os: Visual Studio 2015

environment:
matrix:
- Toolset: v140

platform:
- x86
- x64
- x86
- x64

configuration:
# - Release-140
- Debug-140

build:
project: shell/reicast.sln
parallel: true
Expand All @@ -11,7 +21,7 @@ build:
after_build:
- cmd: mkdir artifacts
- cmd: set PLATFORM2=%PLATFORM:x86=Win32%
- cmd: move WorkDir\reicast_%PLATFORM2%_Slow.exe artifacts/reicast-win_%PLATFORM%-slow-%APPVEYOR_REPO_COMMIT%.exe
- cmd: move WorkDir\reicast_%PLATFORM2%_%CONFIGURATION%.exe artifacts/reicast-win_%PLATFORM%-slow-%APPVEYOR_REPO_COMMIT%.exe

artifacts:
- path: artifacts
Expand Down
15 changes: 13 additions & 2 deletions core/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
core
# core/libdreamcast
===========

All of the interesting bits are here
Here lies the core of our codebase. Everything that's OS inspecific rests here.
** Please check per directory README for more info **

### Some rudimentary categories are:
- hw -- DC Hardware Components Implementation
- nullDC.cpp -- NullDC, thy mighty child (also referenced as "debugger")
- emitter -- Cookie machine
- khronos -- Vulkan stuff
- oslib -- Codebase abstraction effort
- cfg -- Configuration backend structure
- reios -- (Our)Implementation of the DreamCast BIOS (Not functional)
- deps -- External C libraries (hackish, hand-written versions)
1 change: 0 additions & 1 deletion core/cfg/cfg.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "types.h"

/*
** cfg* prototypes, if you pass NULL to a cfgSave* it will wipe out the section
** } if you pass it to lpKey it will wipe out that particular entry
Expand Down
66 changes: 57 additions & 9 deletions core/cfg/cl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <string.h>

#include "cfg/cfg.h"

Expand Down Expand Up @@ -99,29 +99,77 @@ int setconfig(wchar** arg,int cl)
return rv;
}

#ifndef _ANDROID
#include "version.h"
#else
#define REICAST_VERSION "r7-android-tmp"
#endif

#if !defined(DEF_CONSOLE)
#if defined(linux) || defined(_ANDROID)
#define DEF_CONSOLE
#endif
#endif

#if defined(_WIN32)
#include <conio.h>
#endif

void cli_pause()
{
#ifdef DEF_CONSOLE
return;
#endif

#if defined(_WIN32)
printf("\nPress a key to exit.\n");
_getch();
#else
printf("\nPress enter to exit.\n");
char c = getchar();
#endif
}



int showhelp(wchar** arg,int cl)
{
printf("Available commands :\n");
printf("\nAvailable commands :\n");

printf("-config section:key=value [, ..]: add a virtual config value\n Virtual config values won't be saved to the .cfg file\n unless a different value is written to em\nNote :\n You can specify many settings in the xx:yy=zz , gg:hh=jj , ...\n format.The spaces between the values and ',' are needed.");
printf("-config section:key=value [, ..]: add a virtual config value\n Virtual config values won't be saved to the .cfg file\n unless a different value is written to em\nNote :\n You can specify many settings in the xx:yy=zz , gg:hh=jj , ...\n format.The spaces between the values and ',' are needed.\n");
printf("\n-help: show help info\n");
printf("\n-version: show current version #\n\n");

cli_pause();
return 0;
}
bool ParseCommandLine(int argc,wchar* argv[])


int showversion(wchar** arg,int cl)
{
printf("\nReicast Version: # %s built on %s \n", REICAST_VERSION, __DATE__);

cli_pause();
return 0;
}

bool ParseCommandLine(int argc,wchar* argv[])
{
int cl=argc-2;
wchar** arg=argv+1;
while(cl>=0)
{
if (stricmp(*arg,"-help")==0)
if (stricmp(*arg,"-help")==0 || stricmp(*arg,"--help")==0)
{
int as=showhelp(arg,cl);
cl-=as;
arg+=as;
showhelp(arg,cl);
return true;
}
if (stricmp(*arg,"-version")==0 || stricmp(*arg,"--version")==0)
{
showversion(arg,cl);
return true;
}
else if (stricmp(*arg,"-config")==0)
else if (stricmp(*arg,"-config")==0 || stricmp(*arg,"--config")==0)
{
int as=setconfig(arg,cl);
cl-=as;
Expand Down
42 changes: 37 additions & 5 deletions core/core.mk
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#LOCAL_PATH:=
#LOCAL_PATH:=

#MFLAGS := -marm -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3-d16 -mfloat-abi=softfp
#ASFLAGS := -march=armv7-a -mfpu=vfp-d16 -mfloat-abi=softfp
#LDFLAGS := -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common
#LDFLAGS := -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common

RZDCY_SRC_DIR ?= $(call my-dir)

RZDCY_MODULES := cfg/ hw/arm7/ hw/aica/ hw/holly/ hw/ hw/gdrom/ hw/maple/ \
hw/mem/ hw/pvr/ hw/sh4/ hw/sh4/interpr/ hw/sh4/modules/ plugins/ profiler/ oslib/ \
hw/extdev/ hw/arm/ hw/naomi/ imgread/ linux/ ./ deps/coreio/ deps/zlib/ deps/chdr/ deps/crypto/ \
deps/libelf/ deps/chdpsr/ arm_emitter/ rend/ reios/ deps/libpng/
deps/libelf/ deps/chdpsr/ arm_emitter/ rend/ reios/ deps/libpng/

ifdef CHD5_LZMA
RZDCY_MODULES += deps/lzma/
endif

ifdef WEBUI
RZDCY_MODULES += webui/
Expand Down Expand Up @@ -70,7 +73,7 @@ endif
RZDCY_FILES := $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.cpp))
RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.c))
RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.S))

ifdef FOR_PANDORA
RZDCY_CFLAGS := \
$(CFLAGS) -c -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \
Expand All @@ -86,7 +89,7 @@ RZDCY_CFLAGS := \
-D_ANDROID -DRELEASE\
-frename-registers -fsingle-precision-constant -ffast-math \
-ftree-vectorize -fomit-frame-pointer

ifndef NOT_ARM
RZDCY_CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16
RZDCY_CFLAGS += -DTARGET_LINUX_ARMELv7
Expand All @@ -111,4 +114,33 @@ ifdef HAS_SOFTREND
RZDCY_CFLAGS += -DTARGET_SOFTREND
endif

ifdef CHD5_FLAC
RZDCY_MODULES += deps/flac/src/libFLAC/
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/bitmath.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/bitreader.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/cpu.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/crc.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/fixed.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/fixed_intrin_sse2.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/fixed_intrin_ssse3.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/float.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/format.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/lpc.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/lpc_intrin_avx2.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/lpc_intrin_sse2.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/lpc_intrin_sse41.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/lpc_intrin_sse.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/md5.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/memory.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/metadata_iterators.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/metadata_object.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/stream_decoder.c
RZDCY_FILES += $(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/window.c

RZDCY_CFLAGS += -I$(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/include/ -I$(RZDCY_SRC_DIR)/deps/flac/include
RZDCY_CFLAGS += -DPACKAGE_VERSION=\"1.3.2\" -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H
CFLAGS += -I$(RZDCY_SRC_DIR)/deps/flac/include -I$(RZDCY_SRC_DIR)/deps/flac/src/libFLAC/include/
CFLAGS += -DPACKAGE_VERSION=\"1.3.2\" -DFLAC__HAS_OGG=0 -DFLAC__NO_DLL -DHAVE_LROUND -DHAVE_STDINT_H -DHAVE_STDLIB_H -DHAVE_SYS_PARAM_H
endif

RZDCY_CXXFLAGS := $(RZDCY_CFLAGS) -fno-exceptions -fno-rtti -std=gnu++11
27 changes: 18 additions & 9 deletions core/deps/chdpsr/cdipsr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,27 @@ void CDI_get_tracks (FILE *fsource, image_s *image)
fread(&image->tracks, 2, 1, fsource);
}

void CDI_init (FILE *fsource, image_s *image, char *fsourcename)
bool CDI_init (FILE *fsource, image_s *image, const char *fsourcename)
{
image->length = core_fsize(fsource);

if (image->length < 8) printf( "Image file is too short");

fseek(fsource, image->length-8, SEEK_SET);
fread(&image->version, 4, 1, fsource);
fread(&image->header_offset, 4, 1, fsource);

// if (errno != 0) printf( fsourcename);
if (image->header_offset == 0) printf( "Bad image format");
if (image->length < 8)
{
printf("%s: Image file is too short\n", fsourcename);
return false;
}

fseek(fsource, image->length-8, SEEK_SET);
fread(&image->version, 4, 1, fsource);
fread(&image->header_offset, 4, 1, fsource);

if ((image->version != CDI_V2 && image->version != CDI_V3 && image->version != CDI_V35)
|| image->header_offset == 0)
{
printf("%s: Bad image format\n", fsourcename);
return false;
}
return true;
}

void CDI_get_sessions (FILE *fsource, image_s *image)
Expand Down
2 changes: 1 addition & 1 deletion core/deps/chdpsr/cdipsr.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef struct track_s
#define CDI_V35 0x80000006

unsigned long ask_type(core_file *fsource, long header_position);
void CDI_init(core_file *fsource, image_s *image, char *fsourcename);
bool CDI_init(core_file *fsource, image_s *image, const char *fsourcename);
void CDI_get_sessions(core_file *fsource, image_s *image);
void CDI_get_tracks(core_file *fsource, image_s *image);
void CDI_read_track(core_file *fsource, image_s *image, track_s *track);
Expand Down
Loading

0 comments on commit 7e900a4

Please sign in to comment.