Example #1
0
        private void HardReset()
        {
            _cart = Cart.Create(_rom, _gameInfo.CartType);
            ILogger logger = new ConsoleLogger();

            HSC7800 hsc7800 = null;

            if (_hsbios != null)
            {
                hsc7800 = new HSC7800(_hsbios, _hsram);
            }

            Bios7800 bios7800 = new Bios7800(_bios);

            _theMachine = MachineBase.Create(
                _gameInfo.MachineType,
                _cart,
                bios7800,
                hsc7800,
                _gameInfo.LController,
                _gameInfo.RController,
                logger);

            _theMachine.Reset();
            _theMachine.InputState.InputPollCallback = InputCallbacks.Call;

            ControlAdapter       = new Atari7800Control(_theMachine);
            ControllerDefinition = ControlAdapter.ControlType;

            _avProvider.ConnectToMachine(_theMachine, _gameInfo);

            SetupMemoryDomains(hsc7800);
        }
Example #2
0
        public Machine7800(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger, int scanlines, int startl, int fHZ, int sRate, int[] p)
            : base(logger, scanlines, startl, fHZ, sRate, p, 320)
        {
            Mem = new AddressSpace(this, 16, 6);  // 7800: 16bit, 64byte pages

            CPU = new M6502(this, 4);

            Maria = new Maria(this, scanlines);
            Mem.Map(0x0000, 0x0040, Maria);
            Mem.Map(0x0100, 0x0040, Maria);
            Mem.Map(0x0200, 0x0040, Maria);
            Mem.Map(0x0300, 0x0040, Maria);

            PIA = new PIA(this);
            Mem.Map(0x0280, 0x0080, PIA);
            Mem.Map(0x0480, 0x0080, PIA);
            Mem.Map(0x0580, 0x0080, PIA);

            RAM1 = new RAM6116();
            RAM2 = new RAM6116();
            Mem.Map(0x1800, 0x0800, RAM1);
            Mem.Map(0x2000, 0x0800, RAM2);

            Mem.Map(0x0040, 0x00c0, RAM2); // page 0 shadow
            Mem.Map(0x0140, 0x00c0, RAM2); // page 1 shadow
            Mem.Map(0x2800, 0x0800, RAM2); // shadow1
            Mem.Map(0x3000, 0x0800, RAM2); // shadow2
            Mem.Map(0x3800, 0x0800, RAM2); // shadow3

            BIOS = bios;
            HSC  = hsc;

            if (HSC != null)
            {
                Mem.Map(0x1000, 0x800, HSC.SRAM);
                Mem.Map(0x3000, 0x1000, HSC);
                Logger.WriteLine("7800 Highscore Cartridge Installed");
            }

            Cart = cart;
            Mem.Map(0x4000, 0xc000, Cart);
        }
Example #3
0
        private void HardReset()
        {
            cart = Cart.Create(rom, GameInfo.CartType);
            ILogger logger = new ConsoleLogger();

            HSC7800 hsc7800 = null;

            if (hsbios != null)
            {
                hsc7800 = new HSC7800(hsbios, hsram);
            }

            Bios7800 bios7800 = new Bios7800(bios);

            theMachine = MachineBase.Create
                             (GameInfo.MachineType,
                             cart,
                             bios7800,
                             hsc7800,
                             GameInfo.LController,
                             GameInfo.RController,
                             logger);

            theMachine.Reset();
            theMachine.InputState.InputPollCallback = InputCallbacks.Call;

            ControlAdapter       = new Atari7800Control(theMachine);
            ControllerDefinition = ControlAdapter.ControlType;

            _avProvider.ConnectToMachine(theMachine, GameInfo);

            // to sync exactly with audio as this emulator creates and times it, the frame rate should be exactly 60:1 or 50:1
            CoreComm.VsyncNum = theMachine.FrameHZ;
            CoreComm.VsyncDen = 1;

            SetupMemoryDomains(hsc7800);
        }
Example #4
0
        public Machine7800(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger, int scanlines, int startl, int fHZ, int sRate, int[] p)
            : base(logger, scanlines, startl, fHZ, sRate, p, 320)
        {
            Mem = new AddressSpace(this, 16, 6);  // 7800: 16bit, 64byte pages

            CPU = new M6502(this, 4);

            Maria = new Maria(this, scanlines);
            Mem.Map(0x0000, 0x0040, Maria);
            Mem.Map(0x0100, 0x0040, Maria);
            Mem.Map(0x0200, 0x0040, Maria);
            Mem.Map(0x0300, 0x0040, Maria);

            PIA = new PIA(this);
            Mem.Map(0x0280, 0x0080, PIA);
            Mem.Map(0x0480, 0x0080, PIA);
            Mem.Map(0x0580, 0x0080, PIA);

            RAM1 = new RAM6116();
            RAM2 = new RAM6116();
            Mem.Map(0x1800, 0x0800, RAM1);
            Mem.Map(0x2000, 0x0800, RAM2);

            Mem.Map(0x0040, 0x00c0, RAM2); // page 0 shadow
            Mem.Map(0x0140, 0x00c0, RAM2); // page 1 shadow
            Mem.Map(0x2800, 0x0800, RAM2); // shadow1
            Mem.Map(0x3000, 0x0800, RAM2); // shadow2
            Mem.Map(0x3800, 0x0800, RAM2); // shadow3

            BIOS = bios;
            HSC = hsc;

            if (HSC != null)
            {
                Mem.Map(0x1000, 0x800, HSC.SRAM);
                Mem.Map(0x3000, 0x1000, HSC);
                Logger.WriteLine("7800 Highscore Cartridge Installed");
            }

            Cart = cart;
            Mem.Map(0x4000, 0xc000, Cart);
        }
Example #5
0
        void HardReset()
        {
            cart = Cart.Create(rom, GameInfo.CartType);
            ILogger logger = new ConsoleLogger();

            HSC7800 hsc7800 = null;

            if (hsbios != null)
            {
                hsc7800 = new HSC7800(hsbios, hsram);
            }

            Bios7800 bios7800 = new Bios7800(bios);

            theMachine = MachineBase.Create
                             (GameInfo.MachineType,
                             cart,
                             bios7800,
                             hsc7800,
                             GameInfo.LController,
                             GameInfo.RController,
                             logger);

            theMachine.Reset();
            theMachine.InputState.InputPollCallback = CoreComm.InputCallback.Call;

            ControlAdapter       = new Atari7800Control(theMachine);
            ControllerDefinition = ControlAdapter.ControlType;

            avProvider.ConnectToMachine(theMachine, GameInfo);
            // to sync exactly with audio as this emulator creates and times it, the frame rate should be exactly 60:1 or 50:1
            CoreComm.VsyncNum = theMachine.FrameHZ;
            CoreComm.VsyncDen = 1;

            // reset memory domains
            if (_MemoryDomains == null)
            {
                _MemoryDomains = new List <MemoryDomain>();
                if (theMachine is Machine7800)
                {
                    _MemoryDomains.Add(new MemoryDomain(
                                           "RAM1", 0x800, MemoryDomain.Endian.Unknown,
                                           delegate(int addr)
                    {
                        if (addr < 0 || addr >= 0x800)
                        {
                            throw new ArgumentOutOfRangeException();
                        }
                        return(((Machine7800)theMachine).RAM1[(ushort)addr]);
                    },
                                           delegate(int addr, byte val)
                    {
                        if (addr < 0 || addr >= 0x800)
                        {
                            throw new ArgumentOutOfRangeException();
                        }
                        ((Machine7800)theMachine).RAM1[(ushort)addr] = val;
                    }));
                    _MemoryDomains.Add(new MemoryDomain(
                                           "RAM2", 0x800, MemoryDomain.Endian.Unknown,
                                           delegate(int addr)
                    {
                        if (addr < 0 || addr >= 0x800)
                        {
                            throw new ArgumentOutOfRangeException();
                        }
                        return(((Machine7800)theMachine).RAM2[(ushort)addr]);
                    },
                                           delegate(int addr, byte val)
                    {
                        if (addr < 0 || addr >= 0x800)
                        {
                            throw new ArgumentOutOfRangeException();
                        }
                        ((Machine7800)theMachine).RAM2[(ushort)addr] = val;
                    }));
                    _MemoryDomains.Add(new MemoryDomain(
                                           "BIOS ROM", bios.Length, MemoryDomain.Endian.Unknown,
                                           delegate(int addr)
                    {
                        return(bios[addr]);
                    },
                                           delegate(int addr, byte val)
                    {
                    }));
                    if (hsc7800 != null)
                    {
                        _MemoryDomains.Add(new MemoryDomain(
                                               "HSC ROM", hsbios.Length, MemoryDomain.Endian.Unknown,
                                               delegate(int addr)
                        {
                            return(hsbios[addr]);
                        },
                                               delegate(int addr, byte val)
                        {
                        }));
                        _MemoryDomains.Add(new MemoryDomain(
                                               "HSC RAM", hsram.Length, MemoryDomain.Endian.Unknown,
                                               delegate(int addr)
                        {
                            return(hsram[addr]);
                        },
                                               delegate(int addr, byte val)
                        {
                            hsram[addr] = val;
                        }));
                    }
                    _MemoryDomains.Add(new MemoryDomain(
                                           "System Bus", 65536, MemoryDomain.Endian.Unknown,
                                           delegate(int addr)
                    {
                        if (addr < 0 || addr >= 0x10000)
                        {
                            throw new ArgumentOutOfRangeException();
                        }
                        return(theMachine.Mem[(ushort)addr]);
                    },
                                           delegate(int addr, byte val)
                    {
                        if (addr < 0 || addr >= 0x10000)
                        {
                            throw new ArgumentOutOfRangeException();
                        }
                        theMachine.Mem[(ushort)addr] = val;
                    }));
                }
                else                 // todo 2600?
                {
                }
                MemoryDomains = new MemoryDomainList(_MemoryDomains);
            }
        }
Example #6
0
 public Machine7800NTSC(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger)
     : base(cart, bios, hsc, logger, 262, 16, 60, 31440 /* NTSC_SAMPLES_PER_SEC */, MariaTables.NTSCPalette)
 {
 }
Example #7
0
 public Machine7800PAL(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger)
     : base(cart, bios, hsc, logger, 312, 34, 50, 31200 /* PAL_SAMPLES_PER_SEC */, MariaTables.PALPalette)
 {
 }
Example #8
0
 public Machine7800NTSC(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger)
     : base(cart, bios, hsc, logger, 262, 16, 60, 31440 /* NTSC_SAMPLES_PER_SEC */, MariaTables.NTSCPalette)
 {
 }
Example #9
0
 public Machine7800PAL(Cart cart, Bios7800 bios, HSC7800 hsc, ILogger logger)
     : base(cart, bios, hsc, logger, 312, 34, 50, 31200 /* PAL_SAMPLES_PER_SEC */, MariaTables.PALPalette)
 {
 }