mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Fix tape loading.
This commit is contained in:
parent
b688ccf10f
commit
83d9fd8730
19
js/main2.js
19
js/main2.js
@ -178,7 +178,6 @@ export function doLoad() {
|
|||||||
doLoadLocal(_currentDrive, files[0]);
|
doLoadLocal(_currentDrive, files[0]);
|
||||||
} else if (url) {
|
} else if (url) {
|
||||||
var filename;
|
var filename;
|
||||||
MicroModal.close('load-modal');
|
|
||||||
if (url.substr(0,6) == 'local:') {
|
if (url.substr(0,6) == 'local:') {
|
||||||
filename = url.substr(6);
|
filename = url.substr(6);
|
||||||
if (filename == '__manage') {
|
if (filename == '__manage') {
|
||||||
@ -217,13 +216,10 @@ function doLoadLocal(drive, file) {
|
|||||||
var ext = parts[parts.length - 1].toLowerCase();
|
var ext = parts[parts.length - 1].toLowerCase();
|
||||||
if (DISK_TYPES.includes(ext)) {
|
if (DISK_TYPES.includes(ext)) {
|
||||||
doLoadLocalDisk(drive, file);
|
doLoadLocalDisk(drive, file);
|
||||||
} else if ($.inArray(ext, TAPE_TYPES) >= 0) {
|
} else if (TAPE_TYPES.includes(ext)) {
|
||||||
tape.doLoadLocalTape(file, function() {
|
tape.doLoadLocalTape(file);
|
||||||
MicroModal.close('load-modal');
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
window.alert('Unknown file type: ' + ext);
|
window.alert('Unknown file type: ' + ext);
|
||||||
MicroModal.close('load-modal');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +231,6 @@ function doLoadLocalDisk(drive, file) {
|
|||||||
var name = parts.join('.');
|
var name = parts.join('.');
|
||||||
if (disk2.setBinary(drive, name, ext, this.result)) {
|
if (disk2.setBinary(drive, name, ext, this.result)) {
|
||||||
drivelights.label(drive, name);
|
drivelights.label(drive, name);
|
||||||
MicroModal.close('load-modal');
|
|
||||||
initGamepad();
|
initGamepad();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -412,7 +407,7 @@ export function updateSound() {
|
|||||||
label.classList.remove('fa-volume-up');
|
label.classList.remove('fa-volume-up');
|
||||||
label.classList.add('fa-volume-off');
|
label.classList.add('fa-volume-off');
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function dumpDisk(drive) {
|
function dumpDisk(drive) {
|
||||||
var wind = window.open('', '_blank');
|
var wind = window.open('', '_blank');
|
||||||
@ -455,7 +450,7 @@ export function updateCPU()
|
|||||||
if (runTimer) {
|
if (runTimer) {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
var _requestAnimationFrame =
|
var _requestAnimationFrame =
|
||||||
window.requestAnimationFrame ||
|
window.requestAnimationFrame ||
|
||||||
@ -816,7 +811,7 @@ export function updateScreen() {
|
|||||||
|
|
||||||
vm.green(green);
|
vm.green(green);
|
||||||
vm.scanlines(scanlines);
|
vm.scanlines(scanlines);
|
||||||
};
|
}
|
||||||
|
|
||||||
var disableMouseJoystick = false;
|
var disableMouseJoystick = false;
|
||||||
var flipX = false;
|
var flipX = false;
|
||||||
@ -879,11 +874,11 @@ export function toggleSound() {
|
|||||||
|
|
||||||
export function openOptions() {
|
export function openOptions() {
|
||||||
MicroModal.show('options-modal');
|
MicroModal.show('options-modal');
|
||||||
};
|
}
|
||||||
|
|
||||||
export function openPrinterModal() {
|
export function openPrinterModal() {
|
||||||
MicroModal.show('printer-modal');
|
MicroModal.show('printer-modal');
|
||||||
};
|
}
|
||||||
|
|
||||||
MicroModal.init();
|
MicroModal.init();
|
||||||
|
|
||||||
|
21
js/main2e.js
21
js/main2e.js
@ -193,13 +193,13 @@ export function doLoad() {
|
|||||||
document.location.hash = parts.join('|');
|
document.location.hash = parts.join('|');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
export function doSave() {
|
export function doSave() {
|
||||||
var name = document.querySelector('#save_name').value;
|
var name = document.querySelector('#save_name').value;
|
||||||
saveLocalStorage(_currentDrive, name);
|
saveLocalStorage(_currentDrive, name);
|
||||||
MicroModal.close('save-modal');
|
MicroModal.close('save-modal');
|
||||||
};
|
}
|
||||||
|
|
||||||
export function doDelete(name) {
|
export function doDelete(name) {
|
||||||
if (window.confirm('Delete ' + name + '?')) {
|
if (window.confirm('Delete ' + name + '?')) {
|
||||||
@ -212,13 +212,10 @@ function doLoadLocal(drive, file) {
|
|||||||
var ext = parts[parts.length - 1].toLowerCase();
|
var ext = parts[parts.length - 1].toLowerCase();
|
||||||
if (DISK_TYPES.includes(ext)) {
|
if (DISK_TYPES.includes(ext)) {
|
||||||
doLoadLocalDisk(drive, file);
|
doLoadLocalDisk(drive, file);
|
||||||
} else if ($.inArray(ext, TAPE_TYPES) >= 0) {
|
} else if (TAPE_TYPES.includes(ext)) {
|
||||||
tape.doLoadLocalTape(file, function() {
|
tape.doLoadLocalTape(file);
|
||||||
MicroModal.close('load-modal');
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
window.alert('Unknown file type: ' + ext);
|
window.alert('Unknown file type: ' + ext);
|
||||||
MicroModal.close('load-modal');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,7 +383,7 @@ export function updateSound() {
|
|||||||
label.classList.remove('fa-volume-up');
|
label.classList.remove('fa-volume-up');
|
||||||
label.classList.add('fa-volume-off');
|
label.classList.add('fa-volume-off');
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
function dumpDisk(drive) {
|
function dumpDisk(drive) {
|
||||||
var wind = window.open('', '_blank');
|
var wind = window.open('', '_blank');
|
||||||
@ -429,7 +426,7 @@ export function updateCPU()
|
|||||||
if (runTimer) {
|
if (runTimer) {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
var _requestAnimationFrame =
|
var _requestAnimationFrame =
|
||||||
window.requestAnimationFrame ||
|
window.requestAnimationFrame ||
|
||||||
@ -798,7 +795,7 @@ export function updateScreen() {
|
|||||||
|
|
||||||
vm.green(green);
|
vm.green(green);
|
||||||
vm.scanlines(scanlines);
|
vm.scanlines(scanlines);
|
||||||
};
|
}
|
||||||
|
|
||||||
var disableMouseJoystick = false;
|
var disableMouseJoystick = false;
|
||||||
var flipX = false;
|
var flipX = false;
|
||||||
@ -861,11 +858,11 @@ export function toggleSound() {
|
|||||||
|
|
||||||
export function openOptions() {
|
export function openOptions() {
|
||||||
MicroModal.show('options-modal');
|
MicroModal.show('options-modal');
|
||||||
};
|
}
|
||||||
|
|
||||||
export function openPrinterModal() {
|
export function openPrinterModal() {
|
||||||
MicroModal.show('printer-modal');
|
MicroModal.show('printer-modal');
|
||||||
};
|
}
|
||||||
|
|
||||||
MicroModal.init();
|
MicroModal.init();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user