mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Extract constant
This commit is contained in:
parent
dce7a6726e
commit
a111a41deb
|
@ -37,8 +37,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !written_header {
|
if !written_header {
|
||||||
|
const GBA_HEADER_SIZE: usize = 192;
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
data.len() > 192,
|
data.len() > GBA_HEADER_SIZE,
|
||||||
"first section must be at least as big as the gba header"
|
"first section must be at least as big as the gba header"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -48,7 +50,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let header_bytes = bytemuck::bytes_of(&header);
|
let header_bytes = bytemuck::bytes_of(&header);
|
||||||
output.write_all(header_bytes)?;
|
output.write_all(header_bytes)?;
|
||||||
|
|
||||||
data = &data[192..];
|
data = &data[GBA_HEADER_SIZE..];
|
||||||
written_header = true;
|
written_header = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue