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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 121 additions & 114 deletions config/us/levels/data.tsv

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion include/rnc/mobys/animation/moby_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ typedef struct {
char _pad7D[0x28];
unsigned char saved_seq; /* 0xA5: seq before a blend parked the pose */
char _padA6[0x4A];
char unkF0[0x10]; /* 0xF0: copied into the pose's D_001B2C00 slot */
char bounding_sphere
[0x10]; /* 0xF0: animated bounding sphere, copied into the pose's D_001B2C00 slot */
} MobyAnim;

#endif /* LOMBYTE_RNC_MOBYS_ANIMATION_MOBY_ANIM_H */
4 changes: 2 additions & 2 deletions include/rnc/rendering/debug/debug_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct {
s32 unknown_94;
s32 unknown_98;
s32 unknown_9c;
s32 unknown_a0;
s32 previous_step_held_buttons; /* single-step input (handle_pause_input) */
s32 unknown_a4;
s32 unknown_a8;
s32 unknown_ac;
Expand All @@ -64,7 +64,7 @@ typedef struct {
s32 unknown_e0;
s32 unknown_e4;
s32 unknown_e8;
s32 unknown_ec;
s32 single_step_mode_countdown; /* frames until single-step mode (update_flags 0x10) */
s32 battle_camera_enabled;
s32 actuator_enabled;
u8 start_capture_status;
Expand Down
12 changes: 6 additions & 6 deletions include/rnc/rendering/draw_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ struct DrawPass {
*/
struct DrawConfig {
s32 unk0;
s32 unk4;
s32 sky_gif_paging; /* do_sky_gif_paging flushes the texture uploads */
s32 sky;
struct DrawPass tfrag; /* 0xC */
struct DrawPass tie; /* 0x14 */
struct DrawPass shrub; /* 0x1C */
struct DrawPass moby; /* 0x24 */
s32 unk2C;
struct DrawPass tfrag; /* 0xC */
struct DrawPass tie; /* 0x14 */
struct DrawPass shrub; /* 0x1C */
struct DrawPass moby; /* 0x24 */
s32 gif_paging; /* do_gif_paging flushes the texture uploads */
s32 effects_program; /* loads the effects VU1 program */
s32 effects; /* effect callbacks, lens flare, light quads */
s32 particles;
Expand Down
4 changes: 2 additions & 2 deletions include/rnc/rendering/texture_upload.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
count in D_0015F458). Queued by register_8bit_texture, load_texture_file and
get_frame_texture; the block fields are the TEX0 values they return. */
struct TextureUpload {
s32 clut_data; /* 0x00: EE address of the CLUT (load_texture_file: texture CLUT pointer) */
s16 unk4; /* 0x04: every writer stores 0 */
s32 clut_data; /* 0x00: EE address of the CLUT (load_texture_file: texture CLUT pointer) */
s16 clut_psm; /* 0x04: BITBLTBUF.DPSM of the CLUT transfer (FUN_0020b4a8); writers store 0, PSMCT32 */
s16 cbp; /* 0x06: GS block of the CLUT, TEX0.CBP */
s32 image_data; /* 0x08: EE address of the pixels (load_texture_file: texture pixel pointer) */
u8 tw; /* 0x0C: log2 width, TEX0.TW */
Expand Down
35 changes: 19 additions & 16 deletions include/rnc/sdk/libmpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ struct MpegMbBuffer {
MpegMcFunc chroma_func[4]; /* D_00132E50[] copy routine per fetch */
struct MpegMcFetch luma[4];
struct MpegMcFetch chroma[4];
s32 unk128; /* read by _doMC */
u8 *output; /* _doMC writes the macroblock here */
s32 fetch_count; /* queued fetches; loop count in _doMC */
s32 unk130; /* read by _doMC */
s32 intra; /* "intra && skip MB" is an error in _doMC */
u8 pad_134[0x4];
s32 unk138; /* _doMC skips the work when 0 */
s32 unk13C; /* set 1 by _decMB0/_skipMB0, 0 by _slice0 */
s32 unk138; /* _doMC skips the work when 0 */
s32 no_coded_blocks; /* skipped, or neither intra nor pattern (_decMB0) */
};

struct MpegDecoder {
Expand All @@ -88,7 +88,7 @@ struct MpegDecoder {
u8 pad_C[0x40];
u8 ipu_dma_state; /* &ipu_dma_state passed to suspend_mpeg_decoder_ipu_dma */
u8 pad_4D[0x33];
s32 unk80;
s32 displayed_pts; /* pts low word of the last output picture; -1 after a reset */
u8 pad_84[0x4];
u64 unk88;
u8 pad_90[0x4];
Expand All @@ -99,7 +99,7 @@ struct MpegDecoder {
s32 picture_count_p;
s32 picture_count_b;
s32 frame_base; /* sceMpeg.frameCount = frame_count - frame_base (_sceMpegFlush) */
s32 unkB0; /* non-zero: _dispRefImage uses _csc_storeRefImage, else _cpr8 */
s32 csc_output; /* non-zero: _dispRefImage converts colour (_csc_storeRefImage), else _cpr8 copies raw */
s32 unkB4;
s32 unkB8;
s32 unkBC;
Expand All @@ -109,7 +109,7 @@ struct MpegDecoder {
s32 unkCC;
s32 unkD0;
s32 first_field_structure; /* picture_structure of a frame's first picture; 0 in _sequenceHeader */
s32 unkD8; /* output address (_cpr8 masks it to physical) */
s32 image_buffer; /* sceMpegGetPicture output; 64-byte aligned (_getpic) */

/* Output size limits, checked by _isOutSizeOK against the picture. */
s32 out_max_width; /* >= picture width when out_max_height != 0 */
Expand Down Expand Up @@ -158,26 +158,29 @@ struct MpegDecoder {
s32 repeat_first_field;
s32 progressive_frame;

u8 pad_18C[0x20];
s32 unk1AC;
s32 dc_reset; /* DCR bit of the IPU BDEC command (_decMB0); set by _skipMB0 */
u8 pad_18C[0x20];
s32 temporal_reference; /* picture_header temporal_reference plus temporal_reference_base, unwrapped */
s32 dc_reset; /* DCR bit of the IPU BDEC command (_decMB0); set by _skipMB0 */
s32 quantiser_scale_code; /* 5 bits from the slice header (_sliceB); QSC of BDEC */
struct MpegRefImage
*ref_images[12]; /* chosen by picture_structure / picture_coding_type in _outputFrame */
u8 pad_1E8[0x3A8];
struct MpegMbBuffer mb_buf[2];
s32 mb_buf_index; /* toggled per slice in _slice0 */
u8 pad_814[0x8];
u8 *mc_work; /* _getRef0: destination of the queued fetches */
s32 picture_ready; /* _getpic returns once a picture is out */
u8 pad_824[0x1C];
u8 pad_814[0x4];
s32 ipu_command_class; /* IpuCommandTable[] of the last IPU command */
u8 *mc_work; /* _getRef0: destination of the queued fetches */
s32 picture_ready; /* _getpic returns once a picture is out */
u8 pad_824[0x14];
s32 bit_window; /* IPU_TOP after the last command */
s32 available_bit_count; /* valid bits in bit_window */

/* quant_matrix_extension / sequence_header */
s32 load_intra_quantiser_matrix; /* set -> IPU SETIQ intra (0x50000000) */
s32 load_non_intra_quantiser_matrix; /* set -> IPU SETIQ non-intra (0x58000000) */
s32 mpeg2; /* set by sequence_extension; 0: _sequenceHeader loads MPEG-1 defaults */
s32 unk84C;
s32 unk850;
s32 temporal_reference_base;
s32 max_temporal_reference;
s32 unk854;
struct sceMpeg *mpeg; /* owning sceMpeg (_dispRefImage writes its pts/dts/flags) */
};
Expand Down
18 changes: 10 additions & 8 deletions include/rnc/ui/menus/menu_screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ struct MenuMissionListData {
};

/* Item grid screen (draw_menu_item_grid). Cell frames: +1 equipped,
+2 locked, +4 D_0013E520. Locked: flags 4 / 8 with menu_system.unk138 /
unk134 set. The up/down/left/right screens take the focus when the cursor
+2 locked, +4 D_0013E520. Locked: flags 4 / 8 with menu_system.pack_gadgets_hidden /
head_gadgets_hidden set. The up/down/left/right screens take the focus when the cursor
leaves the grid on that side (update_menu_grid_selection). */
struct MenuGridCell {
u16 icon; /* 0x0: get_icon_frame icon */
Expand Down Expand Up @@ -317,12 +317,14 @@ struct MenuLabelData {
#define MENU_LIST_SHRINK_TO_FIT 0x20000 /* switches to the small font when too wide */

/* MenuItemGridData.flags (update_menu_grid_selection, draw_menu_item_grid). */
#define MENU_GRID_NO_CONFIRM 0x1
#define MENU_GRID_FIXED_ROW_STEP 0x2
#define MENU_GRID_HIDDEN_WITH_UNK138 0x4 /* skipped, cells locked while menu_system.unk138 */
#define MENU_GRID_HIDDEN_WITH_UNK134 0x8 /* skipped, cells locked while menu_system.unk134 */
#define MENU_GRID_NO_EQUIPPED_FRAME 0x20
#define MENU_GRID_NO_WRAP 0x8000
#define MENU_GRID_NO_CONFIRM 0x1
#define MENU_GRID_FIXED_ROW_STEP 0x2
#define MENU_GRID_HIDDEN_WITH_PACK_GADGETS \
0x4 /* skipped, cells locked while menu_system.pack_gadgets_hidden */
#define MENU_GRID_HIDDEN_WITH_HEAD_GADGETS \
0x8 /* skipped, cells locked while menu_system.head_gadgets_hidden */
#define MENU_GRID_NO_EQUIPPED_FRAME 0x20
#define MENU_GRID_NO_WRAP 0x8000

/* MenuStreamData.flags (update_menu_resource_stream, update_menu_stream_image). */
#define MENU_STREAM_FIXED_ENTRY 0x1
Expand Down
17 changes: 9 additions & 8 deletions include/rnc/ui/menus/menu_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ struct MenuPage {
* toggle == 0), then stored negated (load_hand_gadget, update_item_preview_binding);
* load_hand_gadget builds the preview moby once preview_loaded_class equals the
* selected class.
* - unk134 / unk138: while set, pages with flags 8 / 4 are skipped
* (find_next_pause_page) and grid items with those flags draw frame +2.
* - head_gadgets_hidden / pack_gadgets_hidden: while set, the grids flagged 8 / 4
* (pause_head_gadget_grid / pause_pack_gadget_grid) are skipped by
* find_next_pause_page and their cells draw frame +2.
* - The buffer addresses (graphics_workspace, first_base..stream_buffer_base) are carved from
* D_001940C0[1] / [2] by FUN_00218f98.
*/
Expand Down Expand Up @@ -124,12 +125,12 @@ struct MenuSystem {
s32 preview_requested_class; /* 0x11C: an oclass, -1 none */
s32 preview_loaded_class; /* 0x120: an oclass, -1 none */

s32 close_locked; /* 0x124: nonzero blocks start/back closing the menu */
s32 card_op_pending; /* 0x128: card save/load started, waiting for the card */
s32 card_op_text; /* 0x12C: text shown while pending (0x4FB5 save, 0x4FB6 load) */
s32 saved_decode_mode; /* 0x130: decode_mode before a menu movie */
s32 unk134; /* 0x134: hides pages / items with flags 8 */
s32 unk138; /* 0x138: hides pages / items with flags 4 */
s32 close_locked; /* 0x124: nonzero blocks start/back closing the menu */
s32 card_op_pending; /* 0x128: card save/load started, waiting for the card */
s32 card_op_text; /* 0x12C: text shown while pending (0x4FB5 save, 0x4FB6 load) */
s32 saved_decode_mode; /* 0x130: decode_mode before a menu movie */
s32 head_gadgets_hidden; /* 0x134: Oltanis Orbit or D_0014161B (pause_all_sounds) */
s32 pack_gadgets_hidden; /* 0x138: Veldin 1 or Oltanis (pause_all_sounds) */
s32 card_icon_hidden; /* 0x13C: set by pause_all_sounds; the level loop skips the busy card icon while set */
s32 resource_table_class; /* 0x140: oclass at the last resource table select */
s32 last_resource_table_toggle; /* 0x144: resource_table_toggle at the last select */
Expand Down
10 changes: 6 additions & 4 deletions src/audio/voices/pause_all_sounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ void pause_all_sounds(s32 menu_state) {
}
{
struct MenuSystem *g = &menu_system;
g->unk134 = *(volatile s32 *)&current_level_index == LEVEL_OLTANIS_ORBIT || D_0014161B != 0;
g->head_gadgets_hidden =
*(volatile s32 *)&current_level_index == LEVEL_OLTANIS_ORBIT || D_0014161B != 0;
}
{
struct MenuSystem *g = &menu_system;
g->unk138 = current_level_index == LEVEL_VELDIN1 || current_level_index == LEVEL_OLTANIS;
g->pack_gadgets_hidden =
current_level_index == LEVEL_VELDIN1 || current_level_index == LEVEL_OLTANIS;
}
{
struct MenuSystem *g = &menu_system;
Expand Down Expand Up @@ -376,7 +378,7 @@ struct MenuGridScreen pause_hand_gadget_grid = {

struct MenuGridScreen pause_pack_gadget_grid = {
{update_menu_grid_selection, draw_menu_item_grid, find_next_pause_page},
{MENU_GRID_HIDDEN_WITH_UNK138,
{MENU_GRID_HIDDEN_WITH_PACK_GADGETS,
0.1f, 0.1f,
0, 1,
3, pause_pack_gadget_cells,
Expand All @@ -386,7 +388,7 @@ struct MenuGridScreen pause_pack_gadget_grid = {

struct MenuGridScreen pause_head_gadget_grid = {
{update_menu_grid_selection, draw_menu_item_grid, find_next_pause_page},
{MENU_GRID_HIDDEN_WITH_UNK134,
{MENU_GRID_HIDDEN_WITH_HEAD_GADGETS,
0.1f, 0.1f,
0, 1,
3, pause_head_gadget_cells,
Expand Down
2 changes: 1 addition & 1 deletion src/check/menu_layout_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ CHECK(MenuSystem, resource_table_toggle, resource_table_toggle, 0x118);
CHECK(MenuSystem, close_locked, close_locked, 0x124);
CHECK(MenuSystem, card_op_pending, card_op_pending, 0x128);
CHECK(MenuSystem, card_op_text, card_op_text, 0x12C);
CHECK(MenuSystem, unk138, unk138, 0x138);
CHECK(MenuSystem, pack_gadgets_hidden, pack_gadgets_hidden, 0x138);
CHECK(MenuSystem, last_resource_table_toggle, last_resource_table_toggle, 0x144);
SIZE_CHECK(MenuSystem, 0x148);

Expand Down
10 changes: 5 additions & 5 deletions src/check/mpeg_layout_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ OFFSET_CHECK(ref_status, struct MpegRefImage, status, 0x28);
OFFSET_CHECK(ref_unk60, struct MpegRefImage, unk60, 0x60);
OFFSET_CHECK(mb_ipu_out, struct MpegMbBuffer, ipu_out, 0x4);
OFFSET_CHECK(mb_chroma, struct MpegMbBuffer, chroma, 0xB8);
OFFSET_CHECK(mb_unk128, struct MpegMbBuffer, unk128, 0x128);
OFFSET_CHECK(mb_output, struct MpegMbBuffer, output, 0x128);
OFFSET_CHECK(mb_fetch_count, struct MpegMbBuffer, fetch_count, 0x12C);
OFFSET_CHECK(mb_unk13C, struct MpegMbBuffer, unk13C, 0x13C);
OFFSET_CHECK(mb_no_coded_blocks, struct MpegMbBuffer, no_coded_blocks, 0x13C);
SIZE_CHECK(mb_buffer, struct MpegMbBuffer, 0x140);

OFFSET_CHECK(ipu_dma_state, struct MpegDecoder, ipu_dma_state, 0x4C);
OFFSET_CHECK(unk80, struct MpegDecoder, unk80, 0x80);
OFFSET_CHECK(displayed_pts, struct MpegDecoder, displayed_pts, 0x80);
OFFSET_CHECK(unk88, struct MpegDecoder, unk88, 0x88);
OFFSET_CHECK(frame_base, struct MpegDecoder, frame_base, 0xAC);
OFFSET_CHECK(unkD8, struct MpegDecoder, unkD8, 0xD8);
OFFSET_CHECK(image_buffer, struct MpegDecoder, image_buffer, 0xD8);
OFFSET_CHECK(out_max_width, struct MpegDecoder, out_max_width, 0xDC);
OFFSET_CHECK(out_max_size, struct MpegDecoder, out_max_size, 0xE4);
OFFSET_CHECK(unkF8, struct MpegDecoder, unkF8, 0xF8);
Expand All @@ -39,7 +39,7 @@ OFFSET_CHECK(picture_coding_type, struct MpegDecoder, picture_coding_type, 0x150
OFFSET_CHECK(f_code_forward_h, struct MpegDecoder, f_code_forward_h, 0x164);
OFFSET_CHECK(picture_structure, struct MpegDecoder, picture_structure, 0x174);
OFFSET_CHECK(progressive_frame, struct MpegDecoder, progressive_frame, 0x188);
OFFSET_CHECK(unk1AC, struct MpegDecoder, unk1AC, 0x1AC);
OFFSET_CHECK(temporal_reference, struct MpegDecoder, temporal_reference, 0x1AC);
OFFSET_CHECK(quantiser_scale_code, struct MpegDecoder, quantiser_scale_code, 0x1B4);
OFFSET_CHECK(ref_images, struct MpegDecoder, ref_images, 0x1B8);
OFFSET_CHECK(mb_buf, struct MpegDecoder, mb_buf, 0x590);
Expand Down
2 changes: 1 addition & 1 deletion src/mobys/animation/blend_moby_animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void blend_moby_animation(MobyAnim *moby, int new_seq, int frame_index, int blen
slot = find_or_allocate_moby_render_slot((int)moby);
if (slot >= 0) {
FUN_0020ede8(moby, slot | 0x300);
qcopy(D_001B2C00 + slot * 0x10, moby->unkF0);
qcopy(D_001B2C00 + slot * 0x10, moby->bounding_sphere);
oldSeq = moby->seq;
if (oldSeq != 0xFF) {
moby->saved_seq = oldSeq;
Expand Down
4 changes: 2 additions & 2 deletions src/mobys/animation/blend_moby_animation_ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern void FUN_0020ede8(void *, int);
find_or_allocate_moby_render_slot) when it hasn't settled yet (anim_time > 0.025, or pose_layers/manips
nonzero) or the caller forces it (arg4 & 4): builds a flags byte from
arg4 bits 0/1 (0x100/0x200), hands it to FUN_0020ede8, snapshots this
moby's unkF0 vector into the matching D_001B2C00 slot, remembers the
moby's bounding_sphere into the matching D_001B2C00 slot, remembers the
old seq in saved_seq (unless it was already 0xFF), then marks seq 0xFF and
frame = slot. Either way it then sets nextFrame/prevSeq from arg2/arg1,
refreshes frame pointers (update_moby_animation_state), arms the timer (anim_speed = 1),
Expand All @@ -39,7 +39,7 @@ void blend_moby_animation_ex(
if (slot >= 0) {
pose_slot_and_flags = (options & 1) ? (slot | 0x100) : slot;
FUN_0020ede8(moby, (options & 2) ? (pose_slot_and_flags | 0x200) : pose_slot_and_flags);
qcopy(D_001B2C00 + slot * 0x10, moby->unkF0);
qcopy(D_001B2C00 + slot * 0x10, moby->bounding_sphere);
oldSeq = moby->seq;
if (oldSeq != 0xFF) {
moby->saved_seq = oldSeq;
Expand Down
Loading
Loading