├── sources ├── dasm │ ├── test │ │ ├── empty.asm │ │ ├── badopcode1.fail │ │ ├── badopcode2.fail │ │ ├── toobigbyte.fail │ │ ├── toobigword.fail │ │ ├── doublemacro.fail │ │ ├── include-a.inc │ │ ├── addressexpression.bin.ref │ │ ├── toobigbyte.hex.ref │ │ ├── doublemacro.hex.ref │ │ ├── toobigword.hex.ref │ │ ├── broken6303hack.bin.ref │ │ ├── include.hex.ref │ │ ├── addressexpression.hex.ref │ │ ├── fill.bin.ref │ │ ├── sample.bin.ref │ │ ├── example.bin.ref │ │ ├── include.bin.ref │ │ ├── suitef8.bin.ref │ │ ├── doublemacro.bin.ref │ │ ├── suite6303.bin.ref │ │ ├── suite6502.bin.ref │ │ ├── suite68705.bin.ref │ │ ├── suite68hc11.bin.ref │ │ ├── toobigbyte.bin.ref │ │ ├── toobigword.bin.ref │ │ ├── badopcode2.asm │ │ ├── labelchanges.bin.ref │ │ ├── channel-f │ │ │ ├── lights.bin.ref │ │ │ ├── tetris.bin.ref │ │ │ ├── Makefile │ │ │ └── README │ │ ├── atari2600 │ │ │ ├── boing26.bin.ref │ │ │ ├── Makefile │ │ │ └── README │ │ ├── atari7800 │ │ │ ├── spritesample.bin.ref │ │ │ ├── Makefile │ │ │ └── README │ │ ├── toobigbyte.asm │ │ ├── toobigword.asm │ │ ├── broken6303hack.hex.ref │ │ ├── badopcode1.asm │ │ ├── doublemacro.asm │ │ ├── 11include.inc │ │ ├── jentzsch1.asm │ │ ├── longstring.bin.ref │ │ ├── jentzsch2.asm │ │ ├── locals.asm │ │ ├── run_valgrind.sh │ │ ├── Makefile │ │ ├── include.asm │ │ ├── longstring.asm │ │ ├── define_echo.asm │ │ ├── fill.asm │ │ ├── negative.asm │ │ ├── fill.hex.ref │ │ ├── demo.asm │ │ ├── longstring.hex.ref │ │ ├── supercat.asm │ │ ├── suitef8.hex.ref │ │ ├── addressexpression.asm │ │ ├── suite68705.hex.ref │ │ ├── suite6502.hex.ref │ │ ├── labelchanges.asm │ │ ├── suite6303.hex.ref │ │ ├── broken6303hack.asm │ │ ├── run_tests.sh │ │ ├── sample.hex.ref │ │ ├── string_conversion.asm │ │ ├── labelchanges.hex.ref │ │ ├── suite68hc11.hex.ref │ │ └── suite6502.asm │ ├── research │ │ ├── README │ │ ├── Makefile │ │ ├── minunit.h │ │ ├── loweror.c │ │ ├── get_set_progname.c │ │ ├── minunit_example.c │ │ ├── fsize.c │ │ └── sizeof.c │ ├── snapshot-builds │ │ ├── dasm-20200219222850-osx-x64.tar.gz │ │ ├── dasm-20200219222850-osx-x86.tar.gz │ │ ├── dasm-20200219222850-win-x64.tar.gz │ │ ├── dasm-20200219222850-win-x86.tar.gz │ │ ├── dasm-20200219222850-linux-x64.tar.gz │ │ └── dasm-20200219222850-linux-x86.tar.gz │ ├── doc │ │ └── ftohex.txt │ ├── docker │ │ ├── Dockerfile │ │ ├── make_dasm_all_platforms.sh │ │ └── README │ ├── src │ │ ├── BUGS │ │ ├── HEADER │ │ ├── test_errors.c │ │ └── version.h │ └── machines │ │ └── atari7800 │ │ └── macro.h ├── ide │ ├── lib │ │ ├── ts │ │ │ ├── common │ │ │ └── route.ts │ │ ├── tile.png │ │ ├── cm-syntax.css │ │ └── codemirror │ │ │ └── activeline.js │ ├── favicon.ico │ ├── Makefile │ ├── font │ │ ├── Pixel8Mono.zip │ │ ├── PixelMono_.zip │ │ ├── pixel_operator.zip │ │ ├── PixelOperatorMono.woff │ │ ├── PixelOperatorMono8.woff │ │ └── PixelOperator │ │ │ ├── PixelOperator.ttf │ │ │ ├── PixelOperator8.ttf │ │ │ ├── PixelOperatorHB.ttf │ │ │ ├── PixelOperatorHB8.ttf │ │ │ ├── PixelOperatorHBSC.ttf │ │ │ ├── PixelOperatorMono.ttf │ │ │ ├── PixelOperatorSC.ttf │ │ │ ├── PixelOperator-Bold.ttf │ │ │ ├── PixelOperator8-Bold.ttf │ │ │ ├── PixelOperatorMono8.ttf │ │ │ ├── PixelOperatorMonoHB.ttf │ │ │ ├── PixelOperatorMono-Bold.ttf │ │ │ ├── PixelOperatorMonoHB8.ttf │ │ │ ├── PixelOperatorSC-Bold.ttf │ │ │ └── PixelOperatorMono8-Bold.ttf │ ├── examples │ │ ├── atari000.png │ │ └── fantasy │ │ │ ├── colors │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── disco │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── noise │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── rle │ │ │ └── project.wide │ │ │ ├── skier │ │ │ └── project.wide │ │ │ ├── spacer │ │ │ └── project.wide │ │ │ ├── demoscene │ │ │ └── project.wide │ │ │ ├── gameoflife │ │ │ └── project.wide │ │ │ ├── random │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── rorshach │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── selfmodify │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── sierpinski │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── softsprites │ │ │ └── project.wide │ │ │ ├── starfield2d │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── triangles │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── zookeeper │ │ │ └── project.wide │ │ │ ├── byterun │ │ │ └── project.wide │ │ │ ├── calculator │ │ │ └── project.wide │ │ │ ├── compo-May07-1st │ │ │ └── project.wide │ │ │ ├── compo-May07-3rd │ │ │ └── project.wide │ │ │ ├── fullscreenlogo │ │ │ └── project.wide │ │ │ ├── screenpatterns │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── splashscreen │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── adventure │ │ │ └── project.wide │ │ │ ├── backandforth │ │ │ ├── project.wide │ │ │ └── main.asm │ │ │ ├── compo-May07-2nd │ │ │ └── project.wide │ │ │ └── alive │ │ │ ├── project.wide │ │ │ └── main.asm │ ├── favicon │ │ ├── gamepad-114-211893.png │ │ ├── gamepad-120-211893.png │ │ ├── gamepad-144-211893.png │ │ ├── gamepad-152-211893.png │ │ ├── gamepad-16-211893.png │ │ ├── gamepad-24-211893.png │ │ ├── gamepad-32-211893.png │ │ ├── gamepad-48-211893.png │ │ ├── gamepad-57-211893.png │ │ ├── gamepad-64-211893.png │ │ ├── gamepad-72-211893.png │ │ └── readme.txt │ ├── rollup.config.js │ └── package.json ├── systems │ └── fantasy_console │ │ ├── ts │ │ ├── common │ │ └── fc-main.ts │ │ ├── build │ │ └── README.md │ │ ├── .vscode │ │ └── settings.json │ │ ├── PixelOperatorMono.ttf │ │ ├── rollup.config.js │ │ ├── c_src │ │ └── machine.h │ │ └── package.json ├── orig │ └── www.6502asm.com │ │ ├── robots.txt │ │ ├── examples │ │ ├── selfmodify.asm │ │ ├── disco.asm │ │ ├── noise.asm │ │ ├── sierpinski.asm │ │ ├── random.asm │ │ ├── colors.asm │ │ ├── starfield2d.asm │ │ ├── triangles.asm │ │ ├── alive.asm │ │ ├── backandforth.asm │ │ ├── screenpatterns.asm │ │ ├── rorshach.asm │ │ ├── splashscreen.asm │ │ └── byterun.asm │ │ ├── beta │ │ ├── note.html │ │ └── style.css │ │ └── style.css ├── pretty6502 │ ├── .gitignore │ ├── Makefile │ ├── LICENSE │ └── README ├── ts_common │ ├── host-origin.ts │ └── scale-element.ts ├── v6502 │ ├── machine.hh │ └── machine.c └── web_dasm │ └── wasm_main.c ├── docs ├── asmjs │ ├── lib │ │ ├── wasm-mode.js │ │ ├── cm-syntax.css │ │ └── codemirror │ │ │ └── activeline.js │ ├── systems │ │ └── fantasy-console │ │ │ ├── README.md │ │ │ ├── fantasy-console.data │ │ │ └── fc-bundle.js │ ├── favicon.ico │ ├── v6502.js.mem │ ├── examples │ │ ├── disco │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── noise │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── rle │ │ │ └── project.wide │ │ ├── skier │ │ │ └── project.wide │ │ ├── colors │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── demoscene │ │ │ └── project.wide │ │ ├── gameoflife │ │ │ └── project.wide │ │ ├── rorshach │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── selfmodify │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── sierpinski │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── spacer │ │ │ └── project.wide │ │ ├── triangles │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── zookeeper │ │ │ └── project.wide │ │ ├── byterun │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── compo-May07-1st │ │ │ └── project.wide │ │ ├── compo-May07-3rd │ │ │ └── project.wide │ │ ├── fullscreenlogo │ │ │ └── project.wide │ │ ├── random │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── screenpatterns │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── softsprites │ │ │ └── project.wide │ │ ├── splashscreen │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── starfield2d │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── adventure │ │ │ └── project.wide │ │ ├── backandforth │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── calculator │ │ │ └── project.wide │ │ ├── compo-May07-2nd │ │ │ └── project.wide │ │ └── alive │ │ │ ├── project.wide │ │ │ └── main.asm │ └── font │ │ ├── PixelOperatorMono.woff │ │ └── PixelOperatorMono8.woff ├── wasm │ ├── lib │ │ ├── wasm-mode.js │ │ ├── cm-syntax.css │ │ └── codemirror │ │ │ └── activeline.js │ ├── systems │ │ └── fantasy-console │ │ │ ├── README.md │ │ │ ├── fantasy-console.data │ │ │ ├── fantasy-console.wasm │ │ │ └── fc-bundle.js │ ├── favicon.ico │ ├── v6502.wasm │ ├── dasm-exe.wasm │ ├── examples │ │ ├── colors │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── disco │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── noise │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── rle │ │ │ └── project.wide │ │ ├── skier │ │ │ └── project.wide │ │ ├── spacer │ │ │ └── project.wide │ │ ├── demoscene │ │ │ └── project.wide │ │ ├── gameoflife │ │ │ └── project.wide │ │ ├── random │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── rorshach │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── selfmodify │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── sierpinski │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── softsprites │ │ │ └── project.wide │ │ ├── starfield2d │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── triangles │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── zookeeper │ │ │ └── project.wide │ │ ├── byterun │ │ │ └── project.wide │ │ ├── calculator │ │ │ └── project.wide │ │ ├── compo-May07-1st │ │ │ └── project.wide │ │ ├── compo-May07-3rd │ │ │ └── project.wide │ │ ├── fullscreenlogo │ │ │ └── project.wide │ │ ├── screenpatterns │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── splashscreen │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── adventure │ │ │ └── project.wide │ │ ├── backandforth │ │ │ ├── project.wide │ │ │ └── main.asm │ │ ├── compo-May07-2nd │ │ │ └── project.wide │ │ └── alive │ │ │ ├── project.wide │ │ │ └── main.asm │ └── font │ │ ├── PixelOperatorMono.woff │ │ └── PixelOperatorMono8.woff ├── favicon.ico ├── update-docs ├── screenshots │ ├── 6502IDEEdit.png │ └── 6502IDEMain.png └── index.html ├── bin └── README.md ├── .gitignore ├── interface.ts ├── Makefile └── README.md /sources/dasm/test/empty.asm: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sources/dasm/test/badopcode1.fail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sources/dasm/test/badopcode2.fail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sources/dasm/test/toobigbyte.fail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sources/dasm/test/toobigword.fail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sources/dasm/test/doublemacro.fail: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sources/dasm/test/include-a.inc: -------------------------------------------------------------------------------- 1 | .byte $0A 2 | -------------------------------------------------------------------------------- /sources/ide/lib/ts/common: -------------------------------------------------------------------------------- 1 | ../../../ts_common/ -------------------------------------------------------------------------------- /sources/dasm/test/addressexpression.bin.ref: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/ts/common: -------------------------------------------------------------------------------- 1 | ../../../ts_common/ -------------------------------------------------------------------------------- /docs/asmjs/lib/wasm-mode.js: -------------------------------------------------------------------------------- 1 | window.WASM_FLAG='asmjs' === 'wasm'; 2 | -------------------------------------------------------------------------------- /docs/wasm/lib/wasm-mode.js: -------------------------------------------------------------------------------- 1 | window.WASM_FLAG='wasm' === 'wasm'; 2 | -------------------------------------------------------------------------------- /docs/asmjs/systems/fantasy-console/README.md: -------------------------------------------------------------------------------- 1 | # Build files go here 2 | -------------------------------------------------------------------------------- /docs/wasm/systems/fantasy-console/README.md: -------------------------------------------------------------------------------- 1 | # Build files go here 2 | -------------------------------------------------------------------------------- /sources/dasm/test/toobigbyte.hex.ref: -------------------------------------------------------------------------------- 1 | :01F800000007 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/build/README.md: -------------------------------------------------------------------------------- 1 | # Build files go here 2 | -------------------------------------------------------------------------------- /bin/README.md: -------------------------------------------------------------------------------- 1 | This directory holds native binaries build from source. 2 | 3 | -------------------------------------------------------------------------------- /sources/dasm/test/doublemacro.hex.ref: -------------------------------------------------------------------------------- 1 | :02F80000A9015C 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /sources/dasm/test/toobigword.hex.ref: -------------------------------------------------------------------------------- 1 | :02F80000000006 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /chat/ 3 | -------------------------------------------------------------------------------- /sources/dasm/test/broken6303hack.bin.ref: -------------------------------------------------------------------------------- 1 | qarbue{kq a r b u e { k -------------------------------------------------------------------------------- /sources/dasm/test/include.hex.ref: -------------------------------------------------------------------------------- 1 | :07000000A9010A0A0A11110F 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /sources/dasm/test/addressexpression.hex.ref: -------------------------------------------------------------------------------- 1 | :0B0100000102030405060708090A0BB2 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /docs/asmjs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/asmjs/favicon.ico -------------------------------------------------------------------------------- /docs/wasm/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/favicon.ico -------------------------------------------------------------------------------- /docs/wasm/v6502.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/v6502.wasm -------------------------------------------------------------------------------- /docs/asmjs/v6502.js.mem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/asmjs/v6502.js.mem -------------------------------------------------------------------------------- /docs/wasm/dasm-exe.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/dasm-exe.wasm -------------------------------------------------------------------------------- /sources/ide/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon.ico -------------------------------------------------------------------------------- /sources/ide/lib/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/lib/tile.png -------------------------------------------------------------------------------- /sources/pretty6502/.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.o 3 | Aa* 4 | aa* 5 | dasm 6 | pretty6502 7 | pretty6502.exe 8 | -------------------------------------------------------------------------------- /docs/asmjs/examples/disco/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/noise/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/rle/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/skier/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/update-docs: -------------------------------------------------------------------------------- 1 | 2 | #!/bin/sh 3 | 4 | rm -rf wasm/ asmjs/ 5 | cp ../dist/wasm/ . -Rv 6 | cp ../dist/asmjs/ . -Rv 7 | -------------------------------------------------------------------------------- /docs/wasm/examples/colors/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/disco/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/noise/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/rle/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/skier/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/spacer/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | npm run make2 3 | 4 | clean: 5 | npm run clean 6 | 7 | run: 8 | cd ../..; make run 9 | -------------------------------------------------------------------------------- /docs/asmjs/examples/colors/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/demoscene/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/gameoflife/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/rorshach/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/selfmodify/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/sierpinski/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/spacer/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/triangles/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/zookeeper/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/screenshots/6502IDEEdit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/screenshots/6502IDEEdit.png -------------------------------------------------------------------------------- /docs/screenshots/6502IDEMain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/screenshots/6502IDEMain.png -------------------------------------------------------------------------------- /docs/wasm/examples/demoscene/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/gameoflife/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/random/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | 5 | -------------------------------------------------------------------------------- /docs/wasm/examples/rorshach/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/selfmodify/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/sierpinski/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/softsprites/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/starfield2d/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/triangles/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/zookeeper/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/dasm/test/fill.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/fill.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/sample.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/sample.bin.ref -------------------------------------------------------------------------------- /sources/ide/font/Pixel8Mono.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/Pixel8Mono.zip -------------------------------------------------------------------------------- /sources/ide/font/PixelMono_.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelMono_.zip -------------------------------------------------------------------------------- /docs/asmjs/examples/byterun/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Byte run compression demo 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/compo-May07-1st/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/compo-May07-3rd/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/fullscreenlogo/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/random/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | 5 | -------------------------------------------------------------------------------- /docs/asmjs/examples/screenpatterns/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/softsprites/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/splashscreen/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/starfield2d/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/byterun/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Byte run compression demo 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/calculator/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Simple integer calculator 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/compo-May07-1st/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/compo-May07-3rd/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/fullscreenlogo/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/screenpatterns/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/splashscreen/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/dasm/test/example.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/example.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/include.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/include.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/suitef8.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/suitef8.bin.ref -------------------------------------------------------------------------------- /sources/ide/examples/atari000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/examples/atari000.png -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/colors/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/disco/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/noise/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/rle/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/skier/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/spacer/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "machine.h": "c" 4 | } 5 | } -------------------------------------------------------------------------------- /docs/asmjs/examples/adventure/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Adventure! Defeat the bad guy! 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/backandforth/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Pixel goes back and forth. 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/calculator/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Simple integer calculator 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/examples/compo-May07-2nd/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | 5 | -------------------------------------------------------------------------------- /docs/wasm/examples/adventure/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Adventure! Defeat the bad guy! 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/backandforth/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Pixel goes back and forth. 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/examples/compo-May07-2nd/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | 5 | -------------------------------------------------------------------------------- /docs/wasm/font/PixelOperatorMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/font/PixelOperatorMono.woff -------------------------------------------------------------------------------- /sources/dasm/test/doublemacro.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/doublemacro.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/suite6303.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/suite6303.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/suite6502.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/suite6502.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/suite68705.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/suite68705.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/suite68hc11.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/suite68hc11.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/toobigbyte.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/toobigbyte.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/toobigword.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/toobigword.bin.ref -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/demoscene/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/gameoflife/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/random/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | 5 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/rorshach/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/selfmodify/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/sierpinski/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/softsprites/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/starfield2d/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/triangles/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/zookeeper/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/font/pixel_operator.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/pixel_operator.zip -------------------------------------------------------------------------------- /docs/asmjs/examples/alive/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Colorful pixels crawl around the screen 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/asmjs/font/PixelOperatorMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/asmjs/font/PixelOperatorMono.woff -------------------------------------------------------------------------------- /docs/asmjs/font/PixelOperatorMono8.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/asmjs/font/PixelOperatorMono8.woff -------------------------------------------------------------------------------- /docs/wasm/examples/alive/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Colorful pixels crawl around the screen 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /docs/wasm/font/PixelOperatorMono8.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/font/PixelOperatorMono8.woff -------------------------------------------------------------------------------- /sources/dasm/test/badopcode2.asm: -------------------------------------------------------------------------------- 1 | ; Test case for bug in error handling. 2 | 3 | processor 6502 4 | 5 | ORG $f800 6 | jsr ($1000) 7 | 8 | -------------------------------------------------------------------------------- /sources/dasm/test/labelchanges.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/labelchanges.bin.ref -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/byterun/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Byte run compression demo 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/calculator/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Simple integer calculator 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/compo-May07-1st/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/compo-May07-3rd/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/fullscreenlogo/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/screenpatterns/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/splashscreen/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/font/PixelOperatorMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperatorMono.woff -------------------------------------------------------------------------------- /sources/dasm/test/channel-f/lights.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/channel-f/lights.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/channel-f/tetris.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/channel-f/tetris.bin.ref -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/adventure/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Adventure! Defeat the bad guy! 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/backandforth/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Pixel goes back and forth. 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/compo-May07-2nd/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Generic description 3 | meta.build=dasm 4 | 5 | -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-114-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-114-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-120-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-120-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-144-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-144-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-152-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-152-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-16-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-16-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-24-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-24-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-32-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-32-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-48-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-48-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-57-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-57-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-64-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-64-211893.png -------------------------------------------------------------------------------- /sources/ide/favicon/gamepad-72-211893.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/favicon/gamepad-72-211893.png -------------------------------------------------------------------------------- /sources/ide/font/PixelOperatorMono8.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperatorMono8.woff -------------------------------------------------------------------------------- /sources/dasm/test/atari2600/boing26.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/atari2600/boing26.bin.ref -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/alive/project.wide: -------------------------------------------------------------------------------- 1 | meta.entry=main.asm 2 | meta.description=Colorful pixels crawl around the screen 3 | meta.build=dasm 4 | -------------------------------------------------------------------------------- /sources/dasm/research/README: -------------------------------------------------------------------------------- 1 | 2 | This is a directory to keep experiments in, stuff that was 3 | written to explore some aspect of DASM and improve on it. 4 | 5 | -------------------------------------------------------------------------------- /sources/dasm/test/atari7800/spritesample.bin.ref: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/test/atari7800/spritesample.bin.ref -------------------------------------------------------------------------------- /sources/dasm/test/toobigbyte.asm: -------------------------------------------------------------------------------- 1 | ; Test case for strict mode check for byte data size 2 | 3 | processor 6502 4 | 5 | ORG $f800 6 | 7 | .byte $100 8 | 9 | -------------------------------------------------------------------------------- /sources/dasm/test/toobigword.asm: -------------------------------------------------------------------------------- 1 | ; Test case for strict mode check for word data size 2 | 3 | processor 6502 4 | 5 | ORG $f800 6 | 7 | .word $10000 8 | 9 | -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperator.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperator.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperator8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperator8.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorHB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorHB.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorHB8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorHB8.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorHBSC.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorHBSC.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorMono.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorSC.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorSC.ttf -------------------------------------------------------------------------------- /docs/wasm/systems/fantasy-console/fantasy-console.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/systems/fantasy-console/fantasy-console.data -------------------------------------------------------------------------------- /docs/wasm/systems/fantasy-console/fantasy-console.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/wasm/systems/fantasy-console/fantasy-console.wasm -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperator-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperator-Bold.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperator8-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperator8-Bold.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorMono8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorMono8.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorMonoHB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorMonoHB.ttf -------------------------------------------------------------------------------- /sources/systems/fantasy_console/PixelOperatorMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/systems/fantasy_console/PixelOperatorMono.ttf -------------------------------------------------------------------------------- /docs/asmjs/systems/fantasy-console/fantasy-console.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/docs/asmjs/systems/fantasy-console/fantasy-console.data -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorMono-Bold.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorMonoHB8.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorMonoHB8.ttf -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorSC-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorSC-Bold.ttf -------------------------------------------------------------------------------- /sources/ts_common/host-origin.ts: -------------------------------------------------------------------------------- 1 | 2 | export const ORIGIN = (() => { 3 | var b = window.location.href.split("/"); 4 | return [b[0], b[1], b[2]].join("/"); 5 | })(); 6 | -------------------------------------------------------------------------------- /sources/ide/font/PixelOperator/PixelOperatorMono8-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/ide/font/PixelOperator/PixelOperatorMono8-Bold.ttf -------------------------------------------------------------------------------- /sources/dasm/test/broken6303hack.hex.ref: -------------------------------------------------------------------------------- 1 | :100000007110611072106210751065107B106B100A 2 | :100010007110206110207210206210207510206570 3 | :0800200010207B10206B102062 4 | :00000001FF 5 | -------------------------------------------------------------------------------- /sources/dasm/snapshot-builds/dasm-20200219222850-osx-x64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/snapshot-builds/dasm-20200219222850-osx-x64.tar.gz -------------------------------------------------------------------------------- /sources/dasm/snapshot-builds/dasm-20200219222850-osx-x86.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/snapshot-builds/dasm-20200219222850-osx-x86.tar.gz -------------------------------------------------------------------------------- /sources/dasm/snapshot-builds/dasm-20200219222850-win-x64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/snapshot-builds/dasm-20200219222850-win-x64.tar.gz -------------------------------------------------------------------------------- /sources/dasm/snapshot-builds/dasm-20200219222850-win-x86.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/snapshot-builds/dasm-20200219222850-win-x86.tar.gz -------------------------------------------------------------------------------- /sources/dasm/snapshot-builds/dasm-20200219222850-linux-x64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/snapshot-builds/dasm-20200219222850-linux-x64.tar.gz -------------------------------------------------------------------------------- /sources/dasm/snapshot-builds/dasm-20200219222850-linux-x86.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JeremyJStarcher/Web_6502_IDE/HEAD/sources/dasm/snapshot-builds/dasm-20200219222850-linux-x86.tar.gz -------------------------------------------------------------------------------- /sources/dasm/test/badopcode1.asm: -------------------------------------------------------------------------------- 1 | ; Thomas Jentzsch test case for bug 2 | ; in error handling. 3 | 4 | processor 6502 5 | 6 | ORG $f800 7 | ldz #$00 ; illegal mnemonic 8 | 9 | -------------------------------------------------------------------------------- /sources/dasm/test/doublemacro.asm: -------------------------------------------------------------------------------- 1 | ; Test case for double macros 2 | 3 | processor 6502 4 | 5 | MAC testmac 6 | lda #1 7 | ENDM 8 | MAC testmac 9 | lda #1 10 | ENDM 11 | 12 | ORG $f800 13 | 14 | testmac 15 | 16 | -------------------------------------------------------------------------------- /sources/dasm/research/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-O0 -std=c99 -Wall -Wextra # try -O3 for fun... 2 | 3 | ALL=compare_mod_and minunit_example get_set_progname sizeof bitsets loweror fsize #args 4 | 5 | all: $(ALL) 6 | 7 | clean: 8 | rm -rf *.o $(ALL) 9 | -------------------------------------------------------------------------------- /sources/dasm/test/atari2600/Makefile: -------------------------------------------------------------------------------- 1 | test: boing26.bin 2 | -diff boing26.bin boing26.bin.ref 3 | 4 | boing26.bin: boing26.asm 5 | ../../bin/dasm boing26.asm -f3 -I../../machines/atari2600/ -oboing26.bin 6 | 7 | clean: 8 | rm -rf boing26.bin 9 | -------------------------------------------------------------------------------- /sources/dasm/test/11include.inc: -------------------------------------------------------------------------------- 1 | ; 11include.inc - part of the symbolic include testing. 2 | ; To test non-symbol compliant include filenames, the name needs to begin with digits. 3 | ; Please don't rename it. 4 | ; 5 | ; --Mike Saarna 6 | 7 | .byte $11 8 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/selfmodify.asm: -------------------------------------------------------------------------------- 1 | ; A very simple example of 2 | ; self-modifying code 3 | ; and code entry points 4 | 5 | lda $fe 6 | sta $1001 7 | jmp $1000 8 | 9 | *=$1000 10 | lda #$00 11 | sta $3ef 12 | jmp $600 13 | 14 | -------------------------------------------------------------------------------- /sources/pretty6502/Makefile: -------------------------------------------------------------------------------- 1 | # Ultra simple makefile for pretty6502 2 | # by Oscar Toledo G. 3 | # https://github.com/nanochess/pretty6502 4 | # 5 | build: 6 | @cc pretty6502.c -o pretty6502 7 | 8 | clean: 9 | @rm pretty6502 10 | 11 | love: 12 | @echo "...not war" 13 | 14 | -------------------------------------------------------------------------------- /sources/dasm/test/atari7800/Makefile: -------------------------------------------------------------------------------- 1 | test: spritesample.bin 2 | -diff spritesample.bin spritesample.bin.ref 3 | 4 | spritesample.bin: spritesample.asm 5 | ../../bin/dasm spritesample.asm -f3 -I../../machines/atari7800/ -ospritesample.bin 6 | 7 | clean: 8 | rm -rf spritesample.bin 9 | -------------------------------------------------------------------------------- /sources/dasm/test/atari7800/README: -------------------------------------------------------------------------------- 1 | 2 | Some DASM test cases for Atari 7800 software 3 | 4 | For all of these examples, I received express written permission 5 | from all authors to include the code in the DASM distribution. 6 | 7 | spritesample.asm 8 | Dan Boris' simple sprite sample 9 | -------------------------------------------------------------------------------- /docs/asmjs/examples/selfmodify/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; A very simple example of 4 | ; self-modifying code 5 | ; and code entry points 6 | 7 | lda $fe 8 | sta $1001 9 | jmp $1000 10 | 11 | ORG $1000 12 | lda #$00 13 | sta $3ef 14 | jmp $600 15 | -------------------------------------------------------------------------------- /docs/wasm/examples/selfmodify/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; A very simple example of 4 | ; self-modifying code 5 | ; and code entry points 6 | 7 | lda $fe 8 | sta $1001 9 | jmp $1000 10 | 11 | ORG $1000 12 | lda #$00 13 | sta $3ef 14 | jmp $600 15 | -------------------------------------------------------------------------------- /sources/dasm/test/jentzsch1.asm: -------------------------------------------------------------------------------- 1 | ; Thomas Jentzsch test case for bug 2 | ; in error handling. 3 | 4 | processor 6502 5 | include vcs.h 6 | 7 | ORG $f800 8 | 9 | Start 10 | ldz #$00 ; illegal mnemonic 11 | 12 | org $fffc 13 | .word Start 14 | .word Start 15 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/selfmodify/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; A very simple example of 4 | ; self-modifying code 5 | ; and code entry points 6 | 7 | lda $fe 8 | sta $1001 9 | jmp $1000 10 | 11 | ORG $1000 12 | lda #$00 13 | sta $3ef 14 | jmp $600 15 | -------------------------------------------------------------------------------- /sources/dasm/test/longstring.bin.ref: -------------------------------------------------------------------------------- 1 | 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 -------------------------------------------------------------------------------- /sources/dasm/test/jentzsch2.asm: -------------------------------------------------------------------------------- 1 | ; Thomas Jentzsch test case for bug 2 | ; in error handling. 3 | 4 | processor 6502 5 | include vcs.h 6 | 7 | ORG $f800 8 | 9 | Start 10 | ldz #$00 ; illegal mnemonic 11 | bpl .error ; undefined label 12 | 13 | org $fffc 14 | .word Start 15 | .word Start 16 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/disco.asm: -------------------------------------------------------------------------------- 1 | ; DISCO DISCO 2 | ; submitted by Anonymous 3 | 4 | start: 5 | inx 6 | txa 7 | sta $200, y 8 | sta $300, y 9 | sta $400, y 10 | sta $500, y 11 | iny 12 | tya 13 | cmp 16 14 | bne do 15 | iny 16 | jmp start 17 | do: 18 | iny 19 | iny 20 | iny 21 | iny 22 | jmp start 23 | 24 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/noise.asm: -------------------------------------------------------------------------------- 1 | ; static noise 2 | 3 | start: ldy #$ff 4 | ldx #$0 5 | loop: lda $fe 6 | sta $200,x 7 | and #$7 8 | sta $300,x 9 | and #$3 10 | sta $400,x 11 | and #$1 12 | sta $500,x 13 | inx 14 | dey 15 | bne loop 16 | rts 17 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript'; 2 | 3 | export default [ 4 | { 5 | input: './ts/fc-main.ts', 6 | plugins: [ 7 | typescript() 8 | ], 9 | output: { 10 | sourcemap: "./ts/fc-bundle.js.map", 11 | file: './ts/fc-bundle.js', 12 | format: 'es' 13 | }, 14 | }, 15 | ] 16 | -------------------------------------------------------------------------------- /docs/asmjs/examples/disco/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; DISCO DISCO 5 | ; submitted by Anonymous 6 | 7 | start: 8 | inx 9 | txa 10 | sta $200,y 11 | sta $300,y 12 | sta $400,y 13 | sta $500,y 14 | iny 15 | tya 16 | cmp 16 17 | bne do 18 | iny 19 | jmp start 20 | do: 21 | iny 22 | iny 23 | iny 24 | iny 25 | jmp start 26 | 27 | -------------------------------------------------------------------------------- /docs/wasm/examples/disco/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; DISCO DISCO 5 | ; submitted by Anonymous 6 | 7 | start: 8 | inx 9 | txa 10 | sta $200,y 11 | sta $300,y 12 | sta $400,y 13 | sta $500,y 14 | iny 15 | tya 16 | cmp 16 17 | bne do 18 | iny 19 | jmp start 20 | do: 21 | iny 22 | iny 23 | iny 24 | iny 25 | jmp start 26 | 27 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/sierpinski.asm: -------------------------------------------------------------------------------- 1 | ; Sierpinski 2 | ; Submitted by Anonymous 3 | 4 | start: 5 | lda #$e1 6 | sta $0 7 | lda #$01 8 | sta $1 9 | ldy #$20 10 | 11 | write: 12 | ldx #$00 13 | eor ($0, x) 14 | sta ($0),y 15 | 16 | inc $0 17 | bne write 18 | inc $1 19 | ldx $1 20 | cpx #$06 21 | bne write 22 | 23 | rts 24 | 25 | -------------------------------------------------------------------------------- /docs/asmjs/examples/noise/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; static noise 5 | 6 | start: ldy #$ff 7 | ldx #$0 8 | loop: lda $fe 9 | sta $200,x 10 | and #$7 11 | sta $300,x 12 | and #$3 13 | sta $400,x 14 | and #$1 15 | sta $500,x 16 | inx 17 | dey 18 | bne loop 19 | rts 20 | -------------------------------------------------------------------------------- /docs/wasm/examples/noise/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; static noise 5 | 6 | start: ldy #$ff 7 | ldx #$0 8 | loop: lda $fe 9 | sta $200,x 10 | and #$7 11 | sta $300,x 12 | and #$3 13 | sta $400,x 14 | and #$1 15 | sta $500,x 16 | inx 17 | dey 18 | bne loop 19 | rts 20 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/disco/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; DISCO DISCO 5 | ; submitted by Anonymous 6 | 7 | start: 8 | inx 9 | txa 10 | sta $200,y 11 | sta $300,y 12 | sta $400,y 13 | sta $500,y 14 | iny 15 | tya 16 | cmp 16 17 | bne do 18 | iny 19 | jmp start 20 | do: 21 | iny 22 | iny 23 | iny 24 | iny 25 | jmp start 26 | 27 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/noise/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; static noise 5 | 6 | start: ldy #$ff 7 | ldx #$0 8 | loop: lda $fe 9 | sta $200,x 10 | and #$7 11 | sta $300,x 12 | and #$3 13 | sta $400,x 14 | and #$1 15 | sta $500,x 16 | inx 17 | dey 18 | bne loop 19 | rts 20 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/random.asm: -------------------------------------------------------------------------------- 1 | loop: lda $fe ; A=rnd 2 | sta $00 ; ZP(0)=A 3 | lda $fe 4 | and #$3 ; A=A&3 5 | clc ; Clear carry 6 | adc #$2 ; A+=2 7 | sta $01 ; ZP(1)=A 8 | lda $fe ; A=rnd 9 | ldy #$0 ; Y=0 10 | sta ($00),y ; ZP(0),ZP(1)=y 11 | jmp loop 12 | -------------------------------------------------------------------------------- /sources/dasm/research/minunit.h: -------------------------------------------------------------------------------- 1 | /* see http://www.jera.com/techinfo/jtns/jtn002.html */ 2 | /* code modified to compile without warnings [phf] */ 3 | #define mu_assert(message, test) \ 4 | do { if (!(test)) return message; } while (0) 5 | #define mu_run_test(test) \ 6 | do { const char *message = test(); tests_run++; \ 7 | if (message) return message; } while (0) 8 | extern int tests_run; 9 | -------------------------------------------------------------------------------- /sources/dasm/test/channel-f/Makefile: -------------------------------------------------------------------------------- 1 | test: lights.bin tetris.bin 2 | -diff lights.bin lights.bin.ref 3 | -diff tetris.bin tetris.bin.ref 4 | 5 | lights.bin: lights.asm 6 | ../../bin/dasm lights.asm -f3 -I../../machines/channel-f/ -olights.bin 7 | tetris.bin: tetris.asm 8 | ../../bin/dasm tetris.asm -f3 -I../../machines/channel-f/ -otetris.bin 9 | 10 | clean: 11 | rm -rf lights.bin tetris.bin 12 | -------------------------------------------------------------------------------- /sources/dasm/test/atari2600/README: -------------------------------------------------------------------------------- 1 | 2 | Some DASM test cases for Atari 2600 software 3 | 4 | For all of these examples, I received express written permission 5 | from all authors to include the code in the DASM distribution. 6 | 7 | boing26.asm 8 | Rob Kudla's Amiga Boing! demo from http://www.qotile.net/minidig/ 9 | boing26.bin.ref 10 | Cartridge ROM by Rob Kudla from http://www.qotile.net/minidig/ 11 | -------------------------------------------------------------------------------- /docs/asmjs/examples/random/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | loop: lda $fe ; A=rnd 5 | sta $00 ; ZP(0)=A 6 | lda $fe 7 | and #$3 ; A=A&3 8 | clc ; Clear carry 9 | adc #$2 ; A+=2 10 | sta $01 ; ZP(1)=A 11 | lda $fe ; A=rnd 12 | ldy #$0 ; Y=0 13 | sta ($00),y ; ZP(0),ZP(1)=y 14 | jmp loop 15 | -------------------------------------------------------------------------------- /docs/wasm/examples/random/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | loop: lda $fe ; A=rnd 5 | sta $00 ; ZP(0)=A 6 | lda $fe 7 | and #$3 ; A=A&3 8 | clc ; Clear carry 9 | adc #$2 ; A+=2 10 | sta $01 ; ZP(1)=A 11 | lda $fe ; A=rnd 12 | ldy #$0 ; Y=0 13 | sta ($00),y ; ZP(0),ZP(1)=y 14 | jmp loop 15 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/random/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | loop: lda $fe ; A=rnd 5 | sta $00 ; ZP(0)=A 6 | lda $fe 7 | and #$3 ; A=A&3 8 | clc ; Clear carry 9 | adc #$2 ; A+=2 10 | sta $01 ; ZP(1)=A 11 | lda $fe ; A=rnd 12 | ldy #$0 ; Y=0 13 | sta ($00),y ; ZP(0),ZP(1)=y 14 | jmp loop 15 | -------------------------------------------------------------------------------- /sources/dasm/test/locals.asm: -------------------------------------------------------------------------------- 1 | ;;;; 2 | ; 3 | ; Test local symbols 4 | ; 5 | processor 6502 6 | 7 | mac test1 8 | bne .end 9 | test$ = 1 10 | test2 11 | .end 12 | nop 13 | endm 14 | 15 | mac test2 16 | bne .end 17 | test$ = 1 18 | test3 19 | .end 20 | nop 21 | endm 22 | 23 | mac test3 24 | bne .end 25 | test$ = 1 26 | nop 27 | .end 28 | nop 29 | endm 30 | 31 | org 0 32 | 33 | test1 34 | test2 35 | test3 36 | 37 | .end 38 | 39 | loop set 0 40 | 41 | -------------------------------------------------------------------------------- /sources/dasm/research/loweror.c: -------------------------------------------------------------------------------- 1 | /* 2 | the findext() function in main.c was full of the "| 0x20" stuff 3 | below; I used this to verify that the intention was to convert 4 | a character to lower case 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | int main(void) 11 | { 12 | for (int i = 0; i < 256; i++) { 13 | int raw = i; 14 | int low = i | 0x20; 15 | printf(" %c \t %c \n", isprint(raw) ? raw : 'X', isprint(low) ? low : 'Y'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sources/v6502/machine.hh: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | //6502 CPU registers 7 | extern uint16_t pc; 8 | extern uint8_t sp, a, x, y, status; 9 | extern void reset6502(void); 10 | extern uint32_t clockticks6502; 11 | 12 | extern void step6502(void); 13 | 14 | void js_step6502(uint16_t *buf, int len); 15 | uint8_t read6502(uint16_t address); 16 | void write6502(uint16_t address, uint8_t value); 17 | void testrun(); 18 | -------------------------------------------------------------------------------- /sources/dasm/test/run_valgrind.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Simple test script adapted from Matt Dillon's 2.16 release. 4 | # It's harder to do this in a Makefile, so let's use a script. 5 | 6 | for i in *.asm 7 | do 8 | NAME=`basename $i .asm` 9 | echo "----- $NAME -----" 10 | valgrind -v --tool=memcheck --leak-check=full --error-exitcode=10 --show-reachable=yes --log-file=$NAME.valgrind ../bin/dasm $i -f1 -o$NAME.bin -DINEEPROM 11 | echo "valgrind returned $?" 12 | done 13 | -------------------------------------------------------------------------------- /sources/dasm/test/Makefile: -------------------------------------------------------------------------------- 1 | # demo.asm doesn't compile! 2 | # no useful reference output for suitef8.asm right now 3 | 4 | DASM=../bin/dasm 5 | FTOHEX=../bin/ftohex 6 | 7 | test: 8 | (cd atari2600; $(MAKE) test; cd ..) 9 | (cd atari7800; $(MAKE) test; cd ..) 10 | ./run_tests.sh 11 | 12 | %.bin: %.asm 13 | $(DASM) $< -o$@ -f1 -DINEEPROM 14 | 15 | %.hex: %.bin 16 | $(FTOHEX) 1 $< $@ 17 | 18 | clean: 19 | (cd atari2600; $(MAKE) clean; cd ..) 20 | (cd atari7800; $(MAKE) clean; cd ..) 21 | rm -rf *.bin *.hex *.list.txt 22 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/colors.asm: -------------------------------------------------------------------------------- 1 | ; submitted by Anonymous 2 | 3 | ldx #0 4 | ldy #0 5 | ;init screen 6 | lda #0 7 | sta $0 8 | lda #2 9 | sta $1 10 | loop: 11 | lda colors,x 12 | bpl ok 13 | inc $0 14 | ldx #0 15 | lda colors,x 16 | ok: 17 | inx 18 | sta ($0),y 19 | iny 20 | bne ok2 21 | inc $1 22 | ok2: 23 | jmp loop 24 | 25 | colors: 26 | dcb 0,2,0,2,2,8,2,8,8,7,8,7,7,1,7,1,1,7,1,7,7,8,7,8,8,2,8,2,2,0,2,0 27 | dcb 2,2,8,2,8,8,7,8,7,7,1,7,1,1,1,1,1,1,1,1,7,1,7,7,8,7,8,8,2,8,2,2,$ff 28 | 29 | -------------------------------------------------------------------------------- /sources/dasm/test/include.asm: -------------------------------------------------------------------------------- 1 | ; Test symbolic includes 2 | ; 3 | ; Ensure that quoted, unquoted, and symbol based includes work. 4 | ; 5 | ; --Mike Saarna 6 | 7 | .processor 6502 8 | .org 0 9 | 10 | TESTINCA = "include-a.inc" 11 | PASSFORCEA = PASSFORCEB 12 | 13 | lda #PASSFORCEA 14 | include "include-a.inc" 15 | include include-a.inc 16 | include TESTINCA 17 | include "11include.inc" 18 | 19 | ; Non-symbol compliant filenames without quotes... 20 | include 11include.inc 21 | 22 | PASSFORCEB = 1 23 | 24 | 25 | .end 26 | -------------------------------------------------------------------------------- /docs/asmjs/examples/colors/main.asm: -------------------------------------------------------------------------------- 1 | ; submitted by Anonymous 2 | 3 | PROCESSOR 6502 4 | ORG $0600 5 | 6 | ldx #0 7 | ldy #0 8 | ;init screen 9 | lda #0 10 | sta $0 11 | lda #2 12 | sta $1 13 | loop: 14 | lda colors,x 15 | bpl ok 16 | inc $0 17 | ldx #0 18 | lda colors,x 19 | ok: 20 | inx 21 | sta ($0),y 22 | iny 23 | bne ok2 24 | inc $1 25 | ok2: 26 | jmp loop 27 | 28 | colors: 29 | .byte 0,2,0,2,2,8,2,8,8,7,8,7,7,1,7,1,1,7,1,7,7,8,7,8,8,2,8,2,2,0,2,0 30 | .byte 2,2,8,2,8,8,7,8,7,7,1,7,1,1,1,1,1,1,1,1,7,1,7,7,8,7,8,8,2,8,2,2,$ff 31 | -------------------------------------------------------------------------------- /docs/wasm/examples/colors/main.asm: -------------------------------------------------------------------------------- 1 | ; submitted by Anonymous 2 | 3 | PROCESSOR 6502 4 | ORG $0600 5 | 6 | ldx #0 7 | ldy #0 8 | ;init screen 9 | lda #0 10 | sta $0 11 | lda #2 12 | sta $1 13 | loop: 14 | lda colors,x 15 | bpl ok 16 | inc $0 17 | ldx #0 18 | lda colors,x 19 | ok: 20 | inx 21 | sta ($0),y 22 | iny 23 | bne ok2 24 | inc $1 25 | ok2: 26 | jmp loop 27 | 28 | colors: 29 | .byte 0,2,0,2,2,8,2,8,8,7,8,7,7,1,7,1,1,7,1,7,7,8,7,8,8,2,8,2,2,0,2,0 30 | .byte 2,2,8,2,8,8,7,8,7,7,1,7,1,1,1,1,1,1,1,1,7,1,7,7,8,7,8,8,2,8,2,2,$ff 31 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/colors/main.asm: -------------------------------------------------------------------------------- 1 | ; submitted by Anonymous 2 | 3 | PROCESSOR 6502 4 | ORG $0600 5 | 6 | ldx #0 7 | ldy #0 8 | ;init screen 9 | lda #0 10 | sta $0 11 | lda #2 12 | sta $1 13 | loop: 14 | lda colors,x 15 | bpl ok 16 | inc $0 17 | ldx #0 18 | lda colors,x 19 | ok: 20 | inx 21 | sta ($0),y 22 | iny 23 | bne ok2 24 | inc $1 25 | ok2: 26 | jmp loop 27 | 28 | colors: 29 | .byte 0,2,0,2,2,8,2,8,8,7,8,7,7,1,7,1,1,7,1,7,7,8,7,8,8,2,8,2,2,0,2,0 30 | .byte 2,2,8,2,8,8,7,8,7,7,1,7,1,1,1,1,1,1,1,1,7,1,7,7,8,7,8,8,2,8,2,2,$ff 31 | -------------------------------------------------------------------------------- /sources/dasm/test/longstring.asm: -------------------------------------------------------------------------------- 1 | ; Test long strings 2 | ; 3 | ; This came about due to strings longer than 256 bytes causing 4 | ; segfaults, due to overflow of a buffer in the opcode handling. 5 | ; 6 | ; --Mike Saarna 7 | 8 | .processor 6502 9 | .org 0 10 | 11 | .byte "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" 12 | 13 | .end 14 | -------------------------------------------------------------------------------- /sources/ide/rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript'; 2 | 3 | export default [ 4 | { 5 | input: './lib/ts/main.ts', 6 | plugins: [ 7 | typescript() 8 | ], 9 | output: { 10 | sourcemap: "./lib/ts/main-bundle.js.map", 11 | file: './lib/ts/main-bundle.js', 12 | format: 'es' 13 | }, 14 | }, 15 | { 16 | input: './lib/ts/dasm.ts', 17 | plugins: [ 18 | typescript() 19 | ], 20 | output: { 21 | sourcemap: "./lib/ts/dasm-bundle.js.map", 22 | file: './lib/ts/dasm-bundle.js', 23 | format: 'es' 24 | }, 25 | }, 26 | ] 27 | -------------------------------------------------------------------------------- /docs/asmjs/examples/sierpinski/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; This code is non-functional in the original emulator 5 | ; it doesn't like the 6 | ; eor ($0,x) 7 | ; line 8 | ; So I can't tell what it does or if this one does the same. 9 | 10 | ; Sierpinski 11 | ; Submitted by Anonymous 12 | 13 | start: 14 | lda #$e1 15 | sta $0 16 | lda #$01 17 | sta $1 18 | ldy #$20 19 | 20 | write: 21 | ldx #$00 22 | eor ($0,x) 23 | sta ($0),y 24 | 25 | inc $0 26 | bne write 27 | inc $1 28 | ldx $1 29 | cpx #$06 30 | bne write 31 | 32 | rts 33 | -------------------------------------------------------------------------------- /docs/wasm/examples/sierpinski/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; This code is non-functional in the original emulator 5 | ; it doesn't like the 6 | ; eor ($0,x) 7 | ; line 8 | ; So I can't tell what it does or if this one does the same. 9 | 10 | ; Sierpinski 11 | ; Submitted by Anonymous 12 | 13 | start: 14 | lda #$e1 15 | sta $0 16 | lda #$01 17 | sta $1 18 | ldy #$20 19 | 20 | write: 21 | ldx #$00 22 | eor ($0,x) 23 | sta ($0),y 24 | 25 | inc $0 26 | bne write 27 | inc $1 28 | ldx $1 29 | cpx #$06 30 | bne write 31 | 32 | rts 33 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/sierpinski/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; This code is non-functional in the original emulator 5 | ; it doesn't like the 6 | ; eor ($0,x) 7 | ; line 8 | ; So I can't tell what it does or if this one does the same. 9 | 10 | ; Sierpinski 11 | ; Submitted by Anonymous 12 | 13 | start: 14 | lda #$e1 15 | sta $0 16 | lda #$01 17 | sta $1 18 | ldy #$20 19 | 20 | write: 21 | ldx #$00 22 | eor ($0,x) 23 | sta ($0),y 24 | 25 | inc $0 26 | bne write 27 | inc $1 28 | ldx $1 29 | cpx #$06 30 | bne write 31 | 32 | rts 33 | -------------------------------------------------------------------------------- /sources/dasm/research/get_set_progname.c: -------------------------------------------------------------------------------- 1 | /* 2 | Test potentially unportable get/setprogname(3) functions. 3 | 4 | WORKS: 5 | OS X 6 | BREAKS: 7 | Linux, Solaris 8 | TODO: 9 | Windows, NetBSD, ... 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | printf("argv[0] == %s\n", argv[0]); 18 | printf("before setprogname(): getprogname() == %s\n", getprogname()); 19 | setprogname(argv[0]); 20 | printf("after setprogname(): getprogname() == %s\n", getprogname()); 21 | return EXIT_SUCCESS; 22 | } 23 | -------------------------------------------------------------------------------- /sources/dasm/doc/ftohex.txt: -------------------------------------------------------------------------------- 1 | 2 | FTOHEX Convert assembly output file to INTEL-HEX format suitable for, say, 3 | a GTEK prom programmer. 4 | 5 | ftohex format infile outfile 6 | 7 | Example: 8 | dasm -f2 example.asm -oexample.out 9 | ftohex 2 example.out example.hex 10 | 11 | This program converts and output file generated by DASM to the Intel 12 | hex-ascii format. You must specify the format you used when you 13 | assembled the source for FTOHEX to properly read the out file. 14 | Generally format 2 is used for assembly (see dasm.txt) as this 15 | generates the smallest hex file. 16 | 17 | -------------------------------------------------------------------------------- /sources/dasm/test/define_echo.asm: -------------------------------------------------------------------------------- 1 | ; Test case for -D and -M options and echo pseudo-op. 2 | 3 | SOURCE_SYMBOL equ 255 4 | IMPROPER_SYMBOL equ 127 5 | 6 | processor 6502 7 | echo "Defined in source file:" 8 | echo SOURCE_SYMBOL 9 | echo "Defined improperly in source file:" 10 | echo IMPROPER_SYMBOL 11 | echo "Defined externally with -D and default:" 12 | echo EXTERNAL_D_DEFAULT 13 | echo "Defined externally with -D and 127:" 14 | echo EXTERNAL_D_VALUE 15 | echo "Defined externally with -M and default:" 16 | echo EXTERNAL_M_DEFAULT 17 | echo "Defined externally with -M and 127:" 18 | echo EXTERNAL_M_VALUE 19 | end 20 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/starfield2d.asm: -------------------------------------------------------------------------------- 1 | ; 2d starfield 2 | ; Submitted by Anonymous 3 | 4 | i:ldx #$7 5 | g:lda $fe 6 | and #3 7 | adc #1 8 | sta $0,x 9 | lda $fe 10 | and #$1f 11 | sta $20,x 12 | dex 13 | bpl g 14 | f:lda #$00 15 | sta $80 16 | lda #$02 17 | sta $81 18 | ldx #$7 19 | l:lda $20,x 20 | pha 21 | clc 22 | sbc $00,x 23 | and #$1f 24 | sta $20,x 25 | lda $20,x 26 | tay 27 | lda #1 28 | sta ($80),y 29 | pla 30 | tay 31 | lda #0 32 | sta ($80),y 33 | lda $80 34 | clc 35 | adc #$80 36 | bne n 37 | inc $81 38 | n:sta $80 39 | dex 40 | bpl l 41 | jmp f 42 | 43 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/c_src/machine.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | //6502 CPU registers 8 | extern uint16_t pc; 9 | extern uint8_t sp, a, x, y, status; 10 | extern void reset6502(void); 11 | extern uint32_t clockticks6502; 12 | 13 | extern void step6502(void); 14 | 15 | extern bool cpu_halted; 16 | 17 | 18 | void js_step6502(uint16_t *buf, int len); 19 | uint8_t read6502(uint16_t address); 20 | void write6502(uint16_t address, uint8_t value); 21 | void testrun(); 22 | void boot_machine(); 23 | void bin_to_ram(unsigned char *stream, int bufz); 24 | -------------------------------------------------------------------------------- /sources/ts_common/scale-element.ts: -------------------------------------------------------------------------------- 1 | export const scaleElement = (conWidth: number, conHeight: number, canvas: HTMLElement) => { 2 | // Go back to full size 3 | canvas.style.transform = `translate(0px, 0px) scale(1)`; 4 | 5 | const minDimension = Math.min(conWidth, conHeight); 6 | 7 | const newScale = minDimension / canvas.offsetWidth; 8 | const newHeight = canvas.offsetHeight * newScale; 9 | const newWidth = canvas.offsetWidth * newScale; 10 | 11 | const offsetWidth = (canvas.offsetWidth - newWidth) / 2; 12 | const offsetHeight = (canvas.offsetHeight - newHeight) / 2; 13 | 14 | canvas.style.transform = `translate(${-offsetWidth}px, ${-offsetHeight}px) scale(${newScale})`; 15 | } 16 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/triangles.asm: -------------------------------------------------------------------------------- 1 | ; Sierpinski-like triangles 2 | ; Submitted by Anonymous 3 | 4 | start: 5 | ldx #0 6 | lda #$00 7 | sta $0 8 | lda #$02 9 | sta $1 10 | write: 11 | jsr point 12 | sta ($0,x) 13 | inc $0 14 | beq highbyte 15 | jmp write 16 | 17 | highbyte: 18 | inc $1 19 | ldy $1 20 | cpy #$06 21 | bne write 22 | rts 23 | 24 | point: 25 | lda $0 26 | and #$1f 27 | sta $2 ;x 28 | lda $0 29 | lsr 30 | lsr 31 | lsr 32 | lsr 33 | lsr 34 | sta $3 35 | lda $1 36 | sec 37 | sbc #2 38 | asl 39 | asl 40 | asl 41 | ora $3 42 | and $2 43 | beq okay 44 | lda #2 45 | rts 46 | okay: 47 | lda #13 48 | rts 49 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fantasy_console", 3 | "version": "0.0.1", 4 | "description": "6502 Fantasy Console", 5 | "main": "index.js", 6 | "dependencies": { 7 | "rollup": "^2.1.0", 8 | "tslib": "^1.11.1", 9 | "rollup-plugin-typescript": "^1.0.1", 10 | "typescript": "^3.8.3" 11 | }, 12 | "devDependencies": {}, 13 | "scripts": { 14 | "test": "echo \"Error: no test specified\" && exit 1", 15 | "fix": " rm -rf node_modules/@types/tern; ", 16 | "clean": "(cd ts; rm -f *.js *.map *.d.ts);", 17 | "make2": "tsc --project ts; rollup -c" 18 | }, 19 | "author": "Jeremy J Starcher", 20 | "license": "SEE LICENCE IN FILE" 21 | } 22 | -------------------------------------------------------------------------------- /docs/wasm/examples/starfield2d/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 2d starfield 4 | ; Submitted by Anonymous 5 | 6 | i: 7 | ldx #$7 8 | g: 9 | lda $fe 10 | and #3 11 | adc #1 12 | sta $0,x 13 | lda $fe 14 | and #$1f 15 | sta $20,x 16 | dex 17 | bpl g 18 | f: 19 | lda #$00 20 | sta $80 21 | lda #$02 22 | sta $81 23 | ldx #$7 24 | l: 25 | lda $20,x 26 | pha 27 | clc 28 | sbc $00,x 29 | and #$1f 30 | sta $20,x 31 | lda $20,x 32 | tay 33 | lda #1 34 | sta ($80),y 35 | pla 36 | tay 37 | lda #0 38 | sta ($80),y 39 | lda $80 40 | clc 41 | adc #$80 42 | bne n 43 | inc $81 44 | n: 45 | sta $80 46 | dex 47 | bpl l 48 | jmp f 49 | 50 | -------------------------------------------------------------------------------- /docs/asmjs/examples/starfield2d/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 2d starfield 4 | ; Submitted by Anonymous 5 | 6 | i: 7 | ldx #$7 8 | g: 9 | lda $fe 10 | and #3 11 | adc #1 12 | sta $0,x 13 | lda $fe 14 | and #$1f 15 | sta $20,x 16 | dex 17 | bpl g 18 | f: 19 | lda #$00 20 | sta $80 21 | lda #$02 22 | sta $81 23 | ldx #$7 24 | l: 25 | lda $20,x 26 | pha 27 | clc 28 | sbc $00,x 29 | and #$1f 30 | sta $20,x 31 | lda $20,x 32 | tay 33 | lda #1 34 | sta ($80),y 35 | pla 36 | tay 37 | lda #0 38 | sta ($80),y 39 | lda $80 40 | clc 41 | adc #$80 42 | bne n 43 | inc $81 44 | n: 45 | sta $80 46 | dex 47 | bpl l 48 | jmp f 49 | 50 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/starfield2d/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 2d starfield 4 | ; Submitted by Anonymous 5 | 6 | i: 7 | ldx #$7 8 | g: 9 | lda $fe 10 | and #3 11 | adc #1 12 | sta $0,x 13 | lda $fe 14 | and #$1f 15 | sta $20,x 16 | dex 17 | bpl g 18 | f: 19 | lda #$00 20 | sta $80 21 | lda #$02 22 | sta $81 23 | ldx #$7 24 | l: 25 | lda $20,x 26 | pha 27 | clc 28 | sbc $00,x 29 | and #$1f 30 | sta $20,x 31 | lda $20,x 32 | tay 33 | lda #1 34 | sta ($80),y 35 | pla 36 | tay 37 | lda #0 38 | sta ($80),y 39 | lda $80 40 | clc 41 | adc #$80 42 | bne n 43 | inc $81 44 | n: 45 | sta $80 46 | dex 47 | bpl l 48 | jmp f 49 | 50 | -------------------------------------------------------------------------------- /docs/asmjs/examples/triangles/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; Sierpinski-like triangles 4 | ; Submitted by Anonymous 5 | 6 | start: 7 | ldx #0 8 | lda #$00 9 | sta $0 10 | lda #$02 11 | sta $1 12 | write: 13 | jsr point 14 | sta ($0,x) 15 | inc $0 16 | beq highbyte 17 | jmp write 18 | 19 | highbyte: 20 | inc $1 21 | ldy $1 22 | cpy #$06 23 | bne write 24 | rts 25 | 26 | point: 27 | lda $0 28 | and #$1f 29 | sta $2 ;x 30 | lda $0 31 | lsr 32 | lsr 33 | lsr 34 | lsr 35 | lsr 36 | sta $3 37 | lda $1 38 | sec 39 | sbc #2 40 | asl 41 | asl 42 | asl 43 | ora $3 44 | and $2 45 | beq okay 46 | lda #2 47 | rts 48 | okay: 49 | lda #13 50 | rts 51 | -------------------------------------------------------------------------------- /docs/wasm/examples/triangles/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; Sierpinski-like triangles 4 | ; Submitted by Anonymous 5 | 6 | start: 7 | ldx #0 8 | lda #$00 9 | sta $0 10 | lda #$02 11 | sta $1 12 | write: 13 | jsr point 14 | sta ($0,x) 15 | inc $0 16 | beq highbyte 17 | jmp write 18 | 19 | highbyte: 20 | inc $1 21 | ldy $1 22 | cpy #$06 23 | bne write 24 | rts 25 | 26 | point: 27 | lda $0 28 | and #$1f 29 | sta $2 ;x 30 | lda $0 31 | lsr 32 | lsr 33 | lsr 34 | lsr 35 | lsr 36 | sta $3 37 | lda $1 38 | sec 39 | sbc #2 40 | asl 41 | asl 42 | asl 43 | ora $3 44 | and $2 45 | beq okay 46 | lda #2 47 | rts 48 | okay: 49 | lda #13 50 | rts 51 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/triangles/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; Sierpinski-like triangles 4 | ; Submitted by Anonymous 5 | 6 | start: 7 | ldx #0 8 | lda #$00 9 | sta $0 10 | lda #$02 11 | sta $1 12 | write: 13 | jsr point 14 | sta ($0,x) 15 | inc $0 16 | beq highbyte 17 | jmp write 18 | 19 | highbyte: 20 | inc $1 21 | ldy $1 22 | cpy #$06 23 | bne write 24 | rts 25 | 26 | point: 27 | lda $0 28 | and #$1f 29 | sta $2 ;x 30 | lda $0 31 | lsr 32 | lsr 33 | lsr 34 | lsr 35 | lsr 36 | sta $3 37 | lda $1 38 | sec 39 | sbc #2 40 | asl 41 | asl 42 | asl 43 | ora $3 44 | and $2 45 | beq okay 46 | lda #2 47 | rts 48 | okay: 49 | lda #13 50 | rts 51 | -------------------------------------------------------------------------------- /sources/dasm/test/fill.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; Test various directives that "fill" memory. 3 | ; 4 | ; This came about because Dennis Debro posted about .align not 5 | ; doing the right thing to the Stella list. Thomas Mathys was 6 | ; able to trace this to v_align, which uses the first value 7 | ; instead of the second as the actual fill byte. Fixed as of 8 | ; release 2.20.12 I hope. :-) 9 | ; 10 | ; Peter H. Froehlich 11 | ; phf at acm dot org 12 | 13 | .processor 6502 14 | .org 0 15 | 16 | ; .ds fills with $a5 as required, works 17 | .ds 33, $a5 ; always filled $a5 18 | ; .align fills with *align* value prior to 2.20.12 19 | .align 64, $f5 ; filled $40 <2.20.11, fills $f5 now 20 | .align 256, $5f ; filled $0 <2.20.11, fills $5f now 21 | 22 | .end 23 | -------------------------------------------------------------------------------- /sources/ide/package.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "name": "web_6502_ide", 4 | "version": "0.0.1", 5 | "description": "The Web6502 IDE", 6 | "main": "index.js", 7 | "directories": { 8 | "lib": "lib" 9 | }, 10 | "scripts": { 11 | "test": "echo \"Error: no test specified\" && exit 1", 12 | "fix": " rm -rf node_modules/@types/tern; ", 13 | "clean": "(cd lib/ts; rm -f *.js *.map *.d.ts);", 14 | "make2": "tsc --project lib/ts; rollup -c" 15 | }, 16 | "author": "Jeremy J Starcher", 17 | "license": "SEE LICENSE IN LICENSE.TXT", 18 | "devDependencies": { 19 | "@types/codemirror": "0.0.87", 20 | "rollup": "^2.1.0", 21 | "rollup-plugin-typescript": "^1.0.1", 22 | "tslib": "^1.11.1", 23 | "typescript": "^3.8.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /sources/dasm/test/negative.asm: -------------------------------------------------------------------------------- 1 | ; Test negative literals. 2 | ; 3 | ; This came about because of the "-1 bug" in 2.20.10 and 4 | ; will hopefully ensure that no such bug ever returns to 5 | ; haunt us again... 6 | ; 7 | ; Peter H. Froehlich 8 | ; phf at acm dot org 9 | 10 | .processor 6502 11 | .org 0 12 | 13 | lda #0 14 | ; lda #+0 ;syntax error? needs a FIX as well :-) 15 | lda #-0 16 | 17 | lda #1 18 | lda #-1 19 | 20 | lda #127 21 | lda #128 22 | lda #129 23 | 24 | lda #-127 25 | lda #-128 26 | lda #-129 27 | 28 | lda #254 29 | lda #255 30 | lda #256 ; should fail? does fail! 31 | 32 | lda #-254 33 | lda #-255 34 | lda #-256 ; should fail? does NOT yet fail? 35 | 36 | lda #1024 ; should fail? does fail! 37 | lda #-1024 ; should fail? does NOT yet fail? 38 | 39 | .end 40 | -------------------------------------------------------------------------------- /sources/dasm/test/fill.hex.ref: -------------------------------------------------------------------------------- 1 | :10000000A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A0 2 | :10001000A5A5A5A5A5A5A5A5A5A5A5A5A5A5A5A590 3 | :10002000A5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5D0 4 | :10003000F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F570 5 | :100040005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5FC0 6 | :100050005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5FB0 7 | :100060005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5FA0 8 | :100070005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F90 9 | :100080005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F80 10 | :100090005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F70 11 | :1000A0005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F60 12 | :1000B0005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F50 13 | :1000C0005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F40 14 | :1000D0005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F30 15 | :1000E0005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F20 16 | :1000F0005F5F5F5F5F5F5F5F5F5F5F5F5F5F5F5F10 17 | :00000001FF 18 | -------------------------------------------------------------------------------- /sources/dasm/test/channel-f/README: -------------------------------------------------------------------------------- 1 | 2 | Some DASM test cases for Channel-F software 3 | 4 | For all of these examples, I received express written permission 5 | from all authors to include the code in the DASM distribution. 6 | 7 | lights.asm 8 | Sean Riddle's Lights Out game from http://members.cox.net/seanriddle/ 9 | Ported to DASM (well, actually DASM2 :-) by Thomas Mathys 10 | lights.bin.ref 11 | Cartridge ROM by Sean Riddle from http://members.cox.net/seanriddle/ 12 | Generated with f8tool, another assembler for the F8 13 | tetris.asm 14 | Peter Trauner's Tetris game from http://members.cox.net/seanandalicia/ 15 | Ported to DASM (well, two lines were added :-) by Peter Froehlich 16 | tetris.bin.ref 17 | Cartridge ROM by Peter Trauner from http://members.cox.net/seanandalicia/ 18 | Generated with f8tool, another assembler for the F8 19 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/beta/note.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6502asm.com v1.5 RELOADED - Beta 4 | 5 | 6 | 7 |

BETA VERSION

8 |

9 | This is a BETA version of 6502asm v1.5 "RELOADED", meaning that 10 | there might be bugs and compability issues. 11 |

12 |

13 | Changelog:
14 | - CMP bug fixed
15 | - STA abs decimal fixed
16 | - Speed optimized
17 | - Slight design change
18 | - Hexdump button back
19 | - Minimal debugger now available
20 | - Larger textarea for code 21 |

22 |

23 | Internet Explorer and Opera support has been dropped for this beta, 24 | but it will be re-implemented once the system is bug free in 25 | Firefox/Safari. 26 |

27 |

28 | So, wanna play? Click here. 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sources/dasm/test/demo.asm: -------------------------------------------------------------------------------- 1 | ;;; 2 | ; 3 | ; Some useful macros and techniques 4 | ; 5 | processor 6502 6 | 7 | ;;; 8 | mac hexdig 9 | 10 | if [{1}] <= 9 11 | dc.b '0 + [{1}] 12 | else 13 | dc.b 'a + [{1}] - 10 14 | endif 15 | 16 | endm 17 | ;;; 18 | mac hexnum 19 | 20 | if [{1}] >= $10 21 | hexnum [{1}] >> 4 22 | endif 23 | hexdig [{1}] & $0F 24 | 25 | endm 26 | ;;; 27 | 28 | org 0 29 | hexnum $123ab 30 | 31 | ;;;; 32 | ; 33 | ; Using an uninitialised segment to create C-like 'struct's. 34 | ; (idea taken from IBM-370 assembler style "dummy segments") 35 | 36 | seg.u node 37 | org 0 38 | 39 | s_next ds.b 2 ; a node has a pointer to the next one 40 | s_data ds.b 2 ; and 2 bytes of data 41 | s_more ds.b 3 ; and 3 bytes of something more 42 | 43 | seg code 44 | 45 | ptr equ 42 ; dummy value 46 | ldy #s_data 47 | lda (ptr),y ; get first byte of data 48 | 49 | 50 | -------------------------------------------------------------------------------- /sources/dasm/test/longstring.hex.ref: -------------------------------------------------------------------------------- 1 | :1000000031323334353637383930313233343536AE 2 | :100010003738393031323334353637383930313298 3 | :100020003334353637383930313233343536373882 4 | :100030003930313233343536373839303132333480 5 | :100040003536373839303132333435363738393060 6 | :10005000313233343536373839303132333435365E 7 | :100060003738393031323334353637383930313248 8 | :100070003334353637383930313233343536373832 9 | :100080003930313233343536373839303132333430 10 | :100090003536373839303132333435363738393010 11 | :1000A000313233343536373839303132333435360E 12 | :1000B00037383930313233343536373839303132F8 13 | :1000C00033343536373839303132333435363738E2 14 | :1000D00039303132333435363738393031323334E0 15 | :1000E00035363738393031323334353637383930C0 16 | :1000F00031323334353637383930313233343536BE 17 | :1001000037383930313233343536373839303132A7 18 | :0801100033343536373839303D 19 | :00000001FF 20 | -------------------------------------------------------------------------------- /sources/dasm/test/supercat.asm: -------------------------------------------------------------------------------- 1 | ; Pretty horrible bug... :-/ Switching to signed instead 2 | ; of unsigned arithmetic made this easier to handle but 3 | ; bad use of .ds can still lead to huge files since DASM 4 | ; doesn't enforce an upper bound yet. And what should it 5 | ; be? Hmm... 6 | ; 7 | ; From "supercat" on the atariage.com forums, forwarded by 8 | ; Andrew Davie 2008/04/12. 9 | ; 10 | ; Peter H. Froehlich 11 | ; phf at acm dot org 12 | 13 | .processor 6502 14 | 15 | .org $7FF8 16 | .byte 1,2,3,4,5 17 | 18 | ; original line by "supercat", would produce huge files 19 | ; since the "-1" result would be interpreted as a huge 20 | ; positive number 21 | .ds $7FFC-* 22 | 23 | ; Peter's line made the problem tractable and revealed 24 | ; the actual bug, checking this with xxd clearly shows 25 | ; the -1 bit pattern 0xffffffff which unsigned is huge. 26 | .long $7FFC-* 27 | 28 | .byte 1,2,3,4,5 29 | 30 | .end 31 | -------------------------------------------------------------------------------- /sources/dasm/research/minunit_example.c: -------------------------------------------------------------------------------- 1 | /* see http://www.jera.com/techinfo/jtns/jtn002.html */ 2 | /* code modified to compile without warnings [phf] */ 3 | 4 | #include 5 | #include "minunit.h" 6 | 7 | int tests_run = 0; 8 | 9 | int foo = 7; 10 | int bar = 4; 11 | 12 | static const char * test_foo(void) { 13 | mu_assert("error, foo != 7", foo == 7); 14 | return 0; 15 | } 16 | 17 | static const char * test_bar(void) { 18 | mu_assert("error, bar != 5", bar == 5); 19 | return 0; 20 | } 21 | 22 | static const char * all_tests(void) { 23 | mu_run_test(test_foo); 24 | mu_run_test(test_bar); 25 | return 0; 26 | } 27 | 28 | int main(int argc, char **argv) { 29 | const char *result = all_tests(); 30 | if (result != 0) { 31 | printf("%s\n", result); 32 | } 33 | else { 34 | printf("ALL TESTS PASSED\n"); 35 | } 36 | printf("Tests run: %d\n", tests_run); 37 | 38 | return result != 0; 39 | } 40 | -------------------------------------------------------------------------------- /sources/dasm/test/suitef8.hex.ref: -------------------------------------------------------------------------------- 1 | :100000008E24F88889C0C1C2C3C4C5C6C7C8C9C9BF 2 | :10001000CACACBCBCCCCCDCDCECED0D1D2D3D4D5F9 3 | :10002000D6D7D8D9D9DADADBDBDCDCDDDDDEDE827F 4 | :10003000FF9CFF91FF92FF98FF94FF81FF90FF8F3D 5 | :10004000FF85FF84FF253F708D182A00022A123495 6 | :100050001A30313233343536373839393A3A3B3B56 7 | :100060003C3C3D3D3E3E1B260226FF1FA0AF291211 8 | :10007000342002776F641619505152535455565715 9 | :100080005859595A5A5B5B5C5C5D5D5E5E4041420B 10 | :1000900043444546474849494A4A4B4B4C4C4D4DD1 11 | :1000A0004E4E000102030405060711110E0E10103A 12 | :1000B0000F0F080809090D0D0A0B1D1D1E1E2181B9 13 | :1000C0008A2BF0F1F2F3F4F5F6F7F8F9F9FAFAFB06 14 | :1000D000FBFCFCFDFDFEFE22808B270227FFB0BF4C 15 | :1000E0002800002812340C1C13151214172C23405E 16 | :1000F0008CE0E1E2E3E4E5E6E7E8E9E9EAEAEBEBF4 17 | :10010000ECECEDEDEEEEECEDEE001234DEADBEEF1C 18 | :10011000001234DEADBEEF001234DEADBEEF0012D1 19 | :1001200034DEADBEEF3333333312341234DEADBEC2 20 | :05013000EFDEADBEEFA3 21 | :00000001FF 22 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/alive.asm: -------------------------------------------------------------------------------- 1 | ; I'm alive 2 | ; by PJP 3 | 4 | start: 5 | lda #15 6 | sta $0 ;xpos 7 | sta $1 ;ypos 8 | 9 | loop: 10 | lda $fe 11 | and #3 12 | cmp #0 13 | beq go_left 14 | cmp #1 15 | beq go_right 16 | cmp #2 17 | beq go_down 18 | dec $1 19 | draw: 20 | lda $1 21 | and #$1f 22 | asl 23 | tax 24 | lda ypos,x 25 | sta $2 26 | inx 27 | lda ypos,x 28 | sta $3 29 | lda $0 30 | and #$1f 31 | tay 32 | lda ($2),y 33 | tax 34 | inx 35 | txa 36 | sta ($2),y 37 | jmp loop 38 | go_down: 39 | inc $1 40 | jmp draw 41 | go_left: 42 | dec $0 43 | jmp draw 44 | go_right: 45 | inc $0 46 | jmp draw 47 | 48 | ypos: 49 | dcb $00,$02,$20,$02,$40,$02,$60,$02 50 | dcb $80,$02,$a0,$02,$c0,$02,$e0,$02 51 | dcb $00,$03,$20,$03,$40,$03,$60,$03 52 | dcb $80,$03,$a0,$03,$c0,$03,$e0,$03 53 | dcb $00,$04,$20,$04,$40,$04,$60,$04 54 | dcb $80,$04,$a0,$04,$c0,$04,$e0,$04 55 | dcb $00,$05,$20,$05,$40,$05,$60,$05 56 | dcb $80,$05,$a0,$05,$c0,$05,$e0,$05 57 | 58 | 59 | -------------------------------------------------------------------------------- /sources/dasm/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | # Install packages 4 | RUN apt update && apt upgrade -y &&\ 5 | apt install -y curl &&\ 6 | apt install -y make &&\ 7 | apt install -y unzip &&\ 8 | apt install -y git &&\ 9 | apt install -y gcc &&\ 10 | apt install -y gcc-multilib &&\ 11 | apt install -y mingw-w64 12 | 13 | #download darwin build packages 14 | RUN curl -O http://security.ubuntu.com/ubuntu/pool/universe/o/openssl098/libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb &&\ 15 | curl -O http://www.tarnyko.net/repo/apple-x86-gcc-DEBIAN-AMD64.zip &&\ 16 | unzip apple-x86-gcc-DEBIAN-AMD64.zip &&\ 17 | export DEBIAN_FRONTEND=noninteractive &&\ 18 | dpkg -i libssl0.9.8_0.9.8o-7ubuntu3.2.14.04.1_amd64.deb &&\ 19 | dpkg -i apple-uni-sdk-10.5_20110407-0.flosoft1_amd64.deb &&\ 20 | dpkg -i apple-x86-odcctools_758.159-0flosoft11_amd64.deb &&\ 21 | dpkg -i apple-x86-gcc_4.2.1~5646.1flosoft2_amd64.deb &&\ 22 | rm *.zip &&\ 23 | rm *.deb 24 | 25 | CMD /bin/bash -------------------------------------------------------------------------------- /docs/asmjs/examples/alive/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; I'm alive 5 | ; by PJP 6 | 7 | start: 8 | lda #15 9 | sta $0 ;xpos 10 | sta $1 ;ypos 11 | 12 | loop: 13 | lda $fe 14 | and #3 15 | cmp #0 16 | beq go_left 17 | cmp #1 18 | beq go_right 19 | cmp #2 20 | beq go_down 21 | dec $1 22 | draw: 23 | lda $1 24 | and #$1f 25 | asl 26 | tax 27 | lda ypos,x 28 | sta $2 29 | inx 30 | lda ypos,x 31 | sta $3 32 | lda $0 33 | and #$1f 34 | tay 35 | lda ($2),y 36 | tax 37 | inx 38 | txa 39 | sta ($2),y 40 | jmp loop 41 | go_down: 42 | inc $1 43 | jmp draw 44 | go_left: 45 | dec $0 46 | jmp draw 47 | go_right: 48 | inc $0 49 | jmp draw 50 | 51 | ypos: 52 | .byte $00,$02,$20,$02,$40,$02,$60,$02 53 | .byte $80,$02,$a0,$02,$c0,$02,$e0,$02 54 | .byte $00,$03,$20,$03,$40,$03,$60,$03 55 | .byte $80,$03,$a0,$03,$c0,$03,$e0,$03 56 | .byte $00,$04,$20,$04,$40,$04,$60,$04 57 | .byte $80,$04,$a0,$04,$c0,$04,$e0,$04 58 | .byte $00,$05,$20,$05,$40,$05,$60,$05 59 | .byte $80,$05,$a0,$05,$c0,$05,$e0,$05 60 | 61 | 62 | -------------------------------------------------------------------------------- /docs/wasm/examples/alive/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; I'm alive 5 | ; by PJP 6 | 7 | start: 8 | lda #15 9 | sta $0 ;xpos 10 | sta $1 ;ypos 11 | 12 | loop: 13 | lda $fe 14 | and #3 15 | cmp #0 16 | beq go_left 17 | cmp #1 18 | beq go_right 19 | cmp #2 20 | beq go_down 21 | dec $1 22 | draw: 23 | lda $1 24 | and #$1f 25 | asl 26 | tax 27 | lda ypos,x 28 | sta $2 29 | inx 30 | lda ypos,x 31 | sta $3 32 | lda $0 33 | and #$1f 34 | tay 35 | lda ($2),y 36 | tax 37 | inx 38 | txa 39 | sta ($2),y 40 | jmp loop 41 | go_down: 42 | inc $1 43 | jmp draw 44 | go_left: 45 | dec $0 46 | jmp draw 47 | go_right: 48 | inc $0 49 | jmp draw 50 | 51 | ypos: 52 | .byte $00,$02,$20,$02,$40,$02,$60,$02 53 | .byte $80,$02,$a0,$02,$c0,$02,$e0,$02 54 | .byte $00,$03,$20,$03,$40,$03,$60,$03 55 | .byte $80,$03,$a0,$03,$c0,$03,$e0,$03 56 | .byte $00,$04,$20,$04,$40,$04,$60,$04 57 | .byte $80,$04,$a0,$04,$c0,$04,$e0,$04 58 | .byte $00,$05,$20,$05,$40,$05,$60,$05 59 | .byte $80,$05,$a0,$05,$c0,$05,$e0,$05 60 | 61 | 62 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/alive/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | 4 | ; I'm alive 5 | ; by PJP 6 | 7 | start: 8 | lda #15 9 | sta $0 ;xpos 10 | sta $1 ;ypos 11 | 12 | loop: 13 | lda $fe 14 | and #3 15 | cmp #0 16 | beq go_left 17 | cmp #1 18 | beq go_right 19 | cmp #2 20 | beq go_down 21 | dec $1 22 | draw: 23 | lda $1 24 | and #$1f 25 | asl 26 | tax 27 | lda ypos,x 28 | sta $2 29 | inx 30 | lda ypos,x 31 | sta $3 32 | lda $0 33 | and #$1f 34 | tay 35 | lda ($2),y 36 | tax 37 | inx 38 | txa 39 | sta ($2),y 40 | jmp loop 41 | go_down: 42 | inc $1 43 | jmp draw 44 | go_left: 45 | dec $0 46 | jmp draw 47 | go_right: 48 | inc $0 49 | jmp draw 50 | 51 | ypos: 52 | .byte $00,$02,$20,$02,$40,$02,$60,$02 53 | .byte $80,$02,$a0,$02,$c0,$02,$e0,$02 54 | .byte $00,$03,$20,$03,$40,$03,$60,$03 55 | .byte $80,$03,$a0,$03,$c0,$03,$e0,$03 56 | .byte $00,$04,$20,$04,$40,$04,$60,$04 57 | .byte $80,$04,$a0,$04,$c0,$04,$e0,$04 58 | .byte $00,$05,$20,$05,$40,$05,$60,$05 59 | .byte $80,$05,$a0,$05,$c0,$05,$e0,$05 60 | 61 | 62 | -------------------------------------------------------------------------------- /sources/dasm/test/addressexpression.asm: -------------------------------------------------------------------------------- 1 | ; addressexpression - adapted from the "jentzsch3" address expression bug test. 2 | ; Original test courtesy Thomas Jentzsch. Output result code generation 3 | ; added by Mike Saarna. 4 | 5 | processor 6502 6 | ORG $100 7 | 8 | TEST_1 = (.) 9 | TEST_2 = (*) 10 | TEST_3 = (1 - .) 11 | TEST_4 = (1 - *) 12 | TEST_5 = (1 - . - 1) 13 | TEST_6 = (1 - * - 1) 14 | TEST_7 = (1 - 1 - .) 15 | TEST_8 = (1 - 1 - *) 16 | TEST_9 = (1 + *) 17 | TEST_10 = (1 + * + 1) 18 | TEST_11 = (1 + 1 + *) 19 | 20 | if TEST_1 = 256 21 | .byte $01 22 | endif 23 | if TEST_2 = 256 24 | .byte $02 25 | endif 26 | if TEST_3 = -255 27 | .byte $03 28 | endif 29 | if TEST_4 = -255 30 | .byte $04 31 | endif 32 | if TEST_5 = -256 33 | .byte $05 34 | endif 35 | if TEST_6 = -256 36 | .byte $06 37 | endif 38 | if TEST_7 = -256 39 | .byte $07 40 | endif 41 | if TEST_8 = -256 42 | .byte $08 43 | endif 44 | if TEST_9 = 257 45 | .byte $09 46 | endif 47 | if TEST_10 = 258 48 | .byte $0A 49 | endif 50 | if TEST_11 = 258 51 | .byte $0B 52 | endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /sources/dasm/test/suite68705.hex.ref: -------------------------------------------------------------------------------- 1 | :10000000A90AB90AC903E8F9E901D903E8AB0ABBAF 2 | :100010000ACB03E8FBEB01DB03E8A40AB40AC40340 3 | :10002000E8F4E401D403E84858380A78680A4757E6 4 | :10003000370A77670A24FE131725FE27FE28FE29B4 5 | :10004000FE22FE24FE2FFE2EFEA50AB50AC503E8F9 6 | :10005000F5E501D503E825FE23FE2CFE2BFE2DFE43 7 | :1000600026FE2AFE20FE21FE030AFD020AFD120AD8 8 | :10007000ADFE989A4F5F3F0A7F6F0AA10AB10AC18D 9 | :1000800003E8F1E101D103E84353330A73630AA3A0 10 | :100090000AB30AC303E8F3E30AD303E84A5A3A0A65 11 | :1000A0007A6A0AA80AB80AC803E8F8E80AD803E88E 12 | :1000B0004C5C3C0A7C6C0ABC0ACC03E8FCEC0ADC15 13 | :1000C00003E8BD0ACD03E8FDED0ADD03E8A60AB6A4 14 | :1000D0000AC603E8F6E60AD603E8AE0ABE0ACE036D 15 | :1000E000E8FEEE0ADE03E84858380A78680A445405 16 | :1000F000340A74640A4050300A70600A9DAA0ABA31 17 | :100100000ACA03E8FAEA0ADA03E84959390A7969B6 18 | :100110000A4656360A76660A9C8081A20AB20AC24C 19 | :1001200003E8F2E20AD203E8999BB70AC703E8F7AB 20 | :10013000E70AD703E8BF0ACF03E8FFEF0ADF03E8C7 21 | :10014000A00AB00AC003E8F0E00AD003E883974DA4 22 | :070150005D3D0A7D6D0A9F71 23 | :00000001FF 24 | -------------------------------------------------------------------------------- /sources/dasm/test/suite6502.hex.ref: -------------------------------------------------------------------------------- 1 | :100000006901650175017901006DE8037DE80379F7 2 | :10001000E803610171012901250135013901002D34 3 | :10002000E8033DE80339E803210131010A0601161E 4 | :10003000010EE8031EE80390FEB0FEF0FE24012C42 5 | :10004000E80330FED0FE10FE0050FE70FE18D858B7 6 | :10005000B8C901C501D501D90100CDE803DDE80328 7 | :10006000D9E803C101D101E001E401ECE803C001DA 8 | :10007000C401CCE803C601D601CEE803DEE803CA1A 9 | :10008000884901450155015901004DE8035DE80328 10 | :1000900059E80341015101E601F601EEE803FEE8EB 11 | :1000A00003E8C84C01004CE8036C01006CE8032035 12 | :1000B000010020E803A901A501B501B90100ADE8DF 13 | :1000C00003BDE803B9E803A101B101A201A601B68D 14 | :1000D00001AEE803BEE803A001A401B401ACE8034B 15 | :1000E000BCE8034A460156014EE8035EE803EA090C 16 | :1000F00001050115011901000DE8031DE80319E8C8 17 | :100100000301011101480868282A260136012EE85A 18 | :10011000033EE8036A660176016EE8037EE8034069 19 | :1001200060E901E501F501F90100EDE803FDE803EF 20 | :10013000F9E803E101F10138F878850195019901A9 21 | :10014000008DE8039DE80399E80381019101860190 22 | :1001500096018EE803840194018CE803AAA8BA8A68 23 | :020160009A986B 24 | :00000001FF 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/asmjs/ 2 | dist/wasm/ 3 | dist 4 | 5 | sources/ide/lib/ts/*.js 6 | sources/ide/lib/ts/*.map 7 | sources/ide/lib/ts/*.js.map 8 | sources/ide/lib/ts/*.d.ts 9 | 10 | sources/ts_common/*.js 11 | sources/ts_common/*.map 12 | sources/ts_common/*.js.map 13 | sources/ts_common/*.d.ts 14 | 15 | sources/ide/node_modules/ 16 | 17 | sources/systems/fantasy_console/c_src/*.o 18 | sources/systems/fantasy_console/build/* 19 | 20 | sources/v6502/*.o 21 | sources/v6502/v6502* 22 | 23 | sources/dasm/src/*.o 24 | sources/dasm/test/**/*.bin 25 | sources/dasm/test/**/*.hex 26 | sources/dasm/test/**/*.list.txt 27 | sources/dasm/bin 28 | sources/dasm/dasm 29 | sources/dasm/ftohex 30 | sources/dasm/src/dasm 31 | sources/dasm/src/ftohex 32 | 33 | sources/web_dasm/*.o 34 | sources/web_dasm/dasm-exe.* 35 | 36 | sources/systems/fantasy_console/node_modules 37 | 38 | sources/systems/fantasy_console/ts/*.js 39 | sources/systems/fantasy_console/ts/*.map 40 | sources/systems/fantasy_console/ts/*.js.map 41 | sources/systems/fantasy_console/ts/*.d.ts 42 | sources/systems/fantasy_console/asm/bios.rom 43 | sources/systems/fantasy_console/asm/bios.lst 44 | 45 | bin/dasm 46 | 47 | -------------------------------------------------------------------------------- /sources/dasm/research/fsize.c: -------------------------------------------------------------------------------- 1 | /* 2 | The issue here was to avoid fseek() and friends to get away 3 | from potential issue with how long "long" really is. So we 4 | "abuse" freopen() in append mode to get to the end of the 5 | file once we establish it exists at all with fopen() in read 6 | mode. Pretty convoluted, but probably the best way. Comments 7 | welcome! :-) 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | int file_size(const char *name, fpos_t *size) 14 | { 15 | int status = -1; 16 | FILE *f = fopen(name, "r+"); 17 | if (f != NULL) { 18 | FILE *g = freopen(NULL, "a+", f); 19 | if (g != NULL) { 20 | if (fgetpos(g, size) == 0) { 21 | status = 0; 22 | } 23 | fclose(g); 24 | } 25 | } 26 | return status; 27 | } 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | printf("Filename %s\n", argv[1]); 32 | fpos_t size; 33 | if (file_size(argv[1], &size) == 0) { 34 | printf("Length of file %s is %ld!\n", argv[1], (long)size); 35 | return EXIT_SUCCESS; 36 | } 37 | else { 38 | printf("File %s not found!\n", argv[1]); 39 | return EXIT_FAILURE; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sources/dasm/test/labelchanges.asm: -------------------------------------------------------------------------------- 1 | ; labelchanges.asm - test various cases of labels changing location in 2 | ; successive passes. Test code provided by Thomas Jentzsch. 3 | 4 | processor 6502 5 | 6 | ;=============================================================================== 7 | 8 | ; automatically decide whether to use a branch or a jump 9 | MAC BNEJ 10 | IF ({1} - .) >= -126 && ({1} - .) <= 129 11 | bne {1} 12 | ELSE 13 | beq skip$ 14 | jmp {1} 15 | skip$ 16 | ENDIF 17 | ENDM 18 | 19 | ;=============================================================================== 20 | 21 | ORG $1000 22 | 23 | BackOk 24 | ds 126, $ea 25 | BNEJ BackOk 26 | 27 | BackJmp 28 | ; this has to use "jmp" 29 | ; and is detected as such 30 | ds 126+1, $ea 31 | BNEJ BackJmp 32 | 33 | ; this can use "bne" 34 | BNEJ ForwardOk 35 | ds 127, $ea 36 | ForwardOk 37 | 38 | ; this has to use "jmp" 39 | ; and is detected as such 40 | BNEJ ForwardJmp 41 | ds 127+3, $ea 42 | ForwardJmp 43 | 44 | ; this has to use "jmp" 45 | ; and is detected as such 46 | BNEJ ForwardJmp2 47 | ds 127+2, $ea 48 | ForwardJmp2 49 | -------------------------------------------------------------------------------- /sources/v6502/machine.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "machine.hh" 9 | 10 | static uint8_t ram[64 * 1024]; 11 | static uint16_t lastAddress; 12 | static uint8_t lastValue; 13 | static uint8_t lastMode; 14 | 15 | #define SYSMAGICADDRESS (0xFFF0) 16 | 17 | uint8_t read6502(uint16_t address) 18 | { 19 | return ram[address]; 20 | } 21 | 22 | void write6502(uint16_t address, uint8_t value) 23 | { 24 | ram[address] = value; 25 | lastAddress = address; 26 | lastValue = value; 27 | lastMode = 1; 28 | } 29 | 30 | void testrun() 31 | { 32 | reset6502(); 33 | 34 | for (int i = 0; i < 100; i++) 35 | { 36 | step6502(); 37 | } 38 | } 39 | 40 | void js_step6502(uint16_t *buf, int len) 41 | { 42 | uint32_t oldticks = clockticks6502; 43 | 44 | step6502(); 45 | 46 | uint16_t ticks = clockticks6502 - oldticks; 47 | 48 | if (len >= 14) 49 | { 50 | buf[0] = pc; 51 | buf[1] = sp; 52 | buf[2] = a; 53 | buf[3] = x; 54 | buf[4] = y; 55 | buf[5] = status; 56 | buf[6] = read6502(pc); 57 | buf[7] = read6502(pc + 1); 58 | buf[8] = read6502(pc + 2); 59 | buf[9] = read6502(SYSMAGICADDRESS); 60 | buf[10] = lastAddress; 61 | buf[11] = lastValue; 62 | buf[12] = lastMode; 63 | buf[13] = ticks; 64 | 65 | lastMode = 0; 66 | } 67 | } -------------------------------------------------------------------------------- /sources/dasm/src/BUGS: -------------------------------------------------------------------------------- 1 | ==== 2 | BUGS 3 | ==== 4 | 5 | A collection of bugs that would require major DASM surgery 6 | and are unlikely to get a fix soon. If possible we offer 7 | workarounds. 8 | 9 | --------------------- 10 | Broken HD6303 Opcodes 11 | --------------------- 12 | 13 | It has been reported several times (by Alan Nash in 2008, 14 | by Rob Hookham in 2014) that the AIM, OIM, EIM, and TIM 15 | opcodes are broken. These instructions are *three* bytes 16 | long according to the data sheets, yet in DASM they are 17 | treated as *two* byte instructions. 18 | 19 | It's my understanding that the instructions are supposed 20 | to work as follows (from Rob's email): 21 | 22 | tim #$10,$C2 23 | tim #$80,$00,x 24 | 25 | So there's an immediate value *and* a zero-page address 26 | for these instructions! DASM, however, only accepts these: 27 | 28 | tim $10 29 | tim $10,x 30 | 31 | I don't know what Matthew Dillon was thinking back in the 32 | day, but in retrospect it seems obvious that these opcodes 33 | simply don't fit into the "regular pattern" of 8-bit CPUs 34 | we deal with in DASM. Fixing this will require changes to 35 | DASM beyond just fixing the instruction table, I don't 36 | think the parser code is even remotely ready for this. :-/ 37 | 38 | The "workaround" for now is to use macros instead of the 39 | actual instructions, see ../test/broken6303hack.asm for 40 | details. 41 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/backandforth.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; moves a dot back and forth 3 | ; 4 | 5 | start: 6 | lda #$f 7 | sta $0 ; Xpos = 15 8 | lda #$4 9 | sta $1 ; Ypos = $02(0f) (top line) 10 | lda #$01 11 | sta $2 ; direction (0=left, 1=right) 12 | 13 | mainloop: 14 | lda $00 ; load Xpos 15 | sta $03 ; save it.. 16 | lda $01 ; load Ypos 17 | sta $04 ; save it.. 18 | 19 | lda $02 ; check direction 20 | cmp #$00 ; left? 21 | bne notLeft 22 | inc $0 ; increment X 23 | jmp checkBounce 24 | notLeft: 25 | dec $0 ; decrement X 26 | 27 | checkBounce: 28 | ldx $02 ; regX = direction 29 | lda $0 ; load xpos 30 | cmp #$1f ; at-most right? 31 | bne notBounceLeft 32 | ldx #$1 ; go left 33 | jmp draw ; draw dot 34 | notBounceLeft: 35 | cmp #$0 ; at-most right? 36 | bne draw 37 | ldx #$0 ; go right 38 | draw: 39 | stx $02 ; update direction 40 | 41 | lda #$1 ; A=1 white color 42 | ldx #$0 43 | sta ($0,x) ; draw dot 44 | 45 | lda #$0 ; A=0 black color 46 | ldx #$0 47 | sta ($3,x) ; erase previous dot 48 | 49 | jmp mainloop ; continue forever 50 | 51 | 52 | -------------------------------------------------------------------------------- /sources/pretty6502/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Oscar Toledo G. http://nanochess.org/ 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /docs/asmjs/examples/backandforth/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; moves a dot back and forth 5 | ; 6 | 7 | start: 8 | lda #$f 9 | sta $0 ; Xpos = 15 10 | lda #$4 11 | sta $1 ; Ypos = $02(0f) (top line) 12 | lda #$01 13 | sta $2 ; direction (0=left, 1=right) 14 | 15 | mainloop: 16 | lda $00 ; load Xpos 17 | sta $03 ; save it.. 18 | lda $01 ; load Ypos 19 | sta $04 ; save it.. 20 | 21 | lda $02 ; check direction 22 | cmp #$00 ; left? 23 | bne notLeft 24 | inc $0 ; increment X 25 | jmp checkBounce 26 | notLeft: 27 | dec $0 ; decrement X 28 | 29 | checkBounce: 30 | ldx $02 ; regX = direction 31 | lda $0 ; load xpos 32 | cmp #$1f ; at-most right? 33 | bne notBounceLeft 34 | ldx #$1 ; go left 35 | jmp draw ; draw dot 36 | notBounceLeft: 37 | cmp #$0 ; at-most right? 38 | bne draw 39 | ldx #$0 ; go right 40 | draw: 41 | stx $02 ; update direction 42 | 43 | lda #$1 ; A=1 white color 44 | ldx #$0 45 | sta ($0,x) ; draw dot 46 | 47 | lda #$0 ; A=0 black color 48 | ldx #$0 49 | sta ($3,x) ; erase previous dot 50 | 51 | jmp mainloop ; continue forever 52 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | About the 6502 IDE 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /docs/wasm/examples/backandforth/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; moves a dot back and forth 5 | ; 6 | 7 | start: 8 | lda #$f 9 | sta $0 ; Xpos = 15 10 | lda #$4 11 | sta $1 ; Ypos = $02(0f) (top line) 12 | lda #$01 13 | sta $2 ; direction (0=left, 1=right) 14 | 15 | mainloop: 16 | lda $00 ; load Xpos 17 | sta $03 ; save it.. 18 | lda $01 ; load Ypos 19 | sta $04 ; save it.. 20 | 21 | lda $02 ; check direction 22 | cmp #$00 ; left? 23 | bne notLeft 24 | inc $0 ; increment X 25 | jmp checkBounce 26 | notLeft: 27 | dec $0 ; decrement X 28 | 29 | checkBounce: 30 | ldx $02 ; regX = direction 31 | lda $0 ; load xpos 32 | cmp #$1f ; at-most right? 33 | bne notBounceLeft 34 | ldx #$1 ; go left 35 | jmp draw ; draw dot 36 | notBounceLeft: 37 | cmp #$0 ; at-most right? 38 | bne draw 39 | ldx #$0 ; go right 40 | draw: 41 | stx $02 ; update direction 42 | 43 | lda #$1 ; A=1 white color 44 | ldx #$0 45 | sta ($0,x) ; draw dot 46 | 47 | lda #$0 ; A=0 black color 48 | ldx #$0 49 | sta ($3,x) ; erase previous dot 50 | 51 | jmp mainloop ; continue forever 52 | -------------------------------------------------------------------------------- /sources/dasm/test/suite6303.hex.ref: -------------------------------------------------------------------------------- 1 | :100000008B0A9B0AAB0ABB03E8CB0ADB0AEB0AFBB1 2 | :1000100003E8C303E8D30AE30AF303E81B890A9958 3 | :100020000AA90AB903E8C90AD90AE90AF903E8845E 4 | :100030000A940AA40AB403E8C40AD40AE40AF4033A 5 | :10004000E8850A950AA50AB503E8C50AD50AE50AAE 6 | :10005000F503E86F0A7F03E84F5F810A910AA10A5E 7 | :10006000B103E8C10AD10AE10AF103E811630A7396 8 | :1000700003E84353600A7003E84050196A0A7A03A0 9 | :10008000E84A5A880A980AA80AB803E8C80AD80AA7 10 | :10009000E80AF803E86C0A7C03E84C5C860A960AD6 11 | :1000A000A60AB603E8C60AD60AE60AF603E8CC03AF 12 | :1000B000E8DC0AEC0AFC03E83D8A0A9A0AAA0ABAB2 13 | :1000C00003E8CA0ADA0AEA0AFA03E8363732336979 14 | :1000D0000A7903E84959660A7603E84656680A78B9 15 | :1000E00003E8485805670A7703E84757640A74032A 16 | :1000F000E8445404970AA70AB703E8D70AE70AF7BF 17 | :1001000003E8DD0AED0AFD03E8800A900AA00AB0C0 18 | :1001100003E8C00AD00AE00AF003E88303E8930A80 19 | :10012000A30AB303E810820A920AA20AB203E8C241 20 | :100130000AD20AE20AF203E816176D0A7D03E84DB7 21 | :100140005D710A610A720A620A750A650A7B0A6BA6 22 | :100150000A8C03E89C0AAC0ABC03E809340831CED7 23 | :1001600003E8DE0AEE0AFE03E88E03E89E0AAE0A02 24 | :10017000BE03E8DF0AEF0AFF03E89F0AAF0ABF03E6 25 | :10018000E835303A3C381820FE21FE24FE25FE27B3 26 | :10019000FE2CFE2EFE22FE2FFE23FE2DFE2BFE2623 27 | :1001A000FE28FE29FE2AFE8DFE6E0A7E03E89D0AC9 28 | :1001B000AD0ABD03E8013B393F3E1A0C0E0A0D0F94 29 | :0301C0000B060724 30 | :00000001FF 31 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/backandforth/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; moves a dot back and forth 5 | ; 6 | 7 | start: 8 | lda #$f 9 | sta $0 ; Xpos = 15 10 | lda #$4 11 | sta $1 ; Ypos = $02(0f) (top line) 12 | lda #$01 13 | sta $2 ; direction (0=left, 1=right) 14 | 15 | mainloop: 16 | lda $00 ; load Xpos 17 | sta $03 ; save it.. 18 | lda $01 ; load Ypos 19 | sta $04 ; save it.. 20 | 21 | lda $02 ; check direction 22 | cmp #$00 ; left? 23 | bne notLeft 24 | inc $0 ; increment X 25 | jmp checkBounce 26 | notLeft: 27 | dec $0 ; decrement X 28 | 29 | checkBounce: 30 | ldx $02 ; regX = direction 31 | lda $0 ; load xpos 32 | cmp #$1f ; at-most right? 33 | bne notBounceLeft 34 | ldx #$1 ; go left 35 | jmp draw ; draw dot 36 | notBounceLeft: 37 | cmp #$0 ; at-most right? 38 | bne draw 39 | ldx #$0 ; go right 40 | draw: 41 | stx $02 ; update direction 42 | 43 | lda #$1 ; A=1 white color 44 | ldx #$0 45 | sta ($0,x) ; draw dot 46 | 47 | lda #$0 ; A=0 black color 48 | ldx #$0 49 | sta ($3,x) ; erase previous dot 50 | 51 | jmp mainloop ; continue forever 52 | -------------------------------------------------------------------------------- /sources/dasm/docker/make_dasm_all_platforms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # this script builds platform-specific dasm binaries for all three supported OSs (Linux, Windows and macOS) 3 | 4 | cd .. 5 | mkdir -p bin/32bit 6 | mkdir -p bin/64bit 7 | cd src 8 | 9 | #step 1: build dasm for Linux 32-bit and 64-bit 10 | make 11 | cp dasm ../bin/64bit/dasm.Linux 12 | make clean 13 | export CFLAGS=' -m32' 14 | export LDFLAGS=' -m32 -L/usr/lib32' 15 | make 16 | cp dasm ../bin/32bit/dasm.Linux 17 | make clean 18 | unset CFLAGS 19 | unset LDFLAGS 20 | 21 | #step 2: build dasm for Windows 32-bit and 64-bit 22 | export CC=x86_64-w64-mingw32-gcc 23 | #TODO: fix warnings when compiling for win64 using x86_64-w64-mingw32-gcc 24 | # the compiler warnings have to do with default size of 'long' on windows 25 | make 26 | cp dasm ../bin/64bit/dasm.exe 27 | make clean 28 | export CC=i686-w64-mingw32-gcc 29 | export CFLAGS=' -m32' 30 | export LDFLAGS=' -m32 -L/usr/lib32' 31 | make 32 | cp dasm ../bin/32bit/dasm.exe 33 | make clean 34 | unset CC 35 | unset CFLAGS 36 | unset LDFLAGS 37 | 38 | #step 3: build dasm for macOS 32-bit and 64-bit 39 | export LD=$CC 40 | export CC=i686-apple-darwin10-gcc 41 | make 42 | cp dasm ../bin/64bit/dasm.macOS 43 | make clean 44 | export CFLAGS=' -m32 -arch i386 ' 45 | export LDFLAGS=' -m32 -L/usr/i686-apple-darwin10/lib -arch i386' 46 | make 47 | cp dasm ../bin/32bit/dasm.macOS 48 | make clean 49 | unset LD 50 | unset CC 51 | unset CFLAGS 52 | unset LDFLAGS 53 | -------------------------------------------------------------------------------- /sources/dasm/test/broken6303hack.asm: -------------------------------------------------------------------------------- 1 | ; See ../src/BUGS for the details. Here's how to use macros 2 | ; to work around the issue. 3 | 4 | .processor HD6303 5 | 6 | .mac hack 7 | dc.b {1} ; opcode 8 | dc.b {2} ; immediate value 9 | dc.b {3} ; zero-page address 10 | .endm 11 | 12 | .mac aimd 13 | hack $71,{1},{2} 14 | .endm 15 | 16 | .mac aimx 17 | hack $61,{1},{2} 18 | .endm 19 | 20 | .mac oimd 21 | hack $72,{1},{2} 22 | .endm 23 | 24 | .mac oimx 25 | hack $62,{1},{2} 26 | .endm 27 | 28 | .mac eimd 29 | hack $75,{1},{2} 30 | .endm 31 | 32 | .mac eimx 33 | hack $65,{1},{2} 34 | .endm 35 | 36 | .mac timd 37 | hack $7b,{1},{2} 38 | .endm 39 | 40 | .mac timx 41 | hack $6b,{1},{2} 42 | .endm 43 | 44 | .org $0 45 | 46 | ; the broken DASM versions 47 | 48 | aim $10 ; assembles to 71 10 49 | aim $10,x ; assembles to 61 10 50 | oim $10 ; assembles to 72 10 51 | oim $10,x ; assembles to 62 10 52 | eim $10 ; assembles to 75 10 53 | eim $10,x ; assembles to 65 10 54 | tim $10 ; assembles to 7B 10 55 | tim $10,x ; assembles to 6B 10 56 | 57 | ; the fixed macro versions 58 | 59 | aimd $10,$20 ; should be "aim #$10,$20" 60 | aimx $10,$20 ; should be "aim #$10,$20,x" 61 | oimd $10,$20 ; should be "oim #$10,$20" 62 | oimx $10,$20 ; should be "oim #$10,$20,x" 63 | eimd $10,$20 ; should be "eim #$10,$20" 64 | eimx $10,$20 ; should be "eim #$10,$20,x" 65 | timd $10,$20 ; should be "tim #$10,$20" 66 | timx $10,$20 ; should be "tim #$10,$20,x" 67 | 68 | .end 69 | -------------------------------------------------------------------------------- /sources/dasm/test/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Simple test script adapted from Matt Dillon's 2.16 release. 4 | # It's harder to do this in a Makefile, so let's use a script. 5 | 6 | echo "=== build test cases (strict=off)" 7 | echo 8 | 9 | for i in *.bin.ref 10 | do 11 | i=$(echo $i | sed 's/.bin.ref/.asm/g') 12 | NAME=`basename $i .asm` 13 | echo " * $NAME" 14 | ../bin/dasm $i -f1 -o$NAME.bin -l$NAME.list.txt -DINEEPROM | \ 15 | grep -vE 'error|Complete|^?' 16 | # echo "dasm returned $?" 17 | cmp -s $NAME.bin $NAME.bin.ref 18 | if [ $? == 0 ] 19 | then 20 | echo " bin comparison: pass" 21 | else 22 | echo " bin comparison: fail" 23 | fi 24 | ../bin/ftohex 1 $NAME.bin $NAME.hex 25 | # echo "ftohex returned $?" 26 | cmp -s $NAME.hex $NAME.hex.ref 27 | if [ $? == 0 ] 28 | then 29 | echo " hex comparison: pass" 30 | else 31 | echo " hex comparison: fail" 32 | fi 33 | echo 34 | done 35 | 36 | echo "=== error test cases (strict=on)" 37 | echo 38 | # test for assembly sniplets that should fail 39 | for i in *.fail 40 | do 41 | i=$(echo $i | sed 's/.fail/.asm/g') 42 | NAME=`basename $i .asm` 43 | echo " * $NAME" 44 | ../bin/dasm $i -S -f1 -o$NAME.bin -l$NAME.list.txt -DINEEPROM 2>&1 | \ 45 | grep -vE 'error|Complete|^$' 46 | grep error $NAME.list.txt 2>&1 >/dev/null 47 | if [ $? == 0 ] 48 | then 49 | echo " error triggered: pass" 50 | else 51 | echo " error triggered: fail" 52 | fi 53 | echo 54 | done 55 | -------------------------------------------------------------------------------- /interface.ts: -------------------------------------------------------------------------------- 1 | let [m6502pc, 2 | m6502sp, 3 | m6502_rega, 4 | m6502_regx, 5 | m6502_regy, 6 | m6502_status_bits, 7 | m6502_opcode, 8 | m6502_operand1, 9 | m6502_operand2, 10 | m6502_magicValue, 11 | m6502_last_bus_address, 12 | m6502_last_bus_value, m6502_last_bus_mode, 13 | m6502_instruction_ticks 14 | ] = Array(13); 15 | 16 | dataHeap!.set(new Uint8Array(cpu_status_data.buffer)); 17 | const oldpc = m6502pc; 18 | 19 | step6502(dataHeap!.byteOffset, cpu_status_data.length); 20 | const result = new Uint16Array(dataHeap!.buffer, dataHeap!.byteOffset, cpu_status_data.length); 21 | 22 | [ 23 | m6502pc, m6502sp, m6502_rega, m6502_regx, m6502_regy, 24 | m6502_status_bits, m6502_opcode, m6502_operand1, 25 | m6502_operand2, m6502_magicValue, m6502_last_bus_address, 26 | m6502_last_bus_value, m6502_last_bus_mode, 27 | m6502_instruction_ticks 28 | ] = result; 29 | 30 | 31 | 32 | const cpu_status_data = new Uint16Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); 33 | 34 | // Get data byte size, allocate memory on Emscripten heap, and get pointer 35 | const nDataBytes = cpu_status_data.length * cpu_status_data.BYTES_PER_ELEMENT; 36 | let dataPtr = Module._malloc(nDataBytes); 37 | 38 | let dataHeap: Uint8Array | null = new Uint8Array(Module.HEAPU8.buffer, dataPtr, nDataBytes); 39 | 40 | const destroy = () => { 41 | if (dataHeap) { 42 | // Free memory 43 | Module._free(dataHeap.byteOffset); 44 | dataHeap = null; 45 | } 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /sources/dasm/test/sample.hex.ref: -------------------------------------------------------------------------------- 1 | :10FE0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF02 2 | :10FE1000FFFFFFFFFFFFFFFF0F4FB7103D97389722 3 | :10FE200035C680D7398E0009C63837373634C63FD5 4 | :10FE300037C6FF37C6FC3736C6803736C634D730AC 5 | :10FE4000972CC60CD72DC603D72BC610D72814283D 6 | :10FE5000401421151422868E039F9760976A0E86A0 7 | :10FE60003897661505108D70C1AA26F34FCE006A2B 8 | :10FE70008D6608E7001B7A006B26F54D26E18D584C 9 | :10FE8000C15526DB966C2B04916126DAD66D861659 10 | :10FE90009768CEFEE7C40E3AEE008620976C966017 11 | :10FEA000976DAD008D0220BE86099767150520CBA2 12 | :10FEB00004D76BCE006B4F152D04C6AA8D22E60029 13 | :10FEC00008107A006B26F51B168D15C6558D11137B 14 | :10FED0002E40FC142D04393E132E20FBD62F393E24 15 | :10FEE000132E80FBD72F39FF01FF10FF27FEF7FEEF 16 | :10FEF00018FEF9FEF7FEF75F39DC6E9760D7005FFA 17 | :10FF0000398601976E9661976FDC31DD70C60439D2 18 | :10FF1000DE6E18CE00715FA60018A7000818085CF6 19 | :10FF2000D17026F3CB0339CE007118DE6E20E7DEE8 20 | :10FF30006408DF641523FB3BDE6208DF621523FDE6 21 | :10FF40003B5F96348D0296333716481B3348594829 22 | :10FF50005939D6025454CE03003A8D64C4FC584932 23 | :10FF6000584924026A40E32024026C407D006A263E 24 | :10FF70000C581659A64049ED004F5FA740ED20D61A 25 | :10FF800002CB082A07966A8B02976A5FD70215236D 26 | :10FF90007FDC16C30140DD1624257A006626031493 27 | :10FFA00005107A00672603140520DE6809DF68273C 28 | :10FFB000088D8ED1612708D7617F00601505C03B91 29 | :10FFC0001402048D068D00150204177D0029D62A1F 30 | :10FFD000D72A4848474739FFFFFFFFFFFFFFFFFFD2 31 | :10FFE000FFFFFFFFFFFFFFFFFF52FE18FF38FF2F4D 32 | :10FFF000FE18FE18FE18FE18FE18FE18FE18FE1851 33 | :00000001FF 34 | -------------------------------------------------------------------------------- /sources/systems/fantasy_console/ts/fc-main.ts: -------------------------------------------------------------------------------- 1 | declare const FS: any; 2 | declare const Module: any; 3 | 4 | import { scaleElement } from "./common/scale-element"; 5 | 6 | // Don't use the resize event -- sometimes the canvas and iframe 7 | // is hidden and therefore has a size of 0. The ResizeObserver 8 | // doesn't have universal support. 9 | const r = () => { 10 | const canvas = document.querySelector("canvas") as HTMLCanvasElement; 11 | const { width, height } = (window.parent as any).GET_IFRAME_SIZE(); 12 | scaleElement(width, height, canvas); 13 | setTimeout(r, 500); 14 | }; 15 | r(); 16 | 17 | 18 | // CLOCK SPEED IN CYCLES PER SECOND 19 | const CPS = 1000000; 20 | let currentCps = CPS; 21 | 22 | 23 | const CPU_SPEEDS = (() => { 24 | const _1MHz = 1000000; 25 | const percents = [0.1, 1, 10, 25, 50, 100, 147]; 26 | return percents.map(percent => { 27 | const speed = _1MHz * (percent / 100); 28 | const words = (speed / _1MHz).toFixed(3) + " Mhz"; 29 | return { 30 | speed, 31 | words, 32 | } 33 | }); 34 | })(); 35 | 36 | window.addEventListener('message', (e: MessageEvent) => { 37 | const m = JSON.parse(e.data) as SendRomMessage; 38 | const boot_machine = Module.cwrap('boot_machine', null, ['void']); 39 | 40 | if (m.action === "send-rom") { 41 | const bin = Uint8Array.from(JSON.parse(m.json)); 42 | FS.writeFile("/file.rom", bin); 43 | boot_machine(); 44 | console.log(`Glory! Received new ROM of ${bin.length}`); 45 | } 46 | }, false); 47 | 48 | window.addEventListener("keydown", (e: KeyboardEvent) => { 49 | const write6502 = Module.cwrap('write6502', 'void', ['number', 'number']); 50 | const ascii = e.key.charCodeAt(0) 51 | console.log(ascii, e.key, e.keyCode); 52 | write6502(0xFF, ascii); 53 | }); -------------------------------------------------------------------------------- /sources/ide/favicon/readme.txt: -------------------------------------------------------------------------------- 1 | Thank you for downloading a favicon from Free Favicon! This favicon was created from an image at http://openclipart.org/ and converted to a favicon and other sizes for you to use in your projects. For more details about this image visit this page: https://openclipart.org/detail/211893/gamepad 2 | 3 | For more infomation about how you can use this image from OpenClipArt see this page: http://openclipart.org/may-clipart-be-used-comparison 4 | 5 | Here are the contents of this compressed package: 6 | 7 | * favicon.ico -- The favicon file (supports both 16*16 and 32*32 dimensions). You will need to rename this to favicon.ico and upload to your web site. 8 | 9 | * You can add a favicon to your web page by uploading favicon.ico to Root of your website and inserting the following HTML tag between the ... tags of your web page. 10 | 11 | 12 | 13 | * There are many different sized png files for use a icons for smartphones, tablets and desktop use. 14 | 15 | If you are having any problems installing your favicon we have tips on the Free Favicon blog. http://www.freefavicon.com/blog/ 16 | 17 | Thank you once again for download from Free Favicon! If you like your favicon we appreciate you taking the time to mention our service to others, blogging about us and of course by linking to us. 18 | 19 | We also encourage you to check out Backblaze online backup. We use Backblaze to backup our computers and keep our data safe. They offer a free 15 day trial and are the easiest online backup service we have used. 20 | 21 | Use this link http://www.freefavicon.com/blog/outgoing/backblaze.php to try Backblaze for Free! 22 | 23 | By signing up for Backblaze you help keep Free Favicon free! 24 | 25 | Thank you, 26 | FreeFavicon.com -------------------------------------------------------------------------------- /sources/dasm/docker/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains files & instructions to create a 'dasm build machine' 3 | Docker image that can build platform-specific dasm binaries for all three 4 | supported OSs (Linux, Windows and macOS) in a single go! 5 | 6 | Steps to create the Docker image: 7 | 8 | 0. Make sure you have Docker Desktop installed on your machine 9 | 1. Open a command prompt (Windows) or a bash shell (Linux/macOS) into this 10 | folder (i.e. containing the Dockerfile) 11 | 2. Run the command: `docker build -t dasm:build .` 12 | Note: this will download/install all build tools so takes a while. 13 | 14 | Steps to run the Docker container and build dasm for all 3 platforms: 15 | 16 | 1. Now run the container: `docker run -it --rm dasm:build`, which opens a shell 17 | to the container. 18 | Note: unless you want fetch a clone the dasm git repo and build that, it is 19 | probably easier to mount a shared drive in your docker container. 20 | On Windows, you can mount your c: drive on /mnt/c by running 21 | `docker run -it --rm -v c:\:/mnt/c dasm:build` (*) 22 | (*) This requires drive-sharing enabled in Docker Desktop, and sometimes 23 | needs this powershell command to allow that: 24 | `Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private` 25 | 2. From the container shell, cd into a shared drive that contains a local git 26 | clone of the dasm repo. Or do a 'git clone' on the container itself, e.g. 27 | `git clone --single-branch --branch master https://github.com/dasm-assembler/dasm.git` 28 | 3. cd into the dasm/docker folder from within the container shell 29 | 4. Run: `./make_dasm_all_platforms.sh` 30 | 5. This will sequentally call 'make' for all target platforms and copies the 31 | different dasm binaries into the /bin directory. 32 | -------------------------------------------------------------------------------- /sources/pretty6502/README: -------------------------------------------------------------------------------- 1 | Pretty6502 v0.5 by Oscar Toledo G. http://nanochess.org/ 2 | 3 | Executables provided for Mac OS X and Windows. 4 | 5 | Usage: 6 | pretty6502 [args] input.asm output.asm 7 | 8 | It's recommended to not use same output file as input, 9 | even if possible because there is a chance (0.0000001%) 10 | that you can DAMAGE YOUR SOURCE if Pretty6502 has 11 | undiscovered bugs. 12 | 13 | Arguments: 14 | -s0 Code in four columns (default) 15 | label: mnemonic operand comment 16 | -s1 Code in three columns 17 | label: mnemonic+operand comment 18 | 19 | -p0 Processor unknown. 20 | -p1 Processor 6502 + DASM syntax (default) 21 | -p2 Processor Z80 + tniASM syntax 22 | -p3 Processor CP1610 + as1600 syntax (Intellivision) 23 | -p4 Processor TMS9900 + xas99 syntax (TI-99/4A) 24 | 25 | -m8 Start of mnemonic column (default) 26 | -o16 Start of operand column (default) 27 | -c32 Start of comment column (default) 28 | 29 | -t8 Use tabs of size 8 to reach column 30 | -t0 Use spaces to align (default) 31 | 32 | -a0 Align comments to nearest column 33 | -a1 Comments at line start are aligned 34 | to mnemonic (default) 35 | 36 | -n4 Nesting spacing (can be any number 37 | of spaces or multiple of tab size) 38 | 39 | -l Put labels in its own line 40 | 41 | -dl Change directives to lowercase 42 | -du Change directives to uppercase 43 | -ml Change mnemonics to lowercase 44 | -mu Change mnemonics to uppercase 45 | 46 | Assumes all your labels are at start of line and there is space 47 | before mnemonic. 48 | 49 | Accepts any assembler file where ; means comment 50 | [label] mnemonic [operand] ; comment 51 | -------------------------------------------------------------------------------- /sources/dasm/src/HEADER: -------------------------------------------------------------------------------- 1 | ==================== 2 | Standard file header 3 | ==================== 4 | 5 | /* 6 | the DASM macro assembler (aka small systems cross assembler) 7 | 8 | Copyright (c) 1988-2002 by Matthew Dillon. 9 | Copyright (c) 1995 by Olaf "Rhialto" Seibert. 10 | Copyright (c) 2003-2008 by Andrew Davie. 11 | Copyright (c) 2008-2015 by Peter H. Froehlich. 12 | 13 | This program is free software; you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation; either version 2 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License along 24 | with this program; if not, write to the Free Software Foundation, Inc., 25 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 26 | */ 27 | 28 | We're sticking with Matt's 1988 claim, even though ftohex.c 29 | had a 1987 copyright originally, and Matt released version 30 | 2.0 in 1988, making a 1987 version 1.x likely. It's just not 31 | available anywhere, not even from Matt... :-/ We're also 32 | extending his copyright to 2002 compared to Andrew's release 33 | since we plan on integrating more of Matt's 2.16 stuff. 34 | 35 | Note that this header only lists the "main" maintainers and 36 | not all contributors. Those are listed in the AUTHORS file, 37 | and sometimes their contributions are in the NEWS file or 38 | other documentation. Note entirely sure that this is right, 39 | but the alternative is to have a *really* long list of 40 | copyright lines in every single file... :-/ 41 | 42 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/screenpatterns.asm: -------------------------------------------------------------------------------- 1 | ; Screen patterns 2 | ; 3 | ; Quick hack - code could obviously be improved but this produces some fun and weird patterns. 4 | ; 5 | ; Great job on the emulator! 6 | ; It reminds me of my Ohio Scientific Challenger 1P... 7 | ; 8 | ; Pete Laing 9 | 10 | ; Try hitting random keys on keyboard for 11 | 12 | ldy #$00 ; clear y index 13 | lda $fe ; get a random number, temporarily save in X 14 | loop: tax ; 15 | lda $ff ; get key from Keyboard 16 | pha ; save to stack as we mangle it displaying 17 | sta $500 ; display low nybble 18 | clc ; clear carry so we rotate in 0\'s 19 | ror ; now get low nybble 20 | ror 21 | ror 22 | ror 23 | sta $501 ; display that too 24 | pla ; get back original key from stack 25 | ; not necessary if we swapped order above... 26 | 27 | and #$0f ; extract it\'s least significant nybble 28 | sta $01 ; and save it on zero page 29 | txa ; get back random number 30 | rol ; shift to high nybble 31 | rol 32 | rol 33 | rol ; Try eor $00 below and hit p y o x f multiple times 34 | eor $01 ; Try 1 and hit a, s, d, f for fun too 35 | sta $200,y ; store to screen 36 | sta $300,y 37 | sta $400,y 38 | dey 39 | sty $540 ; show y index 40 | ; jsr delay ; slow things down if you want 41 | jmp loop 42 | 43 | delay: pha ; save regs we use for loop 44 | txa 45 | pha 46 | ldx #$ff ; count=255 47 | loop2: dex ; count=count-1 48 | lda $fe ; get a random 49 | bne loop2 ; if count!=0 back to loop2 50 | pla ; restore regs 51 | tax 52 | pla 53 | rts ; return from subroutine 54 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/rorshach.asm: -------------------------------------------------------------------------------- 1 | ; "Rorschach test" 2 | ; Not at all what it was supposed to be, 3 | ; but it turns out pretty cool and can 4 | ; create some interesting patterns. 5 | 6 | lda #8 7 | tax 8 | dr: 9 | sta $3cb,x 10 | sta $40b,x 11 | dex 12 | bpl dr 13 | sta $3f3 14 | sta $3eb 15 | 16 | lda #1 17 | sta $3ec 18 | 19 | ldx #255 20 | mk: 21 | lda $fe 22 | sta $1200,x 23 | lda $fe 24 | sta $1300,x 25 | lda $fe 26 | sta $1400,x 27 | lda $fe 28 | sta $1500,x 29 | dex 30 | cpx #$ff 31 | bne mk 32 | 33 | ; smooth it 34 | 35 | ldy #0 36 | re: 37 | lda #1 38 | sta $3ec,y 39 | 40 | ldx #255 41 | sm: 42 | lda $1201,x 43 | adc $11ff,x 44 | adc $1220,x 45 | adc $11e0,x 46 | lsr 47 | lsr 48 | sta $1200,x 49 | 50 | lda $1301,x 51 | adc $12ff,x 52 | adc $1320,x 53 | adc $12e0,x 54 | lsr 55 | lsr 56 | sta $1300,x 57 | 58 | lda $1401,x 59 | adc $13ff,x 60 | adc $1420,x 61 | adc $13e0,x 62 | lsr 63 | lsr 64 | sta $1400,x 65 | 66 | lda $1501,x 67 | adc $14ff,x 68 | adc $1520,x 69 | adc $14e0,x 70 | lsr 71 | lsr 72 | sta $1500,x 73 | 74 | dex 75 | cpx #$ff 76 | bne sm 77 | iny 78 | cpy #7 79 | bne re 80 | 81 | lda #1 82 | sta $3f0 83 | 84 | ;copy it 85 | 86 | clc 87 | ldx #255 88 | cp: 89 | lda $1200,x 90 | lsr 91 | lsr 92 | tay 93 | lda colors,y 94 | sta $200,x 95 | 96 | lda $1300,x 97 | lsr 98 | lsr 99 | tay 100 | lda colors,y 101 | sta $300,x 102 | 103 | lda $1400,x 104 | lsr 105 | lsr 106 | tay 107 | lda colors,y 108 | sta $400,x 109 | 110 | lda $1500,x 111 | lsr 112 | lsr 113 | tay 114 | lda colors,y 115 | sta $500,x 116 | 117 | dex 118 | cpx #$ff 119 | bne cp 120 | rts 121 | 122 | colors: 123 | dcb 0,0,0,0,0,$9,$9,1,1,0,0,0,0,0 124 | 125 | -------------------------------------------------------------------------------- /sources/web_dasm/wasm_main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | extern int main(int argc, char **argv); 11 | 12 | void create_file_name(char *buffer, char *prefix, char *filename, char *ext) 13 | { 14 | strcpy(buffer, prefix); 15 | strcat(buffer, filename); 16 | strcat(buffer, "."); 17 | strcat(buffer, ext); 18 | } 19 | 20 | void EMSCRIPTEN_KEEPALIVE wasm_main(char *filename, int output_format) 21 | { 22 | /* 23 | const cmdargs = [ 24 | 0 `dasm`, 25 | 1 `$ { filename }`, // Source file 26 | 2 `- o${filename}.bin`, // output file name (else a.out) 27 | 3 `- l${filename}.lst`, // list file name (else none generated) 28 | 4 `- L${filename}.lng`, // list file name, containing all passes 29 | 5 `- s${filename}.sym`, // symbol dump file name (else none generated) 30 | 6 `- f2`, // output format 1-3 (default 1, see below) 31 | ]; 32 | */ 33 | 34 | char source_file[100]; 35 | create_file_name(source_file, "", filename, "asm"); 36 | 37 | char dest[100]; 38 | create_file_name(dest, "-o", filename, "bin"); 39 | 40 | char list[100]; 41 | create_file_name(list, "-l", filename, "lst"); 42 | 43 | char sym[100]; 44 | create_file_name(sym, "-s", filename, "sym"); 45 | 46 | char errorFormat[10]; 47 | strcpy(errorFormat, "-E2"); 48 | 49 | char format[10]; 50 | strcpy(format, "-f0"); 51 | format[2] = '0' + output_format; 52 | 53 | char *argv[] = { 54 | &source_file[0], 55 | &source_file[0], 56 | &dest[0], 57 | &list[0], 58 | // &lng[0], 59 | &sym[0], 60 | &format[0], 61 | &errorFormat[0], 62 | NULL}; 63 | 64 | int argc = (int)(sizeof(argv) / sizeof(argv[0])) - 1; 65 | 66 | main(argc, argv); 67 | } 68 | 69 | int string_len(char *p) 70 | { 71 | return strlen(p); 72 | } 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | -------------------------------------------------------------------------------- /docs/asmjs/examples/screenpatterns/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; Screen patterns 4 | ; 5 | ; Quick hack - code could obviously be improved but this produces some fun and weird patterns. 6 | ; 7 | ; Great job on the emulator! 8 | ; It reminds me of my Ohio Scientific Challenger 1P... 9 | ; 10 | ; Pete Laing 11 | 12 | ; Try hitting random keys on keyboard for 13 | 14 | ldy #$00 ; clear y index 15 | lda $fe ; get a random number, temporarily save in X 16 | loop: tax ; 17 | lda $ff ; get key from Keyboard 18 | pha ; save to stack as we mangle it displaying 19 | sta $500 ; display low nybble 20 | clc ; clear carry so we rotate in 0\'s 21 | ror ; now get low nybble 22 | ror 23 | ror 24 | ror 25 | sta $501 ; display that too 26 | pla ; get back original key from stack 27 | ; not necessary if we swapped order above... 28 | 29 | and #$0f ; extract it\'s least significant nybble 30 | sta $01 ; and save it on zero page 31 | txa ; get back random number 32 | rol ; shift to high nybble 33 | rol 34 | rol 35 | rol ; Try eor $00 below and hit p y o x f multiple times 36 | eor $01 ; Try 1 and hit a, s, d, f for fun too 37 | sta $200,y ; store to screen 38 | sta $300,y 39 | sta $400,y 40 | dey 41 | sty $540 ; show y index 42 | ; jsr delay ; slow things down if you want 43 | jmp loop 44 | 45 | delay: pha ; save regs we use for loop 46 | txa 47 | pha 48 | ldx #$ff ; count=255 49 | loop2: dex ; count=count-1 50 | lda $fe ; get a random 51 | bne loop2 ; if count!=0 back to loop2 52 | pla ; restore regs 53 | tax 54 | pla 55 | rts ; return from subroutine 56 | -------------------------------------------------------------------------------- /docs/wasm/examples/screenpatterns/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; Screen patterns 4 | ; 5 | ; Quick hack - code could obviously be improved but this produces some fun and weird patterns. 6 | ; 7 | ; Great job on the emulator! 8 | ; It reminds me of my Ohio Scientific Challenger 1P... 9 | ; 10 | ; Pete Laing 11 | 12 | ; Try hitting random keys on keyboard for 13 | 14 | ldy #$00 ; clear y index 15 | lda $fe ; get a random number, temporarily save in X 16 | loop: tax ; 17 | lda $ff ; get key from Keyboard 18 | pha ; save to stack as we mangle it displaying 19 | sta $500 ; display low nybble 20 | clc ; clear carry so we rotate in 0\'s 21 | ror ; now get low nybble 22 | ror 23 | ror 24 | ror 25 | sta $501 ; display that too 26 | pla ; get back original key from stack 27 | ; not necessary if we swapped order above... 28 | 29 | and #$0f ; extract it\'s least significant nybble 30 | sta $01 ; and save it on zero page 31 | txa ; get back random number 32 | rol ; shift to high nybble 33 | rol 34 | rol 35 | rol ; Try eor $00 below and hit p y o x f multiple times 36 | eor $01 ; Try 1 and hit a, s, d, f for fun too 37 | sta $200,y ; store to screen 38 | sta $300,y 39 | sta $400,y 40 | dey 41 | sty $540 ; show y index 42 | ; jsr delay ; slow things down if you want 43 | jmp loop 44 | 45 | delay: pha ; save regs we use for loop 46 | txa 47 | pha 48 | ldx #$ff ; count=255 49 | loop2: dex ; count=count-1 50 | lda $fe ; get a random 51 | bne loop2 ; if count!=0 back to loop2 52 | pla ; restore regs 53 | tax 54 | pla 55 | rts ; return from subroutine 56 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/screenpatterns/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; Screen patterns 4 | ; 5 | ; Quick hack - code could obviously be improved but this produces some fun and weird patterns. 6 | ; 7 | ; Great job on the emulator! 8 | ; It reminds me of my Ohio Scientific Challenger 1P... 9 | ; 10 | ; Pete Laing 11 | 12 | ; Try hitting random keys on keyboard for 13 | 14 | ldy #$00 ; clear y index 15 | lda $fe ; get a random number, temporarily save in X 16 | loop: tax ; 17 | lda $ff ; get key from Keyboard 18 | pha ; save to stack as we mangle it displaying 19 | sta $500 ; display low nybble 20 | clc ; clear carry so we rotate in 0\'s 21 | ror ; now get low nybble 22 | ror 23 | ror 24 | ror 25 | sta $501 ; display that too 26 | pla ; get back original key from stack 27 | ; not necessary if we swapped order above... 28 | 29 | and #$0f ; extract it\'s least significant nybble 30 | sta $01 ; and save it on zero page 31 | txa ; get back random number 32 | rol ; shift to high nybble 33 | rol 34 | rol 35 | rol ; Try eor $00 below and hit p y o x f multiple times 36 | eor $01 ; Try 1 and hit a, s, d, f for fun too 37 | sta $200,y ; store to screen 38 | sta $300,y 39 | sta $400,y 40 | dey 41 | sty $540 ; show y index 42 | ; jsr delay ; slow things down if you want 43 | jmp loop 44 | 45 | delay: pha ; save regs we use for loop 46 | txa 47 | pha 48 | ldx #$ff ; count=255 49 | loop2: dex ; count=count-1 50 | lda $fe ; get a random 51 | bne loop2 ; if count!=0 back to loop2 52 | pla ; restore regs 53 | tax 54 | pla 55 | rts ; return from subroutine 56 | -------------------------------------------------------------------------------- /docs/wasm/examples/rorshach/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; "Rorschach test" 4 | ; Not at all what it was supposed to be, 5 | ; but it turns out pretty cool and can 6 | ; create some interesting patterns. 7 | 8 | lda #8 9 | tax 10 | dr: 11 | sta $3cb,x 12 | sta $40b,x 13 | dex 14 | bpl dr 15 | sta $3f3 16 | sta $3eb 17 | 18 | lda #1 19 | sta $3ec 20 | 21 | ldx #255 22 | mk: 23 | lda $fe 24 | sta $1200,x 25 | lda $fe 26 | sta $1300,x 27 | lda $fe 28 | sta $1400,x 29 | lda $fe 30 | sta $1500,x 31 | dex 32 | cpx #$ff 33 | bne mk 34 | 35 | ; smooth it 36 | 37 | ldy #0 38 | re: 39 | lda #1 40 | sta $3ec,y 41 | 42 | ldx #255 43 | sm: 44 | lda $1201,x 45 | adc $11ff,x 46 | adc $1220,x 47 | adc $11e0,x 48 | lsr 49 | lsr 50 | sta $1200,x 51 | 52 | lda $1301,x 53 | adc $12ff,x 54 | adc $1320,x 55 | adc $12e0,x 56 | lsr 57 | lsr 58 | sta $1300,x 59 | 60 | lda $1401,x 61 | adc $13ff,x 62 | adc $1420,x 63 | adc $13e0,x 64 | lsr 65 | lsr 66 | sta $1400,x 67 | 68 | lda $1501,x 69 | adc $14ff,x 70 | adc $1520,x 71 | adc $14e0,x 72 | lsr 73 | lsr 74 | sta $1500,x 75 | 76 | dex 77 | cpx #$ff 78 | bne sm 79 | iny 80 | cpy #7 81 | bne re 82 | 83 | lda #1 84 | sta $3f0 85 | 86 | ;copy it 87 | 88 | clc 89 | ldx #255 90 | cp: 91 | lda $1200,x 92 | lsr 93 | lsr 94 | tay 95 | lda colors,y 96 | sta $200,x 97 | 98 | lda $1300,x 99 | lsr 100 | lsr 101 | tay 102 | lda colors,y 103 | sta $300,x 104 | 105 | lda $1400,x 106 | lsr 107 | lsr 108 | tay 109 | lda colors,y 110 | sta $400,x 111 | 112 | lda $1500,x 113 | lsr 114 | lsr 115 | tay 116 | lda colors,y 117 | sta $500,x 118 | 119 | dex 120 | cpx #$ff 121 | bne cp 122 | rts 123 | 124 | colors: 125 | .byte 0,0,0,0,0,$9,$9,1,1,0,0,0,0,0 126 | 127 | -------------------------------------------------------------------------------- /docs/asmjs/examples/rorshach/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; "Rorschach test" 4 | ; Not at all what it was supposed to be, 5 | ; but it turns out pretty cool and can 6 | ; create some interesting patterns. 7 | 8 | lda #8 9 | tax 10 | dr: 11 | sta $3cb,x 12 | sta $40b,x 13 | dex 14 | bpl dr 15 | sta $3f3 16 | sta $3eb 17 | 18 | lda #1 19 | sta $3ec 20 | 21 | ldx #255 22 | mk: 23 | lda $fe 24 | sta $1200,x 25 | lda $fe 26 | sta $1300,x 27 | lda $fe 28 | sta $1400,x 29 | lda $fe 30 | sta $1500,x 31 | dex 32 | cpx #$ff 33 | bne mk 34 | 35 | ; smooth it 36 | 37 | ldy #0 38 | re: 39 | lda #1 40 | sta $3ec,y 41 | 42 | ldx #255 43 | sm: 44 | lda $1201,x 45 | adc $11ff,x 46 | adc $1220,x 47 | adc $11e0,x 48 | lsr 49 | lsr 50 | sta $1200,x 51 | 52 | lda $1301,x 53 | adc $12ff,x 54 | adc $1320,x 55 | adc $12e0,x 56 | lsr 57 | lsr 58 | sta $1300,x 59 | 60 | lda $1401,x 61 | adc $13ff,x 62 | adc $1420,x 63 | adc $13e0,x 64 | lsr 65 | lsr 66 | sta $1400,x 67 | 68 | lda $1501,x 69 | adc $14ff,x 70 | adc $1520,x 71 | adc $14e0,x 72 | lsr 73 | lsr 74 | sta $1500,x 75 | 76 | dex 77 | cpx #$ff 78 | bne sm 79 | iny 80 | cpy #7 81 | bne re 82 | 83 | lda #1 84 | sta $3f0 85 | 86 | ;copy it 87 | 88 | clc 89 | ldx #255 90 | cp: 91 | lda $1200,x 92 | lsr 93 | lsr 94 | tay 95 | lda colors,y 96 | sta $200,x 97 | 98 | lda $1300,x 99 | lsr 100 | lsr 101 | tay 102 | lda colors,y 103 | sta $300,x 104 | 105 | lda $1400,x 106 | lsr 107 | lsr 108 | tay 109 | lda colors,y 110 | sta $400,x 111 | 112 | lda $1500,x 113 | lsr 114 | lsr 115 | tay 116 | lda colors,y 117 | sta $500,x 118 | 119 | dex 120 | cpx #$ff 121 | bne cp 122 | rts 123 | 124 | colors: 125 | .byte 0,0,0,0,0,$9,$9,1,1,0,0,0,0,0 126 | 127 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/rorshach/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; "Rorschach test" 4 | ; Not at all what it was supposed to be, 5 | ; but it turns out pretty cool and can 6 | ; create some interesting patterns. 7 | 8 | lda #8 9 | tax 10 | dr: 11 | sta $3cb,x 12 | sta $40b,x 13 | dex 14 | bpl dr 15 | sta $3f3 16 | sta $3eb 17 | 18 | lda #1 19 | sta $3ec 20 | 21 | ldx #255 22 | mk: 23 | lda $fe 24 | sta $1200,x 25 | lda $fe 26 | sta $1300,x 27 | lda $fe 28 | sta $1400,x 29 | lda $fe 30 | sta $1500,x 31 | dex 32 | cpx #$ff 33 | bne mk 34 | 35 | ; smooth it 36 | 37 | ldy #0 38 | re: 39 | lda #1 40 | sta $3ec,y 41 | 42 | ldx #255 43 | sm: 44 | lda $1201,x 45 | adc $11ff,x 46 | adc $1220,x 47 | adc $11e0,x 48 | lsr 49 | lsr 50 | sta $1200,x 51 | 52 | lda $1301,x 53 | adc $12ff,x 54 | adc $1320,x 55 | adc $12e0,x 56 | lsr 57 | lsr 58 | sta $1300,x 59 | 60 | lda $1401,x 61 | adc $13ff,x 62 | adc $1420,x 63 | adc $13e0,x 64 | lsr 65 | lsr 66 | sta $1400,x 67 | 68 | lda $1501,x 69 | adc $14ff,x 70 | adc $1520,x 71 | adc $14e0,x 72 | lsr 73 | lsr 74 | sta $1500,x 75 | 76 | dex 77 | cpx #$ff 78 | bne sm 79 | iny 80 | cpy #7 81 | bne re 82 | 83 | lda #1 84 | sta $3f0 85 | 86 | ;copy it 87 | 88 | clc 89 | ldx #255 90 | cp: 91 | lda $1200,x 92 | lsr 93 | lsr 94 | tay 95 | lda colors,y 96 | sta $200,x 97 | 98 | lda $1300,x 99 | lsr 100 | lsr 101 | tay 102 | lda colors,y 103 | sta $300,x 104 | 105 | lda $1400,x 106 | lsr 107 | lsr 108 | tay 109 | lda colors,y 110 | sta $400,x 111 | 112 | lda $1500,x 113 | lsr 114 | lsr 115 | tay 116 | lda colors,y 117 | sta $500,x 118 | 119 | dex 120 | cpx #$ff 121 | bne cp 122 | rts 123 | 124 | colors: 125 | .byte 0,0,0,0,0,$9,$9,1,1,0,0,0,0,0 126 | 127 | -------------------------------------------------------------------------------- /sources/dasm/test/string_conversion.asm: -------------------------------------------------------------------------------- 1 | ; Bug in string conversion. 2 | ; Reported 2007/08/25 by Eduardo Casino Almao 3 | 4 | ; I've found a bug in the string conversion feature ([exp]d) I'm using 5 | ; version 2.20.10b 6 | ; 7 | ; Basically, if exp is a not-yet-resolved label, the assembler aborts with 8 | ; "program.a: (XX): error Label mismatch... 9 | 10 | processor 6502 11 | 12 | org $0801 13 | 14 | word endprg ; pointer to next line 15 | word 1968 ; line number 16 | byte $9e ; SYS token 17 | byte [start]d ; ASCII of SYS address 18 | byte " TESTPROG BY TESTSOFT" ; Show copyright 19 | endprg byte 0,0,0 ; End of BASIC program 20 | 21 | start rts 22 | 23 | ; The assembler outputs: 24 | ; 25 | ; DASM V2.20.10, Macro Assembler (C)1988-2004 26 | ; testcase.a (13): error: Label mismatch... 27 | ; --> endprg 081c 28 | ; testcase.a (16): error: Label mismatch... 29 | ; --> start 081f 30 | ; Unrecoverable error(s) in pass, aborting assembly! 31 | ; Complete. 32 | ; 33 | ; The offending code is in symbols.c, lines 203 to 210. I think that there 34 | ; should be an extra condition, so if in the previous pass it has been a 35 | ; string conversion, just go for another pass. 36 | ; 37 | ; -----CUT----- 38 | ; /* 39 | ; * If we had an unevaluated IF expression in the 40 | ; * previous pass, don't complain about phase errors 41 | ; * too loudly. 42 | ; */ 43 | ; 203 if (F_verbose >= 1 || !(Redo_if & (REASON_OBSCURE))) 44 | ; { 45 | ; char sBuffer[ MAX_SYM_LEN * 2 ]; 46 | ; sprintf( sBuffer, "%s %s", sym->name, sftos( sym->value, 0 ) ); 47 | ; /*, sftos(sym->value, 48 | ; sym->flags) ); , sftos(pc, cflags & 7));*/ 49 | ; asmerr( ERROR_LABEL_MISMATCH, false, sBuffer ); 50 | ; 210 } 51 | ; ++Redo; 52 | ; Redo_why |= REASON_PHASE_ERROR; 53 | ; -----CUT----- 54 | -------------------------------------------------------------------------------- /sources/dasm/test/labelchanges.hex.ref: -------------------------------------------------------------------------------- 1 | :10100000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA40 2 | :10101000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA30 3 | :10102000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA20 4 | :10103000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA10 5 | :10104000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA00 6 | :10105000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAF0 7 | :10106000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAE0 8 | :10107000EAEAEAEAEAEAEAEAEAEAEAEAEAEAD08054 9 | :10108000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAC0 10 | :10109000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAB0 11 | :1010A000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAA0 12 | :1010B000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA90 13 | :1010C000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA80 14 | :1010D000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA70 15 | :1010E000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA60 16 | :1010F000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAF04A 17 | :10110000034C8010D07FEAEAEAEAEAEAEAEAEAEA8D 18 | :10111000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA2F 19 | :10112000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA1F 20 | :10113000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA0F 21 | :10114000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAFF 22 | :10115000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEF 23 | :10116000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEADF 24 | :10117000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEACF 25 | :10118000EAEAEAEAEAF0034C0C12EAEAEAEAEAEAF4 26 | :10119000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAAF 27 | :1011A000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA9F 28 | :1011B000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA8F 29 | :1011C000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA7F 30 | :1011D000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA6F 31 | :1011E000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA5F 32 | :1011F000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA4F 33 | :10120000EAEAEAEAEAEAEAEAEAEAEAEAF0034C9215 34 | :1012100012EAEAEAEAEAEAEAEAEAEAEAEAEAEAEA06 35 | :10122000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA1E 36 | :10123000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEA0E 37 | :10124000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAFE 38 | :10125000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEE 39 | :10126000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEADE 40 | :10127000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEACE 41 | :10128000EAEAEAEAEAEAEAEAEAEAEAEAEAEAEAEABE 42 | :02129000EAEA88 43 | :00000001FF 44 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/splashscreen.asm: -------------------------------------------------------------------------------- 1 | ; This is just a simple example 2 | ; to show how you can implement 3 | ; "splash screens" to your programs 4 | ; 5 | ; Notice that you don't have to 6 | ; press the "Run" button to see 7 | ; the results. 8 | ; 9 | ; This makes a nice "cover art" to 10 | ; your program. 11 | ; 12 | ; (Any takers on the Last Ninja game? ;)) 13 | 14 | start: 15 | rts ; just exit nicely 16 | 17 | *=$2e0 18 | dcb 0,0,0,0,9,9,15,15,8,2,8,9,0,0,0,0 19 | dcb 0,0,0,9,9,8,2,8,15,9,9,9,0,0,0,0 20 | dcb 0,0,0,0,0,0,0,0,9,8,15,15,8,15,8,9 21 | dcb 9,15,15,15,8,8,9,0,0,0,0,0,0,0,0,0 22 | dcb 0,0,0,0,9,9,0,0,0,0,0,9,8,15,8,15 23 | dcb 8,15,8,9,0,0,0,0,0,0,0,0,0,0,0,0 24 | dcb 0,0,8,15,15,15,15,15,9,0,0,0,0,9,8,15 25 | dcb 8,9,0,0,0,0,9,8,15,15,15,15,8,8,0,0 26 | dcb 0,8,9,9,0,0,9,15,15,8,2,0,0,0,8,15 27 | dcb 8,0,0,0,9,8,15,15,15,9,0,9,9,8,8,0 28 | dcb 9,0,0,15,9,9,0,9,0,0,0,9,0,0,8,8 29 | dcb 8,2,0,9,0,9,0,9,9,0,8,15,15,0,2,9 30 | dcb 8,8,9,15,15,8,0,9,8,15,15,0,9,0,8,15 31 | dcb 15,8,0,9,15,15,9,8,0,9,8,15,15,8,8,8 32 | dcb 15,8,15,15,15,15,15,15,15,15,15,15,9,2,15,15 33 | dcb 15,8,9,9,15,15,15,15,15,15,15,15,15,15,15,8 34 | dcb 8,8,8,15,15,15,8,8,8,2,9,9,9,9,9,15 35 | dcb 9,9,9,9,0,2,8,8,8,15,15,15,15,15,8,2 36 | dcb 0,0,9,9,9,9,9,9,9,0,15,0,0,9,0,0 37 | dcb 0,0,9,0,0,9,0,0,9,9,15,9,9,0,0,0 38 | dcb 0,0,0,15,9,0,0,15,0,0,15,0,0,0,15,9 39 | dcb 0,0,15,0,0,15,0,0,0,0,9,0,9,0,0,0 40 | dcb 0,0,0,15,0,15,9,10,0,0,15,9,0,0,15,0 41 | dcb 15,9,10,0,0,15,9,0,0,9,15,0,15,9,0,0 42 | dcb 0,0,0,15,9,0,15,10,2,0,10,2,0,0,15,9 43 | dcb 0,15,10,2,0,15,15,0,0,15,2,0,0,15,2,0 44 | dcb 0,0,0,10,2,0,2,10,2,0,10,10,0,0,10,2 45 | dcb 0,2,10,2,0,2,10,0,0,10,2,9,2,2,10,2 46 | dcb 0,0,0,10,10,0,0,10,10,0,10,10,10,2,10,10 47 | dcb 0,0,10,10,0,10,10,2,10,10,0,0,0,2,10,2 48 | dcb 0,0,2,10,10,0,0,2,2,0,0,2,0,10,10,2 49 | dcb 0,0,2,0,2,10,10,2,2,2,0,0,0,2,10,10 50 | dcb 0,0,2,10,2,0,0,0,0,0,0,0,0,10,10,2 51 | dcb 0,0,0,0,10,10,10,0,0,0,0,0,0,2,10,2 52 | 53 | -------------------------------------------------------------------------------- /sources/dasm/research/sizeof.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple sizeof experiment to judge appropriate types to replace 3 | the DASM chaos with. Looks like we can easily go for "int" all 4 | over the place these days. If we want to be compatible with 16 5 | bit machines like the Amiga, we may want to go for "long". The 6 | best choice might be to typedef "int32_t" to a usable name and 7 | stick with that, then we'd only rule out some 8 bit machines. 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #define S(type) printf("sizeof(" #type ") == %d\n", sizeof(type)) 16 | 17 | int main(void) 18 | { 19 | S(char); 20 | S(int8_t); 21 | S(short); 22 | S(int16_t); 23 | S(int); 24 | S(bool); 25 | S(long); 26 | S(int32_t); 27 | S(long long); 28 | S(int64_t); 29 | S(float); 30 | S(double); 31 | return EXIT_SUCCESS; 32 | } 33 | 34 | /* 35 | Darwin Agnes.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh powerpc PowerBook6,8 Darwin 36 | 37 | sizeof(char) == 1 38 | sizeof(int8_t) == 1 39 | sizeof(short) == 2 40 | sizeof(int16_t) == 2 41 | sizeof(int) == 4 42 | sizeof(bool) == 4 43 | sizeof(long) == 4 44 | sizeof(int32_t) == 4 45 | sizeof(long long) == 8 46 | sizeof(int64_t) == 8 47 | sizeof(float) == 4 48 | sizeof(double) == 8 49 | 50 | Linux ugradx.cs.jhu.edu 2.6.26.5-45.fc9.i686 #1 SMP Sat Sep 20 03:45:00 EDT 2008 i686 i686 i386 GNU/Linux 51 | 52 | sizeof(char) == 1 53 | sizeof(int8_t) == 1 54 | sizeof(short) == 2 55 | sizeof(int16_t) == 2 56 | sizeof(int) == 4 57 | sizeof(bool) == 1 58 | sizeof(long) == 4 59 | sizeof(int32_t) == 4 60 | sizeof(long long) == 8 61 | sizeof(int64_t) == 8 62 | sizeof(float) == 4 63 | sizeof(double) == 8 64 | 65 | SunOS peregrine 5.10 Generic_118822-11 sun4u sparc 66 | 67 | sizeof(char) == 1 68 | sizeof(int8_t) == 1 69 | sizeof(short) == 2 70 | sizeof(int16_t) == 2 71 | sizeof(int) == 4 72 | sizeof(bool) == 1 73 | sizeof(long) == 4 74 | sizeof(int32_t) == 4 75 | sizeof(long long) == 8 76 | sizeof(int64_t) == 8 77 | sizeof(float) == 4 78 | sizeof(double) == 8 79 | */ 80 | -------------------------------------------------------------------------------- /docs/asmjs/examples/splashscreen/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ; This is just a simple example 3 | ; to show how you can implement 4 | ; "splash screens" to your programs 5 | ; 6 | ; Notice that you don't have to 7 | ; press the "Run" button to see 8 | ; the results. 9 | ; 10 | ; This makes a nice "cover art" to 11 | ; your program. 12 | ; 13 | ; (Any takers on the Last Ninja game? ;)) 14 | 15 | org $0600 16 | rts ; just exit nicely 17 | 18 | org $02e0 19 | .byte 0,0,0,0,9,9,15,15,8,2,8,9,0,0,0,0 20 | .byte 0,0,0,9,9,8,2,8,15,9,9,9,0,0,0,0 21 | .byte 0,0,0,0,0,0,0,0,9,8,15,15,8,15,8,9 22 | .byte 9,15,15,15,8,8,9,0,0,0,0,0,0,0,0,0 23 | .byte 0,0,0,0,9,9,0,0,0,0,0,9,8,15,8,15 24 | .byte 8,15,8,9,0,0,0,0,0,0,0,0,0,0,0,0 25 | .byte 0,0,8,15,15,15,15,15,9,0,0,0,0,9,8,15 26 | .byte 8,9,0,0,0,0,9,8,15,15,15,15,8,8,0,0 27 | .byte 0,8,9,9,0,0,9,15,15,8,2,0,0,0,8,15 28 | .byte 8,0,0,0,9,8,15,15,15,9,0,9,9,8,8,0 29 | .byte 9,0,0,15,9,9,0,9,0,0,0,9,0,0,8,8 30 | .byte 8,2,0,9,0,9,0,9,9,0,8,15,15,0,2,9 31 | .byte 8,8,9,15,15,8,0,9,8,15,15,0,9,0,8,15 32 | .byte 15,8,0,9,15,15,9,8,0,9,8,15,15,8,8,8 33 | .byte 15,8,15,15,15,15,15,15,15,15,15,15,9,2,15,15 34 | .byte 15,8,9,9,15,15,15,15,15,15,15,15,15,15,15,8 35 | .byte 8,8,8,15,15,15,8,8,8,2,9,9,9,9,9,15 36 | .byte 9,9,9,9,0,2,8,8,8,15,15,15,15,15,8,2 37 | .byte 0,0,9,9,9,9,9,9,9,0,15,0,0,9,0,0 38 | .byte 0,0,9,0,0,9,0,0,9,9,15,9,9,0,0,0 39 | .byte 0,0,0,15,9,0,0,15,0,0,15,0,0,0,15,9 40 | .byte 0,0,15,0,0,15,0,0,0,0,9,0,9,0,0,0 41 | .byte 0,0,0,15,0,15,9,10,0,0,15,9,0,0,15,0 42 | .byte 15,9,10,0,0,15,9,0,0,9,15,0,15,9,0,0 43 | .byte 0,0,0,15,9,0,15,10,2,0,10,2,0,0,15,9 44 | .byte 0,15,10,2,0,15,15,0,0,15,2,0,0,15,2,0 45 | .byte 0,0,0,10,2,0,2,10,2,0,10,10,0,0,10,2 46 | .byte 0,2,10,2,0,2,10,0,0,10,2,9,2,2,10,2 47 | .byte 0,0,0,10,10,0,0,10,10,0,10,10,10,2,10,10 48 | .byte 0,0,10,10,0,10,10,2,10,10,0,0,0,2,10,2 49 | .byte 0,0,2,10,10,0,0,2,2,0,0,2,0,10,10,2 50 | .byte 0,0,2,0,2,10,10,2,2,2,0,0,0,2,10,10 51 | .byte 0,0,2,10,2,0,0,0,0,0,0,0,0,10,10,2 52 | .byte 0,0,0,0,10,10,10,0,0,0,0,0,0,2,10,2 53 | -------------------------------------------------------------------------------- /docs/wasm/examples/splashscreen/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ; This is just a simple example 3 | ; to show how you can implement 4 | ; "splash screens" to your programs 5 | ; 6 | ; Notice that you don't have to 7 | ; press the "Run" button to see 8 | ; the results. 9 | ; 10 | ; This makes a nice "cover art" to 11 | ; your program. 12 | ; 13 | ; (Any takers on the Last Ninja game? ;)) 14 | 15 | org $0600 16 | rts ; just exit nicely 17 | 18 | org $02e0 19 | .byte 0,0,0,0,9,9,15,15,8,2,8,9,0,0,0,0 20 | .byte 0,0,0,9,9,8,2,8,15,9,9,9,0,0,0,0 21 | .byte 0,0,0,0,0,0,0,0,9,8,15,15,8,15,8,9 22 | .byte 9,15,15,15,8,8,9,0,0,0,0,0,0,0,0,0 23 | .byte 0,0,0,0,9,9,0,0,0,0,0,9,8,15,8,15 24 | .byte 8,15,8,9,0,0,0,0,0,0,0,0,0,0,0,0 25 | .byte 0,0,8,15,15,15,15,15,9,0,0,0,0,9,8,15 26 | .byte 8,9,0,0,0,0,9,8,15,15,15,15,8,8,0,0 27 | .byte 0,8,9,9,0,0,9,15,15,8,2,0,0,0,8,15 28 | .byte 8,0,0,0,9,8,15,15,15,9,0,9,9,8,8,0 29 | .byte 9,0,0,15,9,9,0,9,0,0,0,9,0,0,8,8 30 | .byte 8,2,0,9,0,9,0,9,9,0,8,15,15,0,2,9 31 | .byte 8,8,9,15,15,8,0,9,8,15,15,0,9,0,8,15 32 | .byte 15,8,0,9,15,15,9,8,0,9,8,15,15,8,8,8 33 | .byte 15,8,15,15,15,15,15,15,15,15,15,15,9,2,15,15 34 | .byte 15,8,9,9,15,15,15,15,15,15,15,15,15,15,15,8 35 | .byte 8,8,8,15,15,15,8,8,8,2,9,9,9,9,9,15 36 | .byte 9,9,9,9,0,2,8,8,8,15,15,15,15,15,8,2 37 | .byte 0,0,9,9,9,9,9,9,9,0,15,0,0,9,0,0 38 | .byte 0,0,9,0,0,9,0,0,9,9,15,9,9,0,0,0 39 | .byte 0,0,0,15,9,0,0,15,0,0,15,0,0,0,15,9 40 | .byte 0,0,15,0,0,15,0,0,0,0,9,0,9,0,0,0 41 | .byte 0,0,0,15,0,15,9,10,0,0,15,9,0,0,15,0 42 | .byte 15,9,10,0,0,15,9,0,0,9,15,0,15,9,0,0 43 | .byte 0,0,0,15,9,0,15,10,2,0,10,2,0,0,15,9 44 | .byte 0,15,10,2,0,15,15,0,0,15,2,0,0,15,2,0 45 | .byte 0,0,0,10,2,0,2,10,2,0,10,10,0,0,10,2 46 | .byte 0,2,10,2,0,2,10,0,0,10,2,9,2,2,10,2 47 | .byte 0,0,0,10,10,0,0,10,10,0,10,10,10,2,10,10 48 | .byte 0,0,10,10,0,10,10,2,10,10,0,0,0,2,10,2 49 | .byte 0,0,2,10,10,0,0,2,2,0,0,2,0,10,10,2 50 | .byte 0,0,2,0,2,10,10,2,2,2,0,0,0,2,10,10 51 | .byte 0,0,2,10,2,0,0,0,0,0,0,0,0,10,10,2 52 | .byte 0,0,0,0,10,10,10,0,0,0,0,0,0,2,10,2 53 | -------------------------------------------------------------------------------- /sources/ide/examples/fantasy/splashscreen/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ; This is just a simple example 3 | ; to show how you can implement 4 | ; "splash screens" to your programs 5 | ; 6 | ; Notice that you don't have to 7 | ; press the "Run" button to see 8 | ; the results. 9 | ; 10 | ; This makes a nice "cover art" to 11 | ; your program. 12 | ; 13 | ; (Any takers on the Last Ninja game? ;)) 14 | 15 | org $0600 16 | rts ; just exit nicely 17 | 18 | org $02e0 19 | .byte 0,0,0,0,9,9,15,15,8,2,8,9,0,0,0,0 20 | .byte 0,0,0,9,9,8,2,8,15,9,9,9,0,0,0,0 21 | .byte 0,0,0,0,0,0,0,0,9,8,15,15,8,15,8,9 22 | .byte 9,15,15,15,8,8,9,0,0,0,0,0,0,0,0,0 23 | .byte 0,0,0,0,9,9,0,0,0,0,0,9,8,15,8,15 24 | .byte 8,15,8,9,0,0,0,0,0,0,0,0,0,0,0,0 25 | .byte 0,0,8,15,15,15,15,15,9,0,0,0,0,9,8,15 26 | .byte 8,9,0,0,0,0,9,8,15,15,15,15,8,8,0,0 27 | .byte 0,8,9,9,0,0,9,15,15,8,2,0,0,0,8,15 28 | .byte 8,0,0,0,9,8,15,15,15,9,0,9,9,8,8,0 29 | .byte 9,0,0,15,9,9,0,9,0,0,0,9,0,0,8,8 30 | .byte 8,2,0,9,0,9,0,9,9,0,8,15,15,0,2,9 31 | .byte 8,8,9,15,15,8,0,9,8,15,15,0,9,0,8,15 32 | .byte 15,8,0,9,15,15,9,8,0,9,8,15,15,8,8,8 33 | .byte 15,8,15,15,15,15,15,15,15,15,15,15,9,2,15,15 34 | .byte 15,8,9,9,15,15,15,15,15,15,15,15,15,15,15,8 35 | .byte 8,8,8,15,15,15,8,8,8,2,9,9,9,9,9,15 36 | .byte 9,9,9,9,0,2,8,8,8,15,15,15,15,15,8,2 37 | .byte 0,0,9,9,9,9,9,9,9,0,15,0,0,9,0,0 38 | .byte 0,0,9,0,0,9,0,0,9,9,15,9,9,0,0,0 39 | .byte 0,0,0,15,9,0,0,15,0,0,15,0,0,0,15,9 40 | .byte 0,0,15,0,0,15,0,0,0,0,9,0,9,0,0,0 41 | .byte 0,0,0,15,0,15,9,10,0,0,15,9,0,0,15,0 42 | .byte 15,9,10,0,0,15,9,0,0,9,15,0,15,9,0,0 43 | .byte 0,0,0,15,9,0,15,10,2,0,10,2,0,0,15,9 44 | .byte 0,15,10,2,0,15,15,0,0,15,2,0,0,15,2,0 45 | .byte 0,0,0,10,2,0,2,10,2,0,10,10,0,0,10,2 46 | .byte 0,2,10,2,0,2,10,0,0,10,2,9,2,2,10,2 47 | .byte 0,0,0,10,10,0,0,10,10,0,10,10,10,2,10,10 48 | .byte 0,0,10,10,0,10,10,2,10,10,0,0,0,2,10,2 49 | .byte 0,0,2,10,10,0,0,2,2,0,0,2,0,10,10,2 50 | .byte 0,0,2,0,2,10,10,2,2,2,0,0,0,2,10,10 51 | .byte 0,0,2,10,2,0,0,0,0,0,0,0,0,10,10,2 52 | .byte 0,0,0,0,10,10,10,0,0,0,0,0,0,2,10,2 53 | -------------------------------------------------------------------------------- /docs/asmjs/systems/fantasy-console/fc-bundle.js: -------------------------------------------------------------------------------- 1 | var scaleElement = function (conWidth, conHeight, canvas) { 2 | // Go back to full size 3 | canvas.style.transform = "translate(0px, 0px) scale(1)"; 4 | var minDimension = Math.min(conWidth, conHeight); 5 | var newScale = minDimension / canvas.offsetWidth; 6 | var newHeight = canvas.offsetHeight * newScale; 7 | var newWidth = canvas.offsetWidth * newScale; 8 | var offsetWidth = (canvas.offsetWidth - newWidth) / 2; 9 | var offsetHeight = (canvas.offsetHeight - newHeight) / 2; 10 | canvas.style.transform = "translate(" + -offsetWidth + "px, " + -offsetHeight + "px) scale(" + newScale + ")"; 11 | }; 12 | 13 | // Don't use the resize event -- sometimes the canvas and iframe 14 | // is hidden and therefore has a size of 0. The ResizeObserver 15 | // doesn't have universal support. 16 | var r = function () { 17 | var canvas = document.querySelector("canvas"); 18 | var _a = window.parent.GET_IFRAME_SIZE(), width = _a.width, height = _a.height; 19 | scaleElement(width, height, canvas); 20 | setTimeout(r, 500); 21 | }; 22 | r(); 23 | var CPU_SPEEDS = (function () { 24 | var _1MHz = 1000000; 25 | var percents = [0.1, 1, 10, 25, 50, 100, 147]; 26 | return percents.map(function (percent) { 27 | var speed = _1MHz * (percent / 100); 28 | var words = (speed / _1MHz).toFixed(3) + " Mhz"; 29 | return { 30 | speed: speed, 31 | words: words, 32 | }; 33 | }); 34 | })(); 35 | window.addEventListener('message', function (e) { 36 | var m = JSON.parse(e.data); 37 | var boot_machine = Module.cwrap('boot_machine', null, ['void']); 38 | if (m.action === "send-rom") { 39 | var bin = Uint8Array.from(JSON.parse(m.json)); 40 | FS.writeFile("/file.rom", bin); 41 | boot_machine(); 42 | console.log("Glory! Received new ROM of " + bin.length); 43 | } 44 | }, false); 45 | window.addEventListener("keydown", function (e) { 46 | var write6502 = Module.cwrap('write6502', 'void', ['number', 'number']); 47 | var ascii = e.key.charCodeAt(0); 48 | console.log(ascii, e.key, e.keyCode); 49 | write6502(0xFF, ascii); 50 | }); 51 | //# sourceMappingURL=fc-bundle.js.map 52 | -------------------------------------------------------------------------------- /docs/wasm/systems/fantasy-console/fc-bundle.js: -------------------------------------------------------------------------------- 1 | var scaleElement = function (conWidth, conHeight, canvas) { 2 | // Go back to full size 3 | canvas.style.transform = "translate(0px, 0px) scale(1)"; 4 | var minDimension = Math.min(conWidth, conHeight); 5 | var newScale = minDimension / canvas.offsetWidth; 6 | var newHeight = canvas.offsetHeight * newScale; 7 | var newWidth = canvas.offsetWidth * newScale; 8 | var offsetWidth = (canvas.offsetWidth - newWidth) / 2; 9 | var offsetHeight = (canvas.offsetHeight - newHeight) / 2; 10 | canvas.style.transform = "translate(" + -offsetWidth + "px, " + -offsetHeight + "px) scale(" + newScale + ")"; 11 | }; 12 | 13 | // Don't use the resize event -- sometimes the canvas and iframe 14 | // is hidden and therefore has a size of 0. The ResizeObserver 15 | // doesn't have universal support. 16 | var r = function () { 17 | var canvas = document.querySelector("canvas"); 18 | var _a = window.parent.GET_IFRAME_SIZE(), width = _a.width, height = _a.height; 19 | scaleElement(width, height, canvas); 20 | setTimeout(r, 500); 21 | }; 22 | r(); 23 | var CPU_SPEEDS = (function () { 24 | var _1MHz = 1000000; 25 | var percents = [0.1, 1, 10, 25, 50, 100, 147]; 26 | return percents.map(function (percent) { 27 | var speed = _1MHz * (percent / 100); 28 | var words = (speed / _1MHz).toFixed(3) + " Mhz"; 29 | return { 30 | speed: speed, 31 | words: words, 32 | }; 33 | }); 34 | })(); 35 | window.addEventListener('message', function (e) { 36 | var m = JSON.parse(e.data); 37 | var boot_machine = Module.cwrap('boot_machine', null, ['void']); 38 | if (m.action === "send-rom") { 39 | var bin = Uint8Array.from(JSON.parse(m.json)); 40 | FS.writeFile("/file.rom", bin); 41 | boot_machine(); 42 | console.log("Glory! Received new ROM of " + bin.length); 43 | } 44 | }, false); 45 | window.addEventListener("keydown", function (e) { 46 | var write6502 = Module.cwrap('write6502', 'void', ['number', 'number']); 47 | var ascii = e.key.charCodeAt(0); 48 | console.log(ascii, e.key, e.keyCode); 49 | write6502(0xFF, ascii); 50 | }); 51 | //# sourceMappingURL=fc-bundle.js.map 52 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DEST=dist 2 | wasm: MODE=wasm 3 | asmjs: MODE=asmjs 4 | 5 | IDEST=${DEST}/${MODE} 6 | ILIB=${IDEST}/lib 7 | 8 | .PHONY: build wasm asmjs 9 | 10 | all: 11 | echo "Use 'make bootstrap' to set up the build environment with needed software" 12 | echo "for the rest of the build process to use." 13 | echo " " 14 | echo "Files created as part of bootstrap are not removed during" 15 | echo "'make clean'" 16 | echo " " 17 | echo "After that it is either:" 18 | echo " make wasm # to make the wasm version" 19 | echo " make asmjs" 20 | echo " 'make run' # to make and run." 21 | 22 | bootstrap: 23 | cd sources/ide && npm ci && npm run fix 24 | cd sources/systems/fantasy_console && npm ci && npm run fix 25 | cd sources/dasm/ && make 26 | cp sources/dasm/src/dasm ./bin/dasm 27 | make clean 28 | 29 | build: 30 | rm -rf ${IDEST} 31 | mkdir -p ${IDEST}/font 32 | mkdir -p ${IDEST}/systems 33 | mkdir -p ${ILIB} 34 | mkdir -p ${ILIB}/ts 35 | 36 | echo "window.WASM_FLAG='${MODE}' === 'wasm';" >> ${ILIB}/wasm-mode.js 37 | 38 | cd sources/web_dasm && make clean ${MODE} 39 | cd sources/v6502 && make clean ${MODE} 40 | cd sources/systems/fantasy_console && make clean ${MODE} 41 | 42 | cd sources/ide && make clean all 43 | 44 | cp sources/ide/*.html ${IDEST} 45 | cp sources/ide/*.ico ${IDEST} 46 | cp sources/ide/lib/ts/wasmdetect.js ${ILIB}/ts 47 | cp sources/ide/lib/*.css ${ILIB} 48 | cp sources/ide/font/*.woff ${IDEST}/font 49 | cp sources/ide/lib/codemirror ${ILIB}/codemirror -R 50 | cp sources/ide/lib/ts/dasm-bundle.* ${ILIB}/ts 51 | cp sources/ide/lib/ts/main-bundle.* ./${ILIB}/ts 52 | 53 | cp sources/web_dasm/dasm-exe.* ${IDEST} 54 | 55 | 56 | cp sources/v6502/v6502.* ./${IDEST} 57 | mkdir -p ${IDEST}/systems/fantasy-console 58 | cp -r sources/systems/fantasy_console/build/* ${IDEST}/systems/fantasy-console 59 | mkdir -p ${IDEST}/examples 60 | cp -r sources/ide/examples/fantasy/* ${IDEST}/examples 61 | 62 | asmjs: build 63 | wasm: build 64 | 65 | run: wasm 66 | cd dist/wasm && http-server 67 | 68 | clean: 69 | rm -rf ${DEST}/asmjs 70 | rm -rf ${DEST}/wasm 71 | cd sources/ide && make clean 72 | cd sources/web_dasm && make clean 73 | cd sources/v6502 && make clean 74 | cd sources/systems/fantasy_console && make clean 75 | cd sources/dasm && make clean 76 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/beta/style.css: -------------------------------------------------------------------------------- 1 | BODY { 2 | background-color: #d0c8b8; 3 | } 4 | 5 | FONT.title { 6 | font-family: georgia, sans-serif, verdana, helvetica; 7 | font-size: 22px; 8 | font-weight: bold; 9 | } 10 | 11 | DIV.screen { 12 | border: 1px solid black; 13 | background-color: #ffffff; 14 | width: 192px; 15 | height: 192px; 16 | } 17 | 18 | TEXTAREA.code { 19 | margin: 0px 0px 0px 0px; 20 | border: 1px solid black; 21 | width: 400px; 22 | height: 300px; 23 | font-family: courier, fixed, system; 24 | font-size: 10px; 25 | overflow: auto; 26 | } 27 | 28 | INPUT,SELECT { 29 | margin-top: 3px; 30 | width: 85px; 31 | height: 22px; 32 | font-family: arial, georgia, verdana, sans-serif; 33 | font-size: 12px; 34 | background-color: #ccccd0; 35 | } 36 | 37 | INPUT:hover,SELECT:hover { 38 | background-color: #f0f0e8; 39 | } 40 | 41 | TD.screen { 42 | width: 6px; 43 | height: 6px; 44 | padding: 0px; 45 | } 46 | 47 | TABLE.screen { 48 | border-spacing: 0px; 49 | } 50 | 51 | P.helphead { 52 | font-family: georgia, sans-serif, verdana, helvetica; 53 | font-size: 18px; 54 | font-weight: bold; 55 | } 56 | 57 | P.helptext { 58 | font-family: georgia, sans-serif, verdana, helvetica; 59 | font-size: 12px; 60 | font-weight: normal; 61 | text-align: justify; 62 | } 63 | 64 | DIV.messages { 65 | border: 1px solid #999999; 66 | background-color: #e8e8f0; 67 | overflow: auto; 68 | width: 690px; 69 | height: 100px; 70 | text-align: left; 71 | font-family: georgia, sans-serif, verdana, helvetica; 72 | font-size: 12px; 73 | color: #444444; 74 | } 75 | 76 | FONT.version { 77 | font-family: georgia, sans-serif, verdana, helvetica; 78 | font-size: 10px; 79 | color: #686844; 80 | font-weight: bold; 81 | } 82 | 83 | FONT.reloaded { 84 | font-family: georgia, sans-serif, verdana, helvetica; 85 | font-size: 13px; 86 | position: relative; 87 | top: -6px; 88 | left: 45px; 89 | color: #c85800; 90 | font-weight: bold; 91 | } 92 | 93 | DIV.minidebugger { 94 | font-family: fixed, system, courier; 95 | font-size: 12px; 96 | } 97 | 98 | DIV.dbugWin { 99 | border: 1px black solid; 100 | margin-top: 5px; 101 | padding: 3px; 102 | height: 93px; 103 | text-align: center; 104 | } 105 | 106 | -------------------------------------------------------------------------------- /sources/dasm/machines/atari7800/macro.h: -------------------------------------------------------------------------------- 1 | ; MACRO.H 2 | 3 | ; Based on the 2600 macro.h file. 4 | ; Macros irrelevant to the 7800 have been removed, and the sleep macro 5 | ; has been adapted to give accurate results on the 7800. 6 | 7 | ; Version 1.0 2019/12/11 (based on the 2600 Version 1.05, 13/NOVEMBER/2003) 8 | 9 | ; Available macros... 10 | ; SLEEP n - sleep for n cycles 11 | ; SET_POINTER - load a 16-bit absolute to a 16-bit variable 12 | 13 | ;------------------------------------------------------------------------------- 14 | ; SLEEP duration 15 | ; Original author: Thomas Jentzsch 16 | ; Inserts code which takes the specified number of cycles to execute. This is 17 | ; useful for code where precise timing is required. 18 | ; ILLEGAL-OPCODE VERSION DOES NOT AFFECT FLAGS OR REGISTERS. 19 | ; LEGAL OPCODE VERSION MAY AFFECT FLAGS 20 | ; Uses illegal opcode (DASM 2.20.01 onwards). 21 | 22 | MAC SLEEP ;usage: SLEEP n (n>1) 23 | .CYCLES SET {1} 24 | 25 | IF .CYCLES < 2 26 | ECHO "MACRO ERROR: 'SLEEP': Duration must be > 1" 27 | ERR 28 | ENDIF 29 | 30 | IF .CYCLES & 1 31 | IFNCONST NO_ILLEGAL_OPCODES 32 | nop $80 33 | ELSE 34 | bit $80 35 | ENDIF 36 | .CYCLES SET .CYCLES - 3 37 | ENDIF 38 | 39 | REPEAT .CYCLES / 2 40 | nop 41 | REPEND 42 | ENDM 43 | 44 | ;------------------------------------------------------- 45 | ; SET_POINTER 46 | ; Original author: Manuel Rotschkar 47 | ; 48 | ; Sets a 2 byte RAM pointer to an absolute address. 49 | ; 50 | ; Usage: SET_POINTER pointer, address 51 | ; Example: SET_POINTER SpritePTR, SpriteData 52 | ; 53 | ; Note: Alters the accumulator, NZ flags 54 | ; IN 1: 2 byte RAM location reserved for pointer 55 | ; IN 2: absolute address 56 | 57 | MAC SET_POINTER 58 | .POINTER SET {1} 59 | .ADDRESS SET {2} 60 | 61 | LDA #<.ADDRESS ; Get Lowbyte of Address 62 | STA .POINTER ; Store in pointer 63 | LDA #>.ADDRESS ; Get Hibyte of Address 64 | STA .POINTER+1 ; Store in pointer+1 65 | 66 | ENDM 67 | 68 | ; EOF 69 | -------------------------------------------------------------------------------- /sources/dasm/test/suite68hc11.hex.ref: -------------------------------------------------------------------------------- 1 | :100000001B3A183A89019901B903E8A90118A90115 2 | :10001000C901D901F903E8E90118E9018B019B0144 3 | :10002000BB03E8AB0118AB01CB01DB01FB03E8EB41 4 | :100030000118EB01C303E8D301F303E8E30118E37C 5 | :100040000184019401B403E8A40118A401C401D4FB 6 | :1000500001F403E8E40118E401485878000178034A 7 | :10006000E868011868010547577700017703E867DA 8 | :100070000118670124FE1501111D0122181D01330D 9 | :1000800025FE27FE2CFE2EFE22FE24FE8501950174 10 | :10009000B503E8A50118A501C501D501F503E8E5FB 11 | :1000A0000118E5012FFE25FE23FE2DFE2BFE26FE68 12 | :1000B0002AFE20FE130111FC1F0122FC181F013330 13 | :1000C000FB21FE120111FC1E0122FC181E0133FB54 14 | :1000D0001401111C0122181C01338DFE28FE29FE7B 15 | :1000E000110C0E4F5F7F00017F03E86F01186F0155 16 | :1000F0000A81019101B103E8A10118A101C101D157 17 | :1001000001F103E8E10118E10143537300017303B6 18 | :10011000E863011863011A8300011A8303E81A9344 19 | :10012000011AB303E81AA301CDA3018C00018C03CB 20 | :10013000E89C01BC03E8AC01CDAC01188C000118AF 21 | :100140008C03E8189C0118BC03E81AAC0118AC0138 22 | :10015000194A5A7A00017A03E86A01186A013409D7 23 | :10016000180988019801B803E8A80118A801C80176 24 | :10017000D801F803E8E80118E80103024C5C7C00B0 25 | :10018000017C03E86C01186C01310818087E00013D 26 | :100190007E03E86E01186E019D01BD03E8AD0118F4 27 | :1001A000AD0186019601B603E8A60118A601C601B5 28 | :1001B000D601F603E8E60118E601CC0001CC03E81D 29 | :1001C000DC01FC03E8EC0118EC018E00018E03E871 30 | :1001D0009E01BE03E8AE0118AE01CE0001CE03E8D9 31 | :1001E000DE01FE03E8EE01CDEE0118CE000118CECF 32 | :1001F00003E818DE0118FE03E81AEE0118EE0148C4 33 | :10020000587800017803E8680118680105445474BF 34 | :1002100000017403E86401186401043D405070005B 35 | :10022000017003E86001186001018A019A01BA03B4 36 | :10023000E8AA0118AA01CA01DA01FA03E8EA0118DA 37 | :10024000EA0136373C183C323338183849597900BE 38 | :10025000017903E8690118690146567600017603C1 39 | :10026000E866011866013B391082019201B203E889 40 | :10027000A20118A201C201D201F203E8E20118E2D0 41 | :10028000010D0F0B9701B703E8A70118A701D701CC 42 | :10029000F703E8E70118E701DD01FD03E8ED0118C8 43 | :1002A000ED01CF9F01BF03E8AF0118AF01DF01FFF0 44 | :1002B00003E8EF01CDEF0118DF0118FF03E81AEFA3 45 | :1002C0000118EF0180019001B003E8A00118A0011E 46 | :1002D000C001D001F003E8E00118E00183000183D0 47 | :1002E00003E89301B303E8A30118A3013F1606171F 48 | :1002F00000074D5D7D00017D03E86D01186D013043 49 | :0903000018303518353E8F188FB6 50 | :00000001FF 51 | -------------------------------------------------------------------------------- /docs/asmjs/lib/cm-syntax.css: -------------------------------------------------------------------------------- 1 | /**/ 2 | 3 | .cm-s-dasm .CodeMirror-activeline-background { 4 | background: #253540; 5 | } 6 | 7 | .cm-s-dasm.CodeMirror { 8 | background: var(--editor-background-color); 9 | color: var(--editor-text-color); 10 | height: 100%; 11 | width: 100%; 12 | } 13 | 14 | .cm-s-dasm div.CodeMirror-selected { 15 | background: #314D67; 16 | } 17 | 18 | .cm-s-dasm .CodeMirror-line::selection, 19 | .cm-s-dasm .CodeMirror-line>span::selection, 20 | .cm-s-dasm .CodeMirror-line>span>span::selection { 21 | background: rgba(49, 77, 103, .99); 22 | } 23 | 24 | .cm-s-dasm .CodeMirror-line::-moz-selection, 25 | .cm-s-dasm .CodeMirror-line>span::-moz-selection, 26 | .cm-s-dasm .CodeMirror-line>span>span::-moz-selection { 27 | background: rgba(49, 77, 103, .99); 28 | } 29 | 30 | .cm-s-dasm .CodeMirror-guttermarker { 31 | color: white; 32 | } 33 | 34 | .cm-s-dasm .CodeMirror-guttermarker-subtle { 35 | color: #d0d0d0; 36 | } 37 | 38 | .cm-s-dasm .CodeMirror-linenumber { 39 | color: #D0D0D0; 40 | } 41 | 42 | .cm-s-dasm .CodeMirror-linenumber, 43 | .cm-s-dasm .CodeMirror-gutters { 44 | background: var(--gutter-background-color); 45 | color: var(--gutter-text-color); 46 | } 47 | 48 | .cm-s-dasm .CodeMirror-cursor { 49 | border-left: 25 solid #F8F8F0; 50 | } 51 | 52 | .cm-s-dasm span.cm-comment { 53 | color: #428BDD; 54 | } 55 | 56 | .cm-s-dasm span.cm-atom { 57 | color: #AE81FF; 58 | } 59 | 60 | .cm-s-dasm span.cm-number { 61 | color: #D1EDFF; 62 | } 63 | 64 | .cm-s-dasm span.cm-property, 65 | .cm-s-dasm span.cm-attribute { 66 | color: #A6E22E; 67 | } 68 | 69 | .cm-s-dasm span.cm-keyword { 70 | color: #E83737; 71 | } 72 | 73 | .cm-s-dasm span.cm-string { 74 | color: #1DC116; 75 | } 76 | 77 | .cm-s-dasm span.cm-variable { 78 | color: #FFAA3E; 79 | } 80 | 81 | .cm-s-dasm span.cm-variable-2 { 82 | color: #FFAA3E; 83 | } 84 | 85 | .cm-s-dasm span.cm-def { 86 | color: #4DD; 87 | } 88 | 89 | .cm-s-dasm span.cm-bracket { 90 | color: #D1EDFF; 91 | } 92 | 93 | .cm-s-dasm span.cm-tag { 94 | color: #449; 95 | } 96 | 97 | .cm-s-dasm span.cm-link { 98 | color: #AE81FF; 99 | } 100 | 101 | .cm-s-dasm span.cm-error { 102 | background: #F92672; 103 | color: #F8F8F0; 104 | } 105 | 106 | .cm-s-dasm .CodeMirror-matchingbracket { 107 | text-decoration: underline; 108 | color: white !important; 109 | } 110 | 111 | -------------------------------------------------------------------------------- /docs/wasm/lib/cm-syntax.css: -------------------------------------------------------------------------------- 1 | /**/ 2 | 3 | .cm-s-dasm .CodeMirror-activeline-background { 4 | background: #253540; 5 | } 6 | 7 | .cm-s-dasm.CodeMirror { 8 | background: var(--editor-background-color); 9 | color: var(--editor-text-color); 10 | height: 100%; 11 | width: 100%; 12 | } 13 | 14 | .cm-s-dasm div.CodeMirror-selected { 15 | background: #314D67; 16 | } 17 | 18 | .cm-s-dasm .CodeMirror-line::selection, 19 | .cm-s-dasm .CodeMirror-line>span::selection, 20 | .cm-s-dasm .CodeMirror-line>span>span::selection { 21 | background: rgba(49, 77, 103, .99); 22 | } 23 | 24 | .cm-s-dasm .CodeMirror-line::-moz-selection, 25 | .cm-s-dasm .CodeMirror-line>span::-moz-selection, 26 | .cm-s-dasm .CodeMirror-line>span>span::-moz-selection { 27 | background: rgba(49, 77, 103, .99); 28 | } 29 | 30 | .cm-s-dasm .CodeMirror-guttermarker { 31 | color: white; 32 | } 33 | 34 | .cm-s-dasm .CodeMirror-guttermarker-subtle { 35 | color: #d0d0d0; 36 | } 37 | 38 | .cm-s-dasm .CodeMirror-linenumber { 39 | color: #D0D0D0; 40 | } 41 | 42 | .cm-s-dasm .CodeMirror-linenumber, 43 | .cm-s-dasm .CodeMirror-gutters { 44 | background: var(--gutter-background-color); 45 | color: var(--gutter-text-color); 46 | } 47 | 48 | .cm-s-dasm .CodeMirror-cursor { 49 | border-left: 25 solid #F8F8F0; 50 | } 51 | 52 | .cm-s-dasm span.cm-comment { 53 | color: #428BDD; 54 | } 55 | 56 | .cm-s-dasm span.cm-atom { 57 | color: #AE81FF; 58 | } 59 | 60 | .cm-s-dasm span.cm-number { 61 | color: #D1EDFF; 62 | } 63 | 64 | .cm-s-dasm span.cm-property, 65 | .cm-s-dasm span.cm-attribute { 66 | color: #A6E22E; 67 | } 68 | 69 | .cm-s-dasm span.cm-keyword { 70 | color: #E83737; 71 | } 72 | 73 | .cm-s-dasm span.cm-string { 74 | color: #1DC116; 75 | } 76 | 77 | .cm-s-dasm span.cm-variable { 78 | color: #FFAA3E; 79 | } 80 | 81 | .cm-s-dasm span.cm-variable-2 { 82 | color: #FFAA3E; 83 | } 84 | 85 | .cm-s-dasm span.cm-def { 86 | color: #4DD; 87 | } 88 | 89 | .cm-s-dasm span.cm-bracket { 90 | color: #D1EDFF; 91 | } 92 | 93 | .cm-s-dasm span.cm-tag { 94 | color: #449; 95 | } 96 | 97 | .cm-s-dasm span.cm-link { 98 | color: #AE81FF; 99 | } 100 | 101 | .cm-s-dasm span.cm-error { 102 | background: #F92672; 103 | color: #F8F8F0; 104 | } 105 | 106 | .cm-s-dasm .CodeMirror-matchingbracket { 107 | text-decoration: underline; 108 | color: white !important; 109 | } 110 | 111 | -------------------------------------------------------------------------------- /sources/ide/lib/cm-syntax.css: -------------------------------------------------------------------------------- 1 | /**/ 2 | 3 | .cm-s-dasm .CodeMirror-activeline-background { 4 | background: #253540; 5 | } 6 | 7 | .cm-s-dasm.CodeMirror { 8 | background: var(--editor-background-color); 9 | color: var(--editor-text-color); 10 | height: 100%; 11 | width: 100%; 12 | } 13 | 14 | .cm-s-dasm div.CodeMirror-selected { 15 | background: #314D67; 16 | } 17 | 18 | .cm-s-dasm .CodeMirror-line::selection, 19 | .cm-s-dasm .CodeMirror-line>span::selection, 20 | .cm-s-dasm .CodeMirror-line>span>span::selection { 21 | background: rgba(49, 77, 103, .99); 22 | } 23 | 24 | .cm-s-dasm .CodeMirror-line::-moz-selection, 25 | .cm-s-dasm .CodeMirror-line>span::-moz-selection, 26 | .cm-s-dasm .CodeMirror-line>span>span::-moz-selection { 27 | background: rgba(49, 77, 103, .99); 28 | } 29 | 30 | .cm-s-dasm .CodeMirror-guttermarker { 31 | color: white; 32 | } 33 | 34 | .cm-s-dasm .CodeMirror-guttermarker-subtle { 35 | color: #d0d0d0; 36 | } 37 | 38 | .cm-s-dasm .CodeMirror-linenumber { 39 | color: #D0D0D0; 40 | } 41 | 42 | .cm-s-dasm .CodeMirror-linenumber, 43 | .cm-s-dasm .CodeMirror-gutters { 44 | background: var(--gutter-background-color); 45 | color: var(--gutter-text-color); 46 | } 47 | 48 | .cm-s-dasm .CodeMirror-cursor { 49 | border-left: 25 solid #F8F8F0; 50 | } 51 | 52 | .cm-s-dasm span.cm-comment { 53 | color: #428BDD; 54 | } 55 | 56 | .cm-s-dasm span.cm-atom { 57 | color: #AE81FF; 58 | } 59 | 60 | .cm-s-dasm span.cm-number { 61 | color: #D1EDFF; 62 | } 63 | 64 | .cm-s-dasm span.cm-property, 65 | .cm-s-dasm span.cm-attribute { 66 | color: #A6E22E; 67 | } 68 | 69 | .cm-s-dasm span.cm-keyword { 70 | color: #E83737; 71 | } 72 | 73 | .cm-s-dasm span.cm-string { 74 | color: #1DC116; 75 | } 76 | 77 | .cm-s-dasm span.cm-variable { 78 | color: #FFAA3E; 79 | } 80 | 81 | .cm-s-dasm span.cm-variable-2 { 82 | color: #FFAA3E; 83 | } 84 | 85 | .cm-s-dasm span.cm-def { 86 | color: #4DD; 87 | } 88 | 89 | .cm-s-dasm span.cm-bracket { 90 | color: #D1EDFF; 91 | } 92 | 93 | .cm-s-dasm span.cm-tag { 94 | color: #449; 95 | } 96 | 97 | .cm-s-dasm span.cm-link { 98 | color: #AE81FF; 99 | } 100 | 101 | .cm-s-dasm span.cm-error { 102 | background: #F92672; 103 | color: #F8F8F0; 104 | } 105 | 106 | .cm-s-dasm .CodeMirror-matchingbracket { 107 | text-decoration: underline; 108 | color: white !important; 109 | } 110 | 111 | -------------------------------------------------------------------------------- /sources/dasm/src/test_errors.c: -------------------------------------------------------------------------------- 1 | /* 2 | the DASM macro assembler (aka small systems cross assembler) 3 | 4 | Copyright (c) 1988-2002 by Matthew Dillon. 5 | Copyright (c) 1995 by Olaf "Rhialto" Seibert. 6 | Copyright (c) 2003-2008 by Andrew Davie. 7 | Copyright (c) 2008 by Peter H. Froehlich. 8 | 9 | This program is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 2 of the License, or 12 | (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License along 20 | with this program; if not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 22 | */ 23 | 24 | /** 25 | * @file 26 | * @brief Unit tests for errors module. 27 | * @todo how do we keep panic* from aborting while unit test 28 | * runs? or maybe it doesn't matter if we switch to Check? 29 | */ 30 | 31 | #include "errors.h" 32 | 33 | #include "asm.h" 34 | #include "util.h" 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | /* fakes for unit test */ 41 | FILE *FI_listfile = NULL; 42 | char *F_listfile = NULL; 43 | INCFILE *pIncfile = NULL; 44 | 45 | int main(int argc, char *argv[]) 46 | { 47 | assert(argc == 1); 48 | setprogname(argv[0]); 49 | /* fake a current file */ 50 | pIncfile = malloc(sizeof(INCFILE)); 51 | pIncfile->next = NULL; 52 | pIncfile->name = checked_strdup("someFileName"); 53 | pIncfile->lineno = 47; 54 | /* enable all messages */ 55 | set_error_level(ERRORLEVEL_DEBUG); 56 | /* test SUPER new API :-) */ 57 | debug_fmt(WARNING_RANGE, "CRAZY", "DEBUG", 2, 14); 58 | info_fmt(WARNING_RANGE, "CRAZY", "DEBUG", 2, 14); 59 | notice_fmt(WARNING_RANGE, "CRAZY", "DEBUG", 2, 14); 60 | warning_fmt(WARNING_RANGE, "CRAZY", "DEBUG", 2, 14); 61 | error_fmt(WARNING_RANGE, "CRAZY", "DEBUG", 2, 14); 62 | fatal_fmt(WARNING_RANGE, "CRAZY", "FATAL", 2, 14); 63 | panic_fmt(WARNING_RANGE, "CRAZY", "DEBUG", 2, 14); 64 | return EXIT_SUCCESS; 65 | } 66 | 67 | /* vim: set tabstop=4 softtabstop=4 expandtab shiftwidth=4 autoindent: */ 68 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Web 6502 IDE 2 | 3 | [Try it live!](https://jeremyjstarcher.github.io/Web_6502_IDE/) 4 | 5 | The Web 6502 IDE is a continuation of the many fine 6502 emulators 6 | available on the web today, but it uses modern browser features to 7 | combine some of the best pieces of software available today. 8 | 9 | This first release has all of the features of the well-respected 10 | site [6502asm.com](http://6502asm.com). 11 | 12 | However, the source code is not 100% compatible between the two, 13 | but the changes needed are quite minor. I have copied all of the 14 | examples from that site and have included them with this release. 15 | 16 | ## Why did you do this? 17 | 18 | I enjoy retro computing and the simplicity of the old 8bit machines. 19 | I wanted a sandboxed environment to explore in and show off my 20 | creations. 21 | 22 | However, I found that all of the web-based 6502 assemblers were 23 | usable, but lacked a lot of modern features I had gotten used to 24 | with `dasm`. I figured I could either spent a few weeks adding 25 | these features, or I could spent the time learn to use `emscripten` 26 | and interfaing with `wasm.` 27 | 28 | ## Planned features 29 | 30 | * Save! Yes, I want to be able to save the code I am working on. Save to browser storage with the chance to download my library a a `zip` file. 31 | * Add text output. Set aside some memory as a frame buffer and let text I/O working. Then I'd like to port one of the versions of BASIC over. 32 | * Convert it to an application using Electron or some similiar tool. 33 | * Atari 2600 emulator. Code and deploy directly to an Atari 2600 machine. I may consider other 6502 based machines if they are available. 34 | 35 | ## Credits 36 | 37 | Under the hood, there are several pieces of software which makes 38 | this all possible. 39 | 40 | * [emsciopten](https://emscripten.org/) is a C and C++ compiler that can target both JavaScript and Web Assembly (WASM). This package was vital in porting the assembler and the 6502 emulator to the web. 41 | * [dasm](https://dasm-assembler.github.io/) is an assembler that has been around for many years now and can target the 6502 microprocessor. 42 | * [fake6502](https://dasm-assembler.github.io/) is a freely available 6502 emulator that has been well tested in a number of emulation projects. 43 | * [CodeMirror](https://codemirror.net/) is a JavaScript based editor with many features far, far beyond a normal `textarea` element. 44 | 45 | 46 | 47 | ![Edit Screen](docs/screenshots/6502IDEEdit.png) 48 | ![Edit Screen](docs/screenshots/6502IDEMain.png) 49 | 50 | -------------------------------------------------------------------------------- /sources/ide/lib/ts/route.ts: -------------------------------------------------------------------------------- 1 | interface StateData { 2 | [key: string]: any; 3 | } 4 | 5 | const makeOnloadState = (action: string, value: string) => { 6 | const state: StateData = []; 7 | state[action] = value; 8 | 9 | history.pushState(state, "", window.location.href); 10 | history.pushState(state, "", window.location.href); 11 | } 12 | 13 | const onload = function () { 14 | showSection("main"); 15 | return; 16 | 17 | hideAllSections(); 18 | 19 | // Check if this is a reload, in which case you are already on a slide. 20 | const urlParams = new URLSearchParams(window.location.search); 21 | 22 | if (urlParams.has("section")) { 23 | const section = urlParams.get("section"); 24 | if (section !== null) { 25 | makeOnloadState("section", section || ""); 26 | showSection(section || ""); 27 | } else { 28 | const defaultSection = "main"; 29 | makeOnloadState("section", defaultSection); 30 | showSection(defaultSection); 31 | } 32 | } 33 | } 34 | 35 | // Fires when the user goes back or forward in the history. 36 | window.onpopstate = function (e: PopStateEvent) { 37 | const section = e.state && e.state.section; 38 | const routesToSkip = ["filelist"]; 39 | 40 | if (section) { 41 | if (routesToSkip.indexOf(section) >= 0) { 42 | this.history.back(); 43 | return; 44 | } 45 | showSection(section); 46 | } 47 | } 48 | 49 | // Wire up the section handling too 50 | const hideAllSections = () => { 51 | const sections = document.querySelectorAll("section"); 52 | Array.from(sections).forEach(section => { 53 | section.style.display = "none"; 54 | }) 55 | }; 56 | 57 | const showSection = ((sectionId: string) => { 58 | hideAllSections(); 59 | const selector = `section[data-section-id='${sectionId}']`; 60 | const el = document.querySelector(selector)! as HTMLElement; 61 | el.style.display = ""; 62 | }); 63 | 64 | const gotoSection = (section:string) => { 65 | showSection(section); 66 | return; 67 | 68 | if (section) { 69 | const state = { 70 | "section": section, 71 | }; 72 | 73 | history.pushState(state, "", "/?section=" + section); 74 | showSection(section); 75 | } 76 | 77 | }; 78 | 79 | document.body.addEventListener("click", (event) => { 80 | const t = event.target as HTMLElement; 81 | if (t?.dataset?.goto) { 82 | // gotoSection(t.dataset.goto); 83 | showSection(t.dataset.goto); 84 | } 85 | }); 86 | 87 | export default { 88 | onload, 89 | hideAllSections, 90 | gotoSection, 91 | }; -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/examples/byterun.asm: -------------------------------------------------------------------------------- 1 | ; testing byterun compression 2 | 3 | start: 4 | lda #logo 7 | sta $1 8 | lda #$00 9 | sta $2 10 | lda #$02 11 | sta $3 12 | 13 | decrunchLoop: 14 | lda $3 15 | cmp #$6 16 | bne moreWork 17 | rts 18 | moreWork: 19 | ldy #0 20 | lda ($0),y 21 | cmp #$ff 22 | bne notCrunched 23 | iny 24 | lda ($0),y ; repeat # 25 | sta $4 26 | iny 27 | lda ($0),y ; color 28 | ldy $4 29 | drawLoop: 30 | ldx #0 31 | sta ($2,x) 32 | jsr nextPixel 33 | dey 34 | bne drawLoop 35 | jsr getNextByte 36 | jsr getNextByte 37 | jmp decrunchLoop 38 | notCrunched: 39 | ldx #0 40 | sta ($2,x) 41 | jsr nextPixel 42 | jsr getNextByte 43 | jmp decrunchLoop 44 | 45 | getNextByte: 46 | inc $0 47 | lda $0 48 | cmp #$00 49 | bne notHi 50 | inc $1 51 | notHi: 52 | rts 53 | 54 | nextPixel: 55 | inc $2 56 | ldx $2 57 | cpx #$00 58 | bne notNextLine 59 | inc $3 60 | notNextLine: 61 | rts 62 | 63 | 64 | logo: 65 | dcb $ff,43,1,$f,$f,$f,$c,$f,$f,$f,$ff,24,1,$c,$f,$c,0 66 | dcb $c,$f,$c,$ff,24,1,0,$f,$c,0,$c,$f,$c,$ff,24,1 67 | dcb $c,$f,$c,0,$c,$f,$c,$ff,24,1,0,$f,$c,0,$c,$f,$c 68 | dcb $ff,24,1,$c,$f,0,0,$c,$f,$c,$ff,24,1,0,$f,$c,0 69 | dcb $c,$f,$c,$ff,24,1,0,$f,$c,0,$c,$f,0,$ff,24,1 70 | dcb 0,$f,$c,0,$c,$f,0,$ff,23,1,$f,0,$f,$c,0,$c,$f,0,$f 71 | dcb $ff,22,1,$c,0,1,$c,0,$c,$f,0,$c,$ff,21,1 72 | dcb $f,0,0,1,0,0,$c,1,0,0,$ff,21,1,$c,0,$c,1,$c,0 73 | dcb $c,1,$c,0,$c,$ff,19,1,$f,0,0,$f,1,$c,0 74 | dcb $c,1,$f,0,0,$f,$ff,17,1,$f,0,0,0,1,1,$c,0 75 | dcb $c,1,1,0,0,0,$ff,16,1,$f,0,0,0,$f,1,1,0,0 76 | dcb $c,1,1,$f,0,0,0,$f,$ff,13,1 77 | dcb $c,0,0,0,$c,1,1,1,$c,0,$c,1,1,1,$c,0,0,0,$c 78 | dcb $ff,10,1,$c,0,0,0,0,$c,1,1,1,1,0,0 79 | dcb $c,1,1,1,1,0,0,0,0,0,$c,$ff,8,1 80 | dcb 0,0,0,0,$c,1,1,1,1,1,0,0 81 | dcb $c,1,1,1,1,1,$c,0,0,0,0,1,1,1,1,1 82 | dcb 1,1,1,1,0,0,$c,1,1,1,1,1,1,1,$c,0 83 | dcb $c,1,1,1,1,1,1,$f,$c,0,0,$ff,18,1,$f 84 | dcb $ff,53,1,0,$f,1,0,0,0,0,0,$f,1,$c 85 | dcb $c,1,1,1,$c,0,0,0,1,1,0,$f,$f,1,1,1 86 | dcb 1,1,1,1,$c,0,0,1,1,1,0,$f,1,1,$f,0 87 | dcb 0,$f,1,1,0,$f,1,$c,$c,1,0,$f,1,1,1,1 88 | dcb 1,1,1,1,0,$f,0,$f,1,1,0,$f,1,1,$f,$c 89 | dcb $c,$c,1,1,0,1,1,$f,0,1,0,$f,1,1,1,1 90 | dcb 1,1,1,1,0,1,$c,$f,1,1,$c,$f,1,1,0,$f 91 | dcb $f,0,1,1,0,$f,$f,0,$f,1,0,$f,1,1,1,1 92 | dcb 1,1,1,$c,0,$c,0,0,1,1,0,$f,1,1,0,$c 93 | dcb $c,0,$f,1,0,$f,0,$f,1,1,0,$f,1,1,1,1 94 | dcb 1,1,1,0,$c,$f,$f,0,$f,1,$c,$f,1,$c,$c,$f 95 | dcb $f,$c,$c,1,0,1,$f,$c,1,1,0,$f,1,1,1,1 96 | dcb 1,1,$f,0,1,1,1,$c,$c,1,0,$f,1,0,$f,1 97 | dcb 1,$f,0,1,0,$f,1,0,$f,1,0,$f,$ff,16,1 98 | dcb $f,$ff,5,1,$f,1,1,1,$f,$ff,38,1 99 | 100 | 101 | -------------------------------------------------------------------------------- /sources/dasm/test/suite6502.asm: -------------------------------------------------------------------------------- 1 | 2 | ; TEST ADDRESSING MODES 3 | 4 | processor 6502 5 | 6 | org 0 7 | 8 | adc #1 9 | adc 1 10 | adc 1,x 11 | adc 1,y ;absolute 12 | adc 1000 13 | adc 1000,x 14 | adc 1000,y 15 | adc (1,x) 16 | adc (1),y 17 | 18 | and #1 19 | and 1 20 | and 1,x 21 | and 1,y ;absolute 22 | and 1000 23 | and 1000,x 24 | and 1000,y 25 | and (1,x) 26 | and (1),y 27 | 28 | asl 29 | asl 1 30 | asl 1,x 31 | asl 1000 32 | asl 1000,x 33 | 34 | bcc . 35 | bcs . 36 | beq . 37 | bit 1 38 | bit 1000 39 | bmi . 40 | bne . 41 | bpl . 42 | brk 43 | bvc . 44 | bvs . 45 | clc 46 | cld 47 | cli 48 | clv 49 | 50 | cmp #1 51 | cmp 1 52 | cmp 1,x 53 | cmp 1,y ;absolute 54 | cmp 1000 55 | cmp 1000,x 56 | cmp 1000,y 57 | cmp (1,x) 58 | cmp (1),y 59 | 60 | cpx #1 61 | cpx 1 62 | cpx 1000 63 | 64 | cpy #1 65 | cpy 1 66 | cpy 1000 67 | 68 | dec 1 69 | dec 1,x 70 | dec 1000 71 | dec 1000,x 72 | 73 | dex 74 | dey 75 | 76 | eor #1 77 | eor 1 78 | eor 1,x 79 | eor 1,y ;absolute 80 | eor 1000 81 | eor 1000,x 82 | eor 1000,y 83 | eor (1,x) 84 | eor (1),y 85 | 86 | inc 1 87 | inc 1,x 88 | inc 1000 89 | inc 1000,x 90 | 91 | inx 92 | iny 93 | 94 | jmp 1 ;absolute 95 | jmp 1000 96 | jmp (1) ;absolute 97 | jmp (1000) 98 | 99 | jsr 1 ;absolute 100 | jsr 1000 101 | 102 | lda #1 103 | lda 1 104 | lda 1,x 105 | lda 1,y ;absolute 106 | lda 1000 107 | lda 1000,x 108 | lda 1000,y 109 | lda (1,x) 110 | lda (1),y 111 | 112 | ldx #1 113 | ldx 1 114 | ldx 1,y 115 | ldx 1000 116 | ldx 1000,y 117 | 118 | ldy #1 119 | ldy 1 120 | ldy 1,x 121 | ldy 1000 122 | ldy 1000,x 123 | 124 | lsr 125 | lsr 1 126 | lsr 1,x 127 | lsr 1000 128 | lsr 1000,x 129 | 130 | nop 131 | 132 | ora #1 133 | ora 1 134 | ora 1,x 135 | ora 1,y ;absolute 136 | ora 1000 137 | ora 1000,x 138 | ora 1000,y 139 | ora (1,x) 140 | ora (1),y 141 | 142 | pha 143 | php 144 | pla 145 | plp 146 | 147 | rol 148 | rol 1 149 | rol 1,x 150 | rol 1000 151 | rol 1000,x 152 | 153 | ror 154 | ror 1 155 | ror 1,x 156 | ror 1000 157 | ror 1000,x 158 | 159 | rti 160 | rts 161 | 162 | sbc #1 163 | sbc 1 164 | sbc 1,x 165 | sbc 1,y ;absolute 166 | sbc 1000 167 | sbc 1000,x 168 | sbc 1000,y 169 | sbc (1,x) 170 | sbc (1),y 171 | 172 | sec 173 | sed 174 | sei 175 | 176 | sta 1 177 | sta 1,x 178 | sta 1,y ;absolute 179 | sta 1000 180 | sta 1000,x 181 | sta 1000,y 182 | sta (1,x) 183 | sta (1),y 184 | 185 | stx 1 186 | stx 1,y 187 | stx 1000 188 | 189 | sty 1 190 | sty 1,x 191 | sty 1000 192 | 193 | tax 194 | tay 195 | tsx 196 | txa 197 | txs 198 | tya 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /sources/orig/www.6502asm.com/style.css: -------------------------------------------------------------------------------- 1 | BODY { 2 | background-color: #e8e8f0; 3 | } 4 | 5 | FONT.title { 6 | font-family: georgia, sans-serif, verdana, helvetica; 7 | font-size: 22px; 8 | font-weight: bold; 9 | } 10 | 11 | FONT.subtitle { 12 | font-family: georgia, sans-serif, verdana, helvetica; 13 | font-size: 12px; 14 | font-weight: normal; 15 | color: #aaaab8; 16 | } 17 | 18 | DIV.screen { 19 | border-left: 1px solid black; 20 | border-right: 1px solid black; 21 | border-bottom: 1px solid black; 22 | border-top: 1px solid black; 23 | background-color: #ffffff; 24 | width: 192px; 25 | height: 192px; 26 | } 27 | 28 | TEXTAREA.code { 29 | margin: 0px 0px 0px 0px; 30 | border-left: 1px solid black; 31 | border-right: 1px solid black; 32 | border-bottom: 1px solid black; 33 | border-top: 1px solid black; 34 | width: 400px; 35 | height: 194px; 36 | font-family: courier, fixed, system; 37 | font-size: 10px; 38 | overflow: auto; 39 | } 40 | 41 | INPUT,SELECT { 42 | width: 85px; 43 | height: 22px; 44 | font-family: arial, georgia, verdana, sans-serif; 45 | font-size: 12px; 46 | background-color: #ccccd0; 47 | } 48 | 49 | INPUT:hover,SELECT:hover { 50 | background-color: #f0f0e8; 51 | } 52 | 53 | TD.screen { 54 | width: 6px; 55 | height: 6px; 56 | padding: 0px; 57 | } 58 | 59 | TABLE.screen { 60 | border-spacing: 0px; 61 | } 62 | 63 | P.helphead { 64 | font-family: georgia, sans-serif, verdana, helvetica; 65 | font-size: 18px; 66 | font-weight: bold; 67 | } 68 | 69 | P.helptext { 70 | font-family: georgia, sans-serif, verdana, helvetica; 71 | font-size: 12px; 72 | font-weight: normal; 73 | text-align: justify; 74 | } 75 | 76 | DIV.messages { 77 | border-left: 1px solid #999999; 78 | border-right: 1px solid #999999; 79 | border-bottom: 1px solid #999999; 80 | border-top: 1px solid #999999; 81 | background-color: #e8e8f0; 82 | overflow: auto; 83 | width: 596px; 84 | height: 100px; 85 | text-align: left; 86 | font-family: georgia, sans-serif, verdana, helvetica; 87 | font-size: 12px; 88 | color: #444444; 89 | } 90 | 91 | DIV.cursor { 92 | margin-top: 5px; 93 | margin-left: 0px; 94 | margin-bottom: 2px; 95 | font-family: georgia, sans-serif, verdana, helvetica; 96 | font-size: 10px; 97 | color: #444444; 98 | } 99 | 100 | INPUT.paypal { 101 | width: 110px; 102 | height: 23px; 103 | } 104 | 105 | FONT.paypal { 106 | font-family: georgia, sans-serif, verdana, helvetica; 107 | font-size: 10px; 108 | color: #444444; 109 | } 110 | 111 | FONT.version { 112 | font-family: georgia, sans-serif, verdana, helvetica; 113 | font-size: 10px; 114 | color: #ff6666; 115 | font-weight: bold; 116 | } 117 | -------------------------------------------------------------------------------- /sources/dasm/src/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | the DASM macro assembler (aka small systems cross assembler) 3 | 4 | Copyright (c) 1988-2002 by Matthew Dillon. 5 | Copyright (c) 1995 by Olaf "Rhialto" Seibert. 6 | Copyright (c) 2003-2008 by Andrew Davie. 7 | Copyright (c) 2008 by Peter H. Froehlich. 8 | 9 | This program is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 2 of the License, or 12 | (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License along 20 | with this program; if not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 22 | */ 23 | 24 | #ifndef _DASM_VERSION_H 25 | #define _DASM_VERSION_H 26 | 27 | /** 28 | * @file 29 | */ 30 | 31 | /** 32 | * @brief Macro to provide current DASM release as a string. 33 | */ 34 | #define DASM_RELEASE "2.20.14-SNAPSHOT" 35 | 36 | /** 37 | * @brief Macro to provide current DASM headline, including 38 | * release, as a string; printed first in usage messages. 39 | */ 40 | #define DASM_ID "DASM " DASM_RELEASE 41 | 42 | /** 43 | * @brief Macro to print standard DASM copyright, in case we 44 | * go back to printing this part on every run again... 45 | * 46 | * @todo There are several pieces of code out there that have 47 | * 1987 as the first copyright year by Matthew Dillon; almost 48 | * all his later stuff starts at 1988, but ftohex.c is still 49 | * at 1987 even in his 2.16 release. We should settle this... 50 | */ 51 | #define DASM_PRINT_COPYRIGHT \ 52 | (void) puts("Copyright (c) 1988-2020 by the DASM team."); 53 | 54 | /** 55 | * @brief Macro to print standard DASM legalese, including 56 | * copyright, also for usage messages. 57 | */ 58 | #define DASM_PRINT_LEGAL \ 59 | DASM_PRINT_COPYRIGHT \ 60 | (void) puts("License GPLv2+: GNU GPL version 2 or later (see file LICENSE)."); \ 61 | (void) puts("DASM is free software: you are free to change and redistribute it."); \ 62 | (void) puts("There is ABSOLUTELY NO WARRANTY, to the extent permitted by law."); \ 63 | 64 | /** 65 | * @brief Macro to print bug report message, once again for 66 | * usage messages. 67 | */ 68 | #define DASM_PRINT_BUGS \ 69 | (void) puts("Report bugs on https://github.com/dasm-assembler/dasm please!"); 70 | 71 | #endif /* _DASM_VERSION_H */ 72 | 73 | /* vim: set tabstop=4 softtabstop=4 expandtab shiftwidth=4 autoindent: */ 74 | -------------------------------------------------------------------------------- /docs/asmjs/lib/codemirror/activeline.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | var WRAP_CLASS = "CodeMirror-activeline"; 14 | var BACK_CLASS = "CodeMirror-activeline-background"; 15 | var GUTT_CLASS = "CodeMirror-activeline-gutter"; 16 | 17 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { 18 | var prev = old == CodeMirror.Init ? false : old; 19 | if (val == prev) return 20 | if (prev) { 21 | cm.off("beforeSelectionChange", selectionChange); 22 | clearActiveLines(cm); 23 | delete cm.state.activeLines; 24 | } 25 | if (val) { 26 | cm.state.activeLines = []; 27 | updateActiveLines(cm, cm.listSelections()); 28 | cm.on("beforeSelectionChange", selectionChange); 29 | } 30 | }); 31 | 32 | function clearActiveLines(cm) { 33 | for (var i = 0; i < cm.state.activeLines.length; i++) { 34 | cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); 35 | cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); 36 | cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS); 37 | } 38 | } 39 | 40 | function sameArray(a, b) { 41 | if (a.length != b.length) return false; 42 | for (var i = 0; i < a.length; i++) 43 | if (a[i] != b[i]) return false; 44 | return true; 45 | } 46 | 47 | function updateActiveLines(cm, ranges) { 48 | var active = []; 49 | for (var i = 0; i < ranges.length; i++) { 50 | var range = ranges[i]; 51 | var option = cm.getOption("styleActiveLine"); 52 | if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty()) 53 | continue 54 | var line = cm.getLineHandleVisualStart(range.head.line); 55 | if (active[active.length - 1] != line) active.push(line); 56 | } 57 | if (sameArray(cm.state.activeLines, active)) return; 58 | cm.operation(function() { 59 | clearActiveLines(cm); 60 | for (var i = 0; i < active.length; i++) { 61 | cm.addLineClass(active[i], "wrap", WRAP_CLASS); 62 | cm.addLineClass(active[i], "background", BACK_CLASS); 63 | cm.addLineClass(active[i], "gutter", GUTT_CLASS); 64 | } 65 | cm.state.activeLines = active; 66 | }); 67 | } 68 | 69 | function selectionChange(cm, sel) { 70 | updateActiveLines(cm, sel.ranges); 71 | } 72 | }); 73 | -------------------------------------------------------------------------------- /docs/wasm/lib/codemirror/activeline.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | var WRAP_CLASS = "CodeMirror-activeline"; 14 | var BACK_CLASS = "CodeMirror-activeline-background"; 15 | var GUTT_CLASS = "CodeMirror-activeline-gutter"; 16 | 17 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { 18 | var prev = old == CodeMirror.Init ? false : old; 19 | if (val == prev) return 20 | if (prev) { 21 | cm.off("beforeSelectionChange", selectionChange); 22 | clearActiveLines(cm); 23 | delete cm.state.activeLines; 24 | } 25 | if (val) { 26 | cm.state.activeLines = []; 27 | updateActiveLines(cm, cm.listSelections()); 28 | cm.on("beforeSelectionChange", selectionChange); 29 | } 30 | }); 31 | 32 | function clearActiveLines(cm) { 33 | for (var i = 0; i < cm.state.activeLines.length; i++) { 34 | cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); 35 | cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); 36 | cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS); 37 | } 38 | } 39 | 40 | function sameArray(a, b) { 41 | if (a.length != b.length) return false; 42 | for (var i = 0; i < a.length; i++) 43 | if (a[i] != b[i]) return false; 44 | return true; 45 | } 46 | 47 | function updateActiveLines(cm, ranges) { 48 | var active = []; 49 | for (var i = 0; i < ranges.length; i++) { 50 | var range = ranges[i]; 51 | var option = cm.getOption("styleActiveLine"); 52 | if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty()) 53 | continue 54 | var line = cm.getLineHandleVisualStart(range.head.line); 55 | if (active[active.length - 1] != line) active.push(line); 56 | } 57 | if (sameArray(cm.state.activeLines, active)) return; 58 | cm.operation(function() { 59 | clearActiveLines(cm); 60 | for (var i = 0; i < active.length; i++) { 61 | cm.addLineClass(active[i], "wrap", WRAP_CLASS); 62 | cm.addLineClass(active[i], "background", BACK_CLASS); 63 | cm.addLineClass(active[i], "gutter", GUTT_CLASS); 64 | } 65 | cm.state.activeLines = active; 66 | }); 67 | } 68 | 69 | function selectionChange(cm, sel) { 70 | updateActiveLines(cm, sel.ranges); 71 | } 72 | }); 73 | -------------------------------------------------------------------------------- /sources/ide/lib/codemirror/activeline.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | "use strict"; 13 | var WRAP_CLASS = "CodeMirror-activeline"; 14 | var BACK_CLASS = "CodeMirror-activeline-background"; 15 | var GUTT_CLASS = "CodeMirror-activeline-gutter"; 16 | 17 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { 18 | var prev = old == CodeMirror.Init ? false : old; 19 | if (val == prev) return 20 | if (prev) { 21 | cm.off("beforeSelectionChange", selectionChange); 22 | clearActiveLines(cm); 23 | delete cm.state.activeLines; 24 | } 25 | if (val) { 26 | cm.state.activeLines = []; 27 | updateActiveLines(cm, cm.listSelections()); 28 | cm.on("beforeSelectionChange", selectionChange); 29 | } 30 | }); 31 | 32 | function clearActiveLines(cm) { 33 | for (var i = 0; i < cm.state.activeLines.length; i++) { 34 | cm.removeLineClass(cm.state.activeLines[i], "wrap", WRAP_CLASS); 35 | cm.removeLineClass(cm.state.activeLines[i], "background", BACK_CLASS); 36 | cm.removeLineClass(cm.state.activeLines[i], "gutter", GUTT_CLASS); 37 | } 38 | } 39 | 40 | function sameArray(a, b) { 41 | if (a.length != b.length) return false; 42 | for (var i = 0; i < a.length; i++) 43 | if (a[i] != b[i]) return false; 44 | return true; 45 | } 46 | 47 | function updateActiveLines(cm, ranges) { 48 | var active = []; 49 | for (var i = 0; i < ranges.length; i++) { 50 | var range = ranges[i]; 51 | var option = cm.getOption("styleActiveLine"); 52 | if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty()) 53 | continue 54 | var line = cm.getLineHandleVisualStart(range.head.line); 55 | if (active[active.length - 1] != line) active.push(line); 56 | } 57 | if (sameArray(cm.state.activeLines, active)) return; 58 | cm.operation(function() { 59 | clearActiveLines(cm); 60 | for (var i = 0; i < active.length; i++) { 61 | cm.addLineClass(active[i], "wrap", WRAP_CLASS); 62 | cm.addLineClass(active[i], "background", BACK_CLASS); 63 | cm.addLineClass(active[i], "gutter", GUTT_CLASS); 64 | } 65 | cm.state.activeLines = active; 66 | }); 67 | } 68 | 69 | function selectionChange(cm, sel) { 70 | updateActiveLines(cm, sel.ranges); 71 | } 72 | }); 73 | -------------------------------------------------------------------------------- /docs/asmjs/examples/byterun/main.asm: -------------------------------------------------------------------------------- 1 | PROCESSOR 6502 2 | ORG $0600 3 | ; 4 | ; testing byterun compression 5 | 6 | start: 7 | lda #logo 10 | sta $1 11 | lda #$00 12 | sta $2 13 | lda #$02 14 | sta $3 15 | 16 | decrunchLoop: 17 | lda $3 18 | cmp #$6 19 | bne moreWork 20 | rts 21 | moreWork: 22 | ldy #0 23 | lda ($0),y 24 | cmp #$ff 25 | bne notCrunched 26 | iny 27 | lda ($0),y ; repeat # 28 | sta $4 29 | iny 30 | lda ($0),y ; color 31 | ldy $4 32 | drawLoop: 33 | ldx #0 34 | sta ($2,x) 35 | jsr nextPixel 36 | dey 37 | bne drawLoop 38 | jsr getNextByte 39 | jsr getNextByte 40 | jmp decrunchLoop 41 | notCrunched: 42 | ldx #0 43 | sta ($2,x) 44 | jsr nextPixel 45 | jsr getNextByte 46 | jmp decrunchLoop 47 | 48 | getNextByte: 49 | inc $0 50 | lda $0 51 | cmp #$00 52 | bne notHi 53 | inc $1 54 | notHi: 55 | rts 56 | 57 | nextPixel: 58 | inc $2 59 | ldx $2 60 | cpx #$00 61 | bne notNextLine 62 | inc $3 63 | notNextLine: 64 | rts 65 | 66 | 67 | logo: 68 | .byte $ff,43,1,$f,$f,$f,$c,$f,$f,$f,$ff,24,1,$c,$f,$c,0 69 | .byte $c,$f,$c,$ff,24,1,0,$f,$c,0,$c,$f,$c,$ff,24,1 70 | .byte $c,$f,$c,0,$c,$f,$c,$ff,24,1,0,$f,$c,0,$c,$f,$c 71 | .byte $ff,24,1,$c,$f,0,0,$c,$f,$c,$ff,24,1,0,$f,$c,0 72 | .byte $c,$f,$c,$ff,24,1,0,$f,$c,0,$c,$f,0,$ff,24,1 73 | .byte 0,$f,$c,0,$c,$f,0,$ff,23,1,$f,0,$f,$c,0,$c,$f,0,$f 74 | .byte $ff,22,1,$c,0,1,$c,0,$c,$f,0,$c,$ff,21,1 75 | .byte $f,0,0,1,0,0,$c,1,0,0,$ff,21,1,$c,0,$c,1,$c,0 76 | .byte $c,1,$c,0,$c,$ff,19,1,$f,0,0,$f,1,$c,0 77 | .byte $c,1,$f,0,0,$f,$ff,17,1,$f,0,0,0,1,1,$c,0 78 | .byte $c,1,1,0,0,0,$ff,16,1,$f,0,0,0,$f,1,1,0,0 79 | .byte $c,1,1,$f,0,0,0,$f,$ff,13,1 80 | .byte $c,0,0,0,$c,1,1,1,$c,0,$c,1,1,1,$c,0,0,0,$c 81 | .byte $ff,10,1,$c,0,0,0,0,$c,1,1,1,1,0,0 82 | .byte $c,1,1,1,1,0,0,0,0,0,$c,$ff,8,1 83 | .byte 0,0,0,0,$c,1,1,1,1,1,0,0 84 | .byte $c,1,1,1,1,1,$c,0,0,0,0,1,1,1,1,1 85 | .byte 1,1,1,1,0,0,$c,1,1,1,1,1,1,1,$c,0 86 | .byte $c,1,1,1,1,1,1,$f,$c,0,0,$ff,18,1,$f 87 | .byte $ff,53,1,0,$f,1,0,0,0,0,0,$f,1,$c 88 | .byte $c,1,1,1,$c,0,0,0,1,1,0,$f,$f,1,1,1 89 | .byte 1,1,1,1,$c,0,0,1,1,1,0,$f,1,1,$f,0 90 | .byte 0,$f,1,1,0,$f,1,$c,$c,1,0,$f,1,1,1,1 91 | .byte 1,1,1,1,0,$f,0,$f,1,1,0,$f,1,1,$f,$c 92 | .byte $c,$c,1,1,0,1,1,$f,0,1,0,$f,1,1,1,1 93 | .byte 1,1,1,1,0,1,$c,$f,1,1,$c,$f,1,1,0,$f 94 | .byte $f,0,1,1,0,$f,$f,0,$f,1,0,$f,1,1,1,1 95 | .byte 1,1,1,$c,0,$c,0,0,1,1,0,$f,1,1,0,$c 96 | .byte $c,0,$f,1,0,$f,0,$f,1,1,0,$f,1,1,1,1 97 | .byte 1,1,1,0,$c,$f,$f,0,$f,1,$c,$f,1,$c,$c,$f 98 | .byte $f,$c,$c,1,0,1,$f,$c,1,1,0,$f,1,1,1,1 99 | .byte 1,1,$f,0,1,1,1,$c,$c,1,0,$f,1,0,$f,1 100 | .byte 1,$f,0,1,0,$f,1,0,$f,1,0,$f,$ff,16,1 101 | .byte $f,$ff,5,1,$f,1,1,1,$f,$ff,38,1 102 | 103 | 104 | --------------------------------------------------------------------------------