mirror of
https://github.com/cc65/cc65.git
synced 2025-02-26 23:30:03 +00:00
Lynx updates by Karri Kaksonen.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4285 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
ce778c4bb8
commit
d42ce3b59e
@ -99,22 +99,6 @@ void __fastcall__ lynx_eeprom_erase (unsigned char cell);
|
|||||||
/* Clear the word at the given address */
|
/* 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 */
|
/* TGI extras */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -52,8 +52,7 @@ OBJS = cgetc.o \
|
|||||||
extzp.o \
|
extzp.o \
|
||||||
kbhit.o \
|
kbhit.o \
|
||||||
mainargs.o \
|
mainargs.o \
|
||||||
sysuname.o \
|
sysuname.o
|
||||||
upload.o
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Drivers
|
# Drivers
|
||||||
|
@ -387,12 +387,12 @@ CLEAR: lda #<cls_sprite
|
|||||||
SETVIEWPAGE:
|
SETVIEWPAGE:
|
||||||
cmp #1
|
cmp #1
|
||||||
beq @L1 ; page == maxpages-1
|
beq @L1 ; page == maxpages-1
|
||||||
ldy #<$de20 ; page 0
|
ldy #<$e018 ; page 0
|
||||||
ldx #>$de20
|
ldx #>$e018
|
||||||
bra @L2
|
bra @L2
|
||||||
@L1:
|
@L1:
|
||||||
ldy #<$be40 ; page 1
|
ldy #<$c038 ; page 1
|
||||||
ldx #>$be40
|
ldx #>$c038
|
||||||
@L2:
|
@L2:
|
||||||
sty VIEWPAGEL ; Save viewpage for getpixel
|
sty VIEWPAGEL ; Save viewpage for getpixel
|
||||||
stx VIEWPAGEH
|
stx VIEWPAGEH
|
||||||
@ -422,12 +422,12 @@ SETVIEWPAGE:
|
|||||||
SETDRAWPAGE:
|
SETDRAWPAGE:
|
||||||
cmp #1
|
cmp #1
|
||||||
beq @L1 ; page == maxpages-1
|
beq @L1 ; page == maxpages-1
|
||||||
lda #<$de20 ; page 0
|
lda #<$e018 ; page 0
|
||||||
ldx #>$de20
|
ldx #>$e018
|
||||||
bra @L2
|
bra @L2
|
||||||
@L1:
|
@L1:
|
||||||
lda #<$be40 ; page 1
|
lda #<$c038 ; page 1
|
||||||
ldx #>$be40
|
ldx #>$c038
|
||||||
@L2:
|
@L2:
|
||||||
sta DRAWPAGEL
|
sta DRAWPAGEL
|
||||||
stx DRAWPAGEH
|
stx DRAWPAGEH
|
||||||
|
@ -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
|
|
||||||
ldx #>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
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $0000, size = $0100, type = rw, define = yes;
|
ZP: start = $0000, size = $0100, type = rw, define = yes;
|
||||||
HEADER: start = $0000, size = $000A, file = %O;
|
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 {
|
SEGMENTS {
|
||||||
EXEHDR: load = HEADER, type = ro;
|
EXEHDR: load = HEADER, type = ro;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user