wasmboy icon indicating copy to clipboard operation
wasmboy copied to clipboard

Initialize memory with random values

Open tobiasvl opened this issue 7 years ago • 5 comments

It doesn't seem like the memory is "random" enough when uninitialized after boot. This means that common PRNG routines that rely on uninitialized RAM as a seed don't work.

tobiasvl avatar Aug 22 '18 22:08 tobiasvl

Hey! @tobiasvl good to hear from you 😄

Oh I'll go ahead an implement this! I've been working on my PWA wrapper for wasmBoy here: https://github.com/torch2424/vaporBoy

And then doing some more housekeeping, and then I was going to go all in on Accuracy of the lib (wasmBoy).

Thanks for bringing this up :) I'll get to it as soon as I can

torch2424 avatar Aug 22 '18 22:08 torch2424

Cool! I made a game that uses random memory as a seed for PRNG, but none of the web emulators I tried supported it, so the game can't be played in the browser on itch.io :O

tobiasvl avatar Aug 23 '18 12:08 tobiasvl

Oh that's unfortunate. :( Do you have any docs for this (like can I find it in pandocs)? Also, how are you putting your game on itch? Do you have a client side JS project you are just uploading?

torch2424 avatar Aug 23 '18 18:08 torch2424

I'm not sure about docs. Some people on the Discord said that the "random" uninitialized memory has some consistent patterns on different devices, but I don't have any more information. I'm sure most emulators that support it just puts random garbage there, but for supreme accuracy there's probably some deep hole you can dig into.

And yeah, on itch you can just zip up an HTML file and JavaScript files, and it'll be playable on the website. I didn't actually check if it's easy/possible to package your emulator with a ROM like that though 😆 so if not, just ignore that part.

tobiasvl avatar Aug 24 '18 21:08 tobiasvl

Oh forsure, I'll look into that. I may just throw garbage in there for now, and then yeah (if that's what you are looking for).

And now there isn't currently! But if you want, I can whip up something super quick. I can try to make another github pages project, that simply uses a ROM you pass in as a query param. And the base page can just be an iframe with some styling, and possibly a mobile touchpad. But just be forwarned, wasmboy still has a lot of accuracy bugs :(

torch2424 avatar Aug 24 '18 23:08 torch2424