|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
can WebMSX emulator be forked to emulate SMS, Gamegear and SG1000?
Posted: Sun Nov 12, 2017 7:10 pm
|
if someone know how to fork WebMSX to emulate SMS, Gamegear and SG1000, please do!
i think the official WebMSX github account is at https://github.com/ppeccin/WebMSX the amazing thing of WebMSX is that it allows a rom file, like hosted in your webpage, to run on the emulator hosted in another webpage somewhere else, like you can see at http://nitrofurano.altervista.org/retrocoding/msx/index2.html (i’m struggling a lot to find other javascript-based emulators that does the same...) and thanks for all efforts! :) |
|
|
Posted: Sun Nov 12, 2017 9:26 pm |
Why webmsx?
There are other javascript sms emulators around, some of them very good :) I think What webmsx.org is doing is to get the ROM (in PHP, by example) and pass into the html as a object (something easy). The opposite (get a file from other domain from the client) should be done though a Cross domain request, and would need to have a service in server which response ROMs in jsonp format (a base64 binary string into a jsonp structure, by example). |
|
|
Posted: Tue Nov 14, 2017 9:48 pm |
that’s the point, i still found no javascript-based SMS emulator that we can load a rom hosted in another domain, and WebMSX does it perfectly - what i don’t know is what has to be done (in the actual javascript-based SMS emulators, for example) to improve or fix such situation - perhaps forking them, or submit patches in their github accounts (if they exist)? | |
|
Posted: Tue Nov 14, 2017 11:43 pm |
The restriction is for security - JavaScript on one domain can't load data from another, see https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy . The workarounds are to proxy it via the original (script) domain (or one doing special things to allow cross domain access), to host the script on your own site, or to use something like JSONP to inject the data with some help from the host server. None of this is particularly related to the emulator in question. | |
|
Posted: Sun Nov 19, 2017 11:01 am |
so i guess that, somehow, for example, Miracle SMS emulator can be (relatively easily) forked adding that part that WebMSX can open rom files from other url domains? | |
|
Posted: Sun Nov 19, 2017 11:05 am |
It requires server side support, which is somewhat dangerous (arbitrary file proxying unless you also implement some data sniffing which is hard for ROMs). Just host it yourself... | |
|
Example
Posted: Sun Nov 19, 2017 2:53 pm
|
This a little example of miraclejs getting a from from outside, through a curl request in php.
Put the code on localhost (with xamp, by example), and test: http://localhost/index.php?romurl=http://localhost/roms/astroforce.sms Curl will download the sms file (it has not to be on localhost... which is what you are asking, i think) and save it on tmp folder, and will run the file with miracle. Have tuned miracle to run at 60fps, although the other variable (the scanLinesPerFrame var, at beggining of miracle.js) with value 313 seems to be correct only for pal. Does anyone know something about this? Regards |
|
|
Posted: Sun Nov 19, 2017 6:52 pm |
Yes, 262 for NTSC and 313 for PAL. | |
|
Posted: Sun Nov 19, 2017 7:17 pm |
i'd have same kind of question, but for C, could I use tms emulation for sms and use it on a msx 1 emulator ? | |
|
Posted: Sun Nov 19, 2017 8:55 pm |
That makes sense? If NTSC refresh 60hz versus Pal 50hZ should fill more lines per second! | |
|
Posted: Sun Nov 19, 2017 11:42 pm |
60 * 262 is nearly equal to 50 * 313. | |
|
Posted: Mon Nov 20, 2017 6:51 am |
So that 24 (262-24) lines are those which can be used to change tiles or sprites?
Then... Would make more tile changes on a Pal system than NTSC??? This inspire me... |
|
|
Posted: Mon Nov 20, 2017 8:49 am |
Yes, a lot of recent SMS demos have been PAL only for this reason. NTSC has 262-192=70 lines of inactive display, PAL has 313-192=121. With trickery, Game Gear has 262-144=118. | |
|
Posted: Mon Nov 20, 2017 9:30 am |
sure, you get more time to do 'fast' transfers - but you can load tiles also during vdraw phase, if you do it at 'safe' speed. |
|