mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-05-28 08:41:30 +00:00
williams: options=rotate%3D<deg>
This commit is contained in:
parent
0682af1eed
commit
8c63bef8c9
|
@ -11,10 +11,11 @@ var WILLIAMS_PRESETS = [
|
||||||
{ id: 'bitmap_rle.c', name: 'RLE Bitmap' },
|
{ id: 'bitmap_rle.c', name: 'RLE Bitmap' },
|
||||||
];
|
];
|
||||||
|
|
||||||
var WilliamsPlatform = function(mainElement, proto, isDefender) {
|
var WilliamsPlatform = function(mainElement, proto, options) {
|
||||||
var self = this;
|
var self = this;
|
||||||
this.__proto__ = new (proto ? proto : Base6809Platform)();
|
this.__proto__ = new (proto ? proto : Base6809Platform)();
|
||||||
|
|
||||||
|
var isDefender = options.isDefender;
|
||||||
var SCREEN_HEIGHT = 304;
|
var SCREEN_HEIGHT = 304;
|
||||||
var SCREEN_WIDTH = 256;
|
var SCREEN_WIDTH = 256;
|
||||||
|
|
||||||
|
@ -302,7 +303,8 @@ var WilliamsPlatform = function(mainElement, proto, isDefender) {
|
||||||
workerchannel = new WorkerSoundChannel(worker);
|
workerchannel = new WorkerSoundChannel(worker);
|
||||||
audio.master.addChannel(workerchannel);
|
audio.master.addChannel(workerchannel);
|
||||||
|
|
||||||
video = new RasterVideo(mainElement, SCREEN_WIDTH, SCREEN_HEIGHT, { rotate: -90 });
|
let rotate = options.rotate == null ? -90 : parseFloat(options.rotate);
|
||||||
|
video = new RasterVideo(mainElement, SCREEN_WIDTH, SCREEN_HEIGHT, { rotate });
|
||||||
video.create();
|
video.create();
|
||||||
$(video.canvas).click(function(e) {
|
$(video.canvas).click(function(e) {
|
||||||
var x = Math.floor(e.offsetX * video.canvas.width / $(video.canvas).width());
|
var x = Math.floor(e.offsetX * video.canvas.width / $(video.canvas).width());
|
||||||
|
@ -432,12 +434,12 @@ var WilliamsPlatform = function(mainElement, proto, isDefender) {
|
||||||
] } };
|
] } };
|
||||||
}
|
}
|
||||||
|
|
||||||
var Williams6809Platform = function(mainElement) {
|
var Williams6809Platform = function(mainElement, options) {
|
||||||
this.__proto__ = new WilliamsPlatform(mainElement, null, false);
|
this.__proto__ = new WilliamsPlatform(mainElement, null, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
var WilliamsZ80Platform = function(mainElement) {
|
var WilliamsZ80Platform = function(mainElement, options) {
|
||||||
this.__proto__ = new WilliamsPlatform(mainElement, BaseZ80Platform, false);
|
this.__proto__ = new WilliamsPlatform(mainElement, BaseZ80Platform, options);
|
||||||
|
|
||||||
// Z80 @ 4 MHz
|
// Z80 @ 4 MHz
|
||||||
// also scale bitblt clocks
|
// also scale bitblt clocks
|
||||||
|
@ -456,8 +458,8 @@ var WilliamsZ80Platform = function(mainElement) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var WilliamsDefenderPlatform = function(mainElement) {
|
var WilliamsDefenderPlatform = function(mainElement, options) {
|
||||||
this.__proto__ = new WilliamsPlatform(mainElement, null, true);
|
this.__proto__ = new WilliamsPlatform(mainElement, null, {isDefender:true});
|
||||||
this.getMemoryMap = function() { return { main:[
|
this.getMemoryMap = function() { return { main:[
|
||||||
{name:'NVRAM',start:0x400,size:0x200,type:'ram'},
|
{name:'NVRAM',start:0x400,size:0x200,type:'ram'},
|
||||||
{name:'Video RAM',start:0x0000,size:0xc000,type:'ram'},
|
{name:'Video RAM',start:0x0000,size:0xc000,type:'ram'},
|
||||||
|
|
|
@ -41,7 +41,6 @@ export function assembleXASM6809(step: BuildStep): BuildStepResult {
|
||||||
return { errors: errors };
|
return { errors: errors };
|
||||||
var aout = FS.readFile(binpath, { encoding: 'binary' });
|
var aout = FS.readFile(binpath, { encoding: 'binary' });
|
||||||
if (aout.length == 0) {
|
if (aout.length == 0) {
|
||||||
console.log(alst);
|
|
||||||
errors.push({ line: 0, msg: "Empty output file" });
|
errors.push({ line: 0, msg: "Empty output file" });
|
||||||
return { errors: errors };
|
return { errors: errors };
|
||||||
}
|
}
|
||||||
|
@ -118,7 +117,6 @@ export function compileCMOC(step: BuildStep): BuildStepResult {
|
||||||
var asmout = FS.readFile(destpath, { encoding: 'utf8' });
|
var asmout = FS.readFile(destpath, { encoding: 'utf8' });
|
||||||
if (step.params.set_stack_end)
|
if (step.params.set_stack_end)
|
||||||
asmout = asmout.replace('stack space in bytes', `\n lds #${step.params.set_stack_end}\n`)
|
asmout = asmout.replace('stack space in bytes', `\n lds #${step.params.set_stack_end}\n`)
|
||||||
console.log(asmout);
|
|
||||||
putWorkFile(destpath, asmout);
|
putWorkFile(destpath, asmout);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user