Skip to content

Commit

Permalink
Allow load addr to be manually passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mechazawa committed Sep 18, 2024
1 parent 3d5854e commit c93a959
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ fn pack_primitive(fimg: &mut FileImage, dat: &[u8], load_addr: Option<usize>, ty
_ => None,
};

let load_addr = match parsed.get_entry(EntryType::ProdosFileInfo) {
let prodos_load_addr = match parsed.get_entry(EntryType::ProdosFileInfo) {
Some(EntryData::ProDOSFileInfo(file_info)) => Some(usize::try_from(file_info.aux_type).unwrap()),
_ => {
log::warn!("AppleSingle file does not contain any ProDOS file info");
None
},
};

fimg.pack_bin(&data, load_addr, resource)
fimg.pack_bin(&data, load_addr.or(prodos_load_addr), resource)
},
ItemType::ApplesoftTokens => fimg.pack_tok(&dat,ItemType::ApplesoftTokens,None),
ItemType::IntegerTokens => fimg.pack_tok(&dat,ItemType::IntegerTokens,None),
Expand Down

0 comments on commit c93a959

Please sign in to comment.