main
aprzn 1 year ago
commit a7f58b3128

1
.gitignore vendored

@ -0,0 +1 @@
/target

7
Cargo.lock generated

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "zing"
version = "0.1.0"

@ -0,0 +1,8 @@
[package]
name = "zing"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

@ -0,0 +1,49 @@
#![allow(dead_code)]
// see §11 (page 61) of the spec
#[repr(usize)]
enum HeaderFields {
Version = 0x0,
Flags1,
HighMemoryStartAddr = 0x4,
PCInitValAddr = 0x6,
DictionaryAddr = 0x8,
ObjectTableAddr = 0xA,
GlobalsTableAddr = 0xC,
StaticMemoryStartAddr = 0xE,
Flags2 = 0x10,
AbbreviationsTableaddr = 0x18,
FileLength = 0x1A, // divided by a constant; see §11.1.6
FileChecksum = 0x1C,
InterpreterNumber = 0x1E,
InterpreterVersion = 0x1F,
ScreenHeightChars = 0x20,
ScreenWidthChars = 0x21,
ScreenHeightUnits = 0x22,
ScreenWidthUnits = 0x24,
FontWidthUnits = 0x26,
FontHeightUnits = 0x27,
BackgroundColor = 0x2C,
ForegroundColor = 0x2D,
TerminatingCharsTableAddr = 0x2E,
RevisionNumber = 0x32,
AlphabetTableAddr = 0x34,
HeaderExtensionTableAddr = 0x36,
}
// note: this is a table of words, unlike the regular header which is all bytes
#[repr(usize)]
enum ExtensionTableFields {
TableLength = 0,
MouseXAfterClick = 1,
MouseYAfterClick = 2,
UnicodeTranslationTableAddr = 3,
}
struct ZMachine5 {
memory: Box<[u8]>,
}
fn main() {
println!("Hello, world!");
}

Binary file not shown.
Loading…
Cancel
Save