Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Deep Toaster on September 16, 2011, 10:42:40 pm
-
As some of you may know, I've decided to take on the project of a full TI-83 Plus emulator written in JavaScript. In other words, it'll be a webapp calculator that anyone could pull up whenever they're on a computer that's online.
First, I did the reality checks. There have been emulators in JavaScript already, including Two9A's (https://github.com/Two9A/jsGB) and Pedro Ladaria's (http://www.codebase.es/jsgb/) GameBoy emulators (with a GBZ80 engine) and JSSpeccy (http://matt.west.co.tt/spectrum/jsspeccy/), which uses a true Z80. The other major constraint is memory, and Eeems checked that for me with a benchmark too (http://eeems.dyndns.org:1337/benchmark.html) that shows that most browsers can handle far more than the 2 or so megabytes needed to emulate a TI-84 Plus. So it's definitely possible.
I finally started working on it today. It's located at http://clrhome.tk/resources/jazz/ (http://clrhome.tk/resources/jazz/), where I'll be testing individual instructions until I get all of them down. Right now it only has ADC (I'm working through the alphabet), but I'd really appreciate it if people who know ASM could help play around to see if all the flags are being emulated correctly. And if any of you with ASM and JS experience wants to help, please tell me! :)
-
Check out http://z80.info/ (http://z80.info/) for lots of information about the Z80. There's the Zilog Z80 CPU user manual (PDF) that describes every instruction (though it has errors), as well as articles about undocumented instructions. Pretty good resources.
-
I use that all the time, and even got 28D listed on the page :)
-
Btw, my benchmark script is now located on http://eeems.omnimaga.org/Files/benchmark.html if you want to be able to access it when my laptop is not online :P
I'm really looking forward to this :) Let me know if you need any help with anything at all, I'll be happy to provide whatever assistance I can :)
-
Sounds like a great idea! I would love to use a TI-83 Plus emulator on a public computer. :)
What are you going to do about the copyrighted OS, though?
-
Yeah sounds like a great idea. Can't wait to see this.
I guess the page would ask for an OS file.
-
Make it take a URL for an image too, so we can keep one on our servers so we don't have to have one on our phones, etc...
-
I mirror the question about how you are going to manage to bypass the OS copywrite issue o.O
-
Users will somehow have to provide the OS image to the emulator.
With the powerful JIT engines built into the JS interpreters of modern browsers, JS is fast enough for emulating a PC running Linux: http://bellard.org/jslinux/ . Therefore, a 83+ emulator ought to be doable in JS :)
-
Yeah, you'll have to somehow provide the image yourself. I'll definitely have it support saving ROMs too.
With the powerful JIT engines built into the JS interpreters of modern browsers, JS is fast enough for emulating a PC running Linux: http://bellard.org/jslinux/ . Therefore, a 83+ emulator ought to be doable in JS :)
That is amazing.
-
... Unless we use a community created OS... :D This sounds really cool! I won't need to use windows calculator anymore :D
-
This sounds very interesting! I look forward to seeing future progress! :)
-
Users will somehow have to provide the OS image to the emulator.
With the powerful JIT engines built into the JS interpreters of modern browsers, JS is fast enough for emulating a PC running Linux: http://bellard.org/jslinux/ . Therefore, a 83+ emulator ought to be doable in JS :)
Ok, that's just epic
-
I love running:
su
rm -r -f /*
on it. :)
edit: yeha, what jimbauwens said, it will mess shit up bad. DO NOT RUN ON YOUR OS!
-
Ehm, warning to all other Linux users/newbies, don't run this on your production machine!
-
Yeah edited with a warning :P
-
I love running:
su
rm -r -f /*
on it. :)
edit: yeha, what jimbauwens said, it will mess shit up bad. DO NOT RUN ON YOUR OS!
Don't you mean: su
rm -rf /
-
Works the same I believe.
-
Works the same I believe.
yes it does, but this is the more efficient way of typing it :P
-
Pfft efficiency :P
-
Looking at your Javascript, you're using eval() a lot, and that will slow things down a lot. Better to have an associative array connecting the name of each function to the actual function (one of the cool features of JS!), and then find the function from that array and call it. Something like
o={"adc_aa":adc_aa,"adc_ab":adc_ab,"adc_ac":adc_ac};
/* ...stuff... */
o[$('select').val()]();
Naturally, you can (and should!) eliminate the other evals too.
The Jquery can be sluggish, so it'll be good to do something along the lines of
selectBox=$('select');
/* replace everything else with the variable selectBox instead.. */
I'm not saying that a browser wouldn't be able to run this comfortably already, but with each layer of interpretation and emulation things get slower, and *especially* eval() will slow things down by a factor of 20 (maybe 100? maybe less..) easily.
-
I love running:
su
rm -r -f /*
on it. :)
edit: yeha, what jimbauwens said, it will mess shit up bad. DO NOT RUN ON YOUR OS!
Don't you mean: su
rm -rf /
what does it do?
-
rm -r removes an entire directory tree, and / is the root directory. So it deletes every file on your computer.
-
Looks terrible. O.O
-
rm -r removes an entire directory tree, and / is the root directory. So it deletes every file on your computer.
don't forget "-f" makes it not ask permission before deleting things.
-
Looking at your Javascript, you're using eval() a lot, and that will slow things down a lot.
I know. This is just temporary so I can easily test stuff. When I turn it into an actual emulator (which seems to be some time in the far future), the commands will be stored in an array of functions, or an array of arrays of functions for those with multiple bytes.
-
I've been doing some research of my own for personal reasons on the topic of emulating in a browser, you might find this interesting:
http://bellard.org/jslinux/tech.html
http://www.khronos.org/registry/typedarray/specs/latest/
-
Interesting project. I just hope you keep cross-browser compatibility in mind, though, such as Opera.
-
With cross browser in mind, make sure if you use the datatype I mentioned in the links above have it detect if it should use standard arrays or that type instead.