Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 44 additions & 0 deletions docs/game/help-messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Help messages and tutorial records

`HelpState` in `rnc/ui/help/help_state.h` is the shared boot help-window
layout. Its geometry comes from `link_localized_display_text` and is consumed
by `draw_help`: `half_width`/`half_height` are the target size, while
`frame_half_width`/`frame_half_height` describe the animated frame.

## Message fields

`msg` indexes the loaded message table; `pending` is a request ID, with -1
meaning no request. `entry` indexes persistent records, and `count` bounds
the loaded table. These are different index spaces.

A `HelpMessageEntry` is 16 bytes on EE. Its first word is a text pointer
after relocation; archive loaders retain their integer-offset view before
relocation. `find_help_message_index` compares `message_id` at 0x04.
`update_help_state` adds 30000 to `audio_track_offset` at 0x08 for the
secondary audio stream, with -1 meaning no audio. The final word remains
unknown. Message IDs and audio-track offsets are not interchangeable.

## Records and time

`HelpRecord` and `UsageStat` are 8-byte records: a 16-bit count, a 16-bit
`latest_time_bucket`, and 32-bit level/status flags. Writers retain the
maximum of `scale_game_frames(play_time) / 600`; readers multiply by 600
when testing elapsed time. This is a coarse play-time bucket, not a best
score or countdown. Original narrowing and comparisons are preserved.

`UsageStat.level_mask` is signed: Novalis and Kerwan test it against zero
to inspect bit 31. `HelpRecord.level_flags` remains unsigned. Visited-level
bits coexist with bit 31, which `clear_help_record_high_bits` clears, so
it is not an immutable "ever shown" flag. `help_request` rejects a count
of 0xFFFF; other writers saturate the count there.

## Reference evidence

RC1 functions and callers establish these meanings. `rac1-decomp` at
`05da3217a4046ac01dec3ac74f051a348f063155` corroborates geometry and request
offsets in `src/game/help.c` and `src/overlays/shared/help_00203E98.c`.
Its help-update code derives from Lombyte and is not independent evidence.
No PAL addresses or implementation bodies were imported.

The help window and record layout checks in `src/check/` verify EE offsets
and sizes; boot and overlay byte checks remain the acceptance gates.
8 changes: 8 additions & 0 deletions include/rnc/audio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef LOMBYTE_RNC_AUDIO_H
#define LOMBYTE_RNC_AUDIO_H

#include "types.h"

s32 snd_start_sound_system(void) __asm__("FUN_0012da28");

#endif /* LOMBYTE_RNC_AUDIO_H */
12 changes: 12 additions & 0 deletions include/rnc/audio/decoder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef LOMBYTE_RNC_AUDIO_DECODER_H
#define LOMBYTE_RNC_AUDIO_DECODER_H

#include "types.h"

struct AudioDec;

s32 audio_dec_create(struct AudioDec *, s32, s32, s32) __asm__("FUN_0023abd0");
int audio_dec_is_preset(struct AudioDec *) __asm__("func_0023AEE0");
void audio_dec_reset(struct AudioDec *) __asm__("FUN_0023ad10");

#endif /* LOMBYTE_RNC_AUDIO_DECODER_H */
10 changes: 0 additions & 10 deletions include/rnc/audio/decoder/audio_dec_create.h

This file was deleted.

10 changes: 0 additions & 10 deletions include/rnc/audio/decoder/audio_dec_is_preset.h

This file was deleted.

10 changes: 0 additions & 10 deletions include/rnc/audio/decoder/audio_dec_reset.h

This file was deleted.

9 changes: 9 additions & 0 deletions include/rnc/audio/effects.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef LOMBYTE_RNC_AUDIO_EFFECTS_H
#define LOMBYTE_RNC_AUDIO_EFFECTS_H

#include "types.h"

void snd_auto_reverb(s32, s32, s32, s32) __asm__("FUN_0012efe0");
void snd_pre_alloc_reverb_work_area(s32, s32) __asm__("FUN_0012efa8");

#endif /* LOMBYTE_RNC_AUDIO_EFFECTS_H */
8 changes: 0 additions & 8 deletions include/rnc/audio/effects/snd_auto_reverb.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/effects/snd_pre_alloc_reverb_work_area.h

This file was deleted.

9 changes: 9 additions & 0 deletions include/rnc/audio/mixer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef LOMBYTE_RNC_AUDIO_MIXER_H
#define LOMBYTE_RNC_AUDIO_MIXER_H

#include "types.h"

void snd_set_group_voice_range(s32, s32, s32) __asm__("FUN_0012e2b8");
void snd_set_mixer_mode(s32, s32) __asm__("FUN_0012e280");

#endif /* LOMBYTE_RNC_AUDIO_MIXER_H */
8 changes: 0 additions & 8 deletions include/rnc/audio/mixer/snd_set_group_voice_range.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/mixer/snd_set_mixer_mode.h

This file was deleted.

9 changes: 9 additions & 0 deletions include/rnc/audio/movie.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef LOMBYTE_RNC_AUDIO_MOVIE_H
#define LOMBYTE_RNC_AUDIO_MOVIE_H

#include "types.h"

void snd_close_movie_sound(void) __asm__("FUN_0012f0e0");
void snd_update_movie_adpcm(s32, s32) __asm__("FUN_0012f148");

#endif /* LOMBYTE_RNC_AUDIO_MOVIE_H */
8 changes: 0 additions & 8 deletions include/rnc/audio/movie/snd_close_movie_sound.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/movie/snd_update_movie_adpcm.h

This file was deleted.

17 changes: 17 additions & 0 deletions include/rnc/audio/music.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef LOMBYTE_RNC_AUDIO_MUSIC_H
#define LOMBYTE_RNC_AUDIO_MUSIC_H

#include "types.h"

void music_pause(s32);
void music_start_track(s32, s32, s32) __asm__("FUN_00215c40");
void music_start_track_10000(s32, s32, s32) __asm__("FUN_002158a0");
void music_start_track_20000(s32, s32, s32) __asm__("FUN_002157d0");
void music_start_track_30000(s32, s32, s32) __asm__("FUN_002156d8");
void music_start_track_40000(s32, s32, s32) __asm__("FUN_00215600");
void music_start_track_50000(s32, s32, s32) __asm__("FUN_00215518");
void music_start_track_60000(s32, s32, s32) __asm__("FUN_00215440");
void music_update(void) __asm__("FUN_00216290");
void reset_music(void) __asm__("FUN_00215390");

#endif /* LOMBYTE_RNC_AUDIO_MUSIC_H */
8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_pause.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track_10000.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track_20000.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track_30000.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track_40000.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track_50000.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_start_track_60000.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/music_update.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/music/reset_music.h

This file was deleted.

10 changes: 10 additions & 0 deletions include/rnc/audio/rpc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef LOMBYTE_RNC_AUDIO_RPC_H
#define LOMBYTE_RNC_AUDIO_RPC_H

#include "types.h"

void snd_prepare_return_buffer(s32 *, s32);
s32 snd_send_iop_command_and_wait(s32, s32, u8 *) __asm__("FUN_0012e548");
void snd_send_iop_command_no_wait(s32, s32, u8 *, s32, s64) __asm__("FUN_0012e6e0");

#endif /* LOMBYTE_RNC_AUDIO_RPC_H */
8 changes: 0 additions & 8 deletions include/rnc/audio/rpc/snd_returns.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/rpc/snd_send_iop_command_and_wait.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/rpc/snd_send_iop_command_no_wait.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/snd_start_sound_system.h

This file was deleted.

22 changes: 22 additions & 0 deletions include/rnc/audio/sound.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef LOMBYTE_RNC_AUDIO_SOUND_H
#define LOMBYTE_RNC_AUDIO_SOUND_H

#include "rnc/audio/voice_pool.h"
#include "types.h"

struct VoiceVolumeDefinition;

s32 calculate_voice_distance_volume(struct VoiceVolumeDefinition *,
f32,
f32,
f32) __asm__("FUN_0022c6f8");
s32 calculate_voice_pan(s32, f32 *, void *) __asm__("FUN_0022c830");
void clamp_voice_position_to_collision(s32) __asm__("FUN_0022c5a8");
void initialize_gameplay_sound_system(void) __asm__("FUN_0022c8d0");
int snd_get_doppler_pitch_mod(int);
void store_sound_bank_handle_callback(int, long) __asm__("FUN_0022dd78");
int test_voice_occlusion(VoiceSlot *, void *) __asm__("FUN_0022c658");
void voice_start_callback(int, long) __asm__("FUN_0022dd90");
void voice_update_callback(int, long) __asm__("FUN_0022ddd8");

#endif /* LOMBYTE_RNC_AUDIO_SOUND_H */
13 changes: 0 additions & 13 deletions include/rnc/audio/sound/calculate_voice_distance_volume.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/sound/calculate_voice_pan.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/rnc/audio/sound/clamp_voice_position_to_collision.h

This file was deleted.

Loading
Loading