Skip to content
Open
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
5 changes: 3 additions & 2 deletions src/agon_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,9 @@ impl AgonMachine {

// save the size in the FIL structure
let mut file_len = f.seek(SeekFrom::End(0)).unwrap();
f.seek(SeekFrom::Start(0)).unwrap();
if mode & mos::FA_SEEKEND == 0 {
f.seek(SeekFrom::Start(0)).unwrap();
}

// XXX don't support files larger than 512KiB
file_len = file_len.min(1<<19);
Expand All @@ -1018,7 +1020,6 @@ impl AgonMachine {
_ => cpu.state.reg.set24(Reg16::HL, 1)
}
}

}
Environment::new(&mut cpu.state, self).subroutine_return();
}
Expand Down
1 change: 1 addition & 0 deletions src/mos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub const FILINFO_MEMBER_FNAME_256BYTES: u32 = 22;
pub const FA_WRITE: u32 = 2;
pub const FA_CREATE_NEW: u32 = 4;
pub const FA_CREATE_ALWAYS: u32 = 8;
pub const FA_SEEKEND: u32 = 0x20;

#[derive(Clone, Default)]
pub struct MosMap {
Expand Down