Unverified Commit 073be787 authored by Libretro-Admin's avatar Libretro-Admin Committed by GitHub
Browse files

Merge pull request #9 from phcoder/gekko

Add NGC, Wii, DJGPP, PS2 and OpenDingux compilation
parents 51ebc2ef f128a4d1
Pipeline #93286 passed with stages
in 9 minutes and 52 seconds
......@@ -30,6 +30,10 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-i686.yml'
# DJGPP
- project: 'libretro-infrastructure/ci-templates'
file: '/djgpp-static.yml'
# MacOS 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-x64.yml'
......@@ -60,18 +64,22 @@ include:
- project: 'libretro-infrastructure/ci-templates'
file: '/vita-static.yml'
# PlayStation2
- project: 'libretro-infrastructure/ci-templates'
file: '/ps2-static.yml'
# Nintendo 3DS
- project: 'libretro-infrastructure/ci-templates'
file: '/ctr-static.yml'
# Nintendo GameCube
#- project: 'libretro-infrastructure/ci-templates'
#file: '/ngc-static.yml'
- project: 'libretro-infrastructure/ci-templates'
file: '/ngc-static.yml'
# Nintendo Wii
#- project: 'libretro-infrastructure/ci-templates'
#file: '/wii-static.yml'
- project: 'libretro-infrastructure/ci-templates'
file: '/wii-static.yml'
# Nintendo WiiU
- project: 'libretro-infrastructure/ci-templates'
file: '/wiiu-static.yml'
......@@ -144,6 +152,12 @@ libretro-build-osx-arm64:
- .libretro-osx-arm64-make-default
- .core-defs
# DJGPP
libretro-build-djgpp-i586:
extends:
- .libretro-djgpp-static-retroarch-master
- .core-defs
################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
......@@ -194,6 +208,12 @@ libretro-build-psp:
- .libretro-psp-static-retroarch-master
- .core-defs
# PlayStation2
libretro-build-ps2:
extends:
- .libretro-ps2-static-retroarch-master
- .core-defs
# Nintendo 3DS
libretro-build-ctr:
extends:
......@@ -201,16 +221,16 @@ libretro-build-ctr:
- .core-defs
# Nintendo GameCube
#libretro-build-ngc:
#extends:
#- .libretro-ngc-static-retroarch-master
#- .core-defs
libretro-build-ngc:
extends:
- .libretro-ngc-static-retroarch-master
- .core-defs
# Nintendo Wii
#libretro-build-wii:
#extends:
#- .libretro-wii-static-retroarch-master
#- .core-defs
libretro-build-wii:
extends:
- .libretro-wii-static-retroarch-master
- .core-defs
# Nintendo WiiU
libretro-build-wiiu:
......@@ -230,6 +250,24 @@ libretro-build-vita:
- .libretro-vita-static-retroarch-master
- .core-defs
# OpenDingux
libretro-build-dingux-mips32:
extends:
- .libretro-dingux-mips32-make-default
- .core-defs
# OpenDingux Beta
libretro-build-dingux-odbeta-mips32:
extends:
- .libretro-dingux-odbeta-mips32-make-default
- .core-defs
# OpenDingux Beta
libretro-build-rs90-odbeta-mips32:
extends:
- .libretro-rs90-odbeta-mips32-make-default
- .core-defs
# RetroFW
libretro-build-retrofw-mips32:
extends:
......
......@@ -159,6 +159,26 @@ else ifeq ($(platform), libnx)
CFLAGS += -march=armv8-a -mtune=cortex-a57 -mtp=soft -mcpu=cortex-a57+crc+fp+simd -ffast-math
CXXFLAGS := $(ASFLAGS) $(CFLAGS)
STATIC_LINKING = 1
# Nintendo Game Cube
else ifeq ($(platform), ngc)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float
CXXFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float
HAVE_RZLIB := 1
STATIC_LINKING=1
# Nintendo Wii
else ifeq ($(platform), wii)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
CXXFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float
HAVE_RZLIB := 1
STATIC_LINKING=1
# Nintendo WiiU
else ifeq ($(platform), wiiu)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
......@@ -235,6 +255,43 @@ else ifeq ($(platform), ctr)
DISABLE_ERROR_LOGGING := 1
ARM = 1
STATIC_LINKING=1
# GCW0
else ifeq ($(platform), gcw0)
TARGET := $(TARGET_NAME)_libretro.so
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,-no-undefined
DISABLE_ERROR_LOGGING := 1
CFLAGS += -march=mips32 -mtune=mips32r2 -mhard-float
LIBS = -lm
# RS90
else ifeq ($(platform), rs90)
TARGET := $(TARGET_NAME)_libretro.so
CC = /opt/rs90-toolchain/usr/bin/mipsel-linux-gcc
CXX = /opt/rs90-toolchain/usr/bin/mipsel-linux-g++
AR = /opt/rs90-toolchain/usr/bin/mipsel-linux-ar
fpic := -fPIC
SHARED := -shared -Wl,-version-script=$(CORE_DIR)/link.T
CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32
CXXFLAGS += $(CFLAGS)
# PS2
else ifeq ($(platform), ps2)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = mips64r5900el-ps2-elf-gcc
CXX = mips64r5900el-ps2-elf-g++
AR = mips64r5900el-ps2-elf-ar
CFLAGS += -G0 -DPS2 -DUSE_RGB565 -DABGR1555
CXXFLAGS += -G0 -DPS2 -DUSE_RGB565 -DABGR1555
STATIC_LINKING=1
# DOS
else ifeq ($(platform), dos)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
CC = i586-pc-msdosdjgpp-gcc
AR = i586-pc-msdosdjgpp-ar
CXX = i586-pc-msdosdjgpp-g++
PLATFORM_DEFINES += -march=i386
STATIC_LINKING=1
else
CC ?= gcc
TARGET := $(TARGET_NAME)_libretro.dll
......
#include "slock_wrapper.h"
#ifndef USE_SLOCK_WRAPPER
#elif defined(PS2) || defined(WIIU) // Single-threaded
#elif defined(PS2) || defined(WIIU) || defined(__DJGPP__) // Single-threaded
slock_wrap::slock_wrap() {
}
......
#pragma once
#if defined(_3DS) || defined(__PSP__) || defined(PS2) || defined(WIIU)
#if defined(_3DS) || defined(__PSP__) || defined(PS2) || defined(WIIU) || defined(GEKKO) || defined(__DJGPP__)
#define USE_SLOCK_WRAPPER 1
#endif
......
......@@ -112,18 +112,37 @@ inline void DSP::organWave(uint32_t frequency, int16_t amplitude, int16_t offset
inline void DSP::noise(uint32_t frequency, int16_t amplitude, int32_t position, int16_t* dest, size_t samples)
{
static std::random_device rdevice;
static std::mt19937 mt(rdevice());
std::uniform_int_distribution<int16_t> dist(-amplitude/2, amplitude/2);
const size_t periodLength = float(rate) / frequency;
const size_t halfPeriod = periodLength / 2;
static uint32_t lfsr_state = 0x12345678;
static const uint8_t poly = 0x34; // second-smallest maximal-period polynomial.
static const int trailing_zeros = 1; // 1 trailing 0.
static const int significant_bits = 5; // 5 bits from highest set to lowest set
static const int batch = 4; // Batch to handle in a table
static const int table_size = 1 << (batch + significant_bits);
static const int table_mask = table_size - 1;
static uint8_t polytable[table_size];
if (polytable[1] == 0) {
for (size_t i = 1; i < table_size; ++i)
{
uint32_t cur = i << trailing_zeros;
for (int j = 0; j < batch; j++)
{
uint8_t parity = cur & poly;
parity ^= parity >> 4;
parity ^= parity >> 2;
parity ^= parity >> 1;
cur = (cur >> 1) | ((parity & 1) << 31);
}
polytable[i] = cur >> (32 - batch);
}
}
for (size_t i = 0; i < samples; ++i)
{
const auto sampleInPeriod = position % periodLength;
dest[i] += dist(mt);
dest[i] += lfsr_state % amplitude - (amplitude / 2);
lfsr_state = (lfsr_state >> batch) | (polytable[(lfsr_state >> significant_bits) & table_mask] << (32 - batch));
lfsr_state = (lfsr_state >> batch) | (polytable[(lfsr_state >> significant_bits) & table_mask] << (32 - batch));
lfsr_state = (lfsr_state >> batch) | (polytable[(lfsr_state >> significant_bits) & table_mask] << (32 - batch));
lfsr_state = (lfsr_state >> batch) | (polytable[(lfsr_state >> significant_bits) & table_mask] << (32 - batch));
++position;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment