diff --git a/doc/notes.txt b/doc/notes.txt index e4c19516..cf09c0c5 100644 --- a/doc/notes.txt +++ b/doc/notes.txt @@ -6,7 +6,10 @@ TODO: - confuse code/data in listing - show memory locations hovering over lines - don't check against ROM signatures -- DASM: macro forward refs +- DASM + - macro forward refs + - labels start with . omit timing info (isCode) + - spaces in filename don't parse code listing (DASM, maybe more) - asm: support macro expansion - multiple breakpoints, expression breakpoints - watchpoints @@ -31,7 +34,6 @@ TODO: - click to break on raster position - restructure src/ folders - debug bankswitching for funky formats -- spaces in filename don't parse code listing (DASM, maybe more) - 'undefined' for bitmap replacer - requestInterrupt needs to be disabled after breakpoint? - C/asm source formatter @@ -123,6 +125,7 @@ TODO: - separate Scope View - single-stepping vector games makes screen fade - break on stack overflow, illegal op, bad access, BRK, etc + - show in scope instead? - nes - replay doesn't work for nes (force background tile redraw) - nes debug view toolbar @@ -179,6 +182,7 @@ TODO: - can't step back twice? - compiler bug in chase - "shared" in URL doesn't work, leave in URL? (also importURL) +- segments disappear in memory map when binary unchanged - TypeError: null is not an object (evaluating 'n.destination') https://8bitworkshop.com/v3.4.1/javatari.js/release/javatari/javatari.js @@ -307,6 +311,23 @@ Assets come from: - structured data (palette, sprites, metasprites, levels, etc) - think about new comment format, platform-specific types +Programmatic Asset Language +- load PNG, draw image, or generate bitmap font +- split into images +- paletteize +- fit into tileset/spriteset + - NES: 8x8 or 8x16 tiles + - 7800: 256xN slice + - VCS: 24xN playfield, 8xN sprite, 32xN big sprite +- generate data file (asm/c/bin) +- generate char mapping +- tile generator (makechr-like) +- metasprites too +- RLE compression +- check constraints + + +--- Github Support diff --git a/package-lock.json b/package-lock.json index 8d4f4ae8..67b45651 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1819,6 +1819,12 @@ "tough-cookie": "^2.3.3" } }, + "rgbquant": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/rgbquant/-/rgbquant-1.1.2.tgz", + "integrity": "sha1-2V6Imo/LHmwaT6LMyL46QaL80YU=", + "dev": true + }, "rimraf": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", diff --git a/package.json b/package.json index 52a2aa77..b0a8a9ca 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "nightwatch": "^1.2.1", "octokat": "^0.10.0", "pngjs": "^3.3.3", + "rgbquant": "^1.1.2", "typescript": "^3.6.2", "typescript-formatter": "^7.2.2" }, diff --git a/presets/atari7800/chr_font.s b/presets/atari7800/chr_font.s new file mode 100644 index 00000000..e5bef3f2 --- /dev/null +++ b/presets/atari7800/chr_font.s @@ -0,0 +1,518 @@ + +;;{w:8,h:16,bpp:2,count:128,brev:1,flip:1,remap:[0,8,9,10,11,1,2,3,4,5,6,7]};; +.segment "CHR0" + +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$14,$05,$50,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$05,$50 +.byte $00,$00,$05,$50,$00,$00,$55,$55 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$15,$50 +.byte $00,$00,$00,$00,$15,$40,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $14,$00,$00,$14,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$55,$00,$00,$00,$00,$00 +.byte $01,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$14,$14,$14,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $01,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$50,$05,$00,$00,$00,$00,$00 +.byte $01,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$01,$40 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$14,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$05,$00 +.byte $00,$00,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$14 +.byte $00,$00,$00,$00,$00,$50,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $14,$00,$00,$14,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$01,$40,$00,$00,$00,$50 +.byte $01,$40,$05,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$14,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$14,$00,$14,$55,$55,$15,$54 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $01,$40,$00,$54,$00,$00,$00,$00 +.byte $01,$40,$01,$40,$00,$00,$00,$00 +.byte $00,$50,$00,$00,$00,$00,$14,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$50 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$05,$00 +.byte $00,$14,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$14 +.byte $00,$00,$00,$00,$00,$50,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $14,$00,$00,$14,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$50,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$00,$00 +.byte $00,$00,$15,$54,$15,$54,$00,$40 +.byte $00,$00,$05,$54,$05,$54,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$15,$40 +.byte $01,$40,$14,$00,$14,$55,$00,$00 +.byte $14,$00,$00,$14,$01,$40,$14,$14 +.byte $00,$14,$01,$50,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$15,$54,$01,$40 +.byte $00,$00,$01,$40,$00,$00,$05,$14 +.byte $05,$50,$01,$45,$05,$45,$00,$00 +.byte $01,$40,$01,$40,$00,$00,$00,$00 +.byte $01,$50,$00,$00,$01,$50,$14,$00 +.byte $01,$54,$00,$50,$15,$54,$05,$50 +.byte $00,$14,$15,$40,$05,$50,$05,$00 +.byte $05,$50,$05,$40,$01,$50,$01,$50 +.byte $00,$14,$00,$00,$14,$00,$01,$40 +.byte $15,$55,$14,$14,$15,$50,$05,$50 +.byte $15,$40,$15,$54,$14,$00,$05,$54 +.byte $14,$14,$05,$50,$05,$50,$14,$14 +.byte $15,$54,$14,$05,$14,$05,$05,$50 +.byte $14,$00,$05,$50,$14,$14,$05,$50 +.byte $01,$40,$05,$50,$01,$40,$05,$14 +.byte $14,$14,$01,$40,$15,$54,$05,$00 +.byte $00,$14,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$05,$54,$15,$50,$05,$50 +.byte $05,$54,$05,$50,$05,$00,$05,$54 +.byte $14,$14,$15,$54,$00,$50,$14,$14 +.byte $15,$54,$14,$05,$14,$14,$05,$50 +.byte $15,$50,$05,$54,$14,$00,$15,$50 +.byte $01,$54,$05,$54,$01,$40,$05,$14 +.byte $14,$14,$05,$50,$15,$54,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$15,$54 +.byte $00,$00,$50,$05,$55,$55,$01,$50 +.byte $00,$40,$01,$50,$01,$50,$00,$00 +.byte $55,$55,$05,$50,$50,$05,$50,$50 +.byte $05,$50,$55,$00,$55,$15,$01,$40 +.byte $15,$00,$00,$54,$05,$50,$14,$14 +.byte $00,$14,$05,$50,$00,$00,$05,$50 +.byte $01,$40,$05,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$15,$54,$01,$40 +.byte $00,$00,$01,$40,$00,$00,$05,$14 +.byte $14,$14,$11,$45,$14,$14,$00,$00 +.byte $05,$00,$00,$50,$00,$00,$00,$00 +.byte $01,$50,$00,$00,$01,$50,$05,$00 +.byte $05,$05,$00,$50,$14,$00,$14,$14 +.byte $00,$14,$00,$50,$14,$14,$05,$00 +.byte $14,$14,$01,$40,$01,$50,$01,$50 +.byte $00,$50,$00,$00,$05,$00,$01,$40 +.byte $50,$00,$14,$14,$14,$14,$14,$14 +.byte $14,$50,$14,$00,$14,$00,$14,$14 +.byte $14,$14,$01,$40,$14,$14,$14,$14 +.byte $14,$00,$14,$05,$14,$05,$14,$14 +.byte $14,$00,$14,$14,$14,$14,$14,$14 +.byte $01,$40,$14,$14,$05,$50,$05,$14 +.byte $14,$14,$01,$40,$14,$00,$05,$00 +.byte $00,$50,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$14,$14,$14,$14,$14,$14 +.byte $14,$14,$14,$00,$05,$00,$14,$14 +.byte $14,$14,$01,$40,$00,$50,$14,$14 +.byte $01,$40,$14,$45,$14,$14,$14,$14 +.byte $14,$14,$14,$14,$14,$00,$00,$14 +.byte $05,$00,$14,$14,$05,$50,$05,$14 +.byte $14,$14,$14,$14,$14,$00,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$14,$14 +.byte $00,$00,$41,$41,$54,$15,$05,$54 +.byte $01,$50,$04,$44,$04,$44,$01,$40 +.byte $54,$15,$14,$14,$41,$41,$50,$50 +.byte $01,$40,$15,$00,$15,$05,$15,$54 +.byte $15,$40,$01,$54,$15,$54,$00,$00 +.byte $01,$54,$14,$14,$00,$00,$15,$54 +.byte $01,$40,$15,$54,$01,$40,$01,$40 +.byte $00,$00,$04,$10,$15,$54,$01,$40 +.byte $00,$00,$00,$00,$00,$00,$15,$55 +.byte $00,$14,$14,$54,$14,$14,$00,$00 +.byte $05,$00,$00,$50,$05,$14,$01,$40 +.byte $00,$00,$00,$00,$00,$00,$05,$00 +.byte $05,$45,$00,$50,$05,$00,$14,$14 +.byte $15,$55,$00,$14,$14,$14,$05,$00 +.byte $14,$14,$00,$50,$00,$00,$00,$00 +.byte $01,$40,$00,$00,$01,$40,$00,$00 +.byte $50,$55,$14,$14,$14,$14,$14,$14 +.byte $14,$14,$14,$00,$14,$00,$14,$14 +.byte $14,$14,$01,$40,$14,$14,$14,$50 +.byte $14,$00,$14,$05,$14,$05,$14,$14 +.byte $14,$00,$14,$14,$14,$14,$00,$14 +.byte $01,$40,$14,$14,$14,$14,$05,$14 +.byte $14,$14,$01,$40,$14,$00,$05,$00 +.byte $00,$50,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$14,$14,$14,$14,$14,$00 +.byte $14,$14,$14,$00,$05,$00,$14,$14 +.byte $14,$14,$01,$40,$00,$50,$14,$50 +.byte $01,$40,$14,$45,$14,$14,$14,$14 +.byte $14,$14,$14,$14,$14,$00,$00,$14 +.byte $05,$00,$14,$14,$14,$14,$14,$45 +.byte $05,$50,$14,$14,$05,$00,$05,$00 +.byte $01,$40,$00,$50,$00,$00,$14,$14 +.byte $00,$00,$45,$51,$50,$05,$15,$55 +.byte $05,$54,$15,$15,$15,$55,$05,$50 +.byte $50,$05,$50,$05,$05,$50,$50,$50 +.byte $05,$50,$05,$00,$05,$05,$05,$50 +.byte $15,$50,$05,$54,$01,$40,$14,$14 +.byte $05,$54,$14,$14,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$00,$50,$05,$00 +.byte $00,$00,$14,$14,$05,$50,$05,$50 +.byte $00,$00,$01,$40,$00,$00,$05,$14 +.byte $00,$50,$05,$00,$14,$55,$00,$00 +.byte $05,$00,$00,$50,$01,$50,$01,$40 +.byte $00,$00,$00,$00,$00,$00,$01,$40 +.byte $05,$45,$00,$50,$01,$40,$00,$14 +.byte $14,$14,$00,$14,$14,$14,$01,$40 +.byte $14,$54,$05,$54,$00,$00,$00,$00 +.byte $05,$00,$15,$54,$00,$50,$01,$40 +.byte $51,$45,$15,$54,$14,$14,$14,$00 +.byte $14,$14,$14,$00,$14,$00,$14,$54 +.byte $14,$14,$01,$40,$00,$14,$14,$50 +.byte $14,$00,$14,$45,$14,$15,$14,$14 +.byte $14,$00,$14,$14,$14,$50,$00,$50 +.byte $01,$40,$14,$14,$14,$14,$14,$45 +.byte $04,$50,$01,$40,$05,$00,$05,$00 +.byte $01,$40,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$05,$54,$14,$14,$14,$00 +.byte $14,$14,$15,$54,$05,$00,$14,$14 +.byte $14,$14,$01,$40,$00,$50,$15,$40 +.byte $01,$40,$14,$45,$14,$14,$14,$14 +.byte $14,$14,$14,$14,$14,$00,$05,$50 +.byte $05,$00,$14,$14,$14,$14,$14,$45 +.byte $01,$40,$14,$14,$01,$40,$14,$00 +.byte $01,$40,$00,$14,$00,$00,$14,$14 +.byte $00,$00,$40,$01,$55,$55,$15,$55 +.byte $15,$55,$15,$15,$15,$55,$05,$50 +.byte $50,$05,$50,$05,$05,$50,$50,$51 +.byte $14,$14,$05,$00,$05,$05,$14,$14 +.byte $15,$54,$15,$54,$01,$40,$14,$14 +.byte $15,$54,$05,$50,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$15,$54,$15,$54 +.byte $15,$54,$55,$55,$05,$50,$05,$50 +.byte $00,$00,$01,$40,$00,$00,$05,$14 +.byte $01,$40,$01,$40,$14,$00,$00,$00 +.byte $05,$00,$00,$50,$15,$55,$15,$54 +.byte $00,$00,$15,$54,$00,$00,$01,$40 +.byte $05,$05,$00,$50,$00,$50,$01,$50 +.byte $05,$14,$15,$50,$14,$14,$01,$40 +.byte $05,$50,$14,$14,$00,$00,$00,$00 +.byte $14,$00,$00,$00,$00,$14,$01,$40 +.byte $51,$45,$14,$14,$15,$50,$14,$00 +.byte $14,$14,$15,$50,$15,$50,$14,$00 +.byte $15,$54,$01,$40,$00,$14,$15,$40 +.byte $14,$00,$14,$45,$14,$55,$14,$14 +.byte $15,$50,$14,$14,$15,$50,$01,$40 +.byte $01,$40,$14,$14,$14,$14,$14,$45 +.byte $01,$40,$05,$50,$01,$40,$05,$00 +.byte $01,$40,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$14,$14,$14,$14,$00 +.byte $14,$14,$14,$14,$15,$54,$14,$14 +.byte $14,$14,$01,$40,$00,$50,$14,$50 +.byte $01,$40,$14,$45,$14,$14,$14,$14 +.byte $14,$14,$14,$14,$15,$00,$14,$00 +.byte $05,$00,$14,$14,$14,$14,$14,$45 +.byte $05,$50,$14,$14,$00,$50,$05,$00 +.byte $01,$40,$00,$50,$00,$00,$14,$14 +.byte $00,$00,$40,$01,$55,$55,$15,$55 +.byte $05,$54,$04,$44,$05,$54,$05,$50 +.byte $50,$05,$50,$05,$05,$50,$15,$51 +.byte $14,$14,$05,$00,$05,$05,$14,$14 +.byte $15,$50,$05,$54,$01,$40,$14,$14 +.byte $15,$54,$05,$40,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$00,$50,$05,$00 +.byte $14,$00,$14,$14,$05,$50,$05,$50 +.byte $00,$00,$05,$50,$00,$00,$05,$14 +.byte $05,$00,$00,$50,$05,$40,$00,$00 +.byte $05,$00,$00,$50,$01,$50,$01,$40 +.byte $00,$00,$00,$00,$00,$00,$00,$50 +.byte $05,$15,$00,$50,$00,$14,$00,$14 +.byte $05,$14,$14,$00,$15,$50,$00,$50 +.byte $15,$14,$14,$14,$01,$50,$01,$50 +.byte $05,$00,$15,$54,$00,$50,$00,$50 +.byte $50,$55,$14,$14,$14,$14,$14,$00 +.byte $14,$14,$14,$00,$14,$00,$14,$00 +.byte $14,$14,$01,$40,$00,$14,$14,$50 +.byte $14,$00,$14,$45,$15,$45,$14,$14 +.byte $14,$14,$14,$14,$14,$14,$05,$00 +.byte $01,$40,$14,$14,$14,$14,$14,$45 +.byte $01,$40,$14,$14,$00,$50,$05,$00 +.byte $05,$00,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$14,$14,$14,$14,$14 +.byte $14,$14,$14,$14,$05,$00,$14,$14 +.byte $14,$14,$01,$40,$00,$50,$14,$14 +.byte $01,$40,$14,$45,$14,$14,$14,$14 +.byte $14,$14,$14,$14,$14,$54,$14,$00 +.byte $05,$00,$14,$14,$14,$14,$14,$45 +.byte $14,$14,$14,$14,$00,$14,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$14,$14 +.byte $00,$00,$44,$11,$51,$45,$15,$15 +.byte $01,$50,$01,$50,$05,$54,$01,$40 +.byte $54,$15,$14,$14,$41,$41,$00,$15 +.byte $14,$14,$05,$54,$05,$55,$05,$50 +.byte $15,$40,$01,$54,$15,$54,$14,$14 +.byte $15,$54,$14,$00,$00,$00,$15,$54 +.byte $15,$54,$01,$40,$01,$40,$01,$40 +.byte $14,$00,$04,$10,$01,$40,$15,$54 +.byte $00,$00,$05,$50,$14,$14,$15,$55 +.byte $14,$00,$15,$14,$14,$50,$01,$40 +.byte $01,$40,$01,$40,$05,$14,$01,$40 +.byte $00,$00,$00,$00,$00,$00,$00,$50 +.byte $05,$15,$15,$50,$14,$14,$14,$14 +.byte $05,$14,$14,$00,$05,$00,$00,$50 +.byte $14,$14,$14,$14,$01,$50,$01,$50 +.byte $01,$40,$00,$00,$01,$40,$14,$14 +.byte $50,$05,$14,$14,$14,$14,$14,$14 +.byte $14,$14,$14,$00,$14,$00,$14,$14 +.byte $14,$14,$01,$40,$00,$14,$14,$50 +.byte $14,$00,$15,$15,$15,$05,$14,$14 +.byte $14,$14,$14,$14,$14,$14,$14,$00 +.byte $01,$40,$14,$14,$14,$14,$14,$05 +.byte $05,$10,$14,$14,$00,$14,$05,$00 +.byte $05,$00,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$05,$50,$15,$50,$05,$50 +.byte $05,$54,$05,$50,$05,$00,$05,$54 +.byte $15,$50,$15,$40,$05,$50,$14,$14 +.byte $01,$40,$15,$54,$15,$50,$05,$50 +.byte $15,$50,$05,$54,$14,$14,$05,$54 +.byte $15,$54,$14,$14,$14,$14,$14,$05 +.byte $14,$14,$14,$14,$15,$54,$01,$40 +.byte $01,$40,$01,$40,$40,$54,$14,$14 +.byte $00,$00,$44,$11,$51,$45,$04,$04 +.byte $00,$40,$01,$50,$01,$50,$00,$00 +.byte $55,$55,$05,$50,$50,$05,$00,$05 +.byte $14,$14,$05,$04,$05,$05,$15,$54 +.byte $15,$00,$00,$54,$05,$50,$14,$14 +.byte $05,$54,$14,$14,$00,$00,$05,$50 +.byte $05,$50,$01,$40,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$01,$40,$15,$54 +.byte $00,$00,$05,$50,$14,$14,$05,$14 +.byte $14,$14,$51,$44,$14,$50,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$14 +.byte $05,$05,$01,$50,$14,$14,$14,$14 +.byte $05,$00,$14,$00,$01,$40,$00,$14 +.byte $14,$14,$14,$14,$00,$00,$00,$00 +.byte $00,$50,$00,$00,$05,$00,$14,$14 +.byte $50,$05,$05,$50,$14,$14,$14,$14 +.byte $14,$50,$14,$00,$14,$00,$14,$14 +.byte $14,$14,$01,$40,$00,$14,$14,$14 +.byte $14,$00,$14,$05,$14,$05,$14,$14 +.byte $14,$14,$14,$14,$14,$14,$14,$14 +.byte $01,$40,$14,$14,$14,$14,$14,$05 +.byte $14,$14,$14,$14,$00,$14,$05,$00 +.byte $14,$00,$00,$50,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$14,$00,$00,$00 +.byte $00,$14,$00,$00,$05,$00,$00,$00 +.byte $14,$00,$00,$00,$00,$00,$14,$00 +.byte $01,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $05,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$51,$45,$05,$50 +.byte $00,$00,$50,$05,$55,$55,$00,$00 +.byte $00,$00,$00,$40,$00,$40,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$55 +.byte $05,$50,$05,$54,$05,$55,$01,$40 +.byte $14,$00,$00,$14,$01,$40,$14,$14 +.byte $01,$55,$05,$50,$00,$00,$01,$40 +.byte $01,$40,$01,$40,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$01,$40,$15,$54 +.byte $00,$00,$01,$40,$14,$14,$05,$14 +.byte $05,$50,$51,$40,$05,$40,$01,$40 +.byte $00,$50,$05,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$14 +.byte $01,$54,$00,$50,$05,$50,$05,$50 +.byte $05,$00,$15,$54,$01,$50,$15,$54 +.byte $05,$50,$05,$50,$00,$00,$00,$00 +.byte $00,$14,$00,$00,$14,$00,$05,$50 +.byte $15,$54,$01,$40,$15,$50,$05,$50 +.byte $15,$40,$15,$54,$15,$54,$05,$50 +.byte $14,$14,$05,$50,$00,$14,$14,$14 +.byte $14,$00,$14,$05,$14,$05,$05,$50 +.byte $15,$50,$05,$50,$15,$50,$05,$50 +.byte $15,$54,$14,$14,$14,$14,$14,$05 +.byte $14,$14,$14,$14,$15,$54,$05,$50 +.byte $14,$00,$05,$50,$14,$14,$00,$00 +.byte $00,$50,$00,$00,$14,$00,$00,$00 +.byte $00,$14,$00,$00,$01,$54,$00,$00 +.byte $14,$00,$01,$40,$00,$50,$14,$00 +.byte $15,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $05,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$50 +.byte $01,$40,$05,$00,$15,$01,$01,$40 +.byte $00,$00,$15,$54,$15,$54,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $01,$40,$15,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$05,$50,$00,$00 +.byte $01,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$01,$40,$00,$50,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $01,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$01,$40,$00,$00 +.byte $05,$40,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $55,$55,$00,$00,$55,$55,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 +.byte $00,$00,$00,$00,$00,$00,$00,$00 + +;; 4096 bytes diff --git a/presets/atari7800/dlist.c b/presets/atari7800/dlist.c new file mode 100644 index 00000000..86d23f14 --- /dev/null +++ b/presets/atari7800/dlist.c @@ -0,0 +1,59 @@ + +#include "atari7800.h" + +#include + +byte DL[16][64]; + +DLLEntry DLL[16]; + +//#link "chr_font.s" + +char* hello = "\2\4\6\0\220\222\102"; + +void setup_dll() { + byte i; + // set up DLL + byte* dlptr = &DL[0][0]; + DLLEntry *dll = &DLL[0]; + for (i=0; i<16; i++) { + dll->offset_flags = DLL_H16 | (16-1); + dll->dl_hi = (word)dlptr>>8; + dll->dl_lo = (byte)dlptr; + dlptr += sizeof(DL[0]); + dll++; + } + memset(DL, 0, sizeof(DL)); +} + +void main() { + + setup_dll(); + + // set up display list + { + DL5Entry dl5; + dl5.data_hi = (word)hello>>8; + dl5.data_lo = (word)hello; + dl5.flags = DL5_INDIRECT; + dl5.width_pal = 32-8; + dl5.xpos = 32; + memcpy(DL[2], &dl5, sizeof(dl5)); + } + + // activate DMA + MARIA.CHARBASE = 0x80; + MARIA.DPPH = (word)DLL>>8; + MARIA.DPPL = (byte)DLL; + MARIA.CTRL = CTRL_DMA_ON | CTRL_DBLBYTE | CTRL_160AB; + MARIA.P0C1 = 0x2f; + MARIA.P0C2 = 0x1f; + MARIA.P0C3 = 0xf; + + while (1) { + while ((MARIA.MSTAT & MSTAT_VBLANK) == 0) ; + while ((MARIA.MSTAT & MSTAT_VBLANK) != 0) ; + MARIA.BACKGRND = 0; + DL[2][4]++; + } +} diff --git a/scripts/sync-version-prod.sh b/scripts/sync-version-prod.sh index 99588cd8..b54bee28 100755 --- a/scripts/sync-version-prod.sh +++ b/scripts/sync-version-prod.sh @@ -1,8 +1,8 @@ #!/bin/bash -. ./scripts/env.sh -VERSION=`git tag | tail -1` -#VERSION=`git tag -l HEAD` +#. ./scripts/env.sh +#VERSION=`git tag | tail -1` +VERSION=`git tag -l --points-at HEAD` if [ "$VERSION" == "" ]; then echo "No version at HEAD! Tag it first!" exit 1 diff --git a/src/devices.ts b/src/devices.ts index d6d78a3e..825834a2 100644 --- a/src/devices.ts +++ b/src/devices.ts @@ -186,6 +186,7 @@ export interface ProbeTime { export interface ProbeCPU { logExecute(address:number); logInterrupt(type:number); + logIllegal(address:number); } export interface ProbeBus { @@ -218,6 +219,7 @@ export class NullProbe implements ProbeAll { logIOWrite() {} logVRAMRead() {} logVRAMWrite() {} + logIllegal() {} } /// CONVENIENCE diff --git a/src/machine/atari7800.ts b/src/machine/atari7800.ts index 3e8f771b..fa0c4b80 100644 --- a/src/machine/atari7800.ts +++ b/src/machine/atari7800.ts @@ -162,6 +162,8 @@ class MARIA { } } readDLLEntry(bus) { + // display lists must be in RAM (TODO: probe?) + if (this.dll >= 0x4000) { return; } let x = bus.read(this.dll); this.offset = (x & 0xf); this.h16 = (x & 0x40) != 0; @@ -204,6 +206,8 @@ class MARIA { let b0 = bus.read(dlhi + ((dlofs+0) & 0x1ff)); let b1 = bus.read(dlhi + ((dlofs+1) & 0x1ff)); if (b1 == 0) break; // end of DL + // display lists must be in RAM (TODO: probe?) + if (dlhi >= 0x4000) { break; } let b2 = bus.read(dlhi + ((dlofs+2) & 0x1ff)); let b3 = bus.read(dlhi + ((dlofs+3) & 0x1ff)); let indirect = false; @@ -335,7 +339,7 @@ export class Atari7800 extends BasicMachine implements RasterFrameBased { [0x1800, 0x27ff, 0xffff, (a) => { return this.ram[a - 0x1800]; }], [0x2800, 0x3fff, 0x7ff, (a) => { return this.read(a | 0x2000); }], // shadow [0x4000, 0xffff, 0xffff, (a) => { return this.rom ? this.rom[a - 0x4000] : 0; }], - [0x0000, 0xffff, 0xffff, (a) => { return 0; }], // TODO + [0x0000, 0xffff, 0xffff, (a) => { return this.probe && this.probe.logIllegal(a); }], ]); this.write = newAddressDecoder([ [0x0015, 0x001A, 0x1f, (a,v) => { this.xtracyc++; this.pokey1.setTIARegister(a, v); }], @@ -348,7 +352,7 @@ export class Atari7800 extends BasicMachine implements RasterFrameBased { [0x1800, 0x27ff, 0xffff, (a,v) => { this.ram[a - 0x1800] = v; }], [0x2800, 0x3fff, 0x7ff, (a,v) => { this.write(a | 0x2000, v); }], // shadow [0xbfff, 0xbfff, 0xffff, (a,v) => { }], // TODO: bank switching? - [0x0000, 0xffff, 0xffff, (a,v) => { throw new EmuHalt("Write @ " + hex(a,4) + " " + hex(v,2)); }], + [0x0000, 0xffff, 0xffff, (a,v) => { this.probe && this.probe.logIllegal(a); }], ]); this.connectCPUMemoryBus(this); this.probeDMABus = this.probeIOBus(this); @@ -357,7 +361,14 @@ export class Atari7800 extends BasicMachine implements RasterFrameBased { this.audioadapter = new TssChannelAdapter(this.pokey1, audioOversample, audioSampleRate); } - readConst(a) { return this.read(a); } //TODO? + readConst(a) { + // make sure we don't log during this + let oldprobe = this.probe; + this.probe = null; + let v = this.read(a); + this.probe = oldprobe; + return v; + } readInput(a:number) : number { switch (a) { diff --git a/src/platform/verilog.ts b/src/platform/verilog.ts index bca42bb1..0601de99 100644 --- a/src/platform/verilog.ts +++ b/src/platform/verilog.ts @@ -352,10 +352,6 @@ var VerilogPlatform = function(mainElement, options) { start() { video = new RasterVideo(mainElement,videoWidth,videoHeight,{overscan:true}); video.create(); - var ctx = video.getContext(); - ctx.font = "8px TinyFont"; - ctx.fillStyle = "white"; - ctx.textAlign = "left"; poller = setKeyboardFromMap(video, switches, VERILOG_KEYCODE_MAP, (o,key,code,flags) => { if (flags & KeyFlags.KeyPress) { keycode = code | 0x80; diff --git a/src/recorder.ts b/src/recorder.ts index 1d1bae25..e737ff1d 100644 --- a/src/recorder.ts +++ b/src/recorder.ts @@ -192,6 +192,7 @@ export enum ProbeFlags { VRAM_READ = 0x06000000, VRAM_WRITE = 0x07000000, INTERRUPT = 0x08000000, + ILLEGAL = 0x09000000, SCANLINE = 0x7e000000, FRAME = 0x7f000000, } @@ -284,6 +285,9 @@ export class ProbeRecorder implements ProbeAll { logVRAMWrite(address:number, value:number) { this.log(address | ProbeFlags.VRAM_WRITE); } + logIllegal(address:number) { + this.log(address | ProbeFlags.ILLEGAL); + } } diff --git a/src/views.ts b/src/views.ts index 237de5cd..17fdaf5d 100644 --- a/src/views.ts +++ b/src/views.ts @@ -1074,6 +1074,7 @@ abstract class ProbeBitmapViewBase extends ProbeViewBase { case ProbeFlags.VRAM_READ: s = "VRAM Read"; break; case ProbeFlags.VRAM_WRITE: s = "VRAM Write"; break; case ProbeFlags.INTERRUPT: s = "Interrupt"; break; + case ProbeFlags.ILLEGAL: s = "Error"; break; default: s = ""; break; } return typeof addr == 'number' ? s + " " + this.addr2str(addr) : s; @@ -1100,6 +1101,7 @@ abstract class ProbeBitmapViewBase extends ProbeViewBase { case ProbeFlags.VRAM_READ: return 0x808001; case ProbeFlags.VRAM_WRITE: return 0x4080c0; case ProbeFlags.INTERRUPT: return 0xcfcfcf; + case ProbeFlags.ILLEGAL: return 0x3f3fff; default: return 0; } } diff --git a/src/worker/lib/atari7800/atari7800.cfg b/src/worker/lib/atari7800/atari7800.cfg index ae62cb6b..ea14f75c 100644 --- a/src/worker/lib/atari7800/atari7800.cfg +++ b/src/worker/lib/atari7800/atari7800.cfg @@ -9,15 +9,24 @@ MEMORY { HEADER: file = %O, start = $0000, size = $0080, fill = yes; # ROM Bank - PRG: file = %O, start = $4000, size = $BFFA, fill = yes, define = yes; + PRG: file = %O, start = $4000, size = $4000, fill = yes, define = yes; + + # DMA/Code Banks (interleaved for 4K Holey DMA) + CHR0: file = %O, start = $8000, size = $1000, fill = yes, define = yes; + PRG0: file = %O, start = $9000, size = $1000, fill = yes, define = yes; + CHR1: file = %O, start = $A000, size = $1000, fill = yes, define = yes; + PRG1: file = %O, start = $B000, size = $1000, fill = yes, define = yes; + CHR2: file = %O, start = $C000, size = $1000, fill = yes, define = yes; + PRG2: file = %O, start = $D000, size = $1000, fill = yes, define = yes; + CHR3: file = %O, start = $E000, size = $1000, fill = yes, define = yes; + PRG3: file = %O, start = $F000, size = $0FFA, fill = yes, define = yes; # CPU Vectors VECTORS: file = %O, start = $FFFA, size = $0006, fill = yes; # standard 2k SRAM (-zeropage) - # $0140-$0200 cpu stack - # $0500-$0800 3 pages for cc65 parameter stack - RAM: file = "", start = $2200, size = __STACKSIZE__, define = yes; + RAM0: file = "", start = $1800, size = $840, define = yes; + RAM1: file = "", start = $2200, size = __STACKSIZE__, define = yes; } SEGMENTS { ZEROPAGE: load = ZP, type = zp; @@ -26,9 +35,18 @@ SEGMENTS { RODATA: load = PRG, type = ro, define = yes; ONCE: load = PRG, type = ro, optional = yes; CODE: load = PRG, type = ro, define = yes; - DATA: load = PRG, run = RAM, type = rw, define = yes; + DATA: load = PRG, run = RAM0, type = rw, define = yes; + CHR0: load = CHR0, type = ro, optional = yes; + PRG0: load = PRG0, type = ro, optional = yes; + CHR1: load = CHR1, type = ro, optional = yes; + PRG1: load = PRG1, type = ro, optional = yes; + CHR2: load = CHR2, type = ro, optional = yes; + PRG2: load = PRG2, type = ro, optional = yes; + CHR3: load = CHR3, type = ro, optional = yes; + PRG3: load = PRG3, type = ro, optional = yes; VECTORS: load = VECTORS, type = ro; - BSS: load = RAM, type = bss, define = yes; + BSS: load = RAM0, type = bss, define = yes; + RAM1: load = RAM1, type = rw, optional = yes; } FEATURES { CONDES: type = constructor, diff --git a/src/worker/lib/atari7800/crt0.o b/src/worker/lib/atari7800/crt0.o index b6fa3121..f30682bf 100644 Binary files a/src/worker/lib/atari7800/crt0.o and b/src/worker/lib/atari7800/crt0.o differ diff --git a/src/worker/lib/atari7800/crt0.s b/src/worker/lib/atari7800/crt0.s index b1f723d0..26e4e10c 100644 --- a/src/worker/lib/atari7800/crt0.s +++ b/src/worker/lib/atari7800/crt0.s @@ -6,9 +6,11 @@ .export _HandyRTI .export NMI,IRQ,START .import initlib,push0,popa,popax,_main,zerobss,copydata + .importzp sp ; Linker generated symbols - .import __RAM_START__ ,__RAM_SIZE__ + .import __RAM0_START__ ,__RAM0_SIZE__ + .import __RAM1_START__ ,__RAM1_SIZE__ .import __ROM0_START__ ,__ROM0_SIZE__ .import __STARTUP_LOAD__,__STARTUP_RUN__,__STARTUP_SIZE__ .import __CODE_LOAD__ ,__CODE_RUN__ ,__CODE_SIZE__ @@ -82,6 +84,15 @@ _exit: cpx #$40 bne @3 +; copy data segment + jsr copydata +; initialize cc65 stack + lda #<(__RAM1_START__+__RAM1_SIZE__) + sta sp + lda #>(__RAM1_START__+__RAM1_SIZE__) + sta sp+1 +; init CC65 library + jsr initlib ; set interrupt vector in ZP lda #<_HandyRTI sta INTVEC diff --git a/tools/fonts/bitmap-fonts b/tools/fonts/bitmap-fonts deleted file mode 120000 index c293b1b2..00000000 --- a/tools/fonts/bitmap-fonts +++ /dev/null @@ -1 +0,0 @@ -../../bitmap-fonts \ No newline at end of file diff --git a/tools/fonts/ibmfonts b/tools/fonts/ibmfonts deleted file mode 120000 index 8689af2c..00000000 --- a/tools/fonts/ibmfonts +++ /dev/null @@ -1 +0,0 @@ -../../ibmfonts \ No newline at end of file diff --git a/tools/png2a7800.js b/tools/png2a7800.js new file mode 100755 index 00000000..5b37d11b --- /dev/null +++ b/tools/png2a7800.js @@ -0,0 +1,83 @@ +#!/usr/bin/env node + +var fs = require('fs'), + PNG = require('pngjs').PNG, + RgbQuant = require('rgbquant'); + +var data = fs.readFileSync(process.argv[2]); +var png = PNG.sync.read(data); +q = new RgbQuant(); +q.colors = 4; +q.sample(png.data); +pal = q.palette(false, true); +//console.log(q); + +function readfonttxt(s) { + var lines = s.split(/\r?\n/);// TODO +} + +function remapBits(x, arr) { + if (!arr) return x; + var y = 0; + for (var i=0; i= arrin.length) throw i+" -> "+j+" >= "+arrin.length; + out.push(arrin[j] | 0); + } + return out; +} + +function packbits(arrin, bpp, brev) { + var out = new Uint8Array((arrin.length * bpp) >> 3); + for (var i=0; i> 3; + var s = (i * bpp) & 7; + if (brev) s = 8-bpp-s; + out[j] |= arrin[i] << s; + } + return out; +} + +function hex(n) { + return (n < 16 ? "0" : "") + n.toString(16); +} + +function dump(arr, bpl) { + var s = ''; + for (var i=0; i