Jump to content

Photo

Js99'er

Emulator JavaScript

434 replies to this topic

#51 mizapf OFFLINE  

mizapf

    River Patroller

  • 3,309 posts
  • Location:Germany

Posted Fri May 2, 2014 8:09 AM

Just to make sure you know ... there is also JSMESS, a project that is unrelated to the mainline MAME/MESS development. They ported MESS 0.142 to JavaScript, so it is somewhat outdated (with all the glitches that have been fixed in the meantime) but still pretty impressive.

http://jsmess.textfiles.com/
http://archiveteam.o...Javascript_Mess

This is not intended to put you off your implementation, of course. :-)

#52 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Fri May 2, 2014 8:17 AM

Just to make sure you know ... there is also JSMESS, a project that is unrelated to the mainline MAME/MESS development. They ported MESS 0.142 to JavaScript, so it is somewhat outdated (with all the glitches that have been fixed in the meantime) but still pretty impressive.

 

Yeah I know, I looked at that before I started. They are using  Emscripten  to compile LLVM bitcode generated from C/C++ into Javascript. So contributing that project would not really help me learning advanced JavaScript. 



#53 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Fri May 2, 2014 3:49 PM

Finally managed to get BASIC working. It was using a LIMI >0003 instruction, which I had never encountered before, and this made my emulation jump to the wrong interrupt routine address. It's approaching a stage where I expect things to work, so if you find any module that's not working let me know.

 

Next step would be to implement some kind of storage. I have no experience writing DSRs. Any suggestions for how this could be fast tracked? 

Attached Files



#54 Willsy OFFLINE  

Willsy

    River Patroller

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

Posted Fri May 2, 2014 4:36 PM

Wow well done! Brilliant job!

Regarding the DSR, write a very basic DSR (just a header and an unused op code) and trap on the unused opcode AND the cru address. At that point, pass control over to javascript for all facilities that the browser offers!

#55 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,165 posts
  • HarmlessLion
  • Location:BUR

Posted Fri May 2, 2014 8:20 PM

That's what Classic99 does, except it traps by address instead of by bad opcode (since the DSR space is controlled in Classic99 I can get away with that!)



#56 mizapf OFFLINE  

mizapf

    River Patroller

  • 3,309 posts
  • Location:Germany

Posted Sat May 3, 2014 5:10 AM

Yeah I know, I looked at that before I started. They are using  Emscripten  to compile LLVM bitcode generated from C/C++ into Javascript. So contributing that project would not really help me learning advanced JavaScript.


I already guessed you're doing this project in order to do some JavaScript programming; I think you did say so at the beginning.

You're spending quite some efforts here, so I just wanted to avoid a "could've told me earlier..." :-)

#57 Retrospect OFFLINE  

Retrospect

    Stargunner

  • 1,022 posts
  • Location:Wakefield, England

Posted Sat May 3, 2014 11:20 AM

Rasmus .... I have a bug report.

 

I've just tried TI INVADERS .... the player''s ships and enemy missiles are not showing up.  



#58 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Sat May 3, 2014 3:14 PM

Rasmus .... I have a bug report.

 

I've just tried TI INVADERS .... the player''s ships and enemy missiles are not showing up.  

 

Fixed!

 

Edit: I should have said 'fixed on the web site'. In the future I will keep the web site up to date but only post local files once in a while. Note that the web site consists of nothing but static files (html, js, css) - everything takes place at the client side. 



#59 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Sun May 4, 2014 1:44 AM

Help! I'm trying to implement a DSR for DSK1-3, and I'm testing it with TI BASIC:

 

10 GOTO 10

SAVE DSK1.TEST

 

This is what I get:

 

 * I/O ERROR 60

 

I thought this error would only appear if the error code is 0 and the COND bit in >837C is set, but the error code is 0 and the COND bit is not set. Is there anything else a DSR has to do to tell BASIC that the operation was successful?

 

Thanks - R

 

[Edit] Further info: My DSR routine is just a "B *R11". I trap when the CPU gets to this point and execute the JavaScript routine that performs the disk operation before executing the "B *R11". Any reason this should not work?

 

[Edit 2]: Solved it: I had to return with INCT R11, B *R11 instead.



#60 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,127 posts

Posted Sun May 4, 2014 3:07 AM

Wow. So you solved the problem while posting. Incredible work you've done and congratulation with your award.

#61 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Sun May 4, 2014 3:54 AM

Wow. So you solved the problem while posting. Incredible work you've done and congratulation with your award.

 

Thank you. Often writing about a problems helps you solve it. I should soon have a version ready where you can save and load to memory or the browser's local storage,



#62 Willsy OFFLINE  

Willsy

    River Patroller

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

Posted Sun May 4, 2014 4:44 AM

I had no idea that Javascript was this powerful. Awesome. Next step: Integrated assembler and debugger ;-)


Edited by Willsy, Sun May 4, 2014 4:44 AM.


#63 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Tue May 6, 2014 2:18 PM

There is now a high level DSR for DSK1-DSK3. No sector stuff, only the standard op-codes plus directory.

 

https://googledrive....aEU/index.html#

 

You can load TIFILES (no V9T9 files) either individually, multiple files at the same time, or even or zipped archives of TIFILES. There is no support for disk images (.dsk) - the sector dump format does not seem very nice to work with.

 

Currently the disks are stored in memory (on your computer) only, so they are wiped you when you refresh the page, but not when you reset the TI. Note that nothing you load will be sent to any server, everything is running on your own computer.



#64 kl99 OFFLINE  

kl99

    Dragonstomper

  • 837 posts
  • Location:Vienna, Austria

Posted Tue May 6, 2014 3:32 PM

Impressive! I find it nice, how you have combined learning with passion.
Can you give us some details on the javascript technology you use?

Angular JS got quite popular these days, does it has todo with it?
Or Jquery?

Thx kl99



#65 Willsy OFFLINE  

Willsy

    River Patroller

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

Posted Tue May 6, 2014 3:42 PM

Well, whaddaya know?! I just tried a TurboForth RPK in the on-line emulator, and it works!! WOW!

 

However, there seems to be a problem with key scanning. It's not able to detect the : and ; keys (very important for Forth!) so I can't enter Forth definitions.

 

Load the attached RPK (unzip it - I had to zip it to get past Atariage) and start TF in 40 columns. Type WORDS and press enter. All good. Now, try this:

 

: TEST 100 0 DO . LOOP ;

 

On my system, I can't get : and ; and some other keys. In fact, when I press the @ key (which is paired with ' on a UK British keyboard) the QuickFind dialog opens in Firefox - looks like not all keypresses are being passed by the browser.

 

I'm using the very latest version of Firefox with the dumb-ass Fischer Price menus, because, you know... we're too stupid to understand menus the "old" way!

 

Attached File  turboforth.zip   11.54KB   9 downloads



#66 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Tue May 6, 2014 4:30 PM

Well, whaddaya know?! I just tried a TurboForth RPK in the on-line emulator, and it works!! WOW!

 

However, there seems to be a problem with key scanning. It's not able to detect the : and ; keys (very important for Forth!) so I can't enter Forth definitions.

 

Load the attached RPK (unzip it - I had to zip it to get past Atariage) and start TF in 40 columns. Type WORDS and press enter. All good. Now, try this:

 

: TEST 100 0 DO . LOOP ;

 

On my system, I can't get : and ; and some other keys. In fact, when I press the @ key (which is paired with ' on a UK British keyboard) the QuickFind dialog opens in Firefox - looks like not all keypresses are being passed by the browser.

 

I'm using the very latest version of Firefox with the dumb-ass Fischer Price menus, because, you know... we're too stupid to understand menus the "old" way!

 

attachicon.gifturboforth.zip

 

I haven't looked much at the keyboard mapping yet. On my keyboard : and ; are on the key next to the left shift key.



#67 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Tue May 6, 2014 4:36 PM

Impressive! I find it nice, how you have combined learning with passion.
Can you give us some details on the javascript technology you use?

Angular JS got quite popular these days, does it has todo with it?
Or Jquery?

Thx kl99

 

 

I use a little bit of JQuery and Bootstrap for the user interface. But the reason you can make an emulator in JavaScript these days is because of HTML5 technologies like Canvas, Web Audio, File API and typed arrays.

And also because the performance of the JavaScript engines has improved tremendously over the last years.



#68 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Wed May 7, 2014 2:57 PM

However, there seems to be a problem with key scanning. It's not able to detect the : and ; keys (very important for Forth!) so I can't enter Forth definitions.

 

I have remapped a few keys - hope it works better. I only have a Danish keyboard.



#69 thej OFFLINE  

thej

    Space Invader

  • 28 posts

Posted Fri May 9, 2014 12:32 PM

Found a few issues:

When trying Donkey Kong, the only keys that work are; Tab, Q, Space and Enter. I have pressed every key on my keyboard with and without cap-lock on.

 

Also, it does not seem to work in Safari on Mac or iPad (Latest versions).

It displays the blank colored screen and teh log underneath only shows:

"Web Audio API detected

AudioContext: Sample rate is 44100"



#70 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Fri May 9, 2014 1:35 PM

Found a few issues:

When trying Donkey Kong, the only keys that work are; Tab, Q, Space and Enter. I have pressed every key on my keyboard with and without cap-lock on.

 

Also, it does not seem to work in Safari on Mac or iPad (Latest versions).

It displays the blank colored screen and teh log underneath only shows:

"Web Audio API detected

AudioContext: Sample rate is 44100"

 

The problem with the keys was that I had mapped the PC arrow keys to both activate the TI joystick and the TI arrow keys (Fctn S, D, E, X), but apparently this was breaking Donkey Kong so they are now back to only control the joystick.

 

I don't have a Mac to test with Safari. Are there any error messages in the developer console?



#71 thej OFFLINE  

thej

    Space Invader

  • 28 posts

Posted Fri May 9, 2014 1:59 PM

I didn't check. I'm not at my Mac right now but I do have my iPad with me. I can check later (tonight, tomorrow, not sure...)

 

One other item I forgot to add to the list was that the "Preloads" menu appears to be empty (with Safari).

The menu appears as a thin wide bubble between the word "Preloads" and the TI display screen.

 

As a side note, it all works fine in Forefox on Mac (but I'm sure you knew that would be the case :-)

 

Loving this thing though !!! Awesome work !!


Edited by thej, Fri May 9, 2014 2:00 PM.


#72 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Fri May 9, 2014 2:19 PM

One other item I forgot to add to the list was that the "Preloads" menu appears to be empty (with Safari).

The menu appears as a thin wide bubble between the word "Preloads" and the TI display screen.

 

There is probably a JavaScript error before the Preloads menu is initialized.



#73 thej OFFLINE  

thej

    Space Invader

  • 28 posts

Posted Fri May 9, 2014 7:27 PM

I enabled the "Develop" menu in Safari 7.0.3 and opened the error console.

Here is what I got:

 

[Error] ReferenceError: Can't find variable: indexedDB

open (database.js, line 27)
Database (database.js, line 19)
(anonymous function) (js99er.js, line 24)
j (jquery-1.11.0.min.js, line 2)
fireWith (jquery-1.11.0.min.js, line 2)
ready (jquery-1.11.0.min.js, line 2)
K (jquery-1.11.0.min.js, line 2)


#74 Asmusr OFFLINE  

Asmusr

    River Patroller

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

Posted Fri May 9, 2014 10:55 PM

 

I enabled the "Develop" menu in Safari 7.0.3 and opened the error console.

Here is what I got:

 

[Error] ReferenceError: Can't find variable: indexedDB

open (database.js, line 27)
Database (database.js, line 19)
(anonymous function) (js99er.js, line 24)
j (jquery-1.11.0.min.js, line 2)
fireWith (jquery-1.11.0.min.js, line 2)
ready (jquery-1.11.0.min.js, line 2)
K (jquery-1.11.0.min.js, line 2)

 

 

Thanks, that explains it. It should work now.  



#75 thej OFFLINE  

thej

    Space Invader

  • 28 posts

Posted Sat May 10, 2014 4:13 PM

 

Thanks, that explains it. It should work now.  

 

Works great in Safari 7 now !!

Thanks !!







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