Deal with some stray globals.

This commit is contained in:
Will Scullin 2019-03-01 06:48:50 -08:00
parent 573f36510d
commit 13446c0afa
No known key found for this signature in database
GPG Key ID: 9092A5C0A673416B
5 changed files with 13 additions and 12 deletions

View File

@ -53,8 +53,6 @@ var blackCol = [0x00, 0x00, 0x00];
export function LoresPage(page, charset, e, context)
{
'use strict';
// $00-$3F inverse
// $40-$7F flashing
// $80-$FF normal
@ -480,8 +478,6 @@ export function LoresPage(page, charset, e, context)
export function HiresPage(page, context)
{
'use strict';
var _page = page;
var _imageData;
var _dirty = {

View File

@ -14,8 +14,6 @@ import { debug, toHex } from './util';
export default function CPU6502(options)
{
'use strict';
options = options || {};
var is65C02 = options['65C02'] ? true : false;

View File

@ -7,7 +7,7 @@ import RAM from './ram';
import { debug, gup, hup } from './util';
import Audio from './ui/audio';
import { gamepad, initGamepad, processGamepad } from './ui/gamepad';
import { gamepad, configGamepad, initGamepad, processGamepad } from './ui/gamepad';
import KeyBoard from './ui/keyboard';
import Printer from './ui/printer';
import Tape from './ui/tape';
@ -444,7 +444,7 @@ io.setSlot(3, videoterm);
io.setSlot(6, disk2);
io.setSlot(7, clock);
var showFPS = false;
window.showFPS = false;
function updateKHz() {
var now = Date.now();
@ -452,7 +452,7 @@ function updateKHz() {
var cycles = cpu.cycles();
var delta;
if (showFPS) {
if (window.showFPS) {
delta = renderedFrames - lastFrames;
var fps = parseInt(delta/(ms/1000), 10);
$('#khz').text( fps + 'fps');
@ -888,6 +888,7 @@ window.updateJoystick = function() {
flipX = $('#flip_x').prop('checked');
flipY = $('#flip_y').prop('checked');
swapXY = $('#swap_x_y').prop('checked');
configGamepad(flipX, flipY);
if (disableMouseJoystick) {
io.paddle(0, 0.5);

View File

@ -7,7 +7,7 @@ import Prefs from './prefs';
import { debug, gup, hup } from './util';
import Audio from './ui/audio';
import { gamepad, initGamepad, processGamepad } from './ui/gamepad';
import { gamepad, configGamepad, initGamepad, processGamepad } from './ui/gamepad';
import KeyBoard from './ui/keyboard';
import Printer from './ui/printer';
import Tape from './ui/tape';
@ -412,7 +412,7 @@ io.setSlot(2, slinky);
io.setSlot(6, disk2);
io.setSlot(7, clock);
var showFPS = false;
window.showFPS = false;
function updateKHz() {
var now = Date.now();
@ -420,7 +420,7 @@ function updateKHz() {
var cycles = cpu.cycles();
var delta;
if (showFPS) {
if (window.showFPS) {
delta = renderedFrames - lastFrames;
var fps = parseInt(delta/(ms/1000), 10);
$('#khz').text( fps + 'fps');
@ -860,6 +860,7 @@ window.updateJoystick = function() {
flipX = $('#flip_x').prop('checked');
flipY = $('#flip_y').prop('checked');
swapXY = $('#swap_x_y').prop('checked');
configGamepad(flipX, flipY);
if (disableMouseJoystick) {
io.paddle(0, 0.5);

View File

@ -96,6 +96,11 @@ export function processGamepad(io) {
}
}
export function configGamepad(configFlipX, configFlipY) {
flipX = configFlipX;
flipY = configFlipY;
}
export function initGamepad(data) {
for (var idx = 0; idx < 16; idx++) {
gamepadMap[idx] = undefined;