mirror of
https://github.com/mupen64plus/mupen64plus-video-arachnoid.git
synced 2025-04-02 10:42:12 -04:00
Compare commits
No commits in common. "master" and "1.99.4" have entirely different histories.
127 changed files with 2017 additions and 2455 deletions
38
.gitattributes
vendored
38
.gitattributes
vendored
|
@ -1,38 +0,0 @@
|
||||||
* text=auto
|
|
||||||
|
|
||||||
# normal text files
|
|
||||||
*.6 text
|
|
||||||
AUTHORS text
|
|
||||||
*.c text
|
|
||||||
*.cfg text
|
|
||||||
*.cht text
|
|
||||||
*.conf text
|
|
||||||
COPYING text
|
|
||||||
*.cpp text
|
|
||||||
*.def text
|
|
||||||
*-license text
|
|
||||||
*.h text
|
|
||||||
*.html text
|
|
||||||
*.ini text
|
|
||||||
INSTALL text
|
|
||||||
LICENSES text
|
|
||||||
Makefile text
|
|
||||||
*.py text
|
|
||||||
README text
|
|
||||||
RELEASE text
|
|
||||||
*.S text
|
|
||||||
*.sh text
|
|
||||||
*.txt text
|
|
||||||
*.ver text
|
|
||||||
|
|
||||||
# windows specific text files
|
|
||||||
*.sln text eol=crlf
|
|
||||||
*.vcproj text eol=crlf
|
|
||||||
*.vcxproj text eol=crlf
|
|
||||||
*.vcxproj.filters text eol=crlf
|
|
||||||
|
|
||||||
# binary files
|
|
||||||
*.gz binary
|
|
||||||
*.ttf binary
|
|
||||||
cursor.tex binary
|
|
||||||
font.tex binary
|
|
120
.github/workflows/build.yml
vendored
120
.github/workflows/build.yml
vendored
|
@ -1,120 +0,0 @@
|
||||||
name: Arachnoid
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- '.{gitattributes,gitignore,travis.yml}'
|
|
||||||
- '*.md,appveyor.yml,README'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '.{gitattributes,gitignore,travis.yml}'
|
|
||||||
- '*.md,appveyor.yml,README'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
Linux:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- cc: GCC
|
|
||||||
arch: x64
|
|
||||||
- cc: GCC
|
|
||||||
arch: x86
|
|
||||||
- cc: Clang
|
|
||||||
arch: x64
|
|
||||||
- cc: Clang
|
|
||||||
arch: x86
|
|
||||||
name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }}
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Get build dependencies and arrange the environment
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
|
|
||||||
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
|
|
||||||
export BUILD_DEPS="libgl1-mesa-dev"
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }}
|
|
||||||
- name: Build and related stuff, backup binaries
|
|
||||||
run: |
|
|
||||||
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg
|
|
||||||
- name: Upload artifact
|
|
||||||
if: matrix.cc == 'GCC'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.PKG_NAME }}
|
|
||||||
path: pkg/*.tar.gz
|
|
||||||
|
|
||||||
MSYS2:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- cc: GCC
|
|
||||||
arch: x64
|
|
||||||
cross: x86_64
|
|
||||||
env: MINGW64
|
|
||||||
- cc: GCC
|
|
||||||
arch: x86
|
|
||||||
cross: i686
|
|
||||||
env: MINGW32
|
|
||||||
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }}
|
|
||||||
runs-on: windows-2022
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: msys2 {0}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
msystem: ${{ matrix.env }}
|
|
||||||
update: true
|
|
||||||
install: >-
|
|
||||||
git
|
|
||||||
libtool
|
|
||||||
make
|
|
||||||
mingw-w64-${{ matrix.cross }}-gcc
|
|
||||||
mingw-w64-${{ matrix.cross }}-toolchain
|
|
||||||
mingw-w64-${{ matrix.cross }}-ntldd
|
|
||||||
- name: Build and related stuff, backup binaries
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
|
|
||||||
- name: Backup dependencies, etc...
|
|
||||||
run: |
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }}
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.PKG_NAME }}
|
|
||||||
path: pkg/*
|
|
||||||
|
|
||||||
Nightly-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.ref_name == 'master'
|
|
||||||
needs: [Linux, MSYS2]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: binaries
|
|
||||||
- name: Get some tools
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get -y install hashdeep
|
|
||||||
- name: Creating new artifacts and update nightly-build
|
|
||||||
run: |
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh
|
|
||||||
- name: Nightly-build
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
prerelease: true
|
|
||||||
allowUpdates: true
|
|
||||||
removeArtifacts: true
|
|
||||||
replacesArtifacts: false
|
|
||||||
tag: nightly-build
|
|
||||||
artifacts: pkg/*
|
|
115
.github/workflows/schedule.yml
vendored
115
.github/workflows/schedule.yml
vendored
|
@ -1,115 +0,0 @@
|
||||||
name: Arachnoid - Scheduled
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '15 14 21 * *'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
Linux:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- cc: GCC
|
|
||||||
arch: x64
|
|
||||||
- cc: GCC
|
|
||||||
arch: x86
|
|
||||||
- cc: Clang
|
|
||||||
arch: x64
|
|
||||||
- cc: Clang
|
|
||||||
arch: x86
|
|
||||||
name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }}
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
if: github.repository == 'mupen64plus/mupen64plus-video-arachnoid'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Get build dependencies and arrange the environment
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
|
|
||||||
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
|
|
||||||
export BUILD_DEPS="libgl1-mesa-dev"
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }}
|
|
||||||
- name: Build and related stuff, backup binaries
|
|
||||||
run: |
|
|
||||||
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg
|
|
||||||
- name: Upload artifact
|
|
||||||
if: matrix.cc == 'GCC'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.PKG_NAME }}
|
|
||||||
path: pkg/*.tar.gz
|
|
||||||
|
|
||||||
MSYS2:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- cc: GCC
|
|
||||||
arch: x64
|
|
||||||
cross: x86_64
|
|
||||||
env: MINGW64
|
|
||||||
- cc: GCC
|
|
||||||
arch: x86
|
|
||||||
cross: i686
|
|
||||||
env: MINGW32
|
|
||||||
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }}
|
|
||||||
runs-on: windows-2022
|
|
||||||
if: github.repository == 'mupen64plus/mupen64plus-video-arachnoid'
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: msys2 {0}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: msys2/setup-msys2@v2
|
|
||||||
with:
|
|
||||||
msystem: ${{ matrix.env }}
|
|
||||||
update: true
|
|
||||||
install: >-
|
|
||||||
git
|
|
||||||
libtool
|
|
||||||
make
|
|
||||||
mingw-w64-${{ matrix.cross }}-gcc
|
|
||||||
mingw-w64-${{ matrix.cross }}-toolchain
|
|
||||||
mingw-w64-${{ matrix.cross }}-ntldd
|
|
||||||
- name: Build and related stuff, backup binaries
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
|
|
||||||
- name: Backup dependencies, etc...
|
|
||||||
run: |
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }}
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.PKG_NAME }}
|
|
||||||
path: pkg/*
|
|
||||||
|
|
||||||
Nightly-build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.ref_name == 'master'
|
|
||||||
needs: [Linux, MSYS2]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Download artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: binaries
|
|
||||||
- name: Get some tools
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get -y install hashdeep
|
|
||||||
- name: Creating new artifacts and update nightly-build
|
|
||||||
run: |
|
|
||||||
./../mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh
|
|
||||||
- name: Nightly-build
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
prerelease: true
|
|
||||||
allowUpdates: true
|
|
||||||
removeArtifacts: true
|
|
||||||
replacesArtifacts: false
|
|
||||||
tag: nightly-build
|
|
||||||
artifacts: pkg/*
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
/projects/unix/_obj*/
|
|
||||||
/projects/unix/mupen64plus-video-arachnoid*.so
|
|
45
.travis.yml
45
.travis.yml
|
@ -1,45 +0,0 @@
|
||||||
sudo: required
|
|
||||||
dist: xenial
|
|
||||||
language: cpp
|
|
||||||
compiler:
|
|
||||||
- gcc
|
|
||||||
- clang
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- git
|
|
||||||
- libgl1-mesa-dev
|
|
||||||
- pkg-config
|
|
||||||
before_install:
|
|
||||||
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
|
|
||||||
script:
|
|
||||||
- make -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 all
|
|
||||||
|
|
||||||
# extra mxe build entries
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- env:
|
|
||||||
- MXE_CPU=i686
|
|
||||||
- PATH="/usr/lib/mxe/usr/bin/:$PATH"
|
|
||||||
before_install:
|
|
||||||
- curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add -
|
|
||||||
- echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
- sudo apt-get -y --allow-unauthenticated install mxe-i686-w64-mingw32.shared-gcc
|
|
||||||
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
|
|
||||||
script:
|
|
||||||
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean &&
|
|
||||||
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all
|
|
||||||
|
|
||||||
- env:
|
|
||||||
- MXE_CPU=x86_64
|
|
||||||
- PATH="/usr/lib/mxe/usr/bin/:$PATH"
|
|
||||||
before_install:
|
|
||||||
- curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add -
|
|
||||||
- echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list
|
|
||||||
- sudo apt-get update -qq
|
|
||||||
- sudo apt-get -y --allow-unauthenticated install mxe-x86-64-w64-mingw32.shared-gcc
|
|
||||||
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
|
|
||||||
script:
|
|
||||||
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean &&
|
|
||||||
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all
|
|
2
README
2
README
|
@ -1,5 +1,5 @@
|
||||||
Arachnoid Graphics Plugin for Mupen64Plus
|
Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
|
|
||||||
Derived from the Project64/1964 version of Arachnoid, available from:
|
Derived from the Project64/1964 version of Arachnoid, available from:
|
||||||
http://sourceforge.net/projects/arachnoid/
|
http://sourceforge.net/projects/arachnoid/
|
||||||
|
|
38
projects/msvc9/GraphicsPlugin.sln
Normal file → Executable file
38
projects/msvc9/GraphicsPlugin.sln
Normal file → Executable file
|
@ -1,19 +1,19 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||||
# Visual Studio 2008
|
# Visual Studio 2008
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GraphicsPlugin", "GraphicsPlugin.vcproj", "{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GraphicsPlugin", "GraphicsPlugin.vcproj", "{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
Release|Win32 = Release|Win32
|
Release|Win32 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Debug|Win32.ActiveCfg = Debug|Win32
|
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||||
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Debug|Win32.Build.0 = Debug|Win32
|
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Debug|Win32.Build.0 = Debug|Win32
|
||||||
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Release|Win32.ActiveCfg = Release|Win32
|
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Release|Win32.ActiveCfg = Release|Win32
|
||||||
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Release|Win32.Build.0 = Release|Win32
|
{6F7FDCD3-C278-4A5C-BD36-85D58AC75AFE}.Release|Win32.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
1842
projects/msvc9/GraphicsPlugin.vcproj
Normal file → Executable file
1842
projects/msvc9/GraphicsPlugin.vcproj
Normal file → Executable file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
# * Arachnoid - Makefile *
|
# * Arachnoid - Makefile *
|
||||||
# * https://github.com/mupen64plus/mupen64plus-video-arachnoid/ *
|
# * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/ *
|
||||||
# * Copyright (C) 2009 Richard42, Jon Ring *
|
# * Copyright (C) 2009 Richard42, Jon Ring *
|
||||||
# * *
|
# * *
|
||||||
# * This program is free software; you can redistribute it and/or modify *
|
# * This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -20,9 +20,8 @@
|
||||||
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
# Makefile for mupen64plus-video-arachnoid
|
# Makefile for mupen64plus-video-arachnoid
|
||||||
|
|
||||||
# detect operating system
|
# detect operation system
|
||||||
UNAME ?= $(shell uname -s)
|
UNAME = $(shell uname -s)
|
||||||
OS := NONE
|
|
||||||
ifeq ("$(UNAME)","Linux")
|
ifeq ("$(UNAME)","Linux")
|
||||||
OS = LINUX
|
OS = LINUX
|
||||||
SO_EXTENSION = so
|
SO_EXTENSION = so
|
||||||
|
@ -40,7 +39,7 @@ ifneq ("$(filter GNU hurd,$(UNAME))","")
|
||||||
endif
|
endif
|
||||||
ifeq ("$(UNAME)","Darwin")
|
ifeq ("$(UNAME)","Darwin")
|
||||||
OS = OSX
|
OS = OSX
|
||||||
LDLIBS += -liconv -lpng
|
LDFLAGS += -liconv -lpng
|
||||||
SO_EXTENSION = dylib
|
SO_EXTENSION = dylib
|
||||||
SHARED = -bundle
|
SHARED = -bundle
|
||||||
endif
|
endif
|
||||||
|
@ -49,154 +48,66 @@ ifeq ("$(UNAME)","FreeBSD")
|
||||||
SO_EXTENSION = so
|
SO_EXTENSION = so
|
||||||
SHARED = -shared
|
SHARED = -shared
|
||||||
endif
|
endif
|
||||||
ifeq ("$(UNAME)","OpenBSD")
|
|
||||||
OS = FREEBSD
|
|
||||||
SO_EXTENSION = so
|
|
||||||
SHARED = -shared
|
|
||||||
endif
|
|
||||||
ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
|
ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
|
||||||
OS = LINUX
|
OS = LINUX
|
||||||
SO_EXTENSION = so
|
SO_EXTENSION = so
|
||||||
SHARED = -shared
|
SHARED = -shared
|
||||||
endif
|
endif
|
||||||
ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW")
|
|
||||||
OS = MINGW
|
|
||||||
SO_EXTENSION = dll
|
|
||||||
SHARED = -shared
|
|
||||||
PIC = 0
|
|
||||||
endif
|
|
||||||
ifeq ("$(OS)","NONE")
|
|
||||||
$(error OS type "$(UNAME)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues')
|
|
||||||
endif
|
|
||||||
|
|
||||||
# detect system architecture
|
# detect system architecture
|
||||||
HOST_CPU ?= $(shell uname -m)
|
HOST_CPU ?= $(shell uname -m)
|
||||||
CPU := NONE
|
|
||||||
NO_ASM ?= 1
|
NO_ASM ?= 1
|
||||||
ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","")
|
ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","")
|
||||||
CPU := X86
|
CPU := X86
|
||||||
ifeq ("$(BITS)", "32")
|
ifeq ("$(BITS)", "32")
|
||||||
ARCH_DETECTED := 64BITS_32
|
ARCH_DETECTED := 64BITS_32
|
||||||
PIC ?= 0
|
|
||||||
else
|
else
|
||||||
ARCH_DETECTED := 64BITS
|
ARCH_DETECTED := 64BITS
|
||||||
PIC ?= 1
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifneq ("$(filter pentium i%86,$(HOST_CPU))","")
|
ifneq ("$(filter pentium i%86,$(HOST_CPU))","")
|
||||||
CPU := X86
|
CPU := X86
|
||||||
ARCH_DETECTED := 32BITS
|
ARCH_DETECTED := 32BITS
|
||||||
PIC ?= 0
|
|
||||||
endif
|
endif
|
||||||
ifneq ("$(filter ppc macppc socppc powerpc,$(HOST_CPU))","")
|
ifneq ("$(filter ppc powerpc,$(HOST_CPU))","")
|
||||||
CPU := PPC
|
CPU := PPC
|
||||||
ARCH_DETECTED := 32BITS
|
ARCH_DETECTED := 32BITS
|
||||||
BIG_ENDIAN := 1
|
|
||||||
PIC ?= 1
|
|
||||||
$(warning Architecture "$(HOST_CPU)" not officially supported.')
|
|
||||||
endif
|
endif
|
||||||
ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","")
|
ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","")
|
||||||
CPU := PPC
|
CPU := PPC
|
||||||
ARCH_DETECTED := 64BITS
|
ARCH_DETECTED := 64BITS
|
||||||
BIG_ENDIAN := 1
|
|
||||||
PIC ?= 1
|
|
||||||
$(warning Architecture "$(HOST_CPU)" not officially supported.')
|
|
||||||
endif
|
|
||||||
ifneq ("$(filter arm%,$(HOST_CPU))","")
|
|
||||||
ifeq ("$(filter arm%b,$(HOST_CPU))","")
|
|
||||||
CPU := ARM
|
|
||||||
ARCH_DETECTED := 32BITS
|
|
||||||
PIC ?= 1
|
|
||||||
$(warning Architecture "$(HOST_CPU)" not officially supported.')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
ifeq ("$(CPU)","NONE")
|
|
||||||
$(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues')
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SRCDIR = ../../src
|
# base CFLAGS, LIBS, and LDFLAGS
|
||||||
OBJDIR = _obj$(POSTFIX)
|
CFLAGS += -ffast-math -funroll-loops -fexpensive-optimizations -fno-strict-aliasing -fvisibility=hidden -I../../src \
|
||||||
|
|
||||||
# base CFLAGS, LDLIBS, and LDFLAGS
|
|
||||||
OPTFLAGS ?= -O3 -flto
|
|
||||||
WARNFLAGS ?= -Wall
|
|
||||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src \
|
|
||||||
-I../../src/hash -I../../src/ucodes -I../../src/GBI -I../../src/RDP -I../../src/utils \
|
-I../../src/hash -I../../src/ucodes -I../../src/GBI -I../../src/RDP -I../../src/utils \
|
||||||
-I../../src/log -I../../src/RSP -I../../src/framebuffer -I../../src/math -I../../src/renderer \
|
-I../../src/log -I../../src/RSP -I../../src/framebuffer -I../../src/math -I../../src/renderer \
|
||||||
-I../../src/Assembler -I../../src/texture -I../../src/config -I../../src/Combiner
|
-I../../src/Assembler -I../../src/texture -I../../src/config -I../../src/Combiner
|
||||||
|
ifneq ($(OS), FREEBSD)
|
||||||
|
CFLAGS += -pipe -O3
|
||||||
|
endif
|
||||||
CXXFLAGS += -fvisibility-inlines-hidden
|
CXXFLAGS += -fvisibility-inlines-hidden
|
||||||
LDFLAGS += $(SHARED)
|
|
||||||
|
|
||||||
# On OS X, add a few extra flags to elegantly support cross-compilation and backward
|
# On OS X, add a few extra flags to elegantly support cross-compilation and backward
|
||||||
# compatibility (and also the flags to link against OpenGL)
|
# compatibility (and also the flags to link against OpenGL)
|
||||||
ifeq ($(OS), OSX)
|
ifeq ($(OS), OSX)
|
||||||
# Select the proper SDK
|
|
||||||
# Also, SDKs are stored in a different location since XCode 4.3
|
|
||||||
OSX_SDK ?= $(shell sw_vers -productVersion | cut -f1 -f2 -d .)
|
|
||||||
OSX_XCODEMAJ = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f1 -d .)
|
|
||||||
OSX_XCODEMIN = $(shell xcodebuild -version | grep '[0-9]*\.[0-9]*' | cut -f2 -d ' ' | cut -f2 -d .)
|
|
||||||
OSX_XCODEGE43 = $(shell echo "`expr $(OSX_XCODEMAJ) \>= 4``expr $(OSX_XCODEMIN) \>= 3`")
|
|
||||||
ifeq ($(OSX_XCODEGE43), 11)
|
|
||||||
OSX_SYSROOT := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
|
|
||||||
else
|
|
||||||
OSX_SYSROOT := /Developer/SDKs
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(CPU), X86)
|
ifeq ($(CPU), X86)
|
||||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||||
CFLAGS += -arch x86_64 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
CFLAGS += -arch x86_64 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||||
LDFLAGS += -bundle
|
LDFLAGS += -bundle -framework OpenGL -arch x86_64 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||||
else
|
else
|
||||||
CFLAGS += -arch i686 -mmacosx-version-min=$(OSX_SDK) -isysroot $(OSX_SYSROOT)/MacOSX$(OSX_SDK).sdk
|
CFLAGS += -arch i686 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||||
LDFLAGS += -bundle
|
LDFLAGS += -bundle -framework OpenGL -arch i686 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
# search for OpenGL libraries
|
# flags for other Unices
|
||||||
ifeq ($(OS), OSX)
|
LDFLAGS += -ldl -lGL -lGLU -lpthread
|
||||||
GL_LDLIBS = -framework OpenGL
|
|
||||||
endif
|
|
||||||
ifeq ($(OS), MINGW)
|
|
||||||
GL_LDLIBS = -lopengl32
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(origin GL_CFLAGS) $(origin GL_LDLIBS), undefined undefined)
|
|
||||||
ifeq ($(origin PKG_CONFIG), undefined)
|
|
||||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
|
||||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
|
||||||
$(error $(PKG_CONFIG) not found)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(shell $(PKG_CONFIG) --modversion gl 2>/dev/null),)
|
|
||||||
$(error No OpenGL development libraries found!)
|
|
||||||
endif
|
|
||||||
GL_CFLAGS += $(shell $(PKG_CONFIG) --cflags gl)
|
|
||||||
GL_LDLIBS += $(shell $(PKG_CONFIG) --libs gl)
|
|
||||||
endif
|
|
||||||
CFLAGS += $(GL_CFLAGS)
|
|
||||||
LDLIBS += $(GL_LDLIBS)
|
|
||||||
|
|
||||||
CFLAGS += -pthread
|
|
||||||
endif
|
|
||||||
ifeq ($(OS), LINUX)
|
|
||||||
LDLIBS += -ldl
|
|
||||||
endif
|
|
||||||
ifeq ($(OS), FREEBSD)
|
|
||||||
LDLIBS += -lc
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Since we are building a shared library, we must compile with -fPIC on some architectures
|
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||||
# On 32-bit x86 systems we do not want to use -fPIC because we don't have to and it has a big performance penalty on this arch
|
|
||||||
ifeq ($(PIC), 1)
|
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
else
|
|
||||||
CFLAGS += -fno-PIC
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(BIG_ENDIAN), 1)
|
|
||||||
CFLAGS += -DM64P_BIG_ENDIAN
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# set mupen64plus core API header path
|
# set mupen64plus core API header path
|
||||||
|
@ -219,71 +130,66 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# tweak flags for 32-bit build on 64-bit system
|
|
||||||
ifeq ($(ARCH_DETECTED), 64BITS_32)
|
|
||||||
ifeq ($(OS), FREEBSD)
|
|
||||||
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
|
||||||
endif
|
|
||||||
ifneq ($(OS), OSX)
|
|
||||||
ifeq ($(OS), MINGW)
|
|
||||||
LDFLAGS += -Wl,-m,i386pe
|
|
||||||
else
|
|
||||||
CFLAGS += -m32
|
|
||||||
LDFLAGS += -Wl,-m,elf_i386
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
|
||||||
ifeq ($(OS), MINGW)
|
|
||||||
LDFLAGS += -Wl,-m,i386pep
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# set special flags per-system
|
# set special flags per-system
|
||||||
ifeq ($(OS), LINUX)
|
ifeq ($(OS), LINUX)
|
||||||
# only export api symbols
|
# only export api symbols
|
||||||
LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver
|
LDFLAGS += -Wl,-version-script,$(SRCDIR)/video_api_export.ver
|
||||||
endif
|
endif
|
||||||
|
ifneq ($(OS), FREEBSD)
|
||||||
# reduced compile output when running make without V=1
|
ifeq ($(CPU), X86)
|
||||||
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||||
ifndef V
|
CFLAGS += -march=athlon64
|
||||||
Q_CC = @echo ' CC '$@;
|
else
|
||||||
Q_CXX = @echo ' CXX '$@;
|
CFLAGS += -mmmx -msse -march=i686 -mtune=pentium-m -fomit-frame-pointer
|
||||||
Q_LD = @echo ' LD '$@;
|
endif
|
||||||
|
# tweak flags for 32-bit build on 64-bit system
|
||||||
|
ifeq ($(ARCH_DETECTED), 64BITS_32)
|
||||||
|
CFLAGS += -m32
|
||||||
|
LDFLAGS += -m32 -m elf_i386
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifeq ($(ARCH_DETECTED), 64BITS_32)
|
||||||
|
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(CPU), PPC)
|
||||||
|
CFLAGS += -mcpu=powerpc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# set base program pointers and flags
|
# set shell function names
|
||||||
CC = $(CROSS_COMPILE)gcc
|
# set shell function names
|
||||||
CXX = $(CROSS_COMPILE)g++
|
CC ?= gcc
|
||||||
RM ?= rm -f
|
CXX ?= g++
|
||||||
INSTALL ?= install
|
INSTALL ?= install
|
||||||
MKDIR ?= mkdir -p
|
ifeq ($(OS),LINUX)
|
||||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
STRIP = strip -s
|
||||||
COMPILE.cc = $(Q_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
endif
|
||||||
LINK.o = $(Q_LD)$(CXX) $(CXXFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
ifeq ($(OS),OSX)
|
||||||
|
STRIP = strip -x
|
||||||
|
endif
|
||||||
|
|
||||||
# set special flags for given Makefile parameters
|
# set special flags for given Makefile parameters
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -g
|
CFLAGS += -g -fno-inline -Werror
|
||||||
INSTALL_STRIP_FLAG ?=
|
STRIP = true # disable binary strip
|
||||||
else
|
|
||||||
INSTALL_STRIP_FLAG ?= -s
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# set installation options
|
# set installation options
|
||||||
ifeq ($(PREFIX),)
|
ifeq ($(PREFIX),)
|
||||||
PREFIX := /usr/local
|
PREFIX := /usr/local
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(SHAREDIR),)
|
||||||
|
SHAREDIR := $(PREFIX)/share/mupen64plus
|
||||||
|
endif
|
||||||
ifeq ($(LIBDIR),)
|
ifeq ($(LIBDIR),)
|
||||||
LIBDIR := $(PREFIX)/lib
|
LIBDIR := $(PREFIX)/lib/mupen64plus
|
||||||
endif
|
|
||||||
ifeq ($(PLUGINDIR),)
|
|
||||||
PLUGINDIR := $(LIBDIR)/mupen64plus
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
SRCDIR = ../../src
|
||||||
|
OBJDIR = _obj
|
||||||
|
|
||||||
# list of source files to compile
|
# list of source files to compile
|
||||||
SOURCE = \
|
SOURCE = \
|
||||||
$(SRCDIR)/main.cpp \
|
$(SRCDIR)/main.cpp \
|
||||||
|
@ -336,23 +242,18 @@ SOURCE = \
|
||||||
$(SRCDIR)/Combiner/CombinerCache.cpp \
|
$(SRCDIR)/Combiner/CombinerCache.cpp \
|
||||||
$(SRCDIR)/RomDetector.cpp \
|
$(SRCDIR)/RomDetector.cpp \
|
||||||
$(SRCDIR)/RDP/RDP.cpp \
|
$(SRCDIR)/RDP/RDP.cpp \
|
||||||
$(SRCDIR)/RDP/RDPInstructions.cpp
|
$(SRCDIR)/RDP/RDPInstructions.cpp \
|
||||||
|
$(SRCDIR)/osal_dynamiclib_unix.cpp
|
||||||
ifeq ($(OS),MINGW)
|
|
||||||
SOURCE += $(SRCDIR)/osal_dynamiclib_win32.cpp
|
|
||||||
else
|
|
||||||
SOURCE += $(SRCDIR)/osal_dynamiclib_unix.cpp
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
# generate a list of object files build, make a temporary directory for them
|
# generate a list of object files build, make a temporary directory for them
|
||||||
OBJECTS := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE)))
|
OBJECTS := $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(filter %.cpp, $(SOURCE)))
|
||||||
OBJDIRS = $(dir $(OBJECTS))
|
OBJDIRS = $(dir $(OBJECTS))
|
||||||
$(shell $(MKDIR) $(OBJDIRS))
|
$(shell mkdir -p $(OBJDIRS))
|
||||||
|
|
||||||
# build targets
|
# build targets
|
||||||
|
|
||||||
TARGET = mupen64plus-video-arachnoid$(POSTFIX).$(SO_EXTENSION)
|
TARGET = mupen64plus-video-arachnoid.$(SO_EXTENSION)
|
||||||
targets:
|
targets:
|
||||||
@echo "Mupen64plus-video-arachnoid N64 Graphics plugin makefile. "
|
@echo "Mupen64plus-video-arachnoid N64 Graphics plugin makefile. "
|
||||||
@echo " Targets:"
|
@echo " Targets:"
|
||||||
|
@ -364,14 +265,9 @@ targets:
|
||||||
@echo " Options:"
|
@echo " Options:"
|
||||||
@echo " BITS=32 == build 32-bit binaries on 64-bit machine"
|
@echo " BITS=32 == build 32-bit binaries on 64-bit machine"
|
||||||
@echo " APIDIR=path == path to find Mupen64Plus Core headers"
|
@echo " APIDIR=path == path to find Mupen64Plus Core headers"
|
||||||
@echo " OPTFLAGS=flag == compiler optimization (default: -O3 -flto)"
|
|
||||||
@echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)"
|
|
||||||
@echo " PIC=(1|0) == Force enable/disable of position independent code"
|
|
||||||
@echo " POSTFIX=name == String added to the name of the the build (default: '')"
|
|
||||||
@echo " Install Options:"
|
@echo " Install Options:"
|
||||||
@echo " PREFIX=path == install/uninstall prefix (default: /usr/local)"
|
@echo " PREFIX=path == install/uninstall prefix (default: /usr/local)"
|
||||||
@echo " LIBDIR=path == library prefix (default: PREFIX/lib)"
|
@echo " LIBDIR=path == path to install plugin libraries (default: PREFIX/lib/mupen64plus)"
|
||||||
@echo " PLUGINDIR=path == path to install plugin libraries (default: LIBDIR/mupen64plus)"
|
|
||||||
@echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)"
|
@echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)"
|
||||||
@echo " Debugging Options:"
|
@echo " Debugging Options:"
|
||||||
@echo " DEBUG=1 == add debugging symbols"
|
@echo " DEBUG=1 == add debugging symbols"
|
||||||
|
@ -380,30 +276,38 @@ targets:
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
install: $(TARGET)
|
install: $(TARGET)
|
||||||
$(INSTALL) -d "$(DESTDIR)$(PLUGINDIR)"
|
$(INSTALL) -d -v "$(DESTDIR)$(LIBDIR)"
|
||||||
$(INSTALL) -m 0644 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(PLUGINDIR)"
|
$(INSTALL) -m 0644 $(TARGET) "$(DESTDIR)$(LIBDIR)"
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
$(RM) "$(DESTDIR)$(PLUGINDIR)/$(TARGET)"
|
rm -f "$(DESTDIR)$(LIBDIR)/$(TARGET)"
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(OBJDIR) $(TARGET)
|
rm -rf ./_obj mupen64plus-video-arachnoid.$(SO_EXTENSION)
|
||||||
|
|
||||||
# build dependency files
|
# build dependency files
|
||||||
CFLAGS += -MD -MP
|
CFLAGS += -MD
|
||||||
-include $(OBJECTS:.o=.d)
|
-include $(OBJECTS:.o=.d)
|
||||||
|
|
||||||
CXXFLAGS += $(CFLAGS)
|
CXXFLAGS += $(CFLAGS)
|
||||||
|
|
||||||
# standard build rules
|
# reduced compile output when running make without V=1
|
||||||
|
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
||||||
|
ifndef V
|
||||||
|
Q_CC = @echo ' CC '$@;
|
||||||
|
Q_CXX = @echo ' CXX '$@;
|
||||||
|
Q_LD = @echo ' LD '$@;
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# build rules
|
||||||
|
$(TARGET): $(OBJECTS)
|
||||||
|
$(Q_LD)$(CXX) $(SHARED) $^ $(LDFLAGS) -o $@
|
||||||
|
$(STRIP) $@
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
||||||
$(COMPILE.c) -o $@ $<
|
$(Q_CC)$(CC) -o $@ $(CFLAGS) -c $<
|
||||||
|
|
||||||
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
|
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
|
||||||
$(COMPILE.cc) -o $@ $<
|
$(Q_CXX)$(CXX) -o $@ $(CXXFLAGS) -c $<
|
||||||
|
|
||||||
$(TARGET): $(OBJECTS)
|
|
||||||
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
|
|
||||||
|
|
||||||
.PHONY: all clean install uninstall targets
|
|
||||||
|
|
40
src/Assembler/assembler.h
Normal file → Executable file
40
src/Assembler/assembler.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -33,11 +33,11 @@ inline void swapRomHeaderBytes(void *v, unsigned int dwLen)
|
||||||
{
|
{
|
||||||
int *b = (int*)v;
|
int *b = (int*)v;
|
||||||
dwLen /= 4;
|
dwLen /= 4;
|
||||||
for (unsigned int i = 0; i < dwLen; ++i)
|
for (int i = 0; i < dwLen; ++i)
|
||||||
{
|
{
|
||||||
int tmp = b[i];
|
int tmp = b[i];
|
||||||
b[i] = ((tmp & 0xff000000) >> 24) | ((tmp & 0x00ff0000) >> 8) | \
|
b[i] = ((tmp & 0xff000000) >> 24) | ((tmp & 0x00ff0000) >> 8) | \
|
||||||
((tmp & 0x0000ff00) << 8) | ((tmp & 0x000000ff) << 24);
|
((tmp & 0x0000ff00) << 8) | ((tmp & 0x000000ff) << 24);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,22 +113,22 @@ TrailingLoop:
|
||||||
Done:
|
Done:
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
long long beginOffset = (long long)src & 3;
|
long beginOffset = (long)src & 3;
|
||||||
char *readPtr = (char*)src - beginOffset;
|
char *readPtr = (char*)src - beginOffset;
|
||||||
char *writePtr = (char*)dest;
|
char *writePtr = (char*)dest;
|
||||||
|
|
||||||
int swapOffset = beginOffset;
|
int swapOffset = beginOffset;
|
||||||
for (unsigned int i = 0; i < numBytes; ++i)
|
for (int i = 0; i < numBytes; ++i)
|
||||||
{
|
{
|
||||||
*writePtr = readPtr[3 - swapOffset];
|
*writePtr = readPtr[3 - swapOffset];
|
||||||
++writePtr;
|
++writePtr;
|
||||||
++swapOffset;
|
++swapOffset;
|
||||||
if (swapOffset > 3)
|
if (swapOffset > 3)
|
||||||
{
|
{
|
||||||
swapOffset = 0;
|
swapOffset = 0;
|
||||||
readPtr += 4;
|
readPtr += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
77
src/Combiner/AdvancedCombinerManager.cpp
Normal file → Executable file
77
src/Combiner/AdvancedCombinerManager.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -20,78 +20,17 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "AdvancedCombinerManager.h"
|
#include "AdvancedCombinerManager.h"
|
||||||
|
|
||||||
#include "AdvancedTexEnvCombiner.h"
|
|
||||||
#include "CombinerBase.h"
|
|
||||||
#include "CombinerStageCreator.h"
|
|
||||||
#include "CombinerStageMerger.h"
|
|
||||||
#include "CombinerStructs.h"
|
#include "CombinerStructs.h"
|
||||||
#include "DummyCombiner.h"
|
|
||||||
#include "ExtensionChecker.h"
|
#include "ExtensionChecker.h"
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "MultiTexturingExt.h"
|
#include "MultiTexturingExt.h"
|
||||||
#include "OpenGL.h"
|
#include "AdvancedTexEnvCombiner.h"
|
||||||
#include "RomDetector.h"
|
|
||||||
#include "SimpleTexEnvCombiner.h"
|
#include "SimpleTexEnvCombiner.h"
|
||||||
|
#include "DummyCombiner.h"
|
||||||
|
#include "CombinerStageMerger.h"
|
||||||
|
#include "CombinerStageCreator.h"
|
||||||
|
#include "RomDetector.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
static int saRGBExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
|
||||||
SHADE, ENVIRONMENT, CB_ONE, NOISE,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
static int sbRGBExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
|
||||||
SHADE, ENVIRONMENT, CENTER, K4,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
static int mRGBExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
|
||||||
SHADE, ENVIRONMENT, SCALE, COMBINED_ALPHA,
|
|
||||||
TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA, SHADE_ALPHA,
|
|
||||||
ENV_ALPHA, LOD_FRACTION, PRIM_LOD_FRAC, K5,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO,
|
|
||||||
CB_ZERO, CB_ZERO, CB_ZERO, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
static int aRGBExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
|
||||||
SHADE, ENVIRONMENT, CB_ONE, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
static int saAExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
|
||||||
SHADE_ALPHA, ENV_ALPHA, CB_ONE, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
static int sbAExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
|
||||||
SHADE_ALPHA, ENV_ALPHA, CB_ONE, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
static int mAExpanded[] =
|
|
||||||
{
|
|
||||||
LOD_FRACTION, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
|
||||||
SHADE_ALPHA, ENV_ALPHA, PRIM_LOD_FRAC, CB_ZERO,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int aAExpanded[] =
|
|
||||||
{
|
|
||||||
COMBINED, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
|
||||||
SHADE_ALPHA, ENV_ALPHA, CB_ONE, CB_ZERO
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
@ -317,7 +256,7 @@ void AdvancedCombinerManager::getSecondaryCombinerColor(float out[4])
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get color
|
//Get color
|
||||||
m_combiner->getCombinerColor(out, currentTexEnv->vertex.secondaryColor, CB_ONE);
|
m_combiner->getCombinerColor(out, currentTexEnv->vertex.secondaryColor, ONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
18
src/Combiner/AdvancedCombinerManager.h
Normal file → Executable file
18
src/Combiner/AdvancedCombinerManager.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,18 +22,18 @@
|
||||||
#ifndef ADVANCED_COMBINER_MANAGER_H_
|
#ifndef ADVANCED_COMBINER_MANAGER_H_
|
||||||
#define ADVANCED_COMBINER_MANAGER_H_
|
#define ADVANCED_COMBINER_MANAGER_H_
|
||||||
|
|
||||||
#include "CombinerCache.h"
|
|
||||||
#include "CombinerStructs.h"
|
|
||||||
#include "GBIDefs.h"
|
#include "GBIDefs.h"
|
||||||
|
#include "CombinerStructs.h"
|
||||||
|
#include "CombinerCache.h"
|
||||||
|
|
||||||
//Forward declarations
|
//Forward declarations
|
||||||
class AdvancedTexEnvCombiner;
|
|
||||||
class CombinerBase;
|
|
||||||
class CombinerCache;
|
|
||||||
struct CombineCycle;
|
|
||||||
struct Combiner;
|
|
||||||
struct CombinerStage;
|
|
||||||
struct TexEnvCombiner;
|
struct TexEnvCombiner;
|
||||||
|
struct CombineCycle;
|
||||||
|
struct CombinerStage;
|
||||||
|
struct Combiner;
|
||||||
|
class AdvancedTexEnvCombiner;
|
||||||
|
class CombinerCache;
|
||||||
|
class CombinerBase;
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//! Advanced Texture Environment Combiner
|
//! Advanced Texture Environment Combiner
|
||||||
|
|
66
src/Combiner/AdvancedTexEnvCombiner.cpp
Normal file → Executable file
66
src/Combiner/AdvancedTexEnvCombiner.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -20,12 +20,11 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using std::max;
|
using std::max;
|
||||||
#include "AdvancedTexEnvCombiner.h"
|
#include "AdvancedTexEnvCombiner.h"
|
||||||
#include "CombinerStructs.h"
|
#include "CombinerStructs.h"
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "MultiTexturingExt.h" //glActiveTextureARB
|
#include "MultiTexturingExt.h" //glActiveTextureARB
|
||||||
|
#include "ExtensionChecker.h"
|
||||||
|
|
||||||
#ifndef GL_ATI_texture_env_combine3
|
#ifndef GL_ATI_texture_env_combine3
|
||||||
#define GL_ATI_texture_env_combine3
|
#define GL_ATI_texture_env_combine3
|
||||||
|
@ -42,52 +41,6 @@ using std::max;
|
||||||
#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
|
#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
|
||||||
#endif // GL_ATIX_texture_env_route
|
#endif // GL_ATIX_texture_env_route
|
||||||
|
|
||||||
static TexEnvCombinerArg TexEnvArgs[] =
|
|
||||||
{
|
|
||||||
// CMB
|
|
||||||
{ GL_PREVIOUS_ARB, GL_SRC_COLOR },
|
|
||||||
// T0
|
|
||||||
{ GL_TEXTURE, GL_SRC_COLOR },
|
|
||||||
// T1
|
|
||||||
{ GL_TEXTURE, GL_SRC_COLOR },
|
|
||||||
// PRIM
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// SHADE
|
|
||||||
{ GL_PRIMARY_COLOR_ARB, GL_SRC_COLOR },
|
|
||||||
// ENV
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// CENTER
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// SCALE
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// CMBALPHA
|
|
||||||
{ GL_PREVIOUS_ARB, GL_SRC_ALPHA },
|
|
||||||
// T0ALPHA
|
|
||||||
{ GL_TEXTURE, GL_SRC_ALPHA },
|
|
||||||
// T1ALPHA
|
|
||||||
{ GL_TEXTURE, GL_SRC_ALPHA },
|
|
||||||
// PRIMALPHA
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_ALPHA },
|
|
||||||
// SHADEALPHA
|
|
||||||
{ GL_PRIMARY_COLOR_ARB, GL_SRC_ALPHA },
|
|
||||||
// ENVALPHA
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// LODFRAC
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// PRIMLODFRAC
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// NOISE
|
|
||||||
{ GL_TEXTURE, GL_SRC_COLOR },
|
|
||||||
// K4
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// K5
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// CB_ONE
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
|
||||||
// CB_ZERO
|
|
||||||
{ GL_CONSTANT_ARB, GL_SRC_COLOR }
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -124,8 +77,8 @@ void AdvancedTexEnvCombiner::initialize()
|
||||||
|
|
||||||
if ( ATI_texture_env_combine3 )
|
if ( ATI_texture_env_combine3 )
|
||||||
{
|
{
|
||||||
TexEnvArgs[CB_ONE].source = GL_ONE;
|
TexEnvArgs[ONE].source = GL_ONE;
|
||||||
TexEnvArgs[CB_ZERO].source = GL_ZERO;
|
TexEnvArgs[ZERO].source = GL_ZERO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,6 +186,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
TexEnvCombiner* envCombiner = new TexEnvCombiner();
|
TexEnvCombiner* envCombiner = new TexEnvCombiner();
|
||||||
|
|
||||||
int curUnit;
|
int curUnit;
|
||||||
|
int combinedUnit;
|
||||||
|
|
||||||
const int openGLMaxTextureUnits = 8;
|
const int openGLMaxTextureUnits = 8;
|
||||||
|
|
||||||
|
@ -274,7 +228,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
sb = m_primColor[3];
|
sb = m_primColor[3];
|
||||||
else if (alphaCombiner->stage[i].op[j].param1 == ENV_ALPHA)
|
else if (alphaCombiner->stage[i].op[j].param1 == ENV_ALPHA)
|
||||||
sb = m_envColor[3];
|
sb = m_envColor[3];
|
||||||
else if (alphaCombiner->stage[i].op[j].param1 == CB_ONE)
|
else if (alphaCombiner->stage[i].op[j].param1 == ONE)
|
||||||
sb = 1.0f;
|
sb = 1.0f;
|
||||||
|
|
||||||
if (((alphaCombiner->stage[i].numOps - j) >= 3) &&
|
if (((alphaCombiner->stage[i].numOps - j) >= 3) &&
|
||||||
|
@ -287,7 +241,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
envCombiner->usesT0 |= alphaCombiner->stage[i].op[j].param1 == TEXEL0_ALPHA;
|
envCombiner->usesT0 |= alphaCombiner->stage[i].op[j].param1 == TEXEL0_ALPHA;
|
||||||
envCombiner->usesT1 |= alphaCombiner->stage[i].op[j].param1 == TEXEL1_ALPHA;
|
envCombiner->usesT1 |= alphaCombiner->stage[i].op[j].param1 == TEXEL1_ALPHA;
|
||||||
|
|
||||||
if (alphaCombiner->stage[i].op[j].param1 == CB_ONE)
|
if (alphaCombiner->stage[i].op[j].param1 == ONE)
|
||||||
{
|
{
|
||||||
SetAlphaCombinerValues( curUnit, arg0, envCombiner->alpha[curUnit].arg0.source, GL_ONE_MINUS_SRC_ALPHA );
|
SetAlphaCombinerValues( curUnit, arg0, envCombiner->alpha[curUnit].arg0.source, GL_ONE_MINUS_SRC_ALPHA );
|
||||||
}
|
}
|
||||||
|
@ -343,7 +297,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
(alphaCombiner->stage[i].op[j].param1 == TEXEL1_ALPHA) && (curUnit == 0))
|
(alphaCombiner->stage[i].op[j].param1 == TEXEL1_ALPHA) && (curUnit == 0))
|
||||||
curUnit++;
|
curUnit++;
|
||||||
|
|
||||||
if ((j > 0) && (alphaCombiner->stage[i].op[j-1].op == LOAD) && (alphaCombiner->stage[i].op[j-1].param1 == CB_ONE))
|
if ((j > 0) && (alphaCombiner->stage[i].op[j-1].op == LOAD) && (alphaCombiner->stage[i].op[j-1].param1 == ONE))
|
||||||
{
|
{
|
||||||
SetAlphaCombinerArg( curUnit, arg0, alphaCombiner->stage[i].op[j].param1 );
|
SetAlphaCombinerArg( curUnit, arg0, alphaCombiner->stage[i].op[j].param1 );
|
||||||
envCombiner->alpha[curUnit].arg0.operand = GL_ONE_MINUS_SRC_ALPHA;
|
envCombiner->alpha[curUnit].arg0.operand = GL_ONE_MINUS_SRC_ALPHA;
|
||||||
|
@ -407,6 +361,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
combinedUnit = max( curUnit - 1, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
envCombiner->usedUnits = max( curUnit, 1 );
|
envCombiner->usedUnits = max( curUnit, 1 );
|
||||||
|
@ -482,7 +437,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
((colorCombiner->stage[i].op[j].param1 == TEXEL1) || (colorCombiner->stage[i].op[j].param1 == TEXEL1_ALPHA)) && (curUnit == 0))
|
((colorCombiner->stage[i].op[j].param1 == TEXEL1) || (colorCombiner->stage[i].op[j].param1 == TEXEL1_ALPHA)) && (curUnit == 0))
|
||||||
curUnit++;
|
curUnit++;
|
||||||
|
|
||||||
if ((j > 0) && (colorCombiner->stage[i].op[j-1].op == LOAD) && (colorCombiner->stage[i].op[j-1].param1 == CB_ONE))
|
if ((j > 0) && (colorCombiner->stage[i].op[j-1].op == LOAD) && (colorCombiner->stage[i].op[j-1].param1 == ONE))
|
||||||
{
|
{
|
||||||
SetColorCombinerArg( curUnit, arg0, colorCombiner->stage[i].op[j].param1 );
|
SetColorCombinerArg( curUnit, arg0, colorCombiner->stage[i].op[j].param1 );
|
||||||
envCombiner->color[curUnit].arg0.operand = GL_ONE_MINUS_SRC_COLOR;
|
envCombiner->color[curUnit].arg0.operand = GL_ONE_MINUS_SRC_COLOR;
|
||||||
|
@ -579,6 +534,7 @@ TexEnvCombiner* AdvancedTexEnvCombiner::createNewTextureEnviroment(Combiner* col
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
combinedUnit = max( curUnit - 1, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
envCombiner->usedUnits = max( (unsigned short)curUnit, envCombiner->usedUnits );
|
envCombiner->usedUnits = max( (unsigned short)curUnit, envCombiner->usedUnits );
|
||||||
|
|
49
src/Combiner/AdvancedTexEnvCombiner.h
Normal file → Executable file
49
src/Combiner/AdvancedTexEnvCombiner.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -25,7 +25,6 @@
|
||||||
#include "CombinerBase.h"
|
#include "CombinerBase.h"
|
||||||
#include "CombinerStructs.h"
|
#include "CombinerStructs.h"
|
||||||
|
|
||||||
class AdvancedTexEnvCombiner;
|
|
||||||
struct TexEnvCombiner;
|
struct TexEnvCombiner;
|
||||||
|
|
||||||
#ifndef GL_ARB_texture_env_combine
|
#ifndef GL_ARB_texture_env_combine
|
||||||
|
@ -55,6 +54,52 @@ struct TexEnvCombiner;
|
||||||
#define GL_SUBTRACT_ARB 0x84E7
|
#define GL_SUBTRACT_ARB 0x84E7
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static TexEnvCombinerArg TexEnvArgs[] =
|
||||||
|
{
|
||||||
|
// CMB
|
||||||
|
{ GL_PREVIOUS_ARB, GL_SRC_COLOR },
|
||||||
|
// T0
|
||||||
|
{ GL_TEXTURE, GL_SRC_COLOR },
|
||||||
|
// T1
|
||||||
|
{ GL_TEXTURE, GL_SRC_COLOR },
|
||||||
|
// PRIM
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// SHADE
|
||||||
|
{ GL_PRIMARY_COLOR_ARB, GL_SRC_COLOR },
|
||||||
|
// ENV
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// CENTER
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// SCALE
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// CMBALPHA
|
||||||
|
{ GL_PREVIOUS_ARB, GL_SRC_ALPHA },
|
||||||
|
// T0ALPHA
|
||||||
|
{ GL_TEXTURE, GL_SRC_ALPHA },
|
||||||
|
// T1ALPHA
|
||||||
|
{ GL_TEXTURE, GL_SRC_ALPHA },
|
||||||
|
// PRIMALPHA
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_ALPHA },
|
||||||
|
// SHADEALPHA
|
||||||
|
{ GL_PRIMARY_COLOR_ARB, GL_SRC_ALPHA },
|
||||||
|
// ENVALPHA
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// LODFRAC
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// PRIMLODFRAC
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// NOISE
|
||||||
|
{ GL_TEXTURE, GL_SRC_COLOR },
|
||||||
|
// K4
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// K5
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// ONE
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR },
|
||||||
|
// ZERO
|
||||||
|
{ GL_CONSTANT_ARB, GL_SRC_COLOR }
|
||||||
|
};
|
||||||
|
|
||||||
#define SetColorCombinerValues( n, a, s, o ) \
|
#define SetColorCombinerValues( n, a, s, o ) \
|
||||||
envCombiner->color[n].a.source = s; \
|
envCombiner->color[n].a.source = s; \
|
||||||
envCombiner->color[n].a.operand = o
|
envCombiner->color[n].a.operand = o
|
||||||
|
|
21
src/Combiner/CombinerBase.cpp
Normal file → Executable file
21
src/Combiner/CombinerBase.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -20,7 +20,6 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "CombinerBase.h"
|
#include "CombinerBase.h"
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
#include "CombinerStructs.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -32,6 +31,8 @@ CombinerBase::CombinerBase()
|
||||||
m_fillColor[1] = m_blendColor[1] = m_primColor[1] = m_envColor[1] = 0;
|
m_fillColor[1] = m_blendColor[1] = m_primColor[1] = m_envColor[1] = 0;
|
||||||
m_fillColor[2] = m_blendColor[2] = m_primColor[2] = m_envColor[2] = 0;
|
m_fillColor[2] = m_blendColor[2] = m_primColor[2] = m_envColor[2] = 0;
|
||||||
m_fillColor[3] = m_blendColor[3] = m_primColor[3] = m_envColor[3] = 1;
|
m_fillColor[3] = m_blendColor[3] = m_primColor[3] = m_envColor[3] = 1;
|
||||||
|
m_fillColor[4] = 0;
|
||||||
|
m_fillColor[5] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -110,14 +111,14 @@ void CombinerBase::setEnvColor(float r, float g, float b, float a)
|
||||||
//! \arg \c PRIMITIVE_ALPHA Get color from primatives alpha value
|
//! \arg \c PRIMITIVE_ALPHA Get color from primatives alpha value
|
||||||
//! \arg \c ENV_ALPHA Get color from environment colors alpha value
|
//! \arg \c ENV_ALPHA Get color from environment colors alpha value
|
||||||
//! \arg \c PRIM_LOD_FRAC Get color from primative-LOD-frac value
|
//! \arg \c PRIM_LOD_FRAC Get color from primative-LOD-frac value
|
||||||
//! \arg \c CB_ONE Get white color
|
//! \arg \c ONE Get white color
|
||||||
//! \arg \c CB_ZERO Get black color
|
//! \arg \c ZERO Get black color
|
||||||
//! @param[in] alphaSource From which alphasource to retrive alpha value
|
//! @param[in] alphaSource From which alphasource to retrive alpha value
|
||||||
//! \arg \c PRIMITIVE_ALPHA Get alpha value from primitive colors alpha value
|
//! \arg \c PRIMITIVE_ALPHA Get alpha value from primitive colors alpha value
|
||||||
//! \arg \c ENV_ALPHA Get alpha value from environment colors alpha value
|
//! \arg \c ENV_ALPHA Get alpha value from environment colors alpha value
|
||||||
//! \arg \c PRIM_LOD_FRAC Get alpha value from primative-LOD-frac value
|
//! \arg \c PRIM_LOD_FRAC Get alpha value from primative-LOD-frac value
|
||||||
//! \arg \c CB_ONE Set alpha value to 1.0
|
//! \arg \c ONE Set alpha value to 1.0
|
||||||
//! \arg \c CB_ZERO Set alpha value to 0.0
|
//! \arg \c ZERO Set alpha value to 0.0
|
||||||
//! @param[out] out The combiner color with color and alpha value
|
//! @param[out] out The combiner color with color and alpha value
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CombinerBase::getCombinerColor(float out[4], short colorSrc, short alphaSrc)
|
void CombinerBase::getCombinerColor(float out[4], short colorSrc, short alphaSrc)
|
||||||
|
@ -150,12 +151,12 @@ void CombinerBase::getCombinerColor(float out[4], short colorSrc, short alphaSrc
|
||||||
out[1] = m_primLodFrac;
|
out[1] = m_primLodFrac;
|
||||||
out[2] = m_primLodFrac;
|
out[2] = m_primLodFrac;
|
||||||
break;
|
break;
|
||||||
case CB_ONE:
|
case ONE:
|
||||||
out[0] = 1.0f;
|
out[0] = 1.0f;
|
||||||
out[1] = 1.0f;
|
out[1] = 1.0f;
|
||||||
out[2] = 1.0f;
|
out[2] = 1.0f;
|
||||||
break;
|
break;
|
||||||
case CB_ZERO:
|
case ZERO:
|
||||||
out[0] = 0.0f;
|
out[0] = 0.0f;
|
||||||
out[1] = 0.0f;
|
out[1] = 0.0f;
|
||||||
out[2] = 0.0f;
|
out[2] = 0.0f;
|
||||||
|
@ -174,10 +175,10 @@ void CombinerBase::getCombinerColor(float out[4], short colorSrc, short alphaSrc
|
||||||
case PRIM_LOD_FRAC:
|
case PRIM_LOD_FRAC:
|
||||||
out[3] = m_primLodFrac;
|
out[3] = m_primLodFrac;
|
||||||
break;
|
break;
|
||||||
case CB_ONE:
|
case ONE:
|
||||||
out[3] = 1.0f;
|
out[3] = 1.0f;
|
||||||
break;
|
break;
|
||||||
case CB_ZERO:
|
case ZERO:
|
||||||
out[3] = 0.0f;
|
out[3] = 0.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
2
src/Combiner/CombinerBase.h
Normal file → Executable file
2
src/Combiner/CombinerBase.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
4
src/Combiner/CombinerCache.cpp
Normal file → Executable file
4
src/Combiner/CombinerCache.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
#include "CombinerCache.h"
|
#include "CombinerCache.h"
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//* New Compiled Combiner
|
//* New Compiled Combiner
|
||||||
//! Function used to add decoded mux values and the result of them to the list.
|
//! Function used to add decoded mux values and the result of them to the list.
|
||||||
|
|
7
src/Combiner/CombinerCache.h
Normal file → Executable file
7
src/Combiner/CombinerCache.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,11 +22,8 @@
|
||||||
#ifndef COMBINER_CACHE_H_
|
#ifndef COMBINER_CACHE_H_
|
||||||
#define COMBINER_CACHE_H_
|
#define COMBINER_CACHE_H_
|
||||||
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
#include "CombinerStructs.h"
|
||||||
|
#include <list>
|
||||||
struct TexEnvCombiner;
|
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//* Cached Combiner
|
//* Cached Combiner
|
||||||
|
|
20
src/Combiner/CombinerStageCreator.cpp
Normal file → Executable file
20
src/Combiner/CombinerStageCreator.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -28,8 +28,6 @@
|
||||||
|
|
||||||
#include "CombinerStageCreator.h"
|
#include "CombinerStageCreator.h"
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//* Set Stage
|
//* Set Stage
|
||||||
//! Function used to set combiner stage, tries to simplify and optimize as
|
//! Function used to set combiner stage, tries to simplify and optimize as
|
||||||
|
@ -46,10 +44,10 @@ void setStage(CombineCycle* combineCycle, CombinerStage* stageOut)
|
||||||
stageOut->numOps = 1;
|
stageOut->numOps = 1;
|
||||||
|
|
||||||
// If we're just subtracting zero, skip it
|
// If we're just subtracting zero, skip it
|
||||||
if (combineCycle->subValue != CB_ZERO)
|
if (combineCycle->subValue != ZERO)
|
||||||
{
|
{
|
||||||
if (combineCycle->subValue == stageOut->op[0].param1)
|
if (combineCycle->subValue == stageOut->op[0].param1)
|
||||||
stageOut->op[0].param1 = CB_ZERO;
|
stageOut->op[0].param1 = ZERO;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Subract operation
|
//Subract operation
|
||||||
|
@ -60,17 +58,17 @@ void setStage(CombineCycle* combineCycle, CombinerStage* stageOut)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Multiply operation
|
//Multiply operation
|
||||||
if ((stageOut->numOps > 1) || (stageOut->op[0].param1 != CB_ZERO))
|
if ((stageOut->numOps > 1) || (stageOut->op[0].param1 != ZERO))
|
||||||
{
|
{
|
||||||
if (combineCycle->multValue == CB_ZERO)
|
if (combineCycle->multValue == ZERO)
|
||||||
{
|
{
|
||||||
stageOut->numOps = 1;
|
stageOut->numOps = 1;
|
||||||
stageOut->op[0].op = LOAD;
|
stageOut->op[0].op = LOAD;
|
||||||
stageOut->op[0].param1 = CB_ZERO;
|
stageOut->op[0].param1 = ZERO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( stageOut->numOps == 1 && stageOut->op[0].param1 == CB_ONE )
|
if ( stageOut->numOps == 1 && stageOut->op[0].param1 == ONE )
|
||||||
{
|
{
|
||||||
//LOAD
|
//LOAD
|
||||||
stageOut->op[0].param1 = combineCycle->multValue;
|
stageOut->op[0].param1 = combineCycle->multValue;
|
||||||
|
@ -86,10 +84,10 @@ void setStage(CombineCycle* combineCycle, CombinerStage* stageOut)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Don't bother adding zero
|
//Don't bother adding zero
|
||||||
if (combineCycle->addValue != CB_ZERO)
|
if (combineCycle->addValue != ZERO)
|
||||||
{
|
{
|
||||||
// If all we have so far is zero, then load this instead
|
// If all we have so far is zero, then load this instead
|
||||||
if ((stageOut->numOps == 1) && (stageOut->op[0].param1 == CB_ZERO))
|
if ((stageOut->numOps == 1) && (stageOut->op[0].param1 == ZERO))
|
||||||
{
|
{
|
||||||
stageOut->op[0].param1 = combineCycle->addValue;
|
stageOut->op[0].param1 = combineCycle->addValue;
|
||||||
}
|
}
|
||||||
|
|
7
src/Combiner/CombinerStageCreator.h
Normal file → Executable file
7
src/Combiner/CombinerStageCreator.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -24,10 +24,7 @@
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
#include "CombinerStructs.h"
|
||||||
|
|
||||||
struct CombineCycle;
|
|
||||||
struct CombinerStage;
|
|
||||||
|
|
||||||
//Function used to set combiner stage
|
//Function used to set combiner stage
|
||||||
void setStage(CombineCycle* combineCycle, CombinerStage* stageOut);
|
void setStage(CombineCycle* combineCycle, CombinerStage* stageOut);
|
||||||
|
|
||||||
#endif
|
#endif
|
2
src/Combiner/CombinerStageMerger.cpp
Normal file → Executable file
2
src/Combiner/CombinerStageMerger.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
2
src/Combiner/CombinerStageMerger.h
Normal file → Executable file
2
src/Combiner/CombinerStageMerger.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
65
src/Combiner/CombinerStructs.h
Normal file → Executable file
65
src/Combiner/CombinerStructs.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
#ifndef COMBINER_STRUCTS_H_
|
#ifndef COMBINER_STRUCTS_H_
|
||||||
#define COMBINER_STRUCTS_H_
|
#define COMBINER_STRUCTS_H_
|
||||||
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
// Internal combiner commands
|
// Internal combiner commands
|
||||||
#define LOAD 0
|
#define LOAD 0
|
||||||
|
@ -53,8 +53,8 @@
|
||||||
#define NOISE 16
|
#define NOISE 16
|
||||||
#define K4 17
|
#define K4 17
|
||||||
#define K5 18
|
#define K5 18
|
||||||
#define CB_ONE 19
|
#define ONE 19
|
||||||
#define CB_ZERO 20
|
#define ZERO 20
|
||||||
|
|
||||||
//* Combiner data
|
//* Combiner data
|
||||||
//! Defines how mux-values are coded.
|
//! Defines how mux-values are coded.
|
||||||
|
@ -127,6 +127,63 @@ struct CombineCycle
|
||||||
int multValue; //!< Multiplication
|
int multValue; //!< Multiplication
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int saRGBExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
||||||
|
SHADE, ENVIRONMENT, ONE, NOISE,
|
||||||
|
ZERO, ZERO, ZERO, ZERO,
|
||||||
|
ZERO, ZERO, ZERO, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
|
static int sbRGBExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
||||||
|
SHADE, ENVIRONMENT, CENTER, K4,
|
||||||
|
ZERO, ZERO, ZERO, ZERO,
|
||||||
|
ZERO, ZERO, ZERO, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
|
static int mRGBExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
||||||
|
SHADE, ENVIRONMENT, SCALE, COMBINED_ALPHA,
|
||||||
|
TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA, SHADE_ALPHA,
|
||||||
|
ENV_ALPHA, LOD_FRACTION, PRIM_LOD_FRAC, K5,
|
||||||
|
ZERO, ZERO, ZERO, ZERO,
|
||||||
|
ZERO, ZERO, ZERO, ZERO,
|
||||||
|
ZERO, ZERO, ZERO, ZERO,
|
||||||
|
ZERO, ZERO, ZERO, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
|
static int aRGBExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0, TEXEL1, PRIMITIVE,
|
||||||
|
SHADE, ENVIRONMENT, ONE, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
|
static int saAExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
||||||
|
SHADE_ALPHA, ENV_ALPHA, ONE, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
|
static int sbAExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
||||||
|
SHADE_ALPHA, ENV_ALPHA, ONE, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
|
static int mAExpanded[] =
|
||||||
|
{
|
||||||
|
LOD_FRACTION, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
||||||
|
SHADE_ALPHA, ENV_ALPHA, PRIM_LOD_FRAC, ZERO,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int aAExpanded[] =
|
||||||
|
{
|
||||||
|
COMBINED, TEXEL0_ALPHA, TEXEL1_ALPHA, PRIMITIVE_ALPHA,
|
||||||
|
SHADE_ALPHA, ENV_ALPHA, ONE, ZERO
|
||||||
|
};
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//! Texture Environment Combiner Argument
|
//! Texture Environment Combiner Argument
|
||||||
|
|
4
src/Combiner/DummyCombiner.cpp
Normal file → Executable file
4
src/Combiner/DummyCombiner.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
|
||||||
#include "DummyCombiner.h"
|
#include "DummyCombiner.h"
|
||||||
|
#include "CombinerStructs.h"
|
||||||
#include "ExtensionChecker.h"
|
#include "ExtensionChecker.h"
|
||||||
#include "MultiTexturingExt.h"
|
#include "MultiTexturingExt.h"
|
||||||
|
|
||||||
|
|
2
src/Combiner/DummyCombiner.h
Normal file → Executable file
2
src/Combiner/DummyCombiner.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
14
src/Combiner/SimpleTexEnvCombiner.cpp
Normal file → Executable file
14
src/Combiner/SimpleTexEnvCombiner.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,12 +19,12 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "CombinerStructs.h"
|
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "MultiTexturingExt.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "SimpleTexEnvCombiner.h"
|
#include "SimpleTexEnvCombiner.h"
|
||||||
|
#include "CombinerStructs.h"
|
||||||
|
#include "MultiTexturingExt.h"
|
||||||
|
#include "ExtensionChecker.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
@ -172,7 +172,7 @@ TexEnvCombiner* SimpleTexEnvCombiner::createNewTextureEnviroment(Combiner* color
|
||||||
if (op->param1 == TEXEL0 || op->param1 == TEXEL0_ALPHA)
|
if (op->param1 == TEXEL0 || op->param1 == TEXEL0_ALPHA)
|
||||||
{
|
{
|
||||||
if ( mode == GL_MODULATE )
|
if ( mode == GL_MODULATE )
|
||||||
m_color = CB_ONE;
|
m_color = ONE;
|
||||||
|
|
||||||
m_usesTexture0 = true;
|
m_usesTexture0 = true;
|
||||||
m_usesTexture1 = false;
|
m_usesTexture1 = false;
|
||||||
|
@ -180,7 +180,7 @@ TexEnvCombiner* SimpleTexEnvCombiner::createNewTextureEnviroment(Combiner* color
|
||||||
else if ( op->param1 == TEXEL1 || op->param1 == TEXEL1_ALPHA )
|
else if ( op->param1 == TEXEL1 || op->param1 == TEXEL1_ALPHA )
|
||||||
{
|
{
|
||||||
if ( mode == GL_MODULATE )
|
if ( mode == GL_MODULATE )
|
||||||
m_color = CB_ONE;
|
m_color = ONE;
|
||||||
|
|
||||||
m_usesTexture0 = false;
|
m_usesTexture0 = false;
|
||||||
m_usesTexture1 = true;
|
m_usesTexture1 = true;
|
||||||
|
|
9
src/Combiner/SimpleTexEnvCombiner.h
Normal file → Executable file
9
src/Combiner/SimpleTexEnvCombiner.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,15 +22,14 @@
|
||||||
#ifndef SIMPLE_TEX_ENV_COMBINER_H_
|
#ifndef SIMPLE_TEX_ENV_COMBINER_H_
|
||||||
#define SIMPLE_TEX_ENV_COMBINER_H_
|
#define SIMPLE_TEX_ENV_COMBINER_H_
|
||||||
|
|
||||||
#include "CombinerBase.h"
|
|
||||||
#include "CombinerStructs.h"
|
|
||||||
#include "GBIDefs.h"
|
#include "GBIDefs.h"
|
||||||
|
#include "CombinerStructs.h"
|
||||||
|
#include "CombinerBase.h"
|
||||||
|
|
||||||
//Forward declarations
|
//Forward declarations
|
||||||
struct CombineCycle;
|
struct CombineCycle;
|
||||||
struct Combiner;
|
|
||||||
struct CombinerStage;
|
struct CombinerStage;
|
||||||
struct TexEnvCombiner;
|
struct Combiner;
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//! Simple Texture Environment Combiner
|
//! Simple Texture Environment Combiner
|
||||||
|
|
12
src/DisplayListParser.cpp
Normal file → Executable file
12
src/DisplayListParser.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -20,14 +20,12 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "DisplayListParser.h"
|
#include "DisplayListParser.h"
|
||||||
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "Memory.h"
|
#include "Memory.h"
|
||||||
#include "OpenGLRenderer.h"
|
#include "GBI.h"
|
||||||
#include "RDP.h"
|
|
||||||
#include "RSP.h"
|
#include "RSP.h"
|
||||||
#include "UCodeDefs.h"
|
#include "RDP.h"
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
|
#include "GBIDefs.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//* Task
|
//* Task
|
||||||
|
|
2
src/DisplayListParser.h
Normal file → Executable file
2
src/DisplayListParser.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
8
src/ExtensionChecker.cpp
Normal file → Executable file
8
src/ExtensionChecker.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,11 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
#include "ExtensionChecker.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Is Extension Supported
|
//! Is Extension Supported
|
||||||
|
|
6
src/ExtensionChecker.h
Normal file → Executable file
6
src/ExtensionChecker.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,9 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef EXTENSION_CHECKER_H_
|
#ifndef EXTENSION_CHECKER_H
|
||||||
#define EXTENSION_CHECKER_H_
|
#define EXTENSION_CHECKER_H_
|
||||||
|
|
||||||
bool isExtensionSupported( const char *extension );
|
bool isExtensionSupported( const char *extension );
|
||||||
|
|
||||||
#endif
|
#endif
|
9
src/FogManager.cpp
Normal file → Executable file
9
src/FogManager.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -20,10 +20,10 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "FogManager.h"
|
#include "FogManager.h"
|
||||||
#include "OpenGL.h"
|
#include "ExtensionChecker.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -92,8 +92,7 @@ void FogManager::initialize()
|
||||||
static bool fogExtensionInitialized = false;
|
static bool fogExtensionInitialized = false;
|
||||||
if ( !fogExtensionInitialized )
|
if ( !fogExtensionInitialized )
|
||||||
{
|
{
|
||||||
m_fogExtensionsSupported = isExtensionSupported("GL_EXT_fog_coord");
|
if ( m_fogExtensionsSupported = isExtensionSupported("GL_EXT_fog_coord") )
|
||||||
if ( m_fogExtensionsSupported )
|
|
||||||
{
|
{
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)wglGetProcAddress( "glFogCoordfEXT" );
|
glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)wglGetProcAddress( "glFogCoordfEXT" );
|
||||||
|
|
2
src/FogManager.h
Normal file → Executable file
2
src/FogManager.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
14
src/GBI/GBI.cpp
Normal file → Executable file
14
src/GBI/GBI.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -20,18 +20,14 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "GBI.h"
|
#include "GBI.h"
|
||||||
|
|
||||||
#include "GBIDefs.h"
|
#include "GBIDefs.h"
|
||||||
#include "Logger.h"
|
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "RDP.h"
|
|
||||||
#include "RSP.h"
|
#include "RSP.h"
|
||||||
#include "UCodeIdentificationData.h"
|
#include "RDP.h"
|
||||||
#include "UCodeSelector.h"
|
#include "UCodeSelector.h"
|
||||||
|
#include "UCodeIdentificationData.h"
|
||||||
|
#include "OpenGLManager.h"
|
||||||
|
#include "Logger.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
#include "m64p_types.h"
|
|
||||||
|
|
||||||
class DisplayListParser;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Static Variables
|
//! Static Variables
|
||||||
|
|
13
src/GBI/GBI.h
Normal file → Executable file
13
src/GBI/GBI.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -23,22 +23,21 @@
|
||||||
#define GRAPHIC_BINARY_INTERFACE_H_
|
#define GRAPHIC_BINARY_INTERFACE_H_
|
||||||
|
|
||||||
|
|
||||||
#include "RDPInstructions.h"
|
#include "UCodeDefs.h"
|
||||||
#include "UCode0.h" //Super Mario 64
|
#include "UCode0.h" //Super Mario 64
|
||||||
#include "UCode1.h" //Games like Mario Kart 64, Starfox 64
|
#include "UCode1.h" //Games like Mario Kart 64, Starfox 64
|
||||||
#include "UCode10.h" //Conker Bad Fur Day
|
|
||||||
#include "UCode2.h" //Golden Eye
|
#include "UCode2.h" //Golden Eye
|
||||||
#include "UCode4.h" //Wave Race 64
|
#include "UCode4.h" //Wave Race 64
|
||||||
#include "UCode5.h" //Newer Games
|
#include "UCode5.h" //Newer Games
|
||||||
#include "UCode6.h" //Diddy Kong Racing
|
#include "UCode6.h" //Diddy Kong Racing
|
||||||
#include "UCode7.h" //Yoshi's Story
|
#include "UCode7.h" //Yoshi's Story
|
||||||
#include "UCode9.h" //Perfect Dark
|
#include "UCode9.h" //Perfect Dark
|
||||||
#include "UCodeDefs.h"
|
#include "UCode10.h" //Conker Bad Fur Day
|
||||||
|
#include "RDPInstructions.h"
|
||||||
|
|
||||||
class DisplayListParser;
|
|
||||||
class Memory;
|
|
||||||
class RDP;
|
|
||||||
class RSP;
|
class RSP;
|
||||||
|
class RDP;
|
||||||
|
class Memory;
|
||||||
class UCodeSelector;
|
class UCodeSelector;
|
||||||
|
|
||||||
// Allows easier setting of GBI commands
|
// Allows easier setting of GBI commands
|
||||||
|
|
39
src/GBI/GBIDefs.h
Normal file → Executable file
39
src/GBI/GBIDefs.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -279,25 +279,24 @@ enum G_CYCLE_TYPE {
|
||||||
GBI::G_CULL_BOTH = ucode##_CULL_BOTH; \
|
GBI::G_CULL_BOTH = ucode##_CULL_BOTH; \
|
||||||
GBI::G_CLIPPING = ucode##_CLIPPING; \
|
GBI::G_CLIPPING = ucode##_CLIPPING; \
|
||||||
\
|
\
|
||||||
GBI::G_MV_VIEWPORT = ucode##_MV_VIEWPORT; \
|
GBI::G_MV_VIEWPORT = ucode##_MV_VIEWPORT; //\
|
||||||
/* \
|
//\
|
||||||
GBI::G_MWO_aLIGHT_1 = ucode##_MWO_aLIGHT_1; \
|
//GBI::G_MWO_aLIGHT_1 = ucode##_MWO_aLIGHT_1; \
|
||||||
GBI::G_MWO_bLIGHT_1 = ucode##_MWO_bLIGHT_1; \
|
//GBI::G_MWO_bLIGHT_1 = ucode##_MWO_bLIGHT_1; \
|
||||||
GBI::G_MWO_aLIGHT_2 = ucode##_MWO_aLIGHT_2; \
|
//GBI::G_MWO_aLIGHT_2 = ucode##_MWO_aLIGHT_2; \
|
||||||
GBI::G_MWO_bLIGHT_2 = ucode##_MWO_bLIGHT_2; \
|
//GBI::G_MWO_bLIGHT_2 = ucode##_MWO_bLIGHT_2; \
|
||||||
GBI::G_MWO_aLIGHT_3 = ucode##_MWO_aLIGHT_3; \
|
//GBI::G_MWO_aLIGHT_3 = ucode##_MWO_aLIGHT_3; \
|
||||||
GBI::G_MWO_bLIGHT_3 = ucode##_MWO_bLIGHT_3; \
|
//GBI::G_MWO_bLIGHT_3 = ucode##_MWO_bLIGHT_3; \
|
||||||
GBI::G_MWO_aLIGHT_4 = ucode##_MWO_aLIGHT_4; \
|
//GBI::G_MWO_aLIGHT_4 = ucode##_MWO_aLIGHT_4; \
|
||||||
GBI::G_MWO_bLIGHT_4 = ucode##_MWO_bLIGHT_4; \
|
//GBI::G_MWO_bLIGHT_4 = ucode##_MWO_bLIGHT_4; \
|
||||||
GBI::G_MWO_aLIGHT_5 = ucode##_MWO_aLIGHT_5; \
|
//GBI::G_MWO_aLIGHT_5 = ucode##_MWO_aLIGHT_5; \
|
||||||
GBI::G_MWO_bLIGHT_5 = ucode##_MWO_bLIGHT_5; \
|
//GBI::G_MWO_bLIGHT_5 = ucode##_MWO_bLIGHT_5; \
|
||||||
GBI::G_MWO_aLIGHT_6 = ucode##_MWO_aLIGHT_6; \
|
//GBI::G_MWO_aLIGHT_6 = ucode##_MWO_aLIGHT_6; \
|
||||||
GBI::G_MWO_bLIGHT_6 = ucode##_MWO_bLIGHT_6; \
|
//GBI::G_MWO_bLIGHT_6 = ucode##_MWO_bLIGHT_6; \
|
||||||
GBI::G_MWO_aLIGHT_7 = ucode##_MWO_aLIGHT_7; \
|
//GBI::G_MWO_aLIGHT_7 = ucode##_MWO_aLIGHT_7; \
|
||||||
GBI::G_MWO_bLIGHT_7 = ucode##_MWO_bLIGHT_7; \
|
//GBI::G_MWO_bLIGHT_7 = ucode##_MWO_bLIGHT_7; \
|
||||||
GBI::G_MWO_aLIGHT_8 = ucode##_MWO_aLIGHT_8; \
|
//GBI::G_MWO_aLIGHT_8 = ucode##_MWO_aLIGHT_8; \
|
||||||
GBI::G_MWO_bLIGHT_8 = ucode##_MWO_bLIGHT_8; \
|
//GBI::G_MWO_bLIGHT_8 = ucode##_MWO_bLIGHT_8;
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Fixed point conversion factors
|
// Fixed point conversion factors
|
||||||
|
|
143
src/GraphicsPlugin.cpp
Normal file → Executable file
143
src/GraphicsPlugin.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -20,26 +20,20 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include "GraphicsPlugin.h"
|
||||||
#include <ctime>
|
#include "VI.h" //Video interface
|
||||||
|
#include "Memory.h" //Access to memory (RDRAM, Texture Memory)
|
||||||
#include "ConfigMap.h" //Configuration
|
#include "OpenGLRenderer.h" //Renderer
|
||||||
|
#include "FrameBuffer.h" //Framebuffer
|
||||||
#include "DisplayListParser.h" //Displaylist parser
|
#include "DisplayListParser.h" //Displaylist parser
|
||||||
#include "FogManager.h" //Fog
|
#include "FogManager.h" //Fog
|
||||||
#include "FrameBuffer.h" //Framebuffer
|
|
||||||
#include "GBI.h" //Graphics Binary Interface
|
|
||||||
#include "GraphicsPlugin.h"
|
|
||||||
#include "Logger.h" //Debug logger
|
|
||||||
#include "Memory.h" //Access to memory (RDRAM, Texture Memory)
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "OpenGLRenderer.h" //Renderer
|
|
||||||
#include "RDP.h" //Reality Drawing Processor
|
|
||||||
#include "RSP.h" //Reality Signal Processor
|
#include "RSP.h" //Reality Signal Processor
|
||||||
|
#include "RDP.h" //Reality Drawing Processor
|
||||||
|
#include "GBI.h" //Graphics Binary Interface
|
||||||
|
#include "ConfigMap.h" //Configuration
|
||||||
|
#include "Logger.h" //Debug logger
|
||||||
#include "RomDetector.h"
|
#include "RomDetector.h"
|
||||||
#include "VI.h" //Video interface
|
#include <ctime>
|
||||||
#include "m64p.h"
|
|
||||||
#include "m64p_types.h"
|
|
||||||
|
|
||||||
//FrameBuffer framebuffer01;
|
//FrameBuffer framebuffer01;
|
||||||
//FrameBuffer framebuffer02;
|
//FrameBuffer framebuffer02;
|
||||||
|
@ -69,13 +63,6 @@ GraphicsPlugin::~GraphicsPlugin()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool GraphicsPlugin::initialize(GFX_INFO* graphicsInfo)
|
bool GraphicsPlugin::initialize(GFX_INFO* graphicsInfo)
|
||||||
{
|
{
|
||||||
//Initialize video output
|
|
||||||
if (CoreVideo_Init() != M64ERR_SUCCESS)
|
|
||||||
{
|
|
||||||
Logger::getSingleton().printMsg("Could not initialize video.", M64MSG_ERROR);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Save pointer to graphics info
|
//Save pointer to graphics info
|
||||||
m_graphicsInfo = graphicsInfo;
|
m_graphicsInfo = graphicsInfo;
|
||||||
|
|
||||||
|
@ -107,7 +94,7 @@ bool GraphicsPlugin::initialize(GFX_INFO* graphicsInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CoreVideo_SetVideoMode(m_config->fullscreenWidth, m_config->fullscreenHeight, m_config->fullscreenBitDepth,
|
if (CoreVideo_SetVideoMode(m_config->fullscreenWidth, m_config->fullscreenHeight, m_config->fullscreenBitDepth,
|
||||||
m_config->startFullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED, (m64p_video_flags) 0) != M64ERR_SUCCESS)
|
m_config->startFullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED) != M64ERR_SUCCESS)
|
||||||
{
|
{
|
||||||
Logger::getSingleton().printMsg("Could not set video mode.", M64MSG_ERROR);
|
Logger::getSingleton().printMsg("Could not set video mode.", M64MSG_ERROR);
|
||||||
return false;
|
return false;
|
||||||
|
@ -148,7 +135,7 @@ bool GraphicsPlugin::initialize(GFX_INFO* graphicsInfo)
|
||||||
//Initialize Texture Cache
|
//Initialize Texture Cache
|
||||||
//! @todo Not "hardcode" TextureBitDepth.
|
//! @todo Not "hardcode" TextureBitDepth.
|
||||||
m_textureCache.initialize(&m_rsp, &m_rdp, m_memory, 16);
|
m_textureCache.initialize(&m_rsp, &m_rdp, m_memory, 16);
|
||||||
m_textureCache.setMipmap( m_config->mipmapping );
|
|
||||||
|
|
||||||
//Initialize OpenGL Renderer
|
//Initialize OpenGL Renderer
|
||||||
if ( !OpenGLRenderer::getSingleton().initialize(&m_rsp, &m_rdp, &m_textureCache, m_vi, m_fogManager) )
|
if ( !OpenGLRenderer::getSingleton().initialize(&m_rsp, &m_rdp, &m_textureCache, m_vi, m_fogManager) )
|
||||||
|
@ -315,14 +302,97 @@ void renderRedBox(float x, float y, float z, float width, float height, float l
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphicsPlugin::_motionBlur()
|
||||||
|
{
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
gluPerspective(45.0f,(GLfloat)800.0f/(GLfloat)600.0f, .5f ,150.0f);
|
||||||
|
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
|
gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
|
||||||
|
|
||||||
|
////Render new stuff to the motion blur texture
|
||||||
|
if ( animate(50) )
|
||||||
|
{
|
||||||
|
//Render to frame buffer
|
||||||
|
// framebuffer01.beginRendering();
|
||||||
|
{
|
||||||
|
renderMotionBlur();
|
||||||
|
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glLoadIdentity();
|
||||||
|
gluPerspective(45.0f,(GLfloat)800.0f/(GLfloat)600.0f, .5f ,150.0f);
|
||||||
|
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
|
gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
|
||||||
|
|
||||||
|
renderRedBox(0, 0, 0, 1, 5, 1);
|
||||||
|
//m_displayListParser->processDisplayList();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
glFlush();
|
||||||
|
// framebuffer01.endRendering();
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
//glDisable(GL_BLEND);
|
||||||
|
//glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
|
//renderMotionBlur();
|
||||||
|
//renderTriangle();
|
||||||
|
|
||||||
|
renderMotionBlur();
|
||||||
|
|
||||||
|
// glMatrixMode(GL_PROJECTION);
|
||||||
|
//glLoadIdentity();
|
||||||
|
//gluPerspective(45.0f,(GLfloat)800.0f/(GLfloat)600.0f, .5f ,150.0f);
|
||||||
|
|
||||||
|
// glMatrixMode(GL_MODELVIEW);
|
||||||
|
// glLoadIdentity();
|
||||||
|
//gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
|
||||||
|
|
||||||
|
//renderRedBox(0, 0, 0, 1, 5, 1);
|
||||||
|
|
||||||
|
m_rdp.triggerInterrupt();
|
||||||
|
m_rsp.triggerInterrupt();
|
||||||
|
|
||||||
|
|
||||||
|
//Render new stuff to frame buffer
|
||||||
|
//framebuffer02.beginRendering();
|
||||||
|
{
|
||||||
|
// m_displayListParser->processDisplayList();
|
||||||
|
// RSP::getSingleton().reset();
|
||||||
|
// RDP::getSingleton().reset();
|
||||||
|
|
||||||
|
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
// glDisable(GL_BLEND);
|
||||||
|
// glEnable(GL_DEPTH_TEST);
|
||||||
|
// glDisable(GL_ALPHA_TEST);
|
||||||
|
//m_displayListParser->processDisplayList();
|
||||||
|
}
|
||||||
|
//glFlush();
|
||||||
|
//framebuffer02.endRendering();
|
||||||
|
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
//Blend old stuff and new stuff
|
||||||
|
|
||||||
|
//framebuffer02.render2();
|
||||||
|
|
||||||
|
//FrameBuffer::getSingleton().render();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// ProcessDisplayList
|
// ProcessDisplayList
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void GraphicsPlugin::processDisplayList()
|
void GraphicsPlugin::processDisplayList()
|
||||||
{
|
{
|
||||||
if ( (m_numDListProcessed == 1 && m_romDetector->getClearType() == CT_AFTER_ONE_DISPLAY_LIST) ||
|
if ( m_numDListProcessed == 1 && m_romDetector->getClearType() == CT_AFTER_ONE_DISPLAY_LIST ||
|
||||||
(m_numDListProcessed == 2 && m_romDetector->getClearType() == CT_AFTER_TWO_DISPLAY_LIST) ||
|
m_numDListProcessed == 2 && m_romDetector->getClearType() == CT_AFTER_TWO_DISPLAY_LIST ||
|
||||||
(m_numDListProcessed == 3 && m_romDetector->getClearType() == CT_AFTER_THREE_DISPLAY_LIST) )
|
m_numDListProcessed == 3 && m_romDetector->getClearType() == CT_AFTER_THREE_DISPLAY_LIST )
|
||||||
{
|
{
|
||||||
bool scissors = OpenGLManager::getSingleton().getScissorEnabled();
|
bool scissors = OpenGLManager::getSingleton().getScissorEnabled();
|
||||||
OpenGLManager::getSingleton().setScissorEnabled(false);
|
OpenGLManager::getSingleton().setScissorEnabled(false);
|
||||||
|
@ -371,7 +441,18 @@ void GraphicsPlugin::processDisplayList()
|
||||||
m_rsp.reset();
|
m_rsp.reset();
|
||||||
m_rdp.reset();
|
m_rdp.reset();
|
||||||
m_openGLMgr.setCullMode(false, true);
|
m_openGLMgr.setCullMode(false, true);
|
||||||
m_displayListParser->processDisplayList();
|
|
||||||
|
|
||||||
|
if ( false )
|
||||||
|
{
|
||||||
|
_motionBlur();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_displayListParser->processDisplayList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Clear Screen?
|
//Clear Screen?
|
||||||
|
@ -379,7 +460,7 @@ void GraphicsPlugin::processDisplayList()
|
||||||
|
|
||||||
//glFlush();
|
//glFlush();
|
||||||
//OpenGLManager::getSingleton().endRendering();
|
//OpenGLManager::getSingleton().endRendering();
|
||||||
OpenGLManager::getSingleton().setDrawFlag();
|
|
||||||
//Take screenshot?
|
//Take screenshot?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
19
src/GraphicsPlugin.h
Normal file → Executable file
19
src/GraphicsPlugin.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -23,21 +23,18 @@
|
||||||
#ifndef GRAPHICS_PLUGIN_H_
|
#ifndef GRAPHICS_PLUGIN_H_
|
||||||
#define GRAPHICS_PLUGIN_H_
|
#define GRAPHICS_PLUGIN_H_
|
||||||
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "OpenGLManager.h" //Initializes OpenGL and handles OpenGL states
|
|
||||||
#include "RDP.h"
|
|
||||||
#include "RSP.h"
|
|
||||||
#include "TextureCache.h"
|
#include "TextureCache.h"
|
||||||
#include "m64p_plugin.h"
|
#include "OpenGLManager.h" //Initializes OpenGL and handles OpenGL states
|
||||||
|
#include "RSP.h"
|
||||||
|
#include "RDP.h"
|
||||||
|
|
||||||
//Forward declarations
|
//Forward declarations
|
||||||
class DisplayListParser;
|
|
||||||
class FogManager;
|
|
||||||
class Memory;
|
|
||||||
class OpenGLManager;
|
|
||||||
class ROMDetector;
|
|
||||||
//struct GFX_INFO;
|
//struct GFX_INFO;
|
||||||
class VI;
|
class VI;
|
||||||
|
class Memory;
|
||||||
|
class DisplayListParser;
|
||||||
|
class FogManager;
|
||||||
|
class ROMDetector;
|
||||||
struct ConfigMap;
|
struct ConfigMap;
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
46
src/Memory.cpp
Normal file → Executable file
46
src/Memory.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -67,6 +67,48 @@ bool Memory::initialize(unsigned char* RDRAM, unsigned char* DMEM)
|
||||||
// m_TMEM[i] = 0;
|
// m_TMEM[i] = 0;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
m_RDRAMSize = 0x800000;
|
_calculateRDRAMSize();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//* Calculate RDRAM Size
|
||||||
|
//! Detect how much Rambus Dynamic RAM there is
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void Memory::_calculateRDRAMSize()
|
||||||
|
{
|
||||||
|
unsigned char test;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
try
|
||||||
|
{
|
||||||
|
test = m_RDRAM[0x400000];
|
||||||
|
test = m_RDRAM[0x500000];
|
||||||
|
test = m_RDRAM[0x600000];
|
||||||
|
test = m_RDRAM[0x700000];
|
||||||
|
test = m_RDRAM[0x7FFFFC];
|
||||||
|
m_RDRAMSize = 0x800000;
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
m_RDRAMSize = 0x400000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
unsigned int testAddress;
|
||||||
|
|
||||||
|
__try
|
||||||
|
{
|
||||||
|
testAddress = 0;
|
||||||
|
while ( true )
|
||||||
|
{
|
||||||
|
test = m_RDRAM[testAddress];
|
||||||
|
testAddress++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
m_RDRAMSize = testAddress;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
7
src/Memory.h
Normal file → Executable file
7
src/Memory.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -65,6 +65,11 @@ public:
|
||||||
m_segments[address] = value;
|
m_segments[address] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
//Calculate size of Rambus Dynamic Random Access Memory.
|
||||||
|
void _calculateRDRAMSize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
unsigned char* m_RDRAM; //!< Rambus Dynamic Random Access Memory
|
unsigned char* m_RDRAM; //!< Rambus Dynamic Random Access Memory
|
||||||
|
|
7
src/MultiTexturingExt.cpp
Normal file → Executable file
7
src/MultiTexturingExt.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "MultiTexturingExt.h"
|
#include "MultiTexturingExt.h"
|
||||||
|
#include "ExtensionChecker.h"
|
||||||
|
|
||||||
|
|
||||||
//Multi Texturing functions
|
//Multi Texturing functions
|
||||||
|
@ -37,8 +37,7 @@ bool g_MultiTextureARBSupport = false;
|
||||||
bool initializeMultiTexturingExtensions()
|
bool initializeMultiTexturingExtensions()
|
||||||
{
|
{
|
||||||
//Initialize Extentions
|
//Initialize Extentions
|
||||||
g_MultiTextureARBSupport = isExtensionSupported("GL_ARB_multitexture");
|
if ( g_MultiTextureARBSupport = isExtensionSupported("GL_ARB_multitexture") )
|
||||||
if ( g_MultiTextureARBSupport )
|
|
||||||
{
|
{
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress( "glActiveTextureARB" );
|
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress( "glActiveTextureARB" );
|
||||||
|
|
4
src/MultiTexturingExt.h
Normal file → Executable file
4
src/MultiTexturingExt.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
#ifndef MULTI_TEXTURING_EXTENSION_H_
|
#ifndef MULTI_TEXTURING_EXTENSION_H_
|
||||||
#define MULTI_TEXTURING_EXTENSION_H_
|
#define MULTI_TEXTURING_EXTENSION_H_
|
||||||
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
//Multi Texturing Definitions
|
//Multi Texturing Definitions
|
||||||
|
|
2
src/N64Games.h
Normal file → Executable file
2
src/N64Games.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
8
src/OpenGL.h
Normal file → Executable file
8
src/OpenGL.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
*
|
*
|
||||||
|
@ -24,13 +24,7 @@
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
#endif
|
#endif
|
||||||
#if defined(__MACOSX__)
|
|
||||||
#include <OpenGL/gl.h>
|
|
||||||
#elif defined(__MACOS__)
|
|
||||||
#include <gl.h>
|
|
||||||
#else
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#endif
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <GL/glext.h>
|
#include <GL/glext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
9
src/OpenGLManager.cpp
Normal file → Executable file
9
src/OpenGLManager.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -20,10 +20,7 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include "OpenGLManager.h"
|
#include "OpenGLManager.h"
|
||||||
#include "m64p.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
@ -58,7 +55,6 @@ bool OpenGLManager::initialize(bool fullscreen, int width, int height, int bitDe
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
this->setViewport(0, 0, width, height);
|
|
||||||
|
|
||||||
//Set render states
|
//Set render states
|
||||||
setCullMode(false, true);
|
setCullMode(false, true);
|
||||||
|
@ -142,8 +138,7 @@ void OpenGLManager::endRendering()
|
||||||
{
|
{
|
||||||
glFinish();
|
glFinish();
|
||||||
if (m_renderingCallback)
|
if (m_renderingCallback)
|
||||||
m_renderingCallback(m_drawFlag);
|
m_renderingCallback();
|
||||||
m_drawFlag = 0;
|
|
||||||
CoreVideo_GL_SwapBuffers();
|
CoreVideo_GL_SwapBuffers();
|
||||||
//glFlush();
|
//glFlush();
|
||||||
}
|
}
|
||||||
|
|
17
src/OpenGLManager.h
Normal file → Executable file
17
src/OpenGLManager.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -23,9 +23,14 @@
|
||||||
#ifndef OPEN_GL_Manager_H_
|
#ifndef OPEN_GL_Manager_H_
|
||||||
#define OPEN_GL_Manager_H_
|
#define OPEN_GL_Manager_H_
|
||||||
|
|
||||||
#include "OpenGL.h"
|
//OpenGL linking and includes
|
||||||
|
#pragma comment(lib,"opengl32.lib")
|
||||||
|
#pragma comment(lib,"glu32.lib")
|
||||||
|
|
||||||
//OpenGL includes
|
//OpenGL includes
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
#include <GL/glu.h>
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//* OpenGL Manager Class
|
//* OpenGL Manager Class
|
||||||
|
@ -92,10 +97,7 @@ public:
|
||||||
void setClearColor(float r, float g, float b) { glClearColor(r, g, b, 1.0f); }
|
void setClearColor(float r, float g, float b) { glClearColor(r, g, b, 1.0f); }
|
||||||
|
|
||||||
//Set callback from the M64P core
|
//Set callback from the M64P core
|
||||||
void setRenderingCallback(void(*callback)(int)) { m_renderingCallback = callback; }
|
void setRenderingCallback(void(*callback)()) { m_renderingCallback = callback; }
|
||||||
|
|
||||||
//Set draw flag for rendering callback
|
|
||||||
void setDrawFlag() { m_drawFlag = 1; }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -130,8 +132,7 @@ private:
|
||||||
bool m_fullscreen; //!< Fullscreen mode or window mode?
|
bool m_fullscreen; //!< Fullscreen mode or window mode?
|
||||||
bool m_forceDisableCulling; //!< Culling cant be enabled if this is true
|
bool m_forceDisableCulling; //!< Culling cant be enabled if this is true
|
||||||
|
|
||||||
void (*m_renderingCallback)(int); //Rendering callback from the core
|
void (*m_renderingCallback)(); //Rendering callback from the core
|
||||||
int m_drawFlag;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
37
src/RDP/RDP.cpp
Normal file → Executable file
37
src/RDP/RDP.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,31 +19,26 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "AdvancedCombinerManager.h"
|
|
||||||
#include "CachedTexture.h"
|
|
||||||
#include "DisplayListParser.h"
|
|
||||||
#include "FogManager.h"
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "MathLib.h"
|
|
||||||
#include "Memory.h"
|
|
||||||
#include "N64Games.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "OpenGL2DRenderer.h"
|
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "OpenGLRenderer.h"
|
|
||||||
#include "RDP.h"
|
#include "RDP.h"
|
||||||
|
#include "GBIDefs.h"
|
||||||
|
#include "GBI.h"
|
||||||
#include "RSP.h"
|
#include "RSP.h"
|
||||||
#include "RomDetector.h"
|
#include "DisplayListParser.h"
|
||||||
|
#include "assembler.h"
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
#include "TextureCache.h"
|
#include "TextureCache.h"
|
||||||
#include "VI.h"
|
#include "VI.h"
|
||||||
#include "assembler.h"
|
#include "Memory.h"
|
||||||
|
#include "OpenGLManager.h"
|
||||||
|
#include "OpenGL2DRenderer.h"
|
||||||
|
#include "AdvancedCombinerManager.h"
|
||||||
|
#include "FogManager.h"
|
||||||
|
#include "Logger.h"
|
||||||
|
#include "MathLib.h"
|
||||||
|
#include "RomDetector.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
#include "m64p_types.h"
|
#include "OpenGL.h"
|
||||||
|
#include <algorithm>
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
22
src/RDP/RDP.h
Normal file → Executable file
22
src/RDP/RDP.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -23,24 +23,22 @@
|
||||||
#define REALITY_DRAWING_PROCESSOR_H_
|
#define REALITY_DRAWING_PROCESSOR_H_
|
||||||
|
|
||||||
//Includes
|
//Includes
|
||||||
#define M64P_PLUGIN_PROTOTYPES 1
|
#include "m64p_plugin.h"
|
||||||
|
#include "UCodeDefs.h"
|
||||||
#include "GBI.h"
|
#include "GBI.h"
|
||||||
#include "GBIDefs.h"
|
#include "GBIDefs.h"
|
||||||
#include "TextureLoader.h"
|
#include "TextureLoader.h"
|
||||||
#include "UCodeDefs.h"
|
|
||||||
#include "m64p_plugin.h"
|
|
||||||
|
|
||||||
//Forward declaration
|
//Forward declaration
|
||||||
class AdvancedCombinerManager;
|
|
||||||
class DisplayListParser;
|
|
||||||
class FogManager;
|
|
||||||
class GBI;
|
|
||||||
class Memory;
|
|
||||||
class OpenGL2DRenderer;
|
|
||||||
class RSP;
|
class RSP;
|
||||||
class TextureCache;
|
|
||||||
class TextureLoader;
|
|
||||||
class VI;
|
class VI;
|
||||||
|
class Memory;
|
||||||
|
class DisplayListParser;
|
||||||
|
class TextureCache;
|
||||||
|
class AdvancedCombinerManager;
|
||||||
|
class FogManager;
|
||||||
|
class TextureLoader;
|
||||||
|
class OpenGL2DRenderer;
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//! RDPSetImgInfo
|
//! RDPSetImgInfo
|
||||||
|
|
9
src/RDP/RDPInstructions.cpp
Normal file → Executable file
9
src/RDP/RDPInstructions.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,12 +19,11 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "DisplayListParser.h"
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "RDP.h"
|
|
||||||
#include "RDPInstructions.h"
|
#include "RDPInstructions.h"
|
||||||
#include "RDPUCodeStructs.h"
|
#include "RDPUCodeStructs.h"
|
||||||
#include "m64p_types.h"
|
#include "RDP.h"
|
||||||
|
#include "DisplayListParser.h"
|
||||||
|
#include "Logger.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Static Variables
|
// Static Variables
|
||||||
|
|
2
src/RDP/RDPInstructions.h
Normal file → Executable file
2
src/RDP/RDPInstructions.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
2
src/RDP/RDPUCodeStructs.h
Normal file → Executable file
2
src/RDP/RDPUCodeStructs.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
35
src/RSP/RSP.cpp
Normal file → Executable file
35
src/RSP/RSP.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,24 +19,21 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
#include "../RDP/RDP.h"
|
|
||||||
#include "../UCodeDefs.h"
|
|
||||||
#include "DisplayListParser.h"
|
|
||||||
#include "FogManager.h"
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "MathLib.h"
|
|
||||||
#include "Memory.h"
|
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "OpenGLRenderer.h"
|
|
||||||
#include "RSP.h"
|
#include "RSP.h"
|
||||||
#include "RSPLightManager.h"
|
#include "../UCodeDefs.h"
|
||||||
#include "RSPMatrixManager.h"
|
#include "../RDP/RDP.h"
|
||||||
|
#include <cmath>
|
||||||
|
#include "GBIDefs.h"
|
||||||
#include "VI.h"
|
#include "VI.h"
|
||||||
#include "m64p_types.h"
|
#include "Memory.h"
|
||||||
|
#include "Logger.h"
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
|
#include "OpenGLManager.h"
|
||||||
|
#include "RSPLightManager.h"
|
||||||
|
#include "FogManager.h"
|
||||||
|
#include "DisplayListParser.h"
|
||||||
|
#include "MathLib.h"
|
||||||
|
#include "MathLib.h"
|
||||||
|
|
||||||
#define MI_INTR_SP 0x00000001 //!< RSP Interrupt signal
|
#define MI_INTR_SP 0x00000001 //!< RSP Interrupt signal
|
||||||
|
|
||||||
|
@ -122,10 +119,14 @@ void RSP::updateGeometryStates()
|
||||||
{
|
{
|
||||||
bool cullFront = (m_geometryMode & GBI::G_CULL_FRONT ) != 0;
|
bool cullFront = (m_geometryMode & GBI::G_CULL_FRONT ) != 0;
|
||||||
bool cullBack = (m_geometryMode & GBI::G_CULL_BACK ) != 0;
|
bool cullBack = (m_geometryMode & GBI::G_CULL_BACK ) != 0;
|
||||||
|
bool shade = (m_geometryMode & G_SHADE ) != 0;
|
||||||
|
bool shadeSmooth = (m_geometryMode & GBI::G_SHADING_SMOOTH) != 0;
|
||||||
bool fog = (m_geometryMode & G_FOG ) != 0;
|
bool fog = (m_geometryMode & G_FOG ) != 0;
|
||||||
bool textureGen = (m_geometryMode & G_TEXTURE_GEN ) != 0;
|
bool textureGen = (m_geometryMode & G_TEXTURE_GEN ) != 0;
|
||||||
|
bool linearTextureGen = (m_geometryMode & G_TEXTURE_GEN_LINEAR ) != 0;
|
||||||
bool lighting = (m_geometryMode & G_LIGHTING ) != 0;
|
bool lighting = (m_geometryMode & G_LIGHTING ) != 0;
|
||||||
bool zBuffer = (m_geometryMode & G_ZBUFFER ) != 0;
|
bool zBuffer = (m_geometryMode & G_ZBUFFER ) != 0;
|
||||||
|
bool clipping = (m_geometryMode & GBI::G_CLIPPING ) != 0;
|
||||||
|
|
||||||
//Update states
|
//Update states
|
||||||
m_lightMgr->setLightEnabled(lighting);
|
m_lightMgr->setLightEnabled(lighting);
|
||||||
|
|
20
src/RSP/RSP.h
Normal file → Executable file
20
src/RSP/RSP.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,22 +22,20 @@
|
||||||
#ifndef REALITY_SIGNAL_PROCESSOR_H_
|
#ifndef REALITY_SIGNAL_PROCESSOR_H_
|
||||||
#define REALITY_SIGNAL_PROCESSOR_H_
|
#define REALITY_SIGNAL_PROCESSOR_H_
|
||||||
|
|
||||||
#define M64P_PLUGIN_PROTOTYPES 1
|
#include "m64p_plugin.h"
|
||||||
#include "Matrix4.h"
|
#include "UCodeDefs.h"
|
||||||
#include "RSPMatrixManager.h"
|
#include "RSPMatrixManager.h"
|
||||||
#include "RSPVertexManager.h"
|
#include "RSPVertexManager.h"
|
||||||
#include "UCodeDefs.h"
|
#include "Matrix4.h"
|
||||||
#include "m64p_plugin.h"
|
|
||||||
|
|
||||||
//Forward declarations
|
//Forward declarations
|
||||||
class DisplayListParser;
|
|
||||||
class FogManager;
|
|
||||||
class Memory;
|
|
||||||
class RDP;
|
|
||||||
class RSPLightManager;
|
|
||||||
class RSPMatrixManager;
|
|
||||||
class VI;
|
class VI;
|
||||||
struct RDPTile;
|
struct RDPTile;
|
||||||
|
class RDP;
|
||||||
|
class Memory;
|
||||||
|
class DisplayListParser;
|
||||||
|
class RSPLightManager;
|
||||||
|
class FogManager;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Defines
|
// Defines
|
||||||
|
|
8
src/RSP/RSPLightManager.cpp
Normal file → Executable file
8
src/RSP/RSPLightManager.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,11 +19,11 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include "RSPLightManager.h"
|
||||||
|
#include "Memory.h"
|
||||||
|
#include "MathLib.h"
|
||||||
#include "GBI.h"
|
#include "GBI.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "MathLib.h"
|
|
||||||
#include "Memory.h"
|
|
||||||
#include "RSPLightManager.h"
|
|
||||||
|
|
||||||
#define RGBA_GETALPHA(rgb) ((rgb) >> 24)
|
#define RGBA_GETALPHA(rgb) ((rgb) >> 24)
|
||||||
#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
|
#define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
|
||||||
|
|
2
src/RSP/RSPLightManager.h
Normal file → Executable file
2
src/RSP/RSPLightManager.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
8
src/RSP/RSPMatrixManager.cpp
Normal file → Executable file
8
src/RSP/RSPMatrixManager.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,13 +19,11 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include "RSPMatrixManager.h"
|
||||||
|
#include "Memory.h"
|
||||||
#include <cmath> //modff
|
#include <cmath> //modff
|
||||||
|
|
||||||
#include "GBI.h" //SHIFT
|
#include "GBI.h" //SHIFT
|
||||||
#include "GBIDefs.h" //_FIXED2FLOAT
|
#include "GBIDefs.h" //_FIXED2FLOAT
|
||||||
#include "Memory.h"
|
|
||||||
#include "RSPMatrixManager.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
2
src/RSP/RSPMatrixManager.h
Normal file → Executable file
2
src/RSP/RSPMatrixManager.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
27
src/RSP/RSPVertexManager.cpp
Normal file → Executable file
27
src/RSP/RSPVertexManager.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,20 +19,16 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <cmath> //sqrt
|
|
||||||
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "GBIDefs.h" //hmm
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "MathLib.h" //Transform, Vec3Normalize
|
|
||||||
#include "Memory.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "OpenGLRenderer.h"
|
|
||||||
#include "RSPLightManager.h"
|
|
||||||
#include "RSPMatrixManager.h"
|
|
||||||
#include "RSPVertexManager.h"
|
#include "RSPVertexManager.h"
|
||||||
#include "m64p_types.h"
|
#include "OpenGLManager.h"
|
||||||
|
#include "Memory.h"
|
||||||
|
#include "RSPMatrixManager.h"
|
||||||
|
#include "RSPLightManager.h"
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
|
#include "GBIDefs.h" //hmm
|
||||||
|
#include "MathLib.h" //Transform, Vec3Normalize
|
||||||
|
#include <cmath> //sqrt
|
||||||
|
#include "Logger.h"
|
||||||
|
|
||||||
//Vertex
|
//Vertex
|
||||||
struct Vertex
|
struct Vertex
|
||||||
|
@ -550,6 +546,9 @@ void RSPVertexManager::addConkerVertices(unsigned int segmentAddress, unsigned i
|
||||||
//Get vertex from rdram
|
//Get vertex from rdram
|
||||||
Vertex *vertex = (Vertex*) m_memory->getRDRAM(address);
|
Vertex *vertex = (Vertex*) m_memory->getRDRAM(address);
|
||||||
|
|
||||||
|
//Colors
|
||||||
|
short *vertexColoraddr = (short*)(m_memory->getRDRAM(m_conkerRDRAMAddress));
|
||||||
|
|
||||||
|
|
||||||
//For each vertex
|
//For each vertex
|
||||||
for (unsigned int i=firstVertexIndex; i <numVertices+firstVertexIndex; ++i)
|
for (unsigned int i=firstVertexIndex; i <numVertices+firstVertexIndex; ++i)
|
||||||
|
|
4
src/RSP/RSPVertexManager.h
Normal file → Executable file
4
src/RSP/RSPVertexManager.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -108,7 +108,7 @@ private:
|
||||||
RSPLightManager* m_lightMgr;
|
RSPLightManager* m_lightMgr;
|
||||||
|
|
||||||
//Vertex Buffer
|
//Vertex Buffer
|
||||||
static const unsigned int MAX_VERTICES = 300;
|
static const int MAX_VERTICES = 300;
|
||||||
SPVertex m_vertices[MAX_VERTICES];
|
SPVertex m_vertices[MAX_VERTICES];
|
||||||
|
|
||||||
unsigned int m_colorBaseRDRAMAddress; //!< Address in RDRAM where colors for vertices are located (used by Perfect Dark)
|
unsigned int m_colorBaseRDRAMAddress; //!< Address in RDRAM where colors for vertices are located (used by Perfect Dark)
|
||||||
|
|
7
src/RomDetector.cpp
Normal file → Executable file
7
src/RomDetector.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,11 +19,10 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <string.h> //memcpy
|
|
||||||
|
|
||||||
#include "RomDetector.h"
|
#include "RomDetector.h"
|
||||||
#include "StringFunctions.h"
|
|
||||||
#include "assembler.h" //swapRomHeaderBytes
|
#include "assembler.h" //swapRomHeaderBytes
|
||||||
|
#include <string.h> //memcpy
|
||||||
|
#include "StringFunctions.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|
2
src/RomDetector.h
Normal file → Executable file
2
src/RomDetector.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
4
src/SecondaryColorExt.cpp
Normal file → Executable file
4
src/SecondaryColorExt.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,8 +19,8 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "SecondaryColorExt.h"
|
#include "SecondaryColorExt.h"
|
||||||
|
#include "ExtensionChecker.h"
|
||||||
|
|
||||||
// EXT_secondary_color functions
|
// EXT_secondary_color functions
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
|
|
4
src/SecondaryColorExt.h
Normal file → Executable file
4
src/SecondaryColorExt.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
#ifndef SECONDARY_COLOR_EXTENSION_H_
|
#ifndef SECONDARY_COLOR_EXTENSION_H_
|
||||||
#define SECONDARY_COLOR_EXTENSION_H_
|
#define SECONDARY_COLOR_EXTENSION_H_
|
||||||
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
#ifndef GL_EXT_secondary_color
|
#ifndef GL_EXT_secondary_color
|
||||||
|
|
2
src/UCodeDefs.h
Normal file → Executable file
2
src/UCodeDefs.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
9
src/VI.cpp
Normal file → Executable file
9
src/VI.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,9 +19,8 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "GBIDefs.h" //_FIXED2FLOAT, _SHIFTR
|
|
||||||
#include "VI.h"
|
#include "VI.h"
|
||||||
|
#include "GBIDefs.h" //_FIXED2FLOAT, _SHIFTR
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -48,8 +47,8 @@ VI::~VI()
|
||||||
void VI::calcSize(GFX_INFO* graphicsInfo)
|
void VI::calcSize(GFX_INFO* graphicsInfo)
|
||||||
{
|
{
|
||||||
//Get video interface values
|
//Get video interface values
|
||||||
//unsigned int viScaleX = *graphicsInfo->VI_X_SCALE_REG;
|
unsigned int viScaleX = *graphicsInfo->VI_X_SCALE_REG;
|
||||||
//unsigned int viScaleY = *graphicsInfo->VI_X_SCALE_REG;
|
unsigned int viScaleY = *graphicsInfo->VI_X_SCALE_REG;
|
||||||
unsigned int viStartHorizontal = *graphicsInfo->VI_H_START_REG;
|
unsigned int viStartHorizontal = *graphicsInfo->VI_H_START_REG;
|
||||||
unsigned int viStartVertical = *graphicsInfo->VI_V_START_REG;
|
unsigned int viStartVertical = *graphicsInfo->VI_V_START_REG;
|
||||||
|
|
||||||
|
|
11
src/VI.h
Normal file → Executable file
11
src/VI.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -23,7 +23,6 @@
|
||||||
#define VIDEO_INTERFACE_H_
|
#define VIDEO_INTERFACE_H_
|
||||||
|
|
||||||
//Forward declarations
|
//Forward declarations
|
||||||
#define M64P_PLUGIN_PROTOTYPES 1
|
|
||||||
#include "UCodeDefs.h"
|
#include "UCodeDefs.h"
|
||||||
#include "m64p_plugin.h"
|
#include "m64p_plugin.h"
|
||||||
|
|
||||||
|
@ -42,13 +41,13 @@ public:
|
||||||
void calcSize(GFX_INFO* graphicsInfo);
|
void calcSize(GFX_INFO* graphicsInfo);
|
||||||
|
|
||||||
//Get Height and Width
|
//Get Height and Width
|
||||||
unsigned int getWidth() { return m_width; }
|
int getWidth() { return m_width; }
|
||||||
unsigned int getHeight() { return m_height; }
|
int getHeight() { return m_height; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
unsigned int m_width; //!< Width of video interface viewport
|
int m_width; //!< Width of video interface viewport
|
||||||
unsigned int m_height; //!< Height of video interface viewport
|
int m_height; //!< Height of video interface viewport
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
8
src/config/Config.cpp
Normal file → Executable file
8
src/config/Config.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -20,12 +20,10 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
#include <cstdio>
|
||||||
#include "GraphicsPlugin.h"
|
#include "GraphicsPlugin.h"
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "m64p.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
@ -60,7 +58,6 @@ bool Config::initialize()
|
||||||
ConfigSetDefaultBool(m_videoArachnoidSection, "Wireframe", false, "Render in wireframe?");
|
ConfigSetDefaultBool(m_videoArachnoidSection, "Wireframe", false, "Render in wireframe?");
|
||||||
ConfigSetDefaultBool(m_videoArachnoidSection, "Fog", false, "Render fog?");
|
ConfigSetDefaultBool(m_videoArachnoidSection, "Fog", false, "Render fog?");
|
||||||
ConfigSetDefaultInt(m_videoArachnoidSection, "MultiSampling", 0, "Use MultiSampling? 0=no 2,4,8,16=quality");
|
ConfigSetDefaultInt(m_videoArachnoidSection, "MultiSampling", 0, "Use MultiSampling? 0=no 2,4,8,16=quality");
|
||||||
ConfigSetDefaultInt(m_videoArachnoidSection, "Mipmapping", 0, "Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear");
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
ConfigSetDefaultInt(m_videoArachnoidSection, "ScreenUpdateSetting", SCREEN_UPDATE_CI, "When to update the screen: 1 - on VI, 2 - on first CI");
|
ConfigSetDefaultInt(m_videoArachnoidSection, "ScreenUpdateSetting", SCREEN_UPDATE_CI, "When to update the screen: 1 - on VI, 2 - on first CI");
|
||||||
#else
|
#else
|
||||||
|
@ -82,6 +79,5 @@ void Config::load()
|
||||||
m_cfg.wireframe = ConfigGetParamBool(m_videoArachnoidSection, "Wireframe");
|
m_cfg.wireframe = ConfigGetParamBool(m_videoArachnoidSection, "Wireframe");
|
||||||
m_cfg.fog = ConfigGetParamBool(m_videoArachnoidSection, "Fog");
|
m_cfg.fog = ConfigGetParamBool(m_videoArachnoidSection, "Fog");
|
||||||
m_cfg.multiSampling = ConfigGetParamBool(m_videoArachnoidSection, "MultiSampling");
|
m_cfg.multiSampling = ConfigGetParamBool(m_videoArachnoidSection, "MultiSampling");
|
||||||
m_cfg.mipmapping = ConfigGetParamInt(m_videoArachnoidSection, "Mipmapping");
|
|
||||||
m_cfg.screenUpdateSetting = ConfigGetParamInt(m_videoArachnoidSection, "ScreenUpdateSetting");
|
m_cfg.screenUpdateSetting = ConfigGetParamInt(m_videoArachnoidSection, "ScreenUpdateSetting");
|
||||||
}
|
}
|
||||||
|
|
5
src/config/Config.h
Normal file → Executable file
5
src/config/Config.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -23,9 +23,8 @@
|
||||||
#ifndef CONFIG_H_
|
#ifndef CONFIG_H_
|
||||||
#define CONFIG_H_
|
#define CONFIG_H_
|
||||||
|
|
||||||
#include "ConfigMap.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
#include "m64p_types.h"
|
#include "ConfigMap.h"
|
||||||
|
|
||||||
//Forward declaration
|
//Forward declaration
|
||||||
class GraphicsPlugin;
|
class GraphicsPlugin;
|
||||||
|
|
3
src/config/ConfigMap.h
Normal file → Executable file
3
src/config/ConfigMap.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -39,7 +39,6 @@ struct ConfigMap
|
||||||
bool wireframe; //!< Render in wireframe? defualt = false
|
bool wireframe; //!< Render in wireframe? defualt = false
|
||||||
bool fog; //!< Render fog? default = true
|
bool fog; //!< Render fog? default = true
|
||||||
int multiSampling; //!< Use MultiSampling? 0=no 2,4,8,16=quality default = 0
|
int multiSampling; //!< Use MultiSampling? 0=no 2,4,8,16=quality default = 0
|
||||||
int mipmapping; //!< Use Mipmapping? 0=no, 1=nearest, 2=bilinear, 3=trilinear default = 0
|
|
||||||
int screenUpdateSetting; //!< When to redraw the screen default = SCREEN_UPDATE_VI
|
int screenUpdateSetting; //!< When to redraw the screen default = SCREEN_UPDATE_VI
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
17
src/config/StringFunctions.cpp
Normal file → Executable file
17
src/config/StringFunctions.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,11 +19,8 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#include "StringFunctions.h"
|
#include "StringFunctions.h"
|
||||||
|
#include <cstring>
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
|
@ -40,7 +37,7 @@ vector<string> split(const string& str, const string& delims, size_t maxSplits)
|
||||||
size_t pos;
|
size_t pos;
|
||||||
size_t start = 0;
|
size_t start = 0;
|
||||||
vector<string> strings;
|
vector<string> strings;
|
||||||
size_t numSplits = 0;
|
int numSplits = 0;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -55,7 +52,7 @@ vector<string> split(const string& str, const string& delims, size_t maxSplits)
|
||||||
//Do nothing
|
//Do nothing
|
||||||
start = pos + 1;
|
start = pos + 1;
|
||||||
}
|
}
|
||||||
else if (pos == string::npos || (maxSplits!=string::npos && numSplits == maxSplits) )
|
else if (pos == string::npos || (maxSplits!=-1 && numSplits == maxSplits) )
|
||||||
{
|
{
|
||||||
//No more spliting, copy the rest of the string
|
//No more spliting, copy the rest of the string
|
||||||
strings.push_back( str.substr(start) );
|
strings.push_back( str.substr(start) );
|
||||||
|
@ -98,12 +95,6 @@ void trim(string& str, bool left, bool right, const string delims)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
char* trim(char* str, bool left, bool right)
|
char* trim(char* str, bool left, bool right)
|
||||||
{
|
{
|
||||||
// Empty string check
|
|
||||||
if (*str == '\0')
|
|
||||||
{
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Trim from the left
|
//Trim from the left
|
||||||
if(left)
|
if(left)
|
||||||
{
|
{
|
||||||
|
|
9
src/config/StringFunctions.h
Normal file → Executable file
9
src/config/StringFunctions.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -64,16 +64,15 @@ in binary (= untranslated) mode and check for the different newlines yourself.
|
||||||
#ifndef STRING_FUNCTIONS_H_
|
#ifndef STRING_FUNCTIONS_H_
|
||||||
#define STRING_FUNCTIONS_H_
|
#define STRING_FUNCTIONS_H_
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <algorithm> //std::transform
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <algorithm> //std::transform
|
||||||
|
|
||||||
namespace StringFunctions
|
namespace StringFunctions
|
||||||
{
|
{
|
||||||
//Split
|
//Split
|
||||||
std::vector<std::string> split(const std::string& str, const std::string& delims="\n\t ", size_t maxSplits=std::string::npos);
|
std::vector<std::string> split(const std::string& str, const std::string& delims="\n\t ", size_t maxSplits=-1);
|
||||||
std::vector<std::string> split(const char* str, const std::string& delims="\n\t ");
|
std::vector<std::string> split(const char* str, const std::string& delims="\n\t ");
|
||||||
|
|
||||||
//Trim
|
//Trim
|
||||||
|
|
4
src/config/StringValue.h
Normal file → Executable file
4
src/config/StringValue.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,8 +22,8 @@
|
||||||
#ifndef STRING_VALUE_H_
|
#ifndef STRING_VALUE_H_
|
||||||
#define STRING_VALUE_H_
|
#define STRING_VALUE_H_
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
//! Represents numeric value(s) with a string using conversion operators
|
//! Represents numeric value(s) with a string using conversion operators
|
||||||
struct StringValue
|
struct StringValue
|
||||||
|
|
12
src/framebuffer/FrameBuffer.cpp
Normal file → Executable file
12
src/framebuffer/FrameBuffer.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,11 +19,9 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "FrameBuffer.h"
|
#include "FrameBuffer.h"
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
#ifndef GL_GLEXT_VERSION
|
#ifndef GL_GLEXT_VERSION
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -45,7 +43,7 @@
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
FrameBuffer::FrameBuffer()
|
FrameBuffer::FrameBuffer()
|
||||||
{
|
{
|
||||||
m_id = ~0U;
|
m_id = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -101,7 +99,7 @@ void FrameBuffer::initialize(int width, int height)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void FrameBuffer::dispose()
|
void FrameBuffer::dispose()
|
||||||
{
|
{
|
||||||
if ( m_id != ~0U )
|
if ( m_id != -1 )
|
||||||
{
|
{
|
||||||
glDeleteTextures(1, &m_id);
|
glDeleteTextures(1, &m_id);
|
||||||
m_id = -1;
|
m_id = -1;
|
||||||
|
@ -273,5 +271,5 @@ void FrameBuffer::_deactivate()
|
||||||
{
|
{
|
||||||
glActiveTexture((GLuint)GL_TEXTURE0);
|
glActiveTexture((GLuint)GL_TEXTURE0);
|
||||||
glDisable(GL_TEXTURE_2D);
|
glDisable(GL_TEXTURE_2D);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, NULL);
|
||||||
}
|
}
|
||||||
|
|
2
src/framebuffer/FrameBuffer.h
Normal file → Executable file
2
src/framebuffer/FrameBuffer.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
4
src/hash/CRCCalculator.cpp
Normal file → Executable file
4
src/hash/CRCCalculator.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -64,7 +64,7 @@ CRCCalculator::CRCCalculator()
|
||||||
|
|
||||||
/* make exclusive-or pattern from polynomial (0xedb88320L) */
|
/* make exclusive-or pattern from polynomial (0xedb88320L) */
|
||||||
poly = 0L;
|
poly = 0L;
|
||||||
for (unsigned int n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
|
for (int n = 0; n < sizeof(p)/sizeof(unsigned char); n++)
|
||||||
{
|
{
|
||||||
poly |= 1L << (31 - p[n]);
|
poly |= 1L << (31 - p[n]);
|
||||||
}
|
}
|
||||||
|
|
2
src/hash/CRCCalculator.h
Normal file → Executable file
2
src/hash/CRCCalculator.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
6
src/hash/CRCCalculator2.cpp
Normal file → Executable file
6
src/hash/CRCCalculator2.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -27,7 +27,9 @@ typedef unsigned char byte;
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Static Variabels
|
// Static Variabels
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
unsigned int CRCCalculator2::m_crcTable[256] = {0};
|
unsigned int CRCCalculator2::m_crcTable[256] = {0};
|
||||||
|
|
||||||
|
static unsigned int crc_table[256];
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|
2
src/hash/CRCCalculator2.h
Normal file → Executable file
2
src/hash/CRCCalculator2.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
2
src/log/Logger.cpp
Normal file → Executable file
2
src/log/Logger.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
|
3
src/log/Logger.h
Normal file → Executable file
3
src/log/Logger.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -24,7 +24,6 @@
|
||||||
#define LOGGER_H_
|
#define LOGGER_H_
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#include "m64p_types.h"
|
#include "m64p_types.h"
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
8
src/m64p.h
Normal file → Executable file
8
src/m64p.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
*
|
*
|
||||||
|
@ -31,10 +31,9 @@
|
||||||
#define BOOL int
|
#define BOOL int
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define M64P_PLUGIN_PROTOTYPES 1
|
|
||||||
#include "m64p_config.h"
|
|
||||||
#include "m64p_plugin.h"
|
|
||||||
#include "m64p_types.h"
|
#include "m64p_types.h"
|
||||||
|
#include "m64p_plugin.h"
|
||||||
|
#include "m64p_config.h"
|
||||||
#include "m64p_vidext.h"
|
#include "m64p_vidext.h"
|
||||||
|
|
||||||
/* definitions of pointers to Core config functions */
|
/* definitions of pointers to Core config functions */
|
||||||
|
@ -63,7 +62,6 @@ extern ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes;
|
||||||
extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode;
|
extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode;
|
||||||
extern ptr_VidExt_SetCaption CoreVideo_SetCaption;
|
extern ptr_VidExt_SetCaption CoreVideo_SetCaption;
|
||||||
extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen;
|
extern ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen;
|
||||||
extern ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow;
|
|
||||||
extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress;
|
extern ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress;
|
||||||
extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute;
|
extern ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute;
|
||||||
extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers;
|
extern ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers;
|
||||||
|
|
80
src/main.cpp
Normal file → Executable file
80
src/main.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -21,32 +21,22 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
//Includes
|
//Includes
|
||||||
#define M64P_PLUGIN_PROTOTYPES 1
|
#include "m64p.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "ConfigMap.h"
|
|
||||||
#include "GraphicsPlugin.h" //Main class
|
#include "GraphicsPlugin.h" //Main class
|
||||||
|
#include "config/Config.h" //Configuration
|
||||||
#include "Logger.h" //Debug logger
|
#include "Logger.h" //Debug logger
|
||||||
#include "MemoryLeakDetector.h" //For detecting memory leaks
|
#include "MemoryLeakDetector.h" //For detecting memory leaks
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "config/Config.h" //Configuration
|
|
||||||
#include "m64p.h"
|
|
||||||
#include "m64p_common.h"
|
|
||||||
#include "m64p_config.h"
|
|
||||||
#include "m64p_plugin.h"
|
|
||||||
#include "m64p_types.h"
|
#include "m64p_types.h"
|
||||||
|
#include "m64p_plugin.h"
|
||||||
|
#include "m64p_config.h"
|
||||||
#include "m64p_vidext.h"
|
#include "m64p_vidext.h"
|
||||||
|
|
||||||
#include "osal_dynamiclib.h"
|
#include "osal_dynamiclib.h"
|
||||||
|
|
||||||
//Definitions
|
//Definitions
|
||||||
#define PLUGIN_NAME "Arachnoid Video Plugin"
|
#define PLUGIN_NAME "Arachnoid Video Plugin"
|
||||||
#define PLUGIN_VERSION 0x020600
|
#define PLUGIN_VERSION 0x016304
|
||||||
#define VIDEO_PLUGIN_API_VERSION 0x020200
|
|
||||||
#define CONFIG_API_VERSION 0x020000
|
|
||||||
#define VIDEXT_API_VERSION 0x030000
|
|
||||||
|
|
||||||
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)
|
|
||||||
|
|
||||||
#define MI_INTR_DP 0x00000020 //!< RDP Interrupt signal
|
#define MI_INTR_DP 0x00000020 //!< RDP Interrupt signal
|
||||||
#define MI_INTR_SP 0x00000001 //!< RSP Interrupt signal
|
#define MI_INTR_SP 0x00000001 //!< RSP Interrupt signal
|
||||||
|
@ -60,7 +50,7 @@ GFX_INFO g_graphicsInfo; //!< Informatio
|
||||||
GraphicsPlugin g_graphicsPlugin; //!< Main class for application
|
GraphicsPlugin g_graphicsPlugin; //!< Main class for application
|
||||||
Config g_config(&g_graphicsPlugin); //!< Handles configuration
|
Config g_config(&g_graphicsPlugin); //!< Handles configuration
|
||||||
|
|
||||||
void (*renderCallback)(int) = NULL;
|
void (*renderCallback)() = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* definitions of pointers to Core config functions */
|
/* definitions of pointers to Core config functions */
|
||||||
|
@ -89,7 +79,6 @@ ptr_VidExt_ListFullscreenModes CoreVideo_ListFullscreenModes = NULL;
|
||||||
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
|
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
|
||||||
ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL;
|
ptr_VidExt_SetCaption CoreVideo_SetCaption = NULL;
|
||||||
ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL;
|
ptr_VidExt_ToggleFullScreen CoreVideo_ToggleFullScreen = NULL;
|
||||||
ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL;
|
|
||||||
ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL;
|
ptr_VidExt_GL_GetProcAddress CoreVideo_GL_GetProcAddress = NULL;
|
||||||
ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
|
ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL;
|
||||||
ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL;
|
ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL;
|
||||||
|
@ -103,36 +92,8 @@ extern "C" {
|
||||||
EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context,
|
EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Context,
|
||||||
void (*DebugCallback)(void *, int, const char *))
|
void (*DebugCallback)(void *, int, const char *))
|
||||||
{
|
{
|
||||||
char logMsg[530];
|
|
||||||
Logger::getSingleton().initialize(DebugCallback, Context);
|
Logger::getSingleton().initialize(DebugCallback, Context);
|
||||||
Logger::getSingleton().printMsg("PluginStartup");
|
Logger::getSingleton().printMsg("PluginStartup");
|
||||||
|
|
||||||
/* attach and call the CoreGetAPIVersions function, check Config and Video Extension API versions for compatibility */
|
|
||||||
ptr_CoreGetAPIVersions CoreAPIVersionFunc;
|
|
||||||
CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreLibHandle, "CoreGetAPIVersions");
|
|
||||||
if (CoreAPIVersionFunc == NULL)
|
|
||||||
{
|
|
||||||
sprintf(logMsg, "Core emulator broken; no CoreAPIVersionFunc() function found.");
|
|
||||||
Logger::getSingleton().printMsg(logMsg, M64MSG_ERROR);
|
|
||||||
return M64ERR_INCOMPATIBLE;
|
|
||||||
}
|
|
||||||
int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion;
|
|
||||||
(*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL);
|
|
||||||
if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000))
|
|
||||||
{
|
|
||||||
sprintf(logMsg, "Emulator core Config API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)",
|
|
||||||
VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION));
|
|
||||||
Logger::getSingleton().printMsg(logMsg, M64MSG_ERROR);
|
|
||||||
return M64ERR_INCOMPATIBLE;
|
|
||||||
}
|
|
||||||
if ((VidextAPIVersion & 0xffff0000) != (VIDEXT_API_VERSION & 0xffff0000))
|
|
||||||
{
|
|
||||||
sprintf(logMsg, "Emulator core Video Extension API (v%i.%i.%i) incompatible with plugin (v%i.%i.%i)",
|
|
||||||
VERSION_PRINTF_SPLIT(VidextAPIVersion), VERSION_PRINTF_SPLIT(VIDEXT_API_VERSION));
|
|
||||||
Logger::getSingleton().printMsg(logMsg, M64MSG_ERROR);
|
|
||||||
return M64ERR_INCOMPATIBLE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the core config function pointers from the library handle */
|
/* Get the core config function pointers from the library handle */
|
||||||
ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection");
|
ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreLibHandle, "ConfigOpenSection");
|
||||||
ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter");
|
ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreLibHandle, "ConfigSetParameter");
|
||||||
|
@ -167,14 +128,13 @@ EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *Con
|
||||||
CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetVideoMode");
|
CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetVideoMode");
|
||||||
CoreVideo_SetCaption = (ptr_VidExt_SetCaption) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetCaption");
|
CoreVideo_SetCaption = (ptr_VidExt_SetCaption) osal_dynlib_getproc(CoreLibHandle, "VidExt_SetCaption");
|
||||||
CoreVideo_ToggleFullScreen = (ptr_VidExt_ToggleFullScreen) osal_dynlib_getproc(CoreLibHandle, "VidExt_ToggleFullScreen");
|
CoreVideo_ToggleFullScreen = (ptr_VidExt_ToggleFullScreen) osal_dynlib_getproc(CoreLibHandle, "VidExt_ToggleFullScreen");
|
||||||
CoreVideo_ResizeWindow = (ptr_VidExt_ResizeWindow) osal_dynlib_getproc(CoreLibHandle, "VidExt_ResizeWindow");
|
|
||||||
CoreVideo_GL_GetProcAddress = (ptr_VidExt_GL_GetProcAddress) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetProcAddress");
|
CoreVideo_GL_GetProcAddress = (ptr_VidExt_GL_GetProcAddress) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_GetProcAddress");
|
||||||
CoreVideo_GL_SetAttribute = (ptr_VidExt_GL_SetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SetAttribute");
|
CoreVideo_GL_SetAttribute = (ptr_VidExt_GL_SetAttribute) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SetAttribute");
|
||||||
CoreVideo_GL_SwapBuffers = (ptr_VidExt_GL_SwapBuffers) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SwapBuffers");
|
CoreVideo_GL_SwapBuffers = (ptr_VidExt_GL_SwapBuffers) osal_dynlib_getproc(CoreLibHandle, "VidExt_GL_SwapBuffers");
|
||||||
|
|
||||||
if (!CoreVideo_Init || !CoreVideo_Quit || !CoreVideo_ListFullscreenModes || !CoreVideo_SetVideoMode ||
|
if (!CoreVideo_Init || !CoreVideo_Quit || !CoreVideo_ListFullscreenModes || !CoreVideo_SetVideoMode ||
|
||||||
!CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress ||
|
!CoreVideo_SetCaption || !CoreVideo_ToggleFullScreen || !CoreVideo_GL_GetProcAddress ||
|
||||||
!CoreVideo_GL_SetAttribute || !CoreVideo_GL_SwapBuffers || !CoreVideo_ResizeWindow)
|
!CoreVideo_GL_SetAttribute || !CoreVideo_GL_SwapBuffers)
|
||||||
{
|
{
|
||||||
Logger::getSingleton().printMsg("Couldn't connect to Core video functions", M64MSG_ERROR);
|
Logger::getSingleton().printMsg("Couldn't connect to Core video functions", M64MSG_ERROR);
|
||||||
return M64ERR_INCOMPATIBLE;
|
return M64ERR_INCOMPATIBLE;
|
||||||
|
@ -210,7 +170,7 @@ EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *PluginType, int *Plugi
|
||||||
*PluginVersion = PLUGIN_VERSION;
|
*PluginVersion = PLUGIN_VERSION;
|
||||||
|
|
||||||
if (APIVersion != NULL)
|
if (APIVersion != NULL)
|
||||||
*APIVersion = VIDEO_PLUGIN_API_VERSION;
|
*APIVersion = PLUGIN_API_VERSION;
|
||||||
|
|
||||||
if (PluginNamePtr != NULL)
|
if (PluginNamePtr != NULL)
|
||||||
*PluginNamePtr = PLUGIN_NAME;
|
*PluginNamePtr = PLUGIN_NAME;
|
||||||
|
@ -249,7 +209,9 @@ EXPORT BOOL CALL InitiateGFX(GFX_INFO Gfx_Info)
|
||||||
|
|
||||||
//Save Graphics Info
|
//Save Graphics Info
|
||||||
memcpy(&g_graphicsInfo, &Gfx_Info, sizeof(GFX_INFO));
|
memcpy(&g_graphicsInfo, &Gfx_Info, sizeof(GFX_INFO));
|
||||||
return true;
|
|
||||||
|
//Initialize Graphics Plugin
|
||||||
|
return (CoreVideo_Init() == M64ERR_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -257,21 +219,11 @@ EXPORT BOOL CALL InitiateGFX(GFX_INFO Gfx_Info)
|
||||||
//! This function is called when a rom is open. (from the emulation thread)
|
//! This function is called when a rom is open. (from the emulation thread)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
EXPORT int CALL RomOpen()
|
EXPORT int CALL RomOpen()
|
||||||
{
|
{
|
||||||
Logger::getSingleton().printMsg("RomOpen\n");
|
Logger::getSingleton().printMsg("RomOpen\n");
|
||||||
return g_graphicsPlugin.initialize(&g_graphicsInfo);
|
return g_graphicsPlugin.initialize(&g_graphicsInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
//* Resize Video Output
|
|
||||||
//! This function is called to force us to resize our output OpenGL window.
|
|
||||||
//! This is currently unsupported, and should never be called because we do
|
|
||||||
//! not pass the RESIZABLE flag to VidExt_SetVideoMode when initializing.
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
EXPORT void CALL ResizeVideoOutput(int Width, int Height)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//* Rom Closed
|
//* Rom Closed
|
||||||
//! This function is called when a rom is closed.
|
//! This function is called when a rom is closed.
|
||||||
|
@ -419,7 +371,7 @@ EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front)
|
||||||
//! Allows the core to register a callback function that will be called by the
|
//! Allows the core to register a callback function that will be called by the
|
||||||
//! graphics plugin just before the the frame buffers are swapped.
|
//! graphics plugin just before the the frame buffers are swapped.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
EXPORT void CALL SetRenderingCallback(void (*callback)(int))
|
EXPORT void CALL SetRenderingCallback(void (*callback)())
|
||||||
{
|
{
|
||||||
OpenGLManager::getSingleton().setRenderingCallback(callback);
|
OpenGLManager::getSingleton().setRenderingCallback(callback);
|
||||||
}
|
}
|
||||||
|
|
4
src/math/MathLib.h
Normal file → Executable file
4
src/math/MathLib.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -23,7 +23,6 @@
|
||||||
#define MATH_LIBRARY_H_
|
#define MATH_LIBRARY_H_
|
||||||
|
|
||||||
#include <cmath> //sqrtf
|
#include <cmath> //sqrtf
|
||||||
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
|
||||||
// Formula: a.b = a0*b0 + a1*b1 + a2*b2
|
// Formula: a.b = a0*b0 + a1*b1 + a2*b2
|
||||||
|
@ -49,6 +48,7 @@ inline void transformVertex( float* m, float* v, float* out )
|
||||||
float x = v[0];
|
float x = v[0];
|
||||||
float y = v[1];
|
float y = v[1];
|
||||||
float z = v[2];
|
float z = v[2];
|
||||||
|
float w = v[3];
|
||||||
out[0] = m[0] * x + m[4] * y + m[8] * z + m[12];
|
out[0] = m[0] * x + m[4] * y + m[8] * z + m[12];
|
||||||
out[1] = m[1] * x + m[5] * y + m[9] * z + m[13];
|
out[1] = m[1] * x + m[5] * y + m[9] * z + m[13];
|
||||||
out[2] = m[2] * x + m[6] * y + m[10] * z + m[14];
|
out[2] = m[2] * x + m[6] * y + m[10] * z + m[14];
|
||||||
|
|
2
src/math/Matrix4.cpp
Normal file → Executable file
2
src/math/Matrix4.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
3
src/math/Matrix4.h
Normal file → Executable file
3
src/math/Matrix4.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,7 +22,6 @@
|
||||||
#ifndef MATRIX_4_H_
|
#ifndef MATRIX_4_H_
|
||||||
#define MATRIX_4_H_
|
#define MATRIX_4_H_
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
|
|
2
src/osal_dynamiclib.h
Normal file → Executable file
2
src/osal_dynamiclib.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
* Mupen64plus-core - osal/dynamiclib.h *
|
* Mupen64plus-core - osal/dynamiclib.h *
|
||||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||||
* Copyright (C) 2009 Richard Goedeken *
|
* Copyright (C) 2009 Richard Goedeken *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
|
6
src/osal_dynamiclib_unix.cpp
Normal file → Executable file
6
src/osal_dynamiclib_unix.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
* Mupen64plus-core - osal/dynamiclib_unix.c *
|
* Mupen64plus-core - osal/dynamiclib_unix.c *
|
||||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||||
* Copyright (C) 2009 Richard Goedeken *
|
* Copyright (C) 2009 Richard Goedeken *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -19,9 +19,9 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <dlfcn.h>
|
||||||
|
|
||||||
#include "m64p_types.h"
|
#include "m64p_types.h"
|
||||||
#include "osal_dynamiclib.h"
|
#include "osal_dynamiclib.h"
|
||||||
|
|
146
src/osal_dynamiclib_win32.cpp
Normal file → Executable file
146
src/osal_dynamiclib_win32.cpp
Normal file → Executable file
|
@ -1,74 +1,74 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus *
|
* Arachnoid Graphics Plugin for Mupen64Plus *
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/ *
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/ *
|
||||||
* Copyright (C) 2009 Richard Goedeken *
|
* Copyright (C) 2009 Richard Goedeken *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU General Public License as published by *
|
* it under the terms of the GNU General Public License as published by *
|
||||||
* the Free Software Foundation; either version 2 of the License, or *
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
* (at your option) any later version. *
|
* (at your option) any later version. *
|
||||||
* *
|
* *
|
||||||
* This program is distributed in the hope that it will be useful, *
|
* This program is distributed in the hope that it will be useful, *
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
||||||
* *
|
* *
|
||||||
* You should have received a copy of the GNU General Public License *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* along with this program; if not, write to the *
|
* along with this program; if not, write to the *
|
||||||
* Free Software Foundation, Inc., *
|
* Free Software Foundation, Inc., *
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <windows.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <windows.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "m64p_types.h"
|
#include "m64p_types.h"
|
||||||
#include "osal_dynamiclib.h"
|
#include "osal_dynamiclib.h"
|
||||||
|
|
||||||
m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath)
|
m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath)
|
||||||
{
|
{
|
||||||
if (pLibHandle == NULL || pccLibraryPath == NULL)
|
if (pLibHandle == NULL || pccLibraryPath == NULL)
|
||||||
return M64ERR_INPUT_ASSERT;
|
return M64ERR_INPUT_ASSERT;
|
||||||
|
|
||||||
*pLibHandle = LoadLibrary(pccLibraryPath);
|
*pLibHandle = LoadLibrary(pccLibraryPath);
|
||||||
|
|
||||||
if (*pLibHandle == NULL)
|
if (*pLibHandle == NULL)
|
||||||
{
|
{
|
||||||
char *pchErrMsg;
|
char *pchErrMsg;
|
||||||
DWORD dwErr = GetLastError();
|
DWORD dwErr = GetLastError();
|
||||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr,
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr,
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL);
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL);
|
||||||
fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg);
|
fprintf(stderr, "LoadLibrary('%s') error: %s\n", pccLibraryPath, pchErrMsg);
|
||||||
LocalFree(pchErrMsg);
|
LocalFree(pchErrMsg);
|
||||||
return M64ERR_INPUT_NOT_FOUND;
|
return M64ERR_INPUT_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
return M64ERR_SUCCESS;
|
return M64ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName)
|
void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName)
|
||||||
{
|
{
|
||||||
if (pccProcedureName == NULL)
|
if (pccProcedureName == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return (void *)GetProcAddress(LibHandle, pccProcedureName);
|
return GetProcAddress(LibHandle, pccProcedureName);
|
||||||
}
|
}
|
||||||
|
|
||||||
m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle)
|
m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle)
|
||||||
{
|
{
|
||||||
int rval = FreeLibrary(LibHandle);
|
int rval = FreeLibrary(LibHandle);
|
||||||
|
|
||||||
if (rval == 0)
|
if (rval == 0)
|
||||||
{
|
{
|
||||||
char *pchErrMsg;
|
char *pchErrMsg;
|
||||||
DWORD dwErr = GetLastError();
|
DWORD dwErr = GetLastError();
|
||||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr,
|
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr,
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL);
|
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL);
|
||||||
fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg);
|
fprintf(stderr, "FreeLibrary() error: %s\n", pchErrMsg);
|
||||||
LocalFree(pchErrMsg);
|
LocalFree(pchErrMsg);
|
||||||
return M64ERR_INTERNAL;
|
return M64ERR_INTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return M64ERR_SUCCESS;
|
return M64ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
4
src/renderer/OpenGL2DRenderer.cpp
Normal file → Executable file
4
src/renderer/OpenGL2DRenderer.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,10 +19,10 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "OpenGL2DRenderer.h"
|
#include "OpenGL2DRenderer.h"
|
||||||
#include "VI.h"
|
#include "VI.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//* Initialize
|
//* Initialize
|
||||||
|
|
2
src/renderer/OpenGL2DRenderer.h
Normal file → Executable file
2
src/renderer/OpenGL2DRenderer.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
30
src/renderer/OpenGLRenderer.cpp
Normal file → Executable file
30
src/renderer/OpenGLRenderer.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jon Ring
|
* Copyright (C) 2009 Jon Ring
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
|
@ -20,29 +20,23 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include "m64p.h"
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <algorithm>
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
|
#include "OpenGLManager.h"
|
||||||
|
#include "RSP.h"
|
||||||
|
#include "RDP.h"
|
||||||
|
#include "TextureCache.h"
|
||||||
|
#include "VI.h"
|
||||||
|
#include "Logger.h"
|
||||||
//#include "CombinerManager.h"
|
//#include "CombinerManager.h"
|
||||||
#include "AdvancedCombinerManager.h"
|
#include "AdvancedCombinerManager.h"
|
||||||
#include "CachedTexture.h"
|
|
||||||
#include "ExtensionChecker.h"
|
|
||||||
#include "FogManager.h"
|
#include "FogManager.h"
|
||||||
#include "GBIDefs.h"
|
#include "ExtensionChecker.h"
|
||||||
#include "Logger.h"
|
|
||||||
#include "MultiTexturingExt.h"
|
#include "MultiTexturingExt.h"
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "OpenGLManager.h"
|
|
||||||
#include "OpenGLRenderer.h"
|
|
||||||
#include "RDP.h"
|
|
||||||
#include "RSP.h"
|
|
||||||
#include "RSPVertexManager.h"
|
|
||||||
#include "SecondaryColorExt.h"
|
#include "SecondaryColorExt.h"
|
||||||
#include "TextureCache.h"
|
|
||||||
#include "TextureLoader.h"
|
|
||||||
#include "VI.h"
|
|
||||||
#include "m64p.h"
|
|
||||||
#include "m64p_types.h"
|
|
||||||
|
|
||||||
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
|
13
src/renderer/OpenGLRenderer.h
Normal file → Executable file
13
src/renderer/OpenGLRenderer.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,17 +22,18 @@
|
||||||
#ifndef OPEN_GL_RENDERER_H_
|
#ifndef OPEN_GL_RENDERER_H_
|
||||||
#define OPEN_GL_RENDERER_H_
|
#define OPEN_GL_RENDERER_H_
|
||||||
|
|
||||||
#include "MultiTexturingExt.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
//Forward Declarations
|
//Forward Declarations
|
||||||
class FogManager;
|
struct SPVertex;
|
||||||
class RDP;
|
|
||||||
class RSP;
|
class RSP;
|
||||||
|
class RDP;
|
||||||
class TextureCache;
|
class TextureCache;
|
||||||
class VI;
|
class VI;
|
||||||
struct SPVertex;
|
class FogManager;
|
||||||
|
|
||||||
|
#include "MultiTexturingExt.h"
|
||||||
|
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
4
src/texture/CachedTexture.cpp
Normal file → Executable file
4
src/texture/CachedTexture.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
|
|
||||||
#include "CachedTexture.h"
|
#include "CachedTexture.h"
|
||||||
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|
2
src/texture/CachedTexture.h
Normal file → Executable file
2
src/texture/CachedTexture.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
11
src/texture/ImageFormatSelector.cpp
Normal file → Executable file
11
src/texture/ImageFormatSelector.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -26,13 +26,14 @@
|
||||||
//
|
//
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
||||||
#include "CachedTexture.h"
|
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "ImageFormatSelector.h"
|
#include "ImageFormatSelector.h"
|
||||||
#include "Memory.h"
|
#include "CachedTexture.h"
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "assembler.h"
|
#include "assembler.h"
|
||||||
|
#include "GBIDefs.h"
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
#include <GL/glu.h>
|
||||||
|
#include "Memory.h"
|
||||||
|
|
||||||
#ifndef GL_EXT_packed_pixels
|
#ifndef GL_EXT_packed_pixels
|
||||||
#define GL_EXT_packed_pixels 1
|
#define GL_EXT_packed_pixels 1
|
||||||
|
|
2
src/texture/ImageFormatSelector.h
Normal file → Executable file
2
src/texture/ImageFormatSelector.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
73
src/texture/TextureCache.cpp
Normal file → Executable file
73
src/texture/TextureCache.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,31 +19,25 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <algorithm>
|
#include "TextureCache.h"
|
||||||
|
|
||||||
#include "CachedTexture.h"
|
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "MathLib.h"
|
|
||||||
#include "OpenGL.h"
|
|
||||||
#include "RDP.h"
|
#include "RDP.h"
|
||||||
#include "RSP.h"
|
#include "RSP.h"
|
||||||
#include "TextureCache.h"
|
#include "CachedTexture.h"
|
||||||
#include "TextureLoader.h"
|
#include "MathLib.h"
|
||||||
|
#include <algorithm>
|
||||||
using std::min;
|
using std::min;
|
||||||
#include "Memory.h"
|
|
||||||
#include "MultiTexturingExt.h"
|
|
||||||
#include "OpenGLRenderer.h"
|
|
||||||
#include "m64p.h"
|
#include "m64p.h"
|
||||||
|
#include "OpenGL.h"
|
||||||
|
#include "Memory.h"
|
||||||
|
#include "OpenGLRenderer.h"
|
||||||
|
#include "MultiTexturingExt.h"
|
||||||
//gSPBgRect1Cyc
|
//gSPBgRect1Cyc
|
||||||
//gSPBgRectCopy
|
//gSPBgRectCopy
|
||||||
#define GL_CLAMP_TO_EDGE 0x812F
|
#define GL_CLAMP_TO_EDGE 0x812F
|
||||||
#define GL_GENERATE_MIPMAP 0x8191
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
@ -356,14 +350,14 @@ void TextureCache::_loadTexture(CachedTexture* texture)
|
||||||
mirrorTBit = 0x0000;
|
mirrorTBit = 0x0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hack for Zelda warp texture
|
// Hack for Zelda warp texture
|
||||||
if (((texture->tMem << 3) + (texture->width * texture->height << texture->size >> 1)) > 4096)
|
if (((texture->tMem << 3) + (texture->width * texture->height << texture->size >> 1)) > 4096)
|
||||||
texture->tMem = 0;
|
texture->tMem = 0;
|
||||||
|
|
||||||
// limit clamp values to min-0 (Perfect Dark has height=0 textures, making negative clamps)
|
// limit clamp values to min-0 (Perfect Dark has height=0 textures, making negative clamps)
|
||||||
if (clampTClamp & 0x8000)
|
if (clampTClamp & 0x8000)
|
||||||
clampTClamp = 0;
|
clampTClamp = 0;
|
||||||
if (clampSClamp & 0x8000)
|
if (clampSClamp & 0x8000)
|
||||||
clampSClamp = 0;
|
clampSClamp = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -538,12 +532,13 @@ unsigned int TextureCache::_calculateCRC(unsigned int t, unsigned int width, uns
|
||||||
RDPTile* tile = m_rsp->getTile(t);
|
RDPTile* tile = m_rsp->getTile(t);
|
||||||
|
|
||||||
unsigned int crc;
|
unsigned int crc;
|
||||||
unsigned int y, bpl, line;
|
unsigned int y, bpl, lineBytes, line;
|
||||||
unsigned long long *src;
|
unsigned long long *src;
|
||||||
|
|
||||||
//TODO: remove if new works
|
//TODO: remove if new works
|
||||||
//src = m_memory->getTextureMemory(tile->tmem);
|
//src = m_memory->getTextureMemory(tile->tmem);
|
||||||
bpl = width << tile->size >> 1;
|
bpl = width << tile->size >> 1;
|
||||||
|
lineBytes = tile->line << 3;
|
||||||
|
|
||||||
line = tile->line;
|
line = tile->line;
|
||||||
if (tile->size == G_IM_SIZ_32b)
|
if (tile->size == G_IM_SIZ_32b)
|
||||||
|
@ -581,32 +576,8 @@ void TextureCache::_activateTexture( unsigned int t, CachedTexture *texture )
|
||||||
unsigned int textureFiltering = m_rdp->getTextureFiltering();
|
unsigned int textureFiltering = m_rdp->getTextureFiltering();
|
||||||
if ( textureFiltering == G_TF_BILERP || textureFiltering == G_TF_AVERAGE )
|
if ( textureFiltering == G_TF_BILERP || textureFiltering == G_TF_AVERAGE )
|
||||||
{
|
{
|
||||||
if( m_mipmap > 0 )
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
||||||
{
|
|
||||||
// Set Mipmap
|
|
||||||
if(m_mipmap == 1) // nearest
|
|
||||||
{
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
|
|
||||||
}
|
|
||||||
else if(m_mipmap == 2) // bilinear
|
|
||||||
{
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
|
||||||
}
|
|
||||||
else if(m_mipmap == 3) // trilinear
|
|
||||||
{
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tell to hardware to generate mipmap (himself) when glTexImage2D is called
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
|
|
||||||
}
|
|
||||||
else // no mipmapping
|
|
||||||
{
|
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
|
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE );
|
|
||||||
}
|
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -614,8 +585,6 @@ void TextureCache::_activateTexture( unsigned int t, CachedTexture *texture )
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Set clamping modes
|
// Set clamping modes
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->clampS ? GL_CLAMP_TO_EDGE : GL_REPEAT );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texture->clampS ? GL_CLAMP_TO_EDGE : GL_REPEAT );
|
||||||
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->clampT ? GL_CLAMP_TO_EDGE : GL_REPEAT );
|
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texture->clampT ? GL_CLAMP_TO_EDGE : GL_REPEAT );
|
||||||
|
|
15
src/texture/TextureCache.h
Normal file → Executable file
15
src/texture/TextureCache.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -22,17 +22,15 @@
|
||||||
#ifndef TEXTURE_CACHE_H_
|
#ifndef TEXTURE_CACHE_H_
|
||||||
#define TEXTURE_CACHE_H_
|
#define TEXTURE_CACHE_H_
|
||||||
|
|
||||||
|
#include "CachedTexture.h"
|
||||||
|
#include "CRCCalculator2.h"
|
||||||
|
#include "ImageFormatSelector.h"
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "CRCCalculator2.h"
|
|
||||||
#include "CachedTexture.h"
|
|
||||||
#include "ImageFormatSelector.h"
|
|
||||||
|
|
||||||
//Forward declarations
|
//Forward declarations
|
||||||
class CachedTexture;
|
|
||||||
class Memory;
|
class Memory;
|
||||||
class RDP;
|
|
||||||
class RSP;
|
class RSP;
|
||||||
|
class RDP;
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//* Texture Cache
|
//* Texture Cache
|
||||||
|
@ -52,8 +50,6 @@ public:
|
||||||
void update(unsigned int tile);
|
void update(unsigned int tile);
|
||||||
void dispose();
|
void dispose();
|
||||||
|
|
||||||
void setMipmap( int value ) { m_mipmap = value; }
|
|
||||||
|
|
||||||
//Add and Remove
|
//Add and Remove
|
||||||
CachedTexture* addTop();
|
CachedTexture* addTop();
|
||||||
void removeBottom();
|
void removeBottom();
|
||||||
|
@ -85,7 +81,6 @@ private:
|
||||||
unsigned int m_maxBytes; //!< Maximum number of bytes this cache have
|
unsigned int m_maxBytes; //!< Maximum number of bytes this cache have
|
||||||
unsigned int m_cachedBytes; //!< Current number of bytes in cache
|
unsigned int m_cachedBytes; //!< Current number of bytes in cache
|
||||||
unsigned int m_bitDepth; //!<
|
unsigned int m_bitDepth; //!<
|
||||||
int m_mipmap;
|
|
||||||
|
|
||||||
//Cached textures
|
//Cached textures
|
||||||
typedef std::list<CachedTexture*> TextureList;
|
typedef std::list<CachedTexture*> TextureList;
|
||||||
|
|
15
src/texture/TextureLoader.cpp
Normal file → Executable file
15
src/texture/TextureLoader.cpp
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
@ -19,15 +19,14 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include "CRCCalculator2.h"
|
|
||||||
#include "GBI.h"
|
|
||||||
#include "GBIDefs.h"
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "Memory.h"
|
|
||||||
#include "RDP.h"
|
|
||||||
#include "TextureCache.h"
|
|
||||||
#include "TextureLoader.h"
|
#include "TextureLoader.h"
|
||||||
|
#include "Memory.h"
|
||||||
|
#include "TextureCache.h"
|
||||||
|
#include "GBIDefs.h"
|
||||||
#include "assembler.h"
|
#include "assembler.h"
|
||||||
|
#include "Logger.h"
|
||||||
|
#include "RDP.h"
|
||||||
|
#include "CRCCalculator2.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//! Constructor
|
//! Constructor
|
||||||
|
|
2
src/texture/TextureLoader.h
Normal file → Executable file
2
src/texture/TextureLoader.h
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Arachnoid Graphics Plugin for Mupen64Plus
|
* Arachnoid Graphics Plugin for Mupen64Plus
|
||||||
* https://github.com/mupen64plus/mupen64plus-video-arachnoid/
|
* http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
* Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
|
||||||
*
|
*
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue