Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument Exception thrown while playing ROM #12

Open
Game4all opened this issue Jun 6, 2020 · 0 comments
Open

Argument Exception thrown while playing ROM #12

Game4all opened this issue Jun 6, 2020 · 0 comments

Comments

@Game4all
Copy link
Contributor

Game4all commented Jun 6, 2020

Recent work to improve emulator performance (namely #6) seems to have introduced a bug.

An exception will now throw while playing some ROMs such as Super Mario Bros Deluxe whereas it used to work correclty with an earlier emulator version.

Git bisect yields 912a7ee as the first bad commit.

The stack trace in question:

   at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
   at Emux.GameBoy.Cartridge.MemoryBankController5.ReadBytes(UInt16 address, Byte[] buffer, Int32 bufferOffset, Int32 length) 
   at Emux.GameBoy.Cartridge.EmulatedCartridge.ReadBytes(UInt16 address, Byte[] buffer, Int32 bufferOffset, Int32 length) 
   at Emux.GameBoy.Memory.GameBoyMemory.ReadBlock(UInt16 address, Byte[] buffer, Int32 offset, Int32 length)
   at Emux.GameBoy.Memory.DmaController.StartVramDmaTransfer() <------------------ Where the problem is
   at Emux.GameBoy.Memory.DmaController.WriteRegister(UInt16 address, Byte value)
   at Emux.GameBoy.Memory.GameBoyMemory.WriteByte(UInt16 address, Byte value)
   at Emux.GameBoy.Cpu.Z80OpCodes.<>c.<.cctor>b__3_220(GameBoy d, Z80Instruction i)
   at Emux.GameBoy.Cpu.Z80OpCode.<>c__DisplayClass9_0.<.ctor>b__0(GameBoy d, Z80Instruction i)
   at Emux.GameBoy.Cpu.Z80Instruction.Execute(GameBoy device)
   at Emux.GameBoy.Cpu.GameBoyCpu.PerformNextInstruction()
   at Emux.GameBoy.GameBoy.CpuLoop()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant