Skip to main content

Model

Enum Model 

Source
pub enum Model {
    Hp48sx,
    Hp48gx,
    Hp38g,
    Hp49g,
    Hp39g,
    Hp40g,
    Hp42s,
    Hp27s,
    Hp17bii,
    Hp17b,
    Hp28s,
    Hp19bii,
}
Expand description

A supported calculator model.

Variants§

§

Hp48sx

HP48 SX: Clarke, 2 MHz, 256 KB ROM, 32 KB RAM, two 128 KB card ports on CE1 and CE2.

§

Hp48gx

HP48 GX: Yorke, 4 MHz, 512 KB ROM (upper half through DA19), 128 KB RAM, CE1 bank latch, port 1 on CE2, banked port 2 on NCE3 (wiki: hardware/hp48gx).

§

Hp38g

HP 38G: Yorke, 4 MHz, 512 KB OTP ROM, 32 KB RAM that the ROM puts at #F0000, no card ports (wiki: hardware/hp38g).

§

Hp49g

HP49G: Yorke, 4 MHz, 2 MB flash on NCE1 banked by the CE1 latch, 512 KB RAM on NCE2, CE2 and NCE3, its own keyboard matrix (wiki: hardware/hp49g).

§

Hp39g

HP 39G: the 49G board cut to a 1 MB mask ROM on NCE1, banked by the CE1 latch, and 256 KB RAM on NCE2; nothing on CE2 or NCE3; the 49G keyboard matrix with the 39G’s labels (wiki: hardware/hp39g-40g).

§

Hp40g

HP 40G: the 39G hardware without IR, running the same ROM, which tells the two apart by a strap (wiki: hardware/hp39g-40g, questions/hp39g-40g-model-detection).

§

Hp42s

HP 42S: a Pioneer-series machine on the Lewis chip (1LR2), about 1 MHz, 64 KB ROM at #00000, 8 KB RAM at #50000, the Lewis display and register block at #40000, a 131x16 LCD, 37 keys, no card ports and no serial port (wiki: hardware/hp42s, hardware/lewis).

§

Hp27s

HP 27S: the 42S’s board (one Lewis, ROM at #00000, display and registers at #40000, 8 KB RAM at #50000, 131x16 LCD) with the 27S’s keyboard and 64 KB ROM (wiki: hardware/hp27s, hardware/saturn-models).

§

Hp17bii

HP 17BII: the 42S’s board with the 17B keyboard, a 64 KB ROM (English) or 96 KB (international: a 32 KB language ROM at #20000), and a clock with alarm (wiki: hardware/hp17bii).

§

Hp17b

HP 17B: the 17BII’s predecessor on the same board and keyboard matrix, 64 or 96 KB ROM as the 17BII (wiki: hardware/hp17bii).

§

Hp28s

HP 28S: a Clamshell machine on two Lewis chips, master and slave; 128 KB ROM at #00000, 32 KB RAM at #C0000 (aliased at #D0000), the slave’s display and register block at #FF800 and the master’s at #FFC00, a 137x32 LCD split between them, no card ports and no serial port (wiki: hardware/hp28s, hardware/lewis).

§

Hp19bii

HP 19BII: the 28S’s two-Lewis board and map with the 19BII’s keyboard, a 128 KB ROM, 8 KB of RAM that the ROM uses at #C4000-#C7FFF, the 137x32 LCD and a clock with appointment alarms; no serial port (wiki: hardware/hp19bii).

Implementations§

Source§

impl Model

Source

pub const ALL: [Model; 12]

Every model, in declaration order.

Source

pub fn is_pioneer(self) -> bool

The Pioneer models on one Lewis chip (42S, 27S, 17BII, 17B): the fixed Lewis map, the 131x16 LCD, no serial port, no card port, no RPL (wiki: hardware/lewis, hardware/saturn-models).

Source

pub fn is_lewis(self) -> bool

The models on the Lewis chip: the Pioneers, the 28S and the 19BII. None has a serial port or a card port, and none runs the 48’s RPL system (wiki: hardware/lewis, hardware/saturn-models).

Source

pub fn lcd_size(self) -> (usize, usize)

The display’s size in pixels, width by height: 131x64 on the 48-family models, 131x16 on the Pioneers, 137x32 on the 28S and 19BII (wiki: hardware/display, hardware/lewis, hardware/hp28s, hardware/hp19bii).

Source

pub fn name(self) -> &'static str

Short lowercase name as the CLI and the oracle use it.

Source

pub fn contrast_range(self) -> RangeInclusive<u8> ⓘ

Range the ROM lets ON+ / ON- move the contrast in: 3-19 on the 48SX, 9-24 on the 48GX, 38G, 49G, 39G and 40G (wiki: emulators/emu48 Display, from the KML 2.0 documentation; Voyage p. 193 agrees for the SX; wiki: hardware/hp39g-40g “Display”), 15-31 on the 42S (wiki: hardware/hp42s “Summary”), and 15-31 on the 27S, 17BII and 17B (wiki: hardware/hp27s, hardware/hp17bii, from KML 2.0), 16-31 on the 28S and 19BII (wiki: hardware/hp28s, hardware/hp19bii, from KML 2.0). Informational; the hardware register takes any value 0-31.

Source

pub fn default_contrast(self) -> u8

The contrast the ROM sets at power-on, observed after a cold start (wiki: hardware/hp48sx, hardware/hp48gx, hardware/hp38g, hardware/hp49g, hardware/hp39g-40g, hardware/hp42s): the front end renders it properly dark. 11 on the 48SX (ROM J), 14 on the 48GX (R), 38G (A) and 49G (1.19-6 and 2.10), 12 on the 39G/40G, 22 on the 42S (C), 22 on the 27S, 17BII and 17B (the reset value KML 2.0 gives; wiki: hardware/hp27s, hardware/hp17bii), 22 on the 28S and 19BII (KML 2.0; wiki: hardware/hp28s, hardware/hp19bii).

Source

pub fn rom_bytes(self) -> usize

Size of the packed system ROM image in bytes (two nibbles per byte): 256 KB SX, 512 KB GX (wiki: hardware/hp48gx), 2 MB 49G flash (wiki: hardware/hp49g), 1 MB 39G/40G mask ROM (wiki: hardware/hp39g-40g), 64 KB 42S, 27S, 17B and English 17BII (wiki: hardware/hp42s, hardware/saturn-models); the international 17B’s and 17BII’s 96 KB is Model::accepts_rom_len’s second size; 128 KB on the 28S and 19BII (wiki: hardware/hp28s, hardware/hp19bii).

Source

pub fn accepts_rom_len(self, len: usize) -> bool

Whether a ROM file of len bytes has a size super::Machine::new accepts: the packed image, or for the 49G, 39G and 40G also the same unpacked (one nibble per byte, twice the size; hpcalc’s rom.39g is in that form), and for the 17B and 17BII also the 96 KB international image: the 64 KB main ROM at #00000 and the 32 KB language ROM at #20000, in one file (wiki: hardware/hp17bii).

Source

pub fn ram_nibbles(self) -> usize

Built-in RAM on NCE2 in nibbles: 32 KB SX, 128 KB GX (wiki: hardware/hp48gx), 256 KB 49G (wiki: hardware/hp49g, the IRAM half; the other 256 KB sit on CE2 and NCE3), 8 KB on the 42S (wiki: hardware/hp42s; the 32 KB upgrade is not modelled), 32 KB on the 28S (wiki: hardware/hp28s), 8 KB on the 19BII, repeating through the 28S’s RAM window: its ROM reads and writes RAM only at #C4000-#C7FFF (traced; wiki: hardware/hp19bii).

Source

pub fn clock_hz(self) -> u32

CPU clock in Hz: 2 MHz on the SX (wiki: hardware/hp48sx), 4 MHz on the Yorke models (wiki: hardware/hp48gx “~4 MHz”, hardware/hp49g), 1 MHz on the 42S (wiki: hardware/hp42s “about 1 MHz”; the Lewis RATE register’s effect on the clock is not modelled), and the same on the 27S, 17BII and 17B (inferred: the same board). The 28S is taken as the same (inferred: the same chip; wiki: questions/lewis-clock-and-rate).

Source

pub fn cycle_scale_permille(self) -> u32

Calibration of instruction time, in per mille of the cycle table’s count: the factor that makes the HP Museum summation benchmark take as long as on the real machines (wiki: questions/instruction-speed-vs-hardware, sources/hpmuseum-summation-benchmark). Calibration, not a documented hardware figure: with the SASM counts (48SX) and the Meta Kernel counts (Yorke models) plus the 13% display stall, the ROMs run n = 1000 in 75.4 s (48SX, real 95.5 s), 41.2 / 40.5 s (48GX sum / FOR, real 55 / 54 s) and 40.2 / 41.8 s (49G ROM 2.10, real 47.8 / 51.0 s). The 38G is taken as a 48G and the 39G and 40G as a 49G (inferred: same chip and memory types; no benchmark). The 42S runs the table counts at its documented clock, unscaled: no benchmark of a real 42S has been compared yet.

Source

pub fn has_serial(self) -> bool

Whether the model has a serial port (a UART): every model but the Lewis ones (the Pioneers, the 28S and the 19BII), whose only I/O is the infrared printer LED (wiki: hardware/hp42s, hardware/hp28s, hardware/saturn-models).

Source

pub fn card_max_bytes(self, port: Port) -> usize

Largest card image port accepts, in bytes; 0 when the model has no such slot.

Source

pub fn has_key(self, k: Key) -> bool

Whether the model’s keyboard has k (wiki: hardware/keyboard; the 48 and 49G matrices differ).

Source

pub fn keys(self) -> impl Iterator<Item = Key>

Every key of the model’s keyboard, ON included.

Trait Implementations§

Source§

impl Clone for Model

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Model

Source§

impl Debug for Model

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Model

Source§

impl FromStr for Model

The model by its short name (Model::name), ignoring case: “48sx”, “48gx”, “38g”, “49g”, “39g”, “40g”, “42s”, “27s”, “17bii”, “17b”, “28s”, “19bii”. Every host parses model names here.

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(name: &str) -> Result<Self, Error>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for Model

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Model

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Model

Auto Trait Implementations§

§

impl Forget for Model

§

impl Freeze for Model

§

impl Move for Model

§

impl RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl UnsafeUnpin for Model

§

impl UnwindSafe for Model

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.