Skip to main content

News

Topic: Sphere 6502 emulator (Read 5725 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Mooch
  • [*][*][*]
Re: Sphere 6502 emulator
Reply #15
Not sure if you're still playing around with this but I just had a random thought -- the NES and SNES run off of modified 6502 chips. Would it be possible to program an emulator in Sphere if this got up and running?

Re: Sphere 6502 emulator
Reply #16
This is just a basic MOS 6502 emulator, the cpu itself with some stuff for drawing and taking input. For NES emulation, you also need to add code to handle palletes, sprite data, tile data and much more. And while the SNES's CPU is based on the 6502, that would take even more work.
Either way, it definitely wouldn't be at all impossible, but this would end up being a very small fraction of the overall code.

Re: Sphere 6502 emulator
Reply #17
I will go ahead and say that for anything resembling accurate SNES emulation, JS (or really almost any non-native language) is just way too slow. The NES may be another matter, though.

Re: Sphere 6502 emulator
Reply #18
Why is that? There's an x86 virtual machine written in Javascript, and while it obviously doesn't perform as well as it would natively, the x86 instruction set is a lot more complex than the SNES's CPU's instruction set.
  • Last Edit: September 16, 2016, 02:53:23 pm by Eggbert

Re: Sphere 6502 emulator
Reply #19
Making a new thread when this one is still on the first page seems kind of pointless, so I'll just resurrect this one.
Like how I've resurrected the 6502asm.com -> miniSphere port! And it actually (sort of) works this time, though rendering is kind of sluggish.

It also has a ROM hexdump function.
  • Last Edit: March 20, 2018, 03:00:39 am by Eggbertx

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: Sphere 6502 emulator
Reply #20
I'm intrigued and looking forward to seeing more. :D
miniSphere 5.3-beta1 (stable: 5.2.13) - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Sphere 6502 emulator
Reply #21
Aaand done. Thanks for the help, Fat Cerberus and rhuan!

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: Sphere 6502 emulator
Reply #22
This is a pretty awesome little assembler/emulator, me likey. :smiley:  Is there a specific device this is meant to emulate?
miniSphere 5.3-beta1 (stable: 5.2.13) - Cell compiler - SSj debugger
forum thread | on GitHub

Re: Sphere 6502 emulator
Reply #23
As far as I know, it isn't meant to emulate a specific system, and it doesn't have interrupts for input. ASCII values from keypress events are written to memory location $ff, and Math.random()*255 is written to memory location $fe, and for graphics, you simply read from/write to $200-$600 (1 KB or 32x32 px)
  • Last Edit: March 21, 2018, 02:21:02 am by Eggbertx

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Sphere 6502 emulator
Reply #24
This is very neat. I played a little bit of adventure.asm.

I guess in a way this adds compatibility to a whole bunch of (simple) games to miniSphere all at once! :P

  • Rhuan
  • [*][*][*][*]
Re: Sphere 6502 emulator
Reply #25
Glad I could help - I'm almost always happy to spend time optimising code :)

Nice to see this running smoothly at high FPS now.