Giter Site home page Giter Site logo

Comments (5)

mithrendal avatar mithrendal commented on June 16, 2024

hi @agony09

First of all I want to say thank you for this great emulator. It's really a great thing. Thanks.

❤️

Would this be possible?

yes. the preparations for this depends a bit on your planned use case ...

use case: use emulator web app like a native app

when you just want to use it as an emulator app then you have to install it (in iOS save to Home Screen) If installed it will remember the chosen roms on subsequent starts automatically.

use case: embed some c64 programs on your own website

you will find a howto in the wiki which describe how to auto load your desired roms
https://github.com/vc64web/virtualc64web/wiki/vc64webplayer_roms
https://github.com/vc64web/virtualc64web/wiki/vc64webplayer_d64

or just peek how others do it

https://quipzz.bplaced.net/c644.html
https://englishclass.de/~wolf/ac/demos

can you tell us more about your use case ?🤓 then we might give you a more specific advise

from virtualc64web.

agony09 avatar agony09 commented on June 16, 2024

Yes, thanks,
I uploaded the script to a web space. And it also starts when I go to the website. But on first boot, it loads the MEGA65 ROMs.
Yes, I know that I can then select the other ROMs myself and he will remember that.
However, my goal is that the ROM's from my web directory "roms" are automatically loaded the first time the website is started.
And not those MEGA65 roms that come by default.
I thought I had to change that in the "vc64_ui.js" file?

I don't want to start a game automatically. But only,
that the emulator takes other ROMs as default settings.

Can I perhaps enter something in my index.html?

Thanks in advance.

from virtualc64web.

mithrendal avatar mithrendal commented on June 16, 2024

You have to set the samesite file with the addresses of the roms before loading the player. Additionally you might want to configure that it should not show the missing roms dialog on the very first start…

let config={
  
  dialog_on_missing_roms:false,};

This is both described in

https://github.com/vc64web/virtualc64web/wiki/vc64webplayer_roms

Where have you deployed your website? … when you send us a link then we can take a closer look what’s wrong with the rom loading

from virtualc64web.

agony09 avatar agony09 commented on June 16, 2024

ok thanks.
i use this script:
https://github.com/vc64web/vc64web.github.io
i upload it to a web-server.
and i start it with the index.html in this script.

from virtualc64web.

mithrendal avatar mithrendal commented on June 16, 2024

@agony09 ok now I see what you are trying to do… you just want to copy the installation of vc64web to your webspace and run it with original roms per default. I.e. not by embedding it via the player …

For this use case you need to patch the file vc64_ui.js

  1. You duplicate the function fetchOpenROMS() and name it as you like … e.g. fetchOrigROMS() … then you adapt that function and point it to the roms you like to load.

  2. Next you have to find the word MSG_ROM_MISSING in the vc64_ui.js
    It looks like this

else if(msg == "MSG_ROM_MISSING")
    {        
        //try to load roms from local storage
        setTimeout(async function() {
            if(load_roms(true) == false)
            {
                get_parameter_link(); //just make sure the parameters are set
                if(call_param_openROMS==true)
                {
                    await fetchOpenROMS();        
                }
                else if(call_param_dialog_on_missing_roms != false)
                {
                    $('#modal_roms').modal();
                }
            }
        },0);
    }

Try to alter it to this

else if(msg == "MSG_ROM_MISSING")
    {        
        //try to load roms from local storage
        setTimeout(async function() {
            if(load_roms(true) == false)
            {
                get_parameter_link(); //just make sure the parameters are set
                await fetchOrigRoms(); //<—— your own implementation        
            }
        },0);
    }

You noticed that I removed the parts with fetchOpenRoms and also the code for opening the dialog to prompt the user for roms when they are missing…

Now whenever your vc64web copy is started and roms are missing i.e. not yet loaded to the local storage then it will fetch the roms you directed him to load in your own implementation of fetchOrigRoms() … and no rom dialog will popup

from virtualc64web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.