jsbeeb 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +15 -0
- package/.git-blame-ignore-revs +3 -0
- package/.github/copilot-instructions.md +94 -0
- package/.github/workflows/claude-issue-triage.yml +105 -0
- package/.github/workflows/claude.yml +63 -0
- package/.github/workflows/release-please.yml +75 -0
- package/.github/workflows/test-and-deploy.yml +86 -0
- package/.gitmodules +6 -0
- package/.husky/pre-commit +1 -0
- package/.idea/codeStyleSettings.xml +9 -0
- package/.idea/codeStyles/Project.xml +62 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/compiler.xml +22 -0
- package/.idea/copyright/profiles_settings.xml +3 -0
- package/.idea/encodings.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/jsLinters/jshint.xml +85 -0
- package/.idea/jsLinters/jslint.xml +15 -0
- package/.idea/jsbeeb.iml +11 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/runConfigurations/Debug.xml +5 -0
- package/.idea/scopes/scope_settings.xml +5 -0
- package/.idea/vcs.xml +8 -0
- package/.prettierignore +4 -0
- package/.prettierrc.json +1 -0
- package/.release-please-manifest.json +3 -0
- package/.vscode/launch.json +14 -0
- package/.vscode/settings.json +6 -0
- package/CHANGELOG.md +32 -0
- package/CLAUDE.md +136 -0
- package/COPYING +674 -0
- package/Dockerfile +22 -0
- package/Makefile +30 -0
- package/README.md +259 -0
- package/docker/nginx-default.conf +10 -0
- package/docs/pal-comb-filter-research.md +129 -0
- package/docs/pal-simulation-design.md +368 -0
- package/eslint.config.js +35 -0
- package/index.html +954 -0
- package/jsconfig.json +10 -0
- package/package.json +102 -0
- package/public/discs/README.Irq-Timing +3 -0
- package/public/discs/README.bcdtest +5 -0
- package/public/discs/README.elite +6 -0
- package/public/discs/README.eng_test +3 -0
- package/public/discs/README.protection +7 -0
- package/public/favicon.ico +0 -0
- package/public/images/botbar.png +0 -0
- package/public/images/cub-monitor.png +0 -0
- package/public/images/jsbeeb-example.png +0 -0
- package/public/images/placeholder.png +0 -0
- package/public/images/red-off-16.png +0 -0
- package/public/images/red-on-16.png +0 -0
- package/public/images/sb/CD-left.jpg +0 -0
- package/public/images/sb/CD-right.jpg +0 -0
- package/public/images/sidebar.png +0 -0
- package/public/images/tv.png +0 -0
- package/public/images/yellow-off-16.png +0 -0
- package/public/images/yellow-on-16.png +0 -0
- package/public/jsbeeb-icon.png +0 -0
- package/public/robots.txt +3 -0
- package/public/roms/ADFS1-53.rom +0 -0
- package/public/roms/BASIC.ROM +0 -0
- package/public/roms/README +4 -0
- package/public/roms/a01/BASIC1.rom +0 -0
- package/public/roms/ample.rom +0 -0
- package/public/roms/ats-3.0.rom +0 -0
- package/public/roms/b/DFS-0.9.rom +0 -0
- package/public/roms/b/DFS-1.2.rom +0 -0
- package/public/roms/b1770/dfs1770.rom +0 -0
- package/public/roms/b1770/zADFS.ROM +0 -0
- package/public/roms/bp/dfs.rom +0 -0
- package/public/roms/bp/zADFS.ROM +0 -0
- package/public/roms/bpos.rom +0 -0
- package/public/roms/compact/adfs210.rom +0 -0
- package/public/roms/compact/basic48.rom +0 -0
- package/public/roms/compact/basic486.rom +0 -0
- package/public/roms/compact/os51.rom +0 -0
- package/public/roms/compact/utils.rom +0 -0
- package/public/roms/deos.rom +0 -0
- package/public/roms/master/anfs-4.25.rom +0 -0
- package/public/roms/master/mos.txt +68819 -0
- package/public/roms/master/mos3.20 +0 -0
- package/public/roms/os.rom +0 -0
- package/public/roms/os01.rom +0 -0
- package/public/roms/tube/6502Tube.rom +0 -0
- package/public/roms/tube/ARMeval_100.rom +0 -0
- package/public/roms/tube/BIOS.ROM +0 -0
- package/public/roms/tube/ReCo6502ROM_816 +0 -0
- package/public/roms/tube/Z80_120.rom +0 -0
- package/public/roms/us/USBASIC.rom +0 -0
- package/public/roms/us/USDNFS.rom +0 -0
- package/public/roms/usmos.rom +0 -0
- package/public/sounds/disc525/motor.wav +0 -0
- package/public/sounds/disc525/motoroff.wav +0 -0
- package/public/sounds/disc525/motoron.wav +0 -0
- package/public/sounds/disc525/seek.wav +0 -0
- package/public/sounds/disc525/seek2.wav +0 -0
- package/public/sounds/disc525/seek3.wav +0 -0
- package/public/sounds/disc525/step.wav +0 -0
- package/public/teletext/txt0.dat +0 -0
- package/public/teletext/txt1.dat +0 -0
- package/public/teletext/txt2.dat +0 -0
- package/public/teletext/txt3.dat +0 -0
- package/release-please-config.json +13 -0
- package/run-container.sh +92 -0
- package/src/6502.js +1347 -0
- package/src/6502.opcodes.js +1411 -0
- package/src/acia.js +261 -0
- package/src/adc.js +149 -0
- package/src/analogue-source.js +21 -0
- package/src/app/app.js +175 -0
- package/src/app/electron.js +20 -0
- package/src/app/preload.js +8 -0
- package/src/app-bench.js +33 -0
- package/src/basic/multiline-tetris +9 -0
- package/src/basic-tokenise.js +104 -0
- package/src/canvas.js +177 -0
- package/src/cmos.js +141 -0
- package/src/config.js +165 -0
- package/src/ddnoise.js +138 -0
- package/src/disc-drive.js +371 -0
- package/src/disc-hfe.js +396 -0
- package/src/disc.js +997 -0
- package/src/econet/L3FS.dat +0 -0
- package/src/econet/scsi.dat +0 -0
- package/src/econet.js +714 -0
- package/src/fake6502.js +32 -0
- package/src/fdc.js +248 -0
- package/src/filestore.js +666 -0
- package/src/gamepad-source.js +59 -0
- package/src/gamepads.js +268 -0
- package/src/google-drive.js +160 -0
- package/src/intel-fdc.js +1717 -0
- package/src/jsbeeb.css +363 -0
- package/src/keyboard.js +411 -0
- package/src/lib/README +1 -0
- package/src/lib/webgl-debug.js +911 -0
- package/src/main.js +1759 -0
- package/src/microphone-input.js +149 -0
- package/src/models.js +200 -0
- package/src/mouse-joystick-source.js +107 -0
- package/src/music5000-worklet.js +43 -0
- package/src/music5000.js +207 -0
- package/src/scheduler.js +148 -0
- package/src/serial.js +31 -0
- package/src/soundchip.js +314 -0
- package/src/sth.js +59 -0
- package/src/tapes.js +265 -0
- package/src/teletext.js +348 -0
- package/src/teletext_adaptor.js +172 -0
- package/src/teletext_data.js +1064 -0
- package/src/touchscreen.js +86 -0
- package/src/tube.js +349 -0
- package/src/url-params.js +256 -0
- package/src/utils.js +1090 -0
- package/src/via.js +702 -0
- package/src/video-filters/pal-composite.js +94 -0
- package/src/video-filters/passthrough-filter.js +70 -0
- package/src/video-filters/shaders/pal-composite.frag.glsl +147 -0
- package/src/video-filters/shaders/pal-composite.vert.glsl +8 -0
- package/src/video-filters/shaders/passthrough.frag.glsl +6 -0
- package/src/video-filters/shaders/passthrough.vert.glsl +7 -0
- package/src/video.js +794 -0
- package/src/wd-fdc.js +1344 -0
- package/src/web/audio-handler.js +146 -0
- package/src/web/audio-renderer.js +115 -0
- package/src/web/debug.js +529 -0
- package/tests/integration/RmwX.asm +47 -0
- package/tests/integration/TestInstructionsSource +27 -0
- package/tests/integration/TestTimingsResults +27 -0
- package/tests/integration/TestTimingsSource +61 -0
- package/tests/integration/bcd.js +23 -0
- package/tests/integration/dormann.js +101 -0
- package/tests/integration/dp111timing.js +42 -0
- package/tests/integration/ensure-submodules.js +25 -0
- package/tests/integration/nops.bas +119 -0
- package/tests/integration/nops.js +24 -0
- package/tests/integration/protection.js +26 -0
- package/tests/integration/rmw.js +69 -0
- package/tests/integration/teletext/expected_bug_469.png +0 -0
- package/tests/integration/teletext/expected_flash_0.png +0 -0
- package/tests/integration/teletext/expected_flash_1.png +0 -0
- package/tests/integration/teletext/expected_hoglet_held_char.png +0 -0
- package/tests/integration/teletext/expected_reveal_flash_0.png +0 -0
- package/tests/integration/teletext/expected_reveal_flash_1.png +0 -0
- package/tests/integration/teletext.js +126 -0
- package/tests/integration/timings.js +56 -0
- package/tests/integration/via.js +1125 -0
- package/tests/suite/README.md +7 -0
- package/tests/suite/Test Suite 2.15.txt +373 -0
- package/tests/suite/bin/ start +0 -0
- package/tests/suite/bin/adca +0 -0
- package/tests/suite/bin/adcax +0 -0
- package/tests/suite/bin/adcay +0 -0
- package/tests/suite/bin/adcb +0 -0
- package/tests/suite/bin/adcix +0 -0
- package/tests/suite/bin/adciy +0 -0
- package/tests/suite/bin/adcz +0 -0
- package/tests/suite/bin/adczx +0 -0
- package/tests/suite/bin/alrb +0 -0
- package/tests/suite/bin/ancb +0 -0
- package/tests/suite/bin/anda +0 -0
- package/tests/suite/bin/andax +0 -0
- package/tests/suite/bin/anday +0 -0
- package/tests/suite/bin/andb +0 -0
- package/tests/suite/bin/andix +0 -0
- package/tests/suite/bin/andiy +0 -0
- package/tests/suite/bin/andz +0 -0
- package/tests/suite/bin/andzx +0 -0
- package/tests/suite/bin/aneb +0 -0
- package/tests/suite/bin/arrb +0 -0
- package/tests/suite/bin/asla +0 -0
- package/tests/suite/bin/aslax +0 -0
- package/tests/suite/bin/asln +0 -0
- package/tests/suite/bin/aslz +0 -0
- package/tests/suite/bin/aslzx +0 -0
- package/tests/suite/bin/asoa +0 -0
- package/tests/suite/bin/asoax +0 -0
- package/tests/suite/bin/asoay +0 -0
- package/tests/suite/bin/asoix +0 -0
- package/tests/suite/bin/asoiy +0 -0
- package/tests/suite/bin/asoz +0 -0
- package/tests/suite/bin/asozx +0 -0
- package/tests/suite/bin/axsa +0 -0
- package/tests/suite/bin/axsix +0 -0
- package/tests/suite/bin/axsz +0 -0
- package/tests/suite/bin/axszy +0 -0
- package/tests/suite/bin/bccr +0 -0
- package/tests/suite/bin/bcsr +0 -0
- package/tests/suite/bin/beqr +0 -0
- package/tests/suite/bin/bita +0 -0
- package/tests/suite/bin/bitz +0 -0
- package/tests/suite/bin/bmir +0 -0
- package/tests/suite/bin/bner +0 -0
- package/tests/suite/bin/bplr +0 -0
- package/tests/suite/bin/branchwrap +0 -0
- package/tests/suite/bin/brkn +0 -0
- package/tests/suite/bin/bvcr +0 -0
- package/tests/suite/bin/bvsr +0 -0
- package/tests/suite/bin/cia1pb6 +0 -0
- package/tests/suite/bin/cia1pb7 +0 -0
- package/tests/suite/bin/cia1ta +0 -0
- package/tests/suite/bin/cia1tab +0 -0
- package/tests/suite/bin/cia1tb +0 -0
- package/tests/suite/bin/cia1tb123 +0 -0
- package/tests/suite/bin/cia2pb6 +0 -0
- package/tests/suite/bin/cia2pb7 +0 -0
- package/tests/suite/bin/cia2ta +0 -0
- package/tests/suite/bin/cia2tb +0 -0
- package/tests/suite/bin/cia2tb123 +0 -0
- package/tests/suite/bin/clcn +0 -0
- package/tests/suite/bin/cldn +0 -0
- package/tests/suite/bin/clin +0 -0
- package/tests/suite/bin/clvn +0 -0
- package/tests/suite/bin/cmpa +0 -0
- package/tests/suite/bin/cmpax +0 -0
- package/tests/suite/bin/cmpay +0 -0
- package/tests/suite/bin/cmpb +0 -0
- package/tests/suite/bin/cmpix +0 -0
- package/tests/suite/bin/cmpiy +0 -0
- package/tests/suite/bin/cmpz +0 -0
- package/tests/suite/bin/cmpzx +0 -0
- package/tests/suite/bin/cntdef +0 -0
- package/tests/suite/bin/cnto2 +0 -0
- package/tests/suite/bin/cpuport +0 -0
- package/tests/suite/bin/cputiming +0 -0
- package/tests/suite/bin/cpxa +0 -0
- package/tests/suite/bin/cpxb +0 -0
- package/tests/suite/bin/cpxz +0 -0
- package/tests/suite/bin/cpya +0 -0
- package/tests/suite/bin/cpyb +0 -0
- package/tests/suite/bin/cpyz +0 -0
- package/tests/suite/bin/dcma +0 -0
- package/tests/suite/bin/dcmax +0 -0
- package/tests/suite/bin/dcmay +0 -0
- package/tests/suite/bin/dcmix +0 -0
- package/tests/suite/bin/dcmiy +0 -0
- package/tests/suite/bin/dcmz +0 -0
- package/tests/suite/bin/dcmzx +0 -0
- package/tests/suite/bin/deca +0 -0
- package/tests/suite/bin/decax +0 -0
- package/tests/suite/bin/decz +0 -0
- package/tests/suite/bin/deczx +0 -0
- package/tests/suite/bin/dexn +0 -0
- package/tests/suite/bin/deyn +0 -0
- package/tests/suite/bin/eora +0 -0
- package/tests/suite/bin/eorax +0 -0
- package/tests/suite/bin/eoray +0 -0
- package/tests/suite/bin/eorb +0 -0
- package/tests/suite/bin/eorix +0 -0
- package/tests/suite/bin/eoriy +0 -0
- package/tests/suite/bin/eorz +0 -0
- package/tests/suite/bin/eorzx +0 -0
- package/tests/suite/bin/finish +0 -0
- package/tests/suite/bin/flipos +0 -0
- package/tests/suite/bin/icr01 +0 -0
- package/tests/suite/bin/imr +0 -0
- package/tests/suite/bin/inca +0 -0
- package/tests/suite/bin/incax +0 -0
- package/tests/suite/bin/incz +0 -0
- package/tests/suite/bin/inczx +0 -0
- package/tests/suite/bin/insa +0 -0
- package/tests/suite/bin/insax +0 -0
- package/tests/suite/bin/insay +0 -0
- package/tests/suite/bin/insix +0 -0
- package/tests/suite/bin/insiy +0 -0
- package/tests/suite/bin/insz +0 -0
- package/tests/suite/bin/inszx +0 -0
- package/tests/suite/bin/inxn +0 -0
- package/tests/suite/bin/inyn +0 -0
- package/tests/suite/bin/irq +0 -0
- package/tests/suite/bin/jmpi +0 -0
- package/tests/suite/bin/jmpw +0 -0
- package/tests/suite/bin/jsrw +0 -0
- package/tests/suite/bin/lasay +0 -0
- package/tests/suite/bin/laxa +0 -0
- package/tests/suite/bin/laxay +0 -0
- package/tests/suite/bin/laxix +0 -0
- package/tests/suite/bin/laxiy +0 -0
- package/tests/suite/bin/laxz +0 -0
- package/tests/suite/bin/laxzy +0 -0
- package/tests/suite/bin/ldaa +0 -0
- package/tests/suite/bin/ldaax +0 -0
- package/tests/suite/bin/ldaay +0 -0
- package/tests/suite/bin/ldab +0 -0
- package/tests/suite/bin/ldaix +0 -0
- package/tests/suite/bin/ldaiy +0 -0
- package/tests/suite/bin/ldaz +0 -0
- package/tests/suite/bin/ldazx +0 -0
- package/tests/suite/bin/ldxa +0 -0
- package/tests/suite/bin/ldxay +0 -0
- package/tests/suite/bin/ldxb +0 -0
- package/tests/suite/bin/ldxz +0 -0
- package/tests/suite/bin/ldxzy +0 -0
- package/tests/suite/bin/ldya +0 -0
- package/tests/suite/bin/ldyax +0 -0
- package/tests/suite/bin/ldyb +0 -0
- package/tests/suite/bin/ldyz +0 -0
- package/tests/suite/bin/ldyzx +0 -0
- package/tests/suite/bin/loadth +0 -0
- package/tests/suite/bin/lsea +0 -0
- package/tests/suite/bin/lseax +0 -0
- package/tests/suite/bin/lseay +0 -0
- package/tests/suite/bin/lseix +0 -0
- package/tests/suite/bin/lseiy +0 -0
- package/tests/suite/bin/lsez +0 -0
- package/tests/suite/bin/lsezx +0 -0
- package/tests/suite/bin/lsra +0 -0
- package/tests/suite/bin/lsrax +0 -0
- package/tests/suite/bin/lsrn +0 -0
- package/tests/suite/bin/lsrz +0 -0
- package/tests/suite/bin/lsrzx +0 -0
- package/tests/suite/bin/lxab +0 -0
- package/tests/suite/bin/mmu +0 -0
- package/tests/suite/bin/mmufetch +0 -0
- package/tests/suite/bin/nmi +0 -0
- package/tests/suite/bin/nopa +0 -0
- package/tests/suite/bin/nopax +0 -0
- package/tests/suite/bin/nopb +0 -0
- package/tests/suite/bin/nopn +0 -0
- package/tests/suite/bin/nopz +0 -0
- package/tests/suite/bin/nopzx +0 -0
- package/tests/suite/bin/oneshot +0 -0
- package/tests/suite/bin/oraa +0 -0
- package/tests/suite/bin/oraax +0 -0
- package/tests/suite/bin/oraay +0 -0
- package/tests/suite/bin/orab +0 -0
- package/tests/suite/bin/oraix +0 -0
- package/tests/suite/bin/oraiy +0 -0
- package/tests/suite/bin/oraz +0 -0
- package/tests/suite/bin/orazx +0 -0
- package/tests/suite/bin/phan +0 -0
- package/tests/suite/bin/phpn +0 -0
- package/tests/suite/bin/plan +0 -0
- package/tests/suite/bin/plpn +0 -0
- package/tests/suite/bin/rlaa +0 -0
- package/tests/suite/bin/rlaax +0 -0
- package/tests/suite/bin/rlaay +0 -0
- package/tests/suite/bin/rlaix +0 -0
- package/tests/suite/bin/rlaiy +0 -0
- package/tests/suite/bin/rlaz +0 -0
- package/tests/suite/bin/rlazx +0 -0
- package/tests/suite/bin/rola +0 -0
- package/tests/suite/bin/rolax +0 -0
- package/tests/suite/bin/roln +0 -0
- package/tests/suite/bin/rolz +0 -0
- package/tests/suite/bin/rolzx +0 -0
- package/tests/suite/bin/rora +0 -0
- package/tests/suite/bin/rorax +0 -0
- package/tests/suite/bin/rorn +0 -0
- package/tests/suite/bin/rorz +0 -0
- package/tests/suite/bin/rorzx +0 -0
- package/tests/suite/bin/rraa +0 -0
- package/tests/suite/bin/rraax +0 -0
- package/tests/suite/bin/rraay +0 -0
- package/tests/suite/bin/rraix +0 -0
- package/tests/suite/bin/rraiy +0 -0
- package/tests/suite/bin/rraz +0 -0
- package/tests/suite/bin/rrazx +0 -0
- package/tests/suite/bin/rtin +0 -0
- package/tests/suite/bin/rtsn +0 -0
- package/tests/suite/bin/sbca +0 -0
- package/tests/suite/bin/sbcax +0 -0
- package/tests/suite/bin/sbcay +0 -0
- package/tests/suite/bin/sbcb +0 -0
- package/tests/suite/bin/sbcb(eb) +0 -0
- package/tests/suite/bin/sbcix +0 -0
- package/tests/suite/bin/sbciy +0 -0
- package/tests/suite/bin/sbcz +0 -0
- package/tests/suite/bin/sbczx +0 -0
- package/tests/suite/bin/sbxb +0 -0
- package/tests/suite/bin/secn +0 -0
- package/tests/suite/bin/sedn +0 -0
- package/tests/suite/bin/sein +0 -0
- package/tests/suite/bin/shaay +0 -0
- package/tests/suite/bin/shaiy +0 -0
- package/tests/suite/bin/shsay +0 -0
- package/tests/suite/bin/shxay +0 -0
- package/tests/suite/bin/shyax +0 -0
- package/tests/suite/bin/staa +0 -0
- package/tests/suite/bin/staax +0 -0
- package/tests/suite/bin/staay +0 -0
- package/tests/suite/bin/staix +0 -0
- package/tests/suite/bin/staiy +0 -0
- package/tests/suite/bin/staz +0 -0
- package/tests/suite/bin/stazx +0 -0
- package/tests/suite/bin/stxa +0 -0
- package/tests/suite/bin/stxz +0 -0
- package/tests/suite/bin/stxzy +0 -0
- package/tests/suite/bin/stya +0 -0
- package/tests/suite/bin/styz +0 -0
- package/tests/suite/bin/styzx +0 -0
- package/tests/suite/bin/taxn +0 -0
- package/tests/suite/bin/tayn +0 -0
- package/tests/suite/bin/trap1 +0 -0
- package/tests/suite/bin/trap10 +0 -0
- package/tests/suite/bin/trap11 +0 -0
- package/tests/suite/bin/trap12 +0 -0
- package/tests/suite/bin/trap13 +0 -0
- package/tests/suite/bin/trap14 +0 -0
- package/tests/suite/bin/trap15 +0 -0
- package/tests/suite/bin/trap16 +0 -0
- package/tests/suite/bin/trap17 +0 -0
- package/tests/suite/bin/trap2 +0 -0
- package/tests/suite/bin/trap3 +0 -0
- package/tests/suite/bin/trap4 +0 -0
- package/tests/suite/bin/trap5 +0 -0
- package/tests/suite/bin/trap6 +0 -0
- package/tests/suite/bin/trap7 +0 -0
- package/tests/suite/bin/trap8 +0 -0
- package/tests/suite/bin/trap9 +0 -0
- package/tests/suite/bin/tsxn +0 -0
- package/tests/suite/bin/txan +0 -0
- package/tests/suite/bin/txsn +0 -0
- package/tests/suite/bin/tyan +0 -0
- package/tests/suite/cbm-hackers-post.html +178 -0
- package/tests/suite/cbm-hackers-post.md +78 -0
- package/tests/test-machine.js +288 -0
- package/tests/test-suite.js +147 -0
- package/tests/test.css +7 -0
- package/tests/unit/gzip/test-1 +0 -0
- package/tests/unit/gzip/test-1.gz +0 -0
- package/tests/unit/gzip/test-2 +0 -0
- package/tests/unit/gzip/test-2.gz +0 -0
- package/tests/unit/gzip/test-3 +0 -0
- package/tests/unit/gzip/test-3.gz +0 -0
- package/tests/unit/gzip/test-4 +0 -0
- package/tests/unit/gzip/test-4.gz +0 -0
- package/tests/unit/test-adc.js +307 -0
- package/tests/unit/test-bcd.js +30 -0
- package/tests/unit/test-cmos.js +266 -0
- package/tests/unit/test-disc-drive.js +85 -0
- package/tests/unit/test-disc-hfe.js +347 -0
- package/tests/unit/test-disc.js +232 -0
- package/tests/unit/test-fifo.js +35 -0
- package/tests/unit/test-gamepad-source.js +67 -0
- package/tests/unit/test-gzip.js +22 -0
- package/tests/unit/test-intel-fdc.js +93 -0
- package/tests/unit/test-keyboard.js +410 -0
- package/tests/unit/test-mouse-joystick-source.js +128 -0
- package/tests/unit/test-scheduler.js +190 -0
- package/tests/unit/test-serial.js +154 -0
- package/tests/unit/test-teletext-adaptor.js +359 -0
- package/tests/unit/test-tokenise.js +65 -0
- package/tests/unit/test-url-params.js +398 -0
- package/tests/unit/test-utils.js +276 -0
- package/tests/unit/test-video.js +498 -0
- package/tests/unit/test-zip.js +56 -0
- package/tests/unit/zip/test-mixed.zip +0 -0
- package/tests/unit/zip/test-rom.zip +0 -0
- package/tests/unit/zip/test-ssd.zip +0 -0
- package/tools/fir-generator.js +80 -0
- package/tools/vite-plugin-fir-shader.js +131 -0
- package/vite.config.js +34 -0
package/src/web/debug.js
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import $ from "jquery";
|
|
3
|
+
import { hexbyte, hexword, noop, parseAddr } from "../utils.js";
|
|
4
|
+
|
|
5
|
+
const numToShow = 16;
|
|
6
|
+
|
|
7
|
+
function labelHtml(addr) {
|
|
8
|
+
return '<span class="addr">' + hexword(addr) + "</span>";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class MemoryView {
|
|
12
|
+
constructor(widget, peekMem) {
|
|
13
|
+
this._widget = widget;
|
|
14
|
+
this._peekMem = peekMem;
|
|
15
|
+
this._addr = 0;
|
|
16
|
+
this._prevSnapshot = new Uint8Array(65536);
|
|
17
|
+
this._rows = [];
|
|
18
|
+
|
|
19
|
+
const template = this._widget.find(".template");
|
|
20
|
+
for (let i = 0; i < numToShow; i++) {
|
|
21
|
+
this._rows.push(template.clone().removeClass("template").appendTo(this._widget));
|
|
22
|
+
}
|
|
23
|
+
template.remove();
|
|
24
|
+
|
|
25
|
+
widget.bind("wheel", (evt) => {
|
|
26
|
+
const deltaY = evt.originalEvent.deltaY;
|
|
27
|
+
if (deltaY === 0) return;
|
|
28
|
+
const steps = (deltaY / 20) | 0;
|
|
29
|
+
this.update(this._addr + 8 * steps);
|
|
30
|
+
evt.preventDefault();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
update(maybeNewAddr) {
|
|
35
|
+
if (maybeNewAddr !== undefined) this._addr = maybeNewAddr;
|
|
36
|
+
let addr = this._addr - 8 * Math.floor(this._rows.length / 2);
|
|
37
|
+
if (addr < 0) addr = 0;
|
|
38
|
+
for (const row of this._rows) {
|
|
39
|
+
row.find(".dis_addr").html(labelHtml(addr));
|
|
40
|
+
row.toggleClass("highlight", addr === this._addr);
|
|
41
|
+
const dump = this.dump(addr, addr + 8);
|
|
42
|
+
const bytes = row.find(".mem_bytes span");
|
|
43
|
+
const ascii = row.find(".mem_asc span");
|
|
44
|
+
for (let i = 0; i < 8; ++i) {
|
|
45
|
+
$(bytes[i]).text(dump.hex[i]).toggleClass("changed", dump.changed[i]);
|
|
46
|
+
$(ascii[i]).text(dump.asc[i]).toggleClass("changed", dump.changed[i]);
|
|
47
|
+
}
|
|
48
|
+
addr = (addr + 8) & 0xffff;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// todo extract memory part from view part and reuse in disassembler etc. also peekmem can go then
|
|
53
|
+
dump(from, to) {
|
|
54
|
+
const hex = [];
|
|
55
|
+
const asc = [];
|
|
56
|
+
const changed = [];
|
|
57
|
+
for (let i = from; i < to; ++i) {
|
|
58
|
+
const b = this._peekMem(i);
|
|
59
|
+
hex.push(hexbyte(b));
|
|
60
|
+
changed.push(i < this._prevSnapshot.length && this._prevSnapshot[i] !== b);
|
|
61
|
+
if (b >= 32 && b < 128) {
|
|
62
|
+
asc.push(String.fromCharCode(b));
|
|
63
|
+
} else {
|
|
64
|
+
asc.push(".");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return { hex: hex, asc: asc, changed: changed };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
snapshot() {
|
|
71
|
+
for (let i = 0; i < 65536; ++i) {
|
|
72
|
+
this._prevSnapshot[i] = this._peekMem(i);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
step(delta) {
|
|
77
|
+
this.update(this._addr + delta);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export class Debugger {
|
|
82
|
+
constructor() {
|
|
83
|
+
this.patchInstructions = new Map();
|
|
84
|
+
this._enabled = false;
|
|
85
|
+
this.disass = $("#disassembly");
|
|
86
|
+
this._memoryView = new MemoryView($("#memory"), (address) => (this.cpu ? this.cpu.peekmem(address) : 0));
|
|
87
|
+
this.debugNode = $("#debug, #hardware_debug, #crtc_debug");
|
|
88
|
+
this.disassPc = 0;
|
|
89
|
+
this.disassStack = [];
|
|
90
|
+
this.uservia = this.sysvia = this.crtc = null;
|
|
91
|
+
this.breakpoints = {};
|
|
92
|
+
|
|
93
|
+
function setupGoto(form, func) {
|
|
94
|
+
const addr = form.find(".goto-addr");
|
|
95
|
+
form.on("submit", (e) => {
|
|
96
|
+
func(parseAddr(addr.val()));
|
|
97
|
+
addr.val("");
|
|
98
|
+
addr.blur();
|
|
99
|
+
e.preventDefault();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
setupGoto($("#goto-mem-addr-form"), (address) => this._memoryView.update(address));
|
|
104
|
+
setupGoto($("#goto-dis-addr-form"), this.updateDisassembly.bind(this));
|
|
105
|
+
|
|
106
|
+
this.enable(false);
|
|
107
|
+
|
|
108
|
+
for (let i = 0; i < numToShow; i++) {
|
|
109
|
+
this.disass.find(".template").clone().removeClass("template").appendTo(this.disass);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
this.disass.find(".bp_gutter").click(this.bpClick.bind(this));
|
|
113
|
+
|
|
114
|
+
this.disass.bind("wheel", (evt) => {
|
|
115
|
+
let deltaY = evt.originalEvent.deltaY;
|
|
116
|
+
if (deltaY === 0) return;
|
|
117
|
+
let addr = this.disassPc;
|
|
118
|
+
const func = deltaY < 0 ? this.prevInstruction.bind(this) : this.nextInstruction.bind(this);
|
|
119
|
+
deltaY = Math.abs(deltaY);
|
|
120
|
+
while (deltaY > 0) {
|
|
121
|
+
addr = func(addr);
|
|
122
|
+
deltaY -= 30;
|
|
123
|
+
}
|
|
124
|
+
this.updateDisassembly(addr);
|
|
125
|
+
evt.preventDefault();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
setCpu(cpu) {
|
|
130
|
+
this.cpu = cpu;
|
|
131
|
+
this.sysvia = this.setupVia($("#sysvia"), cpu.sysvia);
|
|
132
|
+
this.uservia = this.setupVia($("#uservia"), cpu.uservia);
|
|
133
|
+
this.crtc = this.setupCrtc($("#crtc_debug"), cpu.video);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
disassemble(addr) {
|
|
137
|
+
return this.cpu.disassembler.disassemble(addr);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setupCrtc(node, video) {
|
|
141
|
+
if (!video) return noop;
|
|
142
|
+
const updates = [];
|
|
143
|
+
node.find("tr:not(.template)").remove();
|
|
144
|
+
|
|
145
|
+
const regNode = node.find(".crtc_regs");
|
|
146
|
+
|
|
147
|
+
function makeRow(node, text) {
|
|
148
|
+
const row = node.find(".template").clone().removeClass("template").appendTo(node);
|
|
149
|
+
row.find(".register").text(text);
|
|
150
|
+
return row.find(".value");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
for (let i = 0; i < 16; ++i) {
|
|
154
|
+
const value = makeRow(regNode, "R" + i);
|
|
155
|
+
updates.push(() => {
|
|
156
|
+
this.updateElem(value, hexbyte(video.regs[i]));
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const stateNode = node.find(".crtc_state");
|
|
161
|
+
const others = [
|
|
162
|
+
"bitmapX",
|
|
163
|
+
"bitmapY",
|
|
164
|
+
"dispEnabled",
|
|
165
|
+
"horizCounter",
|
|
166
|
+
"inHSync",
|
|
167
|
+
"scanlineCounter",
|
|
168
|
+
"vertAdjustCounter",
|
|
169
|
+
"vertCounter",
|
|
170
|
+
"inVSync",
|
|
171
|
+
"endOfMainLatched",
|
|
172
|
+
"endOfVertAdjustLatched",
|
|
173
|
+
"inVertAdjust",
|
|
174
|
+
"inDummyRaster",
|
|
175
|
+
"addr",
|
|
176
|
+
"lineStartAddr",
|
|
177
|
+
"nextLineStartAddr",
|
|
178
|
+
];
|
|
179
|
+
for (const elem of others) {
|
|
180
|
+
const value = makeRow(stateNode, elem);
|
|
181
|
+
if (typeof video[elem] === "boolean") {
|
|
182
|
+
updates.push(() => this.updateElem(value, video[elem] ? "true" : "false"));
|
|
183
|
+
} else {
|
|
184
|
+
updates.push(() => this.updateElem(value, hexword(video[elem])));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const update = () => {
|
|
189
|
+
for (const update of updates) update();
|
|
190
|
+
};
|
|
191
|
+
update();
|
|
192
|
+
return update;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
setupVia(node, via) {
|
|
196
|
+
const updates = [];
|
|
197
|
+
if (!via) return noop;
|
|
198
|
+
const regs = [
|
|
199
|
+
"ora",
|
|
200
|
+
"orb",
|
|
201
|
+
"ira",
|
|
202
|
+
"irb",
|
|
203
|
+
"ddra",
|
|
204
|
+
"ddrb",
|
|
205
|
+
"acr",
|
|
206
|
+
"pcr",
|
|
207
|
+
"ifr",
|
|
208
|
+
"ier",
|
|
209
|
+
"t1c",
|
|
210
|
+
"t1l",
|
|
211
|
+
"t2c",
|
|
212
|
+
"t2l",
|
|
213
|
+
"portapins",
|
|
214
|
+
"portbpins",
|
|
215
|
+
"IC32",
|
|
216
|
+
];
|
|
217
|
+
node.find("tr:not(.template)").remove();
|
|
218
|
+
for (const elem of regs) {
|
|
219
|
+
if (via[elem] === undefined) continue;
|
|
220
|
+
const row = node.find(".template").clone().removeClass("template").appendTo(node);
|
|
221
|
+
row.find(".register").text(elem.toUpperCase());
|
|
222
|
+
const value = row.find(".value");
|
|
223
|
+
if (elem.match(/t[12][cl]/)) {
|
|
224
|
+
updates.push(() => {
|
|
225
|
+
const reg = via[elem];
|
|
226
|
+
this.updateElem(
|
|
227
|
+
value,
|
|
228
|
+
hexbyte((reg >>> 16) & 0xff) + hexbyte((reg >>> 8) & 0xff) + hexbyte(reg & 0xff),
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
} else {
|
|
232
|
+
updates.push(() => {
|
|
233
|
+
this.updateElem(value, hexbyte(via[elem]));
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const update = () => {
|
|
238
|
+
for (const update of updates) update();
|
|
239
|
+
};
|
|
240
|
+
update();
|
|
241
|
+
return update;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
updateElem(elem, val) {
|
|
245
|
+
const prevVal = elem.text();
|
|
246
|
+
if (prevVal !== val) {
|
|
247
|
+
elem.text(val);
|
|
248
|
+
}
|
|
249
|
+
elem.toggleClass("changed", prevVal !== val && prevVal !== "");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
updateRegisters() {
|
|
253
|
+
this.updateElem($("#cpu6502_a"), hexbyte(this.cpu.a));
|
|
254
|
+
this.updateElem($("#cpu6502_x"), hexbyte(this.cpu.x));
|
|
255
|
+
this.updateElem($("#cpu6502_y"), hexbyte(this.cpu.y));
|
|
256
|
+
this.updateElem($("#cpu6502_s"), hexbyte(this.cpu.s));
|
|
257
|
+
this.updateElem($("#cpu6502_pc"), hexword(this.cpu.pc));
|
|
258
|
+
for (const flag of ["c", "z", "i", "d", "v", "n"]) {
|
|
259
|
+
this.updateElem($("#cpu6502_flag_" + flag), this.cpu.p[flag] ? flag.toUpperCase() : flag);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
execPatch(instString) {
|
|
264
|
+
for (const inst of instString.split(",")) {
|
|
265
|
+
if (!inst) continue;
|
|
266
|
+
const ops = inst.split(":");
|
|
267
|
+
let addr = parseInt(ops[0], 16);
|
|
268
|
+
const setTo = ops[1];
|
|
269
|
+
for (let i = 0; i < setTo.length; i += 2) {
|
|
270
|
+
const b = parseInt(setTo.substring(i, i + 2), 16);
|
|
271
|
+
this.cpu.writemem(addr, b);
|
|
272
|
+
addr++;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
setPatch(patch) {
|
|
278
|
+
for (const inst of patch.split(";")) {
|
|
279
|
+
if (inst[0] === "@") {
|
|
280
|
+
const at = parseInt(inst.substring(1, 5), 16);
|
|
281
|
+
if (!this.patchInstructions.has(at)) this.patchInstructions.set(at, []);
|
|
282
|
+
this.patchInstructions.get(at).push(inst.substring(5));
|
|
283
|
+
} else {
|
|
284
|
+
this.execPatch(inst);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (this.patchInstructions.size > 0) {
|
|
288
|
+
const hook = this.cpu.debugInstruction.add((pc) => {
|
|
289
|
+
if (!this.patchInstructions.has(pc)) return false;
|
|
290
|
+
for (const inst of this.patchInstructions.get(pc)) this.execPatch(inst);
|
|
291
|
+
this.patchInstructions.delete(pc);
|
|
292
|
+
if (this.patchInstructions.size === 0) {
|
|
293
|
+
console.log("All patches done");
|
|
294
|
+
hook.remove();
|
|
295
|
+
}
|
|
296
|
+
return false;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
debug(where) {
|
|
302
|
+
this.enable(true);
|
|
303
|
+
this.updateDisassembly(where);
|
|
304
|
+
this.updateRegisters();
|
|
305
|
+
this._memoryView.update();
|
|
306
|
+
this.sysvia();
|
|
307
|
+
this.uservia();
|
|
308
|
+
this.crtc();
|
|
309
|
+
this.cpu.video.debugPaint();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
enable(e) {
|
|
313
|
+
if (this._enabled && !e) {
|
|
314
|
+
this.updatePrevMem();
|
|
315
|
+
}
|
|
316
|
+
this._enabled = e;
|
|
317
|
+
this.debugNode.toggle(this._enabled);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
enabled() {
|
|
321
|
+
return this._enabled;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
updateDisassembly(address) {
|
|
325
|
+
this.disassPc = address;
|
|
326
|
+
const elems = this.disass.children().filter(":visible");
|
|
327
|
+
|
|
328
|
+
const updateDisElem = (elem, address) => {
|
|
329
|
+
const result = this.disassemble(address);
|
|
330
|
+
const dump = this._memoryView.dump(address, result[1]);
|
|
331
|
+
elem.find(".dis_addr").html(labelHtml(address));
|
|
332
|
+
elem.toggleClass("current", address === this.cpu.pc);
|
|
333
|
+
elem.toggleClass("highlight", address === this.disassPc);
|
|
334
|
+
elem.find(".instr_bytes").text(dump.hex.join(" "));
|
|
335
|
+
elem.find(".instr_asc").text(dump.asc.join(""));
|
|
336
|
+
const disNode = elem.find(".disassembly").html(result[0]);
|
|
337
|
+
disNode.find(".instr_mem_ref").click((e) => this.memClick(e));
|
|
338
|
+
disNode.find(".instr_instr_ref").click((e) => this.instrClick(e));
|
|
339
|
+
elem.find(".bp_gutter").toggleClass("active", !!this.breakpoints[address]);
|
|
340
|
+
elem.data({ addr: address, ref: result[2] });
|
|
341
|
+
return result[1];
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
for (let i = 0; i < numToShow / 2; ++i) {
|
|
345
|
+
const elem = $(elems[i + numToShow / 2]);
|
|
346
|
+
address = updateDisElem(elem, address);
|
|
347
|
+
}
|
|
348
|
+
address = this.disassPc;
|
|
349
|
+
for (let i = numToShow / 2 - 1; i >= 0; --i) {
|
|
350
|
+
address = this.prevInstruction(address);
|
|
351
|
+
const elem = $(elems[i]);
|
|
352
|
+
updateDisElem(elem, address);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
prevInstruction(address) {
|
|
357
|
+
// Some attempt at making prevInstruction more accurate; score the sequence of instructions leading
|
|
358
|
+
// up to the target by counting all "common" instructions as a point. The highest-scoring run of
|
|
359
|
+
// instructions is picked as the most likely, and the previous from that is used. Common instructions
|
|
360
|
+
// here mean loads, stores, branches, compares, arithmetic and carry-set/clear that don't use "unusual"
|
|
361
|
+
// indexing modes like abs,X, abs,Y and (zp,X).
|
|
362
|
+
// Good test cases:
|
|
363
|
+
// Repton 2 @ 2cbb
|
|
364
|
+
// MOS @ cfc8
|
|
365
|
+
// also, just starting from the back of ROM and going up...
|
|
366
|
+
const commonInstructions =
|
|
367
|
+
/(RTS|B..|JMP|JSR|LD[AXY]|ST[AXY]|TA[XY]|T[XY]A|AD[DC]|SUB|SBC|CLC|SEC|CMP|EOR|ORR|AND|INC|DEC).*/;
|
|
368
|
+
const uncommonInstrucions = /.*,\s*([XY]|X\))$/;
|
|
369
|
+
|
|
370
|
+
address &= 0xffff;
|
|
371
|
+
let bestAddr = address - 1;
|
|
372
|
+
let bestScore = 0;
|
|
373
|
+
for (let startingPoint = address - 20; startingPoint !== address; startingPoint++) {
|
|
374
|
+
let score = 0;
|
|
375
|
+
let addr = startingPoint & 0xffff;
|
|
376
|
+
while (addr < address) {
|
|
377
|
+
const result = this.disassemble(addr);
|
|
378
|
+
if (result[0] === this.cpu.pc) score += 10; // huge boost if this instruction was executed
|
|
379
|
+
if (result[0].match(commonInstructions) && !result[0].match(uncommonInstrucions)) {
|
|
380
|
+
score++;
|
|
381
|
+
}
|
|
382
|
+
if (result[1] === address) {
|
|
383
|
+
if (score > bestScore) {
|
|
384
|
+
bestScore = score;
|
|
385
|
+
bestAddr = addr;
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
addr = result[1];
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return bestAddr;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
updatePrevMem() {
|
|
396
|
+
this._memoryView.snapshot();
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
hide() {
|
|
400
|
+
this.enable(false);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
stepUntil(f) {
|
|
404
|
+
this.cpu.targetCycles = this.cpu.currentCycles; // TODO: this prevents the cpu from running any residual cycles. look into a better solution
|
|
405
|
+
for (let i = 0; i < 65536; i++) {
|
|
406
|
+
this.cpu.execute(1);
|
|
407
|
+
if (f()) break;
|
|
408
|
+
}
|
|
409
|
+
this.debug(this.cpu.pc);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
step() {
|
|
413
|
+
this.updatePrevMem();
|
|
414
|
+
const curpc = this.cpu.pc;
|
|
415
|
+
this.stepUntil(() => this.cpu.pc !== curpc);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
isUnconditionalJump(addr) {
|
|
419
|
+
const result = this.disassemble(addr);
|
|
420
|
+
return !!result[0].match(/^(JMP|RTS|BRA)/);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
stepOver() {
|
|
424
|
+
this.updatePrevMem();
|
|
425
|
+
if (this.isUnconditionalJump(this.cpu.pc)) {
|
|
426
|
+
return this.step();
|
|
427
|
+
}
|
|
428
|
+
const nextPc = this.nextInstruction(this.cpu.pc);
|
|
429
|
+
this.stepUntil(() => this.cpu.pc === nextPc);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
isReturn(addr) {
|
|
433
|
+
const result = this.disassemble(addr);
|
|
434
|
+
return result[0] === "RTS";
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
stepOut() {
|
|
438
|
+
this.updatePrevMem();
|
|
439
|
+
const s = this.cpu.s;
|
|
440
|
+
this.stepUntil(() => {
|
|
441
|
+
if (this.cpu.s >= s && this.isReturn(this.cpu.pc)) {
|
|
442
|
+
const nextInstr = this.nextInstruction(this.cpu.pc);
|
|
443
|
+
this.step();
|
|
444
|
+
return this.cpu.pc !== nextInstr;
|
|
445
|
+
}
|
|
446
|
+
return false;
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
nextInstruction(address) {
|
|
451
|
+
return this.disassemble(address)[1] & 0xffff;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
instrClick(e) {
|
|
455
|
+
const info = $(e.target).data();
|
|
456
|
+
this.disassStack.push(this.disassPc);
|
|
457
|
+
this.updateDisassembly(info.ref);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
memClick(e) {
|
|
461
|
+
const info = $(e.target).data();
|
|
462
|
+
this._memoryView.update(info.ref);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
toggleBreakpoint(address) {
|
|
466
|
+
if (this.breakpoints[address]) {
|
|
467
|
+
console.log("Removing breakpoint from address " + hexword(address));
|
|
468
|
+
this.breakpoints[address].remove();
|
|
469
|
+
this.breakpoints[address] = undefined;
|
|
470
|
+
} else {
|
|
471
|
+
console.log("Adding breakpoint to address " + hexword(address));
|
|
472
|
+
this.breakpoints[address] = this.cpu.debugInstruction.add((x) => x === address);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
bpClick(e) {
|
|
477
|
+
const address = $(e.target).closest(".dis_elem").data().addr;
|
|
478
|
+
this.toggleBreakpoint(address);
|
|
479
|
+
$(e.target).toggleClass("active", !!this.breakpoints[address]);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
keyPress(key) {
|
|
483
|
+
if ($(":focus").length > 0) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
switch (String.fromCharCode(key)) {
|
|
487
|
+
case "b":
|
|
488
|
+
if (this.disassStack.length) this.updateDisassembly(this.disassStack.pop());
|
|
489
|
+
break;
|
|
490
|
+
case "k":
|
|
491
|
+
this.updateDisassembly(this.prevInstruction(this.disassPc));
|
|
492
|
+
break;
|
|
493
|
+
case "j":
|
|
494
|
+
this.updateDisassembly(this.nextInstruction(this.disassPc));
|
|
495
|
+
break;
|
|
496
|
+
case "t":
|
|
497
|
+
this.toggleBreakpoint(this.disassPc);
|
|
498
|
+
this.updateDisassembly(this.disassPc);
|
|
499
|
+
break;
|
|
500
|
+
case "u":
|
|
501
|
+
this._memoryView.step(8);
|
|
502
|
+
break;
|
|
503
|
+
case "i":
|
|
504
|
+
this._memoryView.step(-8);
|
|
505
|
+
break;
|
|
506
|
+
case "U":
|
|
507
|
+
this._memoryView.step(64);
|
|
508
|
+
break;
|
|
509
|
+
case "I":
|
|
510
|
+
this._memoryView.step(-64);
|
|
511
|
+
break;
|
|
512
|
+
case "n":
|
|
513
|
+
this.step();
|
|
514
|
+
break;
|
|
515
|
+
case "N":
|
|
516
|
+
this.updatePrevMem();
|
|
517
|
+
this.cpu.execute(1);
|
|
518
|
+
self.debug(this.cpu.pc);
|
|
519
|
+
break;
|
|
520
|
+
case "m":
|
|
521
|
+
this.stepOver();
|
|
522
|
+
break;
|
|
523
|
+
case "o":
|
|
524
|
+
this.stepOut();
|
|
525
|
+
break;
|
|
526
|
+
}
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
\ Timings test (thanks to Ed Spittles)
|
|
2
|
+
\ build with: beebasm -i RmwX.asm -do ../discs/RmwX.ssd -boot Timings
|
|
3
|
+
ORG &100
|
|
4
|
+
.start
|
|
5
|
+
NOP:NOP:NOP:NOP
|
|
6
|
+
NOP:NOP:NOP:NOP
|
|
7
|
+
NOP:NOP:NOP:NOP
|
|
8
|
+
NOP:NOP:NOP:NOP
|
|
9
|
+
.begin
|
|
10
|
+
SEI
|
|
11
|
+
LDA#&20:STA&FE44:STA&FE45
|
|
12
|
+
LDX#0
|
|
13
|
+
INC&41FF,X:INC&41FF,X
|
|
14
|
+
LDA&FE44:STA&100
|
|
15
|
+
DEC&41FF,X:DEC&41FF,X
|
|
16
|
+
LDA&FE44:STA&101
|
|
17
|
+
ROL&41FF,X:ROL&41FF,X
|
|
18
|
+
LDA&FE44:STA&102
|
|
19
|
+
ROR&41FF,X:ROR&41FF,X
|
|
20
|
+
LDA&FE44:STA&103
|
|
21
|
+
LSR&41FF,X:LSR&41FF,X
|
|
22
|
+
LDA&FE44:STA&104
|
|
23
|
+
ASL&41FF,X:ASL&41FF,X
|
|
24
|
+
LDA&FE44:STA&105
|
|
25
|
+
LDA#&20:STA&FE44:STA&FE45
|
|
26
|
+
LDX#&FF
|
|
27
|
+
INC&41FF,X:INC&41FF,X
|
|
28
|
+
LDA&FE44:STA&108
|
|
29
|
+
DEC&41FF,X:DEC&41FF,X
|
|
30
|
+
LDA&FE44:STA&109
|
|
31
|
+
ROL&41FF,X:ROL&41FF,X
|
|
32
|
+
LDA&FE44:STA&10a
|
|
33
|
+
ROR&41FF,X:ROR&41FF,X
|
|
34
|
+
LDA&FE44:STA&10b
|
|
35
|
+
INX
|
|
36
|
+
INC&41FF,X:INC&41FF,X
|
|
37
|
+
LDA&FE44:STA&10c
|
|
38
|
+
DEC&41FF,X:DEC&41FF,X
|
|
39
|
+
LDA&FE44:STA&10d
|
|
40
|
+
ROL&41FF,X:ROL&41FF,X
|
|
41
|
+
LDA&FE44:STA&10e
|
|
42
|
+
ROR&41FF,X:ROR&41FF,X
|
|
43
|
+
LDA&FE44:STA&10f
|
|
44
|
+
CLI:RTS
|
|
45
|
+
.end
|
|
46
|
+
|
|
47
|
+
SAVE "Timings", start, end, begin
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
REM TestInstructions
|
|
2
|
+
HIMEM = &4000
|
|
3
|
+
FOR N%=0 TO 2 STEP 2:P%=&4400:[OPT N%
|
|
4
|
+
SEI
|
|
5
|
+
LDA #0
|
|
6
|
+
STA testInstr + 1
|
|
7
|
+
.loop
|
|
8
|
+
LDA #0
|
|
9
|
+
TAX
|
|
10
|
+
TAY
|
|
11
|
+
CLC
|
|
12
|
+
.testInstr ADC #0
|
|
13
|
+
.storeAddr STA &4000
|
|
14
|
+
INC testInstr + 1
|
|
15
|
+
INC storeAddr + 1
|
|
16
|
+
BNE loop
|
|
17
|
+
CLI
|
|
18
|
+
RTS
|
|
19
|
+
]NEXT
|
|
20
|
+
CALL &4400
|
|
21
|
+
FOR N%=0 TO 255 STEP 16
|
|
22
|
+
FOR M%=&4000 + N% TO &4000 + N% + 15
|
|
23
|
+
IF ?M%<16:PRINT ;0;
|
|
24
|
+
PRINT ;~?M%;
|
|
25
|
+
NEXT
|
|
26
|
+
PRINT
|
|
27
|
+
NEXT
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
>RUN
|
|
2
|
+
4436 (AD 1 10) 0 DD
|
|
3
|
+
4443 (AD 2 10) 0 DD
|
|
4
|
+
4450 (AD 3 10) 0 DD
|
|
5
|
+
445E (AD 4 10) 0 DD
|
|
6
|
+
0 (C6 16 D0) 0 0
|
|
7
|
+
0 (C6 16 D0) 0 0
|
|
8
|
+
4488 (AD 7 10) 0 FF
|
|
9
|
+
4497 (AD 8 10) 0 0
|
|
10
|
+
0 (C6 16 D0) 0 0
|
|
11
|
+
44B8 (E6 71 8C) C0 FF
|
|
12
|
+
44C5 (E6 71 8C) C0 FF
|
|
13
|
+
0 (C6 16 D0) 0 0
|
|
14
|
+
0 (C6 16 D0) 0 0
|
|
15
|
+
44F6 (AD E 10) C0 DB
|
|
16
|
+
4506 (AD F 10) C0 DC
|
|
17
|
+
4516 (AD 10 10) C0 FF
|
|
18
|
+
4527 (AD 11 10) C0 0
|
|
19
|
+
453A (8E 64 FE) C0 1
|
|
20
|
+
454A (8E 64 FE) C0 1
|
|
21
|
+
4559 (AD 14 20) C0 0
|
|
22
|
+
4569 (AD 15 20) C0 0
|
|
23
|
+
4578 (AD 16 20) C0 1
|
|
24
|
+
458A (E6 71 8C) C0 FF
|
|
25
|
+
4599 (E6 71 8C) C0 0
|
|
26
|
+
45A6 (E6 71 78) C0 0
|
|
27
|
+
0 (C6 16 D0) 0 0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
1 REM TestTimings - by Richard Talbot-Watkins
|
|
2
|
+
5 HIMEM=&4000
|
|
3
|
+
10 FOR N%=0 TO 2 STEP 2:P%=&4400:[OPT N%
|
|
4
|
+
20 SEI
|
|
5
|
+
30 LDA #irq MOD 256:STA &204
|
|
6
|
+
40 LDA #irq DIV 256:STA &205
|
|
7
|
+
50 LDA &FE4E:STA &70
|
|
8
|
+
60 LDA #&7F:STA &FE4E:STA &FE6E
|
|
9
|
+
70 LDA #&C0:STA &FE6E
|
|
10
|
+
80 LDA #0:STA &FE6B:STA &71
|
|
11
|
+
90 CLI
|
|
12
|
+
100 LDX #4:STX &FE64:LDY #0
|
|
13
|
+
105 STY &FE65:LDA (0),Y:LDA #1:DEC &FE65:LDA &1001:INC &71
|
|
14
|
+
110 STY &FE65:LDA (0,X):DEC &FE65:LDA &1002:INC &71
|
|
15
|
+
120 STY &FE65:LDA (0),Y:DEC &FE65:LDA &1003:INC &71
|
|
16
|
+
130 STY &FE65:LDA &1234:DEC &FE65:LDA &1004:INC &71
|
|
17
|
+
140 STY &FE65:LDA &12:DEC &FE65:LDA &1005:INC &71
|
|
18
|
+
150 STY &FE65:LDA #1:DEC &FE65:LDA &1006:INC &71
|
|
19
|
+
160 STY &FE65:LDA (0,X):LDA &1234:LDA &FE64:LDA &1007:INC &71
|
|
20
|
+
170 STY &FE65:LDA (0,X):LDA &12:LDA &FE64:LDA &1008:INC &71
|
|
21
|
+
180 STY &FE65:LDA (0,X):LDA #1:LDA &FE64:LDA &1009:INC &71
|
|
22
|
+
190 STY &FE65:LDA (0),Y:LDA #1:LDA &FE64:LDA &100A:INC &71
|
|
23
|
+
191 STY &FE65:LDA (0,X):LDA &FE64:LDA &100B:INC &71
|
|
24
|
+
192 STY &FE65:LDA (0),Y:LDA &1234:ROL &FE64:LDA &100C:STX &FE64:INC &71
|
|
25
|
+
193 STY &FE65:LDA (0),Y:LDA &12:ROL &FE64:LDA &100D:STX &FE64:INC &71
|
|
26
|
+
195 STY &FE65:LDA (0),Y:LDA #1:ROL &FE64:LDA &100E:STX &FE64:INC &71
|
|
27
|
+
200 STY &FE65:LDA (0,X):ROL &FE64:LDA &100F:STX &FE64:INC &71
|
|
28
|
+
210 STY &FE65:LDA (0),Y:ROL &FE64:LDA &1010:STX &FE64:INC &71
|
|
29
|
+
220 STY &FE65:LDA &1234:ROL &FE64:LDA &1011:STX &FE64:INC &71
|
|
30
|
+
230 STY &FE65:LDA &12:ROL &FE64:LDA &1012:STX &FE64:INC &71
|
|
31
|
+
240 STY &FE65:LDA #1:ROL &FE64:LDA &1013:STX &FE64:INC &71
|
|
32
|
+
241 STY &FE65:LDA (0,X):LDA (0),Y:LDA &1014:LDA &2014:INC &71
|
|
33
|
+
242 STY &FE65:LDA (0,X):LDA &1234:LDA &1015:LDA &2015:INC &71
|
|
34
|
+
243 STY &FE65:LDA (0,X):LDA &12:LDA &1016:LDA &2016:INC &71
|
|
35
|
+
244 STY &FE65:LDA (0,X):LDA #1:LDA &1017:LDA &2017:INC &71
|
|
36
|
+
245 STY &FE65:LDA (0),Y:LDA #1:LDA &1018:LDA &2018:INC &71
|
|
37
|
+
246 STY &FE65:LDA (0,X):LDA &1019:LDA &2019:INC &71
|
|
38
|
+
250 SEI
|
|
39
|
+
260 LDA &70:STA &FE4E:LDA #&7F:STA &FE6E
|
|
40
|
+
270 LDA #?&204:STA &204
|
|
41
|
+
280 LDA #?&205:STA &205
|
|
42
|
+
290 CLI:RTS
|
|
43
|
+
300 .irq
|
|
44
|
+
310 STX &72
|
|
45
|
+
320 TSX:INX:INX:LDA &100,X:STA &73
|
|
46
|
+
325 INX:LDA &100,X
|
|
47
|
+
330 LDX &71:STA &4300,X
|
|
48
|
+
335 LDA &73:STA &4000,X
|
|
49
|
+
340 LDA &FE6D:STA &4100,X
|
|
50
|
+
350 LDA &FE64:STA &4200,X
|
|
51
|
+
360 LDX &72
|
|
52
|
+
370 LDA &FC:RTI
|
|
53
|
+
380 ]NEXT
|
|
54
|
+
385 *FX 16,0
|
|
55
|
+
390 FOR N%=0 TO &3FF STEP 4:N%!&4000=0:NEXT
|
|
56
|
+
400 CALL &4400
|
|
57
|
+
410 FOR N%=0 TO ?&71
|
|
58
|
+
420 A%=(N%?&4300)*256+(N%?&4000)
|
|
59
|
+
430 PRINT ;~A%;" (";~A%?0;" ";~A%?1;" ";~A%?2;") ";TAB(22);~N%?&4100;TAB(30);~N%?&4200
|
|
60
|
+
440 NEXT
|
|
61
|
+
|