Chipvuelto8/index.html

39 lines
960 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chip 8 emulator Test</title>
<style>
body {
background-color: #000;
}
</style>
</head>
<body>
<div id="emulator-container"></div>
<script src="./dist/revuelto8ts.js"></script>
<script>
// Assuming your library exposes an Emulator class
console.log(Revuelto8ts);
console.log(Revuelto8ts.Chip8Emulator);
const emulator = new Revuelto8ts.Chip8Emulator();
// Load ROM (you'll need to implement this method in your emulator)
fetch('./roms/Maze[David Winter, 199x].ch8')
.then(response => response.arrayBuffer())
.then(buffer => {
//emulator.loadROM(new Uint8Array(buffer));
// Load and start
const uint8Array = new Uint8Array(buffer);
const string = String.fromCharCode.apply(null, uint8Array);
console.log(string);
console.log(string.length);
});
</script>
</body>
</html>