diff --git a/Makefile b/Makefile index 47fbb07..6d83853 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,10 @@ $(BUILD_DIR)/%.o : $(SRC_DIR)/%.c @$(ARMGNU)-gcc $(CFLAGS) -c $< -o $@ @echo "CC $<" +$(BUILD_DIR)/%.o : $(SRC_DIR)/%.S + @$(ARMGNU)-gcc $(CFLAGS) -c $< -o $@ + @echo "AS $<" + $(BUILD_DIR)/%.o : $(SRC_DIR)/%.s @$(ARMGNU)-gcc $(CFLAGS) -c $< -o $@ @echo "AS $<" diff --git a/bin/kernel.img b/bin/kernel.img index 4f9fb6d..748b5b5 100755 Binary files a/bin/kernel.img and b/bin/kernel.img differ diff --git a/bin/kernel7.img b/bin/kernel7.img index 8a256fb..3cc6948 100755 Binary files a/bin/kernel7.img and b/bin/kernel7.img differ diff --git a/bin/kernel8-32.img b/bin/kernel8-32.img index b1d5a24..f55e97e 100755 Binary files a/bin/kernel8-32.img and b/bin/kernel8-32.img differ diff --git a/bin/recovery7l.img b/bin/recovery7l.img index d073b00..e1ce254 100755 Binary files a/bin/recovery7l.img and b/bin/recovery7l.img differ diff --git a/doc/terminal_codes.txt b/doc/terminal_codes.txt index 8401d58..709e154 100644 --- a/doc/terminal_codes.txt +++ b/doc/terminal_codes.txt @@ -64,11 +64,24 @@ Scrolling Settings -[m Reset color attributes (white on black) +[m Reset color attributes (gray on black) +[;;m Set display attributes (1 to 3 params, so and are optional) + 0 = Reset all attributes + 1 = increase intensity (only in 4 byte mode colors 0..7) + 2 = decrease intensity (only in 4 byte mode colors 8..15) + 7 = Turn on reverse color + 22= shifts color from dim to bright (only in 4 byte mode 0..7) + 27= Turn off reverse color + 30 ... 37 set foreground color to palette color 0 ... 7 + 40 ... 47 set background color to palette color 0 ... 7 + 90 ... 97 set high intensity foreground color (palette color 8 ... 15) + 100 ... 107 set high intensity background color (palette color 8 ... 15) [38;5;m Set foreground color to (0-255) +[38;6;m Set foreground color to (0-255) and save as default [48;5;m Set background color to (0-255) +[48;6;m Set background color to (0-255) and save as default [58;5;m Set transparent color to (0-255) -[=0m Reset color attributes (white on black) and sets normal drawing (sprites and characters) +[=0m Reset color attributes (gray on black) and sets normal drawing (sprites and characters) [=1m Set XOR drawing (sprites and characters) [=2m Set transparent drawing (sprites and characters) [=0f Set 8x8 font diff --git a/make.bat b/make.bat index 9c81c5c..a59c988 100644 --- a/make.bat +++ b/make.bat @@ -30,6 +30,7 @@ if "%RPI%"=="4" ( echo Compiling for Pi generation %RPI% ::Get Repository Version +md build 2>NUL del build\tmp.txt 2>NUL git describe --all --long > build\tmp.txt set /p GIT_DESCRIBE=cmd_params_size == 1 && state->cmd_params[0]==0 ) - { - gfx_set_bg(0); - gfx_set_fg(15); - goto back_to_normal; - } if( state->cmd_params_size == 3 && - state->cmd_params[0]==38 && - state->cmd_params[1]==5 ) + state->cmd_params[0]==38 ) { - gfx_set_fg( state->cmd_params[2] ); + if (state->cmd_params[1]==5) + { + // esc[38;5;colm + gfx_set_fg( state->cmd_params[2] ); + + } + else if (state->cmd_params[1]==6) + { + // esc[38;6;colm + gfx_set_fg( state->cmd_params[2] ); + gfx_set_default_fg(state->cmd_params[2]); + } goto back_to_normal; } - if( state->cmd_params_size == 3 && - state->cmd_params[0]==48 && - state->cmd_params[1]==5 ) + else if( state->cmd_params_size == 3 && + state->cmd_params[0]==48 ) { - gfx_set_bg( state->cmd_params[2] ); + if (state->cmd_params[1]==5) + { + // esc[48;5;colm + gfx_set_bg( state->cmd_params[2] ); + } + else if (state->cmd_params[1]==6) + { + // esc[48;6;colm + gfx_set_bg( state->cmd_params[2] ); + gfx_set_default_bg(state->cmd_params[2]); + } goto back_to_normal; } - if( state->cmd_params_size == 3 && + else if( state->cmd_params_size == 3 && state->cmd_params[0]==58 && state->cmd_params[1]==5 ) { + // esc[58;5;colm gfx_set_transparent_color( state->cmd_params[2] ); goto back_to_normal; } + else if (state->cmd_params_size == 0) + { + // esc[m + gfx_set_bg(ctx.default_bg); + gfx_set_fg(ctx.default_fg); + ctx.reverse = 0; // sets reverse to 'normal' for the current defaults. + goto back_to_normal; + } + else + { + // esc[par1;par2;par3m (actually one to 3 params) + if (state->cmd_params_size > 3) state->cmd_params_size = 3; // limit to 3 + for (unsigned int i=0; icmd_params_size; i++) + { + switch (state->cmd_params[i]) + { + case 0: + // reset + gfx_set_bg(ctx.default_bg); + gfx_set_fg(ctx.default_fg); + ctx.reverse = 0; // sets reverse to 'normal' for the current defaults. + break; + case 1: + // increase intensity - as 22m for 4byte TODO: 256 Color pal + if (ctx.fg <= 7) gfx_set_fg(ctx.fg+8); + break; + case 2: + // decrease intensity -transpose dim fg colors from bright TODO 255 color pal + if (ctx.fg >= 8) gfx_set_fg(ctx.fg-8); + break; + case 7: + // toggle text mode to 'reverse' + if (ctx.reverse == 0) + { + gfx_swap_fg_bg(); + ctx.reverse = 1; + } + break; + case 22: + // transpose bright fg colors from dim, this is interesting it is meant to be 'normal' + // but is often implemented as 'bright', this is needed for gorilla.bas compatiblity. + // function is fliped since the normal terminal color is often 'dim'; in this case it is. + // TODO: 256 color (how would this have effect?) + if (ctx.fg <= 7) gfx_set_fg(ctx.fg+8); + break; + case 27: + // toggle text mode to 'normal' + if (ctx.reverse == 1) + { + gfx_swap_fg_bg(); + ctx.reverse = 0; + } + break; + case 30 ... 37: + // fg color + gfx_set_fg(state->cmd_params[i]-30); + break; + case 40 ... 47: + // bg color + gfx_set_bg(state->cmd_params[i]-40); + break; + case 90 ... 97: + // bright foreground color 8 to 15 + gfx_set_fg(state->cmd_params[i]-82); + break; + case 100 ... 107: + // bright background color 8 to 15 + gfx_set_bg(state->cmd_params[i]-92); + break; + } + } + goto back_to_normal; + } goto back_to_normal; break; diff --git a/src/gfx.h b/src/gfx.h index 1e06e51..48f5c03 100644 --- a/src/gfx.h +++ b/src/gfx.h @@ -14,6 +14,8 @@ // gfx functions extern void gfx_set_env( void* p_framebuffer, unsigned int width, unsigned int height, unsigned int bpp, unsigned int pitch, unsigned int size ); +extern void gfx_set_default_bg( GFX_COL col ); +extern void gfx_set_default_fg( GFX_COL col ); extern void gfx_set_bg( GFX_COL col ); extern void gfx_set_fg( GFX_COL col ); extern void gfx_swap_fg_bg();