--- uae/src/include/bebox.h 2018/04/24 16:38:39 1.1.1.1 +++ uae/src/include/bebox.h 2018/04/24 16:39:18 1.1.1.2 @@ -3,7 +3,7 @@ * * BeBox port specific stuff * - * (c) 1996 Christian Bauer + * (c) 1996-1997 Christian Bauer * (c) 1996 Patrick Hanevold */ @@ -12,20 +12,24 @@ extern "C" { #include "sysdeps.h" #include "config.h" #include "options.h" +#include "uae.h" #include "memory.h" #include "custom.h" +#include "serial.h" +#include "readcpu.h" #include "newcpu.h" #include "disk.h" #include "debug.h" #include "xwin.h" #include "os.h" -#include "filesys.h" -#include "keybuf.h" +#include "events.h" #include "keyboard.h" +#include "keybuf.h" #include "gui.h" -extern void usage(void); -extern void parse_cmdline(int,char**); -extern unsigned long frametime,timeframes; +#include "zfile.h" +#include "autoconf.h" +#include "osemu.h" +#include "compiler.h" } class UAEWindow; @@ -44,14 +48,17 @@ public: virtual void ReadyToRun(void); virtual bool QuitRequested(void); virtual void AboutRequested(void); -// virtual void MessageReceived(BMessage*); - virtual void RefsReceived(BMessage*); - virtual void FilePanelClosed(BMessage*); - void RequestFile(char*,int); + virtual void RefsReceived(BMessage *msg); + + int GraphicsInit(void); + void GraphicsLeave(void); + private: + static long thread_func(void *obj); + BBitmap *the_bitmap; UAEWindow *main_window; - Emulator *the_emulator; + thread_id the_thread; }; @@ -63,12 +70,15 @@ class UAEWindow : public BWindow { public: UAEWindow(BRect frame, BBitmap *bitmap); virtual bool QuitRequested(void); - virtual void WindowActivated(bool active); - virtual void MessageReceived(BMessage*); + virtual void MessageReceived(BMessage *msg); + private: + void request_floppy(char *title, int drive_num); + BitmapView *main_view; }; + /* * A simple view class for blitting a bitmap on the screen */ @@ -78,119 +88,42 @@ public: BitmapView(BRect frame, BBitmap *bitmap); virtual void Draw(BRect update); virtual void KeyDown(ulong); + virtual void MouseMoved(BPoint point, ulong transit, BMessage *message); void Draw(BRect from, BRect to); + private: BBitmap *the_bitmap; }; + /* * LED */ -struct Color{ - int R; - int G; - int B; -}; - class LEDView : public BView { public: - LEDView(BRect,int,int,int,int,int,int); - virtual void AttachedToWindow(void); - virtual void Draw(BRect); - void SetState(bool); -private: - void Refresh(void); - BRect bounds; - Color ActiveColor; - Color IdleColor; - bool State; -}; - -/* - * Meter - */ + LEDView(BRect frame, rgb_color active, rgb_color idle); + virtual void Draw(BRect update); + void SetState(bool new_state); -class MeterView : public BView { -public: - MeterView(BRect); - virtual void AttachedToWindow(void); - virtual void Draw(BRect); - virtual void Pulse(void); private: - void Refresh(void); - BRect bounds; + BRect bounds; + rgb_color active_color; + rgb_color idle_color; + bool state; }; + /* - * For running the emulation in its own thread + * Global variables */ -class Emulator { -public: - Emulator() {thread_running = FALSE;} - void Run(void); - void Quit(void); - -private: - static long thread_invoc(void*); //Emulator *obj); - void thread_func(void); - - thread_id the_thread; - bool thread_running; -}; - - // Keyboard and mouse int buttonstate[3]; int newmousecounters; int lastmx, lastmy; - -key_info old_key_info; -bool inwindow; -bool window_open; - -struct Event{ - Event *Next; - int Age; - char Key; -}; - -Event *CurentEvent,*LastEvent; +int quit_program; // Color map and bitmap xcolnr xcolors[4096]; struct vidbuf_description gfxvidinfo; - -int vsize, hsize, hpixels; - -BitmapView *bitmap_view; -UAEWindow *bitmap_window; - - -// Array for converting Be keycodes to Amiga keycodes -int keycode2amiga[128] = { - -1, AK_ESC, AK_F1, AK_F2, AK_F3, AK_F4, AK_F5, AK_F6, - AK_F7, AK_F8, AK_F9, AK_F10, AK_LALT, AK_mousestuff, AK_RALT, -1, - - -1, AK_BACKQUOTE, AK_1, AK_2, AK_3, AK_4, AK_5, AK_6, - AK_7, AK_8, AK_9, AK_0, AK_MINUS, AK_EQUAL, AK_BS, AK_HELP, - - AK_NPLPAREN, AK_RAMI, AK_NPLPAREN, AK_NPDIV, AK_NPMUL, AK_NPSUB, AK_TAB, AK_Q, - AK_W, AK_E, AK_R, AK_T, AK_Y, AK_U, AK_I, AK_O, - - AK_P, AK_LBRACKET, AK_RBRACKET, AK_BACKSLASH, AK_DEL, AK_NPRPAREN, AK_LAMI, AK_NP7, - AK_NP8, AK_NP9, AK_NPADD, AK_CAPSLOCK, AK_A, AK_S, AK_D, AK_F, - - AK_G, AK_H, AK_J, AK_K, AK_L, AK_SEMICOLON, AK_QUOTE, AK_RET, - AK_NP4, AK_NP5, AK_NP6, AK_LSH, AK_Z, AK_X, AK_C, AK_V, - - AK_B, AK_N, AK_M, AK_COMMA, AK_PERIOD, AK_SLASH, AK_RSH, AK_UP, - AK_NP1, AK_NP2, AK_NP3, AK_ENT, AK_CTRL, AK_LAMI, AK_SPC, AK_RAMI, - - AK_RALT, AK_LF, AK_DN, AK_RT, AK_NP0, AK_NPDEL, AK_LALT, AK_RALT, - AK_LTGT, -1, -1, -1, -1, -1, -1, -1, - - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1 -};