Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way ROMs are loaded #3

Open
xem opened this issue Jan 6, 2014 · 4 comments
Open

Change the way ROMs are loaded #3

xem opened this issue Jan 6, 2014 · 4 comments

Comments

@xem
Copy link
Owner

xem commented Jan 6, 2014

Hi,

I'm wondering if we could save bytes by changing the way ROMs are loaded:

  • Keep AJAX but without the arrayBuffer option so it can be synchronous
  • Provide the ROMs content in base64 in the URL's hash instead of its path
  • Use the file API to read the ROM's content (uploaded via a file uploader or by drag & dropping it from the file explorer to the browser...)

@aemkei @p01 @rlauck @subzey do you think one of these options could be a good alternative to the current ROM loader? ... Any idea on how to implement one of them?

@rlauck
Copy link
Collaborator

rlauck commented Jan 6, 2014

I've used the file api and drag+drop before and I dont think either would result in smaller code. base64 encoding in data uris would be a great way to go... could we also encode the 80 bytes of static font glyphs in there too?

@xem
Copy link
Owner Author

xem commented Jan 6, 2014

...we could, but these glyphs aren't really a part of the ROMs, they're more a part of the emulator. Or more specifically, a part of the emulator's BIOS. (its first reserved 512b)

I'll try the base64 thing then. or maybe I'll just use a string, instead base64...

@rlauck
Copy link
Collaborator

rlauck commented Jan 7, 2014

Fair enough, maybe we could encode the glyphs in a similar encoding and append it to the ROM before decoding? Not sure if it would help. With base64 we can rely on atob/btoa. I haven't had time to look at it today but I'll play with it tonight when I get a chance

@xem
Copy link
Owner Author

xem commented Jan 7, 2014

Hi, sorry, I just realized that the latest version of the emulator is buggy. For example, we can't move freely in BREAKOUT, the pixels keep being drawn if we release the keys in XMIRROR, etc.
We have to debug it or rollback to a previous version before trying to golf it better...=(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants