⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vmcore.dpr

📁 一个不出名的GBA模拟器
💻 DPR
字号:
//////////////////////////////////////////////////////////////////////
//                                                                  //
// vmcore.dpr: Entry point for the Mappy VM Core                    //
//   This handles initialization and cleanup for the MVM core       //
//                                                                  //
// The contents of this file are subject to the Bottled Light       //
// Public License Version 1.0 (the "License"); you may not use this //
// file except in compliance with the License. You may obtain a     //
// copy of the License at http://www.bottledlight.com/BLPL/         //
//                                                                  //
// Software distributed under the License is distributed on an      //
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or   //
// implied. See the License for the specific language governing     //
// rights and limitations under the License.                        //
//                                                                  //
// The Original Code is the Mappy VM Core, released April 1st, 2003 //
// The Initial Developer of the Original Code is Bottled Light,     //
// Inc. Portions created by Bottled Light, Inc. are Copyright       //
// (C) 2001 - 2003 Bottled Light, Inc. All Rights Reserved.         //
//                                                                  //
// Author(s):                                                       //
//   Michael Noland (joat), michael@bottledlight.com                //
//                                                                  //
// Changelog:                                                       //
//   1.0: First public release (April 1st, 2003)                    //
//                                                                  //
// Notes:                                                           //
//   None at present.                                               //
//                                                                  //
//////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////
library vmcore; //////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////

uses
  Classes,
  nexus in 'nexus.pas',
  cpuMemory in 'cpuMemory.pas',
  cpuMisc in 'cpuMisc.pas',
  cpuThumbCore in 'cpuThumbCore.pas',
  cpuARMCore in 'cpuARMCore.pas',
  cpuGraphics in 'cpuGraphics.pas',
  cpuPeripherals in 'cpuPeripherals.pas',
  cpuSound in 'cpuSound.pas',
  ARM7tdmiCPU in 'ARM7tdmiCPU.pas',
  AddressSpace in '..\AddressSpace.pas';

//////////////////////////////////////////////////////////////////////

var
  // Original head of exit chain
  SaveExit: pointer;

//////////////////////////////////////////////////////////////////////

// Called when the DLL is unloaded
procedure LibExit;
begin
  // Relink the rest of the exit chain
  ExitProc := SaveExit;

  // Release used memory
  options.Free;
  vmRemoveCartridge;
  cpuMemFree;
end;

//////////////////////////////////////////////////////////////////////

begin
  // Register the cleanup handler
  SaveExit := ExitProc;
  ExitProc := @LibExit;

  // Create the option list
  options := TStringList.Create;

  // Initialize the CPU
  addOption('logDMAtransfers', @logDMATransfers, false);
  addOption('logBIOScalls', @logSoftwareInterrupts, false);
  addOption('logIOwrites', @logIORegisters, false);
  addOption('logInvalidStates', @logInvalidStates, false);

  irqPending := false;
  cpuSourceDebug := false;
  cpuStopped := false;
  haveFlippedThumb := false;
  timerQuotaAtLastFlush := 0;
  quota := 0;

  // Initialize memory
  cartRAMdirty := false;
  InitMemory;

  // Initialize sound
  sound1.enabled := false;
  sound2.enabled := false;
  sound3.enabled := false;
  sound4.enabled := false;

  ResetTDSoundRecord(soundA);
  ResetTDSoundRecord(soundB);

  addOption('enableGBC1', @enableGBC1, true);
  addOption('enableGBC2', @enableGBC2, true);
  addOption('enableGBC3', @enableGBC3, true);
  addOption('enableGBC4', @enableGBC4, true);
  addOption('enableDSA', @enableDSA, true);
  addOption('enableDSB', @enableDSB, true);

  soundCyclesUndone := 0;
  soundQuotaAtLastFlush := 0;
end.

//////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -