Full Code of ata4/angrylion-rdp-plus for AI

master 9c8b9ed3e7d7 cached
69 files
767.5 KB
241.0k tokens
565 symbols
1 requests
Download .txt
Showing preview only (798K chars total). Download the full file or copy to clipboard to get everything.
Repository: ata4/angrylion-rdp-plus
Branch: master
Commit: 9c8b9ed3e7d7
Files: 69
Total size: 767.5 KB

Directory structure:
gitextract_j_xyk2b9/

├── .github/
│   └── workflows/
│       └── build.yml
├── .gitignore
├── CMakeLists.txt
├── CREDITS.txt
├── MAME License.txt
├── README.md
├── git-version.cmake
├── make_version.py
├── msvc/
│   ├── .gitignore
│   ├── angrylion-plus.sln
│   ├── core.vcxproj
│   ├── core.vcxproj.filters
│   ├── output.vcxproj
│   ├── output.vcxproj.filters
│   ├── plugin-mupen64plus.vcxproj
│   ├── plugin-mupen64plus.vcxproj.filters
│   ├── plugin-zilmar.vcxproj
│   └── plugin-zilmar.vcxproj.filters
└── src/
    ├── core/
    │   ├── common.h
    │   ├── msg.h
    │   ├── n64video/
    │   │   ├── rdp/
    │   │   │   ├── blender.c
    │   │   │   ├── combiner.c
    │   │   │   ├── coverage.c
    │   │   │   ├── dither.c
    │   │   │   ├── fbuffer.c
    │   │   │   ├── rasterizer.c
    │   │   │   ├── rdram.c
    │   │   │   ├── tcoord.c
    │   │   │   ├── tex.c
    │   │   │   ├── tmem.c
    │   │   │   └── zbuffer.c
    │   │   ├── rdp.c
    │   │   ├── vi/
    │   │   │   ├── divot.c
    │   │   │   ├── fetch.c
    │   │   │   ├── gamma.c
    │   │   │   ├── lerp.c
    │   │   │   ├── restore.c
    │   │   │   └── video.c
    │   │   └── vi.c
    │   ├── n64video.c
    │   ├── n64video.h
    │   ├── parallel.cpp
    │   ├── parallel.h
    │   └── version.h.in
    ├── output/
    │   ├── gl_core_3_3.c
    │   ├── gl_core_3_3.h
    │   ├── gl_proc.h
    │   ├── screen.h
    │   ├── vdac.c
    │   └── vdac.h
    └── plugin/
        ├── mupen64plus/
        │   ├── api/
        │   │   ├── m64p_common.h
        │   │   ├── m64p_config.h
        │   │   ├── m64p_plugin.h
        │   │   ├── m64p_types.h
        │   │   └── m64p_vidext.h
        │   ├── gfx_m64p.c
        │   ├── gfx_m64p.h
        │   ├── msg.c
        │   └── screen.c
        └── zilmar/
            ├── config.c
            ├── config.h
            ├── config.rc
            ├── gfx_1.3.c
            ├── gfx_1.3.h
            ├── msg.c
            ├── resource.h
            ├── screen.c
            ├── wgl_ext.c
            └── wgl_ext.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/build.yml
================================================
name: Angrylion RDP Plus

on:
  push:
    paths-ignore:
      - '**/*.md'
      - '.{gitattributes,gitignore,travis.yml}'
      - 'appveyor.yml,README'
  pull_request:
    paths-ignore:
      - '**/*.md'
      - '.{gitattributes,gitignore,travis.yml}'
      - 'appveyor.yml,README'
  workflow_dispatch:

jobs:

  Linux:
    strategy:
      fail-fast: false
      matrix:
        include:
          - cc: GCC
            platform: x64
          - cc: GCC
            platform: x86
          - cc: Clang
            platform: x64
          - cc: Clang
            platform: x86
    name: Linux / ${{ matrix.cc }} / ${{ matrix.platform }}
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Get build dependencies and arrange the environment
        run: |
          set +e
          git tag --delete nightly-build
          set -e
          echo "G_REV=$(git describe --dirty --always --tags)" >> "${GITHUB_ENV}"
          if [[ "${{ matrix.platform }}" == "x86" ]]; then sudo dpkg --add-architecture i386; fi
          sudo apt-get update
          sudo apt-get -y install cmake libgl1-mesa-dev libopengl-dev
          if [[ "${{ matrix.platform }}" == "x86" ]]; then
            sudo apt-get --reinstall -y install gcc-multilib g++-multilib libc6 libc6-dev-i386 libgl1-mesa-glx:i386 libopengl0:i386
            LINK="sudo ln -s -T"
            cd /usr/lib/i386-linux-gnu
            if ! [[ -f libGLX.so ]]; then ${LINK} libGLX.so.0.0.0 libGLX.so; fi
            if ! [[ -f libOpenGL.so ]]; then ${LINK} libOpenGL.so.0.0.0 libOpenGL.so; fi
          fi
          sudo ldconfig
      - name: Build and related stuff, backup binaries
        run: |
          if [[ "${{ matrix.platform }}" == "x86" ]]; then CPU_TUNE="-m32 -msse2 -mtune=pentium4"; else CPU_TUNE="-mtune=core2"; fi
          CC="gcc"
          CXX="g++"
          if [[ "${{ matrix.cc }}" != "GCC" ]]; then
            CC="clang"
            CXX="clang++"
          fi
          ${CC} --version
          echo ""
          mkdir -p build pkg/usr/local/lib/mupen64plus
          cd build
          cmake -DCMAKE_C_COMPILER="${CC}" -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_C_FLAGS="${CPU_TUNE}" -DCMAKE_CXX_FLAGS="${CPU_TUNE}" -DCMAKE_BUILD_TYPE="Release" ..
          cmake --build . -j2
          echo ""
          chmod 644 *.so
          cp *.so ../pkg/usr/local/lib/mupen64plus/
          ls -gG ../pkg/usr/local/lib/mupen64plus/*.so
          echo ""
          ldd ../pkg/usr/local/lib/mupen64plus/mupen64plus-video-angrylion-plus.so
          tar cvzf ../pkg/mupen64plus-video-angrylion-plus-linux-${{ matrix.platform }}-${{ env.G_REV }}.tar.gz -C ../pkg/ "usr"
      - name: Upload artifact
        if: matrix.cc == 'GCC'
        uses: actions/upload-artifact@v3
        with:
          name: mupen64plus-video-angrylion-plus-linux-${{ matrix.platform }}-${{ env.G_REV }}
          path: pkg/*.tar.gz

  Windows:
    strategy:
      fail-fast: false
      matrix:
        include:
          - method: static
            platform: x64
            wintag: win64
            toolset: v143
            vs: 2022
          - method: static
            platform: x86
            wintag: win32
            toolset: v143
            vs: 2022
          - method: shared
            platform: x64
            wintag: win64
            toolset: v143
            vs: 2022
          - method: shared
            platform: x86
            wintag: win32
            toolset: v141_xp
            vs: 2019
    name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.platform }} / ${{ matrix.method }}
    runs-on: windows-${{ matrix.vs }}
    defaults:
      run:
        shell: cmd
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: microsoft/setup-msbuild@v1
      - name: Pre-build arrangements
        run: |
          for /f "tokens=1" %%T in ('git tag -l ^| find "nightly-build"') do set "R_TAG=%%T"
          if [%R_TAG%] NEQ [] git tag --delete nightly-build
          for /f "tokens=1" %%R in ('git describe --dirty --always --tags') do echo G_REV=%%R>> "%GITHUB_ENV%"
      - name: Static build and backup binaries
        if: matrix.method == 'static'
        run: |
          msbuild --version
          echo.
          msbuild msvc\angrylion-plus.sln /p:Configuration=Release;Platform=${{ matrix.platform }};PlatformToolset=${{ matrix.toolset }} /t:Rebuild
          echo.
          md pkg
          dir msvc\build\Release\*.dll
          copy msvc\build\Release\*.dll pkg\
      - name: Pre-build arrangement for CMake/MSVC environment
        if: matrix.method == 'shared'
        uses: ilammy/msvc-dev-cmd@v1
      - name: Shared build and backup binaries
        if: matrix.method == 'shared'
        run: |
          set "TARCH=${{ matrix.platform }}"
          if [%TARCH%] == [x86] set "TARCH=Win32"
          msbuild --version
          echo.
          md pkg build
          cd build
          cmake -DBUILD_PROJECT64=ON -T "${{ matrix.toolset }}" -A "%TARCH%" ..
          cmake --build . --config Release
          echo.
          dir Release\*.dll
          copy Release\*.dll ..\pkg\
      - name: Upload artifact
        uses: actions/upload-artifact@v3
        with:
          name: angrylion-rdp-plus-${{ matrix.wintag }}-${{ matrix.method }}-${{ env.G_REV }}
          path: pkg/*

  Nightly-build:
    runs-on: ubuntu-latest
    if: github.ref_name == 'master'
    needs: [Linux, Windows]
    steps:
      - uses: actions/checkout@v3
      - name: Download artifacts
        uses: actions/download-artifact@v3
        with:
          path: binaries
      - name: Get some tools
        run: |
          sudo apt-get update
          sudo apt-get -y install hashdeep
      - name: Creating new artifacts and update nightly-build
        run: |
          mkdir pkg
          cd binaries
          for BIN in *; do
            cd "${BIN}"
            if [[ "${BIN:0:11}" == "mupen64plus" ]]; then
              echo ":: Recovering ${BIN}.tar.gz"
              mv *.tar.gz ../../pkg/
            elif [[ "${BIN:25:6}" == "static" ]]; then
              if [[ -f "./angrylion-plus.dll" ]]; then
                echo ":: Creating project64-angrylion-plus-${BIN:19:5}-${BIN:32}.zip"
                zip -r "../../pkg/project64-angrylion-plus-${BIN:19:5}-${BIN:32}.zip" angrylion-plus.dll
              fi
              if [[ -f "./mupen64plus-video-angrylion-plus.dll" ]]; then
                echo ":: Creating mupen64plus-video-angrylion-plus-${BIN:19:5}-${BIN:32}.zip"
                zip -r "../../pkg/mupen64plus-video-angrylion-plus-${BIN:19:5}-${BIN:32}.zip" mupen64plus-video-angrylion-plus.dll
              fi
            else
              echo ":: Creating project64-angrylion-plus-${BIN:19}.zip"
              zip -r "../../pkg/project64-angrylion-plus-${BIN:19}.zip" angrylion-plus.dll
              echo ":: Creating mupen64plus-video-angrylion-plus-${BIN:19}.zip"
              zip -r "../../pkg/mupen64plus-video-angrylion-plus-${BIN:19}.zip" mupen64plus-video-angrylion-plus.dll
            fi
            cd ..
          done
          cd ../pkg
          echo ""
          for BIN in *; do
            ls -gG ${BIN}
            tigerdeep -lz ${BIN} >> ../angrylion-rdp-plus.tiger.txt
            sha256sum ${BIN} >> ../angrylion-rdp-plus.sha256.txt
            sha512sum ${BIN} >> ../angrylion-rdp-plus.sha512.txt
          done
          mv ../*.tiger.txt .
          mv ../*.sha*.txt .
          echo ""
          echo "TIGER:"
          cat *.tiger.txt
          echo ""
          echo "SHA256:"
          cat *.sha256.txt
          echo ""
          echo "SHA512:"
          cat *.sha512.txt
          echo ""
          git tag -f nightly-build
          git push -f origin nightly-build
      - name: Nightly-build
        uses: ncipollo/release-action@v1
        with:
          prerelease: true
          allowUpdates: true
          removeArtifacts: true
          replacesArtifacts: false
          tag: nightly-build
          artifacts: pkg/*


================================================
FILE: .gitignore
================================================
# Visual Studio cache/options directory
.vs/

# Visual C++ cache files
*.aps

src/core/version.h
private/
build/


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 3.10)

option(BUILD_MUPEN64PLUS "Enables build of mupen64plus version" ON)
option(BUILD_PROJECT64   "Enables build of project64 version" WIN32)
option(GLES "Set to ON to use OpenGL ES 3.0 renderer instead of OpenGL 3.3 core")

project(angrylion-plus)

include(GNUInstallDirs)

set(OpenGL_GL_PREFERENCE GLVND)

if (BUILD_PROJECT64 AND NOT WIN32)
    message(WARNING "BUILD_PROJECT64 is ON but not supported on current platform, disabling option")
    set(BUILD_PROJECT64 OFF)
endif()

if(GLES)
    message("OpenGL ES 3.0 renderer enabled")
    add_definitions(-DGLES)
endif(GLES)

if(ANDROID)
    add_definitions(-DANDROID)
endif()

# set policy CMP0042 for MacOS X
set(CMAKE_MACOSX_RPATH 1)

# check for INTERPROCEDURAL_OPTIMIZATION support
cmake_policy(SET CMP0069 NEW)

include(CheckIPOSupported)
check_ipo_supported(RESULT ENABLE_IPO)
if(ENABLE_IPO)
    message("Interprocedural optimizations enabled")
endif(ENABLE_IPO)

# C++14 is required for the Parallel utility class
set(CMAKE_CXX_STANDARD 14)

# disable warnings to use unportable secure file IO
if(MSVC)
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)

# default to release build
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)

if (NOT ANDROID)
    find_package(OpenGL REQUIRED)
endif()

# use warning levels as recommended by
# https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md
if ( CMAKE_COMPILER_IS_GNUCC )
    set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Wnon-virtual-dtor -pedantic")
endif()
if ( MSVC )
    set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} /W4 /w14640 /permissive-")
endif()

set(PATH_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src")

# RDP core library
set(PATH_CORE "${PATH_SRC}/core")

# run script to generate version.h
set(PATH_VERSION "${PATH_CORE}/version.h")

add_custom_command(
    OUTPUT ${PATH_VERSION}
    COMMAND
        ${CMAKE_COMMAND} -DPATH_VERSION=${PATH_VERSION}
        -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
        -P ${CMAKE_CURRENT_SOURCE_DIR}/git-version.cmake
    COMMENT "Generate Git version"
)

# static core library
file(GLOB SOURCES_CORE "${PATH_CORE}/*.c" "${PATH_CORE}/*.cpp")

if (ANDROID)
    find_library( # Defines the name of the path variable that stores the
        # location of the NDK library.
        OPENGL_LIBRARIES

        # Specifies the name of the NDK library that
        # CMake needs to locate.
        GLESv3 )
endif()

add_library(alp-core STATIC ${SOURCES_CORE} ${PATH_VERSION})

# output library
set(PATH_OUTPUT "${PATH_SRC}/output")

file(GLOB SOURCES_OUTPUT "${PATH_OUTPUT}/*.c" "${PATH_OUTPUT}/*.cpp")

add_library(alp-output STATIC ${SOURCES_OUTPUT})

if(MINGW)
    # link libgcc/libstdc++ statically, fixes cryptic "_ZNSt13runtime_errorC1EPKc" error
    set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
else(MINGW)
    # set PIC option for non-MinGW targets
    set_target_properties(alp-core PROPERTIES POSITION_INDEPENDENT_CODE ON)
    set_target_properties(alp-output PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif(MINGW)

# set IPO option, if supported
if(ENABLE_IPO AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
    set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O3")
endif()

include_directories(${PATH_SRC})

# Project64 GFX Plugin (Windows only)
if(BUILD_PROJECT64)
    set(NAME_PLUGIN_ZILMAR ${CMAKE_PROJECT_NAME})
    set(PATH_PLUGIN_ZILMAR "${PATH_SRC}/plugin/zilmar")

    enable_language(RC)
    file(GLOB SOURCES_PLUGIN_ZILMAR "${PATH_PLUGIN_ZILMAR}/*.c" "${PATH_PLUGIN_ZILMAR}/*.rc")
    add_library(${NAME_PLUGIN_ZILMAR} SHARED ${SOURCES_PLUGIN_ZILMAR})

    set_target_properties(${NAME_PLUGIN_ZILMAR} PROPERTIES PREFIX "")

    target_link_libraries(${NAME_PLUGIN_ZILMAR} alp-core alp-output shlwapi ${OPENGL_LIBRARIES})
endif(BUILD_PROJECT64)

# Mupen64Plus GFX plugin
if(BUILD_MUPEN64PLUS)
    set(NAME_PLUGIN_M64P "mupen64plus-video-${CMAKE_PROJECT_NAME}")
    
    set(PATH_PLUGIN_M64P "${PATH_SRC}/plugin/mupen64plus")
    
    file(GLOB SOURCES_PLUGIN_M64P "${PATH_PLUGIN_M64P}/*.c")
    add_library(${NAME_PLUGIN_M64P} SHARED ${SOURCES_PLUGIN_M64P})
    
    if(NOT ANDROID)
        set_target_properties(${NAME_PLUGIN_M64P} PROPERTIES PREFIX "")
    endif()
    
    target_link_libraries(${NAME_PLUGIN_M64P} alp-core alp-output ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES})
    
    if(UNIX AND NOT APPLE AND NOT ANDROID)
        install(TARGETS ${NAME_PLUGIN_M64P}
            DESTINATION "${CMAKE_INSTALL_LIBDIR}/mupen64plus"
        )
    endif()
endif(BUILD_MUPEN64PLUS)


================================================
FILE: CREDITS.txt
================================================
This little RDP plugin was initially based on MESS 0.128 source code.
Many thanks to Ville Linde, MooglyGuy and other people who wrote the RDP implementation in MESS 0.128. The rest of the code is by me, angrylion.
Many thanks to people who helped me in various ways: olivieryuyu, marshallh, LaC, oman, pinchy, ziggy, FatCat, LegendOfDragoon and other folks I forgot.
The code comes under MAME license.
Sorry for my terrible English.

angrylion


================================================
FILE: MAME License.txt
================================================
MAME Legal Information
License

Redistribution and use of the MAME code or any derivative works are permitted provided that the following conditions are met:

    * Redistributions may not be sold, nor may they be used in a commercial product or activity.
    * Redistributions that are modified from the original source must include the complete source code, including the source code for all components used by a binary built from the modified sources. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
    * Redistributions must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Trademark

MAME is a registered trademark of Nicola Salmoria. The "MAME" name and MAME logo may not be used without first obtaining permission of the trademark holder.
Copyright

The code in MAME is the work of hundreds of developers, each of whom owns the copyright to the code they wrote. There is no central copyright authority you can license the code from. The proper way to use the MAME source code is to examine it, using it to understand how the games worked, and then write your own emulation code. Sorry, there is no free lunch here.
Common Questions

Q. Can I include MAME with my product?
A. No. MAME is not licensed for commercial use. Using MAME as a "freebie" or including it at "no cost" with your product still constitutes commerical usage and is forbidden by the license.

Q. Can I sell my product with the MAME logo on it?
A. No. Putting the logo on your product makes it appear that the product is something officially endorsed by Nicola Salmoria, and constitutes trademark infringement.

Q. Can I use the MAME logo to advertise my product?
A. No. Using the logo in your advertising makes it appear that the product is something officially endorsed by Nicola Salmoria, and constitutes trademark infringement.

Q. Can I use the term "MAME" in the name of my software?
A. Generally, no, especially if it is something that is sold. However, if you are producing a free MAME-related piece of software, it is common that permission is granted. Send a query to double- check first, please.

Q. Can I put an arcade cabinet running MAME in a public location?
A. No. This this a commercial use of MAME and is prohibited by the license. Even if you don't charge money, putting a machine in a public location is "operating" an arcade machine and falls under commercial rules in most locations.

Q. Can my non-profit use MAME or an arcade cabinet running MAME to help raise money?
A. No, sorry. Even for the most worthwhile cause, this still is a commercial use of MAME and is prohibited by the license.

Q. How do I obtain a license to the MAME source code?
A. You can't. See the Copyright section above.

Q. Is it legal to download ROMs for a game when I own the PCB?
A. This is unclear and depends on where you live. In most cases you would need to obtain permission from the original manufacturer to do so.

Q. What about the free ROMs on the MAME site? Can I use those with my product?
A. Almost all of the free ROMs on the MAME site are licensed only for non- commercial use, and only for distribution from the MAME site. Just because they are available for "free" here does not grant further redistribution rights, nor does it allow you to treat them as "freebies" for commercial use.

Q. If I obtain a license from an original manufacturer to distribute the ROMs can I use MAME to run them?
A. Generally, no, because it constitutes a commercial use of MAME. However, we have in the past made a couple of exceptions for this particular case. We will not consider making any further exceptions without proof that such a license has already been obtained.

Q. Can I use a PC running MAME to replace a real arcade PCB?
A. In order to do this you would have to use a copy of the original ROMs, which would require obtaining permission from the original manufacturer. Once you had permission from them, if it was used for non-commercial purposes, then you would not technically be violating the MAME license. However we still do not explicitly give permission to use MAME in this way because of the possibility of the game being sold sometime later, which would constitute commercial use of MAME. If you sell your game later you must sell it without MAME included.

Q. Can I ask for donations for the work I did on my port of MAME to platform X?
A. No. You would be earning money from the MAME trademark and copyrights, and that would be a commercial use, which is prohibited by the license. It is our wish that MAME remain free.


================================================
FILE: README.md
================================================
# Angrylion RDP Plus

This is a conservative fork of angrylion's RDP plugin that aims to improve performance and add new features while retaining the accuracy of the original plugin.

### Current features
* More maintainable code base by dividing the huge n64video.cpp into smaller pieces.
* Improved portability by separating the emulator plugin interface and window management from the RDP emulation core.
* Improved performance on multi-core CPUs by using multi-threaded rendering with scan line interleaving.
* Replaced deprecated DirectDraw interface with a modern OpenGL 3.3 implementation.
* Added fullscreen support and manual window sizing.
* Added BMP screenshot support.
* Added settings GUI.
* Added Mupen64Plus support.

Tested with Project64 2.3+. May also work with Project64 1.7 with a RSP plugin of newer builds (1.7.1+).

The Mupen64Plus plugin was tested with Mupen64Plus 2.5 using the [mupen64plus-rsp-cxd4](https://github.com/mupen64plus/mupen64plus-rsp-cxd4) plugin.

### Building

#### Visual Studio

To build the project with Visual Studio (2015+), you currently need to have Python 3 installed, which is used to fetch Git metadata and write it to `version.h`.
You can also build without, but then you have to copy `version.h.in` to `version.h` and disable the custom build event in the core project.

The glLoadGen files (`gl_core_3_3` and `wgl_ext`) were generated using the following parameters:

```bash
lua LoadGen.lua core_3_3 -style=pointer_c -spec=gl -version=3.3 -profile=core
lua LoadGen.lua ext -style=pointer_c -spec=wgl -ext WGL_EXT_swap_control -ext ARB_create_context -ext ARB_create_context_profile
```

#### CMake

Install dependencies:

```bash
apt install cmake freeglut3-dev
```

Building:

```bash
mkdir build
cd build
cmake ..
make
```

To create an OpenGL ES 3 build, add ``-DGLES=ON`` to the cmake arguments.

Installing:

```bash
sudo make install
```

### Credits
* Angrylion, Ville Linde, MooglyGuy and others involved for creating an awesome N64 RDP reference software.
* theboy181 - Testing. Lots of testing.
* fallaha56 - Donator.
* loganmc10 - Mupen64Plus plugin implementation.


================================================
FILE: git-version.cmake
================================================
set(GIT_BRANCH "unknown")
set(GIT_COMMIT_DATE "unknown")
set(GIT_COMMIT_HASH "unknown")
set(GIT_TAG "unknown")

find_package(Git)
if(GIT_FOUND AND EXISTS "${SOURCE_DIR}/.git/")
	execute_process(
		COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
		WORKING_DIRECTORY ${SOURCE_DIR}
		RESULT_VARIABLE GIT_BRANCH_RESULT
		OUTPUT_VARIABLE GIT_BRANCH
		OUTPUT_STRIP_TRAILING_WHITESPACE
	)
	if(NOT ${GIT_BRANCH_RESULT} EQUAL 0)
		message(WARNING "git rev-parse failed, unknown branch.")
	endif()

	execute_process(
		COMMAND ${GIT_EXECUTABLE} show -s --format=%cs
		WORKING_DIRECTORY ${SOURCE_DIR}
		RESULT_VARIABLE GIT_COMMIT_DATE_RESULT
		OUTPUT_VARIABLE GIT_COMMIT_DATE
		OUTPUT_STRIP_TRAILING_WHITESPACE
	)
	if(NOT ${GIT_COMMIT_DATE_RESULT} EQUAL 0)
		message(WARNING "git show failed, unknown commit date.")
	endif()

	execute_process(
		COMMAND ${GIT_EXECUTABLE} show -s --format=%h
		WORKING_DIRECTORY ${SOURCE_DIR}
		RESULT_VARIABLE GIT_COMMIT_HASH_RESULT
		OUTPUT_VARIABLE GIT_COMMIT_HASH
		OUTPUT_STRIP_TRAILING_WHITESPACE
	)
	if(NOT ${GIT_COMMIT_HASH_RESULT} EQUAL 0)
		message(WARNING "git show failed, unknown commit hash.")
	endif()

	execute_process(
		COMMAND ${GIT_EXECUTABLE} describe --dirty --always --tags
		WORKING_DIRECTORY ${SOURCE_DIR}
		RESULT_VARIABLE GIT_TAG_RESULT
		OUTPUT_VARIABLE GIT_TAG
		OUTPUT_STRIP_TRAILING_WHITESPACE
	)
	if(NOT ${GIT_TAG_RESULT} EQUAL 0)
		message(WARNING "git describe failed, unknown tag.")
	endif()
else()
	message(WARNING "git not found or not a git repo.")
endif()

configure_file(${PATH_VERSION}.in ${PATH_VERSION} @ONLY)


================================================
FILE: make_version.py
================================================
#!/usr/bin/env python3

import sys, os, subprocess

def system(cmd, default):
    args = cmd.split()
    try:
        return subprocess.check_output(args).decode("ascii").strip()
    except:
        return default

if __name__ == "__main__":
    branch = system("git rev-parse --abbrev-ref HEAD", "master")
    hash = system("git show -s --format=%h", "0" * 40)
    date = system("git show -s --format=%ci", "")[:10]
    tag = system("git describe --dirty --always --tags", "")

    # remove hash from git describe output
    tag = tag.split("-")
    if len(tag) > 2 and tag[2][1:] in hash:
        del tag[2]
    tag = "-".join(tag)

    mappings = {
        "GIT_BRANCH": branch,
        "GIT_TAG": tag,
        "GIT_COMMIT_HASH": hash,
        "GIT_COMMIT_DATE": date,
    }

    base_path = os.path.dirname(sys.argv[0])
    core_path = os.path.join(base_path, "src", "core")
    in_path = os.path.join(core_path, "version.h.in")
    out_path = os.path.join(core_path, "version.h")

    with open(in_path, "r") as f:
        version_str = f.read()

    for mapping, value in mappings.items():
        version_str = version_str.replace("@" + mapping + "@", value)

    with open(out_path, "w") as f:
        f.write(version_str)


================================================
FILE: msvc/.gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
bld/
[Bb]in/
[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db

# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml

# TODO: Un-comment the next line if you do not want to checkin 
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets

# Microsoft Azure Build Output
csx/
*.build.csdef

# Microsoft Azure Emulator
ecf/
rcf/

# Microsoft Azure ApplicationInsights config file
ApplicationInsights.config

# Windows Store app package directory
AppPackages/
BundleArtifacts/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# GhostDoc plugin setting file
*.GhostDoc.xml

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions

# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml

# Paket dependency manager
.paket/paket.exe

# FAKE - F# Make
.fake/

================================================
FILE: msvc/angrylion-plus.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core.vcxproj", "{D86C6E84-3371-4B20-8620-A703FF3F2CC5}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin-mupen64plus", "plugin-mupen64plus.vcxproj", "{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}"
	ProjectSection(ProjectDependencies) = postProject
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5} = {D86C6E84-3371-4B20-8620-A703FF3F2CC5}
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE} = {B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin-zilmar", "plugin-zilmar.vcxproj", "{722AD25D-C281-48FB-9A58-7699E50F8E6D}"
	ProjectSection(ProjectDependencies) = postProject
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5} = {D86C6E84-3371-4B20-8620-A703FF3F2CC5}
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE} = {B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}
	EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "output", "output.vcxproj", "{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|x64 = Debug|x64
		Debug|x86 = Debug|x86
		Release|x64 = Release|x64
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Debug|x64.ActiveCfg = Debug|x64
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Debug|x64.Build.0 = Debug|x64
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Debug|x86.ActiveCfg = Debug|Win32
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Debug|x86.Build.0 = Debug|Win32
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Release|x64.ActiveCfg = Release|x64
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Release|x64.Build.0 = Release|x64
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Release|x86.ActiveCfg = Release|Win32
		{D86C6E84-3371-4B20-8620-A703FF3F2CC5}.Release|x86.Build.0 = Release|Win32
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Debug|x64.ActiveCfg = Debug|x64
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Debug|x64.Build.0 = Debug|x64
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Debug|x86.ActiveCfg = Debug|Win32
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Debug|x86.Build.0 = Debug|Win32
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Release|x64.ActiveCfg = Release|x64
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Release|x64.Build.0 = Release|x64
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Release|x86.ActiveCfg = Release|Win32
		{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}.Release|x86.Build.0 = Release|Win32
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Debug|x64.ActiveCfg = Debug|x64
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Debug|x64.Build.0 = Debug|x64
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Debug|x86.ActiveCfg = Debug|Win32
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Debug|x86.Build.0 = Debug|Win32
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Release|x64.ActiveCfg = Release|x64
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Release|x64.Build.0 = Release|x64
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Release|x86.ActiveCfg = Release|Win32
		{722AD25D-C281-48FB-9A58-7699E50F8E6D}.Release|x86.Build.0 = Release|Win32
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Debug|x64.ActiveCfg = Debug|x64
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Debug|x64.Build.0 = Debug|x64
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Debug|x86.ActiveCfg = Debug|Win32
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Debug|x86.Build.0 = Debug|Win32
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Release|x64.ActiveCfg = Release|x64
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Release|x64.Build.0 = Release|x64
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Release|x86.ActiveCfg = Release|Win32
		{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}.Release|x86.Build.0 = Release|Win32
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {2896B5DF-D1A8-4A2B-BB7D-835C07F05863}
	EndGlobalSection
EndGlobal


================================================
FILE: msvc/core.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\core\n64video\rdp.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\blender.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\combiner.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\coverage.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\dither.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\fbuffer.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\rasterizer.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\rdram.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\tcoord.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\tex.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\tmem.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\zbuffer.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\divot.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\fetch.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\gamma.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\lerp.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\restore.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\video.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="..\src\core\parallel.cpp" />
    <ClCompile Include="..\src\core\n64video.c" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\core\common.h" />
    <ClInclude Include="..\src\core\msg.h" />
    <ClInclude Include="..\src\core\parallel.h" />
    <ClInclude Include="..\src\core\n64video.h" />
  </ItemGroup>
  <ItemGroup>
    <None Include="..\src\core\version.h.in" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{D86C6E84-3371-4B20-8620-A703FF3F2CC5}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
  </PropertyGroup>
  <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
    <!-- Latest Target Version property -->
    <LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
    <WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
    <TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader />
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
    <PreBuildEvent>
      <Command>python "$(SolutionDir)..\make_version.py"</Command>
    </PreBuildEvent>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
    </Link>
    <PreBuildEvent>
      <Command>python "$(SolutionDir)..\make_version.py"</Command>
    </PreBuildEvent>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader />
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
    <PreBuildEvent>
      <Command>python "$(SolutionDir)..\make_version.py"</Command>
    </PreBuildEvent>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
    </Link>
    <PreBuildEvent>
      <Command>python "$(SolutionDir)..\make_version.py"</Command>
    </PreBuildEvent>
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: msvc/core.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{5467dd49-ff5e-4be4-93ad-8291721fc00d}</UniqueIdentifier>
      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{142a5325-573c-4fde-9d8f-af10cb6e28e5}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
    </Filter>
    <Filter Include="Source Files\n64video">
      <UniqueIdentifier>{201fc67f-a10c-47a3-a9f6-47b9ccdf155a}</UniqueIdentifier>
    </Filter>
    <Filter Include="Source Files\n64video\vi">
      <UniqueIdentifier>{9ac263b1-1e35-44a3-8368-2c88ff3bb096}</UniqueIdentifier>
    </Filter>
    <Filter Include="Source Files\n64video\rdp">
      <UniqueIdentifier>{0def43d5-fe85-4dc1-9b3e-264603cca8fa}</UniqueIdentifier>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\core\parallel.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\blender.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\combiner.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\coverage.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\dither.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\fbuffer.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\rasterizer.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\rdram.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\tcoord.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\tex.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\tmem.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp\zbuffer.c">
      <Filter>Source Files\n64video\rdp</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\divot.c">
      <Filter>Source Files\n64video\vi</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\fetch.c">
      <Filter>Source Files\n64video\vi</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\gamma.c">
      <Filter>Source Files\n64video\vi</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\lerp.c">
      <Filter>Source Files\n64video\vi</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\restore.c">
      <Filter>Source Files\n64video\vi</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi\video.c">
      <Filter>Source Files\n64video\vi</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\rdp.c">
      <Filter>Source Files\n64video</Filter>
    </ClCompile>
    <ClCompile Include="..\src\core\n64video\vi.c">
      <Filter>Source Files\n64video</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\core\common.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\core\msg.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\core\parallel.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\core\n64video.h">
      <Filter>Source Files</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <None Include="..\src\core\version.h.in">
      <Filter>Source Files</Filter>
    </None>
  </ItemGroup>
</Project>

================================================
FILE: msvc/output.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\output\gl_core_3_3.c" />
    <ClCompile Include="..\src\output\vdac.c" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\output\gl_core_3_3.h" />
    <ClInclude Include="..\src\output\gl_proc.h" />
    <ClInclude Include="..\src\output\screen.h" />
    <ClInclude Include="..\src\output\vdac.h" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{B74D5BAF-38F4-4233-9FC1-BE7E02E81FDE}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
  </PropertyGroup>
  <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
    <!-- Latest Target Version property -->
    <LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
    <WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
    <TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>StaticLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader />
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
    <PreBuildEvent />
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
    </Link>
    <PreBuildEvent />
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader />
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
    <PreBuildEvent />
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <DisableSpecificWarnings>4204</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
    </Link>
    <PreBuildEvent />
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: msvc/output.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\output\gl_core_3_3.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\output\vdac.c">
      <Filter>Source Files</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\output\gl_core_3_3.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\output\gl_proc.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\output\screen.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\output\vdac.h">
      <Filter>Source Files</Filter>
    </ClInclude>
  </ItemGroup>
</Project>

================================================
FILE: msvc/plugin-mupen64plus.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_common.h" />
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_config.h" />
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_plugin.h" />
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_types.h" />
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_vidext.h" />
    <ClInclude Include="..\src\plugin\mupen64plus\gfx_m64p.h" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\plugin\mupen64plus\gfx_m64p.c" />
    <ClCompile Include="..\src\plugin\mupen64plus\msg.c" />
    <ClCompile Include="..\src\plugin\mupen64plus\screen.c" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{54BDC4EF-2526-47F7-A73E-C1C0FBC0237C}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
  </PropertyGroup>
  <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
    <!-- Latest Target Version property -->
    <LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
    <WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
    <TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
    <TargetName>mupen64plus-video-$(SolutionName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <TargetName>mupen64plus-video-$(SolutionName)</TargetName>
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
    <TargetName>mupen64plus-video-$(SolutionName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <TargetName>mupen64plus-video-$(SolutionName)</TargetName>
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader />
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4201</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention />
      <TargetMachine>MachineX86</TargetMachine>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>4201</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
      <SmallerTypeCheck>false</SmallerTypeCheck>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader />
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <DisableSpecificWarnings>4201</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention />
      <TargetMachine>MachineX86</TargetMachine>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
      <SmallerTypeCheck>false</SmallerTypeCheck>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <DisableSpecificWarnings>4201</DisableSpecificWarnings>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: msvc/plugin-mupen64plus.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{5467dd49-ff5e-4be4-93ad-8291721fc00d}</UniqueIdentifier>
      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{142a5325-573c-4fde-9d8f-af10cb6e28e5}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
    </Filter>
    <Filter Include="Source Files\api">
      <UniqueIdentifier>{363d4ce3-41b8-4b23-8739-7618a5da0345}</UniqueIdentifier>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_common.h">
      <Filter>Source Files\api</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_config.h">
      <Filter>Source Files\api</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_plugin.h">
      <Filter>Source Files\api</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_types.h">
      <Filter>Source Files\api</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\mupen64plus\api\m64p_vidext.h">
      <Filter>Source Files\api</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\mupen64plus\gfx_m64p.h">
      <Filter>Source Files</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\plugin\mupen64plus\gfx_m64p.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\plugin\mupen64plus\msg.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\plugin\mupen64plus\screen.c">
      <Filter>Source Files</Filter>
    </ClCompile>
  </ItemGroup>
</Project>

================================================
FILE: msvc/plugin-zilmar.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="..\src\plugin\zilmar\config.rc" />
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\plugin\zilmar\config.c" />
    <ClCompile Include="..\src\plugin\zilmar\gfx_1.3.c" />
    <ClCompile Include="..\src\plugin\zilmar\msg.c" />
    <ClCompile Include="..\src\plugin\zilmar\screen.c" />
    <ClCompile Include="..\src\plugin\zilmar\wgl_ext.c" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\plugin\zilmar\config.h" />
    <ClInclude Include="..\src\plugin\zilmar\gfx_1.3.h" />
    <ClInclude Include="..\src\plugin\zilmar\resource.h" />
    <ClInclude Include="..\src\plugin\zilmar\wgl_ext.h" />
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{722AD25D-C281-48FB-9A58-7699E50F8E6D}</ProjectGuid>
    <Keyword>Win32Proj</Keyword>
  </PropertyGroup>
  <PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'==''">
    <!-- Latest Target Version property -->
    <LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
    <WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
    <TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
    <WholeProgramOptimization>true</WholeProgramOptimization>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
    <TargetName>$(SolutionName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <TargetName>$(SolutionName)</TargetName>
    <LinkIncremental>true</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
    <TargetName>$(SolutionName)</TargetName>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <TargetName>$(SolutionName)</TargetName>
    <LinkIncremental>false</LinkIncremental>
    <OutDir>$(SolutionDir)build\$(Configuration)\</OutDir>
    <IntDir>$(SolutionDir)build\$(Configuration)\$(ProjectName)\</IntDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader />
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention />
      <ImportLibrary>$(OutDir)angrylion.lib</ImportLibrary>
      <TargetMachine>MachineX86</TargetMachine>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <Optimization>Disabled</Optimization>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <WarningLevel>Level4</WarningLevel>
      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Windows</SubSystem>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <ImportLibrary>$(OutDir)angrylion.lib</ImportLibrary>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
      <SmallerTypeCheck>false</SmallerTypeCheck>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader />
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention />
      <ImportLibrary>$(OutDir)angrylion.lib</ImportLibrary>
      <TargetMachine>MachineX86</TargetMachine>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <Optimization>MaxSpeed</Optimization>
      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
      <OmitFramePointers>true</OmitFramePointers>
      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <StringPooling>true</StringPooling>
      <BasicRuntimeChecks>Default</BasicRuntimeChecks>
      <SmallerTypeCheck>false</SmallerTypeCheck>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <BufferSecurityCheck>false</BufferSecurityCheck>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <PrecompiledHeader>
      </PrecompiledHeader>
      <BrowseInformation>true</BrowseInformation>
      <WarningLevel>Level4</WarningLevel>
      <TreatWarningAsError>true</TreatWarningAsError>
      <FloatingPointModel>Fast</FloatingPointModel>
      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
      <AdditionalIncludeDirectories>$(SolutionDir)..\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <MultiProcessorCompilation>true</MultiProcessorCompilation>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <GenerateMapFile>true</GenerateMapFile>
      <MapExports>true</MapExports>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <EnableCOMDATFolding>true</EnableCOMDATFolding>
      <RandomizedBaseAddress>false</RandomizedBaseAddress>
      <DataExecutionPrevention>
      </DataExecutionPrevention>
      <ImportLibrary>$(OutDir)angrylion.lib</ImportLibrary>
      <AdditionalDependencies>opengl32.lib;core.lib;output.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    </Link>
  </ItemDefinitionGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: msvc/plugin-zilmar.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{5467dd49-ff5e-4be4-93ad-8291721fc00d}</UniqueIdentifier>
      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{142a5325-573c-4fde-9d8f-af10cb6e28e5}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="..\src\plugin\zilmar\config.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\plugin\zilmar\gfx_1.3.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\plugin\zilmar\msg.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\plugin\zilmar\screen.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="..\src\plugin\zilmar\wgl_ext.c">
      <Filter>Source Files</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\src\plugin\zilmar\config.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\zilmar\gfx_1.3.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\zilmar\resource.h">
      <Filter>Source Files</Filter>
    </ClInclude>
    <ClInclude Include="..\src\plugin\zilmar\wgl_ext.h">
      <Filter>Source Files</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="..\src\plugin\zilmar\config.rc">
      <Filter>Resource Files</Filter>
    </ResourceCompile>
  </ItemGroup>
</Project>

================================================
FILE: src/core/common.h
================================================
#pragma once

// endianness
#define LSB_FIRST 1 
#ifdef LSB_FIRST
    #define BYTE_ADDR_XOR       3
    #define WORD_ADDR_XOR       1
    #define BYTE4_XOR_BE(a)     ((a) ^ BYTE_ADDR_XOR)
#else
    #define BYTE_ADDR_XOR       0
    #define WORD_ADDR_XOR       0
    #define BYTE4_XOR_BE(a)     (a)
#endif

#ifdef LSB_FIRST
    #define BYTE_XOR_DWORD_SWAP 7
    #define WORD_XOR_DWORD_SWAP 3
#else
    #define BYTE_XOR_DWORD_SWAP 4
    #define WORD_XOR_DWORD_SWAP 2
#endif

#define DWORD_XOR_DWORD_SWAP 1

// inlining
#define INLINE inline

#ifdef _MSC_VER
#define STRICTINLINE __forceinline
#elif defined(__GNUC__)
#define STRICTINLINE __attribute__((always_inline)) inline
#else
#define STRICTINLINE inline
#endif

// misc
#define UNUSED(x) (void)(x)


================================================
FILE: src/core/msg.h
================================================
#pragma once

void msg_error(const char * err, ...);
void msg_warning(const char* err, ...);
void msg_debug(const char* err, ...);


================================================
FILE: src/core/n64video/rdp/blender.c
================================================
#ifdef N64VIDEO_C

static int32_t blenderone = 0xff;

static uint8_t bldiv_hwaccurate_table[0x8000];

static INLINE void set_blender_input(struct rdp_state* wstate, int cycle, int which, int32_t **input_r, int32_t **input_g, int32_t **input_b, int32_t **input_a, int a, int b)
{

    switch (a & 0x3)
    {
        case 0:
        {
            if (cycle == 0)
            {
                *input_r = &wstate->pixel_color.r;
                *input_g = &wstate->pixel_color.g;
                *input_b = &wstate->pixel_color.b;
            }
            else
            {
                *input_r = &wstate->blended_pixel_color.r;
                *input_g = &wstate->blended_pixel_color.g;
                *input_b = &wstate->blended_pixel_color.b;
            }
            break;
        }

        case 1:
        {
            *input_r = &wstate->memory_color.r;
            *input_g = &wstate->memory_color.g;
            *input_b = &wstate->memory_color.b;
            break;
        }

        case 2:
        {
            *input_r = &wstate->blend_color.r;      *input_g = &wstate->blend_color.g;      *input_b = &wstate->blend_color.b;
            break;
        }

        case 3:
        {
            *input_r = &wstate->fog_color.r;        *input_g = &wstate->fog_color.g;        *input_b = &wstate->fog_color.b;
            break;
        }
    }

    if (which == 0)
    {
        switch (b & 0x3)
        {
            case 0:     *input_a = &wstate->pixel_color.a; break;
            case 1:     *input_a = &wstate->fog_color.a; break;
            case 2:     *input_a = &wstate->blender_shade_alpha; break;
            case 3:     *input_a = &zero_color; break;
        }
    }
    else
    {
        switch (b & 0x3)
        {
            case 0:     *input_a = &wstate->inv_pixel_color.a; break;
            case 1:     *input_a = &wstate->memory_color.a; break;
            case 2:     *input_a = &blenderone; break;
            case 3:     *input_a = &zero_color; break;
        }
    }
}

static STRICTINLINE int alpha_compare(struct rdp_state* wstate, int32_t comb_alpha)
{
    int32_t threshold;
    if (!wstate->other_modes.alpha_compare_en)
        return 1;
    else
    {
        if (!wstate->other_modes.dither_alpha_en)
            threshold = wstate->blend_color.a;
        else
            threshold = irand(&wstate->rseed) & 0xff;


        if (comb_alpha >= threshold)
            return 1;
        else
            return 0;
    }
}

static STRICTINLINE void blender_equation_cycle0(struct rdp_state* wstate, int* r, int* g, int* b)
{
    int blend1a, blend2a;
    int blr, blg, blb, sum;
    blend1a = *wstate->blender1b_a[0] >> 3;
    blend2a = *wstate->blender2b_a[0] >> 3;

    int mulb;



    if (wstate->blender2b_a[0] == &wstate->memory_color.a)
    {
        blend1a = (blend1a >> wstate->blshifta) & 0x3C;
        blend2a = (blend2a >> wstate->blshiftb) | 3;
    }

    mulb = blend2a + 1;


    blr = (*wstate->blender1a_r[0]) * blend1a + (*wstate->blender2a_r[0]) * mulb;
    blg = (*wstate->blender1a_g[0]) * blend1a + (*wstate->blender2a_g[0]) * mulb;
    blb = (*wstate->blender1a_b[0]) * blend1a + (*wstate->blender2a_b[0]) * mulb;



    if (!wstate->other_modes.force_blend)
    {





        sum = ((blend1a & ~3) + (blend2a & ~3) + 4) << 9;
        *r = bldiv_hwaccurate_table[sum | ((blr >> 2) & 0x7ff)];
        *g = bldiv_hwaccurate_table[sum | ((blg >> 2) & 0x7ff)];
        *b = bldiv_hwaccurate_table[sum | ((blb >> 2) & 0x7ff)];
    }
    else
    {
        *r = (blr >> 5) & 0xff;
        *g = (blg >> 5) & 0xff;
        *b = (blb >> 5) & 0xff;
    }
}

static STRICTINLINE void blender_equation_cycle0_gval(struct rdp_state* wstate, int* g)
{
    int blend1a, blend2a;
    int blg, sum;
    blend1a = *wstate->blender1b_a[0] >> 3;
    blend2a = *wstate->blender2b_a[0] >> 3;

    int mulb;
    if (wstate->blender2b_a[0] == &wstate->memory_color.a)
    {
        blend1a = (blend1a >> wstate->blshifta) & 0x3C;
        blend2a = (blend2a >> wstate->blshiftb) | 3;
    }

    mulb = blend2a + 1;

    blg = (*wstate->blender1a_g[0]) * blend1a + (*wstate->blender2a_g[0]) * mulb;

    if (!wstate->other_modes.force_blend)
    {
        sum = ((blend1a & ~3) + (blend2a & ~3) + 4) << 9;
        *g = bldiv_hwaccurate_table[sum | ((blg >> 2) & 0x7ff)];
    }
    else
        *g = (blg >> 5) & 0xff;
}

static STRICTINLINE void blender_equation_cycle0_2(struct rdp_state* wstate, int* r, int* g, int* b)
{
    int blend1a, blend2a;
    blend1a = *wstate->blender1b_a[0] >> 3;
    blend2a = *wstate->blender2b_a[0] >> 3;

    if (wstate->blender2b_a[0] == &wstate->memory_color.a)
    {
        blend1a = (blend1a >> wstate->pastblshifta) & 0x3C;
        blend2a = (blend2a >> wstate->pastblshiftb) | 3;
    }

    blend2a += 1;
    *r = (((*wstate->blender1a_r[0]) * blend1a + (*wstate->blender2a_r[0]) * blend2a) >> 5) & 0xff;
    *g = (((*wstate->blender1a_g[0]) * blend1a + (*wstate->blender2a_g[0]) * blend2a) >> 5) & 0xff;
    *b = (((*wstate->blender1a_b[0]) * blend1a + (*wstate->blender2a_b[0]) * blend2a) >> 5) & 0xff;
}

static STRICTINLINE void blender_equation_cycle0_2_gval(struct rdp_state* wstate, int* g)
{
    int blend1a, blend2a;
    blend1a = *wstate->blender1b_a[0] >> 3;
    blend2a = *wstate->blender2b_a[0] >> 3;

    if (wstate->blender2b_a[0] == &wstate->memory_color.a)
    {
        blend1a = (blend1a >> wstate->pastblshifta) & 0x3C;
        blend2a = (blend2a >> wstate->pastblshiftb) | 3;
    }

    blend2a += 1;
    *g = (((*wstate->blender1a_g[0]) * blend1a + (*wstate->blender2a_g[0]) * blend2a) >> 5) & 0xff;
}

static STRICTINLINE void blender_equation_cycle1(struct rdp_state* wstate, int* r, int* g, int* b)
{
    int blend1a, blend2a;
    int blr, blg, blb, sum;
    blend1a = *wstate->blender1b_a[1] >> 3;
    blend2a = *wstate->blender2b_a[1] >> 3;

    int mulb;
    if (wstate->blender2b_a[1] == &wstate->memory_color.a)
    {
        blend1a = (blend1a >> wstate->blshifta) & 0x3C;
        blend2a = (blend2a >> wstate->blshiftb) | 3;
    }

    mulb = blend2a + 1;
    blr = (*wstate->blender1a_r[1]) * blend1a + (*wstate->blender2a_r[1]) * mulb;
    blg = (*wstate->blender1a_g[1]) * blend1a + (*wstate->blender2a_g[1]) * mulb;
    blb = (*wstate->blender1a_b[1]) * blend1a + (*wstate->blender2a_b[1]) * mulb;

    if (!wstate->other_modes.force_blend)
    {
        sum = ((blend1a & ~3) + (blend2a & ~3) + 4) << 9;
        *r = bldiv_hwaccurate_table[sum | ((blr >> 2) & 0x7ff)];
        *g = bldiv_hwaccurate_table[sum | ((blg >> 2) & 0x7ff)];
        *b = bldiv_hwaccurate_table[sum | ((blb >> 2) & 0x7ff)];
    }
    else
    {
        *r = (blr >> 5) & 0xff;
        *g = (blg >> 5) & 0xff;
        *b = (blb >> 5) & 0xff;
    }
}

static STRICTINLINE void blender_equation_cycle1_gval(struct rdp_state* wstate, int* g)
{
    int blend1a, blend2a;
    int blg, sum;
    blend1a = *wstate->blender1b_a[1] >> 3;
    blend2a = *wstate->blender2b_a[1] >> 3;

    int mulb;
    if (wstate->blender2b_a[1] == &wstate->memory_color.a)
    {
        blend1a = (blend1a >> wstate->blshifta) & 0x3C;
        blend2a = (blend2a >> wstate->blshiftb) | 3;
    }

    mulb = blend2a + 1;
    blg = (*wstate->blender1a_g[1]) * blend1a + (*wstate->blender2a_g[1]) * mulb;

    if (!wstate->other_modes.force_blend)
    {
        sum = ((blend1a & ~3) + (blend2a & ~3) + 4) << 9;
        *g = bldiv_hwaccurate_table[sum | ((blg >> 2) & 0x7ff)];
    }
    else
        *g = (blg >> 5) & 0xff;
}

static STRICTINLINE int blender_1cycle(struct rdp_state* wstate, uint32_t* fr, uint32_t* fg, uint32_t* fb, int dith, uint32_t blend_en, uint32_t prewrap, uint32_t curpixel_cvg, uint32_t curpixel_cvbit)
{
    int r, g, b, dontblend;


    if (alpha_compare(wstate, wstate->pixel_color.a))
    {






        if (wstate->other_modes.antialias_en ? curpixel_cvg : curpixel_cvbit)
        {

            if (!wstate->other_modes.color_on_cvg || prewrap)
            {
                dontblend = (wstate->other_modes.f.partialreject_1cycle && wstate->pixel_color.a >= 0xff);
                if (!blend_en || dontblend)
                {
                    r = *wstate->blender1a_r[0];
                    g = *wstate->blender1a_g[0];
                    b = *wstate->blender1a_b[0];
                }
                else
                {
                    wstate->inv_pixel_color.a =  (~(*wstate->blender1b_a[0])) & 0xff;





                    blender_equation_cycle0(wstate, &r, &g, &b);
                }
            }
            else
            {
                r = *wstate->blender2a_r[0];
                g = *wstate->blender2a_g[0];
                b = *wstate->blender2a_b[0];
            }

            if (wstate->other_modes.rgb_dither_sel != 3)
                rgb_dither(wstate->other_modes.rgb_dither_sel, &r, &g, &b, dith);

            *fr = r;
            *fg = g;
            *fb = b;
            return 1;
        }
        else
            return 0;
        }
    else
        return 0;
}

static STRICTINLINE int blender_2cycle_cycle0(struct rdp_state* wstate, uint32_t curpixel_cvg, uint32_t curpixel_cvbit)
{
    int r, g, b;
    int wen = (wstate->other_modes.antialias_en ? curpixel_cvg : curpixel_cvbit) > 0 ? 1 : 0;

    if (wen)
    {
        wstate->inv_pixel_color.a =  (~(*wstate->blender1b_a[0])) & 0xff;

        blender_equation_cycle0_2(wstate, &r, &g, &b);

        wstate->blended_pixel_color.r = r;
        wstate->blended_pixel_color.g = g;
        wstate->blended_pixel_color.b = b;
    }

    return wen;
}


static STRICTINLINE void blender_2cycle_cycle0_gval(struct rdp_state* wstate, uint32_t curpixel)
{
    int g, fbsel;
    uint32_t fb;

    fbsel = wstate->fb_size;

    if (wstate->fb_size == PIXEL_SIZE_8BIT)
    {
        fb = wstate->fb_address + curpixel;
        if (!(fb & 1))
            fbsel--;
    }

    if (fbsel & 1)
    {
        wstate->inv_pixel_color.a = (~(*wstate->blender1b_a[0])) & 0xff;

        blender_equation_cycle0_2_gval(wstate, &g);

        wstate->blended_pixel_color.g = g;
    }
}


static STRICTINLINE void blender_2cycle_cycle1(struct rdp_state* wstate, uint32_t* fr, uint32_t* fg, uint32_t* fb, int dith, uint32_t blend_en, uint32_t prewrap)
{
    int r, g, b, dontblend;

    if (!wstate->other_modes.color_on_cvg || prewrap)
    {
        dontblend = (wstate->other_modes.f.partialreject_2cycle && wstate->pixel_color.a >= 0xff);
        if (!blend_en || dontblend)
        {
            r = *wstate->blender1a_r[1];
            g = *wstate->blender1a_g[1];
            b = *wstate->blender1a_b[1];
        }
        else
        {
            wstate->inv_pixel_color.a =  (~(*wstate->blender1b_a[1])) & 0xff;
            blender_equation_cycle1(wstate, &r, &g, &b);
        }
    }
    else
    {
        r = *wstate->blender2a_r[1];
        g = *wstate->blender2a_g[1];
        b = *wstate->blender2a_b[1];
    }

    if (wstate->other_modes.rgb_dither_sel != 3)
        rgb_dither(wstate->other_modes.rgb_dither_sel, &r, &g, &b, dith);

    *fr = r;
    *fg = g;
    *fb = b;
}

static void blender_init_lut(void)
{
    int i, k;
    int d = 0, n = 0, temp = 0, res = 0, invd = 0, nbit = 0;
    int ps[9];
    for (i = 0; i < 0x8000; i++)
    {
        res = 0;
        d = (i >> 11) & 0xf;
        n = i & 0x7ff;
        invd = (~d) & 0xf;


        temp = invd + (n >> 8) + 1;
        ps[0] = temp & 7;
        for (k = 0; k < 8; k++)
        {
            nbit = (n >> (7 - k)) & 1;
            if (res & (0x100 >> k))
                temp = invd + (ps[k] << 1) + nbit + 1;
            else
                temp = d + (ps[k] << 1) + nbit;
            ps[k + 1] = temp & 7;
            if (temp & 0x10)
                res |= (1 << (7 - k));
        }
        bldiv_hwaccurate_table[i] = (uint8_t)res;
    }
}

void rdp_set_fog_color(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->fog_color.r = RGBA32_R(args[1]);
    wstate->fog_color.g = RGBA32_G(args[1]);
    wstate->fog_color.b = RGBA32_B(args[1]);
    wstate->fog_color.a = RGBA32_A(args[1]);
}

void rdp_set_blend_color(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->blend_color.r = RGBA32_R(args[1]);
    wstate->blend_color.g = RGBA32_G(args[1]);
    wstate->blend_color.b = RGBA32_B(args[1]);
    wstate->blend_color.a = RGBA32_A(args[1]);
}

#endif // N64VIDEO_C


================================================
FILE: src/core/n64video/rdp/combiner.c
================================================
#ifdef N64VIDEO_C

static uint32_t special_9bit_clamptable[512];
static int32_t special_9bit_exttable[512];

static INLINE void set_suba_rgb_input(struct rdp_state* wstate, int32_t **input_r, int32_t **input_g, int32_t **input_b, int code)
{
    switch (code & 0xf)
    {
        case 0:     *input_r = &wstate->combined_color.r;   *input_g = &wstate->combined_color.g;   *input_b = &wstate->combined_color.b;   break;
        case 1:     *input_r = &wstate->texel0_color.r;     *input_g = &wstate->texel0_color.g;     *input_b = &wstate->texel0_color.b;     break;
        case 2:     *input_r = &wstate->texel1_color.r;     *input_g = &wstate->texel1_color.g;     *input_b = &wstate->texel1_color.b;     break;
        case 3:     *input_r = &wstate->prim_color.r;       *input_g = &wstate->prim_color.g;       *input_b = &wstate->prim_color.b;       break;
        case 4:     *input_r = &wstate->shade_color.r;      *input_g = &wstate->shade_color.g;      *input_b = &wstate->shade_color.b;      break;
        case 5:     *input_r = &wstate->env_color.r;        *input_g = &wstate->env_color.g;        *input_b = &wstate->env_color.b;        break;
        case 6:     *input_r = &one_color;          *input_g = &one_color;          *input_b = &one_color;      break;
        case 7:     *input_r = &wstate->noise;              *input_g = &wstate->noise;              *input_b = &wstate->noise;              break;
        case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
        {
            *input_r = &zero_color;     *input_g = &zero_color;     *input_b = &zero_color;     break;
        }
    }
}

static INLINE void set_subb_rgb_input(struct rdp_state* wstate, int32_t **input_r, int32_t **input_g, int32_t **input_b, int code)
{
    switch (code & 0xf)
    {
        case 0:     *input_r = &wstate->combined_color.r;   *input_g = &wstate->combined_color.g;   *input_b = &wstate->combined_color.b;   break;
        case 1:     *input_r = &wstate->texel0_color.r;     *input_g = &wstate->texel0_color.g;     *input_b = &wstate->texel0_color.b;     break;
        case 2:     *input_r = &wstate->texel1_color.r;     *input_g = &wstate->texel1_color.g;     *input_b = &wstate->texel1_color.b;     break;
        case 3:     *input_r = &wstate->prim_color.r;       *input_g = &wstate->prim_color.g;       *input_b = &wstate->prim_color.b;       break;
        case 4:     *input_r = &wstate->shade_color.r;      *input_g = &wstate->shade_color.g;      *input_b = &wstate->shade_color.b;      break;
        case 5:     *input_r = &wstate->env_color.r;        *input_g = &wstate->env_color.g;        *input_b = &wstate->env_color.b;        break;
        case 6:     *input_r = &wstate->key_center.r;       *input_g = &wstate->key_center.g;       *input_b = &wstate->key_center.b;       break;
        case 7:     *input_r = &wstate->k4;                 *input_g = &wstate->k4;                 *input_b = &wstate->k4;                 break;
        case 8: case 9: case 10: case 11: case 12: case 13: case 14: case 15:
        {
            *input_r = &zero_color;     *input_g = &zero_color;     *input_b = &zero_color;     break;
        }
    }
}

static INLINE void set_mul_rgb_input(struct rdp_state* wstate, int32_t **input_r, int32_t **input_g, int32_t **input_b, int code)
{
    switch (code & 0x1f)
    {
        case 0:     *input_r = &wstate->combined_color.r;   *input_g = &wstate->combined_color.g;   *input_b = &wstate->combined_color.b;   break;
        case 1:     *input_r = &wstate->texel0_color.r;     *input_g = &wstate->texel0_color.g;     *input_b = &wstate->texel0_color.b;     break;
        case 2:     *input_r = &wstate->texel1_color.r;     *input_g = &wstate->texel1_color.g;     *input_b = &wstate->texel1_color.b;     break;
        case 3:     *input_r = &wstate->prim_color.r;       *input_g = &wstate->prim_color.g;       *input_b = &wstate->prim_color.b;       break;
        case 4:     *input_r = &wstate->shade_color.r;      *input_g = &wstate->shade_color.g;      *input_b = &wstate->shade_color.b;      break;
        case 5:     *input_r = &wstate->env_color.r;        *input_g = &wstate->env_color.g;        *input_b = &wstate->env_color.b;        break;
        case 6:     *input_r = &wstate->key_scale.r;        *input_g = &wstate->key_scale.g;        *input_b = &wstate->key_scale.b;        break;
        case 7:     *input_r = &wstate->combined_color.a;   *input_g = &wstate->combined_color.a;   *input_b = &wstate->combined_color.a;   break;
        case 8:     *input_r = &wstate->texel0_color.a;     *input_g = &wstate->texel0_color.a;     *input_b = &wstate->texel0_color.a;     break;
        case 9:     *input_r = &wstate->texel1_color.a;     *input_g = &wstate->texel1_color.a;     *input_b = &wstate->texel1_color.a;     break;
        case 10:    *input_r = &wstate->prim_color.a;       *input_g = &wstate->prim_color.a;       *input_b = &wstate->prim_color.a;       break;
        case 11:    *input_r = &wstate->shade_color.a;      *input_g = &wstate->shade_color.a;      *input_b = &wstate->shade_color.a;      break;
        case 12:    *input_r = &wstate->env_color.a;        *input_g = &wstate->env_color.a;        *input_b = &wstate->env_color.a;        break;
        case 13:    *input_r = &wstate->lod_frac;           *input_g = &wstate->lod_frac;           *input_b = &wstate->lod_frac;           break;
        case 14:    *input_r = &wstate->primitive_lod_frac; *input_g = &wstate->primitive_lod_frac; *input_b = &wstate->primitive_lod_frac; break;
        case 15:    *input_r = &wstate->k5;                 *input_g = &wstate->k5;                 *input_b = &wstate->k5;                 break;
        case 16: case 17: case 18: case 19: case 20: case 21: case 22: case 23:
        case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
        {
            *input_r = &zero_color;     *input_g = &zero_color;     *input_b = &zero_color;     break;
        }
    }
}

static INLINE void set_add_rgb_input(struct rdp_state* wstate, int32_t **input_r, int32_t **input_g, int32_t **input_b, int code)
{
    switch (code & 0x7)
    {
        case 0:     *input_r = &wstate->combined_color.r;   *input_g = &wstate->combined_color.g;   *input_b = &wstate->combined_color.b;   break;
        case 1:     *input_r = &wstate->texel0_color.r;     *input_g = &wstate->texel0_color.g;     *input_b = &wstate->texel0_color.b;     break;
        case 2:     *input_r = &wstate->texel1_color.r;     *input_g = &wstate->texel1_color.g;     *input_b = &wstate->texel1_color.b;     break;
        case 3:     *input_r = &wstate->prim_color.r;       *input_g = &wstate->prim_color.g;       *input_b = &wstate->prim_color.b;       break;
        case 4:     *input_r = &wstate->shade_color.r;      *input_g = &wstate->shade_color.g;      *input_b = &wstate->shade_color.b;      break;
        case 5:     *input_r = &wstate->env_color.r;        *input_g = &wstate->env_color.g;        *input_b = &wstate->env_color.b;        break;
        case 6:     *input_r = &one_color;          *input_g = &one_color;          *input_b = &one_color;          break;
        case 7:     *input_r = &zero_color;         *input_g = &zero_color;         *input_b = &zero_color;         break;
    }
}

static INLINE void set_sub_alpha_input(struct rdp_state* wstate, int32_t **input, int code)
{
    switch (code & 0x7)
    {
        case 0:     *input = &wstate->combined_color.a; break;
        case 1:     *input = &wstate->texel0_color.a; break;
        case 2:     *input = &wstate->texel1_color.a; break;
        case 3:     *input = &wstate->prim_color.a; break;
        case 4:     *input = &wstate->shade_color.a; break;
        case 5:     *input = &wstate->env_color.a; break;
        case 6:     *input = &one_color; break;
        case 7:     *input = &zero_color; break;
    }
}

static INLINE void set_mul_alpha_input(struct rdp_state* wstate, int32_t **input, int code)
{
    switch (code & 0x7)
    {
        case 0:     *input = &wstate->lod_frac; break;
        case 1:     *input = &wstate->texel0_color.a; break;
        case 2:     *input = &wstate->texel1_color.a; break;
        case 3:     *input = &wstate->prim_color.a; break;
        case 4:     *input = &wstate->shade_color.a; break;
        case 5:     *input = &wstate->env_color.a; break;
        case 6:     *input = &wstate->primitive_lod_frac; break;
        case 7:     *input = &zero_color; break;
    }
}

static STRICTINLINE int32_t color_combiner_equation(int32_t a, int32_t b, int32_t c, int32_t d)
{





    a = special_9bit_exttable[a];
    b = special_9bit_exttable[b];
    c = SIGNF(c, 9);
    d = special_9bit_exttable[d];
    a = ((a - b) * c) + (d << 8) + 0x80;
    return (a & 0x1ffff);
}

static STRICTINLINE int32_t alpha_combiner_equation(int32_t a, int32_t b, int32_t c, int32_t d)
{
    a = special_9bit_exttable[a];
    b = special_9bit_exttable[b];
    c = SIGNF(c, 9);
    d = special_9bit_exttable[d];
    a = (((a - b) * c) + (d << 8) + 0x80) >> 8;
    return (a & 0x1ff);
}

static STRICTINLINE int32_t chroma_key_min(struct rdp_state* wstate, struct color* col)
{
    int32_t redkey, greenkey, bluekey, keyalpha;




    redkey = SIGN(col->r, 17);
    if (redkey > 0)
        redkey = ((redkey & 0xf) == 8) ? (-redkey + 0x10) : (-redkey);

    redkey = (wstate->key_width.r << 4) + redkey;

    greenkey = SIGN(col->g, 17);
    if (greenkey > 0)
        greenkey = ((greenkey & 0xf) == 8) ? (-greenkey + 0x10) : (-greenkey);

    greenkey = (wstate->key_width.g << 4) + greenkey;

    bluekey = SIGN(col->b, 17);
    if (bluekey > 0)
        bluekey = ((bluekey & 0xf) == 8) ? (-bluekey + 0x10) : (-bluekey);

    bluekey = (wstate->key_width.b << 4) + bluekey;

    keyalpha = (redkey < greenkey) ? redkey : greenkey;
    keyalpha = (bluekey < keyalpha) ? bluekey : keyalpha;
    keyalpha = clamp(keyalpha, 0, 0xff);
    return keyalpha;
}

static STRICTINLINE void combiner_1cycle(struct rdp_state* wstate, int adseed, uint32_t* curpixel_cvg)
{

    int32_t keyalpha = 0, temp = 0;
    struct color chromabypass = { 0 };

    if (wstate->other_modes.key_en)
    {
        chromabypass.r = *wstate->combiner_rgbsub_a_r[1];
        chromabypass.g = *wstate->combiner_rgbsub_a_g[1];
        chromabypass.b = *wstate->combiner_rgbsub_a_b[1];
    }






    if (wstate->combiner_rgbmul_r[1] != &zero_color)
    {
















        wstate->combined_color.r = color_combiner_equation(*wstate->combiner_rgbsub_a_r[1],*wstate->combiner_rgbsub_b_r[1],*wstate->combiner_rgbmul_r[1],*wstate->combiner_rgbadd_r[1]);
        wstate->combined_color.g = color_combiner_equation(*wstate->combiner_rgbsub_a_g[1],*wstate->combiner_rgbsub_b_g[1],*wstate->combiner_rgbmul_g[1],*wstate->combiner_rgbadd_g[1]);
        wstate->combined_color.b = color_combiner_equation(*wstate->combiner_rgbsub_a_b[1],*wstate->combiner_rgbsub_b_b[1],*wstate->combiner_rgbmul_b[1],*wstate->combiner_rgbadd_b[1]);
    }
    else
    {
        wstate->combined_color.r = ((special_9bit_exttable[*wstate->combiner_rgbadd_r[1]] << 8) + 0x80) & 0x1ffff;
        wstate->combined_color.g = ((special_9bit_exttable[*wstate->combiner_rgbadd_g[1]] << 8) + 0x80) & 0x1ffff;
        wstate->combined_color.b = ((special_9bit_exttable[*wstate->combiner_rgbadd_b[1]] << 8) + 0x80) & 0x1ffff;
    }

    if (wstate->combiner_alphamul[1] != &zero_color)
        wstate->combined_color.a = alpha_combiner_equation(*wstate->combiner_alphasub_a[1],*wstate->combiner_alphasub_b[1],*wstate->combiner_alphamul[1],*wstate->combiner_alphaadd[1]);
    else
        wstate->combined_color.a = special_9bit_exttable[*wstate->combiner_alphaadd[1]] & 0x1ff;

    wstate->pixel_color.a = special_9bit_clamptable[wstate->combined_color.a];
    if (wstate->pixel_color.a == 0xff)
        wstate->pixel_color.a = 0x100;

    if (!wstate->other_modes.key_en)
    {

        wstate->combined_color.r >>= 8;
        wstate->combined_color.g >>= 8;
        wstate->combined_color.b >>= 8;
        wstate->pixel_color.r = special_9bit_clamptable[wstate->combined_color.r];
        wstate->pixel_color.g = special_9bit_clamptable[wstate->combined_color.g];
        wstate->pixel_color.b = special_9bit_clamptable[wstate->combined_color.b];
    }
    else
    {
        keyalpha = chroma_key_min(wstate, &wstate->combined_color);



        wstate->pixel_color.r = special_9bit_clamptable[chromabypass.r];
        wstate->pixel_color.g = special_9bit_clamptable[chromabypass.g];
        wstate->pixel_color.b = special_9bit_clamptable[chromabypass.b];


        wstate->combined_color.r >>= 8;
        wstate->combined_color.g >>= 8;
        wstate->combined_color.b >>= 8;
    }


    if (wstate->other_modes.cvg_times_alpha)
    {
        temp = (wstate->pixel_color.a * (*curpixel_cvg) + 4) >> 3;
        *curpixel_cvg = (temp >> 5) & 0xf;
    }

    if (!wstate->other_modes.alpha_cvg_select)
    {
        if (!wstate->other_modes.key_en)
        {
            wstate->pixel_color.a += adseed;
            if (wstate->pixel_color.a & 0x100)
                wstate->pixel_color.a = 0xff;
        }
        else
            wstate->pixel_color.a = keyalpha;
    }
    else
    {
        if (wstate->other_modes.cvg_times_alpha)
            wstate->pixel_color.a = temp;
        else
            wstate->pixel_color.a = (*curpixel_cvg) << 5;
        if (wstate->pixel_color.a > 0xff)
            wstate->pixel_color.a = 0xff;
    }

    wstate->blender_shade_alpha = wstate->shade_color.a + adseed;
    if (wstate->blender_shade_alpha & 0x100)
        wstate->blender_shade_alpha = 0xff;
}

static STRICTINLINE void combiner_2cycle_cycle0(struct rdp_state* wstate, int adseed, uint32_t cvg, uint32_t* acalpha)
{
    if (wstate->combiner_rgbmul_r[0] != &zero_color)
    {
        wstate->combined_color.r = color_combiner_equation(*wstate->combiner_rgbsub_a_r[0],*wstate->combiner_rgbsub_b_r[0],*wstate->combiner_rgbmul_r[0],*wstate->combiner_rgbadd_r[0]);
        wstate->combined_color.g = color_combiner_equation(*wstate->combiner_rgbsub_a_g[0],*wstate->combiner_rgbsub_b_g[0],*wstate->combiner_rgbmul_g[0],*wstate->combiner_rgbadd_g[0]);
        wstate->combined_color.b = color_combiner_equation(*wstate->combiner_rgbsub_a_b[0],*wstate->combiner_rgbsub_b_b[0],*wstate->combiner_rgbmul_b[0],*wstate->combiner_rgbadd_b[0]);
    }
    else
    {
        wstate->combined_color.r = ((special_9bit_exttable[*wstate->combiner_rgbadd_r[0]] << 8) + 0x80) & 0x1ffff;
        wstate->combined_color.g = ((special_9bit_exttable[*wstate->combiner_rgbadd_g[0]] << 8) + 0x80) & 0x1ffff;
        wstate->combined_color.b = ((special_9bit_exttable[*wstate->combiner_rgbadd_b[0]] << 8) + 0x80) & 0x1ffff;
    }

    if (wstate->combiner_alphamul[0] != &zero_color)
        wstate->combined_color.a = alpha_combiner_equation(*wstate->combiner_alphasub_a[0],*wstate->combiner_alphasub_b[0],*wstate->combiner_alphamul[0],*wstate->combiner_alphaadd[0]);
    else
        wstate->combined_color.a = special_9bit_exttable[*wstate->combiner_alphaadd[0]] & 0x1ff;



    if (wstate->other_modes.alpha_compare_en)
    {
        int32_t preacalpha = special_9bit_clamptable[wstate->combined_color.a];
        if (preacalpha == 0xff)
            preacalpha = 0x100;

        if (!wstate->other_modes.alpha_cvg_select)
        {
            preacalpha += adseed;
            if (preacalpha & 0x100)
                preacalpha = 0xff;
        }
        else
        {
            if (wstate->other_modes.cvg_times_alpha)
                preacalpha = (preacalpha * cvg + 4) >> 3;
            else
                preacalpha = cvg << 5;

            if (preacalpha > 0xff)
                preacalpha = 0xff;
        }

        *acalpha = preacalpha;
    }





    wstate->combined_color.r >>= 8;
    wstate->combined_color.g >>= 8;
    wstate->combined_color.b >>= 8;

    wstate->blender_shade_alpha = wstate->shade_color.a + adseed;
    if (wstate->blender_shade_alpha & 0x100)
        wstate->blender_shade_alpha = 0xff;
}

static STRICTINLINE void combiner_2cycle_cycle1(struct rdp_state* wstate, int adseed, uint32_t* curpixel_cvg)
{
    int32_t keyalpha = 0, temp = 0;
    struct color chromabypass = { 0 };

    wstate->texel0_color = wstate->texel1_color;
    wstate->texel1_color = wstate->nexttexel_color;









    if (wstate->other_modes.key_en)
    {
        chromabypass.r = *wstate->combiner_rgbsub_a_r[1];
        chromabypass.g = *wstate->combiner_rgbsub_a_g[1];
        chromabypass.b = *wstate->combiner_rgbsub_a_b[1];
    }

    if (wstate->combiner_rgbmul_r[1] != &zero_color)
    {
        wstate->combined_color.r = color_combiner_equation(*wstate->combiner_rgbsub_a_r[1],*wstate->combiner_rgbsub_b_r[1],*wstate->combiner_rgbmul_r[1],*wstate->combiner_rgbadd_r[1]);
        wstate->combined_color.g = color_combiner_equation(*wstate->combiner_rgbsub_a_g[1],*wstate->combiner_rgbsub_b_g[1],*wstate->combiner_rgbmul_g[1],*wstate->combiner_rgbadd_g[1]);
        wstate->combined_color.b = color_combiner_equation(*wstate->combiner_rgbsub_a_b[1],*wstate->combiner_rgbsub_b_b[1],*wstate->combiner_rgbmul_b[1],*wstate->combiner_rgbadd_b[1]);
    }
    else
    {
        wstate->combined_color.r = ((special_9bit_exttable[*wstate->combiner_rgbadd_r[1]] << 8) + 0x80) & 0x1ffff;
        wstate->combined_color.g = ((special_9bit_exttable[*wstate->combiner_rgbadd_g[1]] << 8) + 0x80) & 0x1ffff;
        wstate->combined_color.b = ((special_9bit_exttable[*wstate->combiner_rgbadd_b[1]] << 8) + 0x80) & 0x1ffff;
    }

    if (wstate->combiner_alphamul[1] != &zero_color)
        wstate->combined_color.a = alpha_combiner_equation(*wstate->combiner_alphasub_a[1],*wstate->combiner_alphasub_b[1],*wstate->combiner_alphamul[1],*wstate->combiner_alphaadd[1]);
    else
        wstate->combined_color.a = special_9bit_exttable[*wstate->combiner_alphaadd[1]] & 0x1ff;

    if (!wstate->other_modes.key_en)
    {

        wstate->combined_color.r >>= 8;
        wstate->combined_color.g >>= 8;
        wstate->combined_color.b >>= 8;

        wstate->pixel_color.r = special_9bit_clamptable[wstate->combined_color.r];
        wstate->pixel_color.g = special_9bit_clamptable[wstate->combined_color.g];
        wstate->pixel_color.b = special_9bit_clamptable[wstate->combined_color.b];
    }
    else
    {
        keyalpha = chroma_key_min(wstate, &wstate->combined_color);



        wstate->pixel_color.r = special_9bit_clamptable[chromabypass.r];
        wstate->pixel_color.g = special_9bit_clamptable[chromabypass.g];
        wstate->pixel_color.b = special_9bit_clamptable[chromabypass.b];


        wstate->combined_color.r >>= 8;
        wstate->combined_color.g >>= 8;
        wstate->combined_color.b >>= 8;
    }

    wstate->pixel_color.a = special_9bit_clamptable[wstate->combined_color.a];
    if (wstate->pixel_color.a == 0xff)
        wstate->pixel_color.a = 0x100;


    if (wstate->other_modes.cvg_times_alpha)
    {
        temp = (wstate->pixel_color.a * (*curpixel_cvg) + 4) >> 3;

        *curpixel_cvg = (temp >> 5) & 0xf;


    }

    if (!wstate->other_modes.alpha_cvg_select)
    {
        if (!wstate->other_modes.key_en)
        {
            wstate->pixel_color.a += adseed;
            if (wstate->pixel_color.a & 0x100)
                wstate->pixel_color.a = 0xff;
        }
        else
            wstate->pixel_color.a = keyalpha;
    }
    else
    {
        if (wstate->other_modes.cvg_times_alpha)
            wstate->pixel_color.a = temp;
        else
            wstate->pixel_color.a = (*curpixel_cvg) << 5;
        if (wstate->pixel_color.a > 0xff)
            wstate->pixel_color.a = 0xff;
    }

    wstate->blender_shade_alpha = wstate->shade_color.a + adseed;
    if (wstate->blender_shade_alpha & 0x100)
        wstate->blender_shade_alpha = 0xff;
}

static void combiner_init_lut(void)
{
    int i;
    for(i = 0; i < 0x200; i++)
    {
        switch((i >> 7) & 3)
        {
        case 0:
        case 1:
            special_9bit_clamptable[i] = i & 0xff;
            break;
        case 2:
            special_9bit_clamptable[i] = 0xff;
            break;
        case 3:
            special_9bit_clamptable[i] = 0;
            break;
        }
    }

    for (i = 0; i < 0x200; i++)
    {
        special_9bit_exttable[i] = ((i & 0x180) == 0x180) ? (i | ~0x1ff) : (i & 0x1ff);
    }
}

static void combiner_init(struct rdp_state* wstate)
{
    wstate->combiner_rgbsub_a_r[0] = wstate->combiner_rgbsub_a_r[1] = &one_color;
    wstate->combiner_rgbsub_a_g[0] = wstate->combiner_rgbsub_a_g[1] = &one_color;
    wstate->combiner_rgbsub_a_b[0] = wstate->combiner_rgbsub_a_b[1] = &one_color;
    wstate->combiner_rgbsub_b_r[0] = wstate->combiner_rgbsub_b_r[1] = &one_color;
    wstate->combiner_rgbsub_b_g[0] = wstate->combiner_rgbsub_b_g[1] = &one_color;
    wstate->combiner_rgbsub_b_b[0] = wstate->combiner_rgbsub_b_b[1] = &one_color;
    wstate->combiner_rgbmul_r[0] = wstate->combiner_rgbmul_r[1] = &one_color;
    wstate->combiner_rgbmul_g[0] = wstate->combiner_rgbmul_g[1] = &one_color;
    wstate->combiner_rgbmul_b[0] = wstate->combiner_rgbmul_b[1] = &one_color;
    wstate->combiner_rgbadd_r[0] = wstate->combiner_rgbadd_r[1] = &one_color;
    wstate->combiner_rgbadd_g[0] = wstate->combiner_rgbadd_g[1] = &one_color;
    wstate->combiner_rgbadd_b[0] = wstate->combiner_rgbadd_b[1] = &one_color;

    wstate->combiner_alphasub_a[0] = wstate->combiner_alphasub_a[1] = &one_color;
    wstate->combiner_alphasub_b[0] = wstate->combiner_alphasub_b[1] = &one_color;
    wstate->combiner_alphamul[0] = wstate->combiner_alphamul[1] = &one_color;
    wstate->combiner_alphaadd[0] = wstate->combiner_alphaadd[1] = &one_color;
}

void rdp_set_prim_color(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->min_level = (args[0] >> 8) & 0x1f;
    wstate->primitive_lod_frac = args[0] & 0xff;
    wstate->prim_color.r = RGBA32_R(args[1]);
    wstate->prim_color.g = RGBA32_G(args[1]);
    wstate->prim_color.b = RGBA32_B(args[1]);
    wstate->prim_color.a = RGBA32_A(args[1]);
}

void rdp_set_env_color(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->env_color.r = RGBA32_R(args[1]);
    wstate->env_color.g = RGBA32_G(args[1]);
    wstate->env_color.b = RGBA32_B(args[1]);
    wstate->env_color.a = RGBA32_A(args[1]);
}

void rdp_set_combine(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->combine.sub_a_rgb0  = (args[0] >> 20) & 0xf;
    wstate->combine.mul_rgb0    = (args[0] >> 15) & 0x1f;
    wstate->combine.sub_a_a0    = (args[0] >> 12) & 0x7;
    wstate->combine.mul_a0      = (args[0] >>  9) & 0x7;
    wstate->combine.sub_a_rgb1  = (args[0] >>  5) & 0xf;
    wstate->combine.mul_rgb1    = (args[0] >>  0) & 0x1f;

    wstate->combine.sub_b_rgb0  = (args[1] >> 28) & 0xf;
    wstate->combine.sub_b_rgb1  = (args[1] >> 24) & 0xf;
    wstate->combine.sub_a_a1    = (args[1] >> 21) & 0x7;
    wstate->combine.mul_a1      = (args[1] >> 18) & 0x7;
    wstate->combine.add_rgb0    = (args[1] >> 15) & 0x7;
    wstate->combine.sub_b_a0    = (args[1] >> 12) & 0x7;
    wstate->combine.add_a0      = (args[1] >>  9) & 0x7;
    wstate->combine.add_rgb1    = (args[1] >>  6) & 0x7;
    wstate->combine.sub_b_a1    = (args[1] >>  3) & 0x7;
    wstate->combine.add_a1      = (args[1] >>  0) & 0x7;


    set_suba_rgb_input(wstate, &wstate->combiner_rgbsub_a_r[0], &wstate->combiner_rgbsub_a_g[0], &wstate->combiner_rgbsub_a_b[0], wstate->combine.sub_a_rgb0);
    set_subb_rgb_input(wstate, &wstate->combiner_rgbsub_b_r[0], &wstate->combiner_rgbsub_b_g[0], &wstate->combiner_rgbsub_b_b[0], wstate->combine.sub_b_rgb0);
    set_mul_rgb_input(wstate, &wstate->combiner_rgbmul_r[0], &wstate->combiner_rgbmul_g[0], &wstate->combiner_rgbmul_b[0], wstate->combine.mul_rgb0);
    set_add_rgb_input(wstate, &wstate->combiner_rgbadd_r[0], &wstate->combiner_rgbadd_g[0], &wstate->combiner_rgbadd_b[0], wstate->combine.add_rgb0);
    set_sub_alpha_input(wstate, &wstate->combiner_alphasub_a[0], wstate->combine.sub_a_a0);
    set_sub_alpha_input(wstate, &wstate->combiner_alphasub_b[0], wstate->combine.sub_b_a0);
    set_mul_alpha_input(wstate, &wstate->combiner_alphamul[0], wstate->combine.mul_a0);
    set_sub_alpha_input(wstate, &wstate->combiner_alphaadd[0], wstate->combine.add_a0);

    set_suba_rgb_input(wstate, &wstate->combiner_rgbsub_a_r[1], &wstate->combiner_rgbsub_a_g[1], &wstate->combiner_rgbsub_a_b[1], wstate->combine.sub_a_rgb1);
    set_subb_rgb_input(wstate, &wstate->combiner_rgbsub_b_r[1], &wstate->combiner_rgbsub_b_g[1], &wstate->combiner_rgbsub_b_b[1], wstate->combine.sub_b_rgb1);
    set_mul_rgb_input(wstate, &wstate->combiner_rgbmul_r[1], &wstate->combiner_rgbmul_g[1], &wstate->combiner_rgbmul_b[1], wstate->combine.mul_rgb1);
    set_add_rgb_input(wstate, &wstate->combiner_rgbadd_r[1], &wstate->combiner_rgbadd_g[1], &wstate->combiner_rgbadd_b[1], wstate->combine.add_rgb1);
    set_sub_alpha_input(wstate, &wstate->combiner_alphasub_a[1], wstate->combine.sub_a_a1);
    set_sub_alpha_input(wstate, &wstate->combiner_alphasub_b[1], wstate->combine.sub_b_a1);
    set_mul_alpha_input(wstate, &wstate->combiner_alphamul[1], wstate->combine.mul_a1);
    set_sub_alpha_input(wstate, &wstate->combiner_alphaadd[1], wstate->combine.add_a1);

    wstate->other_modes.f.stalederivs = 1;
}

void rdp_set_key_gb(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->key_width.g = (args[0] >> 12) & 0xfff;
    wstate->key_width.b = args[0] & 0xfff;
    wstate->key_center.g = (args[1] >> 24) & 0xff;
    wstate->key_scale.g = (args[1] >> 16) & 0xff;
    wstate->key_center.b = (args[1] >> 8) & 0xff;
    wstate->key_scale.b = args[1] & 0xff;
}

void rdp_set_key_r(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->key_width.r = (args[1] >> 16) & 0xfff;
    wstate->key_center.r = (args[1] >> 8) & 0xff;
    wstate->key_scale.r = args[1] & 0xff;
}

#endif // N64VIDEO_C


================================================
FILE: src/core/n64video/rdp/coverage.c
================================================
#ifdef N64VIDEO_C

#define CVG_CLAMP               0
#define CVG_WRAP                1
#define CVG_ZAP                 2
#define CVG_SAVE                3

static struct  {
    uint8_t cvg;
    uint8_t cvbit;
    uint8_t xoff;
    uint8_t yoff;
} cvarray[0x100];

static STRICTINLINE uint32_t rightcvghex(uint32_t x, uint32_t fmask)
{
    uint32_t covered = ((x & 7) + 1) >> 1;

    covered = 0xf0 >> covered;
    return (covered & fmask);
}

static STRICTINLINE uint32_t leftcvghex(uint32_t x, uint32_t fmask)
{
    uint32_t covered = ((x & 7) + 1) >> 1;
    covered = 0xf >> covered;
    return (covered & fmask);
}



static STRICTINLINE void compute_cvg_flip(struct rdp_state* wstate, int32_t scanline)
{
    int32_t purgestart, purgeend;
    int i, length, fmask, maskshift, fmaskshifted;
    int32_t minorcur, majorcur, minorcurint, majorcurint, samecvg;

    purgestart = wstate->span[scanline].rx;
    purgeend = wstate->span[scanline].lx;
    length = purgeend - purgestart;
    if (length >= 0)
    {






        memset(&wstate->cvgbuf[purgestart], 0xff, length + 1);
        for(i = 0; i < 4; i++)
        {

                fmask = 0xa >> (i & 1);




                maskshift = (i - 2) & 4;
                fmaskshifted = fmask << maskshift;

                if (!wstate->span[scanline].invalyscan[i])
                {
                   int k;
                    minorcur = wstate->span[scanline].minorx[i];
                    majorcur = wstate->span[scanline].majorx[i];
                    minorcurint = minorcur >> 3;
                    majorcurint = majorcur >> 3;


                    for (k = purgestart; k <= majorcurint; k++)
                        wstate->cvgbuf[k] &= ~fmaskshifted;
                    for (k = minorcurint; k <= purgeend; k++)
                        wstate->cvgbuf[k] &= ~fmaskshifted;









                    if (minorcurint > majorcurint)
                    {
                        wstate->cvgbuf[minorcurint] |= (rightcvghex(minorcur, fmask) << maskshift);
                        wstate->cvgbuf[majorcurint] |= (leftcvghex(majorcur, fmask) << maskshift);
                    }
                    else if (minorcurint == majorcurint)
                    {
                        samecvg = rightcvghex(minorcur, fmask) & leftcvghex(majorcur, fmask);
                        wstate->cvgbuf[majorcurint] |= (samecvg << maskshift);
                    }
                }
                else
                {
                    int k;
                    for (k = purgestart; k <= purgeend; k++)
                        wstate->cvgbuf[k] &= ~fmaskshifted;
                }

        }
    }


}

static STRICTINLINE void compute_cvg_noflip(struct rdp_state* wstate, int32_t scanline)
{
    int32_t purgestart, purgeend;
    int i, length, fmask, maskshift, fmaskshifted;
    int32_t minorcur, majorcur, minorcurint, majorcurint, samecvg;

    purgestart = wstate->span[scanline].lx;
    purgeend = wstate->span[scanline].rx;
    length = purgeend - purgestart;

    if (length >= 0)
    {
        memset(&wstate->cvgbuf[purgestart], 0xff, length + 1);

        for(i = 0; i < 4; i++)
        {
            fmask = 0xa >> (i & 1);
            maskshift = (i - 2) & 4;
            fmaskshifted = fmask << maskshift;

            if (!wstate->span[scanline].invalyscan[i])
            {
               int k;
                minorcur = wstate->span[scanline].minorx[i];
                majorcur = wstate->span[scanline].majorx[i];
                minorcurint = minorcur >> 3;
                majorcurint = majorcur >> 3;

                for (k = purgestart; k <= minorcurint; k++)
                    wstate->cvgbuf[k] &= ~fmaskshifted;
                for (k = majorcurint; k <= purgeend; k++)
                    wstate->cvgbuf[k] &= ~fmaskshifted;

                if (majorcurint > minorcurint)
                {
                    wstate->cvgbuf[minorcurint] |= (leftcvghex(minorcur, fmask) << maskshift);
                    wstate->cvgbuf[majorcurint] |= (rightcvghex(majorcur, fmask) << maskshift);
                }
                else if (minorcurint == majorcurint)
                {
                    samecvg = leftcvghex(minorcur, fmask) & rightcvghex(majorcur, fmask);
                    wstate->cvgbuf[majorcurint] |= (samecvg << maskshift);
                }
            }
            else
            {
                int k;
                for (k = purgestart; k <= purgeend; k++)
                    wstate->cvgbuf[k] &= ~fmaskshifted;
            }
        }
    }
}

static STRICTINLINE int finalize_spanalpha(int cvg_dest, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg)
{
    int finalcvg = 0;



    switch(cvg_dest)
    {
    case CVG_CLAMP:
        if (!blend_en)
        {
            finalcvg = curpixel_cvg - 1;


        }
        else
        {
            finalcvg = curpixel_cvg + curpixel_memcvg;
        }



        if (!(finalcvg & 8))
            finalcvg &= 7;
        else
            finalcvg = 7;

        break;
    case CVG_WRAP:
        finalcvg = (curpixel_cvg + curpixel_memcvg) & 7;
        break;
    case CVG_ZAP:
        finalcvg = 7;
        break;
    case CVG_SAVE:
        finalcvg = curpixel_memcvg;
        break;
    }

    return finalcvg;
}

static STRICTINLINE uint16_t decompress_cvmask_frombyte(uint8_t x)
{
    uint16_t y = (x & 0x5) | ((x & 0x5a) << 4) | ((x & 0xa0) << 8);
    return y;
}

static STRICTINLINE void lookup_cvmask_derivatives(uint8_t mask, uint8_t* offx, uint8_t* offy, uint32_t* curpixel_cvg, uint32_t* curpixel_cvbit)
{
    *curpixel_cvg = cvarray[mask].cvg;
    *curpixel_cvbit = cvarray[mask].cvbit;
    *offx = cvarray[mask].xoff;
    *offy = cvarray[mask].yoff;
}

static void coverage_init_lut(void)
{
    uint8_t i = 0, k = 0;
    uint16_t mask = 0, maskx = 0, masky = 0;
    uint8_t offx = 0, offy = 0;
    const uint8_t yarray[16] = {0, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0};
    const uint8_t xarray[16] = {0, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0};

    do {
        mask = decompress_cvmask_frombyte(i);
        cvarray[i].cvg = cvarray[i].cvbit = 0;
        cvarray[i].cvbit = (i >> 7) & 1;
        for (k = 0; k < 8; k++)
            cvarray[i].cvg += ((i >> k) & 1);


        masky = maskx = offx = offy = 0;
        for (k = 0; k < 4; k++)
            masky |= ((mask & (0xf000 >> (k << 2))) > 0) << k;

        offy = yarray[masky];

        maskx = (mask & (0xf000 >> (offy << 2))) >> ((offy ^ 3) << 2);


        offx = xarray[maskx];

        cvarray[i].xoff = offx;
        cvarray[i].yoff = offy;
    } while (i++ != 0xff);
}

#endif // N64VIDEO_C


================================================
FILE: src/core/n64video/rdp/dither.c
================================================
#ifdef N64VIDEO_C

static const uint8_t bayer_matrix[16] =
{
     0,  4,  1, 5,
     4,  0,  5, 1,
     3,  7,  2, 6,
     7,  3,  6, 2
};


static const uint8_t magic_matrix[16] =
{
     0,  6,  1, 7,
     4,  2,  5, 3,
     3,  5,  2, 4,
     7,  1,  6, 0
};

static STRICTINLINE void rgb_dither(int rgb_dither_sel, int* r, int* g, int* b, int dith)
{

    int32_t newr = *r, newg = *g, newb = *b;
    int32_t rcomp, gcomp, bcomp;


    if (newr > 247)
        newr = 255;
    else
        newr = (newr & 0xf8) + 8;
    if (newg > 247)
        newg = 255;
    else
        newg = (newg & 0xf8) + 8;
    if (newb > 247)
        newb = 255;
    else
        newb = (newb & 0xf8) + 8;

    if (rgb_dither_sel != 2)
        rcomp = gcomp = bcomp = dith;
    else
    {
        rcomp = dith & 7;
        gcomp = (dith >> 3) & 7;
        bcomp = (dith >> 6) & 7;
    }





    int32_t replacesign = (rcomp - (*r & 7)) >> 31;

    int32_t ditherdiff = newr - *r;
    *r = *r + (ditherdiff & replacesign);

    replacesign = (gcomp - (*g & 7)) >> 31;
    ditherdiff = newg - *g;
    *g = *g + (ditherdiff & replacesign);

    replacesign = (bcomp - (*b & 7)) >> 31;
    ditherdiff = newb - *b;
    *b = *b + (ditherdiff & replacesign);
}

static STRICTINLINE void rgb_dither_gval(int rgb_dither_sel, int* g, int dith)
{
    int32_t newg = *g;
    int32_t gcomp;

    if (newg > 247)
        newg = 255;
    else
        newg = (newg & 0xf8) + 8;

    if (rgb_dither_sel != 2)
        gcomp = dith;
    else
        gcomp = (dith >> 3) & 7;

    int32_t replacesign = (gcomp - (*g & 7)) >> 31;
    int32_t ditherdiff = newg - *g;
    *g = *g + (ditherdiff & replacesign);
}

static STRICTINLINE void get_dither_noise(struct rdp_state* wstate, int x, int y, int* cdith, int* adith)
{
    if (!wstate->other_modes.f.getditherlevel)
        wstate->noise = ((irand(&wstate->rseed) & 7) << 6) | 0x20;

    y >>= wstate->scfield;

    int dithindex;
    switch(wstate->other_modes.f.rgb_alpha_dither)
    {
    case 0:
        dithindex = ((y & 3) << 2) | (x & 3);
        *adith = *cdith = magic_matrix[dithindex];
        break;
    case 1:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = magic_matrix[dithindex];
        *adith = (~(*cdith)) & 7;
        break;
    case 2:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = magic_matrix[dithindex];
        *adith = (wstate->noise >> 6) & 7;
        break;
    case 3:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = magic_matrix[dithindex];
        *adith = 0;
        break;
    case 4:
        dithindex = ((y & 3) << 2) | (x & 3);
        *adith = *cdith = bayer_matrix[dithindex];
        break;
    case 5:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = bayer_matrix[dithindex];
        *adith = (~(*cdith)) & 7;
        break;
    case 6:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = bayer_matrix[dithindex];
        *adith = (wstate->noise >> 6) & 7;
        break;
    case 7:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = bayer_matrix[dithindex];
        *adith = 0;
        break;
    case 8:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = irand(&wstate->rseed);
        *adith = magic_matrix[dithindex];
        break;
    case 9:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = irand(&wstate->rseed);
        *adith = (~magic_matrix[dithindex]) & 7;
        break;
    case 10:
        *cdith = irand(&wstate->rseed);
        *adith = (wstate->noise >> 6) & 7;
        break;
    case 11:
        *cdith = irand(&wstate->rseed);
        *adith = 0;
        break;
    case 12:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = 7;
        *adith = bayer_matrix[dithindex];
        break;
    case 13:
        dithindex = ((y & 3) << 2) | (x & 3);
        *cdith = 7;
        *adith = (~bayer_matrix[dithindex]) & 7;
        break;
    case 14:
        *cdith = 7;
        *adith = (wstate->noise >> 6) & 7;
        break;
    case 15:
        *cdith = 7;
        *adith = 0;
        break;
    }
}

#endif // N64VIDEO_C


================================================
FILE: src/core/n64video/rdp/fbuffer.c
================================================
#ifdef N64VIDEO_C

static void fbwrite_4(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx);
static void fbwrite_8(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx);
static void fbwrite_16(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx);
static void fbwrite_32(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx);
static void fbfill_4(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx);
static void fbfill_8(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx);
static void fbfill_16(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx);
static void fbfill_32(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx);
static void fbread_4(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread_8(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread_16(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread_32(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread2_4(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread2_8(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread2_16(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);
static void fbread2_32(struct rdp_state* wstate, uint32_t num, uint32_t* curpixel_memcvg);

static void (*fbread_func[4])(struct rdp_state*, uint32_t, uint32_t*) =
{
    fbread_4, fbread_8, fbread_16, fbread_32
};

static void (*fbread2_func[4])(struct rdp_state*,uint32_t, uint32_t*) =
{
    fbread2_4, fbread2_8, fbread2_16, fbread2_32
};

static void (*fbwrite_func[4])(struct rdp_state*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, int, int*) =
{
    fbwrite_4, fbwrite_8, fbwrite_16, fbwrite_32
};

static void (*fbfill_func[4])(struct rdp_state*, uint32_t, int, int*) =
{
    fbfill_4, fbfill_8, fbfill_16, fbfill_32
};

static void fbwrite_4(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx)
{
    UNUSED(r);
    UNUSED(g);
    UNUSED(b);
    UNUSED(blend_en);
    UNUSED(curpixel_cvg);
    UNUSED(curpixel_memcvg);
    UNUSED(flip);
    UNUSED(delayedhbwidx);

    uint32_t fb = wstate->fb_address + curpixel;
    RWRITEADDR8(fb, 0);
}

static void fbwrite_8(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx)
{
    UNUSED(b);
    UNUSED(blend_en);
    UNUSED(curpixel_cvg);
    UNUSED(curpixel_memcvg);

    uint32_t fb = wstate->fb_address + curpixel;
    rdram_write_pair8(fb, (fb & 1) ? (g & 0xff) : (r & 0xff), flip, delayedhbwidx);
}

static void fbwrite_16(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx)
{
    UNUSED(flip);
    UNUSED(delayedhbwidx);

#undef CVG_DRAW
#ifdef CVG_DRAW
    int covdraw = (curpixel_cvg - 1) << 5;
    r=covdraw; g=covdraw; b=covdraw;
#endif

    uint32_t fb;
    uint16_t rval;
    uint8_t hval;
    fb = (wstate->fb_address >> 1) + curpixel;

    int32_t finalcvg = finalize_spanalpha(wstate->other_modes.cvg_dest, blend_en, curpixel_cvg, curpixel_memcvg);
    int16_t finalcolor;

    if (wstate->fb_format == FORMAT_RGBA)
    {
        finalcolor = ((r & ~7) << 8) | ((g & ~7) << 3) | ((b & ~7) >> 2);
    }
    else
    {
        finalcolor = (int16_t)((r << 8) | (finalcvg << 5));
        finalcvg = 0;
    }


    rval = finalcolor|(uint16_t)(finalcvg >> 2);
    hval = finalcvg & 3;

    rdram_write_pair16(fb, rval, hval, 1);
}

static void fbwrite_32(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b, uint32_t blend_en, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx)
{
    UNUSED(flip);
    UNUSED(delayedhbwidx);

    uint32_t fb = (wstate->fb_address >> 2) + curpixel;

    int32_t finalcolor;
    int32_t finalcvg = finalize_spanalpha(wstate->other_modes.cvg_dest, blend_en, curpixel_cvg, curpixel_memcvg);

    finalcolor = (r << 24) | (g << 16) | (b << 8);
    finalcolor |= (finalcvg << 5);

    rdram_write_pair32(fb, finalcolor, (g & 1) ? 3 : 0, 0);
}

static void fbfill_4(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx)
{
    UNUSED(wstate);
    UNUSED(curpixel);
    UNUSED(flip);
    UNUSED(delayedhbwidx);

    rdp_pipeline_crashed = 1;
}

static void fbfill_8(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx)
{
    uint32_t fb = wstate->fb_address + curpixel;
    uint8_t val = (wstate->fill_color >> ((fb & 3) ^ 3) << 3) & 0xff;
    rdram_write_pair8(fb, val, flip, delayedhbwidx);
}

static void fbfill_16(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx)
{
    UNUSED(flip);
    UNUSED(delayedhbwidx);

    uint16_t val;
    uint8_t hval;
    uint32_t fb = (wstate->fb_address >> 1) + curpixel;
    if (fb & 1)
        val = wstate->fill_color & 0xffff;
    else
        val = (wstate->fill_color >> 16) & 0xffff;
    hval = ((val & 1) << 1) | (val & 1);
    rdram_write_pair16(fb, val, hval, 1);
}

static void fbfill_32(struct rdp_state* wstate, uint32_t curpixel, int flip, int* delayedhbwidx)
{
    UNUSED(flip);
    UNUSED(delayedhbwidx);

    uint32_t fb = (wstate->fb_address >> 2) + curpixel;
    rdram_write_pair32(fb, wstate->fill_color, (wstate->fill_color & 0x10000) ? 3 : 0, (wstate->fill_color & 0x1) ? 3 : 0);
}

static void fbread_4(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    UNUSED(curpixel);

    wstate->memory_color.r = wstate->memory_color.g = wstate->memory_color.b = 0;

    *curpixel_memcvg = 7;
    wstate->memory_color.a = 0xe0;
}

static void fbread2_4(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    UNUSED(curpixel);

    wstate->pre_memory_color.r = wstate->pre_memory_color.g = wstate->pre_memory_color.b = 0;
    wstate->pre_memory_color.a = 0xe0;
    *curpixel_memcvg = 7;
}

static void fbread_8(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    if (wstate->other_modes.image_read_en)
    {
        uint8_t mem;
        uint32_t addr = wstate->fb_address + curpixel;
        RREADADDR8(mem, addr);
        wstate->memory_color.r = wstate->memory_color.g = wstate->memory_color.b = mem;
    }

    *curpixel_memcvg = 7;
    wstate->memory_color.a = 0xe0;
}

static void fbread2_8(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    if (wstate->other_modes.image_read_en)
    {
        uint8_t mem;
        uint32_t addr = wstate->fb_address + curpixel;
        RREADADDR8(mem, addr);
        wstate->pre_memory_color.r = wstate->pre_memory_color.g = wstate->pre_memory_color.b = mem;
    }
    wstate->pre_memory_color.a = 0xe0;
    *curpixel_memcvg = 7;
}

static void fbread_16(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    if (wstate->other_modes.image_read_en)
    {
        uint16_t fword;
        uint8_t hbyte;
        uint32_t addr = (wstate->fb_address >> 1) + curpixel;

        uint8_t lowbits;

        PAIRREAD16(fword, hbyte, addr);

        if (wstate->fb_format == FORMAT_RGBA)
        {
            wstate->memory_color.r = RGBA16_R(fword);
            wstate->memory_color.g = RGBA16_G(fword);
            wstate->memory_color.b = RGBA16_B(fword);
            lowbits = ((fword & 1) << 2) | hbyte;
        }
        else
        {
            wstate->memory_color.r = wstate->memory_color.g = wstate->memory_color.b = fword >> 8;
            lowbits = (fword >> 5) & 7;
        }

        *curpixel_memcvg = lowbits;
        wstate->memory_color.a = lowbits << 5;
    }
    else
    {
        *curpixel_memcvg = 7;
        wstate->memory_color.a = 0xe0;
    }
}

static void fbread2_16(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{

    if (wstate->other_modes.image_read_en)
    {
        uint16_t fword;
        uint8_t hbyte;
        uint32_t addr = (wstate->fb_address >> 1) + curpixel;

        uint8_t lowbits;

        PAIRREAD16(fword, hbyte, addr);

        if (wstate->fb_format == FORMAT_RGBA)
        {
            wstate->pre_memory_color.r = RGBA16_R(fword);
            wstate->pre_memory_color.g = RGBA16_G(fword);
            wstate->pre_memory_color.b = RGBA16_B(fword);
            lowbits = ((fword & 1) << 2) | hbyte;
        }
        else
        {
            wstate->pre_memory_color.r = wstate->pre_memory_color.g = wstate->pre_memory_color.b = fword >> 8;
            lowbits = (fword >> 5) & 7;
        }

        *curpixel_memcvg = lowbits;
        wstate->pre_memory_color.a = lowbits << 5;
    }
    else
    {
        *curpixel_memcvg = 7;
        wstate->pre_memory_color.a = 0xe0;
    }

}

static void fbread_32(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    if (wstate->other_modes.image_read_en)
    {
        uint32_t mem, addr = (wstate->fb_address >> 2) + curpixel;
        RREADIDX32(mem, addr);
        wstate->memory_color.r = RGBA32_R(mem);
        wstate->memory_color.g = RGBA32_G(mem);
        wstate->memory_color.b = RGBA32_B(mem);

        *curpixel_memcvg = (mem >> 5) & 7;
        wstate->memory_color.a = mem & 0xe0;
    }
    else
    {
        *curpixel_memcvg = 7;
        wstate->memory_color.a = 0xe0;
    }
}

static INLINE void fbread2_32(struct rdp_state* wstate, uint32_t curpixel, uint32_t* curpixel_memcvg)
{
    if (wstate->other_modes.image_read_en)
    {
        uint32_t mem, addr = (wstate->fb_address >> 2) + curpixel;
        RREADIDX32(mem, addr);

        wstate->pre_memory_color.r = RGBA32_R(mem);
        wstate->pre_memory_color.g = RGBA32_G(mem);
        wstate->pre_memory_color.b = RGBA32_B(mem);

        *curpixel_memcvg = (mem >> 5) & 7;
        wstate->pre_memory_color.a = mem & 0xe0;
    }
    else
    {
        *curpixel_memcvg = 7;
        wstate->pre_memory_color.a = 0xe0;
    }
}

void rdp_set_color_image(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->fb_format   = (args[0] >> 21) & 0x7;
    wstate->fb_size     = (args[0] >> 19) & 0x3;
    wstate->fb_width    = (args[0] & 0x3ff) + 1;
    wstate->fb_address  = args[1] & 0x0ffffff;


    wstate->fbread1_ptr = fbread_func[wstate->fb_size];
    wstate->fbread2_ptr = fbread2_func[wstate->fb_size];
    wstate->fbwrite_ptr = fbwrite_func[wstate->fb_size];
    wstate->fbfill_ptr = fbfill_func[wstate->fb_size];
}

void rdp_set_fill_color(struct rdp_state* wstate, const uint32_t* args)
{
    wstate->fill_color = args[1];
}

static void fb_init(struct rdp_state* wstate)
{
    wstate->fb_format = FORMAT_RGBA;
    wstate->fb_size = PIXEL_SIZE_4BIT;
    wstate->fb_width = 0;
    wstate->fb_address = 0;


    wstate->fbread1_ptr = fbread_func[wstate->fb_size];
    wstate->fbread2_ptr = fbread2_func[wstate->fb_size];
    wstate->fbwrite_ptr = fbwrite_func[wstate->fb_size];
    wstate->fbfill_ptr = fbfill_func[wstate->fb_size];
}

#endif // N64VIDEO_C


================================================
FILE: src/core/n64video/rdp/rasterizer.c
================================================
#ifdef N64VIDEO_C

static STRICTINLINE int32_t normalize_dzpix(int32_t sum)
{
    int count;
    if (sum & 0xc000)
        return 0x8000;
    if (!(sum & 0xffff))
        return 1;

    if (sum == 1)
        return 3;

    for(count = 0x2000; count > 0; count >>= 1)
    {
        if (sum & count)
            return (count << 1);
    }

    return 0;
}

static void replicate_for_copy(struct rdp_state* wstate, uint32_t* outbyte, uint32_t inshort, uint32_t nybbleoffset, uint32_t tilenum, uint32_t tformat, uint32_t tsize)
{
    uint32_t lownib, hinib;
    switch(tsize)
    {
    case PIXEL_SIZE_4BIT:
        lownib = (nybbleoffset ^ 3) << 2;
        lownib = hinib = (inshort >> lownib) & 0xf;
        if (tformat == FORMAT_CI)
        {
            *outbyte = (wstate->tile[tilenum].palette << 4) | lownib;
        }
        else if (tformat == FORMAT_IA)
        {
            lownib = (lownib << 4) | lownib;
            *outbyte = (lownib & 0xe0) | ((lownib & 0xe0) >> 3) | ((lownib & 0xc0) >> 6);
        }
        else
            *outbyte = (lownib << 4) | lownib;
        break;
    case PIXEL_SIZE_8BIT:
        hinib = ((nybbleoffset ^ 3) | 1) << 2;
        if (tformat == FORMAT_IA)
        {
            lownib = (inshort >> hinib) & 0xf;
            *outbyte = (lownib << 4) | lownib;
        }
        else
        {
            lownib = (inshort >> (hinib & ~4)) & 0xf;
            hinib = (inshort >> hinib) & 0xf;
            *outbyte = (hinib << 4) | lownib;
        }
        break;
    default:
        *outbyte = (inshort >> 8) & 0xff;
        break;
    }
}

static void fetch_qword_copy(struct rdp_state* wstate, uint32_t* hidword, uint32_t* lowdword, int32_t ssss, int32_t ssst, uint32_t tilenum)
{
    uint32_t shorta, shortb, shortc, shortd;
    uint32_t sortshort[8];
    int hibits[6];
    int lowbits[6];
    int32_t sss = ssss, sst = ssst, sss1 = 0, sss2 = 0, sss3 = 0;
    int largetex = 0;

    uint32_t tformat, tsize;
    if (wstate->other_modes.en_tlut)
    {
        tsize = PIXEL_SIZE_16BIT;
        tformat = wstate->other_modes.tlut_type ? FORMAT_IA : FORMAT_RGBA;
    }
    else
    {
        tsize = wstate->tile[tilenum].size;
        tformat = wstate->tile[tilenum].format;
    }

    tc_pipeline_copy(&wstate->tile[tilenum], &sss, &sss1, &sss2, &sss3, &sst);
    read_tmem_copy(wstate, sss, sss1, sss2, sss3, sst, tilenum, sortshort, hibits, lowbits);
    largetex = (tformat == FORMAT_YUV || (tformat == FORMAT_RGBA && tsize == PIXEL_SIZE_32BIT));


    if (wstate->other_modes.en_tlut)
    {
        shorta = sortshort[4];
        shortb = sortshort[5];
        shortc = sortshort[6];
        shortd = sortshort[7];
    }
    else if (largetex)
    {
        shorta = sortshort[0];
        shortb = sortshort[1];
        shortc = sortshort[2];
        shortd = sortshort[3];
    }
    else
    {
        shorta = hibits[0] ? sortshort[4] : sortshort[0];
        shortb = hibits[1] ? sortshort[5] : sortshort[1];
        shortc = hibits[3] ? sortshort[6] : sortshort[2];
        shortd = hibits[4] ? sortshort[7] : sortshort[3];
    }

    *lowdword = (shortc << 16) | shortd;

    if (tsize == PIXEL_SIZE_16BIT)
        *hidword = (shorta << 16) | shortb;
    else
    {
        replicate_for_copy(wstate, &shorta, shorta, lowbits[0] & 3, tilenum, tformat, tsize);
        replicate_for_copy(wstate, &shortb, shortb, lowbits[1] & 3, tilenum, tformat, tsize);
        replicate_for_copy(wstate, &shortc, shortc, lowbits[3] & 3, tilenum, tformat, tsize);
        replicate_for_copy(wstate, &shortd, shortd, lowbits[4] & 3, tilenum, tformat, tsize);
        *hidword = (shorta << 24) | (shortb << 16) | (shortc << 8) | shortd;
    }
}

static STRICTINLINE void rgba_correct(struct rdp_state* wstate, int offx, int offy, int r, int g, int b, int a, uint32_t cvg)
{
    int summand_r, summand_b, summand_g, summand_a;



    if (cvg == 8)
    {
        r >>= 2;
        g >>= 2;
        b >>= 2;
        a >>= 2;
    }
    else
    {
        summand_r = offx * wstate->spans_cdr + offy * wstate->spans_drdy;
        summand_g = offx * wstate->spans_cdg + offy * wstate->spans_dgdy;
        summand_b = offx * wstate->spans_cdb + offy * wstate->spans_dbdy;
        summand_a = offx * wstate->spans_cda + offy * wstate->spans_dady;

        r = ((r << 2) + summand_r) >> 4;
        g = ((g << 2) + summand_g) >> 4;
        b = ((b << 2) + summand_b) >> 4;
        a = ((a << 2) + summand_a) >> 4;
    }


    wstate->shade_color.r = special_9bit_clamptable[r & 0x1ff];
    wstate->shade_color.g = special_9bit_clamptable[g & 0x1ff];
    wstate->shade_color.b = special_9bit_clamptable[b & 0x1ff];
    wstate->shade_color.a = special_9bit_clamptable[a & 0x1ff];
}

static STRICTINLINE void z_correct(struct rdp_state* wstate, int offx, int offy, int* z, uint32_t cvg)
{
    int summand_z;
    int sz = *z;
    int zanded;



    if (cvg == 8)
        sz = sz >> 3;
    else
    {
        summand_z = offx * wstate->spans_cdz + offy * wstate->spans_dzdy;

        sz = ((sz << 2) + summand_z) >> 5;
    }



    zanded = (sz & 0x60000) >> 17;


    switch (zanded)
    {
        case 0: *z = sz & 0x3ffff;                      break;
        case 1: *z = sz & 0x3ffff;                      break;
        case 2: *z = 0x3ffff;                           break;
        case 3: *z = 0;                                 break;
    }
}


void rejected_hbwrite_1cycle(struct rdp_state* wstate, int cdith, uint32_t blend_en, uint32_t prewrap, uint32_t curpixel, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx)
{
    int g, dontblend;
    int gval = 0;
    uint32_t fb = 0;
    int32_t hval = 0;
    int fbsel = wstate->fb_size;

    if (wstate->fb_size == PIXEL_SIZE_8BIT)
    {
        fb = wstate->fb_address + curpixel;
        if (!(fb & 1))
            fbsel--;
    }

    if (fbsel & 1)
    {
        if (!wstate->other_modes.color_on_cvg || prewrap)
        {
            dontblend = (wstate->other_modes.f.partialreject_1cycle && wstate->pixel_color.a >= 0xff);
            if (!blend_en || dontblend)
                g = *wstate->blender1a_g[0];
            else
            {
                wstate->inv_pixel_color.a =  (~(*wstate->blender1b_a[0])) & 0xff;

                blender_equation_cycle0_gval(wstate, &g);
            }
        }
        else
            g = *wstate->blender2a_g[0];

        if (wstate->other_modes.rgb_dither_sel != 3)
            rgb_dither_gval(wstate->other_modes.rgb_dither_sel, &g, cdith);

        gval = (g & 1) ? 3 : 0;
    }

    switch (fbsel)
    {
    case PIXEL_SIZE_4BIT:
        break;
    case PIXEL_SIZE_8BIT:
        if (flip && *delayedhbwidx >= 0)
        {
            if ((uint32_t)*delayedhbwidx < fb)
            {
                if (rdram_valid_idx8((uint32_t)*delayedhbwidx))
                {
                    int oldhbidx = *delayedhbwidx >> 1;
                    rdram_hidden[oldhbidx] &= ~2;
                    rdram_hidden[oldhbidx] |= rdram_hidden_old[oldhbidx & 7] & 2;
                }
            }
            else if (rdram_valid_idx8(fb))
            {
                rdram_hidden[fb >> 1] &= ~2;
                rdram_hidden[fb >> 1] |= gval & 2;
            }

            *delayedhbwidx = -1;
        }

        rdram_hidden_old[(fb >> 1) & 7] = gval & 0xff;
        break;
    case PIXEL_SIZE_16BIT:
        fb = (wstate->fb_address >> 1) + curpixel;
        if (wstate->fb_format == FORMAT_RGBA)
            hval = finalize_spanalpha(wstate->other_modes.cvg_dest, blend_en, curpixel_cvg, curpixel_memcvg) & 3;
        rdram_hidden_old[fb & 7] = hval & 0xff;
        break;
    case PIXEL_SIZE_32BIT:
        fb = (wstate->fb_address >> 2) + curpixel;
        rdram_hidden_old[(fb << 1) & 7] = gval & 0xff;
        rdram_hidden_old[((fb << 1) + 1) & 7] = 0;
        break;
    }
}

void rejected_hbwrite_2cycle(struct rdp_state* wstate, int cdith, uint32_t blend_en, uint32_t prewrap, uint32_t curpixel, uint32_t curpixel_cvg, uint32_t curpixel_memcvg, int flip, int* delayedhbwidx)
{
    int g, dontblend;
    int gval = 0;
    uint32_t fb = 0;
    int32_t hval = 0;
    int fbsel = wstate->fb_size;

    if (wstate->fb_size == PIXEL_SIZE_8BIT)
    {
        fb = wstate->fb_address + curpixel;
        if (!(fb & 1))
            fbsel--;
    }

    if (fbsel & 1)
    {
        if (!wstate->other_modes.color_on_cvg || prewrap)
        {
            dontblend = (wstate->other_modes.f.partialreject_2cycle && wstate->pixel_color.a >= 0xff);
            if (!blend_en || dontblend)
                g = *wstate->blender1a_g[1];
            else
            {
                wstate->inv_pixel_color.a =  (~(*wstate->blender1b_a[1])) & 0xff;

                blender_equation_cycle1_gval(wstate, &g);
            }
        }
        else
            g = *wstate->blender2a_g[1];

        if (wstate->other_modes.rgb_dither_sel != 3)
            rgb_dither_gval(wstate->other_modes.rgb_dither_sel, &g, cdith);

        gval = (g & 1) ? 3 : 0;
    }

    switch (fbsel)
    {
    case PIXEL_SIZE_4BIT:
        break;
    case PIXEL_SIZE_8BIT:
        if (flip && *delayedhbwidx >= 0)
        {
            if ((uint32_t)*delayedhbwidx < fb)
            {
                if (rdram_valid_idx8((uint32_t)*delayedhbwidx))
                {
                    int oldhbidx = *delayedhbwidx >> 1;
                    rdram_hidden[oldhbidx] &= ~2;
                    rdram_hidden[oldhbidx] |= rdram_hidden_old[oldhbidx & 7] & 2;
                }
            }
            else if (rdram_valid_idx8(fb))
            {
                rdram_hidden[fb >> 1] &= ~2;
                rdram_hidden[fb >> 1] |= gval & 2;
            }

            *delayedhbwidx = -1;
        }

        rdram_hidden_old[(fb >> 1) & 7] = gval & 0xff;
        break;
    case PIXEL_SIZE_16BIT:
        fb = (wstate->fb_address >> 1) + curpixel;
        if (wstate->fb_format == FORMAT_RGBA)
            hval = finalize_spanalpha(wstate->other_modes.cvg_dest, blend_en, curpixel_cvg, curpixel_memcvg) & 3;
        rdram_hidden_old[fb & 7] = hval & 0xff;
        break;
    case PIXEL_SIZE_32BIT:
        fb = (wstate->fb_address >> 2) + curpixel;
        rdram_hidden_old[(fb << 1) & 7] = gval & 0xff;
        rdram_hidden_old[((fb << 1) + 1) & 7] = 0;
        break;
    }
}

static void render_spans_1cycle_complete(struct rdp_state* wstate, int start, int end, int tilenum, int flip)
{
    int zb = wstate->zb_address >> 1;
    int zbcur;
    uint8_t offx = 0;
    uint8_t offy = 0;
    struct spansigs sigs;
    uint32_t blend_en;
    uint32_t prewrap;
    uint32_t curpixel_cvg, curpixel_cvbit, curpixel_memcvg;

    int prim_tile = tilenum;
    int tile1 = tilenum;
    int newtile = tilenum;
    int news, newt;

    int i, j;

    int drinc, dginc, dbinc, dainc, dzinc, dsinc, dtinc, dwinc;
    int xinc;

    if (flip)
    {
        drinc = wstate->spans_dr;
        dginc = wstate->spans_dg;
        dbinc = wstate->spans_db;
        dainc = wstate->spans_da;
        dzinc = wstate->spans_dz;
        dsinc = wstate->spans_ds;
        dtinc = wstate->spans_dt;
        dwinc = wstate->spans_dw;
        xinc = 1;
    }
    else
    {
        drinc = -wstate->spans_dr;
        dginc = -wstate->spans_dg;
        dbinc = -wstate->spans_db;
        dainc = -wstate->spans_da;
        dzinc = -wstate->spans_dz;
        dsinc = -wstate->spans_ds;
        dtinc = -wstate->spans_dt;
        dwinc = -wstate->spans_dw;
        xinc = -1;
    }

    int dzpix;
    if (!wstate->other_modes.z_source_sel)
        dzpix = wstate->spans_dzpix;
    else
    {
        dzpix = wstate->primitive_delta_z;
        dzinc = wstate->spans_cdz = wstate->spans_dzdy = 0;
    }
    int dzpixenc = dz_compress(dzpix);

    int cdith = 7, adith = 0;
    int r, g, b, a, z, s, t, w;
    int sr, sg, sb, sa, sz, ss, st, sw;
    int xstart, xend, xendsc;
    int sss = 0, sst = 0;
    int32_t prelodfrac = 0;
    int curpixel = 0;
    int x, length, scdiff, lodlength;
    uint32_t fir = 0, fig = 0, fib = 0;
    int delayedhbwidx = -1;
    int wen;

    for (i = start; i <= end; i++)
    {
        if (wstate->span[i].validline)
        {

        xstart = wstate->span[i].lx;
        xend = wstate->span[i].unscrx;
        xendsc = wstate->span[i].rx;
        r = wstate->span[i].r;
        g = wstate->span[i].g;
        b = wstate->span[i].b;
        a = wstate->span[i].a;
        z = wstate->other_modes.z_source_sel ? wstate->primitive_z : wstate->span[i].z;
        s = wstate->span[i].s;
        t = wstate->span[i].t;
        w = wstate->span[i].w;

        x = xendsc;
        curpixel = wstate->fb_width * i + x;
        zbcur = zb + curpixel;

        if (!flip)
        {
            length = xendsc - xstart;
            scdiff = xend - xendsc;
            compute_cvg_noflip(wstate, i);
        }
        else
        {
            length = xstart - xendsc;
            scdiff = xendsc - xend;
            compute_cvg_flip(wstate, i);
        }



        if (scdiff)
        {


            scdiff &= 0xfff;
            r += (drinc * scdiff);
            g += (dginc * scdiff);
            b += (dbinc * scdiff);
            a += (dainc * scdiff);
            z += (dzinc * scdiff);
            s += (dsinc * scdiff);
            t += (dtinc * scdiff);
            w += (dwinc * scdiff);
        }

        lodlength = length + scdiff;

        sigs.longspan = (lodlength > 7);
        sigs.midspan = (lodlength == 7);
        sigs.onelessthanmid = (lodlength == 6);

        for (j = 0; j <= length; j++)
        {
            sr = r >> 14;
            sg = g >> 14;
            sb = b >> 14;
            sa = a >> 14;
            ss = s >> 16;
            st = t >> 16;
            sw = w >> 16;
            sz = (z >> 10) & 0x3fffff;


            sigs.endspan = (j == length);
            sigs.preendspan = (j == (length - 1));

            lookup_cvmask_derivatives(wstate->cvgbuf[x], &offx, &offy, &curpixel_cvg, &curpixel_cvbit);


            get_texel1_1cycle(wstate, &news, &newt, s, t, w, dsinc, dtinc, dwinc, i, &sigs);



            if (j)
            {
                wstate->texel0_color = wstate->texel1_color;
                wstate->lod_frac = prelodfrac;
            }
            else
            {
                wstate->tcdiv_ptr(ss, st, sw, &sss, &sst);


                tclod_1cycle_current(wstate, &sss, &sst, news, newt, s, t, w, dsinc, dtinc, dwinc, i, prim_tile, &tile1, &sigs);




                texture_pipeline_cycle(wstate, &wstate->texel0_color, &wstate->texel0_color, sss, sst, tile1, 0);
            }

            sigs.nextspan = sigs.endspan;
            sigs.endspan = sigs.preendspan;
            sigs.preendspan = (j == (length - 2));

            s += dsinc;
            t += dtinc;
            w += dwinc;

            tclod_1cycle_next(wstate, &news, &newt, s, t, w, dsinc, dtinc, dwinc, i, prim_tile, &newtile, &sigs, &prelodfrac);

            texture_pipeline_cycle(wstate, &wstate->texel1_color, &wstate->texel1_color, news, newt, newtile, 0);

            rgba_correct(wstate, offx, offy, sr, sg, sb, sa, curpixel_cvg);
            z_correct(wstate, offx, offy, &sz, curpixel_cvg);

            if (wstate->other_modes.f.getditherlevel < 2)
                get_dither_noise(wstate, x, i, &cdith, &adith);

            combiner_1cycle(wstate, adith, &curpixel_cvg);

            wstate->fbread1_ptr(wstate, curpixel, &curpixel_memcvg);

            wen = z_compare(wstate, zbcur, sz, (uint16_t)dzpix, dzpixenc, &blend_en, &prewrap, &curpixel_cvg, curpixel_memcvg);

            if (wen)
                wen = blender_1cycle(wstate, &fir, &fig, &fib, cdith, blend_en, prewrap, curpixel_cvg, curpixel_cvbit);

            if (wen)
            {
                wstate->fbwrite_ptr(wstate, curpixel, fir, fig, fib, blend_en, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);
                if (wstate->other_modes.z_update_en)
                    z_store(zbcur, sz, dzpixenc);
            }
            else if (i >= wstate->last_overwriting_scanline)
                rejected_hbwrite_1cycle(wstate, cdith, blend_en, prewrap, curpixel, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);

            r += drinc;
            g += dginc;
            b += dbinc;
            a += dainc;
            z += dzinc;

            x += xinc;
            curpixel += xinc;
            zbcur += xinc;
        }
        }
    }

    if (delayedhbwidx >= 0 && flip && wstate->fb_size == PIXEL_SIZE_8BIT)
        rdram_complete_delayed_hbwrites(delayedhbwidx);
}


static void render_spans_1cycle_notexel1(struct rdp_state* wstate, int start, int end, int tilenum, int flip)
{
    int zb = wstate->zb_address >> 1;
    int zbcur;
    uint8_t offx = 0;
    uint8_t offy = 0;
    struct spansigs sigs;
    uint32_t blend_en;
    uint32_t prewrap;
    uint32_t curpixel_cvg, curpixel_cvbit, curpixel_memcvg;

    int prim_tile = tilenum;
    int tile1 = tilenum;

    int i, j;

    int drinc, dginc, dbinc, dainc, dzinc, dsinc, dtinc, dwinc;
    int xinc;
    if (flip)
    {
        drinc = wstate->spans_dr;
        dginc = wstate->spans_dg;
        dbinc = wstate->spans_db;
        dainc = wstate->spans_da;
        dzinc = wstate->spans_dz;
        dsinc = wstate->spans_ds;
        dtinc = wstate->spans_dt;
        dwinc = wstate->spans_dw;
        xinc = 1;
    }
    else
    {
        drinc = -wstate->spans_dr;
        dginc = -wstate->spans_dg;
        dbinc = -wstate->spans_db;
        dainc = -wstate->spans_da;
        dzinc = -wstate->spans_dz;
        dsinc = -wstate->spans_ds;
        dtinc = -wstate->spans_dt;
        dwinc = -wstate->spans_dw;
        xinc = -1;
    }

    int dzpix;
    if (!wstate->other_modes.z_source_sel)
        dzpix = wstate->spans_dzpix;
    else
    {
        dzpix = wstate->primitive_delta_z;
        dzinc = wstate->spans_cdz = wstate->spans_dzdy = 0;
    }
    int dzpixenc = dz_compress(dzpix);

    int cdith = 7, adith = 0;
    int r, g, b, a, z, s, t, w;
    int sr, sg, sb, sa, sz, ss, st, sw;
    int xstart, xend, xendsc;
    int sss = 0, sst = 0;
    int curpixel = 0;
    int x, length, scdiff, lodlength;
    uint32_t fir = 0, fig = 0, fib = 0;
    int delayedhbwidx = -1;
    int wen;

    for (i = start; i <= end; i++)
    {
        if (wstate->span[i].validline)
        {

        xstart = wstate->span[i].lx;
        xend = wstate->span[i].unscrx;
        xendsc = wstate->span[i].rx;
        r = wstate->span[i].r;
        g = wstate->span[i].g;
        b = wstate->span[i].b;
        a = wstate->span[i].a;
        z = wstate->other_modes.z_source_sel ? wstate->primitive_z : wstate->span[i].z;
        s = wstate->span[i].s;
        t = wstate->span[i].t;
        w = wstate->span[i].w;

        x = xendsc;
        curpixel = wstate->fb_width * i + x;
        zbcur = zb + curpixel;

        if (!flip)
        {
            length = xendsc - xstart;
            scdiff = xend - xendsc;
            compute_cvg_noflip(wstate, i);
        }
        else
        {
            length = xstart - xendsc;
            scdiff = xendsc - xend;
            compute_cvg_flip(wstate, i);
        }

        if (scdiff)
        {
            scdiff &= 0xfff;
            r += (drinc * scdiff);
            g += (dginc * scdiff);
            b += (dbinc * scdiff);
            a += (dainc * scdiff);
            z += (dzinc * scdiff);
            s += (dsinc * scdiff);
            t += (dtinc * scdiff);
            w += (dwinc * scdiff);
        }

        lodlength = length + scdiff;

        sigs.longspan = (lodlength > 7);
        sigs.midspan = (lodlength == 7);

        for (j = 0; j <= length; j++)
        {
            sr = r >> 14;
            sg = g >> 14;
            sb = b >> 14;
            sa = a >> 14;
            ss = s >> 16;
            st = t >> 16;
            sw = w >> 16;
            sz = (z >> 10) & 0x3fffff;



            sigs.endspan = (j == length);
            sigs.preendspan = (j == (length - 1));

            lookup_cvmask_derivatives(wstate->cvgbuf[x], &offx, &offy, &curpixel_cvg, &curpixel_cvbit);

            wstate->tcdiv_ptr(ss, st, sw, &sss, &sst);

            tclod_1cycle_current_simple(wstate, &sss, &sst, s, t, w, dsinc, dtinc, dwinc, i, prim_tile, &tile1, &sigs);

            texture_pipeline_cycle(wstate, &wstate->texel0_color, &wstate->texel0_color, sss, sst, tile1, 0);

            rgba_correct(wstate, offx, offy, sr, sg, sb, sa, curpixel_cvg);
            z_correct(wstate, offx, offy, &sz, curpixel_cvg);

            if (wstate->other_modes.f.getditherlevel < 2)
                get_dither_noise(wstate, x, i, &cdith, &adith);

            combiner_1cycle(wstate, adith, &curpixel_cvg);

            wstate->fbread1_ptr(wstate, curpixel, &curpixel_memcvg);

            wen = z_compare(wstate, zbcur, sz, (uint16_t)dzpix, dzpixenc, &blend_en, &prewrap, &curpixel_cvg, curpixel_memcvg);

            if (wen)
                wen = blender_1cycle(wstate, &fir, &fig, &fib, cdith, blend_en, prewrap, curpixel_cvg, curpixel_cvbit);

            if (wen)
            {
                wstate->fbwrite_ptr(wstate, curpixel, fir, fig, fib, blend_en, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);
                if (wstate->other_modes.z_update_en)
                    z_store(zbcur, sz, dzpixenc);
            }
            else if (i >= wstate->last_overwriting_scanline)
                rejected_hbwrite_1cycle(wstate, cdith, blend_en, prewrap, curpixel, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);

            s += dsinc;
            t += dtinc;
            w += dwinc;
            r += drinc;
            g += dginc;
            b += dbinc;
            a += dainc;
            z += dzinc;

            x += xinc;
            curpixel += xinc;
            zbcur += xinc;
        }
        }
    }

    if (delayedhbwidx >= 0 && flip && wstate->fb_size == PIXEL_SIZE_8BIT)
        rdram_complete_delayed_hbwrites(delayedhbwidx);
}


static void render_spans_1cycle_notex(struct rdp_state* wstate, int start, int end, int tilenum, int flip)
{
    UNUSED(tilenum);

    int zb = wstate->zb_address >> 1;
    int zbcur;
    uint8_t offx = 0;
    uint8_t offy = 0;
    uint32_t blend_en;
    uint32_t prewrap;
    uint32_t curpixel_cvg, curpixel_cvbit, curpixel_memcvg;

    int i, j;

    int drinc, dginc, dbinc, dainc, dzinc;
    int xinc;

    if (flip)
    {
        drinc = wstate->spans_dr;
        dginc = wstate->spans_dg;
        dbinc = wstate->spans_db;
        dainc = wstate->spans_da;
        dzinc = wstate->spans_dz;
        xinc = 1;
    }
    else
    {
        drinc = -wstate->spans_dr;
        dginc = -wstate->spans_dg;
        dbinc = -wstate->spans_db;
        dainc = -wstate->spans_da;
        dzinc = -wstate->spans_dz;
        xinc = -1;
    }

    int dzpix;
    if (!wstate->other_modes.z_source_sel)
        dzpix = wstate->spans_dzpix;
    else
    {
        dzpix = wstate->primitive_delta_z;
        dzinc = wstate->spans_cdz = wstate->spans_dzdy = 0;
    }
    int dzpixenc = dz_compress(dzpix);

    int cdith = 7, adith = 0;
    int r, g, b, a, z;
    int sr, sg, sb, sa, sz;
    int xstart, xend, xendsc;
    int curpixel = 0;
    int x, length, scdiff;
    uint32_t fir = 0, fig = 0, fib = 0;
    int delayedhbwidx = -1;
    int wen;

    for (i = start; i <= end; i++)
    {
        if (wstate->span[i].validline)
        {

        xstart = wstate->span[i].lx;
        xend = wstate->span[i].unscrx;
        xendsc = wstate->span[i].rx;
        r = wstate->span[i].r;
        g = wstate->span[i].g;
        b = wstate->span[i].b;
        a = wstate->span[i].a;
        z = wstate->other_modes.z_source_sel ? wstate->primitive_z : wstate->span[i].z;

        x = xendsc;
        curpixel = wstate->fb_width * i + x;
        zbcur = zb + curpixel;

        if (!flip)
        {
            length = xendsc - xstart;
            scdiff = xend - xendsc;
            compute_cvg_noflip(wstate, i);
        }
        else
        {
            length = xstart - xendsc;
            scdiff = xendsc - xend;
            compute_cvg_flip(wstate, i);
        }

        if (scdiff)
        {
            scdiff &= 0xfff;
            r += (drinc * scdiff);
            g += (dginc * scdiff);
            b += (dbinc * scdiff);
            a += (dainc * scdiff);
            z += (dzinc * scdiff);
        }

        for (j = 0; j <= length; j++)
        {
            sr = r >> 14;
            sg = g >> 14;
            sb = b >> 14;
            sa = a >> 14;
            sz = (z >> 10) & 0x3fffff;

            lookup_cvmask_derivatives(wstate->cvgbuf[x], &offx, &offy, &curpixel_cvg, &curpixel_cvbit);

            rgba_correct(wstate, offx, offy, sr, sg, sb, sa, curpixel_cvg);
            z_correct(wstate, offx, offy, &sz, curpixel_cvg);

            if (wstate->other_modes.f.getditherlevel < 2)
                get_dither_noise(wstate, x, i, &cdith, &adith);

            combiner_1cycle(wstate, adith, &curpixel_cvg);

            wstate->fbread1_ptr(wstate, curpixel, &curpixel_memcvg);

            wen = z_compare(wstate, zbcur, sz, (uint16_t)dzpix, dzpixenc, &blend_en, &prewrap, &curpixel_cvg, curpixel_memcvg);

            if (wen)
                wen = blender_1cycle(wstate, &fir, &fig, &fib, cdith, blend_en, prewrap, curpixel_cvg, curpixel_cvbit);

            if (wen)
            {
                wstate->fbwrite_ptr(wstate, curpixel, fir, fig, fib, blend_en, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);
                if (wstate->other_modes.z_update_en)
                    z_store(zbcur, sz, dzpixenc);
            }
            else if (i >= wstate->last_overwriting_scanline)
                rejected_hbwrite_1cycle(wstate, cdith, blend_en, prewrap, curpixel, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);

            r += drinc;
            g += dginc;
            b += dbinc;
            a += dainc;
            z += dzinc;

            x += xinc;
            curpixel += xinc;
            zbcur += xinc;
        }
        }
    }

    if (delayedhbwidx >= 0 && flip && wstate->fb_size == PIXEL_SIZE_8BIT)
        rdram_complete_delayed_hbwrites(delayedhbwidx);
}

static void render_spans_2cycle_complete(struct rdp_state* wstate, int start, int end, int tilenum, int flip)
{
    int zb = wstate->zb_address >> 1;
    int zbcur;
    uint8_t offx = 0;
    uint8_t offy = 0;
    int32_t prelodfrac;
    struct color nexttexel1_color;
    uint32_t blend_en = 0;
    uint32_t prewrap = 0;
    uint32_t curpixel_cvg = 0, curpixel_cvbit = 0, curpixel_memcvg = 0;
    uint32_t nextpixel_cvg;
    uint32_t acalpha;



    int tile2 = (tilenum + 1) & 7;
    int tile1 = tilenum;
    int prim_tile = tilenum;
    int tile3 = tilenum;

    int i, j;

    int drinc, dginc, dbinc, dainc, dzinc, dsinc, dtinc, dwinc;
    int xinc;
    if (flip)
    {
        drinc = wstate->spans_dr;
        dginc = wstate->spans_dg;
        dbinc = wstate->spans_db;
        dainc = wstate->spans_da;
        dzinc = wstate->spans_dz;
        dsinc = wstate->spans_ds;
        dtinc = wstate->spans_dt;
        dwinc = wstate->spans_dw;
        xinc = 1;
    }
    else
    {
        drinc = -wstate->spans_dr;
        dginc = -wstate->spans_dg;
        dbinc = -wstate->spans_db;
        dainc = -wstate->spans_da;
        dzinc = -wstate->spans_dz;
        dsinc = -wstate->spans_ds;
        dtinc = -wstate->spans_dt;
        dwinc = -wstate->spans_dw;
        xinc = -1;
    }

    int dzpix;
    if (!wstate->other_modes.z_source_sel)
        dzpix = wstate->spans_dzpix;
    else
    {
        dzpix = wstate->primitive_delta_z;
        dzinc = wstate->spans_cdz = wstate->spans_dzdy = 0;
    }
    int dzpixenc = dz_compress(dzpix);

    int cdith = 7, adith = 0;

    int r, g, b, a, z, s, t, w;
    int sr, sg, sb, sa, sz, ss, st, sw;
    int xstart, xend, xendsc;
    int sss = 0, sst = 0;
    uint32_t curpixel = 0;
    int wen = 0;

    int x, length, scdiff, lodlength;
    uint32_t fir, fig, fib;
    int delayedhbwidx = -1;

    for (i = start; i <= end; i++)
    {
        if (wstate->span[i].validline)
        {

        xstart = wstate->span[i].lx;
        xend = wstate->span[i].unscrx;
        xendsc = wstate->span[i].rx;
        r = wstate->span[i].r;
        g = wstate->span[i].g;
        b = wstate->span[i].b;
        a = wstate->span[i].a;
        z = wstate->other_modes.z_source_sel ? wstate->primitive_z : wstate->span[i].z;
        s = wstate->span[i].s;
        t = wstate->span[i].t;
        w = wstate->span[i].w;

        x = xendsc;
        curpixel = wstate->fb_width * i + x;
        zbcur = zb + curpixel;

        if (!flip)
        {
            length = xendsc - xstart;
            scdiff = xend - xendsc;
            compute_cvg_noflip(wstate, i);
        }
        else
        {
            length = xstart - xendsc;
            scdiff = xendsc - xend;
            compute_cvg_flip(wstate, i);
        }








        if (scdiff)
        {
            scdiff &= 0xfff;
            r += (drinc * scdiff);
            g += (dginc * scdiff);
            b += (dbinc * scdiff);
            a += (dainc * scdiff);
            z += (dzinc * scdiff);
            s += (dsinc * scdiff);
            t += (dtinc * scdiff);
            w += (dwinc * scdiff);
        }

        lodlength = length + scdiff;

        for (j = 0; j <= length; j++)
        {
            sz = (z >> 10) & 0x3fffff;

            if (!j)
            {
                sr = r >> 14;
                sg = g >> 14;
                sb = b >> 14;
                sa = a >> 14;
                ss = s >> 16;
                st = t >> 16;
                sw = w >> 16;

                wstate->tcdiv_ptr(ss, st, sw, &sss, &sst);

                tclod_2cycle(wstate, &sss, &sst, s, t, w, dsinc, dtinc, dwinc, prim_tile, &tile1, &tile2, &wstate->lod_frac);

                texture_pipeline_cycle(wstate, &wstate->texel0_color, &wstate->texel0_color, sss, sst, tile1, 0);
                texture_pipeline_cycle(wstate, &wstate->texel1_color, &wstate->texel0_color, sss, sst, tile2, 1);

                lookup_cvmask_derivatives(wstate->cvgbuf[x], &offx, &offy, &curpixel_cvg, &curpixel_cvbit);

                rgba_correct(wstate, offx, offy, sr, sg, sb, sa, curpixel_cvg);

                if (wstate->other_modes.f.getditherlevel < 2)
                    get_dither_noise(wstate, x, i, &cdith, &adith);

                combiner_2cycle_cycle0(wstate, adith, curpixel_cvg, &acalpha);
            }



            s += dsinc;
            t += dtinc;
            w += dwinc;

            ss = s >> 16;
            st = t >> 16;
            sw = w >> 16;

            wstate->tcdiv_ptr(ss, st, sw, &sss, &sst);

            if (j < length || !wstate->span[i + 1].validline || lodlength < 3)
            {
                tclod_2cycle(wstate, &sss, &sst, s, t, w, dsinc, dtinc, dwinc, prim_tile, &tile1, &tile2, &prelodfrac);

                texture_pipeline_cycle(wstate, &wstate->nexttexel_color, &wstate->nexttexel_color, sss, sst, tile1, 0);
                texture_pipeline_cycle(wstate, &nexttexel1_color, &wstate->nexttexel_color, sss, sst, tile2, 1);
            }
            else
            {
                int sss2, sst2;

                ss = wstate->span[i + 1].s >> 16;
                st = wstate->span[i + 1].t >> 16;
                sw = wstate->span[i + 1].w >> 16;
                wstate->tcdiv_ptr(ss, st, sw, &sss2, &sst2);

                tclod_2cycle_next(wstate, &sss, &sst, &sss2, &sst2, s, t, w, dsinc, dtinc, dwinc, prim_tile, &tile1, &tile3, &prelodfrac, i);

                texture_pipeline_cycle(wstate, &wstate->nexttexel_color, &wstate->nexttexel_color, sss, sst, tile1, 0);
                texture_pipeline_cycle(wstate, &nexttexel1_color, &wstate->nexttexel_color, sss2, sst2, tile3, 0);
            }

            z_correct(wstate, offx, offy, &sz, curpixel_cvg);

            combiner_2cycle_cycle1(wstate, adith, &curpixel_cvg);

            wstate->fbread2_ptr(wstate, curpixel, &curpixel_memcvg);

            wen = z_compare(wstate, zbcur, sz, (uint16_t)dzpix, dzpixenc, &blend_en, &prewrap, &curpixel_cvg, curpixel_memcvg);

            if (wen)
                wen = blender_2cycle_cycle0(wstate, curpixel_cvg, curpixel_cvbit);

            if (!wen && i >= wstate->last_overwriting_scanline)
                blender_2cycle_cycle0_gval(wstate, curpixel);

            wstate->memory_color = wstate->pre_memory_color;

            x += xinc;

            r += drinc;
            g += dginc;
            b += dbinc;
            a += dainc;

            sr = r >> 14;
            sg = g >> 14;
            sb = b >> 14;
            sa = a >> 14;




            lookup_cvmask_derivatives(j < length ? wstate->cvgbuf[x] : 0, &offx, &offy, &nextpixel_cvg, &curpixel_cvbit);

            rgba_correct(wstate, offx, offy, sr, sg, sb, sa, nextpixel_cvg);

            wstate->lod_frac = prelodfrac;
            wstate->texel0_color = wstate->nexttexel_color;
            wstate->texel1_color = nexttexel1_color;


            combiner_2cycle_cycle0(wstate, adith, nextpixel_cvg, &acalpha);

            if (wen)
                wen = alpha_compare(wstate, acalpha);

            if (wen)
            {
                blender_2cycle_cycle1(wstate, &fir, &fig, &fib, cdith, blend_en, prewrap);
                wstate->fbwrite_ptr(wstate, curpixel, fir, fig, fib, blend_en, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);
                if (wstate->other_modes.z_update_en)
                    z_store(zbcur, sz, dzpixenc);
            }
            else if (i >= wstate->last_overwriting_scanline)
                rejected_hbwrite_2cycle(wstate, cdith, blend_en, prewrap, curpixel, curpixel_cvg, curpixel_memcvg, flip, &delayedhbwidx);

            if (wstate->other_modes.f.getditherlevel < 2)
                get_dither_noise(wstate, x, i, &cdith, &adith);

            curpixel_cvg = nextpixel_cvg;






            z += dzinc;

            curpixel += xinc;
            zbcur += xinc;
        }
        }
    }

    if (delayedhbwidx >= 0 && flip && wstate->fb_size == PIXEL_SIZE_8BIT)
        rdram_complete_delayed_hbwrites(delayedhbwidx);
}



static void render_spans_2cycle_notexelnext(struct rdp_state* wstate, int start, int end, int tilenum, int flip)
{
    int zb = wstate->zb_address >> 1;
    int zbcur;
    uint8_t offx = 0;
    uint8_t offy = 0;
    uint32_t blend_en;
    uint32_t prewrap;
    uint32_t curpixel_cvg = 0, curpixel_cvbit = 0, curpixel_memcvg = 0;
    uint32_t nextpixel_cvg;
    uint32_t acalpha;

    int tile2 = (tilenum + 1) & 7;
    int tile1 = tilenum;
    int prim_tile = tilenum;

    int i, j;

    int drinc, dginc, dbinc, dainc, dzinc, dsinc, dtinc, dwinc;
    int xinc;
    if (flip)
    {
        drinc = wstate->spans_dr;
        dginc = wstate->spans_dg;
        dbinc = wstate->spans_db;
        dainc = wstate->spans_da;
        dzinc = wstate->spans_dz;
   
Download .txt
gitextract_j_xyk2b9/

├── .github/
│   └── workflows/
│       └── build.yml
├── .gitignore
├── CMakeLists.txt
├── CREDITS.txt
├── MAME License.txt
├── README.md
├── git-version.cmake
├── make_version.py
├── msvc/
│   ├── .gitignore
│   ├── angrylion-plus.sln
│   ├── core.vcxproj
│   ├── core.vcxproj.filters
│   ├── output.vcxproj
│   ├── output.vcxproj.filters
│   ├── plugin-mupen64plus.vcxproj
│   ├── plugin-mupen64plus.vcxproj.filters
│   ├── plugin-zilmar.vcxproj
│   └── plugin-zilmar.vcxproj.filters
└── src/
    ├── core/
    │   ├── common.h
    │   ├── msg.h
    │   ├── n64video/
    │   │   ├── rdp/
    │   │   │   ├── blender.c
    │   │   │   ├── combiner.c
    │   │   │   ├── coverage.c
    │   │   │   ├── dither.c
    │   │   │   ├── fbuffer.c
    │   │   │   ├── rasterizer.c
    │   │   │   ├── rdram.c
    │   │   │   ├── tcoord.c
    │   │   │   ├── tex.c
    │   │   │   ├── tmem.c
    │   │   │   └── zbuffer.c
    │   │   ├── rdp.c
    │   │   ├── vi/
    │   │   │   ├── divot.c
    │   │   │   ├── fetch.c
    │   │   │   ├── gamma.c
    │   │   │   ├── lerp.c
    │   │   │   ├── restore.c
    │   │   │   └── video.c
    │   │   └── vi.c
    │   ├── n64video.c
    │   ├── n64video.h
    │   ├── parallel.cpp
    │   ├── parallel.h
    │   └── version.h.in
    ├── output/
    │   ├── gl_core_3_3.c
    │   ├── gl_core_3_3.h
    │   ├── gl_proc.h
    │   ├── screen.h
    │   ├── vdac.c
    │   └── vdac.h
    └── plugin/
        ├── mupen64plus/
        │   ├── api/
        │   │   ├── m64p_common.h
        │   │   ├── m64p_config.h
        │   │   ├── m64p_plugin.h
        │   │   ├── m64p_types.h
        │   │   └── m64p_vidext.h
        │   ├── gfx_m64p.c
        │   ├── gfx_m64p.h
        │   ├── msg.c
        │   └── screen.c
        └── zilmar/
            ├── config.c
            ├── config.h
            ├── config.rc
            ├── gfx_1.3.c
            ├── gfx_1.3.h
            ├── msg.c
            ├── resource.h
            ├── screen.c
            ├── wgl_ext.c
            └── wgl_ext.h
Download .txt
SYMBOL INDEX (565 symbols across 44 files)

FILE: make_version.py
  function system (line 5) | def system(cmd, default):

FILE: src/core/n64video.c
  type n64video_config (line 86) | struct n64video_config
  function STRICTINLINE (line 95) | static STRICTINLINE int32_t clamp(int32_t value, int32_t min, int32_t max)
  function STRICTINLINE (line 105) | static STRICTINLINE uint32_t irand(uint32_t* state)
  function cmd_run_buffered (line 129) | static void cmd_run_buffered(uint32_t worker_id)
  function cmd_flush (line 137) | static void cmd_flush(void)
  function cmd_init (line 148) | static void cmd_init(void)
  function n64video_config_init (line 155) | void n64video_config_init(struct n64video_config* conf)
  function n64video_init_parallel (line 165) | static void n64video_init_parallel(uint32_t worker_id)
  function n64video_init (line 174) | void n64video_init(struct n64video_config* _config)
  function n64video_process_list (line 235) | void n64video_process_list(void)
  function n64video_close (line 317) | void n64video_close(void)

FILE: src/core/n64video.h
  type dp_register (line 9) | enum dp_register
  type vi_register (line 22) | enum vi_register
  type vi_mode (line 42) | enum vi_mode
  type vi_interp (line 51) | enum vi_interp
  type dp_compat_profile (line 59) | enum dp_compat_profile
  type n64video_pixel (line 67) | struct n64video_pixel
  type n64video_frame_buffer (line 75) | struct n64video_frame_buffer
  type n64video_config (line 85) | struct n64video_config
  type n64video_config (line 113) | struct n64video_config
  type n64video_config (line 114) | struct n64video_config
  type n64video_frame_buffer (line 115) | struct n64video_frame_buffer

FILE: src/core/n64video/rdp.c
  type color (line 63) | struct color
  type rectangle (line 68) | struct rectangle
  type other_modes (line 73) | struct other_modes
  type spansigs (line 127) | struct spansigs
  type tile (line 137) | struct tile
  type span (line 158) | struct span
  type combiner_inputs (line 169) | struct combiner_inputs
  type rdp_state (line 190) | struct rdp_state
  type rdp_state (line 350) | struct rdp_state
  type rdp_state (line 355) | struct rdp_state
  type rdp_state (line 356) | struct rdp_state
  type rdp_state (line 357) | struct rdp_state
  type rdp_state (line 358) | struct rdp_state
  type rdp_state (line 359) | struct rdp_state
  type rdp_state (line 360) | struct rdp_state
  type rdp_state (line 361) | struct rdp_state
  type rdp_state (line 362) | struct rdp_state
  type rdp_state (line 363) | struct rdp_state
  type rdp_state (line 364) | struct rdp_state
  type rdp_state (line 365) | struct rdp_state
  type rdp_state (line 366) | struct rdp_state
  type rdp_state (line 367) | struct rdp_state
  type rdp_state (line 368) | struct rdp_state
  type rdp_state (line 369) | struct rdp_state
  type rdp_state (line 370) | struct rdp_state
  type rdp_state (line 371) | struct rdp_state
  type rdp_state (line 372) | struct rdp_state
  type rdp_state (line 373) | struct rdp_state
  type rdp_state (line 374) | struct rdp_state
  type rdp_state (line 375) | struct rdp_state
  type rdp_state (line 376) | struct rdp_state
  type rdp_state (line 377) | struct rdp_state
  type rdp_state (line 378) | struct rdp_state
  type rdp_state (line 379) | struct rdp_state
  type rdp_state (line 380) | struct rdp_state
  type rdp_state (line 381) | struct rdp_state
  type rdp_state (line 382) | struct rdp_state
  type rdp_state (line 383) | struct rdp_state
  type rdp_state (line 384) | struct rdp_state
  type rdp_state (line 385) | struct rdp_state
  type rdp_state (line 386) | struct rdp_state
  type rdp_state (line 387) | struct rdp_state
  type rdp_state (line 388) | struct rdp_state
  type rdp_state (line 389) | struct rdp_state
  type rdp_state (line 390) | struct rdp_state
  type rdp_state (line 391) | struct rdp_state
  type rdp_state (line 392) | struct rdp_state
  type rdp_state (line 393) | struct rdp_state
  type rdp_state (line 398) | struct rdp_state
  type rdp_state (line 468) | struct rdp_state
  function deduce_derivatives (line 482) | static void deduce_derivatives(struct rdp_state* wstate)
  function rdp_init (line 571) | void rdp_init(struct rdp_state* wstate)
  function rdp_invalid (line 583) | void rdp_invalid(struct rdp_state* wstate, const uint32_t* args)
  function rdp_noop (line 589) | void rdp_noop(struct rdp_state* wstate, const uint32_t* args)
  function rdp_sync_load (line 595) | void rdp_sync_load(struct rdp_state* wstate, const uint32_t* args)
  function rdp_sync_pipe (line 601) | void rdp_sync_pipe(struct rdp_state* wstate, const uint32_t* args)
  function rdp_sync_tile (line 607) | void rdp_sync_tile(struct rdp_state* wstate, const uint32_t* args)
  function rdp_sync_full (line 613) | void rdp_sync_full(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_other_modes (line 623) | void rdp_set_other_modes(struct rdp_state* wstate, const uint32_t* args)
  function rdp_cmd (line 674) | void rdp_cmd(struct rdp_state* wstate, const uint32_t* args)

FILE: src/core/n64video/rdp/blender.c
  function INLINE (line 7) | static INLINE void set_blender_input(struct rdp_state* wstate, int cycle...
  function STRICTINLINE (line 72) | static STRICTINLINE int alpha_compare(struct rdp_state* wstate, int32_t ...
  function STRICTINLINE (line 92) | static STRICTINLINE void blender_equation_cycle0(struct rdp_state* wstat...
  function STRICTINLINE (line 138) | static STRICTINLINE void blender_equation_cycle0_gval(struct rdp_state* ...
  function STRICTINLINE (line 165) | static STRICTINLINE void blender_equation_cycle0_2(struct rdp_state* wst...
  function STRICTINLINE (line 183) | static STRICTINLINE void blender_equation_cycle0_2_gval(struct rdp_state...
  function STRICTINLINE (line 199) | static STRICTINLINE void blender_equation_cycle1(struct rdp_state* wstat...
  function STRICTINLINE (line 233) | static STRICTINLINE void blender_equation_cycle1_gval(struct rdp_state* ...
  function STRICTINLINE (line 259) | static STRICTINLINE int blender_1cycle(struct rdp_state* wstate, uint32_...
  function STRICTINLINE (line 317) | static STRICTINLINE int blender_2cycle_cycle0(struct rdp_state* wstate, ...
  function STRICTINLINE (line 337) | static STRICTINLINE void blender_2cycle_cycle0_gval(struct rdp_state* ws...
  function STRICTINLINE (line 362) | static STRICTINLINE void blender_2cycle_cycle1(struct rdp_state* wstate,...
  function blender_init_lut (line 396) | static void blender_init_lut(void)
  function rdp_set_fog_color (line 426) | void rdp_set_fog_color(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_blend_color (line 434) | void rdp_set_blend_color(struct rdp_state* wstate, const uint32_t* args)

FILE: src/core/n64video/rdp/combiner.c
  function INLINE (line 6) | static INLINE void set_suba_rgb_input(struct rdp_state* wstate, int32_t ...
  function INLINE (line 25) | static INLINE void set_subb_rgb_input(struct rdp_state* wstate, int32_t ...
  function INLINE (line 44) | static INLINE void set_mul_rgb_input(struct rdp_state* wstate, int32_t *...
  function INLINE (line 72) | static INLINE void set_add_rgb_input(struct rdp_state* wstate, int32_t *...
  function INLINE (line 87) | static INLINE void set_sub_alpha_input(struct rdp_state* wstate, int32_t...
  function INLINE (line 102) | static INLINE void set_mul_alpha_input(struct rdp_state* wstate, int32_t...
  function STRICTINLINE (line 117) | static STRICTINLINE int32_t color_combiner_equation(int32_t a, int32_t b...
  function STRICTINLINE (line 132) | static STRICTINLINE int32_t alpha_combiner_equation(int32_t a, int32_t b...
  function STRICTINLINE (line 142) | static STRICTINLINE int32_t chroma_key_min(struct rdp_state* wstate, str...
  function STRICTINLINE (line 173) | static STRICTINLINE void combiner_1cycle(struct rdp_state* wstate, int a...
  function STRICTINLINE (line 288) | static STRICTINLINE void combiner_2cycle_cycle0(struct rdp_state* wstate...
  function STRICTINLINE (line 349) | static STRICTINLINE void combiner_2cycle_cycle1(struct rdp_state* wstate...
  function combiner_init_lut (line 457) | static void combiner_init_lut(void)
  function combiner_init (line 483) | static void combiner_init(struct rdp_state* wstate)
  function rdp_set_prim_color (line 504) | void rdp_set_prim_color(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_env_color (line 514) | void rdp_set_env_color(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_combine (line 522) | void rdp_set_combine(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_key_gb (line 564) | void rdp_set_key_gb(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_key_r (line 574) | void rdp_set_key_r(struct rdp_state* wstate, const uint32_t* args)

FILE: src/core/n64video/rdp/coverage.c
  function STRICTINLINE (line 15) | static STRICTINLINE uint32_t rightcvghex(uint32_t x, uint32_t fmask)
  function STRICTINLINE (line 23) | static STRICTINLINE uint32_t leftcvghex(uint32_t x, uint32_t fmask)
  function STRICTINLINE (line 32) | static STRICTINLINE void compute_cvg_flip(struct rdp_state* wstate, int3...
  function STRICTINLINE (line 107) | static STRICTINLINE void compute_cvg_noflip(struct rdp_state* wstate, in...
  function STRICTINLINE (line 161) | static STRICTINLINE int finalize_spanalpha(int cvg_dest, uint32_t blend_...
  function STRICTINLINE (line 203) | static STRICTINLINE uint16_t decompress_cvmask_frombyte(uint8_t x)
  function STRICTINLINE (line 209) | static STRICTINLINE void lookup_cvmask_derivatives(uint8_t mask, uint8_t...
  function coverage_init_lut (line 217) | static void coverage_init_lut(void)

FILE: src/core/n64video/rdp/dither.c
  function STRICTINLINE (line 20) | static STRICTINLINE void rgb_dither(int rgb_dither_sel, int* r, int* g, ...
  function STRICTINLINE (line 67) | static STRICTINLINE void rgb_dither_gval(int rgb_dither_sel, int* g, int...
  function STRICTINLINE (line 87) | static STRICTINLINE void get_dither_noise(struct rdp_state* wstate, int ...

FILE: src/core/n64video/rdp/fbuffer.c
  type rdp_state (line 3) | struct rdp_state
  type rdp_state (line 4) | struct rdp_state
  type rdp_state (line 5) | struct rdp_state
  type rdp_state (line 6) | struct rdp_state
  type rdp_state (line 7) | struct rdp_state
  type rdp_state (line 8) | struct rdp_state
  type rdp_state (line 9) | struct rdp_state
  type rdp_state (line 10) | struct rdp_state
  type rdp_state (line 11) | struct rdp_state
  type rdp_state (line 12) | struct rdp_state
  type rdp_state (line 13) | struct rdp_state
  type rdp_state (line 14) | struct rdp_state
  type rdp_state (line 15) | struct rdp_state
  type rdp_state (line 16) | struct rdp_state
  type rdp_state (line 17) | struct rdp_state
  type rdp_state (line 18) | struct rdp_state
  type rdp_state (line 20) | struct rdp_state
  type rdp_state (line 25) | struct rdp_state
  type rdp_state (line 30) | struct rdp_state
  type rdp_state (line 35) | struct rdp_state
  function fbwrite_4 (line 40) | static void fbwrite_4(struct rdp_state* wstate, uint32_t curpixel, uint3...
  function fbwrite_8 (line 55) | static void fbwrite_8(struct rdp_state* wstate, uint32_t curpixel, uint3...
  function fbwrite_16 (line 66) | static void fbwrite_16(struct rdp_state* wstate, uint32_t curpixel, uint...
  function fbwrite_32 (line 102) | static void fbwrite_32(struct rdp_state* wstate, uint32_t curpixel, uint...
  function fbfill_4 (line 118) | static void fbfill_4(struct rdp_state* wstate, uint32_t curpixel, int fl...
  function fbfill_8 (line 128) | static void fbfill_8(struct rdp_state* wstate, uint32_t curpixel, int fl...
  function fbfill_16 (line 135) | static void fbfill_16(struct rdp_state* wstate, uint32_t curpixel, int f...
  function fbfill_32 (line 151) | static void fbfill_32(struct rdp_state* wstate, uint32_t curpixel, int f...
  function fbread_4 (line 160) | static void fbread_4(struct rdp_state* wstate, uint32_t curpixel, uint32...
  function fbread2_4 (line 170) | static void fbread2_4(struct rdp_state* wstate, uint32_t curpixel, uint3...
  function fbread_8 (line 179) | static void fbread_8(struct rdp_state* wstate, uint32_t curpixel, uint32...
  function fbread2_8 (line 193) | static void fbread2_8(struct rdp_state* wstate, uint32_t curpixel, uint3...
  function fbread_16 (line 206) | static void fbread_16(struct rdp_state* wstate, uint32_t curpixel, uint3...
  function fbread2_16 (line 241) | static void fbread2_16(struct rdp_state* wstate, uint32_t curpixel, uint...
  function fbread_32 (line 278) | static void fbread_32(struct rdp_state* wstate, uint32_t curpixel, uint3...
  function INLINE (line 298) | static INLINE void fbread2_32(struct rdp_state* wstate, uint32_t curpixe...
  function rdp_set_color_image (line 319) | void rdp_set_color_image(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_fill_color (line 333) | void rdp_set_fill_color(struct rdp_state* wstate, const uint32_t* args)
  function fb_init (line 338) | static void fb_init(struct rdp_state* wstate)

FILE: src/core/n64video/rdp/rasterizer.c
  function STRICTINLINE (line 3) | static STRICTINLINE int32_t normalize_dzpix(int32_t sum)
  function replicate_for_copy (line 23) | static void replicate_for_copy(struct rdp_state* wstate, uint32_t* outby...
  function fetch_qword_copy (line 63) | static void fetch_qword_copy(struct rdp_state* wstate, uint32_t* hidword...
  function STRICTINLINE (line 125) | static STRICTINLINE void rgba_correct(struct rdp_state* wstate, int offx...
  function STRICTINLINE (line 158) | static STRICTINLINE void z_correct(struct rdp_state* wstate, int offx, i...
  function rejected_hbwrite_1cycle (line 190) | void rejected_hbwrite_1cycle(struct rdp_state* wstate, int cdith, uint32...
  function rejected_hbwrite_2cycle (line 269) | void rejected_hbwrite_2cycle(struct rdp_state* wstate, int cdith, uint32...
  function render_spans_1cycle_complete (line 348) | static void render_spans_1cycle_complete(struct rdp_state* wstate, int s...
  function render_spans_1cycle_notexel1 (line 567) | static void render_spans_1cycle_notexel1(struct rdp_state* wstate, int s...
  function render_spans_1cycle_notex (line 752) | static void render_spans_1cycle_notex(struct rdp_state* wstate, int star...
  function render_spans_2cycle_complete (line 900) | static void render_spans_2cycle_complete(struct rdp_state* wstate, int s...
  function render_spans_2cycle_notexelnext (line 1173) | static void render_spans_2cycle_notexelnext(struct rdp_state* wstate, in...
  function render_spans_2cycle_notexel1 (line 1398) | static void render_spans_2cycle_notexel1(struct rdp_state* wstate, int s...
  function render_spans_2cycle_notex (line 1619) | static void render_spans_2cycle_notex(struct rdp_state* wstate, int star...
  function render_spans_fill (line 1806) | static void render_spans_fill(struct rdp_state* wstate, int start, int e...
  function render_spans_copy (line 1879) | static void render_spans_copy(struct rdp_state* wstate, int start, int e...
  function edgewalker_for_prims (line 2037) | static void edgewalker_for_prims(struct rdp_state* wstate, int32_t* ewdata)
  function rasterizer_init (line 2544) | static void rasterizer_init(struct rdp_state* wstate)
  function rdp_tri_noshade (line 2550) | void rdp_tri_noshade(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_noshade_z (line 2558) | void rdp_tri_noshade_z(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_tex (line 2567) | void rdp_tri_tex(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_tex_z (line 2577) | void rdp_tri_tex_z(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_shade (line 2595) | void rdp_tri_shade(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_shade_z (line 2603) | void rdp_tri_shade_z(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_texshade (line 2612) | void rdp_tri_texshade(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tri_texshade_z (line 2620) | void rdp_tri_texshade_z(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tex_rect (line 2634) | void rdp_tex_rect(struct rdp_state* wstate, const uint32_t* args)
  function rdp_tex_rect_flip (line 2690) | void rdp_tex_rect_flip(struct rdp_state* wstate, const uint32_t* args)
  function rdp_fill_rect (line 2744) | void rdp_fill_rect(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_prim_depth (line 2771) | void rdp_set_prim_depth(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_scissor (line 2779) | void rdp_set_scissor(struct rdp_state* wstate, const uint32_t* args)

FILE: src/core/n64video/rdp/rdram.c
  function rdram_init (line 33) | static void rdram_init(void)
  function STRICTINLINE (line 47) | static STRICTINLINE bool rdram_valid_idx8(uint32_t in)
  function STRICTINLINE (line 52) | static STRICTINLINE bool rdram_valid_idx16(uint32_t in)
  function STRICTINLINE (line 57) | static STRICTINLINE bool rdram_valid_idx32(uint32_t in)
  function STRICTINLINE (line 62) | static STRICTINLINE uint8_t rdram_read_idx8(uint32_t in)
  function STRICTINLINE (line 68) | static STRICTINLINE uint8_t rdram_read_idx8_fast(uint32_t in)
  function STRICTINLINE (line 73) | static STRICTINLINE uint16_t rdram_read_idx16(uint32_t in)
  function STRICTINLINE (line 79) | static STRICTINLINE uint16_t rdram_read_idx16_fast(uint32_t in)
  function STRICTINLINE (line 84) | static STRICTINLINE uint32_t rdram_read_idx32(uint32_t in)
  function STRICTINLINE (line 90) | static STRICTINLINE uint32_t rdram_read_idx32_fast(uint32_t in)
  function STRICTINLINE (line 95) | static STRICTINLINE void rdram_write_idx8(uint32_t in, uint8_t val)
  function STRICTINLINE (line 103) | static STRICTINLINE void rdram_write_idx16(uint32_t in, uint16_t val)
  function STRICTINLINE (line 111) | static STRICTINLINE void rdram_write_idx32(uint32_t in, uint32_t val)
  function STRICTINLINE (line 119) | static STRICTINLINE void rdram_read_pair16(uint16_t* rdst, uint8_t* hdst...
  function STRICTINLINE (line 133) | static STRICTINLINE void rdram_write_pair8(uint32_t in, uint8_t rval, in...
  function STRICTINLINE (line 213) | static STRICTINLINE void rdram_write_pair16(uint32_t in, uint16_t rval, ...
  function STRICTINLINE (line 226) | static STRICTINLINE void rdram_write_pair32(uint32_t in, uint32_t rval, ...
  function rdram_complete_delayed_hbwrites (line 239) | static void rdram_complete_delayed_hbwrites(int delayedhbwidx)

FILE: src/core/n64video/rdp/tcoord.c
  function STRICTINLINE (line 37) | static STRICTINLINE void tcmask_copy(struct tile* tile, int32_t* S, int3...
  function STRICTINLINE (line 83) | static STRICTINLINE void tcshift_cycle(struct tile* tile, int32_t* S, in...
  function STRICTINLINE (line 128) | static STRICTINLINE void tcclamp_cycle(struct tile* tile, int32_t* S, in...
  function STRICTINLINE (line 173) | static STRICTINLINE void tcclamp_cycle_light(struct tile* tile, int32_t*...
  function STRICTINLINE (line 201) | static STRICTINLINE void tcshift_copy(struct tile* tile, int32_t* S, int...
  function STRICTINLINE (line 236) | static STRICTINLINE void tclod_4x17_to_15(int32_t scurr, int32_t snext, ...
  function STRICTINLINE (line 256) | static STRICTINLINE void tclod_tcclamp(int32_t* sss, int32_t* sst)
  function STRICTINLINE (line 309) | static STRICTINLINE void lodfrac_lodtile_signals(struct rdp_state* wstat...
  function STRICTINLINE (line 394) | static STRICTINLINE void tclod_2cycle(struct rdp_state* wstate, int32_t*...
  function STRICTINLINE (line 471) | static STRICTINLINE void tclod_2cycle_next(struct rdp_state* wstate, int...
  function STRICTINLINE (line 558) | static STRICTINLINE void tclod_2cycle_notexel1(struct rdp_state* wstate,...
  function STRICTINLINE (line 605) | static STRICTINLINE void tclod_1cycle_current(struct rdp_state* wstate, ...
  function STRICTINLINE (line 688) | static STRICTINLINE void tclod_1cycle_current_simple(struct rdp_state* w...
  function STRICTINLINE (line 764) | static STRICTINLINE void tclod_1cycle_next(struct rdp_state* wstate, int...
  function STRICTINLINE (line 898) | static STRICTINLINE void tclod_copy(struct rdp_state* wstate, int32_t* s...
  function STRICTINLINE (line 965) | static STRICTINLINE void tc_pipeline_copy(struct tile* tile, int32_t* ss...
  function STRICTINLINE (line 991) | static STRICTINLINE void tc_pipeline_load(struct tile* tile, int32_t* ss...
  function tcdiv_nopersp (line 1018) | static void tcdiv_nopersp(int32_t ss, int32_t st, int32_t sw, int32_t* s...
  function tcdiv_persp (line 1027) | static void tcdiv_persp(int32_t ss, int32_t st, int32_t sw, int32_t* sss...
  function tcoord_init_lut (line 1105) | static void tcoord_init_lut(void)
  function tcoord_init (line 1153) | static void tcoord_init(struct rdp_state* wstate)

FILE: src/core/n64video/rdp/tex.c
  function STRICTINLINE (line 3) | static STRICTINLINE void tcmask(struct tile* tile, int32_t* S, int32_t* T)
  function STRICTINLINE (line 34) | static STRICTINLINE void tcmask_coupled(struct tile* tile, int32_t* S, i...
  function INLINE (line 102) | static INLINE void calculate_clamp_diffs(struct tile* t)
  function INLINE (line 109) | static INLINE void calculate_tile_derivs(struct tile* t)
  function STRICTINLINE (line 130) | static STRICTINLINE void get_texel1_1cycle(struct rdp_state* wstate, int...
  function STRICTINLINE (line 160) | static STRICTINLINE void texture_pipeline_cycle(struct rdp_state* wstate...
  function loading_pipeline (line 487) | static void loading_pipeline(struct rdp_state* wstate, int start, int en...
  function edgewalker_for_loads (line 738) | static void edgewalker_for_loads(struct rdp_state* wstate, int32_t* lewd...
  function rdp_set_tile_size (line 896) | void rdp_set_tile_size(struct rdp_state* wstate, const uint32_t* args)
  function rdp_load_block (line 907) | void rdp_load_block(struct rdp_state* wstate, const uint32_t* args)
  function tile_tlut_common_cs_decoder (line 939) | static void tile_tlut_common_cs_decoder(struct rdp_state* wstate, const ...
  function rdp_load_tlut (line 969) | void rdp_load_tlut(struct rdp_state* wstate, const uint32_t* args)
  function rdp_load_tile (line 974) | void rdp_load_tile(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_tile (line 979) | void rdp_set_tile(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_texture_image (line 1000) | void rdp_set_texture_image(struct rdp_state* wstate, const uint32_t* args)
  function rdp_set_convert (line 1011) | void rdp_set_convert(struct rdp_state* wstate, const uint32_t* args)
  function tex_init_lut (line 1025) | static void tex_init_lut(void)
  function tex_init (line 1031) | static void tex_init(struct rdp_state* wstate)

FILE: src/core/n64video/rdp/tmem.c
  function sort_tmem_idx (line 13) | static void sort_tmem_idx(uint32_t *idx, uint32_t idxa, uint32_t idxb, u...
  function sort_tmem_shorts_lowhalf (line 27) | static void sort_tmem_shorts_lowhalf(uint32_t* bindshort, uint32_t short...
  function compute_color_index (line 46) | static void compute_color_index(struct rdp_state* wstate, uint32_t* cidx...
  function INLINE (line 63) | static INLINE void fetch_texel(struct rdp_state* wstate, struct color *c...
  function INLINE (line 417) | static INLINE void fetch_texel_quadro(struct rdp_state* wstate, struct c...
  function INLINE (line 1364) | static INLINE void fetch_texel_entlut_quadro(struct rdp_state* wstate, s...
  function INLINE (line 1678) | static INLINE void fetch_texel_entlut_quadro_nearest(struct rdp_state* w...
  function get_tmem_idx (line 1865) | static void get_tmem_idx(struct rdp_state* wstate, int s, int t, uint32_...
  function read_tmem_copy (line 1906) | static void read_tmem_copy(struct rdp_state* wstate, int s, int s1, int ...
  function tmem_init_lut (line 2059) | static void tmem_init_lut(void)

FILE: src/core/n64video/rdp/zbuffer.c
  function STRICTINLINE (line 23) | static STRICTINLINE uint32_t z_decompress(uint32_t zb)
  function INLINE (line 28) | static INLINE void z_build_com_table(void)
  function STRICTINLINE (line 191) | static STRICTINLINE void z_store(uint32_t zcurpixel, uint32_t z, int dzp...
  function STRICTINLINE (line 199) | static STRICTINLINE uint32_t dz_decompress(uint32_t dz_compressed)
  function STRICTINLINE (line 205) | static STRICTINLINE uint32_t dz_compress(uint32_t value)
  function STRICTINLINE (line 219) | static STRICTINLINE uint32_t z_compare(struct rdp_state* wstate, uint32_...
  function rdp_set_mask_image (line 377) | void rdp_set_mask_image(struct rdp_state* wstate, const uint32_t* args)
  function z_init_lut (line 382) | void z_init_lut(void)

FILE: src/core/n64video/vi.c
  type vi_type (line 19) | enum vi_type
  type vi_aa (line 27) | enum vi_aa
  type vi_reg_ctrl (line 35) | struct vi_reg_ctrl
  type n64video_pixel (line 50) | struct n64video_pixel
  type vi_reg_ctrl (line 50) | struct vi_reg_ctrl
  type n64video_pixel (line 82) | struct n64video_pixel
  type vi_reg_ctrl (line 88) | struct vi_reg_ctrl
  function vi_init (line 95) | static void vi_init(void)
  function vi_process_full_parallel (line 110) | static void vi_process_full_parallel(uint32_t worker_id)
  function vi_process_full (line 321) | static bool vi_process_full(struct n64video_frame_buffer* fb)
  function vi_process_fast_parallel (line 487) | static void vi_process_fast_parallel(uint32_t worker_id)
  function vi_process_fast (line 565) | static bool vi_process_fast(struct n64video_frame_buffer* fb)
  function vi_set_zbuffer_address (line 615) | void vi_set_zbuffer_address(uint32_t address)
  function n64video_update_screen (line 620) | void n64video_update_screen(struct n64video_frame_buffer* fb)
  function vi_close (line 751) | static void vi_close(void)

FILE: src/core/n64video/vi/divot.c
  function STRICTINLINE (line 3) | static STRICTINLINE void divot_filter(struct n64video_pixel* final, stru...

FILE: src/core/n64video/vi/fetch.c
  function vi_fetch_filter16 (line 3) | static void vi_fetch_filter16(struct n64video_pixel* res, uint32_t fboff...
  function vi_fetch_filter32 (line 41) | static void vi_fetch_filter32(struct n64video_pixel* res, uint32_t fboff...

FILE: src/core/n64video/vi/gamma.c
  function vi_integer_sqrt (line 6) | static uint32_t vi_integer_sqrt(uint32_t a)
  function STRICTINLINE (line 26) | static STRICTINLINE void gamma_filters(struct n64video_pixel* pixel, boo...
  function vi_gamma_init (line 63) | void vi_gamma_init(void)

FILE: src/core/n64video/vi/lerp.c
  function STRICTINLINE (line 3) | static STRICTINLINE void vi_vl_lerp(struct n64video_pixel* up, struct n6...

FILE: src/core/n64video/vi/restore.c
  function STRICTINLINE (line 5) | static STRICTINLINE void restore_filter16(int* r, int* g, int* b, uint32...
  function STRICTINLINE (line 76) | static STRICTINLINE void restore_filter32(int* r, int* g, int* b, uint32...
  function vi_restore_init (line 146) | void vi_restore_init()

FILE: src/core/n64video/vi/video.c
  function STRICTINLINE (line 3) | static STRICTINLINE void video_max_optimized(uint32_t* pixels, uint32_t*...
  function STRICTINLINE (line 46) | static STRICTINLINE void video_filter16(int* endr, int* endg, int* endb,...
  function STRICTINLINE (line 119) | static STRICTINLINE void video_filter32(int* endr, int* endg, int* endb,...

FILE: src/core/parallel.cpp
  class Parallel (line 13) | class Parallel
    method Parallel (line 16) | Parallel(std::uint32_t num_workers)
    method begin (line 54) | void begin()
    method run (line 70) | void run(std::function<void(std::uint32_t)>&& task)
    method num_workers (line 88) | std::uint32_t num_workers()
    method create_worker (line 104) | virtual void create_worker(std::uint32_t worker_id)
    method start_work (line 109) | virtual void start_work()
    method do_work (line 120) | virtual void do_work(std::uint32_t worker_id)
    method wait (line 145) | virtual void wait()
    method Parallel (line 155) | Parallel(const Parallel&) = delete;
  class ParallelBusy (line 159) | class ParallelBusy : public Parallel
    method ParallelBusy (line 162) | ParallelBusy(std::uint32_t num_workers) : Parallel(num_workers)
    method create_worker (line 166) | virtual void create_worker(std::uint32_t worker_id)
    method start_work (line 171) | virtual void start_work()
    method do_work (line 177) | virtual void do_work(std::uint32_t worker_id)
    method wait (line 195) | virtual void wait()
  function parallel_init (line 206) | void parallel_init(uint32_t num, bool busy)
  function parallel_run (line 217) | void parallel_run(void task(uint32_t))
  function parallel_num_workers (line 222) | uint32_t parallel_num_workers()
  function parallel_close (line 227) | void parallel_close()

FILE: src/output/gl_core_3_3.c
  function Load_Version_3_3 (line 365) | static int Load_Version_3_3(void)
  type ogl_StrToExtMap (line 1404) | typedef struct ogl_StrToExtMap_s
  function ogl_StrToExtMap (line 1417) | static ogl_StrToExtMap *FindExtEntry(const char *extensionName)
  function ClearExtensionVars (line 1430) | static void ClearExtensionVars(void)
  function LoadExtByName (line 1435) | static void LoadExtByName(const char *extensionName)
  function ProcExtsFromExtList (line 1461) | static void ProcExtsFromExtList(void)
  function ogl_LoadFunctions (line 1474) | int ogl_LoadFunctions()
  function GetGLVersion (line 1496) | static void GetGLVersion(void)
  function ogl_GetMajorVersion (line 1502) | int ogl_GetMajorVersion(void)
  function ogl_GetMinorVersion (line 1509) | int ogl_GetMinorVersion(void)
  function ogl_IsVersionGEQ (line 1516) | int ogl_IsVersionGEQ(int majorVersion, int minorVersion)

FILE: src/output/gl_core_3_3.h
  type __int32 (line 104) | typedef __int32 int32_t;
  type __int64 (line 105) | typedef __int64 int64_t;
  type GLenum (line 112) | typedef unsigned int GLenum;
  type GLboolean (line 113) | typedef unsigned char GLboolean;
  type GLbitfield (line 114) | typedef unsigned int GLbitfield;
  type GLvoid (line 115) | typedef void GLvoid;
  type GLbyte (line 116) | typedef signed char GLbyte;
  type GLshort (line 117) | typedef short GLshort;
  type GLint (line 118) | typedef int GLint;
  type GLubyte (line 119) | typedef unsigned char GLubyte;
  type GLushort (line 120) | typedef unsigned short GLushort;
  type GLuint (line 121) | typedef unsigned int GLuint;
  type GLsizei (line 122) | typedef int GLsizei;
  type GLfloat (line 123) | typedef float GLfloat;
  type GLclampf (line 124) | typedef float GLclampf;
  type GLdouble (line 125) | typedef double GLdouble;
  type GLclampd (line 126) | typedef double GLclampd;
  type GLchar (line 127) | typedef char GLchar;
  type GLcharARB (line 128) | typedef char GLcharARB;
  type GLhandleARB (line 132) | typedef unsigned int GLhandleARB;
  type GLhalfARB (line 134) | typedef unsigned short GLhalfARB;
  type GLhalf (line 135) | typedef unsigned short GLhalf;
  type GLint (line 136) | typedef GLint GLfixed;
  type GLintptr (line 137) | typedef ptrdiff_t GLintptr;
  type GLsizeiptr (line 138) | typedef ptrdiff_t GLsizeiptr;
  type GLint64 (line 139) | typedef int64_t GLint64;
  type GLuint64 (line 140) | typedef uint64_t GLuint64;
  type GLintptrARB (line 141) | typedef ptrdiff_t GLintptrARB;
  type GLsizeiptrARB (line 142) | typedef ptrdiff_t GLsizeiptrARB;
  type GLint64EXT (line 143) | typedef int64_t GLint64EXT;
  type GLuint64EXT (line 144) | typedef uint64_t GLuint64EXT;
  type __GLsync (line 145) | struct __GLsync
  type _cl_context (line 146) | struct _cl_context
  type _cl_event (line 147) | struct _cl_event
  type GLhalfNV (line 151) | typedef unsigned short GLhalfNV;
  type GLintptr (line 152) | typedef GLintptr GLvdpauSurfaceNV;
  type ogl_LoadStatus (line 1686) | enum ogl_LoadStatus

FILE: src/output/screen.h
  type n64video_config (line 8) | struct n64video_config

FILE: src/output/vdac.c
  function gl_check_errors (line 38) | static void gl_check_errors(void)
  function gl_fbo_create (line 82) | static void gl_fbo_create(uint32_t width, uint32_t height)
  function gl_fbo_delete (line 107) | static void gl_fbo_delete(void)
  function gl_shader_load_file (line 120) | static bool gl_shader_load_file(GLuint shader, const char* path)
  function GLuint (line 168) | static GLuint gl_shader_compile(GLenum type, const GLchar* source, const...
  function GLuint (line 191) | static GLuint gl_shader_link(GLuint vert, GLuint frag)
  function vdac_init (line 213) | void vdac_init(struct n64video_config* config)
  function vdac_read (line 300) | void vdac_read(struct n64video_frame_buffer* fb, bool alpha)
  function vdac_write (line 351) | void vdac_write(struct n64video_frame_buffer* fb)
  function vdac_sync (line 387) | void vdac_sync(bool valid)
  function vdac_close (line 489) | void vdac_close(void)

FILE: src/output/vdac.h
  type n64video_config (line 8) | struct n64video_config
  type n64video_frame_buffer (line 9) | struct n64video_frame_buffer
  type n64video_frame_buffer (line 10) | struct n64video_frame_buffer

FILE: src/plugin/mupen64plus/api/m64p_common.h
  type m64p_error (line 41) | typedef m64p_error (*ptr_PluginGetVersion)(m64p_plugin_type *, int *, in...
  type m64p_error (line 50) | typedef m64p_error (*ptr_CoreGetAPIVersions)(int *, int *, int *, int *);
  type m64p_error (line 70) | typedef m64p_error (*ptr_PluginStartup)(m64p_dynlib_handle, void *, void...
  type m64p_error (line 80) | typedef m64p_error (*ptr_PluginShutdown)(void);

FILE: src/plugin/mupen64plus/api/m64p_config.h
  type m64p_error (line 42) | typedef m64p_error (*ptr_ConfigListSections)(void *, void (*)(void *, co...
  type m64p_error (line 53) | typedef m64p_error (*ptr_ConfigOpenSection)(const char *, m64p_handle *);
  type m64p_error (line 63) | typedef m64p_error (*ptr_ConfigListParameters)(m64p_handle, void *, void...
  type m64p_error (line 72) | typedef m64p_error (*ptr_ConfigSaveFile)(void);
  type m64p_error (line 81) | typedef m64p_error (*ptr_ConfigSaveSection)(const char *);
  type m64p_error (line 99) | typedef m64p_error (*ptr_ConfigDeleteSection)(const char *SectionName);
  type m64p_error (line 108) | typedef m64p_error (*ptr_ConfigRevertChanges)(const char *SectionName);
  type m64p_error (line 118) | typedef m64p_error (*ptr_ConfigSetParameter)(m64p_handle, const char *, ...
  type m64p_error (line 128) | typedef m64p_error (*ptr_ConfigSetParameterHelp)(m64p_handle, const char...
  type m64p_error (line 137) | typedef m64p_error (*ptr_ConfigGetParameter)(m64p_handle, const char *, ...
  type m64p_error (line 146) | typedef m64p_error (*ptr_ConfigGetParameterType)(m64p_handle, const char...
  type m64p_error (line 170) | typedef m64p_error (*ptr_ConfigSetDefaultInt)(m64p_handle, const char *,...
  type m64p_error (line 171) | typedef m64p_error (*ptr_ConfigSetDefaultFloat)(m64p_handle, const char ...
  type m64p_error (line 172) | typedef m64p_error (*ptr_ConfigSetDefaultBool)(m64p_handle, const char *...
  type m64p_error (line 173) | typedef m64p_error (*ptr_ConfigSetDefaultString)(m64p_handle, const char...
  type m64p_error (line 252) | typedef m64p_error (*ptr_ConfigExternalOpen)(const char *, m64p_handle *);
  type m64p_error (line 261) | typedef m64p_error (*ptr_ConfigExternalClose)(m64p_handle);
  type m64p_error (line 271) | typedef m64p_error (*ptr_ConfigExternalGetParameter)(m64p_handle, const ...

FILE: src/plugin/mupen64plus/api/m64p_plugin.h
  type RSP_INFO (line 41) | typedef struct {
  type GFX_INFO (line 74) | typedef struct {
  type AUDIO_INFO (line 122) | typedef struct {
  type CONTROL (line 139) | typedef struct {
  type BUTTONS (line 145) | typedef union {
  type CONTROL_INFO (line 171) | typedef struct {
  type FrameBufferInfo (line 213) | typedef struct

FILE: src/plugin/mupen64plus/api/m64p_types.h
  type HMODULE (line 41) | typedef HMODULE m64p_dynlib_handle;
  type m64p_type (line 65) | typedef enum {
  type m64p_msg_level (line 72) | typedef enum {
  type m64p_error (line 80) | typedef enum {
  type m64p_core_caps (line 98) | typedef enum {
  type m64p_plugin_type (line 104) | typedef enum {
  type m64p_emu_state (line 113) | typedef enum {
  type m64p_video_mode (line 119) | typedef enum {
  type m64p_video_flags (line 125) | typedef enum {
  type m64p_core_param (line 129) | typedef enum {
  type m64p_command (line 143) | typedef enum {
  type m64p_cheat_code (line 168) | typedef struct {
  type m64p_media_loader (line 173) | typedef struct {
  type m64p_system_type (line 212) | typedef enum
  type m64p_rom_header (line 219) | typedef struct
  type m64p_rom_settings (line 238) | typedef struct
  type m64p_dbg_state (line 255) | typedef enum {
  type m64p_dbg_runstate (line 263) | typedef enum {
  type m64p_dbg_mem_info (line 269) | typedef enum {
  type m64p_dbg_mem_type (line 279) | typedef enum {
  type m64p_dbg_mem_flags (line 301) | typedef enum {
  type m64p_dbg_memptr_type (line 308) | typedef enum {
  type m64p_dbg_cpu_data (line 317) | typedef enum {
  type m64p_dbg_bkp_command (line 329) | typedef enum {
  type m64p_dbg_bkp_flags (line 344) | typedef enum {
  type m64p_breakpoint (line 357) | typedef struct {
  type m64p_2d_size (line 367) | typedef struct {
  type m64p_GLattr (line 372) | typedef enum {
  type m64p_GLContextType (line 388) | typedef enum {
  type m64p_video_extension_functions (line 394) | typedef struct {

FILE: src/plugin/mupen64plus/api/m64p_vidext.h
  type m64p_error (line 42) | typedef m64p_error (*ptr_VidExt_Init)(void);
  type m64p_error (line 54) | typedef m64p_error (*ptr_VidExt_Quit)(void);
  type m64p_error (line 65) | typedef m64p_error (*ptr_VidExt_ListFullscreenModes)(m64p_2d_size *, int...
  type m64p_error (line 76) | typedef m64p_error (*ptr_VidExt_SetVideoMode)(int, int, int, m64p_video_...
  type m64p_error (line 85) | typedef m64p_error (*ptr_VidExt_ResizeWindow)(int, int);
  type m64p_error (line 94) | typedef m64p_error (*ptr_VidExt_SetCaption)(const char *);
  type m64p_error (line 103) | typedef m64p_error (*ptr_VidExt_ToggleFullScreen)(void);
  type m64p_function (line 114) | typedef m64p_function (*ptr_VidExt_GL_GetProcAddress)(const char *);
  type m64p_error (line 124) | typedef m64p_error (*ptr_VidExt_GL_SetAttribute)(m64p_GLattr, int);
  type m64p_error (line 134) | typedef m64p_error (*ptr_VidExt_GL_GetAttribute)(m64p_GLattr, int *);
  type m64p_error (line 144) | typedef m64p_error (*ptr_VidExt_GL_SwapBuffers)(void);

FILE: src/plugin/mupen64plus/gfx_m64p.c
  type n64video_config (line 70) | struct n64video_config
  function CALL (line 86) | CALL PluginStartup(m64p_dynlib_handle _CoreLibHandle, void *Context,
  function CALL (line 135) | CALL PluginShutdown(void)
  function CALL (line 149) | CALL PluginGetVersion(m64p_plugin_type *PluginType, int *PluginVersion, ...
  function CALL (line 175) | CALL InitiateGFX (GFX_INFO Gfx_Info)
  function CALL (line 182) | CALL MoveScreen (int xpos, int ypos)
  function CALL (line 188) | CALL ProcessDList(void)
  function CALL (line 196) | CALL ProcessRDPList(void)
  function CALL (line 201) | CALL RomOpen (void)
  function CALL (line 242) | CALL RomClosed (void)
  function CALL (line 248) | CALL ShowCFB (void)
  function CALL (line 252) | CALL UpdateScreen (void)
  function CALL (line 264) | CALL ViStatusChanged (void)
  function CALL (line 268) | CALL ViWidthChanged (void)
  function CALL (line 272) | CALL ChangeWindow(void)
  function CALL (line 277) | CALL ReadScreen2(void *dest, int *width, int *height, int front)
  function CALL (line 289) | CALL SetRenderingCallback(void (*callback)(int))
  function CALL (line 294) | CALL ResizeVideoOutput(int width, int height)
  function CALL (line 300) | CALL FBWrite(unsigned int addr, unsigned int size)
  function CALL (line 306) | CALL FBRead(unsigned int addr)
  function CALL (line 311) | CALL FBGetFrameBufferInfo(void *pinfo)

FILE: src/plugin/mupen64plus/msg.c
  function msg_error (line 11) | void msg_error(const char * err, ...)
  function msg_warning (line 28) | void msg_warning(const char* err, ...)
  function msg_debug (line 44) | void msg_debug(const char* err, ...)

FILE: src/plugin/mupen64plus/screen.c
  function screen_init (line 35) | void screen_init(struct n64video_config* config)
  function screen_adjust (line 68) | void screen_adjust(int32_t width_out, int32_t height_out, int32_t* width...
  function screen_update (line 79) | void screen_update(void)
  function screen_toggle_fullscreen (line 85) | void screen_toggle_fullscreen(void)
  function screen_close (line 90) | void screen_close(void)

FILE: src/plugin/zilmar/config.c
  type n64video_config (line 42) | struct n64video_config
  function config_dialog_update_multithread (line 60) | static void config_dialog_update_multithread(void)
  function config_dialog_update_vi_mode (line 68) | static void config_dialog_update_vi_mode(void)
  function config_dialog_fill_combo (line 74) | static void config_dialog_fill_combo(HWND dialog, char** entries, size_t...
  function INT_PTR (line 83) | INT_PTR CALLBACK config_dialog_proc(HWND hwnd, UINT iMessage, WPARAM wPa...
  function config_handle (line 192) | static void config_handle(const char* key, const char* value, const char...
  function config_init (line 226) | void config_init(HINSTANCE hInst)
  function config_dialog (line 240) | void config_dialog(HWND hParent)
  type n64video_config (line 245) | struct n64video_config
  function config_load (line 250) | bool config_load()
  function config_write_section (line 293) | static void config_write_section(FILE* fp, const char* section)
  function config_write_uint32 (line 298) | static void config_write_uint32(FILE* fp, const char* key, uint32_t value)
  function config_write_int32 (line 303) | static void config_write_int32(FILE* fp, const char* key, int32_t value)
  function config_save (line 308) | bool config_save(void)
  function config_update (line 339) | void config_update(void)

FILE: src/plugin/zilmar/config.h
  type n64video_config (line 9) | struct n64video_config

FILE: src/plugin/zilmar/gfx_1.3.c
  function is_valid_ptr (line 20) | static bool is_valid_ptr(void *ptr, uint32_t bytes)
  function filter_char (line 47) | static char filter_char(char c)
  function mi_intr (line 100) | static void mi_intr(void)
  function write_screenshot (line 106) | static void write_screenshot(char* path)
  function BOOL (line 156) | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReser...
  function CALL (line 167) | CALL CaptureScreen(char* directory)
  function CALL (line 180) | CALL ChangeWindow(void)
  function CALL (line 185) | CALL CloseDLL(void)
  function CALL (line 189) | CALL DllAbout(HWND hParent)
  function CALL (line 203) | CALL DllConfig(HWND hParent)
  function CALL (line 208) | CALL ReadScreen(void **dest, long *width, long *height)
  function CALL (line 215) | CALL DrawScreen(void)
  function CALL (line 219) | CALL GetDllInfo(PLUGIN_INFO* PluginInfo)
  function CALL (line 229) | CALL InitiateGFX(GFX_INFO Gfx_Info)
  function CALL (line 236) | CALL MoveScreen(int xpos, int ypos)
  function CALL (line 242) | CALL ProcessDList(void)
  function CALL (line 250) | CALL ProcessRDPList(void)
  function CALL (line 255) | CALL RomClosed(void)
  function CALL (line 261) | CALL RomOpen(void)
  function CALL (line 287) | CALL ShowCFB(void)
  function CALL (line 291) | CALL UpdateScreen(void)
  function CALL (line 309) | CALL ViStatusChanged(void)
  function CALL (line 313) | CALL ViWidthChanged(void)
  function CALL (line 317) | CALL FBWrite(DWORD addr, DWORD val)
  function CALL (line 323) | CALL FBWList(FrameBufferModifyEntry *plist, DWORD size)
  function CALL (line 329) | CALL FBRead(DWORD addr)
  function CALL (line 334) | CALL FBGetFrameBufferInfo(void *pinfo)

FILE: src/plugin/zilmar/gfx_1.3.h
  type PLUGIN_INFO (line 35) | typedef struct {
  type GFX_INFO (line 47) | typedef struct {
  type FrameBufferModifyEntry (line 283) | typedef struct

FILE: src/plugin/zilmar/msg.c
  function msg_error (line 11) | void msg_error(const char * err, ...)
  function msg_warning (line 22) | void msg_warning(const char* err, ...)
  function msg_debug (line 32) | void msg_debug(const char* err, ...)

FILE: src/plugin/zilmar/screen.c
  function win32_client_resize (line 34) | void win32_client_resize(HWND hWnd, HWND hStatus, int32_t nWidth, int32_...
  function TestPointer (line 58) | static int TestPointer(const PROC pTest)
  function funcptr (line 69) | funcptr IntGetProcAddress(const char* name)
  function screen_init (line 83) | void screen_init(struct n64video_config* config)
  function screen_adjust (line 164) | void screen_adjust(int32_t width_out, int32_t height_out, int32_t* width...
  function screen_update (line 224) | void screen_update(void)
  function screen_toggle_fullscreen (line 233) | void screen_toggle_fullscreen(void)
  function screen_close (line 298) | void screen_close(void)

FILE: src/plugin/zilmar/wgl_ext.c
  function Load_EXT_swap_control (line 15) | static int Load_EXT_swap_control(void)
  function Load_ARB_create_context (line 27) | static int Load_ARB_create_context(void)
  type wgl_StrToExtMap (line 39) | typedef struct wgl_StrToExtMap_s
  function wgl_StrToExtMap (line 54) | static wgl_StrToExtMap *FindExtEntry(const char *extensionName)
  function ClearExtensionVars (line 67) | static void ClearExtensionVars(void)
  function LoadExtByName (line 75) | static void LoadExtByName(const char *extensionName)
  function ProcExtsFromExtString (line 101) | static void ProcExtsFromExtString(const char *strExtList)
  function wgl_LoadFunctions (line 135) | int wgl_LoadFunctions(HDC hdc)

FILE: src/plugin/zilmar/wgl_ext.h
  type GLenum (line 26) | typedef unsigned int GLenum;
  type GLboolean (line 27) | typedef unsigned char GLboolean;
  type GLbitfield (line 28) | typedef unsigned int GLbitfield;
  type GLbyte (line 29) | typedef signed char GLbyte;
  type GLshort (line 30) | typedef short GLshort;
  type GLint (line 31) | typedef int GLint;
  type GLsizei (line 32) | typedef int GLsizei;
  type GLubyte (line 33) | typedef unsigned char GLubyte;
  type GLushort (line 34) | typedef unsigned short GLushort;
  type GLuint (line 35) | typedef unsigned int GLuint;
  type GLfloat (line 36) | typedef float GLfloat;
  type GLclampf (line 37) | typedef float GLclampf;
  type GLdouble (line 38) | typedef double GLdouble;
  type GLclampd (line 39) | typedef double GLclampd;
  type _GPU_DEVICE (line 52) | struct _GPU_DEVICE {
  type _GPU_DEVICE (line 65) | struct _GPU_DEVICE
  type wgl_LoadStatus (line 103) | enum wgl_LoadStatus
Condensed preview — 69 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (816K chars).
[
  {
    "path": ".github/workflows/build.yml",
    "chars": 8071,
    "preview": "name: Angrylion RDP Plus\n\non:\n  push:\n    paths-ignore:\n      - '**/*.md'\n      - '.{gitattributes,gitignore,travis.yml}"
  },
  {
    "path": ".gitignore",
    "chars": 113,
    "preview": "# Visual Studio cache/options directory\n.vs/\n\n# Visual C++ cache files\n*.aps\n\nsrc/core/version.h\nprivate/\nbuild/\n"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 4658,
    "preview": "cmake_minimum_required(VERSION 3.10)\n\noption(BUILD_MUPEN64PLUS \"Enables build of mupen64plus version\" ON)\noption(BUILD_P"
  },
  {
    "path": "CREDITS.txt",
    "chars": 452,
    "preview": "This little RDP plugin was initially based on MESS 0.128 source code.\r\nMany thanks to Ville Linde, MooglyGuy and other p"
  },
  {
    "path": "MAME License.txt",
    "chars": 5715,
    "preview": "MAME Legal Information\r\nLicense\r\n\r\nRedistribution and use of the MAME code or any derivative works are permitted provide"
  },
  {
    "path": "README.md",
    "chars": 2134,
    "preview": "# Angrylion RDP Plus\n\nThis is a conservative fork of angrylion's RDP plugin that aims to improve performance and add new"
  },
  {
    "path": "git-version.cmake",
    "chars": 1581,
    "preview": "set(GIT_BRANCH \"unknown\")\nset(GIT_COMMIT_DATE \"unknown\")\nset(GIT_COMMIT_HASH \"unknown\")\nset(GIT_TAG \"unknown\")\n\nfind_pac"
  },
  {
    "path": "make_version.py",
    "chars": 1231,
    "preview": "#!/usr/bin/env python3\n\nimport sys, os, subprocess\n\ndef system(cmd, default):\n    args = cmd.split()\n    try:\n        re"
  },
  {
    "path": "msvc/.gitignore",
    "chars": 3833,
    "preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User"
  },
  {
    "path": "msvc/angrylion-plus.sln",
    "chars": 4095,
    "preview": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.29806."
  },
  {
    "path": "msvc/core.vcxproj",
    "chars": 21078,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc/core.vcxproj.filters",
    "chars": 4159,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc/output.vcxproj",
    "chars": 11498,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microso"
  },
  {
    "path": "msvc/output.vcxproj.filters",
    "chars": 1302,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc/plugin-mupen64plus.vcxproj",
    "chars": 13264,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc/plugin-mupen64plus.vcxproj.filters",
    "chars": 1867,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "msvc/plugin-zilmar.vcxproj",
    "chars": 13239,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "msvc/plugin-zilmar.vcxproj.filters",
    "chars": 1777,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "src/core/common.h",
    "chars": 752,
    "preview": "#pragma once\n\n// endianness\n#define LSB_FIRST 1 \n#ifdef LSB_FIRST\n    #define BYTE_ADDR_XOR       3\n    #define WORD_ADD"
  },
  {
    "path": "src/core/msg.h",
    "chars": 131,
    "preview": "#pragma once\n\nvoid msg_error(const char * err, ...);\nvoid msg_warning(const char* err, ...);\nvoid msg_debug(const char* "
  },
  {
    "path": "src/core/n64video/rdp/blender.c",
    "chars": 12349,
    "preview": "#ifdef N64VIDEO_C\n\nstatic int32_t blenderone = 0xff;\n\nstatic uint8_t bldiv_hwaccurate_table[0x8000];\n\nstatic INLINE void"
  },
  {
    "path": "src/core/n64video/rdp/combiner.c",
    "chars": 25887,
    "preview": "#ifdef N64VIDEO_C\n\nstatic uint32_t special_9bit_clamptable[512];\nstatic int32_t special_9bit_exttable[512];\n\nstatic INLI"
  },
  {
    "path": "src/core/n64video/rdp/coverage.c",
    "chars": 6654,
    "preview": "#ifdef N64VIDEO_C\n\n#define CVG_CLAMP               0\n#define CVG_WRAP                1\n#define CVG_ZAP                 2"
  },
  {
    "path": "src/core/n64video/rdp/dither.c",
    "chars": 4112,
    "preview": "#ifdef N64VIDEO_C\n\nstatic const uint8_t bayer_matrix[16] =\n{\n     0,  4,  1, 5,\n     4,  0,  5, 1,\n     3,  7,  2, 6,\n  "
  },
  {
    "path": "src/core/n64video/rdp/fbuffer.c",
    "chars": 11748,
    "preview": "#ifdef N64VIDEO_C\n\nstatic void fbwrite_4(struct rdp_state* wstate, uint32_t curpixel, uint32_t r, uint32_t g, uint32_t b"
  },
  {
    "path": "src/core/n64video/rdp/rasterizer.c",
    "chars": 84891,
    "preview": "#ifdef N64VIDEO_C\n\nstatic STRICTINLINE int32_t normalize_dzpix(int32_t sum)\n{\n    int count;\n    if (sum & 0xc000)\n     "
  },
  {
    "path": "src/core/n64video/rdp/rdram.c",
    "chars": 6732,
    "preview": "#ifdef N64VIDEO_C\n\n//\n// rdram.c: RDRAM memory interface\n//\n\n#define RDRAM_MASK 0x00ffffff\n\n#define HB_CLEAN 4\n\n// macro"
  },
  {
    "path": "src/core/n64video/rdp/tcoord.c",
    "chars": 30258,
    "preview": "#ifdef N64VIDEO_C\n\nstatic const int32_t norm_point_table[64] = {\n    0x4000, 0x3f04, 0x3e10, 0x3d22, 0x3c3c, 0x3b5d, 0x3"
  },
  {
    "path": "src/core/n64video/rdp/tex.c",
    "chars": 30907,
    "preview": "#ifdef N64VIDEO_C\n\nstatic STRICTINLINE void tcmask(struct tile* tile, int32_t* S, int32_t* T)\n{\n    int32_t wrap;\n\n\n\n   "
  },
  {
    "path": "src/core/n64video/rdp/tmem.c",
    "chars": 61153,
    "preview": "#ifdef N64VIDEO_C\n\n#define tmem16 ((uint16_t*)wstate->tmem)\n#define tc16   ((uint16_t*)wstate->tmem)\n#define tlut   ((ui"
  },
  {
    "path": "src/core/n64video/rdp/zbuffer.c",
    "chars": 8989,
    "preview": "#ifdef N64VIDEO_C\n\n#define ZMODE_OPAQUE            0\n#define ZMODE_INTERPENETRATING  1\n#define ZMODE_TRANSPARENT       2"
  },
  {
    "path": "src/core/n64video/rdp.c",
    "chars": 23969,
    "preview": "#ifdef N64VIDEO_C\n\n// bit constants for DP_STATUS\n#define DP_STATUS_XBUS_DMA      0x001   // DMEM DMA mode is set\n#defin"
  },
  {
    "path": "src/core/n64video/vi/divot.c",
    "chars": 1060,
    "preview": "#ifdef N64VIDEO_C\n\nstatic STRICTINLINE void divot_filter(struct n64video_pixel* final, struct n64video_pixel center, str"
  },
  {
    "path": "src/core/n64video/vi/fetch.c",
    "chars": 1787,
    "preview": "#ifdef N64VIDEO_C\n\nstatic void vi_fetch_filter16(struct n64video_pixel* res, uint32_t fboffset, uint32_t cur_x, struct v"
  },
  {
    "path": "src/core/n64video/vi/gamma.c",
    "chars": 2010,
    "preview": "#ifdef N64VIDEO_C\n\nstatic uint8_t gamma_table[0x100];\nstatic uint8_t gamma_dither_table[0x4000];\n\nstatic uint32_t vi_int"
  },
  {
    "path": "src/core/n64video/vi/lerp.c",
    "chars": 443,
    "preview": "#ifdef N64VIDEO_C\n\nstatic STRICTINLINE void vi_vl_lerp(struct n64video_pixel* up, struct n64video_pixel down, uint32_t f"
  },
  {
    "path": "src/core/n64video/vi/restore.c",
    "chars": 3930,
    "preview": "#ifdef N64VIDEO_C\n\nstatic int vi_restore_table[0x400];\n\nstatic STRICTINLINE void restore_filter16(int* r, int* g, int* b"
  },
  {
    "path": "src/core/n64video/vi/video.c",
    "chars": 4871,
    "preview": "#ifdef N64VIDEO_C\n\nstatic STRICTINLINE void video_max_optimized(uint32_t* pixels, uint32_t* penumin, uint32_t* penumax, "
  },
  {
    "path": "src/core/n64video/vi.c",
    "chars": 25970,
    "preview": "#ifdef N64VIDEO_C\n\n// anamorphic NTSC resolution\n#define H_RES_NTSC 640\n#define V_RES_NTSC 480\n\n// anamorphic PAL resolu"
  },
  {
    "path": "src/core/n64video.c",
    "chars": 10035,
    "preview": "#include \"n64video.h\"\n#include \"common.h\"\n#include \"msg.h\"\n#include \"parallel.h\"\n\n#include <memory.h>\n#include <string.h"
  },
  {
    "path": "src/core/n64video.h",
    "chars": 2966,
    "preview": "#pragma once\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#define RDRAM_MAX_SIZE 0x800000\n\n// register enums\nenum dp_regis"
  },
  {
    "path": "src/core/parallel.cpp",
    "chars": 5601,
    "preview": "#include \"parallel.h\"\n\n#include <atomic>\n#include <algorithm>\n#include <condition_variable>\n#include <cstdint>\n#include "
  },
  {
    "path": "src/core/parallel.h",
    "chars": 300,
    "preview": "#pragma once\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdint.h>\n#include <stdbool.h>\n\n#define PARALLEL_MAX_WOR"
  },
  {
    "path": "src/core/version.h.in",
    "chars": 383,
    "preview": "#pragma once\n\n#define GIT_BRANCH \"@GIT_BRANCH@\"\n#define GIT_TAG \"@GIT_TAG@\"\n#define GIT_COMMIT_HASH \"@GIT_COMMIT_HASH@\"\n"
  },
  {
    "path": "src/output/gl_core_3_3.c",
    "chars": 106135,
    "preview": "#ifndef GLES\n\n#include \"gl_core_3_3.h\"\n#include \"gl_proc.h\"\n#include <stdlib.h>\n#include <string.h>\n#include <stddef.h>\n"
  },
  {
    "path": "src/output/gl_core_3_3.h",
    "chars": 86711,
    "preview": "#ifndef GLES\n\n#ifndef POINTER_C_GENERATED_HEADER_OPENGL_H\n#define POINTER_C_GENERATED_HEADER_OPENGL_H\n\n#if defined(__gle"
  },
  {
    "path": "src/output/gl_proc.h",
    "chars": 91,
    "preview": "#pragma once\n\ntypedef void (*funcptr)(void);\n\nfuncptr IntGetProcAddress(const char* name);\n"
  },
  {
    "path": "src/output/screen.h",
    "chars": 338,
    "preview": "#pragma once\n\n#include \"core/n64video.h\"\n\n#include <stdint.h>\n#include <stdbool.h>\n\nvoid screen_init(struct n64video_con"
  },
  {
    "path": "src/output/vdac.c",
    "chars": 14379,
    "preview": "#include \"vdac.h\"\n#include \"screen.h\"\n#include \"core/msg.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <stdio.h>\n"
  },
  {
    "path": "src/output/vdac.h",
    "chars": 297,
    "preview": "#pragma once\n\n#include \"core/n64video.h\"\n\n#include <stdint.h>\n#include <stdbool.h>\n\nvoid vdac_init(struct n64video_confi"
  },
  {
    "path": "src/plugin/mupen64plus/api/m64p_common.h",
    "chars": 3664,
    "preview": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *   Mupen64plus-core - m64p_common.h      "
  },
  {
    "path": "src/plugin/mupen64plus/api/m64p_config.h",
    "chars": 11619,
    "preview": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *   Mupen64plus-core - m64p_config.h      "
  },
  {
    "path": "src/plugin/mupen64plus/api/m64p_plugin.h",
    "chars": 10468,
    "preview": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *   Mupen64plus-core - m64p_plugin.h      "
  },
  {
    "path": "src/plugin/mupen64plus/api/m64p_types.h",
    "chars": 13250,
    "preview": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *   Mupen64plus-core - m64p_types.h       "
  },
  {
    "path": "src/plugin/mupen64plus/api/m64p_vidext.h",
    "chars": 6300,
    "preview": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *   Mupen64plus-core - m64p_vidext.h      "
  },
  {
    "path": "src/plugin/mupen64plus/gfx_m64p.c",
    "chars": 10854,
    "preview": "/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n *   Mupen64plus-video-angrylionplus - plug"
  },
  {
    "path": "src/plugin/mupen64plus/gfx_m64p.h",
    "chars": 409,
    "preview": "#pragma once\n\n#include \"core/n64video.h\"\n#include \"api/m64p_plugin.h\"\n#include \"api/m64p_common.h\"\n\n#ifdef _WIN32\n#defin"
  },
  {
    "path": "src/plugin/mupen64plus/msg.c",
    "chars": 1015,
    "preview": "#include \"core/msg.h\"\n#include \"core/version.h\"\n#include \"gfx_m64p.h\"\n\n#include <stdarg.h>\n#include <stdio.h>\n#include <"
  },
  {
    "path": "src/plugin/mupen64plus/screen.c",
    "chars": 3673,
    "preview": "#include \"gfx_m64p.h\"\n#include \"api/m64p_vidext.h\"\n\n#include \"core/common.h\"\n#include \"core/msg.h\"\n#include \"core/versio"
  },
  {
    "path": "src/plugin/zilmar/config.c",
    "chars": 12082,
    "preview": "#include \"config.h\"\n#include \"resource.h\"\n\n#include \"core/common.h\"\n#include \"core/version.h\"\n#include \"core/n64video.h\""
  },
  {
    "path": "src/plugin/zilmar/config.h",
    "chars": 249,
    "preview": "#pragma once\n\n#include \"core/n64video.h\"\n\n#include <Windows.h>\n\nvoid config_init(HINSTANCE hInst);\nvoid config_dialog(HW"
  },
  {
    "path": "src/plugin/zilmar/gfx_1.3.c",
    "chars": 7347,
    "preview": "#include \"gfx_1.3.h\"\n#include \"config.h\"\n#include \"resource.h\"\n\n#include \"core/common.h\"\n#include \"core/n64video.h\"\n#inc"
  },
  {
    "path": "src/plugin/zilmar/gfx_1.3.h",
    "chars": 13117,
    "preview": "/**********************************************************************************\nCommon gfx plugin spec, version #1.3"
  },
  {
    "path": "src/plugin/zilmar/msg.c",
    "chars": 871,
    "preview": "#include \"core/msg.h\"\n#include \"core/version.h\"\n\n#include <Windows.h>\n\n#include <stdio.h>\n#include <stdarg.h>\n\n#define M"
  },
  {
    "path": "src/plugin/zilmar/screen.c",
    "chars": 8345,
    "preview": "#include \"gfx_1.3.h\"\n\n#include \"wgl_ext.h\"\n\n#include \"output/screen.h\"\n#include \"output/gl_proc.h\"\n#include \"core/common"
  },
  {
    "path": "src/plugin/zilmar/wgl_ext.c",
    "chars": 3768,
    "preview": "#include \"wgl_ext.h\"\n#include \"output/gl_proc.h\"\n\n#include <stdlib.h>\n#include <string.h>\n#include <stddef.h>\n\nint wgl_e"
  },
  {
    "path": "src/plugin/zilmar/wgl_ext.h",
    "chars": 3009,
    "preview": "#ifndef POINTER_C_GENERATED_HEADER_WINDOWSGL_H\n#define POINTER_C_GENERATED_HEADER_WINDOWSGL_H\n\n#ifdef __wglext_h_\n#error"
  }
]

// ... and 2 more files (download for full content)

About this extraction

This page contains the full source code of the ata4/angrylion-rdp-plus GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 69 files (767.5 KB), approximately 241.0k tokens, and a symbol index with 565 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!