added category field to presets

This commit is contained in:
Steven Hugg 2023-11-16 13:40:23 -06:00
parent 19e3bbbea3
commit 73c7ac5941
10 changed files with 116 additions and 35 deletions

View File

@ -0,0 +1,30 @@
* = $7ffe
; 2-byte load address for ROM image
!word $8000
; http://swut.net/c64cart-howto.html
; https://codebase64.org/doku.php?id=base:assembling_your_own_cart_rom_image
!word CartKReset ; cold start vector
!word CartWStart ; warm start vector
!byte $c3, $c2, $cd, $38, $30 ; "CBM80"
CartKReset
STX $D016 ; Turn on VIC for PAL / NTSC check
JSR $FDA3 ; IOINIT - Init CIA chips
JSR $FD50 ; RANTAM - Clear/test system RAM
JSR $FD15 ; RESTOR - Init KERNAL RAM vectors
JSR $FF5B ; CINT - Init VIC and screen editor
CLI ; Re-enable IRQ interrupts
CartBReset
; init BASIC?
!ifdef CART_INIT_BASIC {
JSR $E453 ; Init BASIC RAM vectors
JSR $E3BF ; Main BASIC RAM Init routine
JSR $E422 ; Power-up message / NEW command
LDX #$FB
TXS ; Reduce stack pointer for BASIC
; don't init BASIC, just NOP
} else {
!fill 12, $ea ; nop
}
CartWStart
; should be * = $x025

42
presets/c64/hello.acme Normal file
View File

@ -0,0 +1,42 @@
!src "cartheader.acme"
!address {
Temp = $02
}
Start:
sei ; turn off interrupts
ldy #0
Loop:
lda Message,y ; load message byte
beq EOM ; 0 = end of string
clc
adc #$40
sta $400+41,y ; store to screen
iny
bne Loop ; next character
EOM:
Wait1:
lda $d011
bmi Wait1 ; wait for line < 256
Wait2:
lda $d012 ; get current scanline
Wait3:
cmp $d012
beq Wait3 ; wait for scanline to change
lsr ; divide by 2
lsr ; divide by 2
clc
adc Temp ; add to frame counter
sta $d020 ; set border color
lda $d011 ; get status bits
bpl Wait2 ; repeat until line >= 256
sty $d020 ; reset border color
dec Temp ; change frame counter
jmp Wait1 ; endless loop
Message:
!scr "HELLO WORLD", 0

View File

@ -158,6 +158,7 @@ export interface Preset {
name : string; name : string;
chapter? : number; chapter? : number;
title? : string; title? : string;
category?: string;
} }
export interface MemoryBus { export interface MemoryBus {

View File

@ -3,7 +3,7 @@
import * as localforage from "localforage"; import * as localforage from "localforage";
import { CodeProject, createNewPersistentStore, LocalForageFilesystem, OverlayFilesystem, ProjectFilesystem, WebPresetsFileSystem } from "./project"; import { CodeProject, createNewPersistentStore, LocalForageFilesystem, OverlayFilesystem, ProjectFilesystem, WebPresetsFileSystem } from "./project";
import { WorkerResult, WorkerOutputResult, WorkerError, FileData, WorkerErrorResult } from "../common/workertypes"; import { WorkerResult, WorkerError, FileData } from "../common/workertypes";
import { ProjectWindows } from "./windows"; import { ProjectWindows } from "./windows";
import { Platform, Preset, DebugSymbols, DebugEvalCondition, isDebuggable, EmuState } from "../common/baseplatform"; import { Platform, Preset, DebugSymbols, DebugEvalCondition, isDebuggable, EmuState } from "../common/baseplatform";
import { PLATFORMS, EmuHalt } from "../common/emu"; import { PLATFORMS, EmuHalt } from "../common/emu";
@ -15,7 +15,7 @@ import { GHSession, GithubService, getRepos, parseGithubURL } from "./services";
import Split = require('split.js'); import Split = require('split.js');
import { importPlatform } from "../platform/_index"; import { importPlatform } from "../platform/_index";
import { DisassemblerView, ListingView, PC_LINE_LOOKAHEAD , SourceEditor } from "./views/editors"; import { DisassemblerView, ListingView, PC_LINE_LOOKAHEAD , SourceEditor } from "./views/editors";
import { AddressHeatMapView, BinaryFileView, MemoryMapView, MemoryView, ProbeLogView, ProbeSymbolView, RasterPCHeatMapView, RasterStackMapView, ScanlineIOView, VRAMMemoryView } from "./views/debugviews"; import { AddressHeatMapView, BinaryFileView, MemoryMapView, MemoryView, ProbeLogView, ProbeSymbolView, RasterStackMapView, ScanlineIOView, VRAMMemoryView } from "./views/debugviews";
import { AssetEditorView } from "./views/asseteditor"; import { AssetEditorView } from "./views/asseteditor";
import { isMobileDevice } from "./views/baseviews"; import { isMobileDevice } from "./views/baseviews";
import { CallStackView, DebugBrowserView } from "./views/treeviews"; import { CallStackView, DebugBrowserView } from "./views/treeviews";
@ -1221,11 +1221,16 @@ async function _downloadAllFilesZipFile(e) {
function populateExamples(sel) { function populateExamples(sel) {
let files = {}; let files = {};
let optgroup = $("<optgroup />").attr('label','Examples').appendTo(sel); let optgroup;
for (var i=0; i<PRESETS.length; i++) { for (var i=0; i<PRESETS.length; i++) {
var preset = PRESETS[i]; var preset = PRESETS[i];
var name = preset.chapter ? (preset.chapter + ". " + preset.name) : preset.name; var name = preset.chapter ? (preset.chapter + ". " + preset.name) : preset.name;
var isCurrentPreset = preset.id==current_project.mainPath; var isCurrentPreset = preset.id==current_project.mainPath;
if (preset.category) {
optgroup = $("<optgroup />").attr('label','Examples: ' + preset.category).appendTo(sel);
} else if (!optgroup) {
optgroup = $("<optgroup />").attr('label','Examples').appendTo(sel);
}
optgroup.append($("<option />").val(preset.id).text(name).attr('selected',isCurrentPreset?'selected':null)); optgroup.append($("<option />").val(preset.id).text(name).attr('selected',isCurrentPreset?'selected':null));
if (isCurrentPreset) current_preset = preset; if (isCurrentPreset) current_preset = preset;
files[preset.id] = name; files[preset.id] = name;

View File

@ -224,6 +224,7 @@ export class AppleII extends BasicScanlineMachine implements AcceptsBIOS {
if (address < 0xc000 || address >= 0xd000) { if (address < 0xc000 || address >= 0xd000) {
return this.readConst(address); return this.readConst(address);
} else if (address < 0xc100) { } else if (address < 0xc100) {
this.probe.logIORead(address, 0); // TODO: value
var slot = (address >> 4) & 0x0f; var slot = (address >> 4) & 0x0f;
switch (slot) switch (slot)
{ {
@ -280,6 +281,7 @@ export class AppleII extends BasicScanlineMachine implements AcceptsBIOS {
if (address < 0xc000) { if (address < 0xc000) {
this.ram[address] = val; this.ram[address] = val;
this.grdirty[address>>7] = 1; this.grdirty[address>>7] = 1;
this.probe.logIOWrite(address, val);
} else if (address < 0xc080) { } else if (address < 0xc080) {
this.read(address); // strobe address, discard result this.read(address); // strobe address, discard result
} else if (address < 0xc100) { } else if (address < 0xc100) {

View File

@ -1,13 +1,13 @@
import { Platform, getOpcodeMetadata_6502, getToolForFilename_6502 } from "../common/baseplatform"; import { Platform, Preset, getOpcodeMetadata_6502, getToolForFilename_6502 } from "../common/baseplatform";
import { PLATFORMS } from "../common/emu"; import { PLATFORMS } from "../common/emu";
import { AppleII } from "../machine/apple2"; import { AppleII } from "../machine/apple2";
import { Base6502MachinePlatform } from "../common/baseplatform"; import { Base6502MachinePlatform } from "../common/baseplatform";
import { CodeAnalyzer_apple2 } from "../common/analysis"; import { CodeAnalyzer_apple2 } from "../common/analysis";
import { BaseMAME6502Platform } from "../common/mameplatform"; import { BaseMAME6502Platform } from "../common/mameplatform";
const APPLE2_PRESETS = [ const APPLE2_PRESETS : Preset[] = [
{id:'sieve.c', name:'Sieve'}, {id:'sieve.c', name:'Sieve', category:"C"},
{id:'keyboardtest.c', name:'Keyboard Test'}, {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'},
@ -16,12 +16,12 @@ const APPLE2_PRESETS = [
{id:'cosmic.c', name:'Cosmic Impalas'}, {id:'cosmic.c', name:'Cosmic Impalas'},
{id:'farmhouse.c', name:"Farmhouse Adventure"}, {id:'farmhouse.c', name:"Farmhouse Adventure"},
{id:'yum.c', name:"Yum Dice Game"}, {id:'yum.c', name:"Yum Dice Game"},
{id:'lzgtest.c', name:"LZG Decompressor (C)"}, {id:'lzgtest.c', name:"LZG Decompressor"},
{id:'hgrtest.a', name:"HGR Test (ASM)"}, {id:'hgrtest.a', name:"HGR Test", category:"Assembly Language"},
{id:'conway.a', name:"Conway's Game of Life (ASM)"}, {id:'conway.a', name:"Conway's Game of Life"},
{id:'lz4fh.a', name:"LZ4FH Decompressor (ASM)"}, {id:'lz4fh.a', name:"LZ4FH Decompressor"},
{id:'deltamod.dasm', name:"Delta Modulation (ASM)"}, {id:'deltamod.dasm', name:"Delta Modulation Audio"},
// {id:'zap.dasm', name:"ZAP! (ASM)"}, // {id:'zap.dasm', name:"ZAP!"},
// {id:'tb_6502.s', name:'Tom Bombem (assembler game)'}, // {id:'tb_6502.s', name:'Tom Bombem (assembler game)'},
]; ];

View File

@ -1,12 +1,12 @@
import { Platform, getOpcodeMetadata_6502, getToolForFilename_6502, Base6502MachinePlatform } from "../common/baseplatform"; import { Platform, getOpcodeMetadata_6502, getToolForFilename_6502, Base6502MachinePlatform, Preset } from "../common/baseplatform";
import { PLATFORMS } from "../common/emu"; import { PLATFORMS } from "../common/emu";
import { BaseMAME6502Platform } from "../common/mameplatform"; import { BaseMAME6502Platform } from "../common/mameplatform";
import { Atari5200, Atari800 } from "../machine/atari8"; import { Atari5200, Atari800 } from "../machine/atari8";
declare var jt; // for 6502 declare var jt; // for 6502
var Atari8_PRESETS = [ var Atari8_PRESETS : Preset[] = [
{id:'hello.dasm', name:'Hello World (ASM)'}, {id:'hello.dasm', name:'Hello World (ASM)'},
{id:'hellopm.dasm', name:'Hello Sprites (ASM)'}, {id:'hellopm.dasm', name:'Hello Sprites (ASM)'},
{id:'helloconio.c', name:'Text Mode (C)'}, {id:'helloconio.c', name:'Text Mode (C)'},
@ -16,7 +16,7 @@ var Atari8_PRESETS = [
var Atari800_PRESETS = Atari8_PRESETS.concat([ var Atari800_PRESETS = Atari8_PRESETS.concat([
{id:'testmusic.c', name:'POKEY Music (C)'}, {id:'testmusic.c', name:'POKEY Music (C)'},
{id:'sieve.bas', name:'Benchmark (FastBasic)'}, {id:'sieve.bas', name:'Benchmark (FastBasic)', category:'FastBasic'},
{id:'pmtest.bas', name:'Sprites Test (FastBasic)'}, {id:'pmtest.bas', name:'Sprites Test (FastBasic)'},
{id:'dli.bas', name:'DLI Test (FastBasic)'}, {id:'dli.bas', name:'DLI Test (FastBasic)'},
{id:'joyas.bas', name:'Match-3 Game (FastBasic)'}, {id:'joyas.bas', name:'Match-3 Game (FastBasic)'},

View File

@ -1,11 +1,11 @@
import { C64_WASMMachine } from "../machine/c64"; import { C64_WASMMachine } from "../machine/c64";
import { Platform, Base6502MachinePlatform, getToolForFilename_6502, getOpcodeMetadata_6502 } from "../common/baseplatform"; import { Platform, Base6502MachinePlatform, getToolForFilename_6502, getOpcodeMetadata_6502, Preset } from "../common/baseplatform";
import { PLATFORMS } from "../common/emu"; import { PLATFORMS } from "../common/emu";
import { BaseMAME6502Platform } from "../common/mameplatform"; import { BaseMAME6502Platform } from "../common/mameplatform";
const C64_PRESETS = [ const C64_PRESETS : Preset[] = [
{id:'helloc.c', name:'Hello World'}, {id:'helloc.c', name:'Hello World', category:'C'},
{id:'screen_ram.c', name:'Screen RAM'}, {id:'screen_ram.c', name:'Screen RAM'},
{id:'joymove.c', name:'Sprite Movement'}, {id:'joymove.c', name:'Sprite Movement'},
{id:'sprite_collision.c', name:'Sprite Collision'}, {id:'sprite_collision.c', name:'Sprite Collision'},
@ -35,7 +35,8 @@ const C64_PRESETS = [
{id:'23matches.c', name:'23 Matches'}, {id:'23matches.c', name:'23 Matches'},
{id:'tgidemo.c', name:'TGI Graphics Demo'}, {id:'tgidemo.c', name:'TGI Graphics Demo'},
{id:'upandaway.c', name:'Up, Up and Away'}, {id:'upandaway.c', name:'Up, Up and Away'},
{id:'hello.dasm', name:'Hello World (DASM)'}, {id:'hello.dasm', name:'Hello World (DASM)', category:'Assembly Language'},
{id:'hello.dasm', name:'Hello World (ACME)'},
{id:'hello.wiz', name:'Hello Wiz (Wiz)'}, {id:'hello.wiz', name:'Hello Wiz (Wiz)'},
]; ];

View File

@ -1,5 +1,5 @@
import { Platform, Base6502Platform, getOpcodeMetadata_6502, getToolForFilename_6502 } from "../common/baseplatform"; import { Platform, Base6502Platform, getOpcodeMetadata_6502, getToolForFilename_6502, Preset } from "../common/baseplatform";
import { PLATFORMS, setKeyboardFromMap, AnimationTimer, RasterVideo, Keys, makeKeycodeMap, KeyFlags, EmuHalt, ControllerPoller } from "../common/emu"; import { PLATFORMS, setKeyboardFromMap, AnimationTimer, RasterVideo, Keys, makeKeycodeMap, KeyFlags, EmuHalt, ControllerPoller } from "../common/emu";
import { hex, byteArrayToString } from "../common/util"; import { hex, byteArrayToString } from "../common/util";
import { CodeAnalyzer_nes } from "../common/analysis"; import { CodeAnalyzer_nes } from "../common/analysis";
@ -10,7 +10,7 @@ import Mousetrap = require('mousetrap');
import jsnes = require('../../jsnes'); import jsnes = require('../../jsnes');
import { BaseMAME6502Platform } from "../common/mameplatform"; import { BaseMAME6502Platform } from "../common/mameplatform";
const JSNES_PRESETS = [ const JSNES_PRESETS : Preset[] = [
{id:'hello.c', name:'Hello World'}, {id:'hello.c', name:'Hello World'},
{id:'attributes.c', name:'Attribute Table'}, {id:'attributes.c', name:'Attribute Table'},
{id:'scroll.c', name:'Scrolling'}, {id:'scroll.c', name:'Scrolling'},
@ -32,16 +32,16 @@ const JSNES_PRESETS = [
{id:'climber.c', name:'Climber Game'}, {id:'climber.c', name:'Climber Game'},
{id:'bankswitch.c', name:'Bank Switching'}, {id:'bankswitch.c', name:'Bank Switching'},
{id:'irq.c', name:'IRQ Scanline Counter'}, {id:'irq.c', name:'IRQ Scanline Counter'},
{id:'ex0.dasm', name:'Initialization (ASM)'}, {id:'ex0.dasm', name:'Initialization', category:'Assembly Language (ASM)'},
{id:'ex1.dasm', name:'Hello World (ASM)'}, {id:'ex1.dasm', name:'Hello World'},
{id:'ex2.dasm', name:'Scrolling Demo (ASM)'}, {id:'ex2.dasm', name:'Scrolling Demo'},
{id:'ex3.dasm', name:'Sprite Demo (ASM)'}, {id:'ex3.dasm', name:'Sprite Demo'},
{id:'ex4.dasm', name:'Controller Demo (ASM)'}, {id:'ex4.dasm', name:'Controller Demo'},
{id:'musicdemo.dasm', name:'Famitone Demo (ASM)'}, {id:'musicdemo.dasm', name:'Famitone Demo'},
{id:'xyscroll.dasm', name:'XY Split Scrolling (ASM)'}, {id:'xyscroll.dasm', name:'XY Split Scrolling'},
// {id:'scrollrt.dasm', name:'Line-by-line Scrolling (ASM)'}, // {id:'scrollrt.dasm', name:'Line-by-line Scrolling'},
{id:'road.dasm', name:'3-D Road Demo (ASM)'}, {id:'road.dasm', name:'3-D Road Demo'},
{id:'chase/game.c', name:'Shiru\'s Chase Game'}, {id:'chase/game.c', name:'Shiru\'s Chase Game', category:'Other'},
{id:'hello.wiz', name:'Hello (Wiz)'}, {id:'hello.wiz', name:'Hello (Wiz)'},
]; ];

View File

@ -1,6 +1,6 @@
import { Platform, BasePlatform, cpuStateToLongString_6502, dumpStackToString, DisasmLine, CpuState, getToolForFilename_6502 } from "../common/baseplatform"; import { Platform, BasePlatform, cpuStateToLongString_6502, dumpStackToString, DisasmLine, CpuState, Preset } from "../common/baseplatform";
import { PLATFORMS, dumpRAM, EmuHalt, RasterVideo, __createCanvas, drawCrosshair } from "../common/emu"; import { PLATFORMS, dumpRAM, EmuHalt, __createCanvas, drawCrosshair } from "../common/emu";
import { hex, loadScript, lpad, tobin } from "../common/util"; import { hex, loadScript, lpad, tobin } from "../common/util";
import { CodeAnalyzer_vcs } from "../common/analysis"; import { CodeAnalyzer_vcs } from "../common/analysis";
import { disassemble6502 } from "../common/cpu/disasm6502"; import { disassemble6502 } from "../common/cpu/disasm6502";
@ -11,7 +11,7 @@ import { BaseMAME6502Platform } from "../common/mameplatform";
declare var Javatari : any; declare var Javatari : any;
declare var jt : any; // 6502 declare var jt : any; // 6502
const VCS_PRESETS = [ const VCS_PRESETS : Preset[] = [
{id:'examples/hello.a', chapter:4, name:'Hello 6502 and TIA'}, {id:'examples/hello.a', chapter:4, name:'Hello 6502 and TIA'},
{id:'examples/vsync.a', chapter:5, name:'Painting on the CRT', title:'Color Bars'}, {id:'examples/vsync.a', chapter:5, name:'Painting on the CRT', title:'Color Bars'},
{id:'examples/playfield.a', chapter:6, name:'Playfield Graphics'}, {id:'examples/playfield.a', chapter:6, name:'Playfield Graphics'},
@ -42,11 +42,11 @@ const VCS_PRESETS = [
{id:'examples/road.a', chapter:33, name:'Pseudo 3D Road'}, {id:'examples/road.a', chapter:33, name:'Pseudo 3D Road'},
{id:'examples/bankswitching.a', chapter:35, name:'Bankswitching'}, {id:'examples/bankswitching.a', chapter:35, name:'Bankswitching'},
{id:'examples/wavetable.a', chapter:36, name:'Wavetable Sound'}, {id:'examples/wavetable.a', chapter:36, name:'Wavetable Sound'},
{id:'examples/fracpitch.a', name:'Fractional Pitch'},
{id:'examples/pal.a', name:'PAL Video Output'}, {id:'examples/pal.a', name:'PAL Video Output'},
// {id:'examples/testlibrary.a', name:'VCS Library Demo'}, // {id:'examples/testlibrary.a', name:'VCS Library Demo'},
// {id:'examples/music2.a', name:'Pitch-Accurate Music'}, // {id:'examples/music2.a', name:'Pitch-Accurate Music'},
// {id:'examples/fullgame.a', name:'Thru Hike: The Game', title:'Thru Hike'}, // {id:'examples/fullgame.a', name:'Thru Hike: The Game', title:'Thru Hike'},
{id:'examples/fracpitch.a', name:'Fractional Pitch', category:'BASIC and Other Languages'},
{id:'bb/helloworld.bas', name:'Hello World (batariBASIC)'}, {id:'bb/helloworld.bas', name:'Hello World (batariBASIC)'},
{id:'bb/draw.bas', name:'Playfield Draw (batariBASIC)'}, {id:'bb/draw.bas', name:'Playfield Draw (batariBASIC)'},
{id:'bb/sample.bas', name:'Sprite Test (batariBASIC)'}, {id:'bb/sample.bas', name:'Sprite Test (batariBASIC)'},