Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
For many years, perhaps since I first designed the fledgling version of SourceCoder 2.5, I have wanted to make a Javascript graphing calculator emulator. SourceCoder has a keypad that lets you enter tokens and symbols into its editor, but imagine if you could have a real calculator emulator right on the page to test your programs! Imagine if you could do BASIC development and testing online without having to touch an offline emulator or real calculator! This was my dream, but a combination of limited technology, limited experience, and legal hurdles restricted me from following through.

No longer.

First, the legal hurdles. It is illegal to distribute ROM images, so I couldn't make an emulator with a ROM image hosted on Cemetech. I couldn't even let people upload their own ROM images, or in any way let ROM images touch the Cemetech server. HTML 5 offers a solution to this conundrum in the form of what is called DOM Storage. Cemetech gives the javascript for my z80 core to clients, and they load their (legal, I hope) ROM image from their own personal calculator into their browser, but still entirely client-side. No ROMs are distributed in any form.

Second, the technical hurdles. The canvas element of HTML4/5 is powerful and fast enough to be manipulated and display a smooth image of a calculator screen in real-time. Modern computers and modern Javascript implementations are fast enough to run the massive code required for an emulated 6MHz CPU at faster than realtime. In addition, tools such as Google's Closure Compiler exist to optimize and compress Javascript for speed and size.

In a total of about four days separated by two months, I have put together jsTIfied, pronounced "justified", a Javasdript TI-83+ emulator. It is not ready for any public testing or release, and thus is sitting happily offline and not anywhere on Cemetech, but I'm proud to announce that it is fully-functional. As you can see from the screenshots below, I can do math, run applications, and I assure you, almost everything else an emulator such as PindurTI can do. Indeed, I owe a debt of thanks to Gergely Patai (or Patai Gergely), the author of the original PindurTI, for swathes of C code that I studied for jsTIfied, and for the key layout that I used for jsTIfied. In homage to PindurTI, I made the appearance resemble that much-loved emulator. I also owe thanks to JSSpeccy, a Javascript ZX Spectrum emulator that heavily contributed to my understanding of emulating a z80 processor, and some segments of code from which found their way into jsTIfied, especially in helping me to wrap my head around emulating interrupts.

I have great plans for jsTIfied, including letting you somehow test programs from the archives, run SourceCoder projects, and much more straight from your browser. Before that can happen, there are plenty of tweaks and changes for smoothness to be made and features to be added, so for now, enjoy the screenshots below!

That's some high level of awesome right there, Kerm Very Happy Good job, can't wait to see this working in conjunction with sourcecoder!
tifreak8x wrote:
That's some high level of awesome right there, Kerm Very Happy Good job, can't wait to see this working in conjunction with sourcecoder!
Many thanks, tifreak8x! I'm looking very forward to sharing this with everyone. Smile
This is very cool! Do you have plans to support 84+ emulation as well?
elfprince13 wrote:
This is very cool! Do you have plans to support 84+ emulation as well?
Thanks, Elfprince! I am able to eke out about 8 or 10MHz, so there is a bottleneck there. I also don't think I'll be able to fit a full 84+/SE OS in the DOM Storage, although I'm not positive about that.
Awesome job, Kerm. Very Happy Do you have plans to let it directly connect to gCn without any offline computer programs?
souvik1997 wrote:
Awesome job, Kerm. Very Happy Do you have plans to let it directly connect to gCn without any offline computer programs?
Oh a, I didn't even think of that, but I absolutely want to implement that now that you mention it. Very Happy Thanks for a superb suggestion!
You could use a free and open-source ROM to solve the legal issues. Otherwise, that's pretty awesome, Kerm Very Happy
juju2143 wrote:
You could use a free and open-source ROM to solve the legal issues. Otherwise, that's pretty awesome, Kerm Very Happy


Only thing free and open is the Bootfree bootloader. Still iffy ground.
KermMartian wrote:
elfprince13 wrote:
This is very cool! Do you have plans to support 84+ emulation as well?
Thanks, Elfprince! I am able to eke out about 8 or 10MHz, so there is a bottleneck there. I also don't think I'll be able to fit a full 84+/SE OS in the DOM Storage, although I'm not positive about that.


Don't most browsers allow you to configure DOM Storage allowances on a per-site basis? Safari has a "X MB Database Storage Allowed Before Asking" in the preferences, where X defaults to 5.
ParkerR wrote:
juju2143 wrote:
You could use a free and open-source ROM to solve the legal issues. Otherwise, that's pretty awesome, Kerm Very Happy


Only thing free and open is the Bootfree bootloader. Still iffy ground.
Yeah, that's my view as well. I'm happy letting users worry about the ROMs they have on their own computers and not having them touch the Cemetech server at all.

I actually got the DOM storage of the ROM fully-working; next up is serializing and de-serializing the ROM, RAM, and CPU state into and out of DOM storage so your calculator's state persists.
Interesting work, Kerm, I look forwards to seeing how it pans out. I hope you're testing in multiple browsers too to avoid relying on any browser-specific quirks, flaws or "features". Wink

I wonder what the legality of creating a completely home-brew OS that exposed (most of) the same bcalls as the official TI-OS would be? Most assembly games use a very small portion of the OS, so it wouldn't seem a particularly daunting task to get a large number of games running (you could boot the emulator straight to DoorsCS) and if a program did invoke an unimplemented bcall you could catch that, display a meaningful error message and offer to send a report to the emulator author.
This looks pretty cool. Can't wait until it's testable. I would very much like to do so.
adamac17 wrote:
This looks pretty cool. Can't wait until it's testable. I would very much like to do so.
I hope it will be especially helpful to people like you who like to code up programs in SourceCoder and don't have access to a cable to load your programs onto your calculator for testing.

Quote:
Interesting work, Kerm, I look forwards to seeing how it pans out. I hope you're testing in multiple browsers too to avoid relying on any browser-specific quirks, flaws or "features". Wink
I have not started doing so, but I absolutely hope to. I'm trying to go for a minimally-kludgy approach to all the JS coding in this (and the HTML, for that matter). I'm going to be opening up a semi-private beta much sooner than expect, so I'm hoping my favorite Cemetechians will assist me in cross-browser testing. Thanks for your help in finding those two bugs this morning!

Quote:
I wonder what the legality of creating a completely home-brew OS that exposed (most of) the same bcalls as the official TI-OS would be? Most assembly games use a very small portion of the OS, so it wouldn't seem a particularly daunting task to get a large number of games running (you could boot the emulator straight to DoorsCS) and if a program did invoke an unimplemented bcall you could catch that, display a meaningful error message and offer to send a report to the emulator author.
It's certainly something that I've considered before, mostly as a real calculator OS. In the end, I decided that the number of support systems and routines would make it infeasible to the point where I would essentially be duplicating the OS, save perhaps some of the math functions.
Quote:


I have not started doing so, but I absolutely hope to. I'm trying to go for a minimally-kludgy approach to all the JS coding in this (and the HTML, for that matter). I'm going to be opening up a semi-private beta much sooner than expect, so I'm hoping my favorite Cemetechians will assist me in cross-browser testing. Thanks for your help in finding those two bugs this morning!


I would gladly help cross browser test that for you!

Also another, cool quirk you could add, not sure how feasible it is.. Link the calculator to the archives at cemetech.net and ticalc.org, and make those programs testable. I have hated downloading games that I did not like, especially since Ti Connect and TILP dont like me. It would be nice if you could test the game to see if you like it, then download it for personal use. Not sure how possible that is however.
Aes_Sedia5 wrote:
Also another, cool quirk you could add, not sure how feasible it is.. Link the calculator to the archives at cemetech.net and ticalc.org, and make those programs testable. I have hated downloading games that I did not like, especially since Ti Connect and TILP dont like me. It would be nice if you could test the game to see if you like it, then download it for personal use. Not sure how possible that is however.
First post wrote:
I have great plans for jsTIfied, including letting you somehow test programs from the archives, run SourceCoder projects, and much more straight from your browser.
That's way farther down the line for this particular project, though.
That's a planned feature, Aes_, that was stated in the original post. Not sure if ticalc.org is in the works, but the Cemetech Archives certainly are.

~ninjad
souvik1997 wrote:
Awesome job, Kerm. Very Happy Do you have plans to let it directly connect to gCn without any offline computer programs?
That would make it an amazing emulator online or offline. Maybe sound too? Though that would be much harder I'd imagine.
Deep Thought wrote:
souvik1997 wrote:
Awesome job, Kerm. Very Happy Do you have plans to let it directly connect to gCn without any offline computer programs?
That would make it the best emulator online or offline. Maybe sound too? Though that would be much harder I'd imagine.
Sounds would be very very hard. Linking/gCn is hard enough; I have to decide whether I'm going to be cheap and do direct memory injection, or actually do a state machine and play with the link lines.
Actually, what about putting Cemetech- and ticalc.org-archive-browsing features in Sandpaper (those were planned, right?) so you can use it with gCn in jsTIfied? That way you won't have to make a separate system for browsing those files.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 3
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement