Skip to content

Commit

Permalink
Custom item support
Browse files Browse the repository at this point in the history
Required mains supported for Missiles/PB
Unlimited Missiles/PBs are supported now
Spring Ball has its own item now
  • Loading branch information
UltiNaruto committed Aug 8, 2024
1 parent 93ed235 commit b922450
Show file tree
Hide file tree
Showing 7 changed files with 421 additions and 173 deletions.
4 changes: 4 additions & 0 deletions ppcasm/ppcasm_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ decl_instrs! {
addc[o][.], (r:d), (r:a), (r:b) => (6;31) | d | a | b | (?o) | (9;10) | (?.);
addi, (r:d), (r:a), (i:imm) => (6;14) | d | a | (16;imm);
addic[.], (r:d), (r:a), (i:imm) => (5;6) | (?.) | d | a | (16;imm);
and[.], (r:d), (r:a), (r:b) => (6;31) | d | a | b | (10;28) | (?.);
andi, (r:d), (r:a), (i:imm) => (6;28) | d | a | (16;imm);
andis, (r:d), (r:a), (i:imm) => (6;29) | d | a | (16;imm);
b[l][a], (l:li) => (6;18) | (24;li) | (?a) | (?l);
Expand Down Expand Up @@ -409,11 +410,14 @@ decl_instrs! {
mr, (r:a), (r:s) => (6;31) | s | a | s | (10;444) | (1;0);
mtlr, (r:d) => (6;31) | d | (10;0x100) | (10;467) | (1;0);
mullw[o][.],(r:d), (r:a), (r:b) => (6;31) | d | a | b | (?o) | (9;235) | (?.);
neg, (r:d), (r:a) => (6;31) | d | a | (16;208);
nop => (32;0x60000000);
or[.], (r:d), (r:a), (r:b) => (6;31) | d | a | b | (10;444) | (?.);
ori, (r:d), (r:a), (i:imm) => (6;24) | d | a | (16;imm);
oris, (r:d), (r:a), (i:imm) => (6;25) | d | a | (16;imm);
slw[.], (r:d), (r:a), (r:b) => (6;31) | d | a | b | (10;24) | (?.);
slwi, (r:a), (r:s), (i:n) => (6;21) | s | a | (5;{#n}) | (5;0) |(5;{31 - #n}) | (1;0);
srw[.], (r:d), (r:a), (r:b) => (6;31) | d | a | b | (10;536) | (?.);
srwi, (r:a), (r:s), (i:n) => (6;21) | s | a | (5;{32 - #n}) | (5;n) |(5;31) | (1;0);
rlwimi[.], (r:a), (r:s), (i:sh), (i:mb), (i:me) =>
(6;20) | s | a | (5;sh) | (5;mb) |(5;me) | (?.);
Expand Down
18 changes: 8 additions & 10 deletions src/custom_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1367,16 +1367,14 @@ pub fn collect_game_resources<'r>(
];
looking_for.extend(custom_scan_point_deps);

if config.enable_ice_traps {
let player_freeze_deps: Vec<(u32, FourCC)> = vec![
resource_info!("breakFreezeVisor.PART").into(),
resource_info!("Frost1TXTR.TXTR").into(),
resource_info!("75DAC95C.PART").into(),
resource_info!("zorch1_snow3.TXTR").into(),
resource_info!("C28C7348.PART").into(),
];
looking_for.extend(player_freeze_deps);
}
let player_freeze_deps: Vec<(u32, FourCC)> = vec![
resource_info!("breakFreezeVisor.PART").into(),
resource_info!("Frost1TXTR.TXTR").into(),
resource_info!("75DAC95C.PART").into(),
resource_info!("zorch1_snow3.TXTR").into(),
resource_info!("C28C7348.PART").into(),
];
looking_for.extend(player_freeze_deps);

// Dependencies read from paks and custom assets will go here //
let mut found = HashMap::with_capacity(looking_for.len());
Expand Down
3 changes: 0 additions & 3 deletions src/patch_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,6 @@ pub struct PatchConfig {
pub starting_visor: Visor,
pub starting_beam: Beam,
pub escape_sequence_counts_up: bool,
pub enable_ice_traps: bool,
pub missile_station_pb_refill: bool,
pub door_open_mode: DoorOpenMode,

Expand Down Expand Up @@ -1537,7 +1536,6 @@ struct GameConfig {
starting_visor: Option<String>,
starting_beam: Option<String>,
escape_sequence_counts_up: Option<bool>,
enable_ice_traps: Option<bool>,
missile_station_pb_refill: Option<bool>,
door_open_mode: Option<DoorOpenMode>,

Expand Down Expand Up @@ -2674,7 +2672,6 @@ impl PatchConfigPrivate {
.unwrap_or_else(|| StartingItems::from_u64(1)),
disable_item_loss: self.game_config.disable_item_loss.unwrap_or(true),
escape_sequence_counts_up: self.game_config.escape_sequence_counts_up.unwrap_or(false),
enable_ice_traps: self.game_config.enable_ice_traps.unwrap_or(false),
missile_station_pb_refill: self.game_config.missile_station_pb_refill.unwrap_or(false),
door_open_mode: self
.game_config
Expand Down
Loading

0 comments on commit b922450

Please sign in to comment.