Merge branch 'master' into ModernLighting

This commit is contained in:
Goodlyay 2024-05-01 21:57:47 -07:00
commit 400257da1a
279 changed files with 23341 additions and 9339 deletions

View File

@ -0,0 +1,19 @@
name: Notify success
description: Sends a notification that a workflow has finished
inputs:
DESTINATION_URL:
description: 'Webhook notification URL'
type: string
WORKFLOW_NAME:
description: 'Workflow name'
required: true
type: string
runs:
using: "composite"
steps:
- name: Notify failure
if: ${{ inputs.DESTINATION_URL != '' }}
shell: sh
run: |
curl ${{ inputs.DESTINATION_URL }}/${{ inputs.WORKFLOW_NAME }}/${{ github.sha }}

View File

@ -13,7 +13,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.DEST_NAME }}
path: ${{ inputs.SOURCE_FILE }}

View File

@ -26,6 +26,12 @@ jobs:
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-3ds.cia'
DEST_NAME: 'ClassiCube-3ds.cia'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
@ -36,4 +42,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-3ds.elf'
DEST_NAME: 'ClassiCube-3ds.elf'
DEST_NAME: 'ClassiCube-3ds.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: '3ds'

View File

@ -38,4 +38,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-dc.elf'
DEST_NAME: 'ClassiCube-dc.elf'
DEST_NAME: 'ClassiCube-dc.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'dreamcast'

View File

@ -35,8 +35,8 @@ jobs:
PLAT32_FLAGS: "-fno-pie -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON -I freebsd32/include -L freebsd32/lib"
PLAT64_FLAGS: "-fno-pie -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON -I freebsd64/include -L freebsd64/lib"
run: |
apk add curl
LATEST_FLAG=-DCC_COMMIT_SHA=\"${GITHUB_SHA::9}\"
echo $LATEST_FLAG
cd src
i386-freebsd11-clang *.c ${{ env.COMMON_FLAGS }} ${{ env.PLAT32_FLAGS }} $LATEST_FLAG -o cc-fbsd32-gl1 -lm -lpthread -lX11 -lXi -lGL -lexecinfo
@ -65,4 +65,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-fbsd64-gl1'
DEST_NAME: 'ClassiCube-FreeBSD-64'
DEST_NAME: 'ClassiCube-FreeBSD-64'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'freebsd'

View File

@ -33,4 +33,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/ClassiCube-haiku'
DEST_NAME: 'ClassiCube-haiku'
DEST_NAME: 'ClassiCube-haiku'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'haiku'

41
.github/workflows/build_ios.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Build latest (iOS)
on: [push]
concurrency:
group: ${{ github.ref }}-ios
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: macOS-11
steps:
- uses: actions/checkout@v3
- name: Compile iOS build
id: compile
run: |
cd ios
xcodebuild -sdk iphoneos -configuration Release CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
cd build/Release-iphoneos
mkdir Payload
mv ClassiCube.app Payload/ClassiCube.app
zip -r cc.ipa Payload
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile iOS build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ios/build/Release-iphoneos/cc.ipa'
DEST_NAME: 'cc.ipa'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'ios'

110
.github/workflows/build_linux.yml vendored Normal file
View File

@ -0,0 +1,110 @@
name: Build latest (Linux)
on: [push]
concurrency:
group: ${{ github.ref }}-linux
cancel-in-progress: true
jobs:
#============================================
# =============== 32 BIT LINUX ==============
# ===========================================
build-32:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install packages
shell: bash
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install gcc-multilib libx11-dev:i386 libxi-dev:i386 libgl1-mesa-dev:i386
- name: Compile 32 bit Linux builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
NIX32_FLAGS: "-no-pie -fno-pie -m32 -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cd src
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX32_FLAGS }} $LATEST_FLAG -o cc-nix32-gl1 -lX11 -lXi -lpthread -lGL -lm -ldl
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX32_FLAGS }} $LATEST_FLAG -DCC_BUILD_GLMODERN -o cc-nix32-gl2 -lX11 -lXi -lpthread -lGL -lm -ldl
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 32 bit Linux build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix32-gl1'
DEST_NAME: 'ClassiCube-Linux32-OpenGL'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix32-gl2'
DEST_NAME: 'ClassiCube-Linux32-ModernGL'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'linux32'
#============================================
# =============== 64 BIT LINUX ==============
# ===========================================
build-64:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Compile 64 bit Linux builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
NIX64_FLAGS: "-no-pie -fno-pie -m64 -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON"
run: |
sudo apt-get -y install libx11-dev libxi-dev libgl1-mesa-dev
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cd src
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -o cc-nix64-gl1 -lX11 -lXi -lpthread -lGL -lm -ldl
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -DCC_BUILD_GLMODERN -o cc-nix64-gl2 -lX11 -lXi -lpthread -lGL -lm -ldl
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 64 bit Linux build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix64-gl1'
DEST_NAME: 'ClassiCube-Linux64-OpenGL'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix64-gl2'
DEST_NAME: 'ClassiCube-Linux64-ModernGL'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'linux64'

View File

@ -1,51 +0,0 @@
name: Build latest (Linux 32 bit)
on: [push]
concurrency:
group: ${{ github.ref }}-linux32
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Install packages
shell: bash
run: |
sudo dpkg --add-architecture i386
sudo apt-get -y update
sudo apt-get -y install gcc-multilib libx11-dev:i386 libxi-dev:i386 libgl1-mesa-dev:i386
- name: Compile 32 bit Linux builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
NIX32_FLAGS: "-no-pie -fno-pie -m32 -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cd src
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX32_FLAGS }} $LATEST_FLAG -o cc-nix32-gl1 -lX11 -lXi -lpthread -lGL -lm -ldl
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX32_FLAGS }} $LATEST_FLAG -DCC_BUILD_GLMODERN -o cc-nix32-gl2 -lX11 -lXi -lpthread -lGL -lm -ldl
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 32 bit Linux build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix32-gl1'
DEST_NAME: 'ClassiCube-Linux32'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix32-gl2'
DEST_NAME: 'ClassiCube-Linux32-ModernGL'

View File

@ -1,46 +0,0 @@
name: Build latest (Linux 64 bit)
on: [push]
concurrency:
group: ${{ github.ref }}-linux64
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Compile 64 bit Linux builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
NIX64_FLAGS: "-no-pie -fno-pie -m64 -fvisibility=hidden -fcf-protection=none -rdynamic -DCC_BUILD_ICON"
run: |
sudo apt-get -y install libx11-dev libxi-dev libgl1-mesa-dev
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cd src
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -o cc-nix64-gl1 -lX11 -lXi -lpthread -lGL -lm -ldl
gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.NIX64_FLAGS }} $LATEST_FLAG -DCC_BUILD_GLMODERN -o cc-nix64-gl2 -lX11 -lXi -lpthread -lGL -lm -ldl
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 64 bit Linux build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix64-gl1'
DEST_NAME: 'ClassiCube-Linux64'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-nix64-gl2'
DEST_NAME: 'ClassiCube-Linux64-ModernGL'

View File

@ -16,6 +16,8 @@ jobs:
- name: Compile N64 build
id: compile
run: |
apt-get update
apt-get -y install curl
REAL_DIR=`pwd`
cd /tmp
git clone -b opengl https://github.com/DragonMinded/libdragon.git --depth=1
@ -33,8 +35,21 @@ jobs:
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'build-n64/ClassiCube-n64.elf'
DEST_NAME: 'ClassiCube-n64.elf'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-n64.z64'
DEST_NAME: 'ClassiCube-n64.z64'
DEST_NAME: 'ClassiCube-n64.z64'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'n64'

49
.github/workflows/build_nds.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: Build latest (NDS)
on: [push]
concurrency:
group: ${{ github.ref }}-nds
cancel-in-progress: true
jobs:
build-DS:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: skylyrac/blocksds:dev-latest
steps:
- uses: actions/checkout@v4
- name: Compile NDS build
id: compile
run: |
apt-get -y install curl
export BLOCKSDS=/opt/blocksds/core
export BLOCKSDSEXT=/opt/blocksds/external
make ds
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile NDS build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube.nds'
DEST_NAME: 'ClassiCube.nds'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'build-nds/ClassiCube.elf'
DEST_NAME: 'ClassiCube-nds.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'nds'

View File

@ -46,4 +46,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-netbsd64-gl1'
DEST_NAME: 'ClassiCube-NetBSD-64'
DEST_NAME: 'ClassiCube-NetBSD-64'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'netbsd'

View File

@ -16,7 +16,7 @@ jobs:
- name: Compile PS2 build
id: compile
run: |
apk add make mpc1
apk add make mpc1 curl
make ps2
@ -31,4 +31,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-ps2.elf'
DEST_NAME: 'ClassiCube-ps2.elf'
DEST_NAME: 'ClassiCube-ps2.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'ps2'

View File

@ -10,33 +10,49 @@ jobs:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: akusiroyo/ps3sdk:latest
image: ghcr.io/classicube/minimal-psl1ght:latest
steps:
- uses: actions/checkout@v4
- name: Compile PS3 build
id: compile
run: |
pacman -S make --noconfirm
export PSL1GHT=/usr/local/ps3dev
apt-get update
apt-get install -y curl
export PS3DEV=/usr/local/ps3dev
export PSL1GHT=/usr/local/ps3dev
export PATH=$PATH:$PS3DEV/bin
export PATH=$PATH:$PS3DEV/ppu/bin
make ps3
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile PS3 build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-PS3.elf'
DEST_NAME: 'ClassiCube-PS3.elf'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-PS3.self'
DEST_NAME: 'ClassiCube-PS3.self'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-ps3.pkg'
DEST_NAME: 'ClassiCube-ps3.pkg'
SOURCE_FILE: 'ClassiCube-PS3.pkg'
DEST_NAME: 'ClassiCube-PS3.pkg'
- uses: ./.github/actions/upload_build
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-ps3.elf'
DEST_NAME: 'ClassiCube-ps3.elf'
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'ps3'

View File

@ -16,14 +16,10 @@ jobs:
- name: Compile PSP build
id: compile
run: |
apk add curl curl-dev
make psp
# otherwise notify_failure doesn't work
- name: Install curl when necessary
if: ${{ always() && steps.compile.outcome == 'failure' }}
run: apk add curl curl-dev
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
@ -41,4 +37,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-psp.elf'
DEST_NAME: 'ClassiCube-psp.elf'
DEST_NAME: 'ClassiCube-psp.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'psp'

104
.github/workflows/build_rpi.yml vendored Normal file
View File

@ -0,0 +1,104 @@
name: Build latest (RPI)
on: [push]
concurrency:
group: ${{ github.ref }}-rpi
cancel-in-progress: true
jobs:
#============================================
# ================ 32 BIT RPI ===============
# ===========================================
build-RPI32:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: dockcross/linux-armv6-lts
steps:
- uses: actions/checkout@v4
- name: Retrieve OpenGL and X11 dev files
run: |
mkdir src/rpi
cd src/rpi
wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/rpi32.zip
unzip rpi32.zip
- name: Compile RPI 32 bit build
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
RPI32_FLAGS: "-fvisibility=hidden -rdynamic -DCC_BUILD_ICON -DCC_BUILD_RPI -I rpi/include -L rpi/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$GITHUB_SHA\"
cd src
$CC *.c ${{ env.COMMON_FLAGS }} ${{ env.RPI32_FLAGS }} $LATEST_FLAG -o cc-rpi32 -lGLESv2 -lEGL -lX11 -lXi -lm -lpthread -ldl -lrt
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile RPI 32 bit build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-rpi32'
DEST_NAME: 'cc-rpi32'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'rpi32'
#============================================
# ================ 64 BIT RPI ===============
# ===========================================
build-RPI64:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: dockcross/linux-arm64-lts
steps:
- uses: actions/checkout@v4
- name: Retrieve OpenGL and X11 dev files
run: |
mkdir src/rpi
cd src/rpi
wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/rpi64.zip
unzip rpi64.zip
- name: Compile RPI 64 bit build
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
RPI64_FLAGS: "-fvisibility=hidden -rdynamic -DCC_BUILD_ICON -DCC_BUILD_RPI -I rpi/include -L rpi/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$GITHUB_SHA\"
cd src
$CC *.c ${{ env.COMMON_FLAGS }} ${{ env.RPI64_FLAGS }} $LATEST_FLAG -o cc-rpi64 -lGLESv2 -lEGL -lX11 -lXi -lm -lpthread -ldl -lrt
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile RPI 64 bit build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-rpi64'
DEST_NAME: 'cc-rpi64'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'rpi64'

View File

@ -1,45 +0,0 @@
name: Build latest (RPI 32 bit)
on: [push]
concurrency:
group: ${{ github.ref }}-rpi32
cancel-in-progress: true
jobs:
build-RPI32:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: dockcross/linux-armv6-lts
steps:
- uses: actions/checkout@v4
- name: Retrieve OpenGL and X11 dev files
run: |
mkdir src/rpi
cd src/rpi
wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/rpi32.zip
unzip rpi32.zip
- name: Compile RPI 32 bit build
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
RPI32_FLAGS: "-fvisibility=hidden -rdynamic -DCC_BUILD_ICON -DCC_BUILD_RPI -I rpi/include -L rpi/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$GITHUB_SHA\"
cd src
$CC *.c ${{ env.COMMON_FLAGS }} ${{ env.RPI32_FLAGS }} $LATEST_FLAG -o cc-rpi32 -lGLESv2 -lEGL -lX11 -lXi -lm -lpthread -ldl -lrt
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile RPI 32 bit build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-rpi32'
DEST_NAME: 'cc-rpi32'

View File

@ -1,45 +0,0 @@
name: Build latest (RPI 64 bit)
on: [push]
concurrency:
group: ${{ github.ref }}-rpi64
cancel-in-progress: true
jobs:
build-RPI64:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: dockcross/linux-arm64-lts
steps:
- uses: actions/checkout@v4
- name: Retrieve OpenGL and X11 dev files
run: |
mkdir src/rpi
cd src/rpi
wget https://github.com/ClassiCube/rpi-compiling-stuff/raw/main/rpi64.zip
unzip rpi64.zip
- name: Compile RPI 64 bit build
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
RPI64_FLAGS: "-fvisibility=hidden -rdynamic -DCC_BUILD_ICON -DCC_BUILD_RPI -I rpi/include -L rpi/lib -Wl,--unresolved-symbols=ignore-in-shared-libs"
run: |
LATEST_FLAG=-DCC_COMMIT_SHA=\"$GITHUB_SHA\"
cd src
$CC *.c ${{ env.COMMON_FLAGS }} ${{ env.RPI64_FLAGS }} $LATEST_FLAG -o cc-rpi64 -lGLESv2 -lEGL -lX11 -lXi -lm -lpthread -ldl -lrt
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile RPI 64 bit build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-rpi64'
DEST_NAME: 'cc-rpi64'

38
.github/workflows/build_saturn.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Build latest (Saturn)
on: [push]
concurrency:
group: ${{ github.ref }}-saturn
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: ijacquez/yaul
steps:
- uses: actions/checkout@v4
- name: Compile Saturn build
id: compile
run: |
make saturn
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile Saturn build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'build-saturn/ClassiCube-saturn.elf'
DEST_NAME: 'ClassiCube-saturn.elf'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-saturn.iso'
DEST_NAME: 'ClassiCube-saturn.iso'

46
.github/workflows/build_switch.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: Build latest (Switch)
on: [push]
concurrency:
group: ${{ github.ref }}-switch
cancel-in-progress: true
jobs:
build-switch:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: devkitpro/devkita64:latest
steps:
- uses: actions/checkout@v4
- name: Compile Switch build
id: compile
run: |
make switch
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile Switch build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-switch.nro'
DEST_NAME: 'ClassiCube-switch.nro'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-switch.elf'
DEST_NAME: 'ClassiCube-switch.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'switch'

View File

@ -10,9 +10,9 @@ jobs:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: gnuton/vitasdk-docker:latest
image: vitasdk/vitasdk:latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Compile Vita build
id: compile
run: |
@ -36,4 +36,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-vita.elf'
DEST_NAME: 'ClassiCube-vita.elf'
DEST_NAME: 'ClassiCube-vita.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'vita'

View File

@ -63,4 +63,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'wiitest'
DEST_NAME: 'ClassiCube-Wii-Homebrew'
DEST_NAME: 'ClassiCube-Wii-Homebrew'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'wiigc'

52
.github/workflows/build_wiiu.yml vendored Normal file
View File

@ -0,0 +1,52 @@
name: Build latest (WiiU)
on: [push]
concurrency:
group: ${{ github.ref }}-wiiu
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: devkitpro/devkitppc:latest
steps:
- uses: actions/checkout@v4
- name: Compile Wii U build
id: compile
run: |
make wiiu
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile WiiU build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-wiiu.wuhb'
DEST_NAME: 'ClassiCube-wiiu.wuhb'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-wiiu.rpx'
DEST_NAME: 'ClassiCube-wiiu.rpx'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-wiiu.elf'
DEST_NAME: 'ClassiCube-wiiu.elf'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'wiiu'

View File

@ -1,63 +0,0 @@
name: Build latest (Windows 32 bit)
on: [push]
concurrency:
group: ${{ github.ref }}-win32
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile 32 bit Windows builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
WIN32_FLAGS: "-mwindows -nostartfiles -Wl,-e_main_real -DCC_NOMAIN"
run: |
sudo apt-get -y install gcc-mingw-w64-i686
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cp misc/windows/CCicon_32.res src/CCicon_32.res
cd src
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -o cc-w32-d3d9.exe CCicon_32.res $LATEST_FLAG -lwinmm -limagehlp
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -o cc-w32-ogl.exe CCicon_32.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp -lopengl32
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -o cc-w32-d3d11.exe CCicon_32.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_D3D11 -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp
# mingw defaults to i686, but some really old CPUs only support i586
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -march=i586 -o cc-w9x-ogl.exe CCicon_32.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp -lopengl32
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 32 bit Windows build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w32-d3d9.exe'
DEST_NAME: 'ClassiCube-Win32.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w32-ogl.exe'
DEST_NAME: 'ClassiCube-Win32-OpenGL.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w32-d3d11.exe'
DEST_NAME: 'ClassiCube-Win32-Direct3D11.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w9x-ogl.exe'
DEST_NAME: 'ClassiCube-Win9x.exe'

View File

@ -1,54 +0,0 @@
name: Build latest (Windows 64 bit)
on: [push]
concurrency:
group: ${{ github.ref }}-win64
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile 64 bit Windows builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
WIN64_FLAGS: "-mwindows -nostartfiles -Wl,-emain_real -DCC_NOMAIN"
run: |
sudo apt-get -y install gcc-mingw-w64-x86-64
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cp misc/windows/CCicon_64.res src/CCicon_64.res
cd src
x86_64-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN64_FLAGS }} -o cc-w64-d3d9.exe CCicon_64.res $LATEST_FLAG -lwinmm -limagehlp
x86_64-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN64_FLAGS }} -o cc-w64-ogl.exe CCicon_64.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp -lopengl32
x86_64-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN64_FLAGS }} -o cc-w64-d3d11.exe CCicon_64.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_D3D11 -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 64 bit Windows build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w64-d3d9.exe'
DEST_NAME: 'ClassiCube-Win64.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w64-ogl.exe'
DEST_NAME: 'ClassiCube-Win64-OpenGL.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w64-d3d11.exe'
DEST_NAME: 'ClassiCube-Win64-Direct3D11.exe'

131
.github/workflows/build_windows.yml vendored Normal file
View File

@ -0,0 +1,131 @@
name: Build latest (Windows)
on: [push]
concurrency:
group: ${{ github.ref }}-windows
cancel-in-progress: true
jobs:
#============================================
# ============== 32 BIT WINDOWS =============
# ===========================================
build-32:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile 32 bit Windows builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
WIN32_FLAGS: "-mwindows -nostartfiles -Wl,-e_main_real -DCC_NOMAIN"
run: |
sudo apt-get -y install gcc-mingw-w64-i686
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cp misc/windows/CCicon_32.res src/CCicon_32.res
cd src
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -o cc-w32-d3d9.exe CCicon_32.res $LATEST_FLAG -lwinmm -limagehlp
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -o cc-w32-ogl.exe CCicon_32.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp -lopengl32
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -o cc-w32-d3d11.exe CCicon_32.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_D3D11 -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp
# mingw defaults to i686, but some really old CPUs only support i586
i686-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN32_FLAGS }} -march=i586 -o cc-w9x-ogl.exe CCicon_32.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp -lopengl32
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 32 bit Windows build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w32-d3d9.exe'
DEST_NAME: 'ClassiCube-Win32-Direct3D9.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w32-ogl.exe'
DEST_NAME: 'ClassiCube-Win32-OpenGL.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w32-d3d11.exe'
DEST_NAME: 'ClassiCube-Win32-Direct3D11.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w9x-ogl.exe'
DEST_NAME: 'ClassiCube-Win9x.exe'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'win32'
#============================================
# ============== 64 BIT WINDOWS =============
# ===========================================
build-64:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Compile 64 bit Windows builds
shell: bash
id: compile
env:
COMMON_FLAGS: "-O1 -s -fno-stack-protector -fno-math-errno -Qn"
WIN64_FLAGS: "-mwindows -nostartfiles -Wl,-emain_real -DCC_NOMAIN"
run: |
sudo apt-get -y install gcc-mingw-w64-x86-64
LATEST_FLAG=-DCC_COMMIT_SHA=\"$(git rev-parse --short "$GITHUB_SHA")\"
cp misc/windows/CCicon_64.res src/CCicon_64.res
cd src
x86_64-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN64_FLAGS }} -o cc-w64-d3d9.exe CCicon_64.res $LATEST_FLAG -lwinmm -limagehlp
x86_64-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN64_FLAGS }} -o cc-w64-ogl.exe CCicon_64.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_GL -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp -lopengl32
x86_64-w64-mingw32-gcc *.c ${{ env.COMMON_FLAGS }} ${{ env.WIN64_FLAGS }} -o cc-w64-d3d11.exe CCicon_64.res $LATEST_FLAG -DCC_BUILD_MANUAL -DCC_BUILD_WIN -DCC_BUILD_D3D11 -DCC_BUILD_WINGUI -DCC_BUILD_WGL -DCC_BUILD_WINMM -DCC_BUILD_HTTPCLIENT -DCC_BUILD_SCHANNEL -lwinmm -limagehlp
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile 64 bit Windows build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w64-d3d9.exe'
DEST_NAME: 'ClassiCube-Win64-Direct3D9.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w64-ogl.exe'
DEST_NAME: 'ClassiCube-Win64-OpenGL.exe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc-w64-d3d11.exe'
DEST_NAME: 'ClassiCube-Win64-Direct3D11.exe'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'win64'

View File

@ -16,15 +16,12 @@ jobs:
- name: Compile Xbox build
id: compile
run: |
apk add curl curl-dev
eval $(/usr/src/nxdk/bin/activate -s)
make xbox
cp bin/default.xbe ClassiCube-xbox.xbe
# otherwise notify_failure doesn't work
- name: Install curl when necessary
if: ${{ always() && steps.compile.outcome == 'failure' }}
run: apk add curl curl-dev
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
@ -35,11 +32,18 @@ jobs:
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'bin/default.xbe'
SOURCE_FILE: 'ClassiCube-xbox.xbe'
DEST_NAME: 'ClassiCube-xbox.xbe'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-xbox.iso'
DEST_NAME: 'ClassiCube-xbox.iso'
DEST_NAME: 'ClassiCube-xbox.iso'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'xbox'

50
.github/workflows/build_xbox360.yml vendored Normal file
View File

@ -0,0 +1,50 @@
name: Build latest (Xbox 360)
on: [push]
concurrency:
group: ${{ github.ref }}-xbox360
cancel-in-progress: true
jobs:
build-Xbox:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
container:
image: free60/libxenon
steps:
- uses: actions/checkout@v3
- name: Compile 360 build
id: compile
run: |
sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
apt-get update
apt-get install -y curl
export DEVKITXENON=/usr/local/xenon
export PATH=$PATH:$DEVKITXENON/bin:$DEVKITXENON/usr/bin
make xbox360
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to compile Xbox 360 build'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-xbox360.elf'
DEST_NAME: 'ClassiCube-xbox360.elf'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'ClassiCube-xbox360.elf32'
DEST_NAME: 'ClassiCube-xbox360.elf32'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'xbox360'

179
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,179 @@
name: Produce release
on: [workflow_dispatch]
concurrency:
group: ${{ github.ref }}-release
cancel-in-progress: true
jobs:
build:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Download resources
- name: Retrieve classicube texture pack
run: |
wget https://www.classicube.net/static/default.zip
- name: Retrieve classicube audio pack
run: |
wget https://www.classicube.net/static/audio.zip
# Download windows artifacts
- name: Retrieve Windows binaries
run: |
wget https://cdn.classicube.net/client/latest/ClassiCube.64.exe -O cc-w64.exe
wget https://cdn.classicube.net/client/latest/ClassiCube.exe -O cc-w32.exe
# Download Linux artifacts
- name: Retrieve Linux binaries
run: |
wget https://cdn.classicube.net/client/latest/ClassiCube -O cc-linux-64
wget https://cdn.classicube.net/client/latest/ClassiCube.32 -O cc-linux-32
# Download macOS artifacts
- name: Retrieve macOS binaries
run: |
wget https://cdn.classicube.net/client/latest/ClassiCube.64.osx -O cc-mac-64
wget https://cdn.classicube.net/client/latest/ClassiCube.osx -O cc-mac-32
# Download RPI artifacts
- name: Retrieve RPI binaries
run: |
wget https://cdn.classicube.net/client/latest/cc-rpi64 -O cc-rpi-64
wget https://cdn.classicube.net/client/latest/ClassiCube.rpi -O cc-rpi-32
# Download FreeBSD artifacts
- name: Retrieve macOS binaries
run: |
wget https://cdn.classicube.net/client/latest/cc-freebsd-64 -O cc-freebsd-64
wget https://cdn.classicube.net/client/latest/cc-freebsd-32 -O cc-freebsd-32
- name: Generate builds
id: compile
shell: bash
run: |
mkdir ClassiCube
mkdir ClassiCube/audio
mkdir ClassiCube/texpacks
cp audio.zip ClassiCube/audio/classicube.zip
cp default.zip ClassiCube/texpacks/classicube.zip
# ./ClassiCube
make_unix_tar() {
cp $2 ClassiCube/ClassiCube
chmod +x ClassiCube/ClassiCube
tar -zcvf $1 ClassiCube
rm ClassiCube/ClassiCube
}
# ./ClassiCube
make_windows_zip() {
cp $2 ClassiCube/ClassiCube.exe
zip -r $1 ClassiCube
rm ClassiCube/ClassiCube.exe
}
# Generate FreeBSD builds
make_unix_tar cc-freebsd32.tar.gz cc-freebsd-32
make_unix_tar cc-freebsd64.tar.gz cc-freebsd-64
# Generate RPI builds
make_unix_tar cc-rpi32.tar.gz cc-rpi-32
make_unix_tar cc-rpi64.tar.gz cc-rpi-64
# Generate Linux builds
make_unix_tar cc-linux32.tar.gz cc-linux-32
make_unix_tar cc-linux64.tar.gz cc-linux-64
# Generate macOS builds
make_unix_tar cc-mac32.tar.gz cc-mac-32
make_unix_tar cc-mac64.tar.gz cc-mac-64
# Generate Windows builds
make_windows_zip cc-win32.zip cc-w32.exe
make_windows_zip cc-win64.zip cc-w64.exe
- uses: ./.github/actions/notify_failure
if: ${{ always() && steps.compile.outcome == 'failure' }}
with:
NOTIFY_MESSAGE: 'Failed to produce release'
WEBHOOK_URL: '${{ secrets.WEBHOOK_URL }}'
# Generate Linux release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-linux32.tar.gz'
DEST_NAME: 'cc-linux32.tar.gz'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-linux64.tar.gz'
DEST_NAME: 'cc-linux64.tar.gz'
# Generate macOS release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-mac32.tar.gz'
DEST_NAME: 'cc-mac32.tar.gz'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-mac64.tar.gz'
DEST_NAME: 'cc-mac64.tar.gz'
# Generate Windows release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-win32.zip'
DEST_NAME: 'cc-win32.zip'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-win64.zip'
DEST_NAME: 'cc-win64.zip'
# Generate RPI release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-rpi32.tar.gz'
DEST_NAME: 'cc-rpi32.tar.gz'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-rpi64.tar.gz'
DEST_NAME: 'cc-rpi64.tar.gz'
# Generate FreeBSD release files
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-freebsd32.tar.gz'
DEST_NAME: 'cc-freebsd32.tar.gz'
- uses: ./.github/actions/upload_build
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'cc-freebsd64.tar.gz'
DEST_NAME: 'cc-freebsd64.tar.gz'
- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'release'

37
.gitignore vendored
View File

@ -20,16 +20,38 @@ android/app/.externalNativeBuild/
android/local.properties
*.iml
# Console build results
build-360/
# Nintendo Console build results
build-3ds/
build-dc/
build-gc/
build-nds/
build-n64/
build-wii/
build-wiiu/
build-switch/
classicube.nds
# SEGA console build results
build-dc/
IP.BIN
ISO_FILES/
third_party/gldc/libGLdc.a
build-saturn/
cd/
# Microsoft console build results
build-360/
main.exe
main.lib
misc/xbox/ps_coloured.inl
misc/xbox/ps_textured.inl
misc/xbox/vs_coloured.inl
misc/xbox/vs_textured.inl
# Sony console build results
build-ps2/
build-ps3/
build-psp/
build-vita/
build-wii/
eboot.pbp
eboot.bin
param.sfo
# Build results
[Dd]ebug/
@ -66,6 +88,13 @@ ClassiCube*
screenshots
fontscache.txt
# Android source files need to be included
!android/app/src/main/java/com/classicube
# CMake files
CMakeFiles/
CMakeCache.txt
#GCC object files
*.o

192
Makefile
View File

@ -1,99 +1,109 @@
C_SOURCES:=$(wildcard src/*.c)
C_OBJECTS:=$(patsubst %.c, %.o, $(C_SOURCES))
OBJECTS:=$(C_OBJECTS)
ENAME=ClassiCube
DEL=rm -f
CFLAGS=-g -pipe -fno-math-errno
LDFLAGS=-g -rdynamic
SOURCE_DIR := src
BUILD_DIR := build
C_SOURCES := $(wildcard $(SOURCE_DIR)/*.c)
C_OBJECTS := $(patsubst $(SOURCE_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES))
OBJECTS := $(C_OBJECTS)
ENAME = ClassiCube
DEL = rm -f
CFLAGS = -g -pipe -fno-math-errno
LDFLAGS = -g -rdynamic
# Enables dependency tracking (https://make.mad-scientist.net/papers/advanced-auto-dependency-generation/)
# This ensures that changing a .h file automatically results in the .c files using it being auto recompiled when next running make
# On older systems the required GCC options may not be supported - in which case just change TRACK_DEPENDENCIES to 0
TRACK_DEPENDENCIES=1
ifndef $(PLAT)
ifeq ($(OS),Windows_NT)
PLAT=mingw
PLAT = mingw
else
PLAT=$(shell uname -s | tr '[:upper:]' '[:lower:]')
PLAT = $(shell uname -s | tr '[:upper:]' '[:lower:]')
endif
endif
ifeq ($(PLAT),web)
CC=emcc
OEXT=.html
CFLAGS=-g
LDFLAGS=-s WASM=1 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library src/interop_web.js
CC = emcc
OEXT = .html
CFLAGS = -g
LDFLAGS = -s WASM=1 -s NO_EXIT_RUNTIME=1 -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library $(SOURCE_DIR)/interop_web.js
endif
ifeq ($(PLAT),mingw)
CC=gcc
OEXT=.exe
CFLAGS=-g -pipe -DUNICODE -fno-math-errno
LDFLAGS=-g
LIBS=-mwindows -lwinmm -limagehlp
CC = gcc
OEXT = .exe
CFLAGS = -g -pipe -DUNICODE -fno-math-errno
LDFLAGS = -g
LIBS = -mwindows -lwinmm -limagehlp
endif
ifeq ($(PLAT),linux)
LIBS=-lX11 -lXi -lpthread -lGL -ldl
CFLAGS = -g -pipe -fno-math-errno -DCC_BUILD_ICON
LIBS = -lX11 -lXi -lpthread -lGL -ldl
endif
ifeq ($(PLAT),sunos)
CFLAGS=-g -pipe -fno-math-errno
LIBS=-lsocket -lX11 -lXi -lGL
CFLAGS = -g -pipe -fno-math-errno
LIBS = -lsocket -lX11 -lXi -lGL
endif
ifeq ($(PLAT),darwin)
OBJECTS+=src/interop_cocoa.o
CFLAGS=-g -pipe -fno-math-errno
LIBS=
LDFLAGS=-rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
OBJECTS += $(BUILD_DIR)/interop_cocoa.o
CFLAGS = -g -pipe -fno-math-errno -DCC_BUILD_ICON
LIBS =
LDFLAGS = -rdynamic -framework Cocoa -framework OpenGL -framework IOKit -lobjc
endif
ifeq ($(PLAT),freebsd)
CFLAGS=-g -pipe -I /usr/local/include -fno-math-errno
LDFLAGS=-L /usr/local/lib -rdynamic
LIBS=-lexecinfo -lGL -lX11 -lXi -lpthread
CFLAGS = -g -pipe -I /usr/local/include -fno-math-errno -DCC_BUILD_ICON
LDFLAGS = -L /usr/local/lib -rdynamic
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
endif
ifeq ($(PLAT),openbsd)
CFLAGS=-g -pipe -I /usr/X11R6/include -I /usr/local/include -fno-math-errno
LDFLAGS=-L /usr/X11R6/lib -L /usr/local/lib -rdynamic
LIBS=-lexecinfo -lGL -lX11 -lXi -lpthread
CFLAGS = -g -pipe -I /usr/X11R6/include -I /usr/local/include -fno-math-errno -DCC_BUILD_ICON
LDFLAGS = -L /usr/X11R6/lib -L /usr/local/lib -rdynamic
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
endif
ifeq ($(PLAT),netbsd)
CFLAGS=-g -pipe -I /usr/X11R7/include -I /usr/pkg/include -fno-math-errno
LDFLAGS=-L /usr/X11R7/lib -L /usr/pkg/lib -rdynamic
LIBS=-lexecinfo -lGL -lX11 -lXi -lpthread
CFLAGS = -g -pipe -I /usr/X11R7/include -I /usr/pkg/include -fno-math-errno -DCC_BUILD_ICON
LDFLAGS = -L /usr/X11R7/lib -L /usr/pkg/lib -rdynamic
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
endif
ifeq ($(PLAT),dragonfly)
CFLAGS=-g -pipe -I /usr/local/include -fno-math-errno
LDFLAGS=-L /usr/local/lib -rdynamic
LIBS=-lexecinfo -lGL -lX11 -lXi -lpthread
CFLAGS = -g -pipe -I /usr/local/include -fno-math-errno -DCC_BUILD_ICON
LDFLAGS = -L /usr/local/lib -rdynamic
LIBS = -lexecinfo -lGL -lX11 -lXi -lpthread
endif
ifeq ($(PLAT),haiku)
OBJECTS+=src/interop_BeOS.o
CFLAGS=-g -pipe -fno-math-errno
LDFLAGS=-g
LIBS=-lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
OBJECTS += $(BUILD_DIR)/interop_BeOS.o
CFLAGS = -g -pipe -fno-math-errno
LDFLAGS = -g
LIBS = -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
endif
ifeq ($(PLAT),beos)
OBJECTS+=src/interop_BeOS.o
CFLAGS=-g -pipe
LDFLAGS=-g
LIBS=-lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
OBJECTS += $(BUILD_DIR)/interop_BeOS.o
CFLAGS = -g -pipe
LDFLAGS = -g
LIBS = -lGL -lnetwork -lstdc++ -lbe -lgame -ltracker
TRACK_DEPENDENCIES=0
endif
ifeq ($(PLAT),serenityos)
LIBS=-lgl -lSDL2
LIBS = -lgl -lSDL2
endif
ifeq ($(PLAT),irix)
CC=gcc
LIBS=-lGL -lX11 -lXi -lpthread -ldl
CC = gcc
LIBS = -lGL -lX11 -lXi -lpthread -ldl
endif
ifeq ($(OS),Windows_NT)
DEL=del
DEL = del
endif
default: $(PLAT)
@ -124,43 +134,75 @@ serenityos:
$(MAKE) $(ENAME) PLAT=serenityos
irix:
$(MAKE) $(ENAME) PLAT=irix
# consoles builds require special handling, so are moved to
# separate makefiles to avoid having one giant messy makefile
psp:
$(MAKE) -f misc/psp/Makefile PLAT=psp
vita:
$(MAKE) -f misc/vita/Makefile PLAT=vita
ps3:
$(MAKE) -f misc/ps3/Makefile PLAT=ps3
ps2:
$(MAKE) -f misc/ps2/Makefile PLAT=ps2
3ds:
$(MAKE) -f misc/3ds/Makefile PLAT=3ds
wii:
$(MAKE) -f misc/wii/Makefile PLAT=wii
gamecube:
$(MAKE) -f misc/gc/Makefile PLAT=gamecube
dreamcast:
$(MAKE) -f misc/dreamcast/Makefile PLAT=dreamcast
$(MAKE) -f misc/dreamcast/Makefile
saturn:
$(MAKE) -f misc/saturn/Makefile
psp:
$(MAKE) -f misc/psp/Makefile
vita:
$(MAKE) -f misc/vita/Makefile
ps1:
cmake --preset default misc/ps1
cmake --build misc/ps1/build
ps2:
$(MAKE) -f misc/ps2/Makefile
ps3:
$(MAKE) -f misc/ps3/Makefile
xbox:
$(MAKE) -f misc/xbox/Makefile PLAT=xbox
$(MAKE) -f misc/xbox/Makefile
xbox360:
$(MAKE) -f misc/xbox360/Makefile PLAT=xbox360
$(MAKE) -f misc/xbox360/Makefile
n64:
$(MAKE) -f misc/n64/Makefile PLAT=n64
$(MAKE) -f misc/n64/Makefile
ds:
$(MAKE) -f misc/ds/Makefile
3ds:
$(MAKE) -f misc/3ds/Makefile
gamecube:
$(MAKE) -f misc/gc/Makefile
wii:
$(MAKE) -f misc/wii/Makefile
wiiu:
$(MAKE) -f misc/wiiu/Makefile
switch:
$(MAKE) -f misc/switch/Makefile
os/2:
$(MAKE) -f misc/os2/Makefile
clean:
$(DEL) $(OBJECTS)
$(ENAME): $(OBJECTS)
$(CC) $(LDFLAGS) -o $@$(OEXT) $(OBJECTS) $(LIBS)
$(C_OBJECTS): %.o : %.c
$(ENAME): $(BUILD_DIR) $(OBJECTS)
$(CC) $(LDFLAGS) -o $@$(OEXT) $(OBJECTS) $(LIBS)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
# === Compiling with dependency tracking ===
# NOTE: Tracking dependencies might not work on older systems - disable this if so
ifeq ($(TRACK_DEPENDENCIES), 1)
DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)/$*.d
DEPFILES := $(patsubst $(SOURCE_DIR)/%.c, $(BUILD_DIR)/%.d, $(C_SOURCES))
$(DEPFILES):
$(C_OBJECTS): $(BUILD_DIR)/%.o : $(SOURCE_DIR)/%.c $(BUILD_DIR)/%.d
$(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@
include $(wildcard $(DEPFILES))
# === Compiling WITHOUT dependency tracking ===
else
$(C_OBJECTS): $(BUILD_DIR)/%.o : $(SOURCE_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
endif
# === Platform specific file compiling ===
$(BUILD_DIR)/interop_cocoa.o: $(SOURCE_DIR)/interop_cocoa.m
$(CC) $(CFLAGS) -c $< -o $@
src/interop_cocoa.o: src/interop_cocoa.m
$(CC) $(CFLAGS) -c $< -o $@
src/interop_BeOS.o: src/interop_BeOS.cpp
$(BUILD_DIR)/interop_BeOS.o: $(SOURCE_DIR)/interop_BeOS.cpp
$(CC) $(CFLAGS) -c $< -o $@

View File

@ -22,7 +22,7 @@ set(${CMAKE_C_FLAGS}, "${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -Werror")
add_library(classicube SHARED
../../src/Program.c
../../src/main.c
../../src/IsometricDrawer.c
../../src/Builder.c
../../src/ExtMath.c
@ -99,6 +99,10 @@ add_library(classicube SHARED
../../src/LBackend.c
../../src/SystemFonts.c
../../src/Commands.c
../../src/EntityRenderers.c
../../src/AudioBackend.c
../../src/TouchUI.c
../../src/LBackend_Android.c
)
# add lib dependencies
@ -107,4 +111,5 @@ target_link_libraries(classicube
EGL
GLESv2
log
OpenSLES)
OpenSLES
jnigraphics)

View File

@ -0,0 +1,108 @@
package com.classicube;
import android.text.Editable;
import android.text.Selection;
import android.text.SpannableStringBuilder;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
public class CCView extends SurfaceView {
SpannableStringBuilder kbText;
MainActivity activity;
public CCView(MainActivity activity) {
// setFocusable, setFocusableInTouchMode - API level 1
super(activity);
this.activity = activity;
setFocusable(true);
setFocusableInTouchMode(true);
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return activity.handleTouchEvent(ev) || super.dispatchTouchEvent(ev);
}
@Override
public InputConnection onCreateInputConnection(EditorInfo attrs) {
// BaseInputConnection, IME_ACTION_GO, IME_FLAG_NO_EXTRACT_UI - API level 3
attrs.actionLabel = null;
attrs.inputType = MainActivity.calcKeyboardType(activity.keyboardType);
attrs.imeOptions = MainActivity.calcKeyboardOptions(activity.keyboardType);
kbText = new SpannableStringBuilder(activity.keyboardText);
InputConnection ic = new BaseInputConnection(this, true) {
boolean inited;
void updateText() {
activity.pushCmd(MainActivity.CMD_KEY_TEXT, kbText.toString());
}
@Override
public Editable getEditable() {
if (!inited) {
// needed to set selection, otherwise random crashes later with backspacing
// set selection to end, so backspacing after opening keyboard with text still works
Selection.setSelection(kbText, kbText.toString().length());
inited = true;
}
return kbText;
}
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
boolean success = super.setComposingText(text, newCursorPosition);
updateText();
return success;
}
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
boolean success = super.deleteSurroundingText(beforeLength, afterLength);
updateText();
return success;
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
boolean success = super.commitText(text, newCursorPosition);
updateText();
return success;
}
@Override
public boolean sendKeyEvent(KeyEvent ev) {
// getSelectionStart - API level 1
if (ev.getAction() != KeyEvent.ACTION_DOWN) return super.sendKeyEvent(ev);
int code = ev.getKeyCode();
int uni = ev.getUnicodeChar();
// start is -1 sometimes, and trying to insert/delete there crashes
int start = Selection.getSelectionStart(kbText);
if (start == -1) start = kbText.toString().length();
if (code == KeyEvent.KEYCODE_ENTER) {
// enter maps to \n but that should not be intercepted
} else if (code == KeyEvent.KEYCODE_DEL) {
if (start <= 0) return false;
kbText.delete(start - 1, start);
updateText();
return false;
} else if (uni != 0) {
kbText.insert(start, String.valueOf((char) uni));
updateText();
return false;
}
return super.sendKeyEvent(ev);
}
};
//String text = MainActivity.this.keyboardText;
//if (text != null) ic.setComposingText(text, 0);
return ic;
}
}

View File

@ -57,6 +57,7 @@ import android.view.inputmethod.InputMethodManager;
// implements InputQueue.Callback
public class MainActivity extends Activity
{
public boolean launcher;
// ==================================================================
// ---------------------------- COMMANDS ----------------------------
// ==================================================================
@ -72,21 +73,29 @@ public class MainActivity extends Activity
NativeCmdArgs args = freeCmds.poll();
return args != null ? args : new NativeCmdArgs();
}
void pushCmd(int cmd) {
public void pushCmd(int cmd) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
pending.add(args);
}
void pushCmd(int cmd, int a1) {
public void pushCmd(int cmd, int a1) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
args.arg1 = a1;
pending.add(args);
}
public void pushCmd(int cmd, int a1, int a2) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
args.arg1 = a1;
args.arg2 = a2;
pending.add(args);
}
void pushCmd(int cmd, int a1, int a2, int a3, int a4) {
public void pushCmd(int cmd, int a1, int a2, int a3, int a4) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
args.arg1 = a1;
@ -96,45 +105,58 @@ public class MainActivity extends Activity
pending.add(args);
}
void pushCmd(int cmd, String text) {
public void pushCmd(int cmd, String text) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
args.str = text;
pending.add(args);
}
void pushCmd(int cmd, Surface surface) {
public void pushCmd(int cmd, int a1, String str) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
args.arg1 = a1;
args.str = str;
pending.add(args);
}
public void pushCmd(int cmd, Surface surface) {
NativeCmdArgs args = getCmdArgs();
args.cmd = cmd;
args.sur = surface;
pending.add(args);
}
final static int CMD_KEY_DOWN = 0;
final static int CMD_KEY_UP = 1;
final static int CMD_KEY_CHAR = 2;
final static int CMD_POINTER_DOWN = 3;
final static int CMD_POINTER_UP = 4;
final static int CMD_POINTER_MOVE = 5;
final static int CMD_WIN_CREATED = 6;
final static int CMD_WIN_DESTROYED = 7;
final static int CMD_WIN_RESIZED = 8;
final static int CMD_WIN_REDRAW = 9;
public final static int CMD_KEY_DOWN = 0;
public final static int CMD_KEY_UP = 1;
public final static int CMD_KEY_CHAR = 2;
public final static int CMD_POINTER_DOWN = 3;
public final static int CMD_POINTER_UP = 4;
public final static int CMD_POINTER_MOVE = 5;
final static int CMD_APP_START = 10;
final static int CMD_APP_STOP = 11;
final static int CMD_APP_RESUME = 12;
final static int CMD_APP_PAUSE = 13;
final static int CMD_APP_DESTROY = 14;
public final static int CMD_WIN_CREATED = 6;
public final static int CMD_WIN_DESTROYED = 7;
public final static int CMD_WIN_RESIZED = 8;
public final static int CMD_WIN_REDRAW = 9;
final static int CMD_GOT_FOCUS = 15;
final static int CMD_LOST_FOCUS = 16;
final static int CMD_CONFIG_CHANGED = 17;
final static int CMD_LOW_MEMORY = 18;
public final static int CMD_APP_START = 10;
public final static int CMD_APP_STOP = 11;
public final static int CMD_APP_RESUME = 12;
public final static int CMD_APP_PAUSE = 13;
public final static int CMD_APP_DESTROY = 14;
final static int CMD_KEY_TEXT = 19;
final static int CMD_OFD_RESULT = 20;
public final static int CMD_GOT_FOCUS = 15;
public final static int CMD_LOST_FOCUS = 16;
public final static int CMD_CONFIG_CHANGED = 17;
public final static int CMD_LOW_MEMORY = 18;
public final static int CMD_KEY_TEXT = 19;
public final static int CMD_OFD_RESULT = 20;
public final static int CMD_UI_CREATED = 21;
public final static int CMD_UI_CLICKED = 22;
public final static int CMD_UI_CHANGED = 23;
public final static int CMD_UI_STRING = 24;
// ====================================================================
@ -385,7 +407,15 @@ public class MainActivity extends Activity
// static to persist across activity destroy/create
static final Semaphore winDestroyedSem = new Semaphore(0, true);
SurfaceHolder.Callback callback;
CCView curView;
public View curView;
public void setActiveView(View view) {
// setContentView, requestFocus - API level 1
curView = view;
setContentView(view);
curView.requestFocus();
if (fullscreen) setUIVisibility(FULLSCREEN_FLAGS);
}
// SurfaceHolder.Callback - API level 1
class CCSurfaceCallback implements SurfaceHolder.Callback {
@ -449,107 +479,11 @@ public class MainActivity extends Activity
void attachSurface() {
// setContentView, requestFocus, getHolder, addCallback, RGBX_8888 - API level 1
createSurfaceCallback();
curView = new CCView(this);
curView.getHolder().addCallback(callback);
curView.getHolder().setFormat(PixelFormat.RGBX_8888);
setContentView(curView);
curView.requestFocus();
if (fullscreen) setUIVisibility(FULLSCREEN_FLAGS);
}
CCView view = new CCView(this);
view.getHolder().addCallback(callback);
view.getHolder().setFormat(PixelFormat.RGBX_8888);
class CCView extends SurfaceView {
SpannableStringBuilder kbText;
public CCView(Context context) {
// setFocusable, setFocusableInTouchMode - API level 1
super(context);
setFocusable(true);
setFocusableInTouchMode(true);
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
return MainActivity.this.handleTouchEvent(ev) || super.dispatchTouchEvent(ev);
}
@Override
public InputConnection onCreateInputConnection(EditorInfo attrs) {
// BaseInputConnection, IME_ACTION_GO, IME_FLAG_NO_EXTRACT_UI - API level 3
attrs.actionLabel = null;
attrs.inputType = MainActivity.this.getKeyboardType();
attrs.imeOptions = MainActivity.this.getKeyboardOptions();
kbText = new SpannableStringBuilder(MainActivity.this.keyboardText);
InputConnection ic = new BaseInputConnection(this, true) {
boolean inited;
void updateText() { MainActivity.this.pushCmd(CMD_KEY_TEXT, kbText.toString()); }
@Override
public Editable getEditable() {
if (!inited) {
// needed to set selection, otherwise random crashes later with backspacing
// set selection to end, so backspacing after opening keyboard with text still works
Selection.setSelection(kbText, kbText.toString().length());
inited = true;
}
return kbText;
}
@Override
public boolean setComposingText(CharSequence text, int newCursorPosition) {
boolean success = super.setComposingText(text, newCursorPosition);
updateText();
return success;
}
@Override
public boolean deleteSurroundingText(int beforeLength, int afterLength) {
boolean success = super.deleteSurroundingText(beforeLength, afterLength);
updateText();
return success;
}
@Override
public boolean commitText(CharSequence text, int newCursorPosition) {
boolean success = super.commitText(text, newCursorPosition);
updateText();
return success;
}
@Override
public boolean sendKeyEvent(KeyEvent ev) {
// getSelectionStart - API level 1
if (ev.getAction() != KeyEvent.ACTION_DOWN) return super.sendKeyEvent(ev);
int code = ev.getKeyCode();
int uni = ev.getUnicodeChar();
// start is -1 sometimes, and trying to insert/delete there crashes
int start = Selection.getSelectionStart(kbText);
if (start == -1) start = kbText.toString().length();
if (code == KeyEvent.KEYCODE_ENTER) {
// enter maps to \n but that should not be intercepted
} else if (code == KeyEvent.KEYCODE_DEL) {
if (start <= 0) return false;
kbText.delete(start - 1, start);
updateText();
return false;
} else if (uni != 0) {
kbText.insert(start, String.valueOf((char)uni));
updateText();
return false;
}
return super.sendKeyEvent(ev);
}
};
//String text = MainActivity.this.keyboardText;
//if (text != null) ic.setComposingText(text, 0);
return ic;
}
setActiveView(view);
}
@ -655,8 +589,9 @@ public class MainActivity extends Activity
if (curView == null) return;
// Try to avoid restarting input if possible
if (curView.kbText != null) {
String curText = curView.kbText.toString();
CCView view = (CCView)curView;
if (view.kbText != null) {
String curText = view.kbText.toString();
if (text.equals(curText)) return;
}
@ -668,9 +603,9 @@ public class MainActivity extends Activity
input.restartInput(curView);
}
public int getKeyboardType() {
public static int calcKeyboardType(int kbType) {
// TYPE_CLASS_TEXT, TYPE_CLASS_NUMBER, TYPE_TEXT_VARIATION_PASSWORD - API level 3
int type = keyboardType & 0xFF;
int type = kbType & 0xFF;
if (type == 2) return InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD;
if (type == 1) return InputType.TYPE_CLASS_NUMBER; // KEYBOARD_TYPE_NUMERIC
@ -678,9 +613,9 @@ public class MainActivity extends Activity
return InputType.TYPE_CLASS_TEXT;
}
public int getKeyboardOptions() {
public static int calcKeyboardOptions(int kbType) {
// IME_ACTION_GO, IME_FLAG_NO_EXTRACT_UI - API level 3
if ((keyboardType & 0x100) != 0) {
if ((kbType & 0x100) != 0) {
return EditorInfo.IME_ACTION_SEND | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
} else {
return EditorInfo.IME_ACTION_GO | EditorInfo.IME_FLAG_NO_EXTRACT_UI;

View File

@ -8,9 +8,9 @@
The OSX port would not have been possible without you, thanks!
* Jerralish - reverse engineering and documenting the original classic map generation algorithm.
* Cybertoon - Adding water animation, better metal step/dig sounds, identifying multiple flaws
* FabTheZen - suggestions about how to improve user experience, testing.
* Cheesse - multiple suggestions, testing ClassicalSharp on AMD graphics cards.
* Hemsindor - testing ClassicalSharp on OSX.
* headshotnoby - developing the Switch port
And a big thanks to everyone else in the ClassiCube community (who I didn't mention here),
who in the past have provided many suggestions and assisted in identifying bugs.

View File

@ -3,9 +3,11 @@ Although most of the code is platform-independent, some per-platform functionali
By default I try to automatically define appropriate backends for your system in `Core.h`. Define ```CC_BUILD_MANUAL``` to disable this.
## Before you start
* IEEE floating support is required.
* IEEE floating support is required. (Can be emulated in software, but will affect performance)
* int must be 32-bits. 32-bit addressing (or more) is required.
* Support for 8/16/32/64 integer types is required. (your compiler must support 64-bit arithmetic)
* At least around 2 MB of RAM is required at a minimum
* At least 128 kb for main thread stack size
In other words, the codebase can theroetically be ported to any modern-ish hardware, but not stuff like a UNIVAC machine, the SuperFX chip on the SNES, or an 8-bit microcontroller.

View File

@ -7,6 +7,9 @@
objects = {
/* Begin PBXBuildFile section */
9A4D0C642BDD168800E1695D /* TouchUI.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A4D0C632BDD168800E1695D /* TouchUI.c */; };
9A57ECEE2BCD1408006A89F0 /* AudioBackend.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A57ECED2BCD1408006A89F0 /* AudioBackend.c */; };
9A57ECF02BCD1413006A89F0 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A57ECEF2BCD1412006A89F0 /* main.c */; };
9A62ADF5286D906F00E5E3DE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A62ADF4286D906F00E5E3DE /* Assets.xcassets */; };
9A7401D92B737D5C0040E575 /* Commands.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A7401D82B737D5B0040E575 /* Commands.c */; };
9A7401DB2B7384060040E575 /* SSL.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A7401DA2B7384060040E575 /* SSL.c */; };
@ -39,7 +42,6 @@
9A89D55627F802F600FF3F80 /* EnvRenderer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D47A27F802F500FF3F80 /* EnvRenderer.c */; };
9A89D55827F802F600FF3F80 /* Graphics_GL1.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D47E27F802F500FF3F80 /* Graphics_GL1.c */; };
9A89D55927F802F600FF3F80 /* interop_ios.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D47F27F802F600FF3F80 /* interop_ios.m */; };
9A89D55A27F802F600FF3F80 /* Program.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D48127F802F600FF3F80 /* Program.c */; };
9A89D55B27F802F600FF3F80 /* _type1.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D48227F802F600FF3F80 /* _type1.c */; };
9A89D55C27F802F600FF3F80 /* Animations.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D48527F802F600FF3F80 /* Animations.c */; };
9A89D55D27F802F600FF3F80 /* _psmodule.c in Sources */ = {isa = PBXBuildFile; fileRef = 9A89D48627F802F600FF3F80 /* _psmodule.c */; };
@ -91,6 +93,9 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
9A4D0C632BDD168800E1695D /* TouchUI.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TouchUI.c; sourceTree = "<group>"; };
9A57ECED2BCD1408006A89F0 /* AudioBackend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = AudioBackend.c; sourceTree = "<group>"; };
9A57ECEF2BCD1412006A89F0 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
9A62ADF4286D906F00E5E3DE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ClassiCube/Assets.xcassets; sourceTree = "<group>"; };
9A7401D82B737D5B0040E575 /* Commands.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Commands.c; sourceTree = "<group>"; };
9A7401DA2B7384060040E575 /* SSL.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SSL.c; sourceTree = "<group>"; };
@ -125,7 +130,6 @@
9A89D47A27F802F500FF3F80 /* EnvRenderer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = EnvRenderer.c; sourceTree = "<group>"; };
9A89D47E27F802F500FF3F80 /* Graphics_GL1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Graphics_GL1.c; sourceTree = "<group>"; };
9A89D47F27F802F600FF3F80 /* interop_ios.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = interop_ios.m; sourceTree = "<group>"; };
9A89D48127F802F600FF3F80 /* Program.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Program.c; sourceTree = "<group>"; };
9A89D48227F802F600FF3F80 /* _type1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = _type1.c; sourceTree = "<group>"; };
9A89D48527F802F600FF3F80 /* Animations.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Animations.c; sourceTree = "<group>"; };
9A89D48627F802F600FF3F80 /* _psmodule.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = _psmodule.c; sourceTree = "<group>"; };
@ -208,6 +212,9 @@
9A89D37727F802F500FF3F80 /* src */ = {
isa = PBXGroup;
children = (
9A4D0C632BDD168800E1695D /* TouchUI.c */,
9A57ECEF2BCD1412006A89F0 /* main.c */,
9A57ECED2BCD1408006A89F0 /* AudioBackend.c */,
9A7401DA2B7384060040E575 /* SSL.c */,
9A7401D82B737D5B0040E575 /* Commands.c */,
9AC543412AE264B90086C85F /* EntityRenderers.c */,
@ -272,7 +279,6 @@
9A89D4C927F802F600FF3F80 /* SelOutlineRenderer.c */,
9A89D4AA27F802F600FF3F80 /* Picking.c */,
9A89D39227F802F500FF3F80 /* Platform_Posix.c */,
9A89D48127F802F600FF3F80 /* Program.c */,
9A89D4B327F802F600FF3F80 /* Protocol.c */,
9A89D4BE27F802F600FF3F80 /* Resources.c */,
9A89D4D127F802F600FF3F80 /* Screens.c */,
@ -402,6 +408,7 @@
9A89D55F27F802F600FF3F80 /* _sfnt.c in Sources */,
9A89D55527F802F600FF3F80 /* HeldBlockRenderer.c in Sources */,
9A89D4FD27F802F600FF3F80 /* ExtMath.c in Sources */,
9A57ECEE2BCD1408006A89F0 /* AudioBackend.c in Sources */,
9A89D56427F802F600FF3F80 /* String.c in Sources */,
9A89D57D27F802F600FF3F80 /* _smooth.c in Sources */,
9AC543402AE264AC0086C85F /* GameVersion.c in Sources */,
@ -416,7 +423,6 @@
9A89D55827F802F600FF3F80 /* Graphics_GL1.c in Sources */,
9A89D59427F802F600FF3F80 /* Widgets.c in Sources */,
9A89D55927F802F600FF3F80 /* interop_ios.m in Sources */,
9A89D55A27F802F600FF3F80 /* Program.c in Sources */,
9A7401DB2B7384060040E575 /* SSL.c in Sources */,
9A89D4F527F802F600FF3F80 /* _ftsynth.c in Sources */,
9A89D55D27F802F600FF3F80 /* _psmodule.c in Sources */,
@ -426,9 +432,11 @@
9A89D56227F802F600FF3F80 /* _ftbase.c in Sources */,
9A89D56B27F802F600FF3F80 /* Server.c in Sources */,
9A89D50027F802F600FF3F80 /* _truetype.c in Sources */,
9A4D0C642BDD168800E1695D /* TouchUI.c in Sources */,
9AC5433E2AE2649F0086C85F /* SystemFonts.c in Sources */,
9A89D57F27F802F600FF3F80 /* LWeb.c in Sources */,
9A89D56627F802F600FF3F80 /* Drawer2D.c in Sources */,
9A57ECF02BCD1413006A89F0 /* main.c in Sources */,
9A89D57427F802F600FF3F80 /* MapRenderer.c in Sources */,
9A89D57627F802F600FF3F80 /* _pshinter.c in Sources */,
9A89D56A27F802F600FF3F80 /* Physics.c in Sources */,

View File

@ -1,4 +1,4 @@
Copyright (c) 2014 - 2022, UnknownShadow200
Copyright (c) 2014 - 2024, UnknownShadow200
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,

View File

@ -28,6 +28,10 @@ BUILD := build-3ds
SOURCES := src misc/3ds third_party/bearssl/src
INCLUDES := third_party/bearssl/inc
CIA_BANNER_BIN := $(TOPDIR)/misc/3ds/banner.bin
CIA_ICON_BIN := $(TOPDIR)/misc/3ds/icon.bin
CIA_SPEC_RSF := $(TOPDIR)/misc/3ds/spec.rsf
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
@ -44,7 +48,7 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=3dsx.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LIBS := -lcitro3d -lctru -lm
LIBS := -lctru -lm
#---------------------------------------------------------------------------------
@ -93,7 +97,7 @@ $(BUILD):
#---------------------------------------------------------------------------------
clean:
echo clean ...
rm -fr $(BUILD) $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf
rm -fr $(BUILD) $(TARGET).cia $(TARGET).3dsx $(OUTPUT).smdh $(TARGET).elf
#---------------------------------------------------------------------------------
else
@ -101,6 +105,14 @@ else
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).cia : $(OUTPUT).3dsx makerom
./makerom -f cia -o "$(OUTPUT).cia" -elf "$(OUTPUT).elf" -rsf "$(CIA_SPEC_RSF)" -icon "$(CIA_ICON_BIN)" -banner "$(CIA_BANNER_BIN)" -exefslogo -target t
makerom:
wget https://github.com/3DSGuy/Project_CTR/releases/download/makerom-v0.18.3/makerom-v0.18.3-ubuntu_x86_64.zip
unzip makerom-v0.18.3-ubuntu_x86_64.zip
chmod +x makerom
$(OUTPUT).3dsx : $(OUTPUT).elf $(OUTPUT).smdh
$(OUTPUT).elf : $(OFILES)
@ -121,4 +133,4 @@ $(OUTPUT).elf : $(OFILES)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------

BIN
misc/3ds/audio.wav Normal file

Binary file not shown.

BIN
misc/3ds/banner.bin Normal file

Binary file not shown.

BIN
misc/3ds/icon.bin Normal file

Binary file not shown.

5
misc/3ds/readme.md Normal file
View File

@ -0,0 +1,5 @@
Commands used to generate the .bin files:
`bannertool makebanner -i banner.png -a audio.wav -o banner.bin`
`bannertool makesmdh -s ClassiCube -l ClassiCube -p UnknownShadow200 -i icon.png -o icon.bin`

View File

@ -148,7 +148,6 @@ AccessControlInfo:
- dlp:SRVR
- dsp::DSP
- frd:u
#- http:C
- fs:USER
- gsp::Gpu
- hid:USER
@ -159,7 +158,6 @@ AccessControlInfo:
- ptm:u
- pxi:dev
- soc:U
#- ssl:C
- gsp::Lcd
- y2r:u
- ldr:ro
@ -203,5 +201,4 @@ SystemControlInfo:
ptm: 0x0004013000002202L
ro: 0x0004013000003702L
socket: 0x0004013000002e02L
spi: 0x0004013000002302L
#ssl: 0x0004013000002f02
spi: 0x0004013000002302L

View File

@ -1,21 +0,0 @@
* Blocks over 256 are not saved or loaded at all.
* Custom block information for blocks over 256 is not saved or loaded at all.
* /hold 0 prevents you deleting blocks until you change to another.
* Sometimes when holding air and your own model is a block model, you crash.
* Labels and buttons overlap in launcher with some fonts. (e.g. Lucida Console)
* terrain.png with width under 16 insta-crash the game
* catbox.moe texture packs/terrain.png links insta-crash the game
* Sometimes you randomly crash reading leveldatachunk packet on OSX
* Models with size of over 2 are not supported at all
* Direct3D9 backend uses an ill-formed vertex format that works by accident
* Alt text doesn't update its Y position if you click on chat
* Menu inputs (save, edit hotkey, water level, etc) are reset on window resize
* Chat input caret is reset on window resize
* Position in chat (if you scrolled up into history) is reset on window resize
* Two blank lines get shown in chat when you type /client cuboid
* Alt text is closed on window resize
* Changing server texture packs sometimes still retains textures from previous one
* Crashes at startup when another process has exclusively acquired Direct3D9 device
* Can't bind controls to mouse buttons
* Does not work at all on 64 bit macOS
* Making a gas block undeletable doesn't prevent placing blocks over it

View File

@ -1,5 +0,0 @@
Here lies ClassicalSharp, the original C# client. (works with Mono and .NET framework 2.0)
It has unfixed bugs and missing features. There's no reason to use it anymore.
For licensing, please see license.txt inside ClassicalSharp.zip.
Absolutely no support or assistance will be provided for ClassicalSharp.

164
misc/ds/Makefile Normal file
View File

@ -0,0 +1,164 @@
# SPDX-License-Identifier: CC0-1.0
#
# SPDX-FileContributor: Antonio Niño Díaz, 2023
export BLOCKSDS ?= /opt/blocksds/core
export BLOCKSDSEXT ?= /opt/blocksds/external
NAME := ClassiCube
GAME_TITLE := ClassiCube
GAME_SUBTITLE := Built with BlocksDS
GAME_AUTHOR := UnknownShadow200
GAME_ICON := misc/ds/icon.bmp
SOURCEDIRS := src
INCLUDEDIRS :=
DEFINES := -DPLAT_NDS
LIBS := -ldswifi9 -lnds9 -lc
LIBDIRS := $(BLOCKSDS)/libs/dswifi $(BLOCKSDS)/libs/libnds
export WONDERFUL_TOOLCHAIN ?= /opt/wonderful
ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/
# DLDI and internal SD slot of DSi
# --------------------------------
# Root folder of the SD image
SDROOT := sdroot
# Name of the generated image it "DSi-1.sd" for no$gba in DSi mode
SDIMAGE := image.bin
# Build artifacts
# ---------------
BUILDDIR := build-nds
ELF := build-nds/$(NAME).elf
DUMP := build-nds/$(NAME).dump
MAP := build-nds/$(NAME).map
ROM := $(NAME).nds
# Tools
# -----
PREFIX := $(ARM_NONE_EABI_PATH)arm-none-eabi-
CC := $(PREFIX)gcc
CXX := $(PREFIX)g++
LD := $(PREFIX)gcc
OBJDUMP := $(PREFIX)objdump
MKDIR := mkdir
RM := rm -rf
# Verbose flag
# ------------
ifeq ($(VERBOSE),1)
V :=
else
V := @
endif
# Source files
# ------------
SOURCES_S := $(foreach dir,$(SOURCEDIRS),$(wildcard $(dir)/*.s))
SOURCES_C := $(foreach dir,$(SOURCEDIRS),$(wildcard $(dir)/*.c))
# Compiler and linker flags
# -------------------------
ARCH := -mthumb -mcpu=arm946e-s+nofp
SPECS := $(BLOCKSDS)/sys/crts/ds_arm9.specs
WARNFLAGS := -Wall
INCLUDEFLAGS := $(foreach path,$(INCLUDEDIRS),-I$(path)) \
$(foreach path,$(LIBDIRS),-I$(path)/include)
LIBDIRSFLAGS := $(foreach path,$(LIBDIRS),-L$(path)/lib)
ASFLAGS += -x assembler-with-cpp $(DEFINES) $(INCLUDEFLAGS) \
$(ARCH) -ffunction-sections -fdata-sections \
-specs=$(SPECS)
CFLAGS += -std=gnu17 $(WARNFLAGS) $(DEFINES) $(INCLUDEFLAGS) \
$(ARCH) -O2 -ffunction-sections -fdata-sections \
-specs=$(SPECS)
LDFLAGS := $(ARCH) $(LIBDIRSFLAGS) -Wl,-Map,$(MAP) $(DEFINES) \
-Wl,--start-group $(LIBS) -Wl,--end-group -specs=$(SPECS)
# Intermediate build files
# ------------------------
OBJS := $(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_S))) \
$(addsuffix .o,$(addprefix $(BUILDDIR)/,$(SOURCES_C)))
DEPS := $(OBJS:.o=.d)
# Targets
# -------
.PHONY: all clean dump dldipatch sdimage
all: $(ROM)
# Combine the title strings
ifeq ($(strip $(GAME_SUBTITLE)),)
GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_AUTHOR)
else
GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_SUBTITLE);$(GAME_AUTHOR)
endif
$(ROM): $(ELF)
@echo " NDSTOOL $@"
$(V)$(BLOCKSDS)/tools/ndstool/ndstool -c $@ \
-7 $(BLOCKSDS)/sys/default_arm7/arm7.elf -9 $(ELF) \
-b $(GAME_ICON) "$(GAME_FULL_TITLE)" \
$(NDSTOOL_ARGS)
$(ELF): $(OBJS)
@echo " LD $@"
$(V)$(LD) -o $@ $(OBJS) $(LDFLAGS)
$(DUMP): $(ELF)
@echo " OBJDUMP $@"
$(V)$(OBJDUMP) -h -C -S $< > $@
dump: $(DUMP)
clean:
@echo " CLEAN"
$(V)$(RM) $(ROM) $(DUMP) build $(SDIMAGE)
sdimage:
@echo " MKFATIMG $(SDIMAGE) $(SDROOT)"
$(V)$(BLOCKSDS)/tools/mkfatimg/mkfatimg -t $(SDROOT) $(SDIMAGE)
dldipatch: $(ROM)
@echo " DLDIPATCH $(ROM)"
$(V)$(BLOCKSDS)/tools/dldipatch/dldipatch patch \
$(BLOCKSDS)/sys/dldi_r4/r4tf.dldi $(ROM)
# Rules
# -----
$(BUILDDIR)/%.s.o : %.s
@echo " AS $<"
@$(MKDIR) -p $(@D)
$(V)$(CC) $(ASFLAGS) -MMD -MP -c -o $@ $<
$(BUILDDIR)/%.c.o : %.c
@echo " CC $<"
@$(MKDIR) -p $(@D)
$(V)$(CC) $(CFLAGS) -MMD -MP -c -o $@ $<
$(BUILDDIR)/%.arm.c.o : %.arm.c
@echo " CC $<"
@$(MKDIR) -p $(@D)
$(V)$(CC) $(CFLAGS) -MMD -MP -marm -mlong-calls -c -o $@ $<
# Include dependency files if they exist
# --------------------------------------
-include $(DEPS)

BIN
misc/ds/icon.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -33,7 +33,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lbba -lfat -logc -lm
LIBS := -lasnd -lbba -lfat -logc -lm
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@ -100,4 +100,4 @@ $(OUTPUT).elf: $(OFILES)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Name=ClassiCube
Exec=ClassiCubeLauncher
Comment=Sandbox building-block game
Type=Application
Icon=net.classicube.flatpak.client
Categories=Game;ActionGame;
Terminal=false
MimeType=x-scheme-handler/mc;
StartupWMClass=net.classicube.flatpak.client

View File

@ -0,0 +1,133 @@
<?xml version='1.0' encoding='utf-8'?>
<component type="desktop-application">
<id>net.classicube.flatpak.client</id>
<name>ClassiCube</name>
<summary>Sandbox building-block game</summary>
<developer id="net.classicube">
<name>The ClassiCube Project</name>
</developer>
<metadata_license>CC0-1.0</metadata_license>
<project_license>BSD-3-Clause</project_license>
<description>
<p>ClassiCube brings you back to the days of 2009 where one block game ruled them all, it includes such features as:</p>
<ul>
<li>Loads of blocks and items to choose from</li>
<li>Chatting with other players</li>
<li>An extremely simple network protocol to tinker with</li>
<li>Hundreds of creative and inventive worlds to explore online</li>
<li>A growing community</li>
<li>Hundreds of hours of entertainment</li>
</ul>
</description>
<screenshots>
<screenshot type="default">
<caption>Classic mode features faithful classic gameplay</caption>
<image type="source">https://github.com/ClassiCube/ClassiCube/assets/6509348/eedee53f-f53e-456f-b51c-92c62079eee0</image>
</screenshot>
<screenshot>
<caption>Enhanced mode allows hacks like flying and noclipping, it also allows servers to provide many custom features</caption>
<image type="source">https://github.com/ClassiCube/ClassiCube/assets/6509348/b2fe0e2b-5d76-41ab-909f-048d0ad15f37</image>
</screenshot>
</screenshots>
<releases>
<release version="1.3.6" date="2023-08-28" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.6</url>
</release>
<release version="1.3.5" date="2023-01-06" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.5</url>
</release>
<release version="1.3.4" date="2022-11-01" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.4</url>
</release>
<release version="1.3.3" date="2022-10-08" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.3</url>
</release>
<release version="1.3.2" date="2022-05-26" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.2</url>
</release>
<release version="1.3.1" date="2022-01-11" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.1</url>
</release>
<release version="1.3.0" date="2022-01-04" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.3.0</url>
</release>
<release version="1.2.9" date="2021-10-18" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.9</url>
</release>
<release version="1.2.8" date="2021-09-18" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.8</url>
</release>
<release version="1.2.7" date="2021-07-22" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.7</url>
</release>
<release version="1.2.6" date="2021-07-02" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.6</url>
</release>
<release version="1.2.5" date="2021-04-02" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.5</url>
</release>
<release version="1.2.4" date="2021-01-23" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.4</url>
</release>
<release version="1.2.3" date="2020-12-12" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.3</url>
</release>
<release version="1.2.2" date="2020-12-11" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.2</url>
</release>
<release version="1.2.1" date="2020-11-28" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.1</url>
</release>
<release version="1.2.0" date="2020-10-01" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.2.0</url>
</release>
<release version="1.1.9" date="2020-08-16" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.9</url>
</release>
<release version="1.1.8" date="2020-08-05" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.8</url>
</release>
<release version="1.1.7" date="2020-06-13" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.7</url>
</release>
<release version="1.1.6" date="2020-05-07" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.6</url>
</release>
<release version="1.1.5" date="2020-05-01" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.5</url>
</release>
<release version="1.1.4" date="2020-04-21" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.4</url>
</release>
<release version="1.1.3" date="2020-03-08" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.3</url>
</release>
<release version="1.1.2" date="2020-01-26" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.2</url>
</release>
<release version="1.1.1" date="2019-12-16" type="stable">
<url>https://github.com/ClassiCube/ClassiCube/releases/tag/1.1.1</url>
</release>
</releases>
<url type="homepage">https://www.classicube.net/</url>
<url type="bugtracker">https://github.com/ClassiCube/ClassiCube/issues</url>
<url type="donation">https://www.patreon.com/ClassiCube</url>
<url type="vcs-browser">https://github.com/ClassiCube/ClassiCube</url>
<categories>
<category>Game</category>
<category>AdventureGame</category>
<category>ActionGame</category>
</categories>
<recommends>
<control>pointing</control>
<control>keyboard</control>
</recommends>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">moderate</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
<launchable type="desktop-id">net.classicube.flatpak.client.desktop</launchable>
<provides>
<binary>ClassiCube</binary>
</provides>
</component>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="128"
height="127.99999"
viewBox="0 0 33.866667 33.866664"
version="1.1"
id="svg8"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs2" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
transform="translate(5.8338447,-13.20144)">
<g
id="g4741"
transform="matrix(0.12177585,0,0,0.12056875,-1.6325083,12.971524)">
<path
id="path4737"
d="M -5.8338447,207.40561 V 78.28894 L 106.61407,13.20144 218.79741,78.28894 V 207.40561 L 106.61407,272.4931 Z"
style="fill:#f6f6f6;stroke:#000000;stroke-width:8.0626;stroke-dasharray:none;stroke-opacity:1" />
<path
id="path179"
d="m 104.07502,141.52929 110.68965,-60.9215 1.62598,125.47985 -109.78346,61.73499 z m 20.61272,94.64566 c 8.561,-1.36503 22.58979,-6.90566 34.77207,-13.73314 8.44846,-4.73489 17.45957,-10.82064 25.81752,-17.43613 8.72093,-6.90281 17.22731,-15.21726 18.55921,-18.14047 0.26981,-0.59217 0.24879,-0.77358 -0.13391,-1.15568 -0.36305,-0.36248 -0.91552,-0.44887 -2.7589,-0.43139 -3.71393,0.0352 -9.27509,1.35366 -16.28846,3.86168 -2.01562,0.7208 -3.69686,1.27297 -3.73608,1.22704 -0.16881,-0.19764 3.44601,-29.37179 6.84564,-55.24912 1.21398,-9.24057 2.15592,-16.89033 2.09321,-16.99948 -0.19747,-0.34365 -6.05941,-0.21541 -8.74964,0.19141 -11.67357,1.7653 -26.1385,9.31897 -38.83406,20.27938 -3.00232,2.59198 -8.66363,8.37481 -10.38554,10.60847 l -1.13332,1.47013 1.06078,5.78494 c 1.66864,9.09991 3.21014,18.62874 5.55847,34.35994 1.6265,10.89577 2.70193,17.7159 2.81167,17.83099 0.23021,0.24143 9.15704,-3.22834 13.96159,-5.42672 4.01374,-1.83655 7.38001,-3.77497 13.6069,-7.83534 5.39432,-3.51748 6.57616,-4.09382 7.18285,-3.50281 1.32604,1.29178 -3.92898,6.46583 -11.75312,11.57204 -5.59387,3.65069 -11.90727,6.67998 -18.54423,8.8979 -3.61228,1.20714 -3.99351,1.40207 -6.48521,3.316 -7.13359,5.47947 -15.77323,13.5129 -18.33378,17.04736 -1.39429,1.92461 -1.60126,3.07547 -0.62376,3.46838 0.81553,0.3278 3.41645,0.32525 5.4901,-0.005 z"
style="fill:#cbcbcb;fill-opacity:1;stroke-width:0.264583" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,29 @@
id: net.classicube.flatpak.client
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: ClassiCubeLauncher
finish-args:
- --socket=x11
- --device=dri
- --share=network
- --share=ipc
- --socket=pulseaudio
modules:
- name: ClassiCube
buildsystem: simple
build-commands:
- gcc -fno-math-errno src/*.c -o src/ClassiCube -O1 -DCC_BUILD_FLATPAK -DCC_BUILD_GLMODERN -rdynamic -lm -lpthread -lX11 -lXi -lGL -ldl
- install -Dm755 src/ClassiCube -t ${FLATPAK_DEST}/bin
- install -Dm755 ClassiCubeLauncher -t ${FLATPAK_DEST}/bin
- install -Dm644 misc/linux/flatpak/net.classicube.flatpak.client.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/net.classicube.flatpak.client.svg
- install -Dm644 misc/linux/flatpak/net.classicube.flatpak.client.desktop ${FLATPAK_DEST}/share/applications/net.classicube.flatpak.client.desktop
- install -Dm644 misc/linux/flatpak/net.classicube.flatpak.client.metainfo.xml ${FLATPAK_DEST}/share/metainfo/net.classicube.flatpak.client.metainfo.xml
sources:
- type: dir
path: ../../../
- type: script
dest-filename: ClassiCubeLauncher
commands:
- mkdir -p ${XDG_DATA_HOME}/ClassiCube
- cd ${XDG_DATA_HOME}/ClassiCube && exec /app/bin/ClassiCube "$@"

View File

@ -15,7 +15,11 @@ namespace test
for (int y = 0; y < bmp.Height; y++) {
for (int x = 0; x < bmp.Width; x++) {
Color c = bmp.GetPixel(x, y);
int p = (c.B << 24) | (c.G << 16) | (c.R << 8) | c.A;
int r = c.R * c.A / 255;
int g = c.G * c.A / 255;
int b = c.B * c.A / 255;
int p = (r << 24) | (g << 16) | (b << 8) | c.A;
sw.Write("0x" + ((uint)p).ToString("X8") + ",");
}
sw.WriteLine();
@ -26,7 +30,7 @@ namespace test
public static void Main(string[] args) {
using (StreamWriter sw = new StreamWriter(dst)) {
sw.WriteLine("/* Generated using misc/mac_icon_gen.cs */");
sw.WriteLine("/* Generated using misc/macOS/mac_icon_gen.cs */");
sw.WriteLine("");
sw.WriteLine("static const unsigned int CCIcon_Data[] = {");
DumpIcon(sw, 64, 64);

58
misc/os2/Makefile Normal file
View File

@ -0,0 +1,58 @@
#--------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
#
# NO_ICON: if set to anything, do not use icon.
# NO_NACP: if set to anything, no .nacp file is generated.
# APP_TITLE is the name of the app stored in the .nacp file (Optional)
# APP_AUTHOR is the author of the app stored in the .nacp file (Optional)
# APP_VERSION is the version of the app stored in the .nacp file (Optional)
# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional)
# ICON is the filename of the icon (.jpg), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.jpg
# - icon.jpg
# - <libnx folder>/default_icon.jpg
#
# CONFIG_JSON is the filename of the NPDM config file (.json), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.json
# - config.json
# If a JSON file is provided or autodetected, an ExeFS PFS0 (.nsp) is built instead
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
TARGET := ClassiCube
BUILD_DIR := build
SOURCE_DIR:= src
DATA := data
C_SOURCES := $(wildcard $(SOURCE_DIR)/*.c)
C_OBJECTS := $(patsubst $(SOURCE_DIR)/%.c, $(BUILD_DIR)/%.o, $(C_SOURCES))
OBJECTS := $(C_OBJECTS) $(BUILD_DIR)/$(TARGET).res misc/os2/classicube.def
ENAME = ClassiCube
DEL = rm -f
APP_TITLE := ClassiCube
APP_AUTHOR := UnknownShadow200
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
CC := gcc
CFLAGS := -pipe -fno-math-errno -O3 -g -mtune=pentium4 -msse2 -march=i686 -idirafter /@unixroot/usr/include/os2tk45 -DOS2
LDFLAGS := -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp -Zlinker DISABLE -Zlinker 1121
LIBS := -lcx -lmmpm2 -lpthread -lSDL2
$(TARGET).exe: $(BUILD_DIR) $(OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBS)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(C_OBJECTS): $(BUILD_DIR)/%.o : $(SOURCE_DIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(BUILD_DIR)/$(TARGET).res: misc/os2/$(TARGET).rc misc/os2/$(TARGET).ico
wrc -r misc/os2/$(TARGET).rc -fo=$@

BIN
misc/os2/classicube.ICO Normal file

Binary file not shown.

21
misc/ps1/CMakeLists.txt Normal file
View File

@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.21)
project(
ClassiCube
LANGUAGES C ASM
VERSION 1.0.0
DESCRIPTION "ClassiCube PS1 port"
HOMEPAGE_URL "https://classicube.net"
)
add_definitions(-DPLAT_PS1)
file(GLOB _sources ../../src/*.c)
psn00bsdk_add_executable(template GPREL ${_sources})
psn00bsdk_add_cd_image(
iso # Target name
template # Output file name (= template.bin + template.cue)
iso.xml # Path to config file
DEPENDS template system.cnf
)

View File

@ -0,0 +1,26 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"displayName": "Default configuration",
"description": "Use this preset to build the project using PSn00bSDK.",
"generator": "Ninja",
"toolchainFile": "$env{PSN00BSDK_LIBS}/cmake/sdk.cmake",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"PSN00BSDK_TC": "",
"PSN00BSDK_TARGET": "mipsel-none-elf"
},
"warnings": {
"dev": false
}
}
]
}

BIN
misc/ps1/classicube.zip Normal file

Binary file not shown.

2142
misc/ps1/classicubezip.h Normal file

File diff suppressed because it is too large Load Diff

86
misc/ps1/iso.xml Normal file
View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is processed by CMake and used by mkpsxiso to build the CD image.
NOTE: all paths are relative to the build directory; if you want to include
a file from the source tree, you'll have to prepend its path with
${PROJECT_SOURCE_DIR}.
-->
<iso_project>
<track type="data">
<!--
The "volume", "volume_set", "publisher", "data_preparer" and
"copyright" strings below can be freely modified. The ISO9660
specification, however, imposes the following limitations:
- "volume" and "volume_set" must be 32 characters or less, and can
only contain uppercase letters, digits and underscores.
- "publisher" and "data_preparer" can be up to 128 characters long
and can additionally contain spaces and some special characters.
- "copyright" should be a path to a file on the disc, even one that
does not exist (but in practice it can be set to anything).
"system" and "application" must always be set to "PLAYSTATION" in
order for the disc to be recognized as valid.
-->
<identifiers
system ="PLAYSTATION"
volume ="PSN00BSDK_TEMPLATE"
volume_set ="PSN00BSDK_TEMPLATE"
publisher ="MEIDOTEK"
data_preparer ="PSN00BSDK ${PSN00BSDK_VERSION}"
application ="PLAYSTATION"
copyright ="README.TXT;1"
/>
<!--
You may optionally include a license file using the <license> tag.
Some consoles, particularly Japanese or PAL models with a modchip,
require the disc to contain valid license data and will refuse to
boot if it is missing. License files are usually not required on
US consoles or when booting via softmods or cheat cartridges.
License files are region-specific and are not distributed with
PSn00bSDK for obvious reasons, but can be dumped from an official
game using dumpsxiso or extracted from the Sony SDK.
-->
<!--<license file="${PROJECT_SOURCE_DIR}/license.dat" />-->
<!--
Files and directories can be added to the disc by placing <file>
and <dir> tags below. All file names are case-insensitive and must
be in 8.3 format, i.e. no more than 8 characters for the name and 3
for the optional extension. Directories cannot have extensions.
A boot configuration file (SYSTEM.CNF) or executable (PSX.EXE) must
be present in the root directory. Due to BIOS limitations the root
directory cannot hold more than 30 files or directories, and the
entire disc must contain 45 directories or less. Subdirectories can
contain any number of files.
-->
<directory_tree>
<file name="SYSTEM.CNF" type="data" source="${PROJECT_SOURCE_DIR}/system.cnf" />
<file name="TEMPLATE.EXE" type="data" source="template.exe" />
<!--
This file is only required if you are using dynamic linking
(see the system/dynlink example). It contains the executable's
symbol map and can be used to obtain the address of a function
or global variable by its name.
-->
<!--<file name="TEMPLATE.MAP" type="data" source="template.map" />-->
<dir name="texpacks">
<file name="default.zip" type="data" source="../classicube.zip" />
</dir>
<dummy sectors="1024"/>
</directory_tree>
</track>
<!--
CD-DA tracks can be added to the CD image by using one or more <track>
tags. The source attribute must be a path to an audio file in WAV, FLAC
or MP3 format (using WAV or FLAC is highly recommended to preserve
audio quality if you have a lossless copy of the source track).
-->
<!--<track type="audio" source="${PROJECT_SOURCE_DIR}/track2.wav" />-->
</iso_project>

4
misc/ps1/system.cnf Normal file
View File

@ -0,0 +1,4 @@
BOOT=cdrom:\template.exe;1
TCB=4
EVENT=10
STACK=801FFFF0

View File

@ -35,7 +35,7 @@ ICON0 := ../misc/ps3/ICON0.png
CFLAGS = -O2 -DPLAT_PS3 -Wall -mcpu=cell -fno-math-errno $(MACHDEP) $(INCLUDE)
CXXFLAGS = $(CFLAGS)
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map
LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map -fno-use-linker-plugin
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
@ -141,4 +141,4 @@ $(OUTPUT).elf: $(OFILES)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------

28
misc/saturn/Makefile Normal file
View File

@ -0,0 +1,28 @@
ifeq ($(strip $(YAUL_INSTALL_ROOT)),)
$(error Undefined YAUL_INSTALL_ROOT (install root directory))
endif
SH_BUILD_DIR := build-saturn
include $(YAUL_INSTALL_ROOT)/share/build.pre.mk
# Each asset follows the format: <path>;<symbol>. Duplicates are removed
BUILTIN_ASSETS=
SH_PROGRAM := ClassiCube-saturn
SH_SRCS := $(wildcard src/*.c)
SH_CFLAGS+= -Os -I. -DPLAT_SATURN
SH_LDFLAGS+=
IP_VERSION:= V1.000
IP_RELEASE_DATE:= 20160101
IP_AREAS:= JTUBKAEL
IP_PERIPHERALS:= JAMKST
IP_TITLE:= VDP1 drawing
IP_MASTER_STACK_ADDR:= 0x06004000
IP_SLAVE_STACK_ADDR:= 0x06001E00
IP_1ST_READ_ADDR:= 0x06004000
IP_1ST_READ_SIZE:= 0
include $(YAUL_INSTALL_ROOT)/share/build.post.iso-cue.mk

226
misc/switch/Makefile Normal file
View File

@ -0,0 +1,226 @@
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
# ROMFS is the directory containing data to be added to RomFS, relative to the Makefile (Optional)
#
# NO_ICON: if set to anything, do not use icon.
# NO_NACP: if set to anything, no .nacp file is generated.
# APP_TITLE is the name of the app stored in the .nacp file (Optional)
# APP_AUTHOR is the author of the app stored in the .nacp file (Optional)
# APP_VERSION is the version of the app stored in the .nacp file (Optional)
# APP_TITLEID is the titleID of the app stored in the .nacp file (Optional)
# ICON is the filename of the icon (.jpg), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.jpg
# - icon.jpg
# - <libnx folder>/default_icon.jpg
#
# CONFIG_JSON is the filename of the NPDM config file (.json), relative to the project folder.
# If not set, it attempts to use one of the following (in this order):
# - <Project name>.json
# - config.json
# If a JSON file is provided or autodetected, an ExeFS PFS0 (.nsp) is built instead
# of a homebrew executable (.nro). This is intended to be used for sysmodules.
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
TARGET := ClassiCube-switch
BUILD := build-switch
SOURCES := src misc/switch third_party/bearssl/src
DATA := data
INCLUDES := third_party/bearssl/inc
#ROMFS := romfs
APP_TITLE := ClassiCube
APP_AUTHOR := UnknownShadow200
ICON := misc/switch/icon.jpg
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
CFLAGS := -g -Wall -O2 -ffunction-sections \
$(ARCH) $(DEFINES)
CFLAGS += $(INCLUDE) -D__SWITCH__
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LIBS := -lGLESv2 -lEGL -lglapi -ldrm_nouveau -lnx -lm
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(LIBNX)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
ifeq ($(strip $(CONFIG_JSON)),)
jsons := $(wildcard *.json)
ifneq (,$(findstring $(TARGET).json,$(jsons)))
export APP_JSON := $(TOPDIR)/$(TARGET).json
else
ifneq (,$(findstring config.json,$(jsons)))
export APP_JSON := $(TOPDIR)/config.json
endif
endif
else
export APP_JSON := $(TOPDIR)/$(CONFIG_JSON)
endif
ifeq ($(strip $(ICON)),)
icons := $(wildcard *.jpg)
ifneq (,$(findstring $(TARGET).jpg,$(icons)))
export APP_ICON := $(TOPDIR)/$(TARGET).jpg
else
ifneq (,$(findstring icon.jpg,$(icons)))
export APP_ICON := $(TOPDIR)/icon.jpg
endif
endif
else
export APP_ICON := $(TOPDIR)/$(ICON)
endif
ifeq ($(strip $(NO_ICON)),)
export NROFLAGS += --icon=$(APP_ICON)
endif
ifeq ($(strip $(NO_NACP)),)
export NROFLAGS += --nacp=$(CURDIR)/$(TARGET).nacp
endif
ifneq ($(APP_TITLEID),)
export NACPFLAGS += --titleid=$(APP_TITLEID)
endif
ifneq ($(ROMFS),)
export NROFLAGS += --romfsdir=$(CURDIR)/$(ROMFS)
endif
.PHONY: $(BUILD) clean all
#---------------------------------------------------------------------------------
all: $(BUILD)
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/misc/switch/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
ifeq ($(strip $(APP_JSON)),)
@rm -fr $(BUILD) $(TARGET).nro $(TARGET).nacp $(TARGET).elf
else
@rm -fr $(BUILD) $(TARGET).nsp $(TARGET).nso $(TARGET).npdm $(TARGET).elf
endif
#---------------------------------------------------------------------------------
else
.PHONY: all
DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
ifeq ($(strip $(APP_JSON)),)
all : $(OUTPUT).nro
ifeq ($(strip $(NO_NACP)),)
$(OUTPUT).nro : $(OUTPUT).elf $(OUTPUT).nacp
else
$(OUTPUT).nro : $(OUTPUT).elf
endif
else
all : $(OUTPUT).nsp
$(OUTPUT).nsp : $(OUTPUT).nso $(OUTPUT).npdm
$(OUTPUT).nso : $(OUTPUT).elf
endif
$(OUTPUT).elf : $(OFILES)
$(OFILES_SRC) : $(HFILES_BIN)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPENDS)
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

BIN
misc/switch/icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -33,7 +33,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lwiikeyboard -lwiiuse -lbte -lfat -logc -lm
LIBS := -lasnd -lwiikeyboard -lwiiuse -lbte -lfat -logc -lm
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
@ -100,4 +100,4 @@ $(OUTPUT).elf: $(OFILES)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------

174
misc/wiiu/Makefile Normal file
View File

@ -0,0 +1,174 @@
#-------------------------------------------------------------------------------
.SUFFIXES:
#-------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>/devkitpro")
endif
TOPDIR ?= $(CURDIR)
#-------------------------------------------------------------------------------
# APP_NAME sets the long name of the application
# APP_SHORTNAME sets the short name of the application
# APP_AUTHOR sets the author of the application
#-------------------------------------------------------------------------------
#APP_NAME := Application Name
#APP_SHORTNAME := App Name
#APP_AUTHOR := Built with devkitPPC & wut
include $(DEVKITPRO)/wut/share/wut_rules
#-------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# DATA is a list of directories containing data files
# INCLUDES is a list of directories containing header files
# CONTENT is the path to the bundled folder that will be mounted as /vol/content/
# ICON is the game icon, leave blank to use default rule
# TV_SPLASH is the image displayed during bootup on the TV, leave blank to use default rule
# DRC_SPLASH is the image displayed during bootup on the DRC, leave blank to use default rule
#-------------------------------------------------------------------------------
TARGET := ClassiCube-wiiu
BUILD := build-wiiu
SOURCES := src third_party/bearssl/src
SHADERS := misc/wiiu
DATA := data
INCLUDES := third_party/bearssl/inc
CONTENT :=
ICON :=
TV_SPLASH :=
DRC_SPLASH :=
#-------------------------------------------------------------------------------
# options for code generation
#-------------------------------------------------------------------------------
CFLAGS := -g -Wall -O2 -ffunction-sections -fno-math-errno \
$(MACHDEP)
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
CXXFLAGS := $(CFLAGS)
ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
LIBS := -lwut -lm
#-------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level
# containing include and lib
#-------------------------------------------------------------------------------
LIBDIRS := $(PORTLIBS) $(WUT_ROOT)
#-------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#-------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#-------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export TOPDIR := $(CURDIR)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) \
$(foreach dir,$(SHADERS),$(notdir $(wildcard $(dir)/*.gsh)))
export LD := $(CXX)
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
ifneq (,$(strip $(CONTENT)))
export APP_CONTENT := $(TOPDIR)/$(CONTENT)
endif
ifneq (,$(strip $(ICON)))
export APP_ICON := $(TOPDIR)/$(ICON)
else ifneq (,$(wildcard $(TOPDIR)/$(TARGET).png))
export APP_ICON := $(TOPDIR)/$(TARGET).png
else ifneq (,$(wildcard $(TOPDIR)/icon.png))
export APP_ICON := $(TOPDIR)/icon.png
endif
ifneq (,$(strip $(TV_SPLASH)))
export APP_TV_SPLASH := $(TOPDIR)/$(TV_SPLASH)
else ifneq (,$(wildcard $(TOPDIR)/tv-splash.png))
export APP_TV_SPLASH := $(TOPDIR)/tv-splash.png
else ifneq (,$(wildcard $(TOPDIR)/splash.png))
export APP_TV_SPLASH := $(TOPDIR)/splash.png
endif
ifneq (,$(strip $(DRC_SPLASH)))
export APP_DRC_SPLASH := $(TOPDIR)/$(DRC_SPLASH)
else ifneq (,$(wildcard $(TOPDIR)/drc-splash.png))
export APP_DRC_SPLASH := $(TOPDIR)/drc-splash.png
else ifneq (,$(wildcard $(TOPDIR)/splash.png))
export APP_DRC_SPLASH := $(TOPDIR)/splash.png
endif
.PHONY: $(BUILD) clean all
#-------------------------------------------------------------------------------
all: $(BUILD)
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/misc/wiiu/Makefile
#-------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).wuhb $(TARGET).rpx $(TARGET).elf
#-------------------------------------------------------------------------------
else
.PHONY: all
DEPENDS := $(OFILES:.o=.d)
#-------------------------------------------------------------------------------
# main targets
#-------------------------------------------------------------------------------
all : $(OUTPUT).wuhb
$(OUTPUT).wuhb : $(OUTPUT).rpx
$(OUTPUT).rpx : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
$(OFILES_SRC) : $(HFILES_BIN)
# you need a rule like this for each extension you use as binary data
#-------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#-------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
#-------------------------------------------------------------------------------
%.gsh.o %_gsh.h : ../misc/wiiu/%.gsh
#-------------------------------------------------------------------------------
echo $(notdir $<)
$(bin2o)
-include $(DEPENDS)
#-------------------------------------------------------------------------------
endif
#-------------------------------------------------------------------------------

BIN
misc/wiiu/coloured.gsh Normal file

Binary file not shown.

8
misc/wiiu/coloured.psh Normal file
View File

@ -0,0 +1,8 @@
; $NUM_SPI_PS_INPUT_CNTL = 1
; $SPI_PS_INPUT_CNTL[0].SEMANTIC = 0
; $SPI_PS_INPUT_CNTL[0].DEFAULT_VAL = 1
; $SQ_PGM_RESOURCES_PS.STACK_SIZE = 0
; -------- Disassembly --------------------
00 EXP_DONE: PIX0, R0
END_OF_PROGRAM

View File

@ -0,0 +1,6 @@
varying vec4 out_col;
void main() {
vec4 col = out_col;
gl_FragColor = col;
}

46
misc/wiiu/coloured.vsh Normal file
View File

@ -0,0 +1,46 @@
; $MODE = "UniformRegister"
; $SPI_VS_OUT_CONFIG.VS_EXPORT_COUNT = 0
; $NUM_SPI_VS_OUT_ID = 1
; out_colour
; $SPI_VS_OUT_ID[0].SEMANTIC_0 = 0
; C0
; $UNIFORM_VARS[0].name = "mvp"
; $UNIFORM_VARS[0].type = "mat4"
; $UNIFORM_VARS[0].count = 1
; $UNIFORM_VARS[0].block = -1
; $UNIFORM_VARS[0].offset = 0
; R1
; $ATTRIB_VARS[0].name = "in_pos"
; $ATTRIB_VARS[0].type = "vec3"
; $ATTRIB_VARS[0].location = 0
; R2
; $ATTRIB_VARS[1].name = "in_col"
; $ATTRIB_VARS[1].type = "vec4"
; $ATTRIB_VARS[1].location = 1
; -------- Disassembly --------------------
00 CALL_FS NO_BARRIER
01 ALU: ADDR(32) CNT(18)
0 x: MUL ____, C3.w, 1.0f
y: MUL ____, C3.z, 1.0f
z: MUL ____, C3.y, 1.0f
w: MUL ____, C3.x, 1.0f
1 x: MULADD R127.x, R1.z, C2.w, PV0.x
y: MULADD R127.y, R1.z, C2.z, PV0.y
z: MULADD R127.z, R1.z, C2.y, PV0.z
w: MULADD R127.w, R1.z, C2.x, PV0.w
2 x: MULADD R127.x, R1.y, C1.w, PV1.x
y: MULADD R127.y, R1.y, C1.z, PV1.y
z: MULADD R127.z, R1.y, C1.y, PV1.z
w: MULADD R127.w, R1.y, C1.x, PV1.w
3 x: MULADD R1.x, R1.x, C0.x, PV2.w
y: MULADD R1.y, R1.x, C0.y, PV2.z
z: MULADD R1.z, R1.x, C0.z, PV2.y
w: MULADD R1.w, R1.x, C0.w, PV2.x
02 EXP_DONE: POS0, R1
03 EXP_DONE: PARAM0, R2 NO_BARRIER
END_OF_PROGRAM

View File

@ -0,0 +1,9 @@
attribute vec3 in_pos;
attribute vec4 in_col;
varying vec4 out_col;
uniform mat4 mvp;
void main() {
gl_Position = mvp * vec4(in_pos, 1.0);
out_col = in_col;
}

14
misc/wiiu/shaders.txt Normal file
View File

@ -0,0 +1,14 @@
Shader samples
https://github.com/decaf-emu/wiiu-tests/blob/master/content/shaders/pos_colour.vsh
https://github.com/GaryOderNichts/wiiu-shaders/blob/master/shaders.md
https://github.com/luRaichu/recsbr/blob/163fa441712f6b25e780e914617941c2385b330e/src/Backends/Rendering/WiiUShaders/shader%20sources/plain.vsh#L6
https://github.com/GaryOderNichts/MultiDRCSpaceDemo/blob/30a6337a47dabafd6d601ce0555b326866f63247/shaders/textureShader.vsh#L6
https://github.com/luRaichu/recsbr/blob/163fa441712f6b25e780e914617941c2385b330e/src/Backends/Rendering/WiiUShaders/shader%20sources/texture.vsh#L9
https://github.com/rw-r-r-0644/gx2-texture/blob/83d7707e8d4b33ec7ba63d5c7dfe62c359b2b50a/shaders/texture_shader.vsh#L9
https://github.com/yawut/ntrview-wiiu/blob/45b1c7f05cfd9917b8b171f3db08dc63293fc5c5/gfx/gx2_shaders/main.psh
https://github.com/Hydr8gon/NooDS/blob/b41cb3b9b889481c998e7e83db1ab3ef9d97b838/src/console/shaders/shader_wiiu.vsh
https://github.com/luRaichu/recsbr/blob/163fa441712f6b25e780e914617941c2385b330e/src/Backends/Rendering/WiiUShaders/shader%20sources/wtf%20is%20this.txt
To generate shader assembly
1) Get AMD ShaderAnalyzer
2) Select Radeon HD 4670 (RV370) Assembly as the output format

BIN
misc/wiiu/textured.gsh Normal file

Binary file not shown.

21
misc/wiiu/textured.psh Normal file
View File

@ -0,0 +1,21 @@
; $MODE = "UniformRegister"
; $SAMPLER_VARS[0].name= "texImage"
; $SAMPLER_VARS[0].type= "sampler2D"
; $SAMPLER_VARS[0].location = 0
; $NUM_SPI_PS_INPUT_CNTL = 2
; $SPI_PS_INPUT_CNTL[0].semantic = 0
; $SPI_PS_INPUT_CNTL[0].default_val = 1
; $SPI_PS_INPUT_CNTL[1].semantic = 1
; $SPI_PS_INPUT_CNTL[1].default_val = 1
; -------- Disassembly --------------------
00 TEX: ADDR(48) CNT(1) VALID_PIX
0 SAMPLE R1, R1.xy0x, t0, s0
01 ALU: ADDR(32) CNT(4)
1 x: MUL R0.x, R0.x, R1.x
y: MUL R0.y, R0.y, R1.y
z: MUL R0.z, R0.z, R1.z
w: MUL R0.w, R0.w, R1.w
02 EXP_DONE: PIX0, R0
END_OF_PROGRAM

View File

@ -0,0 +1,9 @@
varying vec4 out_col;
varying vec2 out_uv;
uniform sampler2D texImage;
void main() {
vec4 col = texture(texImage, out_uv) * out_col;
gl_FragColor = col;
}

55
misc/wiiu/textured.vsh Normal file
View File

@ -0,0 +1,55 @@
; $MODE = "UniformRegister"
; $SPI_VS_OUT_CONFIG.VS_EXPORT_COUNT = 1
; $NUM_SPI_VS_OUT_ID = 1
; out_colour
; $SPI_VS_OUT_ID[0].SEMANTIC_0 = 0
; out_uv
; $SPI_VS_OUT_ID[0].SEMANTIC_1 = 1
; C0
; $UNIFORM_VARS[0].name = "mvp"
; $UNIFORM_VARS[0].type = "mat4"
; $UNIFORM_VARS[0].count = 1
; $UNIFORM_VARS[0].block = -1
; $UNIFORM_VARS[0].offset = 0
; R1
; $ATTRIB_VARS[0].name = "in_pos"
; $ATTRIB_VARS[0].type = "vec3"
; $ATTRIB_VARS[0].location = 0
; R2
; $ATTRIB_VARS[1].name = "in_col"
; $ATTRIB_VARS[1].type = "vec4"
; $ATTRIB_VARS[1].location = 1
; R3
; $ATTRIB_VARS[2].name = "in_uv"
; $ATTRIB_VARS[2].type = "vec2"
; $ATTRIB_VARS[2].location = 2
; -------- Disassembly --------------------
00 CALL_FS NO_BARRIER
01 ALU: ADDR(32) CNT(20)
0 x: MUL ____, C3.y, 1.0f
y: MUL ____, C3.x, 1.0f
z: MUL ____, C3.w, 1.0f
w: MUL ____, C3.z, 1.0f
t: MOV R0.x, R3.x
1 x: MULADD R127.x, R1.z, C2.y, PV0.x
y: MULADD R127.y, R1.z, C2.x, PV0.y
z: MULADD R127.z, R1.z, C2.w, PV0.z
w: MULADD R127.w, R1.z, C2.z, PV0.w
t: MOV R0.y, R3.y
2 x: MULADD R127.x, R1.y, C1.y, PV1.x
y: MULADD R127.y, R1.y, C1.x, PV1.y
z: MULADD R127.z, R1.y, C1.w, PV1.z
w: MULADD R127.w, R1.y, C1.z, PV1.w
3 x: MULADD R1.x, R1.x, C0.x, PV2.y
y: MULADD R1.y, R1.x, C0.y, PV2.x
z: MULADD R1.z, R1.x, C0.z, PV2.w
w: MULADD R1.w, R1.x, C0.w, PV2.z
02 EXP_DONE: POS0, R1
03 EXP: PARAM0, R2 NO_BARRIER
04 EXP_DONE: PARAM1, R0.xyzz NO_BARRIER
END_OF_PROGRAM

View File

@ -0,0 +1,12 @@
attribute vec3 in_pos;
attribute vec4 in_col;
attribute vec2 in_uv;
varying vec4 out_col;
varying vec2 out_uv;
uniform mat4 mvp;
void main() {
gl_Position = mvp * vec4(in_pos, 1.0);
out_col = in_col;
out_uv = in_uv;
}

View File

@ -0,0 +1,64 @@
; $MODE = "UniformRegister"
; $SPI_VS_OUT_CONFIG.VS_EXPORT_COUNT = 1
; $NUM_SPI_VS_OUT_ID = 1
; out_colour
; $SPI_VS_OUT_ID[0].SEMANTIC_0 = 0
; out_uv
; $SPI_VS_OUT_ID[0].SEMANTIC_1 = 1
; C0
; $UNIFORM_VARS[0].name = "mvp"
; $UNIFORM_VARS[0].type = "mat4"
; $UNIFORM_VARS[0].count = 1
; $UNIFORM_VARS[0].block = -1
; $UNIFORM_VARS[0].offset = 0
; C4 (MIGHT BE WRONG AND SHOULD BE [3] instead??? )
; $UNIFORM_VARS[1].name = "texOffset"
; $UNIFORM_VARS[1].type = "vec2"
; $UNIFORM_VARS[1].count = 1
; $UNIFORM_VARS[1].block = -1
; $UNIFORM_VARS[1].offset = 0
; R1
; $ATTRIB_VARS[0].name = "in_pos"
; $ATTRIB_VARS[0].type = "vec3"
; $ATTRIB_VARS[0].location = 0
; R2
; $ATTRIB_VARS[1].name = "in_col"
; $ATTRIB_VARS[1].type = "vec4"
; $ATTRIB_VARS[1].location = 1
; R3
; $ATTRIB_VARS[2].name = "in_uv"
; $ATTRIB_VARS[2].type = "vec2"
; $ATTRIB_VARS[2].location = 2
; -------- Disassembly --------------------
00 CALL_FS NO_BARRIER
01 ALU: ADDR(32) CNT(18)
0 x: MUL ____, C3.y, 1.0f
y: MUL ____, C3.x, 1.0f
z: MUL ____, C3.w, 1.0f
w: MUL ____, C3.z, 1.0f
1 x: MULADD R127.x, R2.z, C2.y, PV0.x
y: MULADD R127.y, R2.z, C2.x, PV0.y
z: MULADD R127.z, R2.z, C2.w, PV0.z
w: MULADD R127.w, R2.z, C2.z, PV0.w
2 x: MULADD R127.x, R2.y, C1.y, PV1.x
y: MULADD R127.y, R2.y, C1.x, PV1.y
z: MULADD R127.z, R2.y, C1.w, PV1.z
w: MULADD R127.w, R2.y, C1.z, PV1.w
3 x: MULADD R2.x, R2.x, C0.x, PV2.y
y: MULADD R2.y, R2.x, C0.y, PV2.x
z: MULADD R2.z, R2.x, C0.z, PV2.w
w: MULADD R2.w, R2.x, C0.w, PV2.z
4 x: ADD R3.x, R3.x, C4.x
y: ADD R3.y, R3.y, C4.y
02 EXP_DONE: POS0, R2
03 EXP: PARAM0, R1 NO_BARRIER
04 EXP_DONE: PARAM1, R3.xyzz NO_BARRIER
05 ALU: ADDR(50) CNT(1)
5 x: NOP ____
06 NOP NO_BARRIER
END_OF_PROGRAM

View File

@ -0,0 +1,13 @@
attribute vec3 in_pos;
attribute vec4 in_col;
attribute vec2 in_uv;
varying vec4 out_col;
varying vec2 out_uv;
uniform mat4 mvp;
uniform vec2 texOffset;
void main() {
gl_Position = mvp * vec4(in_pos, 1.0);
out_col = in_col;
out_uv = in_uv + texOffset;
}

View File

@ -8,6 +8,6 @@ SRCS = $(wildcard src/*.c) $(wildcard third_party/bearssl/src/*.c)
SHADER_OBJS = misc/xbox/vs_coloured.inl misc/xbox/vs_textured.inl misc/xbox/ps_coloured.inl misc/xbox/ps_textured.inl
NXDK_NET = y
NXDK_CFLAGS = -Ithird_party/bearssl/inc -O1
NXDK_LDFLAGS = -stack:131072
NXDK_LDFLAGS = -stack:196608
include $(NXDK_DIR)/Makefile

View File

@ -11,7 +11,8 @@ struct vOut {
vOut main(
vIn input,
uniform float4x4 mvp,
uniform float4 half_viewport
uniform float4 vp_scale,
uniform float4 vp_offset
)
{
vOut result;
@ -21,9 +22,9 @@ vOut main(
position = mul(position, mvp);
position.xyz = position.xyz / position.w;
position.x = position.x * half_viewport.x + half_viewport.x;
position.y = -position.y * half_viewport.y + half_viewport.y;
position.z = position.z * half_viewport.z + half_viewport.z;
position.x = position.x * vp_scale.x + vp_offset.x;
position.y = position.y * vp_scale.y + vp_offset.y;
position.z = position.z * vp_scale.z + vp_offset.z;
//position.w = 1.0 / half_viewport.w;
result.pos = position;

View File

@ -13,7 +13,8 @@ struct vOut {
vOut main(
vIn input,
uniform float4x4 mvp,
uniform float4 half_viewport
uniform float4 vp_scale,
uniform float4 vp_offset
)
{
vOut result;
@ -23,9 +24,9 @@ vOut main(
position = mul(position, mvp);
position.xyz = position.xyz / position.w;
position.x = position.x * half_viewport.x + half_viewport.x;
position.y = -position.y * half_viewport.y + half_viewport.y;
position.z = position.z * half_viewport.z + half_viewport.z;
position.x = position.x * vp_scale.x + vp_offset.x;
position.y = position.y * vp_scale.y + vp_offset.y;
position.z = position.z * vp_scale.z + vp_offset.z;
//position.w = 1.0 / half_viewport.w;
result.pos = position;

Binary file not shown.

View File

@ -0,0 +1,19 @@
const char ps_coloured[160] = {
0x10, 0x2a, 0x11, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00,
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1c,
0x00, 0x00, 0x00, 0x23, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1c, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x32, 0x2e,
0x30, 0x2e, 0x34, 0x33, 0x31, 0x34, 0x2e, 0x30, 0x00, 0xab, 0xab,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0xf0, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0xc4, 0x00,
0x22, 0x00, 0x00, 0x00, 0xc8, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const int ps_coloured_length = 160;

View File

@ -0,0 +1,7 @@
struct INPUT_VERTEX {
float4 col : COLOR0;
};
float4 main(INPUT_VERTEX input) : COLOR0 {
return input.col;
}

Binary file not shown.

View File

@ -0,0 +1,25 @@
const char ps_textured[228] = {
0x10, 0x2a, 0x11, 0x00, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00,
0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x1c,
0x00, 0x00, 0x00, 0x4b, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x44, 0x00, 0x00, 0x00, 0x30, 0x00, 0x03, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00,
0x73, 0x00, 0xab, 0xab, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x01, 0x00,
0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x73,
0x5f, 0x33, 0x5f, 0x30, 0x00, 0x32, 0x2e, 0x30, 0x2e, 0x34, 0x33,
0x31, 0x34, 0x2e, 0x30, 0x00, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3c, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x42, 0x00, 0x01,
0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x30, 0x50, 0x00,
0x00, 0xf1, 0xa0, 0x00, 0x01, 0x10, 0x02, 0x00, 0x00, 0x12, 0x00,
0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x22,
0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, 0x01, 0x1f, 0x1f,
0xf6, 0x88, 0x00, 0x00, 0x40, 0x00, 0xc8, 0x0f, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0xc1, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const int ps_textured_length = 228;

View File

@ -0,0 +1,10 @@
sampler s;
struct INPUT_VERTEX {
float4 col : COLOR0;
float2 uv : TEXCOORD0;
};
float4 main(INPUT_VERTEX input) : COLOR0 {
return tex2D(s, input.uv) * input.col;
}

Binary file not shown.

View File

@ -0,0 +1,34 @@
const char vs_coloured[324] = {
0x10, 0x2a, 0x11, 0x01, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1c,
0x00, 0x00, 0x00, 0x53, 0xff, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x6d, 0x76, 0x70, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x00, 0xab,
0xab, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f,
0x30, 0x00, 0x32, 0x2e, 0x30, 0x2e, 0x34, 0x33, 0x31, 0x34, 0x2e,
0x30, 0x00, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x84, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x21, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x02, 0x90,
0x00, 0x10, 0x00, 0x03, 0x00, 0x30, 0xa0, 0x04, 0x00, 0x00, 0xf0,
0x50, 0x00, 0x00, 0x10, 0x09, 0x30, 0x05, 0x20, 0x03, 0x00, 0x00,
0x12, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x00,
0x00, 0x12, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x09,
0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xf8, 0x20,
0x00, 0x00, 0x00, 0x0e, 0x88, 0x00, 0x00, 0x00, 0x00, 0x05, 0xf8,
0x00, 0x00, 0x00, 0x00, 0x06, 0x88, 0x00, 0x00, 0x00, 0x00, 0xc8,
0x0f, 0x00, 0x01, 0x00, 0xb1, 0x77, 0x00, 0x81, 0x02, 0x01, 0x00,
0xc8, 0x0f, 0x00, 0x01, 0x00, 0x6c, 0x94, 0xe3, 0xab, 0x02, 0x00,
0x01, 0xc8, 0x0f, 0x00, 0x01, 0x00, 0xc6, 0x25, 0xe3, 0xab, 0x02,
0x02, 0x01, 0xc8, 0x0f, 0x80, 0x3e, 0x00, 0x3e, 0x00, 0x00, 0x80,
0x01, 0x03, 0x00, 0xc8, 0x0f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00
};
const int vs_coloured_length = 324;

View File

@ -0,0 +1,20 @@
struct INPUT_VERTEX
{
float3 pos : POSITION;
float4 col : COLOR0;
};
struct OUTPUT_VERTEX
{
float4 pos : POSITION;
float4 col : TEXCOORD0;
};
float4x4 mvpMatrix: register(c0);
OUTPUT_VERTEX main(INPUT_VERTEX input) {
OUTPUT_VERTEX output;
output.pos = mul(mvpMatrix, float4(input.pos, 1.0f));
output.col = input.col;
return output;
}

Binary file not shown.

View File

@ -0,0 +1,37 @@
const char vs_textured[360] = {
0x10, 0x2a, 0x11, 0x01, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00,
0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x1c,
0x00, 0x00, 0x00, 0x53, 0xff, 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x4c, 0x00, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x6d, 0x76, 0x70, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x00, 0xab,
0xab, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f,
0x30, 0x00, 0x32, 0x2e, 0x30, 0x2e, 0x34, 0x33, 0x31, 0x34, 0x2e,
0x30, 0x00, 0xab, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x9c, 0x00, 0x11, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x18, 0x42, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x90,
0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x30, 0x50,
0x05, 0x00, 0x00, 0x30, 0x50, 0x00, 0x01, 0xf1, 0xa0, 0x00, 0x00,
0x10, 0x0a, 0x00, 0x00, 0x10, 0x0b, 0x70, 0x15, 0x30, 0x03, 0x00,
0x00, 0x12, 0x00, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x06,
0x00, 0x00, 0x12, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
0x0a, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xf8,
0x30, 0x00, 0x00, 0x00, 0x0e, 0x88, 0x00, 0x00, 0x00, 0x00, 0x05,
0xf8, 0x10, 0x00, 0x00, 0x00, 0x06, 0x88, 0x00, 0x00, 0x00, 0x00,
0x05, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x00,
0x00, 0xc8, 0x0f, 0x00, 0x02, 0x00, 0xb1, 0x77, 0x00, 0x81, 0x03,
0x01, 0x00, 0xc8, 0x0f, 0x00, 0x02, 0x00, 0x6c, 0x94, 0xe3, 0xab,
0x03, 0x00, 0x02, 0xc8, 0x0f, 0x00, 0x02, 0x00, 0xc6, 0x25, 0xe3,
0xab, 0x03, 0x02, 0x02, 0xc8, 0x0f, 0x80, 0x3e, 0x00, 0x3e, 0x00,
0x00, 0x80, 0x02, 0x03, 0x00, 0xc8, 0x03, 0x80, 0x00, 0x00, 0xb0,
0xb0, 0x00, 0xc2, 0x00, 0x00, 0x00, 0xc8, 0x0f, 0x80, 0x01, 0x00,
0x00, 0x00, 0x00, 0xc2, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const int vs_textured_length = 360;

View File

@ -0,0 +1,23 @@
struct INPUT_VERTEX
{
float3 pos : POSITION;
float4 col : COLOR0;
float2 uv : TEXCOORD0;
};
struct OUTPUT_VERTEX
{
float4 pos : POSITION;
float4 col : COLOR0;
float2 uv : TEXCOORD0;
};
float4x4 mvpMatrix: register(c0);
OUTPUT_VERTEX main(INPUT_VERTEX input) {
OUTPUT_VERTEX output;
output.pos = mul(mvpMatrix, float4(input.pos, 1.0f));
output.col = input.col;
output.uv = input.uv;
return output;
}

288
readme.md
View File

@ -21,9 +21,9 @@ ClassiCube is not trying to replicate modern Minecraft versions. It will never s
You can **download ClassiCube** [from here](https://www.classicube.net/download/) and the very latest builds [from here](https://www.classicube.net/nightlies/).
![classic](https://github.com/ClassiCube/actions-testing-cc/assets/7892772/a233cb4c-296a-4d08-87fc-49874c230d4f)
![classic](https://github.com/ClassiCube/ClassiCube/assets/6509348/eedee53f-f53e-456f-b51c-92c62079eee0)
![enhanced](https://github.com/ClassiCube/actions-testing-cc/assets/7892772/61a064bd-cfaa-4a91-bedf-a16c3dd7e8a2)
![enhanced](https://github.com/ClassiCube/ClassiCube/assets/6509348/b2fe0e2b-5d76-41ab-909f-048d0ad15f37)
# We need your help
@ -59,7 +59,7 @@ ClassiCube runs on:
* macOS - 10.5 or later (but can be compiled to work with 10.3/10.4 though)
* Linux - needs `libcurl` and `libopenal`
* Android - 2.3 or later
* iOS - 10.3 or later
* iOS - 8.0 or later
* Most web browsers (even runs on IE11)
And also runs on:
@ -72,16 +72,21 @@ And also runs on:
* BeOS - untested on actual hardware
* IRIX - needs <code>curl</code> and <code>openal</code> packages
* SerenityOS - needs <code>SDL2</code>
* 3DS - unfinished, but usable (can [download from here](https://www.classicube.net/download/3ds))
* Dreamcast - unfinished, but renders (can [download from here](https://www.classicube.net/download/dreamcast))
* Switch - unfinished, but usable (can [download from here](https://www.classicube.net/download/switch))
* Wii U - unfinished, major issues (if you have a GitHub account, can [download from here](https://github.com/ClassiCube/ClassiCube/actions/workflows/build_wiiu.yml)), **untested on real hardware**)
* Wii - unfinished, but usable (can [download from here](https://www.classicube.net/download/wii))
* GameCube - unfinished, but usable (can [download from here](https://www.classicube.net/download/gamecube))
* Dreamcast - unfinished, but renders (can [download from here](https://www.classicube.net/download/dreamcast))
* PSP - unfinished, rendering issues (can [download from here](https://www.classicube.net/download/psp))
* Nintendo 64 - unfinished, moderate rendering issues (can [download from here](https://www.classicube.net/download/n64))
* 3DS - unfinished, but usable (can [download from here](https://www.classicube.net/download/3ds))
* DS/DSi - unfinished, rendering issues (can [download from here](https://www.classicube.net/download/nds))
* PS Vita - unfinished, rendering issues (can [download from here](https://www.classicube.net/download/vita))
* Xbox - unfinished, major rendering issues (can [download from here](https://www.classicube.net/download/xbox), **untested on real hardware**)
* PS3 - unfinished, rendering issues (can [download from here](https://www.classicube.net/download/ps3), **usually outdated**)
* Nintendo 64 - unfinished, moderate rendering issues (if you have a GitHub account, can [download from here](https://github.com/ClassiCube/ClassiCube/actions/workflows/build_n64.yml))
* PS2 - unfinished, major rendering and **stability issues** (if you have a GitHub account, can [download from here](https://github.com/ClassiCube/ClassiCube/actions/workflows/build_ps2.yml))
* PSP - unfinished, rendering issues (can [download from here](https://www.classicube.net/download/psp))
* PS3 - unfinished, rendering issues (can [download from here](https://www.classicube.net/download/ps3))
* PS2 - unfinished, major rendering and **stability issues** (can [download from here](https://www.classicube.net/download/ps2))
* PS1 - unfinished, major rendering and **stability issues**
* Xbox 360 - completely unfinished (if you have a GitHub account, can [download from here](https://github.com/ClassiCube/ClassiCube/actions/workflows/build_xbox360.yml)), **untested on real hardware**)
* Xbox - unfinished, major rendering issues (can [download from here](https://www.classicube.net/download/xbox))
# Compiling
@ -115,13 +120,17 @@ I am assuming you used the installer from https://osdn.net/projects/mingw/
4. Enter `gcc -fno-math-errno *.c -o ClassiCube.exe -mwindows -lwinmm -limagehlp`
##### Using TCC (Tiny C Compiler)
I am assuming you used `tcc-0.9.27-win64-bin.zip` from https://bellard.org/tcc/
1. Extract the .zip file
Setting up TCC:
1. Download and extract `tcc-0.9.27-win64-bin.zip` from https://bellard.org/tcc/
2. In TCC's `lib/kernel32.def`, add missing `RtlCaptureContext` at line 554 (In between `RtlAddFunctionTable` and `RtlDeleteFunctionTable`)
3. Copy `winapi` folder and `_mingw_dxhelper.h` from `winapi-full-for-0.9.27.zip` into TCC's `include` folder
4. Navigate to the directory with ClassiCube's source code
5. In `ExtMath.c`, change `fabsf` to `fabs` and `sqrtf` to `sqrtf`
6. Enter `tcc.exe -o ClassiCube.exe *.c -lwinmm -limagehlp -lgdi32 -luser32 -lcomdlg32 -lshell32`
3. Download `winapi-full-for-0.9.27.zip` from https://bellard.org/tcc/
4. Copy `winapi` folder and `_mingw_dxhelper.h` from `winapi-full-for-0.9.27.zip` into TCC's `include` folder
Compiling with TCC:
1. Navigate to the directory with ClassiCube's source code
2. In `ExtMath.c`, change `fabsf` to `fabs` and `sqrtf` to `sqrt`
3. Enter `tcc.exe -o ClassiCube.exe *.c -lwinmm -limagehlp -lgdi32 -luser32 -lcomdlg32 -lshell32`<br>
(Note: You may need to specify the full path to `tcc.exe` instead of just `tcc.exe`)
## Compiling - Linux
@ -146,14 +155,10 @@ Although the regular linux compiliation flags will work fine, to take full advan
## Compiling - macOS
##### Using gcc/clang (32 bit)
```cc -fno-math-errno *.c -o ClassiCube -framework Carbon -framework AGL -framework OpenGL -framework IOKit```
##### Using gcc/clang (64 bit)
```cc -fno-math-errno *.c interop_cocoa.m -o ClassiCube -framework Cocoa -framework OpenGL -framework IOKit -lobjc```
Note: You may need to install Xcode before you can compile ClassiCube
## Compiling - for Android
NOTE: If you are distributing a modified version, **please change the package ID from `com.classicube.android.client` to something else** - otherwise Android users won't be able to have both ClassiCube and your modified version installed at the same time on their Android device
@ -180,7 +185,125 @@ Import `ios/CCIOS.xcodeproj` project into Xcode (TODO explain more detailed)
`xcodebuild -sdk iphoneos -configuration Debug` (TODO explain more detailed)
## Compiling - other desktop OSes
## Compiling - webclient
```emcc *.c -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library interop_web.js```
The generated javascript file has some issues. [See here for how to fix](doc/compile-fixes.md#webclient-patches)
For more details on how to integrate into a website, see [here](doc/hosting-webclient.md)
<details>
<summary><h2>Compiling - consoles</h2></summary>
All console ports needs assistance from someone experienced with homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
<details>
<summary><h3>Nintendo consoles (click to expand)</h3></summary>
#### Switch
Run `make switch`. You'll need [libnx](https://github.com/switchbrew/libnx) and [mesa](https://github.com/devkitPro/mesa)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `switch-dev` group and the `switch-mesa switch-glm` packages)**
#### Wii U
Run `make wiiu`. You'll need [wut](https://github.com/devkitPro/wut/)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `wiiu-dev` group)**
#### 3DS
Run `make 3ds`. You'll need [libctru](https://github.com/devkitPro/libctru)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `3ds-dev` group)**
#### Wii
Run `make wii`. You'll need [libogc](https://github.com/devkitPro/libogc)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `wii-dev` group)**
#### GameCube
Run `make gamecube`. You'll need [libogc](https://github.com/devkitPro/libogc)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `gamecube-dev` group)**
#### Nintendo DS/DSi
Run `make ds`. You'll need [BlocksDS](https://github.com/blocksds/sdk)
#### Nintendo 64
Run `make n64`. You'll need the opengl branch of [libdragon](https://github.com/DragonMinded/libdragon/tree/opengl)
</details>
<details>
<summary><h3>Sony consoles (click to expand)</h3></summary>
#### PlayStation Vita
Run `make vita`. You'll need [vitasdk](https://vitasdk.org/)
#### PlayStation Portable
Run `make psp`. You'll need [pspsdk](https://github.com/pspdev/pspsdk)
**NOTE: It is recommended that you install the precompiled pspsdk version from [here](https://github.com/pspdev/pspdev/releases)**
#### PlayStation 3
Run `make ps3`. You'll need [PSL1GHT](https://github.com/ps3dev/PSL1GHT)
#### PlayStation 2
Run `make ps2`. You'll need [ps2sdk](https://github.com/ps2dev/ps2sdk)
#### PlayStation 1
Run `make ps1`. You'll need [PSn00bSDK](https://github.com/Lameguy64/PSn00bSDK/)
</details>
<details>
<summary><h3>Microsoft consoles (click to expand)</h3></summary>
#### Xbox 360
Run `make 360`. You'll need [libxenon](https://github.com/Free60Project/libxenon)
#### Xbox (original)
Run `make xbox`. You'll need [nxdk](https://github.com/XboxDev/nxdk)
</details>
<details>
<summary><h3>SEGA consoles (click to expand)</h3></summary>
### SEGA consoles
#### Dreamcast
Run `make dreamcast`. You'll need [KallistiOS](https://github.com/KallistiOS/KallistiOS)
#### Saturn
Run `make saturn`. You'll need [libyaul](https://github.com/yaul-org/libyaul)
</details>
</details>
<details>
<summary><h2>Compiling - other platforms (click to expand)</h2></summary>
#### FreeBSD
@ -228,81 +351,11 @@ Install SDL2 port if needed
```cc *.c -o ClassiCube -lgl -lSDL2```
## Compiling - other
#### Other systems
#### Web
You'll have to write the necessary code. You should read `portability.md` in doc folder.
```emcc *.c -s ALLOW_MEMORY_GROWTH=1 -s TOTAL_STACK=1Mb --js-library interop_web.js```
The generated javascript file has some issues. [See here for how to fix](doc/compile-fixes.md#webclient-patches)
#### 3DS
Run `make 3ds`. You'll need [libctru](https://github.com/devkitPro/libctru)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `3ds-dev` group)**
The 3DS port needs assistance from someone experienced with 3DS homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### Wii
Run `make wii`. You'll need [libogc](https://github.com/devkitPro/libogc)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `wii-dev` group)**
The Wii port needs assistance from someone experienced with Wii homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### GameCube
Run `make gamecube`. You'll need [libogc](https://github.com/devkitPro/libogc)
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `gamecube-dev` group)**
The GC port needs assistance from someone experienced with GameCube homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### PlayStation Portable
Run `make psp`. You'll need [pspsdk](https://github.com/pspdev/pspsdk)
**NOTE: It is recommended that you install the precompiled pspsdk version from [here](https://github.com/pspdev/pspdev/releases)**
The PSP port needs assistance from someone experienced with PSP homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### PlayStation Vita
Run `make vita`. You'll need [vitasdk](https://vitasdk.org/)
The Vita port needs assistance from someone experienced with Vita homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### PlayStation 3
Run `make ps3`. You'll need [PSL1GHT](https://github.com/ps3dev/PSL1GHT)
The PS3 port needs assistance from someone experienced with PS3 homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### Xbox
Run `make xbox`. You'll need [nxdk](https://github.com/XboxDev/nxdk)
The Xbox port needs assistance from someone experienced with Xbox homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### Dreamcast
Run `make dreamcast`. You'll need [KallistiOS](https://github.com/KallistiOS/KallistiOS)
The Dreamcast port needs assistance from someone experienced with Dreamcast homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
#### Nintendo 64
Run `make n64`. You'll need the opengl branch of [libdragon](https://github.com/DragonMinded/libdragon/tree/opengl)
The Nintendo 64 port needs assistance from someone experienced with Nintendo 64 homebrew development - if you're interested, please get in contact with me. (`unknownshadow200` on Discord)
You'll also need to stub out `WorkerLoop` function in `Http_Worker.c` for now
##### Other
You'll have to write the necessary code. You should read portability.md in doc folder.
</details>
## Documentation
@ -325,7 +378,8 @@ Further information (e.g. style) for ClassiCube's source code can be found in th
* To see help for a given built in command, type `/client help <command name>`.
## Open source technologies
<details>
<summary><h2>Open source technologies (click to expand)</h2></summary>
* [curl](https://curl.se/) - HTTP/HTTPS for linux and macOS
* [FreeType](https://www.freetype.org/) - Font handling for all platforms
@ -335,31 +389,41 @@ Further information (e.g. style) for ClassiCube's source code can be found in th
* [Emscripten](https://emscripten.org/) - Compiles client for web
* [RenderDoc](https://renderdoc.org/) - Graphics debugging
* [BearSSL](https://www.bearssl.org/) - SSL/TLS support on consoles
* [libnx](https://github.com/switchbrew/libnx) - Backend for Switch
* [Ryujinx](https://github.com/Ryujinx/Ryujinx) - Emulator used to test Switch port
* [wut](https://github.com/devkitPro/wut/) - Backend for Wii U
* [Cemu](https://github.com/cemu-project/Cemu) - Emulator used to test Wii U port
* [libctru](https://github.com/devkitPro/libctru) - Backend for 3DS
* [citro3D](https://github.com/devkitPro/citro3d) - Rendering backend for 3DS
* [Citra](https://github.com/citra-emu/citra) - Emulator used to test 3DS port
* [pspsdk](https://github.com/pspdev/pspsdk) - Backend for PSP
* [PPSSPP](https://github.com/hrydgard/ppsspp) - Emulator used to test PSP port
* [vitasdk](https://github.com/vitasdk) - Backend for PS Vita
* [Vita3K](https://github.com/Vita3K/Vita3K) - Emulator used to test Vita port
* [PSL1GHT](https://github.com/ps3dev/PSL1GHT) - Backend for PS3
* [RPCS3](https://github.com/RPCS3/rpcs3) - Emulator used to test PS3 port
* [libogc](https://github.com/devkitPro/libogc) - Backend for Wii and GameCube
* [libfat](https://github.com/devkitPro/libfat) - Filesystem backend for Wii/GC
* [Dolphin](https://github.com/dolphin-emu/dolphin) - Emulator used to test Wii/GC port
* [KallistiOS](https://github.com/KallistiOS/KallistiOS) - Backend for Dreamcast
* [GLdc](https://github.com/Kazade/GLdc) - Basis of rendering backend for Dreamcast
* [nullDC](https://github.com/skmp/nulldc) - Emulator used to test Dreamcast port
* [flycast](https://github.com/flyinghead/flycast) - Emulator used to test Dreamcast port
* [libdragon](https://github.com/DragonMinded/libdragon) - Backend for Nintendo 64
* [ares](https://github.com/ares-emulator/ares) - Emulator used to test Nintendo 64 port
* [BlocksDS](https://github.com/blocksds/sdk) - Backend for Nintendo DS
* [melonDS](https://github.com/melonDS-emu/melonDS) - Emulator used to test Nintendo DS port
* [vitasdk](https://github.com/vitasdk) - Backend for PS Vita
* [Vita3K](https://github.com/Vita3K/Vita3K) - Emulator used to test Vita port
* [pspsdk](https://github.com/pspdev/pspsdk) - Backend for PSP
* [PPSSPP](https://github.com/hrydgard/ppsspp) - Emulator used to test PSP port
* [PSL1GHT](https://github.com/ps3dev/PSL1GHT) - Backend for PS3
* [RPCS3](https://github.com/RPCS3/rpcs3) - Emulator used to test PS3 port
* [ps2sdk](https://github.com/ps2dev/ps2sdk) - Backend for PS2
* [PCSX2](https://github.com/PCSX2/pcsx2) - Emulator used to test PS2 port
* [PSn00bSDK](https://github.com/Lameguy64/PSn00bSDK/) - Backend for PS1
* [duckstation](https://github.com/stenzek/duckstation) - Emulator used to test PS1 port
* [libxenon](https://github.com/Free60Project/libxenon) - Backend for Xbox 360
* [nxdk](https://github.com/XboxDev/nxdk) - Backend for Xbox
* [xemu](https://github.com/xemu-project/xemu) - Emulator used to test Xbox port
* [cxbx-reloaded](https://github.com/Cxbx-Reloaded/Cxbx-Reloaded) - Emulator used to test Xbox port
* [libdragon](https://github.com/DragonMinded/libdragon) - Backend for Nintendo 64
* [cen64](https://github.com/n64dev/cen64) - Emulator used to test Nintendo 64 port
* [ares](https://github.com/ares-emulator/ares) - Emulator used to test Nintendo 64 port
* [ps2sdk](https://github.com/ps2dev/ps2sdk) - Backend for PS2
* [PCSX2](https://github.com/PCSX2/pcsx2) - Emulator used to test PS2 port
* [KallistiOS](https://github.com/KallistiOS/KallistiOS) - Backend for Dreamcast
* [GLdc](https://github.com/Kazade/GLdc) - Basis of rendering backend for Dreamcast
* [flycast](https://github.com/flyinghead/flycast) - Emulator used to test Dreamcast port
* [libyaul](https://github.com/yaul-org/libyaul) - Backend for Saturn
* [mednafen](https://mednafen.github.io/) - Emulator used to test Saturn port
</details>
## Sound Credits
ClassiCube uses sounds from [Freesound.org](https://freesound.org)<br>

View File

@ -12,10 +12,17 @@
#include "Options.h"
#include "Logger.h"
#define LIQUID_ANIM_MAX 64
#ifdef CC_BUILD_ANIMATIONS
static void Animations_Update(int loc, struct Bitmap* bmp, int stride);
#ifdef CC_BUILD_LOWMEM
#define LIQUID_ANIM_MAX 16
#else
#define LIQUID_ANIM_MAX 64
#endif
#define WATER_TEX_LOC 14
#define LAVA_TEX_LOC 30
static void Animations_Update(int loc, struct Bitmap* bmp, int stride);
#ifndef CC_BUILD_WEB
/* Based off the incredible work from https://dl.dropboxusercontent.com/u/12694594/lava.txt
@ -292,20 +299,20 @@ static void Animations_Clear(void) {
}
static void Animations_Validate(void) {
struct AnimationData data;
struct AnimationData* data;
int maxX, maxY, tileX, tileY;
int i, j;
anims_validated = true;
for (i = 0; i < anims_count; i++) {
data = anims_list[i];
data = &anims_list[i];
maxX = data.frameX + data.frameSize * data.statesCount;
maxY = data.frameY + data.frameSize;
tileX = Atlas2D_TileX(data.texLoc);
tileY = Atlas2D_TileY(data.texLoc);
maxX = data->frameX + data->frameSize * data->statesCount;
maxY = data->frameY + data->frameSize;
tileX = Atlas2D_TileX(data->texLoc);
tileY = Atlas2D_TileY(data->texLoc);
if (data.frameSize > Atlas2D.TileSize || tileY >= Atlas2D.RowsCount) {
if (data->frameSize > Atlas2D.TileSize || tileY >= Atlas2D.RowsCount) {
Chat_Add2("&cAnimation frames for tile (%i, %i) are bigger than the size of a tile in terrain.png", &tileX, &tileY);
} else if (maxX > anims_bmp.width || maxY > anims_bmp.height) {
Chat_Add2("&cSome of the animation frames for tile (%i, %i) are at coordinates outside animations.png", &tileX, &tileY);
@ -313,8 +320,8 @@ static void Animations_Validate(void) {
/* if user has water/lava animations in their default.zip, disable built-in */
/* However, 'usewateranim' and 'uselavaanim' files should always disable use */
/* of custom water/lava animations, even when they exist in animations.png */
if (data.texLoc == LAVA_TEX_LOC && !alwaysLavaAnim) useLavaAnim = false;
if (data.texLoc == WATER_TEX_LOC && !alwaysWaterAnim) useWaterAnim = false;
if (data->texLoc == LAVA_TEX_LOC && !alwaysLavaAnim) useLavaAnim = false;
if (data->texLoc == WATER_TEX_LOC && !alwaysWaterAnim) useWaterAnim = false;
continue;
}
@ -391,6 +398,10 @@ static void OnInit(void) {
ScheduledTask_Add(GAME_DEF_TICKS, Animations_Tick);
Event_Register_(&TextureEvents.PackChanged, NULL, OnPackChanged);
}
#else
static void Animations_Clear(void) { }
static void OnInit(void) { }
#endif
struct IGameComponent Animations_Component = {
OnInit, /* Init */

Some files were not shown because too many files have changed in this diff Show More