@8bitscript/atari5200 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 8BitScript contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,130 @@
1
+ {
2
+ "name": "@8bitscript/atari5200",
3
+ "version": "0.22.1",
4
+ "description": "Atari 5200 target support for 8BitScript: the hardware underneath the portable APIs.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/8BitScript/8bitscript.git",
9
+ "directory": "packages/atari5200"
10
+ },
11
+ "8bitscript": {
12
+ "title": "Atari 5200",
13
+ "emulator": {
14
+ "binary": "atari800",
15
+ "family": "atari800",
16
+ "screenshot": "window",
17
+ "framesUnit": "frames",
18
+ "defaultFrames": 240,
19
+ "installer": "atari800",
20
+ "deferred": "atari800 needs a 5200 BIOS ROM this project does not ship"
21
+ },
22
+ "entry": "./src/index.8bs",
23
+ "exports": {
24
+ "./screen": "./src/screen.8bs",
25
+ "./text": "./src/text.8bs",
26
+ "./input": "./src/input.8bs",
27
+ "./pointer": "./src/pointer.8bs",
28
+ "./rasterline": "./src/rasterline.8bs"
29
+ },
30
+ "hardware": {
31
+ "build": {
32
+ "defsym": {
33
+ "__load_address": 16384,
34
+ "__rom_size": 32768,
35
+ "__bss_origin": 512,
36
+ "__bss_ceiling": 4608,
37
+ "__ram_ceiling": 65536
38
+ },
39
+ "output": "bin"
40
+ },
41
+ "facts": {
42
+ "video.columns": 40,
43
+ "video.rows": 24,
44
+ "video.cellWidth": 8,
45
+ "video.cellHeight": 8,
46
+ "video.palette": 256,
47
+ "video.cellColors": 2,
48
+ "video.colorPerCell": true,
49
+ "video.glyphs": 0,
50
+ "video.blockWidth": 0,
51
+ "video.blockHeight": 0,
52
+ "video.bitmap": false,
53
+ "video.layers": 1,
54
+ "video.scroll": true,
55
+ "video.raster": true,
56
+ "video.sprites": 4,
57
+ "video.spritesPerLine": 4,
58
+ "video.spriteWidth": 8,
59
+ "video.spriteHeight": 255,
60
+ "video.spriteColors": 1,
61
+ "video.frameRate": 60,
62
+ "audio.voices": 0,
63
+ "audio.noise": false,
64
+ "audio.envelope": false,
65
+ "audio.filter": false,
66
+ "audio.pcm": false,
67
+ "audio.volume": false,
68
+ "audio.entropy": false,
69
+ "input.keyboard": false,
70
+ "input.joysticks": 0,
71
+ "input.pads": 2,
72
+ "input.controls": [
73
+ "up",
74
+ "down",
75
+ "left",
76
+ "right",
77
+ "a"
78
+ ],
79
+ "input.mouse": false,
80
+ "input.paddles": false,
81
+ "storage.save": false,
82
+ "storage.kib": 0,
83
+ "memory.ram": 16384,
84
+ "memory.banked": false,
85
+ "memory.bankedKib": 0
86
+ },
87
+ "run": {
88
+ "atari800": [
89
+ "-5200"
90
+ ]
91
+ },
92
+ "options": {
93
+ "media": {
94
+ "label": "Cartridge",
95
+ "default": "32k",
96
+ "values": {
97
+ "32k": {
98
+ "label": "32K cart",
99
+ "build": {
100
+ "output": "bin",
101
+ "defsym": {
102
+ "__rom_size": 32768
103
+ }
104
+ }
105
+ },
106
+ "supercart": {
107
+ "label": "Super Cart (banked)",
108
+ "build": {
109
+ "output": "bin",
110
+ "defsym": {
111
+ "__rom_size": 65536
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ },
118
+ "presets": {}
119
+ }
120
+ },
121
+ "files": [
122
+ "src"
123
+ ],
124
+ "publishConfig": {
125
+ "access": "public"
126
+ },
127
+ "scripts": {
128
+ "test": "node --test"
129
+ }
130
+ }
@@ -0,0 +1,5 @@
1
+ export namespace Video {
2
+ const COLUMNS: utinyint = 40;
3
+ const ROWS: utinyint = 24;
4
+ const CELL_COUNT: usmallint = 960;
5
+ }
package/src/index.8bs ADDED
@@ -0,0 +1,2 @@
1
+ // @8bitscript/atari5200 — Atari 5200 hardware underneath the portable APIs.
2
+ // Registers a program names sit in this package; screen/text/input import them.
package/src/input.8bs ADDED
@@ -0,0 +1,50 @@
1
+ export namespace input {
2
+ function begin(): void {
3
+ input.poll();
4
+ }
5
+
6
+ function poll(): void {
7
+ }
8
+
9
+ function left(): bool {
10
+ return false;
11
+ }
12
+
13
+ function right(): bool {
14
+ return false;
15
+ }
16
+
17
+ function up(): bool {
18
+ return false;
19
+ }
20
+
21
+ function down(): bool {
22
+ return false;
23
+ }
24
+
25
+ function confirm(): bool {
26
+ return false;
27
+ }
28
+
29
+ function cancel(): bool {
30
+ return false;
31
+ }
32
+
33
+ function pointer(): bool {
34
+ return false;
35
+ }
36
+
37
+ function pointerCell(): usmallint {
38
+ return 0;
39
+ }
40
+
41
+ function pointerButton(): bool {
42
+ return false;
43
+ }
44
+ }
45
+
46
+ export namespace Input {
47
+ const CONFIRM_LABEL: string = "FIRE";
48
+ const ALT_CONFIRM_LABEL: string = "FIRE";
49
+ const CONFIRM_LABELS: string = "FIRE";
50
+ }
@@ -0,0 +1,15 @@
1
+ export namespace pointer {
2
+ const DRAWS: bool = false;
3
+
4
+ function begin(): void {
5
+ }
6
+
7
+ function setColor(color: utinyint): void {
8
+ }
9
+
10
+ function update(): void {
11
+ }
12
+
13
+ function hide(): void {
14
+ }
15
+ }
@@ -0,0 +1,38 @@
1
+ export namespace Slot {
2
+ const BORDER: utinyint = 0;
3
+ const BACKGROUND: utinyint = 1;
4
+ const SCROLL_X: utinyint = 2;
5
+ }
6
+
7
+ export namespace raster {
8
+ const ENTRIES: utinyint = 0;
9
+ const STRIDE: utinyint = 0;
10
+
11
+ function clear(): void {
12
+ }
13
+
14
+ function at(line: utinyint, slot: utinyint, value: utinyint): bool {
15
+ return false;
16
+ }
17
+
18
+ function insert(line: utinyint, slot: utinyint, value: utinyint): bool {
19
+ return false;
20
+ }
21
+
22
+ function setValue(entry: utinyint, value: utinyint): bool {
23
+ return false;
24
+ }
25
+
26
+ function commit(): void {
27
+ }
28
+
29
+ function count(): utinyint {
30
+ return 0;
31
+ }
32
+
33
+ function enable(): void {
34
+ }
35
+
36
+ function disable(): void {
37
+ }
38
+ }
package/src/screen.8bs ADDED
@@ -0,0 +1,48 @@
1
+ import { Video } from "./geometry.8bs";
2
+
3
+ export namespace screen {
4
+ function setColors(border: u8, background: u8): void {
5
+ }
6
+
7
+ function blank(border: utinyint = BorderColor.BLACK, background: utinyint = BackgroundColor.BLACK): void {
8
+ for (let cell: usmallint = 0; cell < Video.CELL_COUNT; cell++) {
9
+ memory.write(0 + cell, 32);
10
+ }
11
+ }
12
+
13
+ function setBackground(background: u8): void {
14
+ }
15
+
16
+ function setBorder(border: u8): void {
17
+ }
18
+
19
+ const RESIZABLE: bool = false;
20
+
21
+ function resized(): bool {
22
+ return false;
23
+ }
24
+ }
25
+
26
+ export namespace BorderColor {
27
+ const BLACK: utinyint = 0;
28
+ const WHITE: utinyint = 1;
29
+ const RED: utinyint = 2;
30
+ const CYAN: utinyint = 3;
31
+ const PURPLE: utinyint = 4;
32
+ const GREEN: utinyint = 5;
33
+ const BLUE: utinyint = 6;
34
+ const YELLOW: utinyint = 7;
35
+ const KEEP: utinyint = 255;
36
+ }
37
+
38
+ export namespace BackgroundColor {
39
+ const BLACK: utinyint = 0;
40
+ const WHITE: utinyint = 1;
41
+ const RED: utinyint = 2;
42
+ const CYAN: utinyint = 3;
43
+ const PURPLE: utinyint = 4;
44
+ const GREEN: utinyint = 5;
45
+ const BLUE: utinyint = 6;
46
+ const YELLOW: utinyint = 7;
47
+ const KEEP: utinyint = 255;
48
+ }
package/src/text.8bs ADDED
@@ -0,0 +1,85 @@
1
+ import { Video } from "./geometry.8bs";
2
+
3
+ function asciiToScreenCode(code: utinyint): utinyint {
4
+ if (code >= 97 && code < 123) {
5
+ return code - 96;
6
+ }
7
+ return code;
8
+ }
9
+
10
+ let ink: utinyint = 1;
11
+
12
+ export namespace text {
13
+ const CELL_COUNT: usmallint = Video.CELL_COUNT;
14
+ const COLUMNS: utinyint = Video.COLUMNS;
15
+ const ROWS: utinyint = Video.ROWS;
16
+
17
+ function columns(): utinyint {
18
+ return text.COLUMNS;
19
+ }
20
+
21
+ function rows(): utinyint {
22
+ return text.ROWS;
23
+ }
24
+
25
+ function releaseCursor(): void {
26
+ }
27
+
28
+ function setReverse(on: bool): void {
29
+ }
30
+
31
+ function setColor(color: utinyint): void {
32
+ ink = color;
33
+ }
34
+
35
+ function putChar(cell: usmallint, code: utinyint): void {
36
+ memory.write(0 + cell, asciiToScreenCode(code));
37
+ }
38
+
39
+ function putColor(cell: usmallint, color: utinyint): void {
40
+ }
41
+
42
+ function print(cell: usmallint, s: string): void {
43
+ for (let i: utinyint = 0; i < s.length; i++) {
44
+ text.putChar(cell + i, s[i]);
45
+ }
46
+ }
47
+
48
+
49
+ function fill(cell: usmallint, count: usmallint, code: utinyint): void {
50
+ for (let i: usmallint = 0; i < count; i++) {
51
+ text.putChar(cell + i, code);
52
+ }
53
+ }
54
+
55
+ function printNumber(cell: usmallint, value: usmallint, width: utinyint): void {
56
+ let n: usmallint = value;
57
+ let i: utinyint = width;
58
+ while (i > 0) {
59
+ i = i - 1;
60
+ let digit: utinyint = 0;
61
+ let place: usmallint = 1;
62
+ let w: utinyint = 0;
63
+ while (w < i) {
64
+ place = place * 10;
65
+ w = w + 1;
66
+ }
67
+ while (n >= place) {
68
+ n = n - place;
69
+ digit = digit + 1;
70
+ }
71
+ text.putChar(cell + i, 48 + digit);
72
+ }
73
+ }
74
+ }
75
+
76
+ export namespace TextColor {
77
+ const BLACK: utinyint = 0;
78
+ const WHITE: utinyint = 1;
79
+ const RED: utinyint = 2;
80
+ const CYAN: utinyint = 3;
81
+ const PURPLE: utinyint = 4;
82
+ const GREEN: utinyint = 5;
83
+ const BLUE: utinyint = 6;
84
+ const YELLOW: utinyint = 7;
85
+ }