#define STANDALONE_WINDOWS_SIDE
#include <stand.h>
#include <machine/bootinfo.h>
#include <machine/platid.h>
extern TCHAR szAppName[ ];
#define whoami szAppName
#define PREFNAME TEXT("pbsdboot.ini")
#define LOGNAME TEXT("pbsdboot.log")
#define PATHBUFLEN 200
double wcstod(const wchar_t *, wchar_t **);
long wcstol(const wchar_t *, wchar_t **, int);
unsigned long wcstoul(const wchar_t *, wchar_t **, int);
BOOL VirtualCopy(LPVOID, LPVOID, DWORD, DWORD);
struct map_s {
void *entry;
void *base;
int pagesize;
int leafsize;
int nleaves;
void *arg0;
void *arg1;
void *arg2;
void *arg3;
void **leaf[32];
};
struct preference_s {
int setting_idx;
int fb_type;
int fb_width, fb_height, fb_linebytes;
int boot_time;
long fb_addr;
unsigned long platid_cpu, platid_machine;
TCHAR setting_name[PATHBUFLEN];
TCHAR kernel_name[PATHBUFLEN];
TCHAR options[PATHBUFLEN];
BOOL check_last_chance;
BOOL load_debug_info;
BOOL serial_port;
BOOL reverse_video;
BOOL autoboot;
};
struct path_s {
TCHAR* name;
LANGID langid;
unsigned long flags;
#define PATH_SAVE 1
};
struct system_info {
unsigned int si_dramstart;
unsigned int si_drammaxsize;
DWORD si_pagesize;
unsigned char *si_asmcode;
int si_asmcodelen;
int (*si_boot)(void *);
int si_intrvec;
};
extern struct system_info system_info;
extern struct preference_s pref;
extern TCHAR* where_pref_load_from;
BOOL CheckCancel(int progress);
extern HWND hDlgMain;
int CreateMainWindow(HINSTANCE hInstance, HWND hWnd, LPCTSTR name, int cmdbar_height);
int vmem_exec(void *entry, int argc, char *argv[], struct bootinfo *bi);
void *vmem_get(void *phys_addr, int *length);
int vmem_init(void *start, void *end);
void vmem_dump_map(void);
void *vtophysaddr(void *page);
void vmem_free(void);
void *vmem_alloc(void);
int getinfo(int fd, void **start, void **end);
int loadfile(int fd, void **entry);
int mips_boot(void *map);
int pbsdboot(TCHAR*, int argc, char *argv[], struct bootinfo *bi);
int debug_printf(LPWSTR lpszFmt, ...);
int msg_printf(UINT type, LPWSTR caption, LPWSTR lpszFmt, ...);
int stat_printf(LPWSTR lpszFmt, ...);
int set_debug_log(TCHAR* path);
void close_debug_log(void);
#define MSG_ERROR (MB_OK | MB_ICONERROR)
#define MSG_INFO (MB_OK | MB_ICONINFORMATION)
void hardware_test(void);
void pref_init(struct preference_s* pref);
void pref_dump(struct preference_s* pref);
int pref_read(TCHAR* filename, struct preference_s* pref);
int pref_load(struct path_s load_path[], int pathlen);
int pref_save(struct path_s load_path[], int pathlen);
int pref_write(TCHAR* filename, struct preference_s* buf);
int set_system_info(platid_t* platid);
enum palette_status { PAL_ERROR, PAL_NOERROR, PAL_SUCCEEDED };
extern enum palette_status palette_succeeded;
void palette_init(HWND hWnd);
void palette_set(HWND hWnd);
void palette_check(HWND hWnd);
void vr41xx_init(SYSTEM_INFO *info);
void tx39xx_init(SYSTEM_INFO *info);