Jump to content

Photo

Js99'er

Emulator JavaScript

461 replies to this topic

#1 Asmusr OFFLINE  

Asmusr

    River Patroller

  • 2,892 posts
  • Location:Denmark

Posted Fri Apr 25, 2014 1:29 PM

I needed a project for learning advanced JavaScript for my work, so here is my proof of concept for a TI-99/4A emulator written in pure JavaScript: 

 

http://js99er.net

 

You can run it from the web link or download and expand the zip to your local machine and open the index.html file. All that's required is an up-to-date browser (Google, Firefox, IE 10+).

 

Currently only the CPU, VDP, PSG, RAM and a bit of the keyboard is emulated. There 's no system ROM, GROM, DSRs, disks, i.e. none of the console's 'operating system' (the opening screen is just a VDP dump). So the programs are limited to machine code that doesn't require any console routines. Luckily I had a few of those available ;-)

 

If you want to attempt to load other programs than the bundled examples, take at the software folder and software.js to see how it works, but beware that it will probably not work. The programs are currently provided as JavaScript arrays. I have attached a small Java program (bin2js.jar) to turn binary files into JavaScript arrays.

 

I have put this together in few weeks. This would not be possible without taking advantage other peoples' work. I'm in eternal debt to Tursi, from whom I have borrowed much of the CPU emulation (plus a little from MESS), the sound emulation is using components from TSS Chiptune Sound Library and JavaGear, and the VDP emulation was based on MSX.js but has been substantively rewritten.

 

If anyone is interested in contributing to js99'er I'm thinking about turning it into a GitHub open source project.

 

[EDIT] Joystick 1 is mapped to arrow keys + Tab like in Classic99.

 

Enjoy!

 

-----------------------------------------------------------------------------------------------------------------------------------------

 

Note: This is now a fully working emulator capable of running most programs. Low levels disk access is only partially supported, and speech support is a hack. Apart from that it works, and it's the only emulator that supports most of the functionality of the F18A.

Attached Files



#2 --- Ω --- OFFLINE  

--- Ω ---

    HexaCoreRunner

  • 12,840 posts

Posted Fri Apr 25, 2014 1:37 PM

I needed a project for learning advanced JavaScript for my work, so here is my proof of concept for a TI-99/4A emulator written in pure JavaScript: 

 

https://googledrive....PaEU/index.html

 

You can run it from the web link or download and expand the zip to your local machine and open the index.html file.

 

Totally AWESOME!

borat-thumbs-up.jpg



#3 Gary from OPA OFFLINE  

Gary from OPA

    Moonsweeper

  • 417 posts
  • Location:The World Wide Web

Posted Fri Apr 25, 2014 1:41 PM

Looks good.

 

There is another Java emulator Edward rewrote his V9T9 into Java a while ago:

 

http://eswartz.github.io/emul/



#4 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,892 posts
  • Location:Denmark

Posted Fri Apr 25, 2014 1:43 PM

Java and JavaScript are not the same.

 

BTW, could someone try it on a tablet or a phone? I only have a 4 year old Nokia :-).



#5 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,143 posts

Posted Fri Apr 25, 2014 2:23 PM

Looks as if it runs fine on our iPads and Android tablets, sometimes with slower frame rates ...

 

iPad.jpg

 

Android.jpg
 



#6 am1933 OFFLINE  

am1933

    Stargunner

  • 1,039 posts
  • Location:U.K

Posted Fri Apr 25, 2014 2:27 PM

 

Totally AWESOME!

borat-thumbs-up.jpg

Rasmus also number 1 exporter of potassium in Denmark, all other potassium inferior to Rasmus.



#7 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 798 posts
  • Location:Belgium

Posted Fri Apr 25, 2014 2:38 PM

Runs without errors on my Nexus 5, although fairly slow (15 to 30 fps). Can't test keyboard functionality though, so maybe an onscreen joystick would be good?

#8 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,892 posts
  • Location:Denmark

Posted Fri Apr 25, 2014 2:43 PM

In a few years it will probably be fine on phones, on my 3 years old laptop it runs at 60 FPS.



#9 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,143 posts

Posted Fri Apr 25, 2014 2:47 PM

Rasmus also number 1 exporter of potassium in Denmark, all other potassium inferior to Rasmus.

 

Yeah, I'm glad I didn't start a HTML5 Canvas shit thread when I looked into it a month ago. I was leaning more toward an XB emulator, with restrictions much like Harry's compiler (no file access etc.), but of course with floating point, and perhaps speech. You'd call the webpage, paste, write or edit the XB program and see it run wild (I would expect extremely fast ?).

 

:)


Edited by sometimes99er, Thu May 1, 2014 2:39 AM.


#10 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,892 posts
  • Location:Denmark

Posted Fri Apr 25, 2014 3:01 PM

 

Yeah, I'm glad I didn't start a HTML5 Canvas shit thread when I looked into it a month ago.

 

I'm hoping you would like to contribute to the project.  ;)



#11 ti99iuc ONLINE  

ti99iuc

    Stargunner

  • 1,515 posts
  • Location:Italy

Posted Fri Apr 25, 2014 3:31 PM

ohhhh nice, it's the future ! :D



#12 OLD CS1 OFFLINE  

OLD CS1

    Technomancer

  • 5,567 posts
  • Technology Samurai
  • Location:Tallahassee, FL

Posted Fri Apr 25, 2014 7:24 PM

BTW, could someone try it on a tablet or a phone? I only have a 4 year old Nokia :-).

 

Gonna give it a try on my HP TouchPad later.

 

Looks as if it runs fine on our iPads and Android tablets, sometimes with slower frame rates ...

 

Cool... if it does not work in a native TouchPad browser, then it might work in the ACL Android environment on the same.



#13 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,322 posts
  • Location:Eagan, MN, USA

Posted Fri Apr 25, 2014 9:14 PM

Cool! My frame rate is around 21 on my first gen Nexus 7 tablet.

#14 --- Ω --- OFFLINE  

--- Ω ---

    HexaCoreRunner

  • 12,840 posts

Posted Fri Apr 25, 2014 10:32 PM

I'd love to see Parsec added to the selection box!



#15 --- Ω --- OFFLINE  

--- Ω ---

    HexaCoreRunner

  • 12,840 posts

Posted Fri Apr 25, 2014 11:40 PM

In a few years it will probably be fine on phones, on my 3 years old laptop it runs at 60 FPS.

 

Same here.  It actually plays quite nicely.  I think a website with a bunch of PLAYABLE TI GAMES and a link to this forum might help bring locate some old users and some new blood in.

Attached Files



#16 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,892 posts
  • Location:Denmark

Posted Sat Apr 26, 2014 12:19 AM

I'd love to see Parsec added to the selection box!

 

Yes that would be interesting. I guess I would need to add the system ROMs and implement GROMs. Is Parsec dependent on anything else?



#17 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,079 posts
  • Location:Uzbekistan (no, really!)

Posted Sat Apr 26, 2014 11:57 AM

Rasmus also number 1 exporter of potassium in Denmark, all other potassium inferior to Rasmus.


Rasmus also have pretty sister!

#18 RobertLM78 OFFLINE  

RobertLM78

    Stargunner

  • 1,055 posts

Posted Sat Apr 26, 2014 1:41 PM

I'm using Firefox 28 on Linux Mint.  I also use No Script, but of course, I allowed the scripts for the site, but I can't seem to get it to run.  Am I doing something wrong?



#19 mizapf OFFLINE  

mizapf

    River Patroller

  • 3,383 posts
  • Location:Germany

Posted Sat Apr 26, 2014 2:40 PM

Mee too, I only see a black canvas, start button can be pressed without effect, stop button cannot be pressed, and the load dropdown is empty. My web developer console inside Firefox 28.0 (openSUSE 13.1) says:
 
* Use of getUserData() or setUserData() is deprecated.  Use WeakMap or element.dataset instead. (requestNotifier.js:64)
* The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. (index.html)
* ReferenceError: webkitAudioContext is not defined (AudioLooper.js:27)
 
At the same time, the console where I started Firefox says:
 
JavaScript error: https://googledrive..../AudioLooper.js
, line 27: webkitAudioContext is not defined

JavaScript error: http://atariage.com/...66e3b7a9956074d
, line 145: u.data.html is undefined

JavaScript error: http://atariage.com/...66e3b7a9956074d
, line 145: u.data.html is undefined


GRRRR ... HOW CAN I TELL THIS !"§$/$% EDITOR TO STOP CREATING HYPERLINKS!

Edited by mizapf, Sat Apr 26, 2014 2:46 PM.


#20 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,892 posts
  • Location:Denmark

Posted Sat Apr 26, 2014 3:31 PM

Have you tried running the app locally?



#21 RobertLM78 OFFLINE  

RobertLM78

    Stargunner

  • 1,055 posts

Posted Sat Apr 26, 2014 3:47 PM

Have you tried running the app locally?

That was the second thing I did when I couldn't get the website to work.

 

Mee too, I only see a black canvas, start button can be pressed without effect, stop button cannot be pressed, and the load dropdown is empty. My web developer console inside Firefox 28.0 (openSUSE 13.1) says:
 
* Use of getUserData() or setUserData() is deprecated.  Use WeakMap or element.dataset instead. (requestNotifier.js:64)
* The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. (index.html)
* ReferenceError: webkitAudioContext is not defined (AudioLooper.js:27)
 
At the same time, the console where I started Firefox says:
 
JavaScript error: https://googledrive..../AudioLooper.js
, line 27: webkitAudioContext is not defined

JavaScript error: http://atariage.com/...66e3b7a9956074d
, line 145: u.data.html is undefined

JavaScript error: http://atariage.com/...66e3b7a9956074d
, line 145: u.data.html is undefined


GRRRR ... HOW CAN I TELL THIS !"§$/$% EDITOR TO STOP CREATING HYPERLINKS!

Just click the hyperlink off when you go to edit the post (see the third weblink). Well that doesn't work - I would just misspell the link, like using google-com instead of google.com.


Edited by RobertLM78, Sat Apr 26, 2014 3:48 PM.


#22 RobertLM78 OFFLINE  

RobertLM78

    Stargunner

  • 1,055 posts

Posted Sat Apr 26, 2014 3:53 PM

I just went ahead and tried the local version again - same thing.

 

Attached Files



#23 Asmusr OFFLINE  

Asmusr

    River Patroller

  • Topic Starter
  • 2,892 posts
  • Location:Denmark

Posted Sat Apr 26, 2014 5:06 PM

Hmm, I don't know. It works fine in Firefox on Windows, but there is a warning in the console about the sound library being deprecated.



#24 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 798 posts
  • Location:Belgium

Posted Sun Apr 27, 2014 3:21 AM

In a few years it will probably be fine on phones, on my 3 years old laptop it runs at 60 FPS.

 

Yeah, same for my 2013 lowest-end Mac Mini (using Chrome). Nice job man, really slick.



#25 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,079 posts
  • Location:Uzbekistan (no, really!)

Posted Tue Apr 29, 2014 10:47 AM

This really has mega potential. This is awesome!





Also tagged with one or more of these keywords: Emulator, JavaScript

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users