From: Alan Cox Date: Thu, 28 May 2015 00:11:09 +0000 (+0100) Subject: dragon-nx-32: 256x192 bitmapped mode X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=31abacd92497c1217b7151b7e8e7a2ecce7f50b7;p=FUZIX.git dragon-nx-32: 256x192 bitmapped mode We might want to use 40 char or 64 char but possibly not on composite video 8) Must figure out how to set the border black. --- diff --git a/Kernel/platform-dragon-nx32/Makefile b/Kernel/platform-dragon-nx32/Makefile index bb0d3c55..81814ce8 100644 --- a/Kernel/platform-dragon-nx32/Makefile +++ b/Kernel/platform-dragon-nx32/Makefile @@ -2,7 +2,7 @@ CSRCS = devlpr.c devtty.c devfd.c devdw.c CSRCS += devices.c main.c libc.c -ASRCS = crt0.s dragon.s mem-nx32.s +ASRCS = crt0.s dragon.s mem-nx32.s video.s ASRCS += tricks.s commonmem.s usermem_sam.s floppy.s drivewire.s COBJS = $(CSRCS:.c=$(BINEXT)) @@ -32,5 +32,5 @@ image: ../devio.o ../filesys.o ../process.o ../inode.o ../syscall_fs.o \ ../syscall_proc.o ../syscall_other.o ../mm.o ../swap.o \ ../tty.o ../devsys.o ../usermem.o ../syscall_fs2.o ../syscall_exec16.o \ - devlpr.o devtty.o libc.o ../vt.o + devlpr.o devtty.o libc.o ../vt.o video.o ../font8x8.o ../tools/pad256 ../fuzix.bin diff --git a/Kernel/platform-dragon-nx32/config.h b/Kernel/platform-dragon-nx32/config.h index 74a94dc8..cb392f92 100644 --- a/Kernel/platform-dragon-nx32/config.h +++ b/Kernel/platform-dragon-nx32/config.h @@ -10,7 +10,7 @@ #undef CONFIG_SINGLETASK /* Pure swap */ #undef CONFIG_SWAP_ONLY -/* Banked Kernel: need to fix GCC first */ + #define CONFIG_BANK_FIXED #define MAX_MAPS 4 #define MAP_SIZE 0x7C00U @@ -27,15 +27,13 @@ /* Video terminal, not a serial tty */ #define CONFIG_VT -/* Simple text mode */ -#define CONFIG_VT_SIMPLE +#define CONFIG_FONT8X8 /* Vt definitions */ -#define VT_BASE (uint8_t *)0x0400 /* Default video text mode base */ #define VT_WIDTH 32 -#define VT_HEIGHT 16 +#define VT_HEIGHT 24 #define VT_RIGHT 31 -#define VT_BOTTOM 15 -#define VT_INITIAL_LINE 4 +#define VT_BOTTOM 23 +#define VT_INITIAL_LINE 0 extern unsigned char vt_mangle_6847(unsigned char c); #define VT_MAP_CHAR(x) vt_mangle_6847(x) diff --git a/Kernel/platform-dragon-nx32/dragon.s b/Kernel/platform-dragon-nx32/dragon.s index 2ec72dbf..96c96523 100644 --- a/Kernel/platform-dragon-nx32/dragon.s +++ b/Kernel/platform-dragon-nx32/dragon.s @@ -11,6 +11,7 @@ .globl fd_nmi_handler .globl size_ram .globl null_handler + .globl _vid256x192 ; exported debugging tools .globl _trap_monitor @@ -49,6 +50,8 @@ init_hardware: lda 0xFF03 ora #1 sta 0xFF03 + jsr _vid256x192 + jsr _vtinit rts diff --git a/Kernel/platform-dragon-nx32/fuzix.link b/Kernel/platform-dragon-nx32/fuzix.link index 4721232a..5d076d3e 100644 --- a/Kernel/platform-dragon-nx32/fuzix.link +++ b/Kernel/platform-dragon-nx32/fuzix.link @@ -1,7 +1,7 @@ define basesympat __sectionbase_%s__ define lensympat __sectionlen_%s__ section .vectors load 0x0100 -section .start load 0x0800 +section .start load 0x1c00 section .common section .text2 section .discard diff --git a/Kernel/platform-dragon-nx32/video.s b/Kernel/platform-dragon-nx32/video.s index 71f2048b..0e4c997e 100644 --- a/Kernel/platform-dragon-nx32/video.s +++ b/Kernel/platform-dragon-nx32/video.s @@ -22,6 +22,9 @@ ; ; Dragon video drivers ; +; SAM V2=1 V1=1 V0=- +; 6847 A/G=1 GM2=1 GM1=1 GM0=1 +; _vid256x192: sta $ffc0 sta $ffc3 @@ -37,16 +40,9 @@ _vid256x192: ; A = X, B = Y ; vidaddr: - ldy #VIDEO_BASE ; X is now the right column top line - leay a,y - clra - rorb ; 3 right is as good as 5 left - rora - rorb - rora - rorb - rora ; D is now 32 * b - leay d,y + ldy #VIDEO_BASE + exg a,b + leay d,y ; 256 x Y + X rts ; ; plot_char(int8_t y, int8_t x, uint16_t c) @@ -85,9 +81,9 @@ _plot_char: ; ; void scroll_up(void) ; -_scroll_up +_scroll_up: pshs y - ldy VIDEO_BASE + ldy #VIDEO_BASE leax 256,y vscrolln: ; Unrolled line by line copy @@ -123,7 +119,7 @@ vscrolln: std ,y++ ldd ,x++ std ,y++ - cmpy video_endptr + cmpx video_endptr bne vscrolln puls y,pc @@ -132,7 +128,7 @@ vscrolln: ; _scroll_down: pshs y - ldy VIDEO_END + ldy #VIDEO_END leax -256,y vscrolld: ; Unrolled line by line loop @@ -196,7 +192,7 @@ clearnext: clr 192,x clr 224,x leax 1,x - deca + decb bne clearnext puls y,pc ; @@ -209,6 +205,9 @@ _clear_lines: tfr y,x clra clrb + lsl 4,s + lsl 4,s + lsl 4,s wipel: std ,x++ std ,x++ @@ -230,7 +229,7 @@ wipel: bne wipel puls y,pc -_cursor_on +_cursor_on: pshs y lda 4,s jsr vidaddr @@ -238,7 +237,7 @@ _cursor_on puls y stx cursor_save ; Fall through -_cursor_off +_cursor_off: ldx cursor_save com ,x com 32,x