From d42ce3b59eab61610128b3feb3207267a63eae98 Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 1 Oct 2009 14:09:19 +0000 Subject: [PATCH] Lynx updates by Karri Kaksonen. git-svn-id: svn://svn.cc65.org/cc65/trunk@4285 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- include/lynx.h | 16 ---- libsrc/lynx/Makefile | 3 +- libsrc/lynx/lynx-160-102-16.s | 16 ++-- libsrc/lynx/upload.s | 155 ---------------------------------- src/ld65/cfg/lynx.cfg | 2 +- 5 files changed, 10 insertions(+), 182 deletions(-) delete mode 100644 libsrc/lynx/upload.s diff --git a/include/lynx.h b/include/lynx.h index b669f78a1..c51d4cbf1 100644 --- a/include/lynx.h +++ b/include/lynx.h @@ -99,22 +99,6 @@ void __fastcall__ lynx_eeprom_erase (unsigned char cell); /* Clear the word at the given address */ - -/*****************************************************************************/ -/* TGI extras */ -/*****************************************************************************/ - - - -#define tgi_sprite(spr) tgi_ioctl(0, (unsigned)(spr)) -#define tgi_flip() tgi_ioctl(1, 0) -#define tgi_setbgcolor(bgcol) tgi_ioctl(2, (unsigned)(bgcol)) -#define tgi_setframerate(rate) tgi_ioctl(3, (unsigned)(rate)) -#define tgi_busy() tgi_ioctl(4, 0) -#define tgi_updatedisplay() tgi_ioctl(4, 1) -#define tgi_setvblhook(addr) tgi_ioctl(5, (unsigned)(addr)) - - /*****************************************************************************/ /* TGI extras */ /*****************************************************************************/ diff --git a/libsrc/lynx/Makefile b/libsrc/lynx/Makefile index 6f1aa071e..8a75cfba1 100644 --- a/libsrc/lynx/Makefile +++ b/libsrc/lynx/Makefile @@ -52,8 +52,7 @@ OBJS = cgetc.o \ extzp.o \ kbhit.o \ mainargs.o \ - sysuname.o \ - upload.o + sysuname.o #-------------------------------------------------------------------------- # Drivers diff --git a/libsrc/lynx/lynx-160-102-16.s b/libsrc/lynx/lynx-160-102-16.s index 625c01fb7..864ab554f 100644 --- a/libsrc/lynx/lynx-160-102-16.s +++ b/libsrc/lynx/lynx-160-102-16.s @@ -387,12 +387,12 @@ CLEAR: lda #$de20 + ldy #<$e018 ; page 0 + ldx #>$e018 bra @L2 @L1: - ldy #<$be40 ; page 1 - ldx #>$be40 + ldy #<$c038 ; page 1 + ldx #>$c038 @L2: sty VIEWPAGEL ; Save viewpage for getpixel stx VIEWPAGEH @@ -422,12 +422,12 @@ SETVIEWPAGE: SETDRAWPAGE: cmp #1 beq @L1 ; page == maxpages-1 - lda #<$de20 ; page 0 - ldx #>$de20 + lda #<$e018 ; page 0 + ldx #>$e018 bra @L2 @L1: - lda #<$be40 ; page 1 - ldx #>$be40 + lda #<$c038 ; page 1 + ldx #>$c038 @L2: sta DRAWPAGEL stx DRAWPAGEH diff --git a/libsrc/lynx/upload.s b/libsrc/lynx/upload.s deleted file mode 100644 index 4ba78b3b8..000000000 --- a/libsrc/lynx/upload.s +++ /dev/null @@ -1,155 +0,0 @@ -; *** -; CC65 Lynx Library -; -; Originally by Bastian Schick -; http://www.geocities.com/SiliconValley/Byte/4242/lynx/ -; -; Ported to cc65 (http://www.cc65.org) by -; Shawn Jefferson, June 2004 -; -; *** -; -; void install_uploader(unsigned char divider); -; -; Installs an interrupt handler that hooks the comlynx rx/tx interrupts to -; allow upload of code to the lynx from another computer via the comlynx -; cable. divider values are in lynx.h -; -; Loader is installed under the mikey chip at $FE00. -; - - .include "lynx.inc" - .export _lynx_install_uploader - .import _install_irq - .import popa, pusha - - -; ------------------------------------------------------------------------ - -.segment "EXTZP": zeropage - -load_len: .res 2 -load_ptr: .res 2 -load_ptr2: .res 2 - - - .code - -; ------------------------------------------------------------------------ -; The following code will get moved to $FE00 when installing the uploader. - -.proc Loader - -.org $fe00 - -run: ldy #4 -loop0: jsr read_byte - sta load_len-1,y - dey - bne loop0 ; get destination and length - tax ; lowbyte of length - - lda load_ptr - sta load_ptr2 - lda load_ptr+1 - sta load_ptr2+1 - -loop1: inx - bne cont1 - inc load_len+1 - bne cont1 - jmp (load_ptr) - -cont1: jsr read_byte - sta (load_ptr2),y - sta PALETTE ; feedback ;-) - iny - bne loop1 - inc load_ptr2+1 - bra loop1 - -read_byte: - bit SERCTL - bvc read_byte - lda SERDAT - rts - -.reloc - -.endproc - - -; ------------------------------------------------------------------------ - -.code - -_lynx_install_uploader: - - ldx #.sizeof(Loader)-1 ; put Loader in the right place -loop: lda Loader,x ; x is length of loader - sta Loader::run,x - dex - bpl loop - -; -; install serial-irq vector -; - lda #4 - jsr pusha - lda #UpLoader - jsr _install_irq ; set vector -; -; set baudrate -; - jsr popa ; get divider - sta $fd10 - lda #%00011000 ; Baudrate = 1MHz/16/(divider+1) - sta $fd11 -; -; set ComLynx parameters -; - lda #%00011101 ; even par - sta SERCTL ; set 8E1 -; -; clear Rx-buffer -; -clear: bit SERCTL - bvc ok0 - ldx SERDAT - bra clear -; -; enable Rx-interrupt -; -ok0: ora #$40 - sta SERCTL - rts - - -; ------------------------------------------------------------------------ -; Rx-IRQ-handler - -UpLoader: - lda SERDAT ; wait for the start sequence - bit flag ; already seen $81 ? - bpl again ; >= 0 => no - cmp #$50 ; "P" ? - bne again ; not correct, so clear flag - jmp Loader::run - -again: stz flag - cmp #$81 - bne exit - sta flag -; -; last action : clear interrupt -; -exit: lda #$10 - sta INTRST - rts - - -.data - -flag: .byte 0 - diff --git a/src/ld65/cfg/lynx.cfg b/src/ld65/cfg/lynx.cfg index 6c087c141..c277528d7 100644 --- a/src/ld65/cfg/lynx.cfg +++ b/src/ld65/cfg/lynx.cfg @@ -1,7 +1,7 @@ MEMORY { ZP: start = $0000, size = $0100, type = rw, define = yes; HEADER: start = $0000, size = $000A, file = %O; - RAM: start = $0400, size = $BA3F, define = yes, file = %O; + RAM: start = $0400, size = $BC38, define = yes, file = %O; } SEGMENTS { EXEHDR: load = HEADER, type = ro; -- 2.39.5