Compare commits

..

6 Commits

77 changed files with 505 additions and 1248 deletions

View File

@@ -31,7 +31,7 @@
"compilerPath": "/usr/bin/mips-linux-gnu-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++14",
"intelliSenseMode": "linux-gcc-x86"
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4

View File

@@ -119,10 +119,20 @@ else ifeq ($(GRUCODE),super3d) # Super3D
DEFINES += SUPER3D_GBI=1 F3D_NEW=1
endif
LIBRARIES := nustd hvqm2 z goddard
# TEXT ENGINES
# s2dex_text_engine - Text Engine by someone2639
TEXT_ENGINE := none
$(eval $(call validate-option,TEXT_ENGINE,none s2dex_text_engine))
ifeq ($(TEXT_ENGINE), s2dex_text_engine)
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
LIBRARIES += s2d_engine
DUMMY != make -C src/s2d_engine COPY_DIR=$(shell pwd)/lib/
endif
# add more text engines here
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
#==============================================================================#
# Optimization flags #
@@ -200,12 +210,6 @@ endif
# 0 - does not
UNF ?= 0
$(eval $(call validate-option,UNF,0 1))
# if `unf` is a target, make sure that UNF is set
ifneq ($(filter unf,$(MAKECMDGOALS)),)
UNF = 1
endif
ifeq ($(UNF),1)
DEFINES += UNF=1
SRC_DIRS += src/usb
@@ -407,18 +411,6 @@ else
$(error Unable to detect a suitable MIPS toolchain installed)
endif
LIBRARIES := nustd hvqm2 z goddard
# Text engine
ifeq ($(TEXT_ENGINE), s2dex_text_engine)
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
LIBRARIES += s2d_engine
DUMMY != $(MAKE) -C src/s2d_engine COPY_DIR=$(shell pwd)/lib/ CROSS=$(CROSS)
endif
# add more text engines here
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
export LD_LIBRARY_PATH=./tools
AS := $(CROSS)as
@@ -510,13 +502,8 @@ endif
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
EMULATOR = mupen64plus
EMU_FLAGS =
ifneq (,$(call find-command,wslview))
LOADER = ./$(TOOLS_DIR)/UNFLoader.exe
else
LOADER = ./$(TOOLS_DIR)/UNFLoader
endif
LOADER = loader64
LOADER_FLAGS = -vwf
SHA1SUM = sha1sum
PRINT = printf
@@ -566,18 +553,8 @@ test-pj64: $(ROM)
wine ~/Desktop/new64/Project64.exe $<
# someone2639
# download and extract most recent unfloader build if needed
$(LOADER):
ifeq (,$(wildcard $(LOADER)))
@$(PRINT) "Downloading latest UNFLoader...$(NO_COL)\n"
$(PYTHON) $(TOOLS_DIR)/get_latest_unfloader.py $(TOOLS_DIR)
endif
load: $(ROM) $(LOADER)
$(LOADER) -r $<
unf: $(ROM) $(LOADER)
$(LOADER) -d -r $<
load: $(ROM)
$(LOADER) $(LOADER_FLAGS) $<
libultra: $(BUILD_DIR)/libultra.a
@@ -873,16 +850,8 @@ $(ELF): $(BUILD_DIR)/sm64_prelim.elf $(BUILD_DIR)/asm/debug/map.o $(O_FILES) $(Y
$(V)$(LD) --gc-sections -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -T goddard.txt -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L$(LIBS_DIR) -l$(ULTRALIB) -Llib $(LINK_LIBRARIES) -u sprintf -u osMapTLB -Llib/gcclib/$(LIBGCCDIR) -lgcc -lrtc
# Build ROM
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
# run with -n / --dry-run
$(ROM):
@$(PRINT) "$(BLUE)DRY RUNS ARE DISABLED$(NO_COL)\n"
else
# not running with -n / --dry-run
$(ROM): $(ELF)
$(call print,Building ROM:,$<,$@)
endif
ifeq ($(CONSOLE),n64)
$(V)$(OBJCOPY) --pad-to=0x101000 --gap-fill=0xFF $< $@ -O binary
else ifeq ($(CONSOLE),bb)

View File

@@ -14,7 +14,7 @@ This is a fork of the ultrasm64 repo by CrashOveride which includes the followin
- **ArcticJaguar725**: Most audio configuration and layout changes, colored ia4 text, floombas, various bugfixes, and more
- **CowQuack**: Adjustable skybox sizes, area-specific skybox function
- **thecozies**: Water surface types, general maintenance, and time
- **MrComit**: General use object defines, JUMP_KICK_FIX
- **MrComit**: General use object defines, JUMP_KICK_FIX, LEDGE_GRABS_CHECK_SLOPE_ANGLE
- **aglab2**: Bugfixes (particularly puppycam), refactor stuff
- **someone2639**: math.s and crash screen disam, stack trace, map packing, shiftable segments 2, S2DEX engine
- **Arthurtilly**: Platform Displacement 2
@@ -61,6 +61,7 @@ Thanks to Frame#5375 and AloXado320 for also helping with silhouette stuff
- Toggle to disable fall damage and the fall damage sound *
- Nonstop stars *
- Removed course-specific camera processing *
- You can increase the number of frames that you have to perform a firsty *
- Ability to set Mario's movement speed when hanging from a ceiling *
- Tighter hanging controls (Mario will face the direction of the analog stick directly while hanging from a ceiling) *
- reonucam3: custom camera by Reonu. This is included as a .patch file in the enhancements folder, you need to apply it if you want this camera.

View File

@@ -1 +1 @@
v2.0.5
v2.0.3

View File

@@ -15,14 +15,9 @@
.word 0x00000000 /* Unknown */
.word 0x00000000 /* Unknown */
.ascii INTERNAL_ROM_NAME /* Internal ROM name */
#if defined(USE_GAMECUBE_CONTROLLER)
/* Advanced homebrew ROM header bytes: https://n64brew.dev/wiki/ROM_Header#Advanced_Homebrew_ROM_Header */
.word 0x82000000
#else
.word 0x00000000 /* Unknown */
#endif
.word 0x0000004E /* Cartridge */
#if defined(EEP4K) && !defined(USE_GAMECUBE_CONTROLLER)
#if defined(EEP4K)
.ascii "SM" /* Cartridge ID */
#else
.ascii "ED" /* Cartridge ID */

View File

@@ -1679,9 +1679,9 @@ const BehaviorScript bhvWfSolidTowerPlatform[] = {
BEGIN(OBJ_LIST_SURFACE),
OR_INT(oFlags, (OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
LOAD_COLLISION_DATA(wf_seg7_collision_platform),
CALL_NATIVE(load_object_static_model),
BEGIN_LOOP(),
CALL_NATIVE(bhv_wf_solid_tower_platform_loop),
CALL_NATIVE(load_object_collision_model),
END_LOOP(),
};
@@ -2626,7 +2626,6 @@ const BehaviorScript bhvExclamationBox[] = {
OR_INT(oFlags, OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE),
SET_FLOAT(oCollisionDistance, 300),
SET_HOME(),
CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(),
CALL_NATIVE(bhv_exclamation_box_loop),
END_LOOP(),
@@ -3773,7 +3772,6 @@ const BehaviorScript bhvMessagePanel[] = {
DROP_TO_FLOOR(),
SET_HITBOX(/*Radius*/ 150, /*Height*/ 80),
SET_INT(oWoodenPostTotalMarioAngle, 0),
CALL_NATIVE(bhv_init_room),
CALL_NATIVE(load_object_static_model),
BEGIN_LOOP(),
SET_INT(oIntangibleTimer, 0),
@@ -5602,7 +5600,6 @@ const BehaviorScript bhvActivatedBackAndForthPlatform[] = {
const BehaviorScript bhvRecoveryHeart[] = {
BEGIN(OBJ_LIST_LEVEL),
OR_INT(oFlags, (OBJ_FLAG_COMPUTE_ANGLE_TO_MARIO | OBJ_FLAG_COMPUTE_DIST_TO_MARIO | OBJ_FLAG_UPDATE_GFX_POS_AND_ANGLE)),
CALL_NATIVE(bhv_init_room),
BEGIN_LOOP(),
CALL_NATIVE(bhv_recovery_heart_loop),
END_LOOP(),

View File

@@ -14,13 +14,6 @@
*/
// #define JP_RED_COIN_SOUND
/**
* In vanilla, Mario's sounds are pitch shifted in real time in order to maintain a sense of consistency. This can be annoying when replacing Mario's sounds.
* This define will disable this behavior, making sound replacements easier to manage. Use of this is not recommended unless you're actually replacing Mario's sounds.
* When toggling this define, you will need to run `make clean` for it to apply.
*/
// #define DISABLE_MARIO_PITCH_SHIFTING
/**
* Increase audio heap size to allow for larger/more custom sequences/banks/sfx to be imported without causing issues (not supported for SH).
* Note that this is REQUIRED in order to use the extended 0C audio bank. Do not disable this if you're planning on using it.

View File

@@ -9,9 +9,3 @@
* Currently this just starts the credits, and enables PUPPYPRINT_DEBUG.
*/
// #define ENABLE_CREDITS_BENCHMARK
#ifdef ENABLE_CREDITS_BENCHMARK
#define DEBUG_ALL
#define ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS
#define TEST_LEVEL LEVEL_CASTLE_GROUNDS
#endif

View File

@@ -44,16 +44,6 @@
*/
#define PARALLEL_LAKITU_CAM
/**
* These defines decide whether the turning, error and zoom out/zoom in out sounds are enabled, and which sounds to play if enabled.
* The turning, zooming out and zooming in sounds have been replaced with less annoying ones.
* If you want the vanilla ones back, set them to SOUND_MENU_CAMERA_TURN, SOUND_MENU_CAMERA_ZOOM_OUT and SOUND_MENU_CAMERA_ZOOM_IN respectively.
*/
#define CAMERA_TURN_SOUND SOUND_MENU_MESSAGE_NEXT_PAGE
#define CAMERA_ZOOM_OUT_SOUND SOUND_MENU_MESSAGE_DISAPPEAR
#define CAMERA_ZOOM_IN_SOUND SOUND_MENU_MESSAGE_APPEAR
// #define CAMERA_ERROR_SOUND SOUND_MENU_CAMERA_BUZZ
/**
* Enables Puppy Camera 2, a rewritten camera that can be freely configured and modified.
*/

View File

@@ -17,7 +17,6 @@
/**
* Allows all surfaces types to have force, (doesn't require setting force, just allows it to be optional).
* Also allows you to pass a warp node to warp floors (SURFACE_WARP, SURFACE_DEATH_PLANE, SURFACE_VERTICAL_WIND) via the second byte of the force parameter.
*/
#define ALL_SURFACES_HAVE_FORCE

View File

@@ -12,7 +12,7 @@
/**
* Disables all debug options (except PUPPYPRINT).
*/
// #define DISABLE_ALL
#define DISABLE_ALL
/**
* Enables a comprehensive standalone profiler. Automatically enabled by PUPPYPRINT_DEBUG.
@@ -21,12 +21,17 @@
#define USE_PROFILER
/**
* -- TEST LEVEL --
* Uncomment this define and set a test level in order to boot straight into said level.
* This allows you to quickly test the level you're working on.
* If you want the game to boot normally, just comment out the define again.
* -- DEBUG STARTUP SPAWN PARAMETERS --
* Sets a level in order to boot straight into said level, skipping the title screen and file select.
* This allows you to quickly test the level or location you're working on.
* NOTE: STARTUP_SPAWN_LEVEL is required for the other parameters to have an effect.
* NOTE: It is recommended to set STARTUP_SPAWN_POS in addition to STARTUP_SPAWN_AREA, otherwise the default position may be out of bounds.
* NOTE: STARTUP_SPAWN_ANGLE is an s16 angle.
*/
// #define TEST_LEVEL LEVEL_BOB
// #define STARTUP_SPAWN_LEVEL LEVEL_BOB
// #define STARTUP_SPAWN_AREA 1
// #define STARTUP_SPAWN_POS 0, 0, 0
// #define STARTUP_SPAWN_ANGLE 0x0
/**
* Enables debug level select. Hold L while the game boots to turn it on.

View File

@@ -108,15 +108,20 @@
*/
#define HANGING_FIX
/**
* The last frame after hitting a wall that will be considered a firsty when wallkicking.
*/
#define FIRSTY_LAST_FRAME 1
/**
* The maximum angle the player can wall kick, in degrees. 0..90. To allow 45 degree wall kicks, you must supply `46` to allow 45 and under.
*/
#define WALL_KICK_DEGREES 45
/**
* Makes Mario unable to ledge grab steep slopes to prevent false ledge grabs.
* This is vanilla behavior, disable it to allow ledge grabbing regardless of floor pitch.
*/
// #define DONT_LEDGE_GRAB_STEEP_SLOPES
// #define LEDGE_GRABS_CHECK_SLOPE_ANGLE
/**
* Disables BLJs and crushes SimpleFlips's dreams.

View File

@@ -28,8 +28,3 @@
*/
#define BORDER_HEIGHT_CONSOLE 0
#define BORDER_HEIGHT_EMULATOR 0
/**
* Informs supported emulators to default to gamecube controller inputs.
*/
// #define USE_GAMECUBE_CONTROLLER

View File

@@ -75,7 +75,10 @@
#ifdef DISABLE_ALL
#undef DEBUG_ALL
#undef TEST_LEVEL
#undef STARTUP_SPAWN_LEVEL
#undef STARTUP_SPAWN_AREA
#undef STARTUP_SPAWN_POS
#undef STARTUP_SPAWN_ANGLE
#undef DEBUG_LEVEL_SELECT
#undef ENABLE_DEBUG_FREE_MOVE
#undef VANILLA_DEBUG
@@ -87,6 +90,7 @@
#undef COMPLETE_SAVE_FILE
#undef DEBUG_FORCE_CRASH_ON_BOOT
#undef USE_PROFILER
#undef ENABLE_CREDITS_BENCHMARK
#endif // DISABLE_ALL
#ifdef DEBUG_ALL
@@ -112,6 +116,12 @@
#define COMPLETE_SAVE_FILE
#endif // DEBUG_ALL
#ifndef STARTUP_SPAWN_LEVEL
#undef STARTUP_SPAWN_AREA
#undef STARTUP_SPAWN_POS
#undef STARTUP_SPAWN_ANGLE
#endif // STARTUP_SPAWN_LEVEL
#ifdef PUPPYPRINT_DEBUG
#undef PUPPYPRINT
#define PUPPYPRINT
@@ -125,6 +135,17 @@
#endif // COMPLETE_SAVE_FILE
/*****************
* config_benchmark.h
*/
#ifdef ENABLE_CREDITS_BENCHMARK
#define DEBUG_ALL
#define ENABLE_VANILLA_LEVEL_SPECIFIC_CHECKS
#define STARTUP_SPAWN_LEVEL LEVEL_CASTLE_GROUNDS
#endif
/*****************
* config_camera.h
*/

View File

@@ -82,7 +82,7 @@ enum LevelActs {
ACT_4 = (1 << 3),
ACT_5 = (1 << 4),
ACT_6 = (1 << 5),
ALL_ACTS = (ACT_1 | ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6),
ALL_ACTS = (ACT_1 | ACT_2 | ACT_3 | ACT_4 | ACT_5 | ACT_6)
};
enum LevelCommandEvalOperation {
@@ -114,6 +114,13 @@ enum WarpCheckpointFlags {
WARP_CHECKPOINT = (1 << 7), // 0x80
};
enum LevelCommandCreateWhirlpoolCondition {
WHIRLPOOL_COND_ALWAYS,
WHIRLPOOL_COND_BOWSER2_NOT_BEATEN,
WHIRLPOOL_COND_BOWSER2_BEATEN,
WHIRLPOOL_COND_AT_LEAST_SECOND_STAR
};
// Head defines
enum GoddardScene {
REGULAR_FACE = 0x2,
@@ -354,7 +361,7 @@ enum GoddardScene {
CMD_W(model)
#define OBJECT(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh) \
OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, ALL_ACTS)
OBJECT_WITH_ACTS(model, posX, posY, posZ, angleX, angleY, angleZ, behParam, beh, 0x1F)
#define MARIO(model, behArg, beh) \
CMD_BBH(LEVEL_CMD_INIT_MARIO, 0x0C, model), \
@@ -370,10 +377,9 @@ enum GoddardScene {
CMD_BBBB(destArea, destNode, flags, 0x00)
#define INSTANT_WARP(index, destArea, displaceX, displaceY, displaceZ) \
CMD_BBBB(LEVEL_CMD_CREATE_INSTANT_WARP, 0x10, index, destArea), \
CMD_W(displaceX), \
CMD_W(displaceY), \
CMD_W(displaceZ)
CMD_BBBB(LEVEL_CMD_CREATE_INSTANT_WARP, 0x0C, index, destArea), \
CMD_HH(displaceX, displaceY), \
CMD_HH(displaceZ, 0x0000)
#define LOAD_AREA(area) \
CMD_BBBB(LEVEL_CMD_LOAD_AREA, 0x04, area, 0x00)
@@ -440,8 +446,8 @@ enum GoddardScene {
CMD_HH(unk6, unk8), \
CMD_HH(unk10, 0x0000)
#define WHIRLPOOL(index, acts, posX, posY, posZ, strength) \
CMD_BBBB(LEVEL_CMD_CREATE_WHIRLPOOL, 0x0C, index, acts), \
#define WHIRLPOOL(index, condition, posX, posY, posZ, strength) \
CMD_BBBB(LEVEL_CMD_CREATE_WHIRLPOOL, 0x0C, index, condition), \
CMD_HH(posX, posY), \
CMD_HH(posZ, strength)

View File

@@ -63,18 +63,6 @@ typedef struct {
u8 error;
} OSContPad;
// Custom extended controller pad struct that contains fields for gamecube controllers
typedef struct {
u16 button;
s8 stick_x; /* -80 <= stick_x <= 80 */
s8 stick_y; /* -80 <= stick_y <= 80 */
s8 c_stick_x;
s8 c_stick_y;
u8 l_trig;
u8 r_trig;
u8 errno;
} OSContPadEx;
typedef struct {
void *address; /* Ram pad Address: 11 bits */
u8 databuffer[32]; /* address of the data buffer */
@@ -115,7 +103,6 @@ typedef struct {
#define CONT_ABSOLUTE 0x0001
#define CONT_RELATIVE 0x0002
#define CONT_JOYPORT 0x0004
#define CONT_GCN 0x0008
#define CONT_EEPROM 0x8000
#define CONT_EEP16K 0x4000
#define CONT_TYPE_MASK 0x1f07
@@ -163,25 +150,6 @@ typedef struct {
#define L_CBUTTONS CONT_C
#define R_CBUTTONS CONT_F
#define D_CBUTTONS CONT_D
#define GCN_X_BUTTON 0x0040
#define GCN_Y_BUTTON 0x0080
/* Gamecube controller buttons */
#define CONT_GCN_GET_ORIGIN 0x2000
#define CONT_GCN_START 0x1000
#define CONT_GCN_Y 0x0800
#define CONT_GCN_X 0x0400
#define CONT_GCN_B 0x0200
#define CONT_GCN_A 0x0100
#define CONT_GCN_USE_ORIGIN 0x0080
#define CONT_GCN_L 0x0040
#define CONT_GCN_R 0x0020
#define CONT_GCN_Z 0x0010
#define CONT_GCN_UP 0x0008
#define CONT_GCN_DOWN 0x0004
#define CONT_GCN_RIGHT 0x0002
#define CONT_GCN_LEFT 0x0001
/* Controller error number */
@@ -194,9 +162,6 @@ typedef struct {
#define CONT_ERR_VOICE_WORD 14
#define CONT_ERR_VOICE_NO_RESPONSE 15
#define CONT_TYPE_N64 0
#define CONT_TYPE_GCN 1
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
@@ -213,7 +178,6 @@ typedef struct {
*
*/
extern u8 __osControllerTypes[MAXCONTROLLERS];
/**************************************************************************
*
@@ -227,13 +191,11 @@ extern s32 osContInit( OSMesgQueue *mq, u8 *bitpattern, OSContStatus *s
extern s32 osContReset( OSMesgQueue *mq, OSContStatus *status);
extern s32 osContStartQuery( OSMesgQueue *mq);
extern s32 osContStartReadData(OSMesgQueue *mq);
extern s32 osContStartReadDataEx(OSMesgQueue *mq);
#ifndef _HW_VERSION_1
extern s32 osContSetCh(u8 ch);
#endif
extern void osContGetQuery(OSContStatus *status);
extern void osContGetReadData(OSContPad *pad);
extern void osContGetReadDataEx(OSContPadEx *pad);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */

View File

@@ -62,14 +62,12 @@ extern "C" {
/* Rumble PAK interface */
extern s32 osMotorInit(OSMesgQueue *mq, OSPfs *pfs, int controller_no);
extern s32 osMotorInitEx(OSMesgQueue *mq, OSPfs *pfs, int controller_no);
#if 1
#define MOTOR_START 1
#define MOTOR_STOP 0
#define osMotorStart(x) __osMotorAccessEx((x), MOTOR_START)
#define osMotorStop(x) __osMotorAccessEx((x), MOTOR_STOP)
#define osMotorStart(x) __osMotorAccess((x), MOTOR_START)
#define osMotorStop(x) __osMotorAccess((x), MOTOR_STOP)
extern s32 __osMotorAccess(OSPfs *pfs, s32 flag);
extern s32 __osMotorAccessEx(OSPfs *pfs, s32 flag);
#else
extern s32 osMotorStop( OSPfs *pfs);
extern s32 osMotorStart(OSPfs *pfs);

View File

@@ -55,7 +55,6 @@ enum ObjFlags {
OBJ_FLAG_OCCLUDE_SILHOUETTE = (1 << 20), // 0x00100000
OBJ_FLAG_OPACITY_FROM_CAMERA_DIST = (1 << 21), // 0x00200000
OBJ_FLAG_EMIT_LIGHT = (1 << 22), // 0x00400000
OBJ_FLAG_PROCESS_OUTSIDE_ROOM = (1 << 23), // 0x00800000
OBJ_FLAG_HITBOX_WAS_SET = (1 << 30), // 0x40000000
};

View File

@@ -153,7 +153,7 @@
#define /*0x17C*/ oOpacity OBJECT_FIELD_S32(0x3D)
#define /*0x180*/ oDamageOrCoinValue OBJECT_FIELD_S32(0x3E)
#define /*0x184*/ oHealth OBJECT_FIELD_S32(0x3F)
#define /*0x188*/ oBehParams OBJECT_FIELD_U32(0x40)
#define /*0x188*/ oBehParams OBJECT_FIELD_S32(0x40)
#define /*0x18C*/ oPrevAction OBJECT_FIELD_S32(0x41)
#define /*0x190*/ oInteractionSubtype OBJECT_FIELD_U32(0x42)
#define /*0x194*/ oCollisionDistance OBJECT_FIELD_F32(0x43)
@@ -606,7 +606,7 @@
#define /*0x110*/ oIsFloomba OBJECT_FIELD_S32(0x22)
#ifdef INTRO_FLOOMBAS
#define /*0x1AC*/ oZoomCounter OBJECT_FIELD_U32(0x49)
#define /*0x1AC*/ oZoomCounter OBJECT_FIELD_S32(0x49)
#define /*0x1B0*/ oZoomPosZ OBJECT_FIELD_F32(0x4A)
#endif
#endif

71
include/rtc.h Executable file
View File

@@ -0,0 +1,71 @@
/*---------------------------------------------------------------------
Copyright (C) 1997, 1998 Nintendo.
File rtc.h
Coded by Shigeo Kimura. Oct 14, 1997.
Modified by Koji Mitsunari. Jan 22, 2001.
Comments Real Time Clock Library
---------------------------------------------------------------------*/
#ifndef _rtc_h_
#define _rtc_h_
/*-----------------------------------------------------------------------
* Macro & constant definitions
*-----------------------------------------------------------------------*/
/* Controller type */
#define CONT_TYPE_RTC 0x1000 /* from os.h */
#define RTC_WAIT 300
/* RTC status signed 32bits */
#define RTC_NG_NOTHING 0x8000
#define RTC_NG_WRITE 0x0100
#define RTC_NG_ADDR 0x0200
#define RTC_STATUS_BUSY 0x0080
#define RTC_STATUS_DDOWN 0x0002
#define RTC_STATUS_BDOWN 0x0001
/* RTC Error Code */
#define CONT_ERR_RTC_BUSY 16
#define CONT_ERR_RTC_BDOWN 17
#define CONT_ERR_RTC_DDOWN 18
#define CONT_ERR_RTC_BDDOWN 19
/* RTC bit status */
#define RTC_EALM 0x80
#define RTC_ALM 0x20
#define RTC_WPB1 0x02
#define RTC_WPB0 0x01
#define RTC_MOD 0x04
#define RTC_CHLD 0x02
#define RTC_ADJ 0x01
#define RTC_ADDR_FLAG 0
#define RTC_ADDR_RAM 1
#define RTC_ADDR_TIME 2
typedef struct{
u8 sec; /* second 0-59 */
u8 min; /* minute 0-59 */
u8 hour; /* hour 0-23 */
u8 day; /* day 1-31 */
u8 week; /* week 0-6(sun,mon,..,sat) */
u8 month; /* month 1-12 */
u16 year; /* year 1901-2099 */
} OSRTCTime;
/*-----------------------------------------------------------------------
* externs
*-----------------------------------------------------------------------*/
extern s32 osRTCInit( OSMesgQueue *mq);
extern s32 osRTCReadData( OSMesgQueue *mq, u8 *);
extern s32 osRTCWriteData( OSMesgQueue *mq, u8 *);
extern s32 osRTCGetTime( OSMesgQueue *mq, OSRTCTime *);
extern s32 osRTCSetTime( OSMesgQueue *mq, OSRTCTime *);
extern u32 osRTCGetIntervalTime(OSRTCTime *, OSRTCTime *);
extern s32 osRTCGetLaterTime(OSMesgQueue *mq, u32, OSRTCTime *);
extern s32 osRTCSetAlarm( OSMesgQueue *mq, u8, u8);
extern s32 osRTCGetAlarmStat(OSMesgQueue *mq, u8 *, u8 *, int *);
extern s32 osRTCProbe( OSMesgQueue *mq);
#endif /* _rtc_h_ */

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