mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-29 14:51:17 +00:00
fixed apple keys, kbd, unreadable memory
This commit is contained in:
parent
8bb67e5610
commit
1f32eee70c
16
presets/apple2/keyboardtest.c
Normal file
16
presets/apple2/keyboardtest.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <conio.h>
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
printf("\nKeyboard Test\n");
|
||||||
|
while (1) {
|
||||||
|
char ch = cgetc();
|
||||||
|
printf("%3d ($%2x) = %c\n", ch, ch, ch);
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,7 @@ declare var jt; // 6502
|
|||||||
|
|
||||||
const APPLE2_PRESETS = [
|
const APPLE2_PRESETS = [
|
||||||
{id:'sieve.c', name:'Sieve'},
|
{id:'sieve.c', name:'Sieve'},
|
||||||
|
{id:'keyboardtest.c', name:'Keyboard Test'},
|
||||||
{id:'mandel.c', name:'Mandelbrot'},
|
{id:'mandel.c', name:'Mandelbrot'},
|
||||||
{id:'tgidemo.c', name:'TGI Graphics Demo'},
|
{id:'tgidemo.c', name:'TGI Graphics Demo'},
|
||||||
{id:'siegegame.c', name:'Siege Game'},
|
{id:'siegegame.c', name:'Siege Game'},
|
||||||
@ -170,11 +171,17 @@ const _Apple2Platform = function(mainElement) {
|
|||||||
kbdlatch = (code | 0x80) & 0xff;
|
kbdlatch = (code | 0x80) & 0xff;
|
||||||
} else if (key) {
|
} else if (key) {
|
||||||
switch (key) {
|
switch (key) {
|
||||||
|
case 16: return; // shift
|
||||||
|
case 17: return; // ctrl
|
||||||
|
case 18: return; // alt
|
||||||
case 37: key=8; break; // left
|
case 37: key=8; break; // left
|
||||||
case 39: key=21; break; // right
|
case 39: key=21; break; // right
|
||||||
case 38: key=11; break; // up
|
case 38: key=11; break; // up
|
||||||
case 40: key=10; break; // down
|
case 40: key=10; break; // down
|
||||||
}
|
}
|
||||||
|
if (key >= 65 && key < 65+26) {
|
||||||
|
if (flags & 5) key -= 64; // ctrl
|
||||||
|
}
|
||||||
kbdlatch = (key | 0x80) & 0xff;
|
kbdlatch = (key | 0x80) & 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,8 +249,8 @@ const _Apple2Platform = function(mainElement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readAddress(addr) {
|
readAddress(addr : number) {
|
||||||
return bus.read(addr);
|
return ((addr & 0xf000) != 0xc000) ? bus.read(addr) : null; // ignore I/O space
|
||||||
}
|
}
|
||||||
|
|
||||||
loadState(state) {
|
loadState(state) {
|
||||||
|
@ -170,7 +170,7 @@ function refreshWindowList() {
|
|||||||
return new Views.DisassemblerView();
|
return new Views.DisassemblerView();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (platform.readAddress && platform_id != 'vcs') {
|
if (platform.readAddress) {
|
||||||
addWindowItem("#memory", "Memory Browser", function() {
|
addWindowItem("#memory", "Memory Browser", function() {
|
||||||
return new Views.MemoryView();
|
return new Views.MemoryView();
|
||||||
});
|
});
|
||||||
|
@ -528,6 +528,7 @@ export class ListingView extends DisassemblerView implements ProjectView {
|
|||||||
///
|
///
|
||||||
|
|
||||||
// TODO: make it use debug state
|
// TODO: make it use debug state
|
||||||
|
// TODO: make it safe (load/restore state?)
|
||||||
export class MemoryView implements ProjectView {
|
export class MemoryView implements ProjectView {
|
||||||
memorylist;
|
memorylist;
|
||||||
dumplines;
|
dumplines;
|
||||||
@ -613,7 +614,7 @@ export class MemoryView implements ProjectView {
|
|||||||
for (var i=n1; i<n2; i++) {
|
for (var i=n1; i<n2; i++) {
|
||||||
var read = platform.readAddress(offset+i);
|
var read = platform.readAddress(offset+i);
|
||||||
if (i==8) s += ' ';
|
if (i==8) s += ' ';
|
||||||
s += ' ' + (read>=0?hex(read,2):'??');
|
s += ' ' + (read!==null?hex(read,2):'??');
|
||||||
}
|
}
|
||||||
for (var i=n2; i<16; i++) s += ' ';
|
for (var i=n2; i<16; i++) s += ' ';
|
||||||
if (sym) s += ' ' + sym;
|
if (sym) s += ' ' + sym;
|
||||||
|
@ -97,6 +97,10 @@ function testPlatform(platid, romname, maxframes, callback) {
|
|||||||
for (var i=0; i<maxframes; i++) {
|
for (var i=0; i<maxframes; i++) {
|
||||||
if (callback) callback(platform, i);
|
if (callback) callback(platform, i);
|
||||||
platform.nextFrame();
|
platform.nextFrame();
|
||||||
|
if (i==10) {
|
||||||
|
for (var j=0; j<0x10000; j++)
|
||||||
|
platform.readAddress(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
platform.pause();
|
platform.pause();
|
||||||
assert.equal(maxframes, rec.numFrames());
|
assert.equal(maxframes, rec.numFrames());
|
||||||
|
Loading…
Reference in New Issue
Block a user