Skip to main content
↑
↓
Spherical forums
Community for the
Sphere game engine
New?
Contact Us
to register an account!
1 Hour
1 Day
1 Week
1 Month
Forever
Community
Help
Search
Recent Posts
Log in
Contact Us
News
Spherical
Facebook
-
Twitter
-
Discord chat
New?
Contact us
to register an account!
User-Made
Projects
Sphere 6502 emulator
previous
1
2
Print
Topic: Sphere 6502 emulator
(Read 12665 times)
previous topic
-
next topic
0 Members and 2 Guests are viewing this topic.
Mooch
Medium Poster
Posts: 148
Logged
Re: Sphere 6502 emulator
Reply #15
–
September 14, 2016, 11:22:35 am
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?
Eggbertx
High Poster
Posts: 352
Logged
Re: Sphere 6502 emulator
Reply #16
–
September 15, 2016, 06:02:41 am
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.
My GitHub
QtSphere IDE, (eventually) the one Sphere IDE to rule them all
Flying Jester
Legendary Poster
Posts: 1,161
Logged
TurboSphere Developer
Re: Sphere 6502 emulator
Reply #17
–
September 15, 2016, 01:03:56 pm
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.
Learn some history?
The Flying Jester's Blog of Sorts
Eggbertx
High Poster
Posts: 352
Logged
Re: Sphere 6502 emulator
Reply #18
–
September 15, 2016, 03:32:11 pm
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
My GitHub
QtSphere IDE, (eventually) the one Sphere IDE to rule them all
Eggbertx
High Poster
Posts: 352
Logged
Re: Sphere 6502 emulator
Reply #19
–
March 19, 2018, 08:48:36 pm
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
2
Likes
My GitHub
QtSphere IDE, (eventually) the one Sphere IDE to rule them all
Fat Cerberus
Big Chungus
Posts: 2,774
*MUNCH*
Logged
Global Moderator
Sphere Developer
Re: Sphere 6502 emulator
Reply #20
–
March 19, 2018, 09:03:35 pm
I'm intrigued and looking forward to seeing more.
neoSphere 5.9.2
-
neoSphere
engine -
Cell
compiler -
SSj
debugger
forum thread
|
on GitHub
Eggbertx
High Poster
Posts: 352
Logged
Re: Sphere 6502 emulator
Reply #21
–
March 20, 2018, 08:52:49 pm
Aaand done. Thanks for the help, Fat Cerberus and rhuan!
1
Likes
My GitHub
QtSphere IDE, (eventually) the one Sphere IDE to rule them all
Fat Cerberus
Big Chungus
Posts: 2,774
*MUNCH*
Logged
Global Moderator
Sphere Developer
Re: Sphere 6502 emulator
Reply #22
–
March 21, 2018, 12:03:22 am
This is a pretty awesome little assembler/emulator, me likey.
Is there a specific device this is meant to emulate?
neoSphere 5.9.2
-
neoSphere
engine -
Cell
compiler -
SSj
debugger
forum thread
|
on GitHub
Eggbertx
High Poster
Posts: 352
Logged
Re: Sphere 6502 emulator
Reply #23
–
March 21, 2018, 12:44:16 am
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
My GitHub
QtSphere IDE, (eventually) the one Sphere IDE to rule them all
DaVince
Legendary Poster
Posts: 1,001
Logged
Administrator
Used Sphere for, like, half my life
Re: Sphere 6502 emulator
Reply #24
–
March 22, 2018, 09:14:22 am
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!
Spherical Downloads Repo
||
My (really old) Sphere stuff
Rhuan
High Poster
Posts: 384
Logged
Re: Sphere 6502 emulator
Reply #25
–
March 25, 2018, 12:56:58 pm
Glad I could help - I'm almost always happy to spend time optimising code
Nice to see this running smoothly at high FPS now.
previous
1
2
Print
User-Made
Projects
Sphere 6502 emulator