VIC Dual example; platforms in menu

This commit is contained in:
Steven Hugg 2017-02-14 18:15:06 -05:00
parent fe9b295539
commit ca9a4afec3
9 changed files with 12723 additions and 7 deletions

View File

@ -187,17 +187,18 @@ canvas.pixelated {
<li><a class="dropdown-item" href="#" id="item_share_file">Share File as GitHub Gist...</a></li>
<li><a class="dropdown-item" href="#" id="item_reset_file">Revert to Original...</a></li>
<li><a class="dropdown-item" href="#" id="item_download_rom">Download ROM Image...</a></li>
<!--
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Platform</a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="?platform=vcs" id="item_platform_vcs">Atari VCS</a></li>
<li><a class="dropdown-item" href="?platform=apple2" id="item_platform_apple2">Apple ][</a></li>
<li><a class="dropdown-item" href="?platform=vector" id="item_platform_atarivec">Asteroids</a></li>
<li><a class="dropdown-item" href="?platform=mw8080bw" id="item_platform_mw8080bw">Midway 8080 B/W</a></li>
<!--<li><a class="dropdown-item" href="?platform=apple2" id="item_platform_apple2">Apple ][</a></li>-->
<li><a class="dropdown-item" href="?platform=mw8080bw" id="item_platform_mw8080bw">Midway 8080 B&amp;W</a></li>
<li><a class="dropdown-item" href="?platform=vicdual" id="item_platform_vicdual">VIC Dual</a></li>
<li><a class="dropdown-item" href="?platform=galaxian" id="item_platform_galaxian">Galaxian/Scramble</a></li>
<li><a class="dropdown-item" href="?platform=vector-z80color" id="item_platform_vector_z80color">Atari Color Vector (Z80)</a></li>
<li><a class="dropdown-item" href="?platform=williams" id="item_platform_williams">Williams (Z80)</a></li>
</ul>
</li>
-->
<li class="dropdown dropdown-submenu">
<a tabindex="-1" href="#">Debug</a>
<ul class="dropdown-menu">

71
presets/vicdual/vic1.c Normal file

File diff suppressed because one or more lines are too long

View File

@ -561,6 +561,50 @@ var POKEYDeviceChannel = function() {
}
}
////// CPU sound
var CPUSoundChannel = function(cpu, clockRate) {
var sampleRate;
var buffer;
var lastbufpos=0;
var curSample=0;
var clocksPerSample;
this.setBufferLength = function (length) {
buffer = new Int32Array(length);
};
this.getBuffer = function () {
return buffer;
};
this.setSampleRate = function (rate) {
sampleRate = rate;
};
this.getSetDACFunction = function() {
return function(a,v) {
var bufpos = Math.floor(cpu.getTstates() / clocksPerSample);
while (lastbufpos < bufpos)
buffer[lastbufpos++] = curSample;
lastbufpos = bufpos;
curSample = v;
};
};
this.generate = function (length) {
clocksPerSample = clockRate * 1.0 / sampleRate;
var clocks = Math.round(length * clocksPerSample);
if (cpu.getTstates && cpu.runFrame) {
cpu.setTstates(0);
lastbufpos = 0;
cpu.runFrame(cpu.getTstates() + totalClocks);
while (lastbufpos < length)
buffer[lastbufpos++] = curSample;
}
};
}
////// 6502
var Base6502Platform = function() {

View File

@ -1,5 +1,7 @@
"use strict";
var VICDUAL_PRESETS = [
{id:'vic1.c', name:'Graphics Test'},
];
var VicDualPlatform = function(mainElement) {

View File

@ -179,7 +179,8 @@ function loadFile(fileid, filename, index) {
if (text) {
loadCode(text, fileid);
} else if (!text && index >= 0) {
filename += ".a";
if (filename.indexOf('.') <= 0)
filename += ".a";
console.log("Loading preset", fileid, filename, index, PRESETS[index]);
if (text.length == 0) {
console.log("Fetching", filename);
@ -292,7 +293,7 @@ function populateExamples(sel) {
sel.append($("<option />").text("--------- Chapters ---------").attr('disabled',true));
for (var i=0; i<PRESETS.length; i++) {
var preset = PRESETS[i];
var name = preset.chapter + ". " + preset.name;
var name = preset.chapter ? (preset.chapter + ". " + preset.name) : preset.name;
sel.append($("<option />").val(preset.id).text(name).attr('selected',preset.id==current_preset_id));
}
}

3857
tools/cp437-6x8.bdf Normal file

File diff suppressed because it is too large Load Diff

4881
tools/cp437-8x12.bdf Normal file

File diff suppressed because it is too large Load Diff

3857
tools/cp437-8x8.bdf Normal file

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,8 @@ import sys,string
height = 8
lochar = 0x20 #48
hichar = 0x5e #57
lochar = 0
hichar = 255
chars = {}
inbitmap = 0