2022-08-08 00:58:46 +00:00
|
|
|
#ifndef CHERNOBYL_H
|
|
|
|
#define CHERNOBYL_H
|
|
|
|
|
|
|
|
#include "chernobyl_types.h"
|
|
|
|
|
|
|
|
u16 _main ();
|
2022-09-02 11:22:18 +00:00
|
|
|
u16 walk (u16 r15); // unused
|
2022-08-08 00:58:46 +00:00
|
|
|
u16 run ();
|
|
|
|
|
2022-09-02 11:22:18 +00:00
|
|
|
u16 *create_hash_table (u16 exponent, u16 size);
|
2022-08-15 08:57:45 +00:00
|
|
|
u16 add_to_table (u16 *table, char *username, u16 pin);
|
2022-08-08 00:58:46 +00:00
|
|
|
// Return address of a buffer from the table
|
|
|
|
// r15 = buffer address. r14
|
2022-08-08 01:57:25 +00:00
|
|
|
u16 get_from_table (void *r15, char *r14);
|
2022-08-08 00:58:46 +00:00
|
|
|
u16 hash (char *str);
|
2022-08-15 08:57:45 +00:00
|
|
|
u16 rehash (u16 *table, u16 r14);
|
2022-08-08 00:58:46 +00:00
|
|
|
|
2022-08-08 01:57:25 +00:00
|
|
|
// Strings, named after the position of the first character in memory
|
|
|
|
// Strings associated with <walk>
|
2022-08-08 00:58:46 +00:00
|
|
|
#define s_4566 "\r\r"
|
|
|
|
#define s_4569 "%x [alloc] [p %x] [n %x] [s %x]"
|
|
|
|
#define s_4588 " "
|
|
|
|
#define s_458b " {%x} [ "
|
|
|
|
#define s_4594 "%x "
|
|
|
|
#define s_4599 "%x [freed] [p %x] [n %x] [s %x]"
|
|
|
|
|
2022-08-08 01:57:25 +00:00
|
|
|
// Strings associated with <malloc>
|
2022-08-08 00:58:46 +00:00
|
|
|
#define s_465e "Heap exhausted; aborting."
|
|
|
|
|
2022-08-08 01:57:25 +00:00
|
|
|
// Strings associated with <run>
|
2022-08-08 00:58:46 +00:00
|
|
|
#define s_4a38 "Welcome to the lock controller."
|
|
|
|
#define s_4a58 "You can open the door by entering 'access [your name] [pin]'"
|
|
|
|
#define s_4a95 ""
|
|
|
|
#define s_4a96 "No such box."
|
|
|
|
#define s_4aa3 "Access granted."
|
|
|
|
#define s_4ab3 "Access granted; but account not activated."
|
|
|
|
#define s_4ade "Aceess denied" // [sic]
|
|
|
|
#define s_4aec "Can not have a pin with high bit set."
|
|
|
|
#define s_4b12 "User already has an account."
|
|
|
|
#define s_4b2f "Adding user account %s with pin %x."
|
|
|
|
#define s_4b54 "Invalid command."
|
|
|
|
|
|
|
|
#endif
|