mirror of
https://github.com/izzy2lost/Starship.git
synced 2026-07-05 15:19:42 -07:00
First compilation, we just need more stupid assets
This commit is contained in:
+3
-1
@@ -23,4 +23,6 @@ debug/
|
||||
.venv/
|
||||
m2cfiles/
|
||||
TempComp.bin.mio0
|
||||
torch.hash.yml
|
||||
torch.hash.yml
|
||||
cmake-build-*/
|
||||
.idea/
|
||||
|
||||
+440
@@ -0,0 +1,440 @@
|
||||
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
|
||||
|
||||
# Set the project version and language
|
||||
project(Lylat64 VERSION 0.1.0 LANGUAGES C CXX ASM)
|
||||
|
||||
if(APPLE)
|
||||
enable_language(OBJCXX)
|
||||
endif()
|
||||
|
||||
# Set the minimum version of CMake and the deployment target for macOS
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
|
||||
|
||||
# Set the C++ standard and enable the MSVC parallel build option
|
||||
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
||||
set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard to use")
|
||||
#add_compile_options(-fsanitize=address)
|
||||
#add_link_options(-fsanitize=address)
|
||||
|
||||
# Add a custom module path to locate additional CMake modules
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
||||
include(FindFontconfig)
|
||||
|
||||
if (WIN32)
|
||||
include(cmake/automate-vcpkg.cmake)
|
||||
# Forced to use MSVC
|
||||
set(MSVC ON)
|
||||
|
||||
if(MSVC)
|
||||
set(VCPKG_TRIPLET x64-windows-static)
|
||||
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
||||
else()
|
||||
set(VCPKG_TRIPLET x64-mingw-static)
|
||||
set(VCPKG_TARGET_TRIPLET x64-mingw-static)
|
||||
endif()
|
||||
|
||||
vcpkg_bootstrap()
|
||||
vcpkg_install_packages(fontconfig sdl2 zlib bzip2 libpng getopt dirent libusb pthread glew glfw3)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
set(CPP "${CMAKE_C_COMPILER}" "/EP")
|
||||
else()
|
||||
set(CPP "${CMAKE_C_COMPILER}" "-E" "-P" "-Wno-trigraphs" "-x" "c")
|
||||
endif()
|
||||
|
||||
# Set game compilation version
|
||||
set(VERSION us)
|
||||
set(USE_NETWORKING ON)
|
||||
|
||||
# Add compile definitions for the target
|
||||
add_compile_definitions(
|
||||
VERSION_US=1
|
||||
ENABLE_RUMBLE=1
|
||||
F3DEX_GBI=1
|
||||
_LANGUAGE_C
|
||||
_USE_MATH_DEFINES
|
||||
CIMGUI_DEFINE_ENUMS_AND_STRUCTS
|
||||
NON_MATCHING=1
|
||||
NON_EQUIVALENT=1
|
||||
)
|
||||
|
||||
# Find necessary libraries
|
||||
if (UNIX AND NOT APPLE)
|
||||
find_package(OpenGL REQUIRED)
|
||||
endif()
|
||||
|
||||
# Include directories
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
|
||||
# Collect source files to build the executable
|
||||
file(GLOB_RECURSE ALL_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
"src/libultra/io/aisetfreq.c"
|
||||
"src/libultra/gu/sqrtf.c"
|
||||
"src/libultra/gu/mtxutil.c"
|
||||
"src/libultra/gu/ortho.c"
|
||||
"src/main/*.c"
|
||||
"src/main/*.h"
|
||||
"src/port/*.h"
|
||||
"src/port/*.cpp"
|
||||
"src/assets/*.c"
|
||||
"src/overlays/*.c"
|
||||
"src/port/importer/*.cpp"
|
||||
"src/port/importer/types/*.cpp"
|
||||
)
|
||||
|
||||
# Exclude specific files from the ALL_FILES list
|
||||
list(FILTER ALL_FILES EXCLUDE REGEX ".*.inc.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_context.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_effects.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_general.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_heap.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_load.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_playback.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_seqplayer.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_synthesis.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audio_thread.c")
|
||||
# list(FILTER ALL_FILES EXCLUDE REGEX "src/main/audiotables.c")
|
||||
list(FILTER ALL_FILES EXCLUDE REGEX "src/main/sys_fault.c")
|
||||
|
||||
add_executable(${PROJECT_NAME} ${ALL_FILES} ${GENERATED_SOURCES})
|
||||
|
||||
################################################################################
|
||||
# MSVC runtime library
|
||||
################################################################################
|
||||
if (MSVC)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY)
|
||||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
|
||||
$<$<CONFIG:Debug>:
|
||||
MultiThreadedDebug
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
MultiThreaded
|
||||
>
|
||||
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
|
||||
)
|
||||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
|
||||
$<$<CONFIG:Debug>:
|
||||
MultiThreadedDebug
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
MultiThreaded
|
||||
>
|
||||
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
|
||||
)
|
||||
endif()
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#==============================================================================#
|
||||
# Libultraship Integration #
|
||||
#==============================================================================#
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/include/libultraship
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/log
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/debug
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/menu
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/utils
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/utils/binarytools
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/resource
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/resource/type
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/resource/factory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/audio
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/window
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/window/gui
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/config
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/public
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/public/libultra
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/public/bridge
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/extern
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/extern/tinyxml2
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/libultraship/Lib/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/libultraship/Lib/libjpeg/include/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/libultraship/Lib/spdlog/include/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic/Fast3D/U64/PR
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libultraship/src/graphic
|
||||
${SDL2_INCLUDE_DIRS}
|
||||
${GLEW_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
"$<$<CONFIG:Debug>:"
|
||||
"_DEBUG;"
|
||||
"_CRT_SECURE_NO_WARNINGS;"
|
||||
"ENABLE_DX11;"
|
||||
">"
|
||||
"$<$<CONFIG:Release>:"
|
||||
"NDEBUG"
|
||||
">"
|
||||
"INCLUDE_GAME_PRINTF;"
|
||||
"UNICODE;"
|
||||
"_UNICODE"
|
||||
STORMLIB_NO_AUTO_LINK
|
||||
"_CRT_SECURE_NO_WARNINGS;"
|
||||
)
|
||||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
"$<$<CONFIG:Debug>:"
|
||||
"NOINCLUDE_GAME_PRINTF;"
|
||||
"_DEBUG;"
|
||||
"_CRT_SECURE_NO_WARNINGS;"
|
||||
"ENABLE_OPENGL"
|
||||
">"
|
||||
"$<$<CONFIG:Release>:"
|
||||
"NDEBUG;"
|
||||
">"
|
||||
"INCLUDE_GAME_PRINTF;"
|
||||
"WIN32;"
|
||||
"UNICODE;"
|
||||
"_UNICODE"
|
||||
STORMLIB_NO_AUTO_LINK
|
||||
)
|
||||
endif()
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
"$<$<CONFIG:Debug>:"
|
||||
"_DEBUG"
|
||||
">"
|
||||
"$<$<CONFIG:Release>:"
|
||||
"NDEBUG"
|
||||
">"
|
||||
"SPDLOG_ACTIVE_LEVEL=3;"
|
||||
"SPDLOG_NO_THREAD_ID;"
|
||||
"SPDLOG_NO_TLS;"
|
||||
"STBI_NO_THREAD_LOCALS;"
|
||||
)
|
||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||
"$<$<CONFIG:Debug>:"
|
||||
"_DEBUG"
|
||||
">"
|
||||
"$<$<CONFIG:Release>:"
|
||||
"NDEBUG"
|
||||
">"
|
||||
"$<$<BOOL:${BUILD_CROWD_CONTROL}>:ENABLE_CROWD_CONTROL>"
|
||||
"SPDLOG_ACTIVE_LEVEL=0;"
|
||||
"_CONSOLE;"
|
||||
"_CRT_SECURE_NO_WARNINGS;"
|
||||
"ENABLE_OPENGL;"
|
||||
"UNICODE;"
|
||||
"_UNICODE"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectory(libultraship ${CMAKE_CURRENT_SOURCE_DIR}/libultraship)
|
||||
|
||||
add_dependencies(${PROJECT_NAME} libultraship)
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE libultraship)
|
||||
|
||||
if(USE_NETWORKING)
|
||||
if(MSVC)
|
||||
vcpkg_install_packages(sdl2-net)
|
||||
endif()
|
||||
find_package(SDL2_net REQUIRED)
|
||||
include_directories(${SDL2_NET_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2_net::SDL2_net)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_NETWORKING)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Compile and link options
|
||||
################################################################################
|
||||
if(MSVC)
|
||||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
$<$<CONFIG:Debug>:
|
||||
/w;
|
||||
/Od;
|
||||
/MTd
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
/Oi;
|
||||
/Gy;
|
||||
/W3;
|
||||
/MT
|
||||
>
|
||||
/permissive-;
|
||||
/MP;
|
||||
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
||||
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
||||
)
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:/ZI;>)
|
||||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
$<$<CONFIG:Debug>:
|
||||
/MTd
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
/O2;
|
||||
/Oi;
|
||||
/Gy;
|
||||
/MT
|
||||
>
|
||||
/permissive-;
|
||||
/MP;
|
||||
/w;
|
||||
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
||||
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
||||
)
|
||||
endif()
|
||||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
target_link_options(${PROJECT_NAME} PRIVATE
|
||||
$<$<CONFIG:Debug>:
|
||||
/INCREMENTAL
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
/OPT:REF;
|
||||
/OPT:ICF;
|
||||
/INCREMENTAL:NO;
|
||||
/FORCE:MULTIPLE
|
||||
>
|
||||
/MANIFEST:NO;
|
||||
/DEBUG;
|
||||
/SUBSYSTEM:WINDOWS
|
||||
)
|
||||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
target_link_options(${PROJECT_NAME} PRIVATE
|
||||
$<$<CONFIG:Debug>:
|
||||
/STACK:8777216
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
/OPT:REF;
|
||||
/OPT:ICF;
|
||||
/INCREMENTAL:NO;
|
||||
/FORCE:MULTIPLE
|
||||
>
|
||||
/MANIFEST:NO;
|
||||
/DEBUG;
|
||||
/SUBSYSTEM:WINDOWS
|
||||
)
|
||||
endif()
|
||||
|
||||
# Remove /RTC from msvc flags
|
||||
foreach (fentry
|
||||
CMAKE_C_FLAGS
|
||||
CMAKE_CXX_FLAGS
|
||||
)
|
||||
string (REGEX REPLACE "/RTC(su|[1su])" "" ${fentry} "${${fentry}}")
|
||||
endforeach(fentry)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
-Wall -Wextra -Wno-error
|
||||
-Wno-return-type
|
||||
-Wno-unused-parameter
|
||||
-Wno-unused-function
|
||||
-Wno-unused-variable
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:
|
||||
-Wno-c++11-narrowing
|
||||
-Wno-deprecated-enum-enum-conversion
|
||||
>
|
||||
-pthread
|
||||
)
|
||||
|
||||
target_link_options(${PROJECT_NAME} PRIVATE
|
||||
-pthread
|
||||
)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
-Wall -Wextra -Wno-error
|
||||
-Wno-return-type
|
||||
-Wno-unused-parameter
|
||||
-Wno-unused-function
|
||||
-Wno-unused-variable
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:
|
||||
-Wno-c++11-narrowing
|
||||
-Wno-deprecated-enum-enum-conversion
|
||||
>
|
||||
-pthread
|
||||
)
|
||||
|
||||
target_link_options(${PROJECT_NAME} PRIVATE
|
||||
-pthread
|
||||
)
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
-O2
|
||||
|
||||
# disable some warnings to not clutter output
|
||||
-Wno-multichar
|
||||
-Wno-return-type
|
||||
-Wno-narrowing
|
||||
-Wno-switch-outside-range
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
-Wno-discarded-array-qualifiers
|
||||
-Wno-discarded-qualifiers
|
||||
-Wno-int-conversion
|
||||
-Wno-builtin-declaration-mismatch
|
||||
-Wno-switch-unreachable
|
||||
-Wno-stringop-overflow
|
||||
>
|
||||
)
|
||||
else()
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
set(CPU_OPTION -msse2 -mfpmath=sse)
|
||||
endif()
|
||||
|
||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||
-Wall -Wextra -Wno-error
|
||||
-Wno-unused-parameter
|
||||
-Wno-unused-function
|
||||
-Wno-unused-variable
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-parentheses
|
||||
-Wno-narrowing
|
||||
-Wno-missing-braces
|
||||
$<$<COMPILE_LANGUAGE:C>:
|
||||
-Werror-implicit-function-declaration
|
||||
-Wno-incompatible-pointer-types
|
||||
>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
|
||||
-pthread
|
||||
${CPU_OPTION}
|
||||
)
|
||||
|
||||
target_link_options(${PROJECT_NAME} PRIVATE
|
||||
-pthread
|
||||
-Wl,-export-dynamic
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@@ -1,453 +0,0 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1995, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 1997/02/11 08:15:34 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/R4300.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __R4300_H__
|
||||
#define __R4300_H__
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/*
|
||||
* Segment base addresses and sizes
|
||||
*/
|
||||
#define KUBASE 0
|
||||
#define KUSIZE 0x80000000
|
||||
#define K0BASE 0x80000000
|
||||
#define K0SIZE 0x20000000
|
||||
#define K1BASE 0xA0000000
|
||||
#define K1SIZE 0x20000000
|
||||
#define K2BASE 0xC0000000
|
||||
#define K2SIZE 0x20000000
|
||||
|
||||
/*
|
||||
* Exception vectors
|
||||
*/
|
||||
#define SIZE_EXCVEC 0x80 /* Size of an exc. vec */
|
||||
#define UT_VEC K0BASE /* utlbmiss vector */
|
||||
#define R_VEC (K1BASE+0x1fc00000) /* reset vector */
|
||||
#define XUT_VEC (K0BASE+0x80) /* extended address tlbmiss */
|
||||
#define ECC_VEC (K0BASE+0x100) /* Ecc exception vector */
|
||||
#define E_VEC (K0BASE+0x180) /* Gen. exception vector */
|
||||
|
||||
/*
|
||||
* Address conversion macros
|
||||
*/
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
|
||||
#define K0_TO_K1(x) ((x)|0xA0000000) /* kseg0 to kseg1 */
|
||||
#define K1_TO_K0(x) ((x)&0x9FFFFFFF) /* kseg1 to kseg0 */
|
||||
#define K0_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg0 to physical */
|
||||
#define K1_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg1 to physical */
|
||||
#define KDM_TO_PHYS(x) ((x)&0x1FFFFFFF) /* direct mapped to physical */
|
||||
#define PHYS_TO_K0(x) ((x)|0x80000000) /* physical to kseg0 */
|
||||
#define PHYS_TO_K1(x) ((x)|0xA0000000) /* physical to kseg1 */
|
||||
|
||||
#else /* _LANGUAGE_C */
|
||||
|
||||
#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */
|
||||
#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */
|
||||
#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */
|
||||
#define K1_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg1 to physical */
|
||||
#define KDM_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* direct mapped to physical */
|
||||
#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */
|
||||
#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */
|
||||
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
/*
|
||||
* Address predicates
|
||||
*/
|
||||
#define IS_KSEG0(x) ((u32)(x) >= K0BASE && (u32)(x) < K1BASE)
|
||||
#define IS_KSEG1(x) ((u32)(x) >= K1BASE && (u32)(x) < K2BASE)
|
||||
#define IS_KSEGDM(x) ((u32)(x) >= K0BASE && (u32)(x) < K2BASE)
|
||||
#define IS_KSEG2(x) ((u32)(x) >= K2BASE && (u32)(x) < KPTE_SHDUBASE)
|
||||
#define IS_KPTESEG(x) ((u32)(x) >= KPTE_SHDUBASE)
|
||||
#define IS_KUSEG(x) ((u32)(x) < K0BASE)
|
||||
|
||||
/*
|
||||
* TLB size constants
|
||||
*/
|
||||
|
||||
#define NTLBENTRIES 31 /* entry 31 is reserved by rdb */
|
||||
|
||||
#define TLBHI_VPN2MASK 0xffffe000
|
||||
#define TLBHI_VPN2SHIFT 13
|
||||
#define TLBHI_PIDMASK 0xff
|
||||
#define TLBHI_PIDSHIFT 0
|
||||
#define TLBHI_NPID 255 /* 255 to fit in 8 bits */
|
||||
|
||||
#define TLBLO_PFNMASK 0x3fffffc0
|
||||
#define TLBLO_PFNSHIFT 6
|
||||
#define TLBLO_CACHMASK 0x38 /* cache coherency algorithm */
|
||||
#define TLBLO_CACHSHIFT 3
|
||||
#define TLBLO_UNCACHED 0x10 /* not cached */
|
||||
#define TLBLO_NONCOHRNT 0x18 /* Cacheable non-coherent */
|
||||
#define TLBLO_EXLWR 0x28 /* Exclusive write */
|
||||
#define TLBLO_D 0x4 /* writeable */
|
||||
#define TLBLO_V 0x2 /* valid bit */
|
||||
#define TLBLO_G 0x1 /* global access bit */
|
||||
|
||||
#define TLBINX_PROBE 0x80000000
|
||||
#define TLBINX_INXMASK 0x3f
|
||||
#define TLBINX_INXSHIFT 0
|
||||
|
||||
#define TLBRAND_RANDMASK 0x3f
|
||||
#define TLBRAND_RANDSHIFT 0
|
||||
|
||||
#define TLBWIRED_WIREDMASK 0x3f
|
||||
|
||||
#define TLBCTXT_BASEMASK 0xff800000
|
||||
#define TLBCTXT_BASESHIFT 23
|
||||
#define TLBCTXT_BASEBITS 9
|
||||
|
||||
#define TLBCTXT_VPNMASK 0x7ffff0
|
||||
#define TLBCTXT_VPNSHIFT 4
|
||||
|
||||
#define TLBPGMASK_4K 0x0
|
||||
#define TLBPGMASK_16K 0x6000
|
||||
#define TLBPGMASK_64K 0x1e000
|
||||
|
||||
/*
|
||||
* Status register
|
||||
*/
|
||||
#define SR_CUMASK 0xf0000000 /* coproc usable bits */
|
||||
|
||||
#define SR_CU3 0x80000000 /* Coprocessor 3 usable */
|
||||
#define SR_CU2 0x40000000 /* Coprocessor 2 usable */
|
||||
#define SR_CU1 0x20000000 /* Coprocessor 1 usable */
|
||||
#define SR_CU0 0x10000000 /* Coprocessor 0 usable */
|
||||
#define SR_RP 0x08000000 /* Reduced power (quarter speed) */
|
||||
#define SR_FR 0x04000000 /* MIPS III FP register mode */
|
||||
#define SR_RE 0x02000000 /* Reverse endian */
|
||||
#define SR_ITS 0x01000000 /* Instruction trace support */
|
||||
#define SR_BEV 0x00400000 /* Use boot exception vectors */
|
||||
#define SR_TS 0x00200000 /* TLB shutdown */
|
||||
#define SR_SR 0x00100000 /* Soft reset occured */
|
||||
#define SR_CH 0x00040000 /* Cache hit for last 'cache' op */
|
||||
#define SR_CE 0x00020000 /* Create ECC */
|
||||
#define SR_DE 0x00010000 /* ECC of parity does not cause error */
|
||||
|
||||
/*
|
||||
* Interrupt enable bits
|
||||
* (NOTE: bits set to 1 enable the corresponding level interrupt)
|
||||
*/
|
||||
#define SR_IMASK 0x0000ff00 /* Interrupt mask */
|
||||
#define SR_IMASK8 0x00000000 /* mask level 8 */
|
||||
#define SR_IMASK7 0x00008000 /* mask level 7 */
|
||||
#define SR_IMASK6 0x0000c000 /* mask level 6 */
|
||||
#define SR_IMASK5 0x0000e000 /* mask level 5 */
|
||||
#define SR_IMASK4 0x0000f000 /* mask level 4 */
|
||||
#define SR_IMASK3 0x0000f800 /* mask level 3 */
|
||||
#define SR_IMASK2 0x0000fc00 /* mask level 2 */
|
||||
#define SR_IMASK1 0x0000fe00 /* mask level 1 */
|
||||
#define SR_IMASK0 0x0000ff00 /* mask level 0 */
|
||||
|
||||
#define SR_IBIT8 0x00008000 /* bit level 8 */
|
||||
#define SR_IBIT7 0x00004000 /* bit level 7 */
|
||||
#define SR_IBIT6 0x00002000 /* bit level 6 */
|
||||
#define SR_IBIT5 0x00001000 /* bit level 5 */
|
||||
#define SR_IBIT4 0x00000800 /* bit level 4 */
|
||||
#define SR_IBIT3 0x00000400 /* bit level 3 */
|
||||
#define SR_IBIT2 0x00000200 /* bit level 2 */
|
||||
#define SR_IBIT1 0x00000100 /* bit level 1 */
|
||||
|
||||
#define SR_IMASKSHIFT 8
|
||||
|
||||
#define SR_KX 0x00000080 /* extended-addr TLB vec in kernel */
|
||||
#define SR_SX 0x00000040 /* xtended-addr TLB vec supervisor */
|
||||
#define SR_UX 0x00000020 /* xtended-addr TLB vec in user mode */
|
||||
#define SR_KSU_MASK 0x00000018 /* mode mask */
|
||||
#define SR_KSU_USR 0x00000010 /* user mode */
|
||||
#define SR_KSU_SUP 0x00000008 /* supervisor mode */
|
||||
#define SR_KSU_KER 0x00000000 /* kernel mode */
|
||||
#define SR_ERL 0x00000004 /* Error level, 1=>cache error */
|
||||
#define SR_EXL 0x00000002 /* Exception level, 1=>exception */
|
||||
#define SR_IE 0x00000001 /* interrupt enable, 1=>enable */
|
||||
|
||||
/*
|
||||
* Cause Register
|
||||
*/
|
||||
#define CAUSE_BD 0x80000000 /* Branch delay slot */
|
||||
#define CAUSE_CEMASK 0x30000000 /* coprocessor error */
|
||||
#define CAUSE_CESHIFT 28
|
||||
|
||||
/* Interrupt pending bits */
|
||||
#define CAUSE_IP8 0x00008000 /* External level 8 pending - COMPARE */
|
||||
#define CAUSE_IP7 0x00004000 /* External level 7 pending - INT4 */
|
||||
#define CAUSE_IP6 0x00002000 /* External level 6 pending - INT3 */
|
||||
#define CAUSE_IP5 0x00001000 /* External level 5 pending - INT2 */
|
||||
#define CAUSE_IP4 0x00000800 /* External level 4 pending - INT1 */
|
||||
#define CAUSE_IP3 0x00000400 /* External level 3 pending - INT0 */
|
||||
#define CAUSE_SW2 0x00000200 /* Software level 2 pending */
|
||||
#define CAUSE_SW1 0x00000100 /* Software level 1 pending */
|
||||
|
||||
#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */
|
||||
#define CAUSE_IPSHIFT 8
|
||||
|
||||
#define CAUSE_EXCMASK 0x0000007C /* Cause code bits */
|
||||
|
||||
#define CAUSE_EXCSHIFT 2
|
||||
|
||||
/* Cause register exception codes */
|
||||
|
||||
#define EXC_CODE(x) ((x)<<2)
|
||||
|
||||
/* Hardware exception codes */
|
||||
#define EXC_INT EXC_CODE(0) /* interrupt */
|
||||
#define EXC_MOD EXC_CODE(1) /* TLB mod */
|
||||
#define EXC_RMISS EXC_CODE(2) /* Read TLB Miss */
|
||||
#define EXC_WMISS EXC_CODE(3) /* Write TLB Miss */
|
||||
#define EXC_RADE EXC_CODE(4) /* Read Address Error */
|
||||
#define EXC_WADE EXC_CODE(5) /* Write Address Error */
|
||||
#define EXC_IBE EXC_CODE(6) /* Instruction Bus Error */
|
||||
#define EXC_DBE EXC_CODE(7) /* Data Bus Error */
|
||||
#define EXC_SYSCALL EXC_CODE(8) /* SYSCALL */
|
||||
#define EXC_BREAK EXC_CODE(9) /* BREAKpoint */
|
||||
#define EXC_II EXC_CODE(10) /* Illegal Instruction */
|
||||
#define EXC_CPU EXC_CODE(11) /* CoProcessor Unusable */
|
||||
#define EXC_OV EXC_CODE(12) /* OVerflow */
|
||||
#define EXC_TRAP EXC_CODE(13) /* Trap exception */
|
||||
#define EXC_VCEI EXC_CODE(14) /* Virt. Coherency on Inst. fetch */
|
||||
#define EXC_FPE EXC_CODE(15) /* Floating Point Exception */
|
||||
#define EXC_WATCH EXC_CODE(23) /* Watchpoint reference */
|
||||
#define EXC_VCED EXC_CODE(31) /* Virt. Coherency on data read */
|
||||
|
||||
/* C0_PRID Defines */
|
||||
#define C0_IMPMASK 0xff00
|
||||
#define C0_IMPSHIFT 8
|
||||
#define C0_REVMASK 0xff
|
||||
#define C0_MAJREVMASK 0xf0
|
||||
#define C0_MAJREVSHIFT 4
|
||||
#define C0_MINREVMASK 0xf
|
||||
|
||||
/*
|
||||
* Coprocessor 0 operations
|
||||
*/
|
||||
#define C0_READI 0x1 /* read ITLB entry addressed by C0_INDEX */
|
||||
#define C0_WRITEI 0x2 /* write ITLB entry addressed by C0_INDEX */
|
||||
#define C0_WRITER 0x6 /* write ITLB entry addressed by C0_RAND */
|
||||
#define C0_PROBE 0x8 /* probe for ITLB entry addressed by TLBHI */
|
||||
#define C0_RFE 0x10 /* restore for exception */
|
||||
|
||||
/*
|
||||
* 'cache' instruction definitions
|
||||
*/
|
||||
|
||||
/* Target cache */
|
||||
#define CACH_PI 0x0 /* specifies primary inst. cache */
|
||||
#define CACH_PD 0x1 /* primary data cache */
|
||||
#define CACH_SI 0x2 /* secondary instruction cache */
|
||||
#define CACH_SD 0x3 /* secondary data cache */
|
||||
|
||||
/* Cache operations */
|
||||
#define C_IINV 0x0 /* index invalidate (inst, 2nd inst) */
|
||||
#define C_IWBINV 0x0 /* index writeback inval (d, sd) */
|
||||
#define C_ILT 0x4 /* index load tag (all) */
|
||||
#define C_IST 0x8 /* index store tag (all) */
|
||||
#define C_CDX 0xc /* create dirty exclusive (d, sd) */
|
||||
#define C_HINV 0x10 /* hit invalidate (all) */
|
||||
#define C_HWBINV 0x14 /* hit writeback inv. (d, sd) */
|
||||
#define C_FILL 0x14 /* fill (i) */
|
||||
#define C_HWB 0x18 /* hit writeback (i, d, sd) */
|
||||
#define C_HSV 0x1c /* hit set virt. (si, sd) */
|
||||
|
||||
/*
|
||||
* Cache size definitions
|
||||
*/
|
||||
#define ICACHE_SIZE 0x4000 /* 16K */
|
||||
#define ICACHE_LINESIZE 32 /* 8 words */
|
||||
#define ICACHE_LINEMASK (ICACHE_LINESIZE-1)
|
||||
|
||||
#define DCACHE_SIZE 0x2000 /* 8K */
|
||||
#define DCACHE_LINESIZE 16 /* 4 words */
|
||||
#define DCACHE_LINEMASK (DCACHE_LINESIZE-1)
|
||||
|
||||
/*
|
||||
* C0_CONFIG register definitions
|
||||
*/
|
||||
#define CONFIG_CM 0x80000000 /* 1 == Master-Checker enabled */
|
||||
#define CONFIG_EC 0x70000000 /* System Clock ratio */
|
||||
#define CONFIG_EC_1_1 0x6 /* System Clock ratio 1 :1 */
|
||||
#define CONFIG_EC_3_2 0x7 /* System Clock ratio 1.5 :1 */
|
||||
#define CONFIG_EC_2_1 0x0 /* System Clock ratio 2 :1 */
|
||||
#define CONFIG_EC_3_1 0x1 /* System Clock ratio 3 :1 */
|
||||
#define CONFIG_EP 0x0f000000 /* Transmit Data Pattern */
|
||||
#define CONFIG_SB 0x00c00000 /* Secondary cache block size */
|
||||
|
||||
#define CONFIG_SS 0x00200000 /* Split scache: 0 == I&D combined */
|
||||
#define CONFIG_SW 0x00100000 /* scache port: 0==128, 1==64 */
|
||||
#define CONFIG_EW 0x000c0000 /* System Port width: 0==64, 1==32 */
|
||||
#define CONFIG_SC 0x00020000 /* 0 -> 2nd cache present */
|
||||
#define CONFIG_SM 0x00010000 /* 0 -> Dirty Shared Coherency enabled*/
|
||||
#define CONFIG_BE 0x00008000 /* Endian-ness: 1 --> BE */
|
||||
#define CONFIG_EM 0x00004000 /* 1 -> ECC mode, 0 -> parity */
|
||||
#define CONFIG_EB 0x00002000 /* Block order:1->sequent,0->subblock */
|
||||
|
||||
#define CONFIG_IC 0x00000e00 /* Primary Icache size */
|
||||
#define CONFIG_DC 0x000001c0 /* Primary Dcache size */
|
||||
#define CONFIG_IB 0x00000020 /* Icache block size */
|
||||
#define CONFIG_DB 0x00000010 /* Dcache block size */
|
||||
#define CONFIG_CU 0x00000008 /* Update on Store-conditional */
|
||||
#define CONFIG_K0 0x00000007 /* K0SEG Coherency algorithm */
|
||||
|
||||
#define CONFIG_UNCACHED 0x00000002 /* K0 is uncached */
|
||||
#define CONFIG_NONCOHRNT 0x00000003
|
||||
#define CONFIG_COHRNT_EXLWR 0x00000005
|
||||
#define CONFIG_SB_SHFT 22 /* shift SB to bit position 0 */
|
||||
#define CONFIG_IC_SHFT 9 /* shift IC to bit position 0 */
|
||||
#define CONFIG_DC_SHFT 6 /* shift DC to bit position 0 */
|
||||
#define CONFIG_BE_SHFT 15 /* shift BE to bit position 0 */
|
||||
|
||||
/*
|
||||
* C0_TAGLO definitions for setting/getting cache states and physaddr bits
|
||||
*/
|
||||
#define SADDRMASK 0xFFFFE000 /* 31..13 -> scache paddr bits 35..17 */
|
||||
#define SVINDEXMASK 0x00000380 /* 9..7: prim virt index bits 14..12 */
|
||||
#define SSTATEMASK 0x00001c00 /* bits 12..10 hold scache line state */
|
||||
#define SINVALID 0x00000000 /* invalid --> 000 == state 0 */
|
||||
#define SCLEANEXCL 0x00001000 /* clean exclusive --> 100 == state 4 */
|
||||
#define SDIRTYEXCL 0x00001400 /* dirty exclusive --> 101 == state 5 */
|
||||
#define SECC_MASK 0x0000007f /* low 7 bits are ecc for the tag */
|
||||
#define SADDR_SHIFT 4 /* shift STagLo (31..13) to 35..17 */
|
||||
|
||||
#define PADDRMASK 0xFFFFFF00 /* PTagLo31..8->prim paddr bits35..12 */
|
||||
#define PADDR_SHIFT 4 /* roll bits 35..12 down to 31..8 */
|
||||
#define PSTATEMASK 0x00C0 /* bits 7..6 hold primary line state */
|
||||
#define PINVALID 0x0000 /* invalid --> 000 == state 0 */
|
||||
#define PCLEANEXCL 0x0080 /* clean exclusive --> 10 == state 2 */
|
||||
#define PDIRTYEXCL 0x00C0 /* dirty exclusive --> 11 == state 3 */
|
||||
#define PPARITY_MASK 0x0001 /* low bit is parity bit (even). */
|
||||
|
||||
/*
|
||||
* C0_CACHE_ERR definitions.
|
||||
*/
|
||||
#define CACHERR_ER 0x80000000 /* 0: inst ref, 1: data ref */
|
||||
#define CACHERR_EC 0x40000000 /* 0: primary, 1: secondary */
|
||||
#define CACHERR_ED 0x20000000 /* 1: data error */
|
||||
#define CACHERR_ET 0x10000000 /* 1: tag error */
|
||||
#define CACHERR_ES 0x08000000 /* 1: external ref, e.g. snoop*/
|
||||
#define CACHERR_EE 0x04000000 /* error on SysAD bus */
|
||||
#define CACHERR_EB 0x02000000 /* complicated, see spec. */
|
||||
#define CACHERR_EI 0x01000000 /* complicated, see spec. */
|
||||
#define CACHERR_SIDX_MASK 0x003ffff8 /* secondary cache index */
|
||||
#define CACHERR_PIDX_MASK 0x00000007 /* primary cache index */
|
||||
#define CACHERR_PIDX_SHIFT 12 /* bits 2..0 are paddr14..12 */
|
||||
|
||||
/* R4000 family supports hardware watchpoints:
|
||||
* C0_WATCHLO:
|
||||
* bits 31..3 are bits 31..3 of physaddr to watch
|
||||
* bit 2: reserved; must be written as 0.
|
||||
* bit 1: when set causes a watchpoint trap on load accesses to paddr.
|
||||
* bit 0: when set traps on stores to paddr;
|
||||
* C0_WATCHHI
|
||||
* bits 31..4 are reserved and must be written as zeros.
|
||||
* bits 3..0 are bits 35..32 of the physaddr to watch
|
||||
*/
|
||||
#define WATCHLO_WTRAP 0x00000001
|
||||
#define WATCHLO_RTRAP 0x00000002
|
||||
#define WATCHLO_ADDRMASK 0xfffffff8
|
||||
#define WATCHLO_VALIDMASK 0xfffffffb
|
||||
#define WATCHHI_VALIDMASK 0x0000000f
|
||||
|
||||
/*
|
||||
* Coprocessor 0 registers
|
||||
*/
|
||||
#ifdef _LANGUAGE_ASSEMBLY
|
||||
#define C0_INX $0
|
||||
#define C0_RAND $1
|
||||
#define C0_ENTRYLO0 $2
|
||||
#define C0_ENTRYLO1 $3
|
||||
#define C0_CONTEXT $4
|
||||
#define C0_PAGEMASK $5 /* page mask */
|
||||
#define C0_WIRED $6 /* # wired entries in tlb */
|
||||
#define C0_BADVADDR $8
|
||||
#define C0_COUNT $9 /* free-running counter */
|
||||
#define C0_ENTRYHI $10
|
||||
#define C0_SR $12
|
||||
#define C0_CAUSE $13
|
||||
#define C0_EPC $14
|
||||
#define C0_PRID $15 /* revision identifier */
|
||||
#define C0_COMPARE $11 /* counter comparison reg. */
|
||||
#define C0_CONFIG $16 /* hardware configuration */
|
||||
#define C0_LLADDR $17 /* load linked address */
|
||||
#define C0_WATCHLO $18 /* watchpoint */
|
||||
#define C0_WATCHHI $19 /* watchpoint */
|
||||
#define C0_ECC $26 /* S-cache ECC and primary parity */
|
||||
#define C0_CACHE_ERR $27 /* cache error status */
|
||||
#define C0_TAGLO $28 /* cache operations */
|
||||
#define C0_TAGHI $29 /* cache operations */
|
||||
#define C0_ERROR_EPC $30 /* ECC error prg. counter */
|
||||
|
||||
# else /* ! _LANGUAGE_ASSEMBLY */
|
||||
|
||||
#define C0_INX 0
|
||||
#define C0_RAND 1
|
||||
#define C0_ENTRYLO0 2
|
||||
#define C0_ENTRYLO1 3
|
||||
#define C0_CONTEXT 4
|
||||
#define C0_PAGEMASK 5 /* page mask */
|
||||
#define C0_WIRED 6 /* # wired entries in tlb */
|
||||
#define C0_BADVADDR 8
|
||||
#define C0_COUNT 9 /* free-running counter */
|
||||
#define C0_ENTRYHI 10
|
||||
#define C0_SR 12
|
||||
#define C0_CAUSE 13
|
||||
#define C0_EPC 14
|
||||
#define C0_PRID 15 /* revision identifier */
|
||||
#define C0_COMPARE 11 /* counter comparison reg. */
|
||||
#define C0_CONFIG 16 /* hardware configuration */
|
||||
#define C0_LLADDR 17 /* load linked address */
|
||||
#define C0_WATCHLO 18 /* watchpoint */
|
||||
#define C0_WATCHHI 19 /* watchpoint */
|
||||
#define C0_ECC 26 /* S-cache ECC and primary parity */
|
||||
#define C0_CACHE_ERR 27 /* cache error status */
|
||||
#define C0_TAGLO 28 /* cache operations */
|
||||
#define C0_TAGHI 29 /* cache operations */
|
||||
#define C0_ERROR_EPC 30 /* ECC error prg. counter */
|
||||
|
||||
#endif /* _LANGUAGE_ASSEMBLY */
|
||||
|
||||
/*
|
||||
* floating-point status register
|
||||
*/
|
||||
#define FPCSR_FS 0x01000000 /* flush denorm to zero */
|
||||
#define FPCSR_C 0x00800000 /* condition bit */
|
||||
#define FPCSR_CE 0x00020000 /* cause: unimplemented operation */
|
||||
#define FPCSR_CV 0x00010000 /* cause: invalid operation */
|
||||
#define FPCSR_CZ 0x00008000 /* cause: division by zero */
|
||||
#define FPCSR_CO 0x00004000 /* cause: overflow */
|
||||
#define FPCSR_CU 0x00002000 /* cause: underflow */
|
||||
#define FPCSR_CI 0x00001000 /* cause: inexact operation */
|
||||
#define FPCSR_EV 0x00000800 /* enable: invalid operation */
|
||||
#define FPCSR_EZ 0x00000400 /* enable: division by zero */
|
||||
#define FPCSR_EO 0x00000200 /* enable: overflow */
|
||||
#define FPCSR_EU 0x00000100 /* enable: underflow */
|
||||
#define FPCSR_EI 0x00000080 /* enable: inexact operation */
|
||||
#define FPCSR_FV 0x00000040 /* flag: invalid operation */
|
||||
#define FPCSR_FZ 0x00000020 /* flag: division by zero */
|
||||
#define FPCSR_FO 0x00000010 /* flag: overflow */
|
||||
#define FPCSR_FU 0x00000008 /* flag: underflow */
|
||||
#define FPCSR_FI 0x00000004 /* flag: inexact operation */
|
||||
#define FPCSR_RM_MASK 0x00000003 /* rounding mode mask */
|
||||
#define FPCSR_RM_RN 0x00000000 /* round to nearest */
|
||||
#define FPCSR_RM_RZ 0x00000001 /* round to zero */
|
||||
#define FPCSR_RM_RP 0x00000002 /* round to positive infinity */
|
||||
#define FPCSR_RM_RM 0x00000003 /* round to negative infinity */
|
||||
|
||||
#endif /* __R4300_H */
|
||||
+2
-57
@@ -2,19 +2,11 @@
|
||||
#define _CONTROLLER_H
|
||||
|
||||
#include "macros.h"
|
||||
#include "PR/ultratypes.h"
|
||||
#include "PR/os_internal.h"
|
||||
#include "PR/os_version.h"
|
||||
#include "PR/rcp.h"
|
||||
#include <libultraship.h>
|
||||
|
||||
#define EEPROM_BLOCK_SIZE 8
|
||||
#define CHNL_ERR(format) (((format).rxsize & CHNL_ERR_MASK) >> 4)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ u32 ramarray[15];
|
||||
/* 0x3C */ u32 pifstatus;
|
||||
} OSPifRam;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ u8 dummy;
|
||||
@@ -64,45 +56,6 @@ typedef struct
|
||||
/* 0x26 */ u8 datacrc;
|
||||
} __OSContRamReadFormat;
|
||||
|
||||
typedef union {
|
||||
/* 0x0 */ struct
|
||||
{
|
||||
/* 0x0 */ u8 bank;
|
||||
/* 0x1 */ u8 page;
|
||||
} inode_t;
|
||||
/* 0x0 */ u16 ipage;
|
||||
} __OSInodeUnit;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ u32 game_code;
|
||||
/* 0x4 */ u16 company_code;
|
||||
/* 0x6 */ __OSInodeUnit start_page;
|
||||
/* 0x8 */ u8 status;
|
||||
/* 0x9 */ s8 reserved;
|
||||
/* 0xA */ u16 data_sum;
|
||||
/* 0xC */ u8 ext_name[PFS_FILE_EXT_LEN];
|
||||
/* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN];
|
||||
} __OSDir;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ __OSInodeUnit inode_page[128];
|
||||
} __OSInode;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ u32 repaired;
|
||||
/* 0x4 */ u32 random;
|
||||
/* 0x8 */ u64 serial_mid;
|
||||
/* 0x10 */ u64 serial_low;
|
||||
/* 0x18 */ u16 deviceid;
|
||||
/* 0x1A */ u8 banks;
|
||||
/* 0x1B */ u8 version;
|
||||
/* 0x1C */ u16 checksum;
|
||||
/* 0x1E */ u16 inverted_checksum;
|
||||
} __OSPackId;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ u8 txsize;
|
||||
@@ -193,14 +146,6 @@ typedef struct
|
||||
#define GB_POWER_ON 0x84
|
||||
#define GB_POWER_OFF 0xFE
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* 0x0 */ __OSInode inode;
|
||||
/* 0x100 */ u8 bank;
|
||||
/* 0x101 */ u8 map[PFS_INODE_DIST_MAP];
|
||||
} __OSInodeCache;
|
||||
|
||||
extern s32 __osEepStatus(OSMesgQueue *, OSContStatus *);
|
||||
u16 __osSumcalc(u8 *ptr, int length);
|
||||
s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum);
|
||||
|
||||
-4384
File diff suppressed because it is too large
Load Diff
-108
@@ -1,108 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os.h,v $
|
||||
$Revision: 1.168 $
|
||||
$Date: 2000/06/15 06:24:52 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_H_
|
||||
#define _OS_H_
|
||||
|
||||
#include <PR/os_thread.h>
|
||||
#include <PR/os_message.h>
|
||||
#include <PR/os_exception.h>
|
||||
#include <PR/os_tlb.h>
|
||||
#include <PR/os_pi.h>
|
||||
#include <PR/os_vi.h>
|
||||
#include <PR/os_ai.h>
|
||||
#include <PR/os_si.h>
|
||||
#include <PR/os_time.h>
|
||||
#include <PR/os_cont.h>
|
||||
#include <PR/os_pfs.h>
|
||||
#include <PR/os_gbpak.h>
|
||||
#include <PR/os_voice.h>
|
||||
#include <PR/os_cache.h>
|
||||
#include <PR/os_debug.h>
|
||||
#include <PR/os_error.h>
|
||||
#include <PR/os_gio.h>
|
||||
#include <PR/os_reg.h>
|
||||
#include <PR/os_system.h>
|
||||
#include <PR/os_eeprom.h>
|
||||
#include <PR/os_flash.h>
|
||||
#include <PR/os_host.h>
|
||||
#include <PR/os_convert.h>
|
||||
#include <PR/os_rdp.h>
|
||||
#include <PR/os_rsp.h>
|
||||
#include <PR/os_motor.h>
|
||||
#include <PR/os_libc.h>
|
||||
#include <PR/os_version.h>
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Stack size for I/O device managers: PIM (PI Manager), VIM (VI Manager),
|
||||
* SIM (SI Manager)
|
||||
*
|
||||
*/
|
||||
#define OS_PIM_STACKSIZE 4096
|
||||
#define OS_VIM_STACKSIZE 4096
|
||||
#define OS_SIM_STACKSIZE 4096
|
||||
|
||||
#define OS_MIN_STACKSIZE 72
|
||||
|
||||
/*
|
||||
* Leo Disk
|
||||
*/
|
||||
|
||||
/* transfer mode */
|
||||
|
||||
#define LEO_BLOCK_MODE 1
|
||||
#define LEO_TRACK_MODE 2
|
||||
#define LEO_SECTOR_MODE 3
|
||||
|
||||
/*
|
||||
* Boot addresses
|
||||
*/
|
||||
#define BOOT_ADDRESS_ULTRA 0x80000400
|
||||
#define BOOT_ADDRESS_COSIM 0x80002000
|
||||
#define BOOT_ADDRESS_EMU 0x20010000
|
||||
#define BOOT_ADDRESS_INDY 0x88100000
|
||||
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_H */
|
||||
@@ -1,92 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_ai.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_ai.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:04 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_AI_H_
|
||||
#define _OS_AI_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Audio interface (Ai) */
|
||||
extern u32 osAiGetStatus(void);
|
||||
extern u32 osAiGetLength(void);
|
||||
extern s32 osAiSetFrequency(u32);
|
||||
extern s32 osAiSetNextBuffer(void *, u32);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_AI_H_ */
|
||||
@@ -1,96 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_cache.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_cache.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:04 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_CACHE_H_
|
||||
#define _OS_CACHE_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10))
|
||||
#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10))
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Cache operations and macros */
|
||||
|
||||
extern void osInvalDCache(void *, s32);
|
||||
extern void osInvalICache(void *, s32);
|
||||
extern void osWritebackDCache(void *, s32);
|
||||
extern void osWritebackDCacheAll(void);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_CACHE_H_ */
|
||||
@@ -1,208 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_cont.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_cont.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:05 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_CONT_H_
|
||||
#define _OS_CONT_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "os_message.h"
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Structure for controllers
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
u16 type; /* Controller Type */
|
||||
u8 status; /* Controller status */
|
||||
u8 errno;
|
||||
}OSContStatus;
|
||||
|
||||
typedef struct {
|
||||
u16 button;
|
||||
s8 stick_x; /* -80 <= stick_x <= 80 */
|
||||
s8 stick_y; /* -80 <= stick_y <= 80 */
|
||||
u8 errno;
|
||||
} OSContPad;
|
||||
|
||||
typedef struct {
|
||||
void *address; /* Ram pad Address: 11 bits */
|
||||
u8 databuffer[32]; /* address of the data buffer */
|
||||
u8 addressCrc; /* CRC code for address */
|
||||
u8 dataCrc; /* CRC code for data */
|
||||
u8 errno;
|
||||
} OSContRamIo;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Controllers number
|
||||
*/
|
||||
|
||||
#ifndef _HW_VERSION_1
|
||||
#define MAXCONTROLLERS 4
|
||||
#else
|
||||
#define MAXCONTROLLERS 6
|
||||
#endif
|
||||
|
||||
/* controller errors */
|
||||
#define CONT_NO_RESPONSE_ERROR 0x8
|
||||
#define CONT_OVERRUN_ERROR 0x4
|
||||
#define CONT_RANGE_ERROR -1
|
||||
#ifdef _HW_VERSION_1
|
||||
#define CONT_FRAME_ERROR 0x2
|
||||
#define CONT_COLLISION_ERROR 0x1
|
||||
#endif
|
||||
|
||||
/* Controller type */
|
||||
|
||||
#define CONT_ABSOLUTE 0x0001
|
||||
#define CONT_RELATIVE 0x0002
|
||||
#define CONT_JOYPORT 0x0004
|
||||
#define CONT_EEPROM 0x8000
|
||||
#define CONT_EEP16K 0x4000
|
||||
#define CONT_TYPE_MASK 0x1f07
|
||||
#define CONT_TYPE_NORMAL 0x0005
|
||||
#define CONT_TYPE_MOUSE 0x0002
|
||||
#define CONT_TYPE_VOICE 0x0100
|
||||
|
||||
/* Controller status */
|
||||
|
||||
#define CONT_CARD_ON 0x01
|
||||
#define CONT_CARD_PULL 0x02
|
||||
#define CONT_ADDR_CRC_ER 0x04
|
||||
#define CONT_EEPROM_BUSY 0x80
|
||||
|
||||
/* Buttons */
|
||||
|
||||
#define CONT_A 0x8000
|
||||
#define CONT_B 0x4000
|
||||
#define CONT_G 0x2000
|
||||
#define CONT_START 0x1000
|
||||
#define CONT_UP 0x0800
|
||||
#define CONT_DOWN 0x0400
|
||||
#define CONT_LEFT 0x0200
|
||||
#define CONT_RIGHT 0x0100
|
||||
#define CONT_L 0x0020
|
||||
#define CONT_R 0x0010
|
||||
#define CONT_E 0x0008
|
||||
#define CONT_D 0x0004
|
||||
#define CONT_C 0x0002
|
||||
#define CONT_F 0x0001
|
||||
|
||||
/* Nintendo's official button names */
|
||||
|
||||
#define A_BUTTON CONT_A
|
||||
#define B_BUTTON CONT_B
|
||||
#define L_TRIG CONT_L
|
||||
#define R_TRIG CONT_R
|
||||
#define Z_TRIG CONT_G
|
||||
#define START_BUTTON CONT_START
|
||||
#define U_JPAD CONT_UP
|
||||
#define L_JPAD CONT_LEFT
|
||||
#define R_JPAD CONT_RIGHT
|
||||
#define D_JPAD CONT_DOWN
|
||||
#define U_CBUTTONS CONT_E
|
||||
#define L_CBUTTONS CONT_C
|
||||
#define R_CBUTTONS CONT_F
|
||||
#define D_CBUTTONS CONT_D
|
||||
|
||||
/* Controller error number */
|
||||
|
||||
#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */
|
||||
#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */
|
||||
#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */
|
||||
#define CONT_ERR_DEVICE PFS_ERR_DEVICE /* 11 */
|
||||
#define CONT_ERR_NOT_READY 12
|
||||
#define CONT_ERR_VOICE_MEMORY 13
|
||||
#define CONT_ERR_VOICE_WORD 14
|
||||
#define CONT_ERR_VOICE_NO_RESPONSE 15
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Controller interface */
|
||||
|
||||
extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *);
|
||||
extern s32 osContReset(OSMesgQueue *, OSContStatus *);
|
||||
extern s32 osContStartQuery(OSMesgQueue *);
|
||||
extern s32 osContStartReadData(OSMesgQueue *);
|
||||
#ifndef _HW_VERSION_1
|
||||
extern s32 osContSetCh(u8);
|
||||
#endif
|
||||
extern void osContGetQuery(OSContStatus *);
|
||||
extern void osContGetReadData(OSContPad *);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_CONT_H_ */
|
||||
@@ -1,111 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_convert.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_convert.h,v $
|
||||
$Revision: 1.2 $
|
||||
$Date: 1999/04/21 02:53:11 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_CONVERT_H_
|
||||
#define _OS_CONVERT_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#define OS_CLOCK_RATE 62500000LL
|
||||
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL))
|
||||
#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
|
||||
#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL))
|
||||
#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL))
|
||||
|
||||
/* OS_K?_TO_PHYSICAL macro bug fix for CodeWarrior */
|
||||
#ifndef __MWERKS__
|
||||
#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
|
||||
#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000))
|
||||
#else
|
||||
#define OS_K0_TO_PHYSICAL(x) ((char *)(x)-0x80000000)
|
||||
#define OS_K1_TO_PHYSICAL(x) ((char *)(x)-0xa0000000)
|
||||
#endif
|
||||
|
||||
#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000))
|
||||
#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000))
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Address translation routines and macros */
|
||||
|
||||
extern u32 osVirtualToPhysical(void *);
|
||||
extern void * osPhysicalToVirtual(u32);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_CONVERT_H_ */
|
||||
@@ -1,117 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_debug.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_debug.h,v $
|
||||
$Revision: 1.4 $
|
||||
$Date: 1999/06/30 03:04:08 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_DEBUG_H_
|
||||
#define _OS_DEBUG_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Structure for Profiler
|
||||
*/
|
||||
typedef struct {
|
||||
u16 *histo_base; /* histogram base */
|
||||
u32 histo_size; /* histogram size */
|
||||
u32 *text_start; /* start of text segment */
|
||||
u32 *text_end; /* end of text segment */
|
||||
} OSProf;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Profiler constants
|
||||
*/
|
||||
#define PROF_MIN_INTERVAL 50 /* microseconds */
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Profiler Interface */
|
||||
|
||||
extern void osProfileInit(OSProf *, u32 profcnt);
|
||||
extern void osProfileStart(u32);
|
||||
extern void osProfileFlush(void);
|
||||
extern void osProfileStop(void);
|
||||
|
||||
/* Thread Profiler Interface */
|
||||
extern void osThreadProfileClear(OSId);
|
||||
extern void osThreadProfileInit(void);
|
||||
extern void osThreadProfileStart(void);
|
||||
extern void osThreadProfileStop(void);
|
||||
extern u32 osThreadProfileReadCount(OSId);
|
||||
extern u32 osThreadProfileReadCountTh(OSThread*);
|
||||
extern OSTime osThreadProfileReadTime(OSId);
|
||||
extern OSTime osThreadProfileReadTimeTh(OSThread*);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_DEBUG_H_ */
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_eeprom.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_eeprom.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:06 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_EEPROM_H_
|
||||
#define _OS_EEPROM_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "PR/os_message.h"
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* EEPROM TYPE */
|
||||
|
||||
#define EEPROM_TYPE_4K 0x01
|
||||
#define EEPROM_TYPE_16K 0x02
|
||||
|
||||
/* definition for EEPROM */
|
||||
|
||||
#define EEPROM_MAXBLOCKS 64
|
||||
#define EEP16K_MAXBLOCKS 256
|
||||
#define EEPROM_BLOCK_SIZE 8
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* EEPROM interface */
|
||||
|
||||
extern s32 osEepromProbe(OSMesgQueue *);
|
||||
extern s32 osEepromRead(OSMesgQueue *, u8, u8 *);
|
||||
extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *);
|
||||
extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int);
|
||||
extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_EEPROM_H_ */
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_error.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_error.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:06 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_ERROR_H_
|
||||
#define _OS_ERROR_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_ERROR_H_ */
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_exception.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_exception.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:07 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_EXCEPTION_H_
|
||||
#define _OS_EXCEPTION_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
typedef u32 OSIntMask;
|
||||
typedef u32 OSHWIntr;
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/* Flags for debugging purpose */
|
||||
|
||||
#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */
|
||||
#define OS_FLAG_FAULT 2 /* CPU fault has occurred */
|
||||
|
||||
/* Interrupt masks */
|
||||
|
||||
#define OS_IM_NONE 0x00000001
|
||||
#define OS_IM_RCP 0x00000401
|
||||
#define OS_IM_SW1 0x00000501
|
||||
#define OS_IM_SW2 0x00000601
|
||||
#define OS_IM_CART 0x00000c01
|
||||
#define OS_IM_PRENMI 0x00001401
|
||||
#define OS_IM_RDBWRITE 0x00002401
|
||||
#define OS_IM_RDBREAD 0x00004401
|
||||
#define OS_IM_COUNTER 0x00008401
|
||||
#define OS_IM_CPU 0x0000ff01
|
||||
#define OS_IM_SP 0x00010401
|
||||
#define OS_IM_SI 0x00020401
|
||||
#define OS_IM_AI 0x00040401
|
||||
#define OS_IM_VI 0x00080401
|
||||
#define OS_IM_PI 0x00100401
|
||||
#define OS_IM_DP 0x00200401
|
||||
#define OS_IM_ALL 0x003fff01
|
||||
#define RCP_IMASK 0x003f0000
|
||||
#define RCP_IMASKSHIFT 16
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/* Interrupt operations */
|
||||
|
||||
extern OSIntMask osGetIntMask(void);
|
||||
extern OSIntMask osSetIntMask(OSIntMask);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_EXCEPTION_H_ */
|
||||
@@ -1,77 +0,0 @@
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_flash.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 2000/06/15 06:24:55 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_FLASH_H_
|
||||
#define _OS_FLASH_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "PR/ultratypes.h"
|
||||
#include "PR/os_pi.h"
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/*
|
||||
* defines for FLASH
|
||||
*/
|
||||
#define FLASH_START_ADDR 0x08000000
|
||||
|
||||
#define FLASH_SIZE 0x20000
|
||||
|
||||
#define FLASH_LATENCY 0x5
|
||||
#define FLASH_PULSE 0x0c
|
||||
#define FLASH_PAGE_SIZE 0xf
|
||||
#define FLASH_REL_DURATION 0x2
|
||||
#define DEVICE_TYPE_FLASH 8
|
||||
|
||||
#define FLASH_VERSION_MX_PROTO_A 0x00c20000
|
||||
#define FLASH_VERSION_MX_A 0x00c20001
|
||||
#define FLASH_VERSION_MX_C 0x00c2001e
|
||||
#define FLASH_VERSION_MX_B_AND_D 0x00c2001d
|
||||
#define FLASH_VERSION_MEI 0x003200f1
|
||||
|
||||
/* OLD_FLASH is MX_PROTO_A, MX_A and MX_C */
|
||||
#define OLD_FLASH 0
|
||||
/* NEW_FLASH is MX_B_AND_D and MATSUSHITA flash */
|
||||
#define NEW_FLASH 1
|
||||
|
||||
#define FLASH_STATUS_ERASE_BUSY 2
|
||||
#define FLASH_STATUS_ERASE_OK 0
|
||||
#define FLASH_STATUS_ERASE_ERROR -1
|
||||
|
||||
#define FLASH_STATUS_WRITE_BUSY 1
|
||||
#define FLASH_STATUS_WRITE_OK 0
|
||||
#define FLASH_STATUS_WRITE_ERROR -1
|
||||
|
||||
extern OSPiHandle *osFlashReInit(u8 latency, u8 pulse,
|
||||
u8 page_size, u8 rel_duration, u32 start);
|
||||
extern OSPiHandle *osFlashInit(void);
|
||||
extern void osFlashReadStatus(u8 *flash_status);
|
||||
extern void osFlashReadId(u32 *flash_type, u32 *flash_maker);
|
||||
extern void osFlashClearStatus(void);
|
||||
extern s32 osFlashAllErase(void);
|
||||
extern s32 osFlashSectorErase(u32 page_num);
|
||||
extern s32 osFlashWriteBuffer(OSIoMesg *mb, s32 priority,
|
||||
void *dramAddr, OSMesgQueue *mq);
|
||||
extern s32 osFlashWriteArray(u32 page_num);
|
||||
extern s32 osFlashReadArray(OSIoMesg *mb, s32 priority, u32 page_num,
|
||||
void *dramAddr, u32 n_pages, OSMesgQueue *mq);
|
||||
extern void osFlashChange(u32 flash_num);
|
||||
extern void osFlashAllEraseThrough(void);
|
||||
extern void osFlashSectorEraseThrough(u32 page_num);
|
||||
extern s32 osFlashCheckEraseEnd(void);
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_FLASH_H_ */
|
||||
@@ -1,107 +0,0 @@
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo.
|
||||
|
||||
$RCSfile: os_gbpak.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:07 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_GBPAK_H_
|
||||
#define _OS_GBPAK_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include "os_message.h"
|
||||
#include "os_pfs.h"
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
u16 fixed1;
|
||||
u16 start_address;
|
||||
u8 nintendo_chr[0x30];
|
||||
u8 game_title[16];
|
||||
u16 company_code;
|
||||
u8 body_code;
|
||||
u8 cart_type;
|
||||
u8 rom_size;
|
||||
u8 ram_size;
|
||||
u8 country_code;
|
||||
u8 fixed2;
|
||||
u8 version;
|
||||
u8 isum;
|
||||
u16 sum;
|
||||
} OSGbpakId;
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
/* definition for 64GB-PAK */
|
||||
|
||||
#define OS_GBPAK_POWER 0x01
|
||||
#define OS_GBPAK_RSTB_DETECTION 0x04
|
||||
#define OS_GBPAK_RSTB_STATUS 0x08
|
||||
#define OS_GBPAK_GBCART_PULL 0x40
|
||||
#define OS_GBPAK_GBCART_ON 0x80
|
||||
|
||||
#define OS_GBPAK_POWER_OFF 0x00 /* power of 64GB-PAK */
|
||||
#define OS_GBPAK_POWER_ON 0x01
|
||||
|
||||
#define OS_GBPAK_ROM_ID_SIZE 0x50 /* ID size of GB cartridge */
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* 64GB-PAK */
|
||||
extern s32 osGbpakInit(OSMesgQueue *, OSPfs *, int);
|
||||
extern s32 osGbpakPower(OSPfs *, s32);
|
||||
extern s32 osGbpakGetStatus(OSPfs *, u8 *);
|
||||
extern s32 osGbpakReadWrite(OSPfs *, u16, u16, u8 *, u16);
|
||||
extern s32 osGbpakReadId(OSPfs *, OSGbpakId *, u8 *);
|
||||
extern s32 osGbpakCheckConnector(OSPfs *, u8 *);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_GBPAK_H_ */
|
||||
@@ -1,86 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_gio.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_gio.h,v $
|
||||
$Revision: 1.1 $
|
||||
$Date: 1998/10/09 08:01:08 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_GIO_H_
|
||||
#define _OS_GIO_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_GIO_H_ */
|
||||
@@ -1,166 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_host.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_host.h,v $
|
||||
$Revision: 1.3 $
|
||||
$Date: 1999/06/24 09:23:06 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_HOST_H_
|
||||
#define _OS_HOST_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
#include <PR/os_version.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
extern void __osInitialize_common(void);
|
||||
|
||||
#if defined(_FINALROM)
|
||||
|
||||
#define osInitialize() __osInitialize_common()
|
||||
|
||||
#else
|
||||
|
||||
/* PARTNER-N64 */
|
||||
#if defined(PTN64)
|
||||
extern void __osInitialize_kmc(void);
|
||||
#define osReadHost osReadHost_pt
|
||||
#define osWriteHost osWriteHost_pt
|
||||
#define osInitialize() \
|
||||
{ \
|
||||
__osInitialize_common(); \
|
||||
__osInitialize_kmc(); \
|
||||
}
|
||||
|
||||
/* MONEGI SMART PACK A */
|
||||
#elif defined(MWN64)
|
||||
extern void __osInitialize_msp(void);
|
||||
#define osReadHost osReadHost_pt
|
||||
#define osWriteHost osWriteHost_pt
|
||||
#define osInitialize() \
|
||||
{ \
|
||||
__osInitialize_common(); \
|
||||
__osInitialize_msp(); \
|
||||
}
|
||||
|
||||
/* IS-Viewer(for Debugger) */
|
||||
#elif defined(ISV64)
|
||||
extern void __osInitialize_isv(void);
|
||||
#define osInitialize() \
|
||||
{ \
|
||||
__osInitialize_common(); \
|
||||
__osInitialize_isv(); \
|
||||
}
|
||||
|
||||
/* Emulation board for INDY */
|
||||
#elif defined(EMU64)
|
||||
extern void __osInitialize_emu(void);
|
||||
#define osInitialize() \
|
||||
{ \
|
||||
__osInitialize_common(); \
|
||||
__osInitialize_emu(); \
|
||||
}
|
||||
|
||||
#else
|
||||
/* Default (auto detect) */
|
||||
extern void __osInitialize_autodetect(void);
|
||||
extern void __osInitialize_msp(void);
|
||||
extern void __osInitialize_kmc(void);
|
||||
extern void __osInitialize_isv(void);
|
||||
extern void __osInitialize_emu(void);
|
||||
#define osInitialize() \
|
||||
{ \
|
||||
__osInitialize_common(); \
|
||||
__osInitialize_autodetect(); \
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _FINAL_ROM */
|
||||
|
||||
#if BUILD_VERSION < VERSION_K
|
||||
#undef osInitialize
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* Game <> Host data transfer functions */
|
||||
|
||||
extern s32 osTestHost(void);
|
||||
extern void osReadHost(void *, u32);
|
||||
extern void osWriteHost(void *, u32);
|
||||
extern void osAckRamromRead(void);
|
||||
extern void osAckRamromWrite(void);
|
||||
|
||||
/* RDB port operations */
|
||||
|
||||
extern void osInitRdb(u8 *sendBuf, u32 sendSize);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_HOST_H_ */
|
||||
@@ -1,119 +0,0 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1995, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* $Revision: 1.18 $
|
||||
* $Date: 1997/02/11 08:26:14 $
|
||||
* $Source: /disk6/Master/cvsmdev2/PR/include/os_internal.h,v $
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _OS_INTERNAL_H_
|
||||
#define _OS_INTERNAL_H_
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/os.h>
|
||||
#include "PR/os_version.h"
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/* Routines to get/fetch coprocessor 0 registers */
|
||||
|
||||
extern u32 __osGetCause(void);
|
||||
extern void __osSetCause(u32);
|
||||
extern u32 __osGetCompare(void);
|
||||
extern void __osSetCompare(u32);
|
||||
extern u32 __osGetConfig(void);
|
||||
extern void __osSetConfig(u32);
|
||||
extern void __osSetCount(u32);
|
||||
extern u32 __osGetSR(void);
|
||||
extern void __osSetSR(u32);
|
||||
extern u32 __osDisableInt(void);
|
||||
extern void __osRestoreInt(u32);
|
||||
|
||||
/* Routines to get/set floating-point control and status register */
|
||||
extern u32 __osSetFpcCsr(u32);
|
||||
extern u32 __osGetFpcCsr(void);
|
||||
|
||||
/* Routine for HW interrupt "handler" */
|
||||
extern void __osSetHWIntrRoutine(OSHWIntr, s32 (*handler)(void));
|
||||
|
||||
/* Routine for global interrupt mask */
|
||||
extern void __osSetGlobalIntMask(OSHWIntr);
|
||||
extern void __osResetGlobalIntMask(OSHWIntr);
|
||||
|
||||
/* Routine for global interrupt mask */
|
||||
extern s32 __osLeoInterrupt(void);
|
||||
|
||||
/* Routines for fetch TLB info */
|
||||
|
||||
extern u32 __osGetTLBASID(void);
|
||||
extern u32 __osGetTLBPageMask(s32);
|
||||
extern u32 __osGetTLBHi(s32);
|
||||
extern u32 __osGetTLBLo0(s32);
|
||||
extern u32 __osGetTLBLo1(s32);
|
||||
|
||||
/* Serial interface (Si) */
|
||||
|
||||
extern u32 __osSiGetStatus(void);
|
||||
extern s32 __osSiRawWriteIo(u32, u32);
|
||||
extern s32 __osSiRawReadIo(u32, u32 *);
|
||||
extern s32 __osSiRawStartDma(s32, void *);
|
||||
|
||||
/* Signal processor interface (Sp) */
|
||||
|
||||
extern u32 __osSpGetStatus(void);
|
||||
extern void __osSpSetStatus(u32);
|
||||
extern s32 __osSpSetPc(u32);
|
||||
extern s32 __osSpRawWriteIo(u32, u32);
|
||||
extern s32 __osSpRawReadIo(u32, u32 *);
|
||||
extern s32 __osSpRawStartDma(s32, u32, void *, u32);
|
||||
|
||||
/* Error handling */
|
||||
|
||||
extern void __osError(s16, s16, ...);
|
||||
extern OSThread * __osGetCurrFaultedThread(void);
|
||||
extern OSThread * __osGetNextFaultedThread(OSThread *);
|
||||
|
||||
/* Development board functions */
|
||||
|
||||
extern void __osGIOInit(s32);
|
||||
extern void __osGIOInterrupt(s32);
|
||||
extern void __osGIORawInterrupt(s32);
|
||||
|
||||
/* For debugger use */
|
||||
|
||||
extern OSThread * __osGetActiveQueue(void);
|
||||
|
||||
/* Debug port */
|
||||
extern void __osSyncPutChars(int, int, const char *);
|
||||
extern int __osSyncGetChars(char *);
|
||||
extern void __osAsyncPutChars(int, int, const char *);
|
||||
extern int __osAsyncGetChars(char *);
|
||||
extern int __osAtomicInc(unsigned int *p);
|
||||
extern int __osAtomicDec(unsigned int *p);
|
||||
|
||||
/* routine for rdb port */
|
||||
extern u32 __osRdbSend(u8 *buf, u32 size, u32 type);
|
||||
|
||||
|
||||
#endif /* _LANGUAGE_C */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_INTERNAL_H */
|
||||
@@ -1,100 +0,0 @@
|
||||
|
||||
/*====================================================================
|
||||
* os_libc.h
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
* in Technical Data and Computer Software clause at DFARS
|
||||
* 252.227-7013, and/or in similar or successor clauses in the FAR,
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
Copyright (C) 1998 Nintendo. (Originated by SGI)
|
||||
|
||||
$RCSfile: os_libc.h,v $
|
||||
$Revision: 1.3 $
|
||||
$Date: 1999/07/13 01:43:47 $
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _OS_LIBC_H_
|
||||
#define _OS_LIBC_H_
|
||||
|
||||
#include "os_pfs.h"
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <PR/ultratypes.h>
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Type definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Global definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Macro definitions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Extern variables
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
*
|
||||
* Function prototypes
|
||||
*
|
||||
*/
|
||||
|
||||
/* byte string operations */
|
||||
|
||||
|
||||
extern void bcopy(const void *, void *, int);
|
||||
extern int bcmp(const void *, const void *, int);
|
||||
extern void bzero(void *, int);
|
||||
|
||||
/* Printf */
|
||||
|
||||
extern int sprintf(char *s, const char *fmt, ...);
|
||||
extern void osSyncPrintf(const char *fmt, ...);
|
||||
|
||||
|
||||
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
|
||||
|
||||
#ifdef _LANGUAGE_C_PLUS_PLUS
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_OS_LIBC_H_ */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user