1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-22 14:33:51 +00:00

fixed loadBIOS

This commit is contained in:
Steven Hugg 2019-05-26 19:22:51 -04:00
parent bafee9d55d
commit 8e19a65968
4 changed files with 20 additions and 27 deletions

View File

@ -63,6 +63,16 @@ export class SN76489_Audio {
// https://user.xmission.com/~trevin/atari/pokey_regs.html
// http://krap.pl/mirrorz/atari/homepage.ntlworld.com/kryten_droid/Atari/800XL/atari_hw/pokey.htm
export function newPOKEYAudio(count:number) {
var audio = new MasterAudio();
for (var i=1; i<=count; i++) {
var pokey = new POKEYDeviceChannel();
audio['pokey'+i] = pokey; // TODO: cheezy
audio.master.addChannel(pokey);
}
return audio;
}
export var POKEYDeviceChannel = function() {
/* definitions for AUDCx (D201, D203, D205, D207) */

View File

@ -3,7 +3,7 @@
import { Platform, Base6502Platform, BaseMAMEPlatform, getOpcodeMetadata_6502, getToolForFilename_6502 } from "../baseplatform";
import { PLATFORMS, RAM, newAddressDecoder, padBytes, noise, setKeyboardFromMap, AnimationTimer, RasterVideo, Keys, makeKeycodeMap, dumpRAM, getMousePos } from "../emu";
import { hex, lzgmini, stringToByteArray, lpad, rpad, rgb2bgr } from "../util";
import { MasterAudio, POKEYDeviceChannel } from "../audio";
import { MasterAudio, POKEYDeviceChannel, newPOKEYAudio } from "../audio";
declare var jt; // for 6502
@ -17,14 +17,6 @@ const ATARI8_KEYCODE_MAP = makeKeycodeMap([
[Keys.VK_ENTER, 0, 0],
]);
function newPOKEYAudio() {
var pokey1 = new POKEYDeviceChannel();
var audio = new MasterAudio();
audio['pokey1'] = pokey1; // TODO: cheezy
audio.master.addChannel(pokey1);
return audio;
}
// ANTIC
// https://www.atarimax.com/jindroush.atari.org/atanttim.html
@ -477,7 +469,7 @@ const _Atari8Platform = function(mainElement) {
gtia = new GTIA(antic);
// create video/audio
video = new RasterVideo(mainElement, 352, 192);
audio = newPOKEYAudio();
audio = newPOKEYAudio(1);
video.create();
setKeyboardFromMap(video, inputs, ATARI8_KEYCODE_MAP, (o,key,code,flags) => {
// TODO

View File

@ -3,7 +3,7 @@
import { Platform, BaseZ80Platform, Base6502Platform } from "../baseplatform";
import { PLATFORMS, RAM, newAddressDecoder, padBytes, noise, setKeyboardFromMap, AnimationTimer, VectorVideo, Keys, makeKeycodeMap } from "../emu";
import { hex } from "../util";
import { MasterAudio, POKEYDeviceChannel } from "../audio";
import { MasterAudio, POKEYDeviceChannel, newPOKEYAudio } from "../audio";
// http://www.computerarcheology.com/Arcade/Asteroids/DVG.html
// http://arcarc.xmission.com/Tech/neilw_xy.txt
@ -41,17 +41,6 @@ var GRAVITAR_KEYCODE_MAP = makeKeycodeMap([
[Keys.VK_LEFT, 1, -0x8],
]);
function newPOKEYAudio() {
var pokey1 = new POKEYDeviceChannel();
var pokey2 = new POKEYDeviceChannel();
var audio = new MasterAudio();
audio['pokey1'] = pokey1; // TODO: cheezy
audio['pokey2'] = pokey2;
audio.master.addChannel(pokey1);
audio.master.addChannel(pokey2);
return audio;
}
var AtariVectorPlatform = function(mainElement) {
var XTAL = 12096000;
var cpuFrequency = XTAL/8;
@ -103,7 +92,7 @@ var AtariVectorPlatform = function(mainElement) {
// create video/audio
video = new VectorVideo(mainElement,1024,1024);
dvg = new DVGBWStateMachine(bus, video, 0x4000);
audio = newPOKEYAudio();
audio = newPOKEYAudio(2);
video.create();
timer = new AnimationTimer(60, this.nextFrame.bind(this));
setKeyboardFromMap(video, switches, ASTEROIDS_KEYCODE_MAP);
@ -259,7 +248,7 @@ var AtariColorVectorPlatform = function(mainElement) {
// create video/audio
video = new VectorVideo(mainElement,1024,1024);
dvg = new DVGColorStateMachine(bus, video, 0x2000);
audio = newPOKEYAudio();
audio = newPOKEYAudio(2);
video.create();
timer = new AnimationTimer(60, this.nextFrame.bind(this));
setKeyboardFromMap(video, switches, GRAVITAR_KEYCODE_MAP);
@ -404,7 +393,7 @@ var Z80ColorVectorPlatform = function(mainElement, proto) {
// create video/audio
video = new VectorVideo(mainElement,1024,1024);
dvg = new DVGColorStateMachine(bus, video, 0xa000);
audio = newPOKEYAudio();
audio = newPOKEYAudio(2);
video.create();
timer = new AnimationTimer(60, this.nextFrame.bind(this));
setKeyboardFromMap(video, switches, GRAVITAR_KEYCODE_MAP);

View File

@ -976,8 +976,10 @@ function loadBIOSFromProject() {
if (platform.loadBIOS) {
var biospath = platform_id + '.rom';
store.getItem(biospath).then( (biosdata) => {
console.log('loading BIOS')
platform.loadBIOS('BIOS', biosdata);
if (biosdata instanceof Uint8Array) {
console.log('loading BIOS')
platform.loadBIOS('BIOS', biosdata);
}
});
}
}