From 1b6b49889b4bab8570715c6bfe2c0998ed770865 Mon Sep 17 00:00:00 2001 From: zbyti Date: Mon, 28 Sep 2020 19:19:25 +0200 Subject: [PATCH 1/6] A8 landscape refactor --- examples/a8/landscape.mfk | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/a8/landscape.mfk b/examples/a8/landscape.mfk index 918a496a..50f869ff 100644 --- a/examples/a8/landscape.mfk +++ b/examples/a8/landscape.mfk @@ -1,5 +1,6 @@ // idea @ilmenit -// https://demozoo.org/productions/280623/ +// https://demozoo.org/productions/280623 +// for 8bit AtariXL, OS Rev 2 alias prev_x = os_OLDCOL.lo alias cursor_x = os_COLCRS.lo @@ -23,20 +24,17 @@ void main(){ for i,0,to,79 { cursor_x = i prev_x = i - color = 13 prev_y = 1 - while color != $ff { + for color,13,downto,0 { cursor_y = color_height[color] - if (pokey_random & 1) != 0 { + if pokey_random < $80 { + color_height[color] -= 1 + } + if pokey_random < $80 { color_height[color] += 1 - } else { - if (pokey_random & 1) != 0 { - color_height[color] -= 1 - } } drawto() - color -= 1 } } From a4b27f73e73c96347bd0c41cb94fd335fc2fe878 Mon Sep 17 00:00:00 2001 From: zbyti Date: Mon, 28 Sep 2020 21:49:44 +0200 Subject: [PATCH 2/6] ANTIC Display List Instruction Set constans --- examples/README.md | 2 ++ examples/a8/dli_example.mfk | 9 ++++++--- include/a8_antic.mfk | 38 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/examples/README.md b/examples/README.md index c76406f1..0fe7be6e 100644 --- a/examples/README.md +++ b/examples/README.md @@ -110,6 +110,8 @@ how to create a program made of multiple files loaded on demand ### Other examples +* [Test OS module](a8/a8_os_test.mfk) – quick test for a8_os.mfk module + * [Rainbow example](a8/rainbow.mfk) – simple scrolling rasterbars * [Quatari Landscape](a8/landscape.mfk) – part of Quatari 256B intro diff --git a/examples/a8/dli_example.mfk b/examples/a8/dli_example.mfk index d9e1ef90..e9118c86 100644 --- a/examples/a8/dli_example.mfk +++ b/examples/a8/dli_example.mfk @@ -2,9 +2,12 @@ const word dlAddr = $3000 const word dliAddr = $3100 const array(byte) dl @ dlAddr = [ - $70,$70,$70, - $42,$00,$40,2,2,2,2,$f0,2,2,2,2, - $41,@word[dlAddr] + BLANK_8,BLANK_8,BLANK_8, + LMS|MODE_2,$00,$40, + MODE_2,MODE_2,MODE_2,MODE_2, + BLANK_8|DLI, + MODE_2,MODE_2,MODE_2,MODE_2, + JVB,@word[dlAddr] ] volatile word SDLST @ $230 diff --git a/include/a8_antic.mfk b/include/a8_antic.mfk index 6aa0ef53..fb7557c1 100644 --- a/include/a8_antic.mfk +++ b/include/a8_antic.mfk @@ -4,6 +4,44 @@ #warn a8_antic module should be used only on Atari computer-compatible targets #endif +// ANTIC Display List Instruction Set +// THE DISPLAY LIST CANNOT CROSS A 1K BYTE MEMORY BOUNDARY UNLESS A JUMP INSTRUCTION IS USED! +const byte LMS = $40 // Load memory scan 10-bit counter, $fff boundary. +const byte DLI = $80 // Display list interrupt - Interrupt CPU at beginning of last scan line. +const byte HSCROL = $10 // Enable vertical scrolling. +const byte VSCROL = $20 // Enable horizontal scrolling. +const byte JMP = 1 // Jump command - followed by two bytes indicating the new instruction pointer for the display list. +const byte JVB = $41 // Jump and wait for Vertical Blank - suspends the display list until vertical blank and then jumps. + + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+ colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixe + +const byte MODE_2 = 2 //+ 2 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_3 = 3 //+ 2 + 40x24 + text + 10 + 760 B + 40 + 8 + +const byte MODE_4 = 4 //+ 5 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_5 = 5 //+ 5 + 40x12 + text + 16 + 480 B + 40 + 8 + +const byte MODE_6 = 6 //+ 5 + 20x24 + text + 8 + 480 B + 20 + 8 + +const byte MODE_7 = 7 //+ 5 + 20x12 + text + 16 + 240 B + 20 + 8 + +const byte MODE_8 = 8 //+ 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + +const byte MODE_9 = 9 //+ 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + +const byte MODE_A = $a //+ 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + +const byte MODE_B = $b //+ 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + +const byte MODE_C = $c //+ 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + +const byte MODE_D = $d //+ 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + +const byte MODE_E = $e //+ 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + +const byte MODE_F = $f //+ 2 + 320x192 + graphics + 1 + 7680 B + 40 + 1 + + //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +const byte BLANK_1 = 0 +const byte BLANK_2 = $10 +const byte BLANK_3 = $20 +const byte BLANK_4 = $30 +const byte BLANK_5 = $40 +const byte BLANK_6 = $50 +const byte BLANK_7 = $60 +const byte BLANK_8 = $70 + +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + volatile byte antic_dmactl @$D400 // direct memory access control volatile byte antic_chactl @$D401 // character mode control volatile word antic_dlist @$D402 // display list pointer From 362d682c11b01f07f3af2ccffc0c7575ea82860b Mon Sep 17 00:00:00 2001 From: zbyti Date: Mon, 28 Sep 2020 21:54:35 +0200 Subject: [PATCH 3/6] ANTIC Display List Instruction Set table typo --- include/a8_antic.mfk | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/a8_antic.mfk b/include/a8_antic.mfk index fb7557c1..d4b6adf3 100644 --- a/include/a8_antic.mfk +++ b/include/a8_antic.mfk @@ -13,23 +13,23 @@ const byte VSCROL = $20 // Enable horizontal scrolling. const byte JMP = 1 // Jump command - followed by two bytes indicating the new instruction pointer for the display list. const byte JVB = $41 // Jump and wait for Vertical Blank - suspends the display list until vertical blank and then jumps. - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - //+ colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixe + -const byte MODE_2 = 2 //+ 2 + 40x24 + text + 8 + 960 B + 40 + 8 + -const byte MODE_3 = 3 //+ 2 + 40x24 + text + 10 + 760 B + 40 + 8 + -const byte MODE_4 = 4 //+ 5 + 40x24 + text + 8 + 960 B + 40 + 8 + -const byte MODE_5 = 5 //+ 5 + 40x12 + text + 16 + 480 B + 40 + 8 + -const byte MODE_6 = 6 //+ 5 + 20x24 + text + 8 + 480 B + 20 + 8 + -const byte MODE_7 = 7 //+ 5 + 20x12 + text + 16 + 240 B + 20 + 8 + -const byte MODE_8 = 8 //+ 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + -const byte MODE_9 = 9 //+ 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + -const byte MODE_A = $a //+ 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + -const byte MODE_B = $b //+ 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + -const byte MODE_C = $c //+ 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + -const byte MODE_D = $d //+ 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + -const byte MODE_E = $e //+ 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + -const byte MODE_F = $f //+ 2 + 320x192 + graphics + 1 + 7680 B + 40 + 1 + - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+ colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixel + +const byte MODE_2 = 2 //+ 2 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_3 = 3 //+ 2 + 40x24 + text + 10 + 760 B + 40 + 8 + +const byte MODE_4 = 4 //+ 5 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_5 = 5 //+ 5 + 40x12 + text + 16 + 480 B + 40 + 8 + +const byte MODE_6 = 6 //+ 5 + 20x24 + text + 8 + 480 B + 20 + 8 + +const byte MODE_7 = 7 //+ 5 + 20x12 + text + 16 + 240 B + 20 + 8 + +const byte MODE_8 = 8 //+ 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + +const byte MODE_9 = 9 //+ 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + +const byte MODE_A = $a //+ 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + +const byte MODE_B = $b //+ 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + +const byte MODE_C = $c //+ 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + +const byte MODE_D = $d //+ 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + +const byte MODE_E = $e //+ 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + +const byte MODE_F = $f //+ 2 + 320x192 + graphics + 1 + 7680 B + 40 + 1 + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ const byte BLANK_1 = 0 const byte BLANK_2 = $10 From cc1adee4f1a2e0686196689c9b46f1e251e4ac24 Mon Sep 17 00:00:00 2001 From: zbyti Date: Mon, 28 Sep 2020 22:15:39 +0200 Subject: [PATCH 4/6] ANTIC Display List BASIC modes --- include/a8_antic.mfk | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/a8_antic.mfk b/include/a8_antic.mfk index d4b6adf3..add4da7a 100644 --- a/include/a8_antic.mfk +++ b/include/a8_antic.mfk @@ -13,23 +13,23 @@ const byte VSCROL = $20 // Enable horizontal scrolling. const byte JMP = 1 // Jump command - followed by two bytes indicating the new instruction pointer for the display list. const byte JVB = $41 // Jump and wait for Vertical Blank - suspends the display list until vertical blank and then jumps. - //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - //+ colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixel + -const byte MODE_2 = 2 //+ 2 + 40x24 + text + 8 + 960 B + 40 + 8 + -const byte MODE_3 = 3 //+ 2 + 40x24 + text + 10 + 760 B + 40 + 8 + -const byte MODE_4 = 4 //+ 5 + 40x24 + text + 8 + 960 B + 40 + 8 + -const byte MODE_5 = 5 //+ 5 + 40x12 + text + 16 + 480 B + 40 + 8 + -const byte MODE_6 = 6 //+ 5 + 20x24 + text + 8 + 480 B + 20 + 8 + -const byte MODE_7 = 7 //+ 5 + 20x12 + text + 16 + 240 B + 20 + 8 + -const byte MODE_8 = 8 //+ 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + -const byte MODE_9 = 9 //+ 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + -const byte MODE_A = $a //+ 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + -const byte MODE_B = $b //+ 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + -const byte MODE_C = $c //+ 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + -const byte MODE_D = $d //+ 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + -const byte MODE_E = $e //+ 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + -const byte MODE_F = $f //+ 2 + 320x192 + graphics + 1 + 7680 B + 40 + 1 + - //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + //+ BASIC + colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixel + +const byte MODE_2 = 2 //+ 0 + 2 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_3 = 3 //+ - + 2 + 40x24 + text + 10 + 760 B + 40 + 8 + +const byte MODE_4 = 4 //+ 12 + 5 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_5 = 5 //+ 13 + 5 + 40x12 + text + 16 + 480 B + 40 + 8 + +const byte MODE_6 = 6 //+ 1 + 5 + 20x24 + text + 8 + 480 B + 20 + 8 + +const byte MODE_7 = 7 //+ 2 + 5 + 20x12 + text + 16 + 240 B + 20 + 8 + +const byte MODE_8 = 8 //+ 3 + 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + +const byte MODE_9 = 9 //+ 4 + 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + +const byte MODE_A = $a //+ 5 + 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + +const byte MODE_B = $b //+ 6 + 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + +const byte MODE_C = $c //+ 14 + 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + +const byte MODE_D = $d //+ 7 + 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + +const byte MODE_E = $e //+ 15 + 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + +const byte MODE_F = $f //+8,9,10,11+ 2 + 320x192 + graphics + 1 + 7680 B + 40 + 1 + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ const byte BLANK_1 = 0 const byte BLANK_2 = $10 From f9fc001c9a4001da3d8adf4413fa1508736d6e16 Mon Sep 17 00:00:00 2001 From: zbyti Date: Mon, 28 Sep 2020 22:17:34 +0200 Subject: [PATCH 5/6] ANTIC Display List BASIC modes forrmating --- include/a8_antic.mfk | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/a8_antic.mfk b/include/a8_antic.mfk index add4da7a..0bbf98f5 100644 --- a/include/a8_antic.mfk +++ b/include/a8_antic.mfk @@ -14,20 +14,20 @@ const byte JMP = 1 // Jump command - followed by two bytes indica const byte JVB = $41 // Jump and wait for Vertical Blank - suspends the display list until vertical blank and then jumps. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - //+ BASIC + colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixel + -const byte MODE_2 = 2 //+ 0 + 2 + 40x24 + text + 8 + 960 B + 40 + 8 + -const byte MODE_3 = 3 //+ - + 2 + 40x24 + text + 10 + 760 B + 40 + 8 + -const byte MODE_4 = 4 //+ 12 + 5 + 40x24 + text + 8 + 960 B + 40 + 8 + -const byte MODE_5 = 5 //+ 13 + 5 + 40x12 + text + 16 + 480 B + 40 + 8 + -const byte MODE_6 = 6 //+ 1 + 5 + 20x24 + text + 8 + 480 B + 20 + 8 + -const byte MODE_7 = 7 //+ 2 + 5 + 20x12 + text + 16 + 240 B + 20 + 8 + -const byte MODE_8 = 8 //+ 3 + 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + -const byte MODE_9 = 9 //+ 4 + 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + -const byte MODE_A = $a //+ 5 + 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + -const byte MODE_B = $b //+ 6 + 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + -const byte MODE_C = $c //+ 14 + 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + -const byte MODE_D = $d //+ 7 + 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + -const byte MODE_E = $e //+ 15 + 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + + //+ BASIC + colors + resolution + display mode + scan lines per row + screen memory + bytes per line + bits per pixel + +const byte MODE_2 = 2 //+ 0 + 2 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_3 = 3 //+ - + 2 + 40x24 + text + 10 + 760 B + 40 + 8 + +const byte MODE_4 = 4 //+ 12 + 5 + 40x24 + text + 8 + 960 B + 40 + 8 + +const byte MODE_5 = 5 //+ 13 + 5 + 40x12 + text + 16 + 480 B + 40 + 8 + +const byte MODE_6 = 6 //+ 1 + 5 + 20x24 + text + 8 + 480 B + 20 + 8 + +const byte MODE_7 = 7 //+ 2 + 5 + 20x12 + text + 16 + 240 B + 20 + 8 + +const byte MODE_8 = 8 //+ 3 + 4 + 40x24 + graphics + 8 + 240 B + 10 + 2 + +const byte MODE_9 = 9 //+ 4 + 2 + 80x48 + graphics + 4 + 480 B + 10 + 1 + +const byte MODE_A = $a //+ 5 + 4 + 80x48 + graphics + 4 + 960 B + 20 + 2 + +const byte MODE_B = $b //+ 6 + 2 + 160x96 + graphics + 2 + 1920 B + 20 + 1 + +const byte MODE_C = $c //+ 14 + 2 + 160x192 + graphics + 1 + 3840 B + 20 + 1 + +const byte MODE_D = $d //+ 7 + 4 + 160x96 + graphics + 2 + 3840 B + 40 + 2 + +const byte MODE_E = $e //+ 15 + 4 + 160x192 + graphics + 1 + 7680 B + 40 + 2 + const byte MODE_F = $f //+8,9,10,11+ 2 + 320x192 + graphics + 1 + 7680 B + 40 + 1 + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ From 802424316c38e605164bb5b4e41226069db5e0ea Mon Sep 17 00:00:00 2001 From: zbyti Date: Mon, 28 Sep 2020 22:54:58 +0200 Subject: [PATCH 6/6] ANTIC Display List BASIC fix --- include/a8_antic.mfk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/a8_antic.mfk b/include/a8_antic.mfk index 0bbf98f5..d0442868 100644 --- a/include/a8_antic.mfk +++ b/include/a8_antic.mfk @@ -8,8 +8,8 @@ // THE DISPLAY LIST CANNOT CROSS A 1K BYTE MEMORY BOUNDARY UNLESS A JUMP INSTRUCTION IS USED! const byte LMS = $40 // Load memory scan 10-bit counter, $fff boundary. const byte DLI = $80 // Display list interrupt - Interrupt CPU at beginning of last scan line. -const byte HSCROL = $10 // Enable vertical scrolling. -const byte VSCROL = $20 // Enable horizontal scrolling. +const byte HSCROL = $10 // Enable horizontal scrolling. +const byte VSCROL = $20 // Enable vertical scrolling. const byte JMP = 1 // Jump command - followed by two bytes indicating the new instruction pointer for the display list. const byte JVB = $41 // Jump and wait for Vertical Blank - suspends the display list until vertical blank and then jumps.