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))
../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
#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
/* 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)
.globl fd_nmi_handler
.globl size_ram
.globl null_handler
+ .globl _vid256x192
; exported debugging tools
.globl _trap_monitor
lda 0xFF03
ora #1
sta 0xFF03
+ jsr _vid256x192
+ jsr _vtinit
rts
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
;
; Dragon video drivers
;
+; SAM V2=1 V1=1 V0=-
+; 6847 A/G=1 GM2=1 GM1=1 GM0=1
+;
_vid256x192:
sta $ffc0
sta $ffc3
; 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)
;
; 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
std ,y++
ldd ,x++
std ,y++
- cmpy video_endptr
+ cmpx video_endptr
bne vscrolln
puls y,pc
;
_scroll_down:
pshs y
- ldy VIDEO_END
+ ldy #VIDEO_END
leax -256,y
vscrolld:
; Unrolled line by line loop
clr 192,x
clr 224,x
leax 1,x
- deca
+ decb
bne clearnext
puls y,pc
;
tfr y,x
clra
clrb
+ lsl 4,s
+ lsl 4,s
+ lsl 4,s
wipel:
std ,x++
std ,x++
bne wipel
puls y,pc
-_cursor_on
+_cursor_on:
pshs y
lda 4,s
jsr vidaddr
puls y
stx cursor_save
; Fall through
-_cursor_off
+_cursor_off:
ldx cursor_save
com ,x
com 32,x