amebo icon indicating copy to clipboard operation
amebo copied to clipboard

No video

Open foxt opened this issue 5 years ago • 1 comments

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();
                })
            });
        });

	}

foxt avatar Jun 30 '19 21:06 foxt

Noice

ghost avatar Nov 26 '21 00:11 ghost