Beispiel #1
0
        public Menu(RendererSDL renderer, Network network)
        {
            menuList = new List <MenuList>();

            this.renderer = renderer;
            this.network  = network;

            networkAddress = Settings.Default.LastHost;

            drawTimer          = new Timer(20);
            drawTimer.Elapsed += new ElapsedEventHandler(drawTimer_Elapsed);
        }
Beispiel #2
0
        public void Start()
        {
            network = new Network();
            network.screenReceived      += new ScreenReceived(network_screenReceived);
            network.keyEventReceived    += new KeyEventReceived(network_keyEventReceived);
            network.joyEventReceived    += new JoyEventReceived(network_joyEventReceived);
            network.clientConnected     += new ClientConnected(network_clientConnected);
            network.clientConnectFailed += new ClientConnectFailed(network_clientConnectFailed);
            network.clientDisconnected  += new ClientDisconnected(network_clientDisconnected);
            network.incomingClient      += new IncomingClient(network_incomingClient);
            network.partedClient        += new PartedClient(network_partedClient);

            Video.WindowIcon(Resources.c64icon);
            Video.WindowCaption = "Pipkinsoft C64 Emulator";

            renderer = new RendererSDL();

            menu             = new Menu(renderer, network);
            menu.menuReturn += new MenuReturn(menu_menuReturn);
            menu.menuQuit   += new MenuQuit(menu_menuQuit);

            try
            {
                C64.Start(renderer, network);
            }
            catch (Exception ex)
            {
                renderer.DrawError(ex.Message);
                Events.Quit += new EventHandler <QuitEventArgs>(Quit);
                Events.Run();
                return;
            }

            Joysticks.Initialize();

            if (Joysticks.NumberOfJoysticks > 0)
            {
                joy1 = Joysticks.OpenJoystick(0);
            }
            if (Joysticks.NumberOfJoysticks > 1)
            {
                joy2 = Joysticks.OpenJoystick(1);
            }

            Events.Quit               += new EventHandler <QuitEventArgs>(Quit);
            Events.KeyboardDown       += new EventHandler <KeyboardEventArgs>(KeyboardEvent);
            Events.KeyboardUp         += new EventHandler <KeyboardEventArgs>(KeyboardEvent);
            Events.JoystickAxisMotion += new EventHandler <JoystickAxisEventArgs>(JoystickAxisMotion);
            Events.JoystickButtonDown += new EventHandler <JoystickButtonEventArgs>(JoystickButtonEvent);
            Events.JoystickButtonUp   += new EventHandler <JoystickButtonEventArgs>(JoystickButtonEvent);

            Events.Run();
        }
Beispiel #3
0
        public static void Start(RendererSDL r, Network n)
        {
            string appDir =
                Path.GetDirectoryName(Assembly.GetCallingAssembly().Location) +
                Path.DirectorySeparatorChar.ToString();

            renderer = r;
            renderer.ResetDrawState();
            network = n;
            kernal  = new Kernal(appDir + KERNALROM);
            basic   = new BASIC(appDir + BASICROM);
            charset = new Char(appDir + CHARROM);
            palette = new Palette();
            ram     = new Memory();
            vic     = new VIC();
            sid     = new SID();
            cia1    = new CIA1();
            cia2    = new CIA2();
            io      = new IO();
            cpu     = new CPU6510();

            cpu.Start();
        }