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

No video #6

Open
foxt opened this issue Jun 30, 2019 · 1 comment
Open

No video #6

foxt opened this issue Jun 30, 2019 · 1 comment

Comments

@foxt
Copy link

foxt commented Jun 30, 2019

I had to slightly modify Amebo to get it to work with the recent version of jszip, but I've got the ROM loading, I'm passing a canvas, and theres no output to the canvas

<head>
    
    <script type="text/javascript" src="gbc.js"></script>
    <script src="../gba/user_scripts/jszip-utils.min.js"></script>
    <script src="../gba/user_scripts/jszip.min.js"></script>
    <script type="text/javascript">
    gameboyObj = new gb("https://cors-anywhere.herokuapp.com/https://the-eye.eu/public/rom/Nintendo%20Gameboy%20Color/" + location.hash.substr(1), document.querySelector("canvas"));
    </script>
    <title>GameBoy Online</title>
</head>
<body>
    <canvas id="canv" width=160 height=144></canvas>
</body>

The modification to Amebo is as follows:

this.loadROM = function(url, pauseAfter) {
		var filename = url.split("/");
		GBObj.filename = filename[filename.length-1];
		GBObj.paused = true;

		JSZipUtils.getBinaryContent(url, function(err, data) {
            if(err) {
                alert("Error unzipping game!")
                throw err; // or handle err
            }
            JSZip.loadAsync(data).then(function (zip) {
				console.log(data,zip)
				var filename = Object.keys(zip.files)[0]
				console.log(filename)
                zip.files[filename].async("uint8array").then(function(ROM) {
                    GBObj.filename = filename;
					GBObj.loadROMBuffer(ROM);
					gameboyObj.paused = false;
					gameboyObj.reset();
                })
            });
        });

	}
@ghost
Copy link

ghost commented Nov 26, 2021

Noice

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

1 participant