From f70d503001632d83275db378aec0956adfc1f201 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 22 Jan 2021 20:37:24 +0100 Subject: [PATCH] One demo program for vera modes. --- src/test/kc/examples/cx16/cx16-vera.c | 44 ++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/src/test/kc/examples/cx16/cx16-vera.c b/src/test/kc/examples/cx16/cx16-vera.c index c7e98ee91..749a86c9e 100644 --- a/src/test/kc/examples/cx16/cx16-vera.c +++ b/src/test/kc/examples/cx16/cx16-vera.c @@ -111,6 +111,12 @@ void main() { void tile_16_x_16_8BPP_256_color() { + vera_layer_mode_text( 1, 0x00000, 0x0F800, 128, 128, 8, 8, 256 ); + screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + byte tiles[256] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -228,6 +234,12 @@ void tile_8_x_8_8BPP_256_color() { vera_layer_mode_tile(0, 0x04000, 0x14000, 128, 128, 8, 8, 8); vera_display_set_scale_none(); + vera_layer_mode_text( 1, 0x00000, 0x0F800, 128, 128, 8, 8, 256 ); + screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + byte tiles[64] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -306,6 +318,12 @@ void tile_16_x_16_4BPP_16_color() { vera_layer_mode_tile(0, 0x04000, 0x14000, 128, 128, 16, 16, 4); vera_display_set_scale_none(); + vera_layer_mode_text( 1, 0x00000, 0x0F800, 128, 128, 8, 8, 256 ); + screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + byte tiles[2048] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -513,6 +531,12 @@ void tile_8_x_8_4BPP_16_color() { vera_layer_mode_tile(0, 0x04000, 0x14000, 128, 128, 8, 8, 4); vera_display_set_scale_none(); + vera_layer_mode_text( 1, 0x00000, 0x0F800, 128, 128, 8, 8, 256 ); + screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + byte tiles[512] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -622,6 +646,12 @@ void tile_16_x_16_2BPP_4_color() { vera_layer_mode_tile(0, 0x04000, 0x14000, 128, 128, 16, 16, 2); vera_display_set_scale_none(); + vera_layer_mode_text( 1, 0x00000, 0x0F800, 128, 128, 8, 8, 256 ); + screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + byte tiles[256] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -698,6 +728,12 @@ void tile_8_x_8_2BPP_4_color() { vera_layer_mode_tile(0, 0x04000, 0x14000, 128, 128, 8, 8, 2); vera_display_set_scale_none(); + vera_layer_mode_text( 1, 0x00000, 0x0F800, 128, 128, 8, 8, 256 ); + screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + byte tiles[64] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55, 0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA, @@ -788,6 +824,11 @@ void text_8_x_8_1BPP_16_color() { vera_display_set_scale_none(); screenlayer(1); + textcolor(WHITE); + bgcolor(BLACK); + clrscr(); + + for(byte c:0..255) { bgcolor(c); printf(" ++++++ "); @@ -823,7 +864,6 @@ void bitmap_320_x_240_1BPP() { vera_layer_mode_bitmap(0, (dword)0x00000, 320, 1); vera_layer_mode_tile(1, 0x14000, 0x1F000, 128, 64, 8, 8, 1); - vera_display_set_scale_none(); screenlayer(1); textcolor(WHITE); @@ -874,6 +914,8 @@ void bitmap_320_x_240_1BPP() { void bitmap_640_x_480_1BPP() { + vera_display_set_scale_none(); + // Before we configure the bitmap pane into vera memory we need to re-arrange a few things! // It is better to load all in bank 0, but then there is an issue. // So the default CX16 character set is located in bank 0, at address 0xF800.