mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-06-06 02:29:32 +00:00
Distilled IP65 out of NETBOOT65.
This commit is contained in:
parent
eae8c4028d
commit
ecdaac2ff8
24
Makefile
24
Makefile
|
@ -1,24 +0,0 @@
|
||||||
.PHONY: client clean dist distclean
|
|
||||||
|
|
||||||
all: client dist dist-ip65
|
|
||||||
|
|
||||||
client:
|
|
||||||
make -C client all
|
|
||||||
|
|
||||||
clean:
|
|
||||||
make -C client clean
|
|
||||||
rm -rf dist/netboot65
|
|
||||||
rm -rf dist/ip65
|
|
||||||
rm -f dist/*.zip
|
|
||||||
|
|
||||||
dist:
|
|
||||||
rm -rf dist/netboot65
|
|
||||||
ruby dist/make_dist.rb
|
|
||||||
|
|
||||||
dist-ip65:
|
|
||||||
rm -rf dist/ip65
|
|
||||||
ruby dist/make_dist_ip65.rb
|
|
||||||
|
|
||||||
distclean:
|
|
||||||
make -C client distclean
|
|
||||||
rm -f *~
|
|
|
@ -1,25 +1,25 @@
|
||||||
|
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $00, size = $08, type = rw, define = yes; #zero size as we hand allocate all ZP locations
|
ZP: start = $00, size = $08, type = rw, define = yes; #zero size as we hand allocate all ZP locations
|
||||||
IP65ZP: start = $E0, size = $0, type = rw, define = yes; #zero size as we hand allocate all ZP locations
|
IP65ZP: start = $E0, size = $0, type = rw, define = yes; #zero size as we hand allocate all ZP locations
|
||||||
HEADER: start = $0000, size = $10, file = %O;
|
HEADER: start = $0000, size = $10, file = %O;
|
||||||
RAM: start = $800, size = $8000, file = %O, define=yes;
|
RAM: start = $800, size = $8000, file = %O, define=yes;
|
||||||
PAGE3: start = $2C0, size = 272;
|
PAGE3: start = $2C0, size = 272;
|
||||||
}
|
}
|
||||||
SEGMENTS {
|
SEGMENTS {
|
||||||
EXEHDR: load = HEADER, type = ro;
|
EXEHDR: load = HEADER, type = ro;
|
||||||
STARTUP: load = RAM,run=RAM, type = ro, define = yes, optional=yes;
|
STARTUP: load = RAM,run=RAM, type = ro, define = yes, optional=yes;
|
||||||
CODE: load = RAM, run=RAM, type = ro, define = yes;
|
CODE: load = RAM, run=RAM, type = ro, define = yes;
|
||||||
RODATA: load = RAM, run=RAM, type = ro , define = yes;
|
RODATA: load = RAM, run=RAM, type = ro , define = yes;
|
||||||
IP65_DEFAULTS: load = RAM, run=RAM, type = ro , define = yes;
|
IP65_DEFAULTS: load = RAM, run=RAM, type = ro , define = yes;
|
||||||
DATA: load = RAM, run=RAM, type = rw , define = yes;
|
DATA: load = RAM, run=RAM, type = rw , define = yes;
|
||||||
PAGE3: load = RAM,run=PAGE3, type = rw, define = yes, optional=yes;
|
PAGE3: load = RAM,run=PAGE3, type = rw, define = yes, optional=yes;
|
||||||
HTTP_VARS: load = RAM, run=RAM, type = rw, optional=yes;
|
HTTP_VARS: load = RAM, run=RAM, type = rw, optional=yes;
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
TCP_VARS: load = RAM, type = bss, optional=yes;
|
||||||
APP_SCRATCH: load = RAM, type = bss , optional=yes;
|
APP_SCRATCH: load = RAM, type = bss , optional=yes;
|
||||||
BSS: load=RAM, type = bss, define = yes;
|
BSS: load=RAM, type = bss, define = yes;
|
||||||
ZEROPAGE: load = ZP, type = zp , optional=yes;
|
ZEROPAGE: load = ZP, type = zp , optional=yes;
|
||||||
IP65ZP: load = IP65ZP, type = zp,optional=yes;
|
IP65ZP: load = IP65ZP, type = zp,optional=yes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $02, size = $1A, type = rw ;
|
ZP: start = $02, size = $1A, type = rw ;
|
||||||
IP65ZP: start = $5f, size = $10, type = rw;
|
IP65ZP: start = $5f, size = $10, type = rw;
|
||||||
RAM: start = $07FF, size = $77ab, file = %O;
|
RAM: start = $07FF, size = $77ab, file = %O;
|
||||||
RAM3000: start = $3000, size = $4800, type=rw;
|
RAM3000: start = $3000, size = $4800, type=rw;
|
||||||
RAM4000: start = $4000, size = $3800, type=rw;
|
RAM4000: start = $4000, size = $3800, type=rw;
|
||||||
RAM6000: start = $6000, size = $1800, type=rw;
|
RAM6000: start = $6000, size = $1800, type=rw;
|
||||||
DISCARD: start = $77FF, size = $10;
|
DISCARD: start = $77FF, size = $10;
|
||||||
}
|
}
|
||||||
SEGMENTS {
|
SEGMENTS {
|
||||||
STARTUP: load = RAM, type = ro ,define = yes, optional=yes;
|
STARTUP: load = RAM, type = ro ,define = yes, optional=yes;
|
||||||
CODE: load = RAM, type = ro,define = yes;
|
CODE: load = RAM, type = ro,define = yes;
|
||||||
DATA: load = RAM, type = rw,define = yes;
|
DATA: load = RAM, type = rw,define = yes;
|
||||||
SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes;
|
SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes;
|
||||||
VIC_DATA: load = RAM, type = rw,align = $800, optional=yes;
|
VIC_DATA: load = RAM, type = rw,align = $800, optional=yes;
|
||||||
RODATA: load = RAM, type = ro,define = yes, optional=yes;
|
RODATA: load = RAM, type = ro,define = yes, optional=yes;
|
||||||
IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes;
|
IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes;
|
||||||
BSS: load = RAM, type = bss, optional=yes;
|
BSS: load = RAM, type = bss, optional=yes;
|
||||||
SAFE_BSS: load = RAM3000, type = bss, optional=yes;
|
SAFE_BSS: load = RAM3000, type = bss, optional=yes;
|
||||||
BSS4K: load = RAM4000, type = bss, optional=yes;
|
BSS4K: load = RAM4000, type = bss, optional=yes;
|
||||||
DATA6K: load = RAM, run = RAM6000, type = rw, define = yes, optional=yes;
|
DATA6K: load = RAM, run = RAM6000, type = rw, define = yes, optional=yes;
|
||||||
APP_SCRATCH: load = RAM, type = bss, optional=yes;
|
APP_SCRATCH: load = RAM, type = bss, optional=yes;
|
||||||
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
||||||
IP65ZP: load = IP65ZP, type = zp, optional=yes;
|
IP65ZP: load = IP65ZP, type = zp, optional=yes;
|
||||||
EXEHDR: load = DISCARD, type = ro, optional=yes;
|
EXEHDR: load = DISCARD, type = ro, optional=yes;
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
TCP_VARS: load = RAM, type = bss, optional=yes;
|
||||||
HTTP_VARS: load = RAM, type = bss, optional=yes;
|
HTTP_VARS: load = RAM, type = bss, optional=yes;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,23 +1,23 @@
|
||||||
#assumes a fully expanded VIC 20
|
#assumes a fully expanded VIC 20
|
||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $02, size = $1A, type = rw ;
|
ZP: start = $02, size = $1A, type = rw ;
|
||||||
IP65ZP: start = $5f, size = $10, type = rw;
|
IP65ZP: start = $5f, size = $10, type = rw;
|
||||||
RAM: start = $11FF, size = $6e00, file = %O;
|
RAM: start = $11FF, size = $6e00, file = %O;
|
||||||
}
|
}
|
||||||
SEGMENTS {
|
SEGMENTS {
|
||||||
STARTUP: load = RAM, type = ro ,define = yes, optional=yes;
|
STARTUP: load = RAM, type = ro ,define = yes, optional=yes;
|
||||||
CODE: load = RAM, type = ro,define = yes;
|
CODE: load = RAM, type = ro,define = yes;
|
||||||
DATA: load = RAM, type = rw,define = yes;
|
DATA: load = RAM, type = rw,define = yes;
|
||||||
SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes;
|
SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes;
|
||||||
VIC_DATA: load = RAM, type = rw,align = $800, optional=yes;
|
VIC_DATA: load = RAM, type = rw,align = $800, optional=yes;
|
||||||
RODATA: load = RAM, type = ro,define = yes, optional=yes;
|
RODATA: load = RAM, type = ro,define = yes, optional=yes;
|
||||||
IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes;
|
IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes;
|
||||||
BSS: load = RAM, type = bss, optional=yes;
|
BSS: load = RAM, type = bss, optional=yes;
|
||||||
# SAFE_BSS: load = RAM3000, type = bss, optional=yes;
|
# SAFE_BSS: load = RAM3000, type = bss, optional=yes;
|
||||||
APP_SCRATCH: load = RAM, type = bss, optional=yes;
|
APP_SCRATCH: load = RAM, type = bss, optional=yes;
|
||||||
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
||||||
IP65ZP: load = IP65ZP, type = zp, optional=yes;
|
IP65ZP: load = IP65ZP, type = zp, optional=yes;
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
TCP_VARS: load = RAM, type = bss, optional=yes;
|
||||||
HTTP_VARS: load = RAM, type = bss, optional=yes;
|
HTTP_VARS: load = RAM, type = bss, optional=yes;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,61 +0,0 @@
|
||||||
|
|
||||||
.PHONY: ip65 drivers test clean distclean kipperterm2 examples carts basic wiznet a2
|
|
||||||
|
|
||||||
|
|
||||||
all: ip65 drivers test carts examples basic kipperterm2 wiznet a2
|
|
||||||
|
|
||||||
ip65:
|
|
||||||
make -C ip65 all
|
|
||||||
|
|
||||||
drivers:
|
|
||||||
make -C drivers all
|
|
||||||
|
|
||||||
examples:
|
|
||||||
make -C examples all
|
|
||||||
|
|
||||||
a2:
|
|
||||||
make -C a2 all
|
|
||||||
|
|
||||||
test:
|
|
||||||
make -C test TARGET=$(TARGET) all
|
|
||||||
|
|
||||||
|
|
||||||
kipperterm2:
|
|
||||||
make -C kipperterm2 all
|
|
||||||
|
|
||||||
|
|
||||||
carts:
|
|
||||||
make -C carts all
|
|
||||||
|
|
||||||
basic:
|
|
||||||
make -C basic all
|
|
||||||
|
|
||||||
wiznet:
|
|
||||||
make -C wiznet all
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
make -C ip65 clean
|
|
||||||
|
|
||||||
make -C drivers clean
|
|
||||||
make -C test clean
|
|
||||||
make -C carts clean
|
|
||||||
|
|
||||||
make -C kipperterm2 clean
|
|
||||||
|
|
||||||
make -C basic clean
|
|
||||||
|
|
||||||
|
|
||||||
distclean:
|
|
||||||
make -C ip65 distclean
|
|
||||||
|
|
||||||
make -C drivers clean
|
|
||||||
make -C test distclean
|
|
||||||
|
|
||||||
make -C carts distclean
|
|
||||||
|
|
||||||
make -C kipperterm2 distclean
|
|
||||||
|
|
||||||
make -C basic distclean
|
|
||||||
|
|
||||||
rm -f *~
|
|
|
@ -1,54 +0,0 @@
|
||||||
CC=cl65
|
|
||||||
AS=ca65
|
|
||||||
LD=ld65
|
|
||||||
CFLAGS=-Oirs -t $(TARGET)
|
|
||||||
AFLAGS=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IP65LIB=../ip65/ip65.lib
|
|
||||||
IP65TCPLIB=../ip65/ip65_tcp.lib
|
|
||||||
A2UTHERLIB=../drivers/a2uther.lib
|
|
||||||
|
|
||||||
INCFILES=\
|
|
||||||
../inc/common.i\
|
|
||||||
../inc/commonprint.i\
|
|
||||||
../inc/net.i\
|
|
||||||
|
|
||||||
all: \
|
|
||||||
ip65 \
|
|
||||||
drivers \
|
|
||||||
amper.dsk \
|
|
||||||
|
|
||||||
|
|
||||||
ip65:
|
|
||||||
make -C ../ip65 all
|
|
||||||
|
|
||||||
drivers:
|
|
||||||
make -C ../drivers all
|
|
||||||
|
|
||||||
%.o: %.s
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
#tokenize_asoft comes from http://www.deater.net/weave/vmwprod/apple/dos33fs.html
|
|
||||||
%.bas: %.applesoft
|
|
||||||
tokenize_asoft < $*.applesoft > $*.bas
|
|
||||||
|
|
||||||
%.pg2: %.o $(IP65LIB) $(A2UTHERLIB) $(INCFILES) ../cfg/a2bin.cfg
|
|
||||||
$(LD) -vm --mapfile $*.map -C ../cfg/a2bin.cfg -o $*.pg2 $(AFLAGS) $< $(IP65TCPLIB) $(A2UTHERLIB)
|
|
||||||
|
|
||||||
amper.dsk: autoexec.bas amper.pg2 hello.bas
|
|
||||||
ripxplore.rb amper.dsk --init AppleDos
|
|
||||||
ripxplore.rb amper.dsk -a amper.pg2 -t AppleBinary
|
|
||||||
cp hello.bas hello
|
|
||||||
ripxplore.rb amper.dsk -a hello -t Applesoft
|
|
||||||
rm hello
|
|
||||||
ripxplore.rb amper.dsk -a autoexec.bas -t Applesoft
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.pg2 *.map *.lst
|
|
||||||
rm -f ip65test.dsk
|
|
||||||
rm -f amper.dsk
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *~
|
|
|
@ -1,646 +0,0 @@
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.include "../inc/a2const.i"
|
|
||||||
.include "../inc/net.i"
|
|
||||||
|
|
||||||
.import exit_to_basic
|
|
||||||
.import cfg_get_configuration_ptr
|
|
||||||
.import dns_ip
|
|
||||||
.import dns_resolve
|
|
||||||
.import dns_set_hostname
|
|
||||||
.import icmp_ping
|
|
||||||
.import icmp_echo_ip
|
|
||||||
|
|
||||||
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
|
|
||||||
.importzp copy_dest
|
|
||||||
.importzp buffer_ptr
|
|
||||||
.importzp scratch_ptr
|
|
||||||
|
|
||||||
.import http_parse_request
|
|
||||||
.import http_get_value
|
|
||||||
.import http_variables_buffer
|
|
||||||
|
|
||||||
.import tcp_inbound_data_ptr
|
|
||||||
.import tcp_inbound_data_length
|
|
||||||
.import tcp_send_data_len
|
|
||||||
.import tcp_send
|
|
||||||
.import check_for_abort_key
|
|
||||||
.import tcp_connect_remote_port
|
|
||||||
.import tcp_remote_ip
|
|
||||||
.import tcp_listen
|
|
||||||
.import tcp_callback
|
|
||||||
.import tcp_close
|
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __IP65_DEFAULTS_SIZE__
|
|
||||||
.import __BSS_RUN__
|
|
||||||
.import __BSS_SIZE__
|
|
||||||
|
|
||||||
END_OF_BSS = __BSS_RUN__+__BSS_SIZE__
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$03 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+__IP65_DEFAULTS_SIZE__+4 ; file size
|
|
||||||
jmp init
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
jsr ip65_init
|
|
||||||
bcc @init_ok
|
|
||||||
ldax #@no_nic
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
jmp exit_to_basic
|
|
||||||
@no_nic:
|
|
||||||
.byte "NO NIC - UNINSTALLING",0
|
|
||||||
@install_msg:
|
|
||||||
.byte " FOUND",13,"APPLESOFT.NET USING $801-$"
|
|
||||||
|
|
||||||
.byte 0
|
|
||||||
@init_ok:
|
|
||||||
;print the banner
|
|
||||||
ldax #eth_driver_name
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #@install_msg
|
|
||||||
jsr print
|
|
||||||
print_hex_double #END_OF_BSS
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
;take over the ampersand vector
|
|
||||||
ldax AMPERSAND_VECTOR+1
|
|
||||||
stax old_amper_handler
|
|
||||||
ldax #amper_handler
|
|
||||||
stax AMPERSAND_VECTOR+1
|
|
||||||
|
|
||||||
lda #$FF
|
|
||||||
sta CURLIN+1 ;put into 'immediate' mode
|
|
||||||
ldax #END_OF_BSS+1
|
|
||||||
stax TXTTAB
|
|
||||||
lda #0
|
|
||||||
sta END_OF_BSS ;if the byte before the start of the BASIC is not zero, we
|
|
||||||
;get a weird 'SYNTAX ERROR IN LINE' because
|
|
||||||
;STXTPT (called by RUN) sets TXTPTR (address of next BASIC token) to be TXTTAB-1
|
|
||||||
;if this byte is zero, then NEWSTT tries to execute that byte
|
|
||||||
jsr SCRTCH ;reset BASIC now we have updated the start address
|
|
||||||
lday #chain_cmd
|
|
||||||
jsr STROUT
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
print_error:
|
|
||||||
jsr print
|
|
||||||
ldax #error
|
|
||||||
jsr print
|
|
||||||
lda ip65_error
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
amper_handler:
|
|
||||||
;see if & is followed by one of our keywords
|
|
||||||
|
|
||||||
ldx #0
|
|
||||||
ldy #0
|
|
||||||
lda keyword_table
|
|
||||||
|
|
||||||
@check_one_handler:
|
|
||||||
cmp #$FF ;end of table?
|
|
||||||
beq exit_to_old_handler
|
|
||||||
cmp (TXTPTR),y ;char in line
|
|
||||||
beq @this_char_ok
|
|
||||||
@skip_to_next_handler_loop:
|
|
||||||
inx
|
|
||||||
lda keyword_table,x
|
|
||||||
bne @skip_to_next_handler_loop
|
|
||||||
inx ;skip first part of handler address
|
|
||||||
inx ;skip next part of handler address
|
|
||||||
ldy #$FF
|
|
||||||
@this_char_ok:
|
|
||||||
iny
|
|
||||||
inx
|
|
||||||
lda keyword_table,x ;get cmd char
|
|
||||||
bne @check_one_handler
|
|
||||||
;if we get here, we have matched a keyword, and X points to the zero terminating the keyword, Y is length of keyword
|
|
||||||
lda keyword_table+2,x ;get high byte of handler address
|
|
||||||
pha
|
|
||||||
lda keyword_table+1,x ;get low byte of handler address
|
|
||||||
pha
|
|
||||||
jmp ADDON ;fix-up TXTPTR - on return control will transfer to address we just pushed
|
|
||||||
|
|
||||||
exit_to_old_handler:
|
|
||||||
jmp $ffff
|
|
||||||
old_amper_handler=exit_to_old_handler+1
|
|
||||||
|
|
||||||
get_optional_byte:
|
|
||||||
jsr CHRGOT
|
|
||||||
beq @no_param ;leave X as it was
|
|
||||||
jmp COMBYTE
|
|
||||||
@no_param:
|
|
||||||
rts
|
|
||||||
|
|
||||||
extract_string:
|
|
||||||
jsr FRMEVL
|
|
||||||
jsr FRESTR ;if not string, will create type mismatch error
|
|
||||||
sta param_length
|
|
||||||
tay
|
|
||||||
lda #0
|
|
||||||
sta transfer_buffer,y
|
|
||||||
dey
|
|
||||||
@loop:
|
|
||||||
lda (INDEX),y
|
|
||||||
sta transfer_buffer,y
|
|
||||||
dey
|
|
||||||
bpl @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_ip_parameter:
|
|
||||||
stax buffer_ptr
|
|
||||||
jsr extract_string
|
|
||||||
ldax #transfer_buffer
|
|
||||||
|
|
||||||
jsr dns_set_hostname
|
|
||||||
|
|
||||||
bcs @error
|
|
||||||
jsr dns_resolve
|
|
||||||
bcc @ok
|
|
||||||
@error:
|
|
||||||
ldax #address_resolution
|
|
||||||
jmp print_error
|
|
||||||
|
|
||||||
@ok:
|
|
||||||
ldax #dns_ip
|
|
||||||
ldx #4
|
|
||||||
@copy_dns_ip:
|
|
||||||
lda dns_ip,y
|
|
||||||
sta (buffer_ptr),y
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bne @copy_dns_ip
|
|
||||||
rts
|
|
||||||
|
|
||||||
ipcfg_handler:
|
|
||||||
jmp print_ip_config
|
|
||||||
|
|
||||||
ping_handler:
|
|
||||||
ldax #icmp_echo_ip
|
|
||||||
jsr get_ip_parameter
|
|
||||||
bcc @no_error
|
|
||||||
rts
|
|
||||||
@no_error:
|
|
||||||
;is there an optional parameter?
|
|
||||||
ldx #3
|
|
||||||
jsr get_optional_byte
|
|
||||||
stx ping_counter
|
|
||||||
|
|
||||||
ldax #pinging
|
|
||||||
jsr print
|
|
||||||
ldax #dns_ip
|
|
||||||
jsr print_dotted_quad
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
@ping_loop:
|
|
||||||
jsr icmp_ping
|
|
||||||
bcs @error
|
|
||||||
lda #'.'
|
|
||||||
@print_and_loop:
|
|
||||||
jsr print_a
|
|
||||||
lda $c000 ;key pressed
|
|
||||||
sta $c010 ;clear keyboard
|
|
||||||
cmp #$9B ;escape
|
|
||||||
beq @done
|
|
||||||
dec ping_counter
|
|
||||||
bne @ping_loop
|
|
||||||
@done:
|
|
||||||
jmp print_cr
|
|
||||||
@error:
|
|
||||||
lda #'!'
|
|
||||||
jmp @print_and_loop
|
|
||||||
|
|
||||||
|
|
||||||
dhcp_handler:
|
|
||||||
jsr dhcp_init
|
|
||||||
bcc @init_ok
|
|
||||||
jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to default values)
|
|
||||||
|
|
||||||
@init_failed:
|
|
||||||
ldax #dhcp
|
|
||||||
jmp print_error
|
|
||||||
@init_ok:
|
|
||||||
rts
|
|
||||||
|
|
||||||
myip_handler:
|
|
||||||
ldax #cfg_ip
|
|
||||||
jmp get_ip_parameter
|
|
||||||
|
|
||||||
dns_handler:
|
|
||||||
ldax #cfg_dns
|
|
||||||
jmp get_ip_parameter
|
|
||||||
|
|
||||||
gateway_handler:
|
|
||||||
ldax #cfg_gateway
|
|
||||||
jmp get_ip_parameter
|
|
||||||
|
|
||||||
netmask_handler:
|
|
||||||
ldax #cfg_netmask
|
|
||||||
jmp get_ip_parameter
|
|
||||||
|
|
||||||
|
|
||||||
skip_comma_get_integer:
|
|
||||||
jsr CHKCOM
|
|
||||||
get_integer:
|
|
||||||
jsr CHRGOT
|
|
||||||
jsr LINGET
|
|
||||||
ldax LINNUM
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
httpd_handler:
|
|
||||||
jsr flush_handler ;clean out the last connection
|
|
||||||
jsr get_integer
|
|
||||||
stax httpd_port_number
|
|
||||||
tsx
|
|
||||||
stx top_of_stack
|
|
||||||
ldax #__http_variables_buffer
|
|
||||||
stax http_variables_buffer
|
|
||||||
|
|
||||||
ldax #listening
|
|
||||||
jsr print
|
|
||||||
ldax #cfg_ip
|
|
||||||
jsr print_dotted_quad
|
|
||||||
lda #':'
|
|
||||||
jsr print_a
|
|
||||||
ldax httpd_port_number
|
|
||||||
jsr print_integer
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
@listen:
|
|
||||||
jsr tcp_close
|
|
||||||
ldax httpd_io_buffer
|
|
||||||
stax tcp_buffer_ptr
|
|
||||||
|
|
||||||
ldax #http_callback
|
|
||||||
stax tcp_callback
|
|
||||||
ldax httpd_port_number
|
|
||||||
|
|
||||||
jsr tcp_listen
|
|
||||||
bcc @connect_ok
|
|
||||||
jmp END4
|
|
||||||
|
|
||||||
@connect_ok:
|
|
||||||
ldax #connection_from
|
|
||||||
jsr print
|
|
||||||
ldax #tcp_remote_ip
|
|
||||||
jsr print_dotted_quad
|
|
||||||
lda #':'
|
|
||||||
jsr print_a
|
|
||||||
ldax tcp_connect_remote_port
|
|
||||||
|
|
||||||
jsr print_integer
|
|
||||||
jsr print_cr
|
|
||||||
lda #0
|
|
||||||
sta connection_closed
|
|
||||||
sta found_eol
|
|
||||||
sta polling_counter
|
|
||||||
|
|
||||||
@main_polling_loop:
|
|
||||||
jsr ip65_process
|
|
||||||
jsr ISCNTC ;check for ^C, if so print error message, warm start BASIC
|
|
||||||
|
|
||||||
lda found_eol
|
|
||||||
bne @got_eol
|
|
||||||
lda #75
|
|
||||||
jsr $fca8 ;wait for about 15ms - this gives a total timeout of ~4seconds
|
|
||||||
inc polling_counter
|
|
||||||
bne @main_polling_loop
|
|
||||||
jmp @listen
|
|
||||||
|
|
||||||
@got_eol:
|
|
||||||
|
|
||||||
jsr reset_output_buffer
|
|
||||||
|
|
||||||
ldy #$FF
|
|
||||||
:
|
|
||||||
iny
|
|
||||||
lda status_ok,y
|
|
||||||
sta status_code_buffer,y
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
ldy #$FF
|
|
||||||
:
|
|
||||||
iny
|
|
||||||
lda text_html,y
|
|
||||||
sta content_type_buffer,y
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
sta sent_header
|
|
||||||
|
|
||||||
ldax httpd_io_buffer
|
|
||||||
jmp got_http_request
|
|
||||||
|
|
||||||
http_callback:
|
|
||||||
lda tcp_inbound_data_length+1
|
|
||||||
cmp #$ff
|
|
||||||
bne @not_eof
|
|
||||||
inc connection_closed
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
@not_eof:
|
|
||||||
lda found_eol
|
|
||||||
bne @done
|
|
||||||
|
|
||||||
;copy this chunk to our input buffer
|
|
||||||
ldax tcp_buffer_ptr
|
|
||||||
stax copy_dest
|
|
||||||
ldax tcp_inbound_data_ptr
|
|
||||||
stax copy_src
|
|
||||||
ldax tcp_inbound_data_length
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
;increment the pointer into the input buffer
|
|
||||||
clc
|
|
||||||
lda tcp_buffer_ptr
|
|
||||||
adc tcp_inbound_data_length
|
|
||||||
sta tcp_buffer_ptr
|
|
||||||
sta copy_src
|
|
||||||
lda tcp_buffer_ptr+1
|
|
||||||
adc tcp_inbound_data_length+1
|
|
||||||
sta tcp_buffer_ptr+1
|
|
||||||
sta copy_src+1
|
|
||||||
|
|
||||||
;put a null byte at the end (assumes we have set copy_src already)
|
|
||||||
lda #0
|
|
||||||
tay
|
|
||||||
sta (copy_src),y
|
|
||||||
|
|
||||||
;look for CR or LF in input
|
|
||||||
sta found_eol
|
|
||||||
ldax httpd_io_buffer
|
|
||||||
stax get_next_byte+1
|
|
||||||
|
|
||||||
@look_for_eol:
|
|
||||||
jsr get_next_byte
|
|
||||||
cmp #$0a
|
|
||||||
beq @found_eol
|
|
||||||
cmp #$0d
|
|
||||||
bne @not_eol
|
|
||||||
@found_eol:
|
|
||||||
inc found_eol
|
|
||||||
rts
|
|
||||||
@not_eol:
|
|
||||||
cmp #0
|
|
||||||
bne @look_for_eol
|
|
||||||
rts
|
|
||||||
|
|
||||||
send_buffer:
|
|
||||||
ldax output_buffer_length
|
|
||||||
stax tcp_send_data_len
|
|
||||||
ldax httpd_io_buffer
|
|
||||||
jsr tcp_send
|
|
||||||
|
|
||||||
reset_output_buffer:
|
|
||||||
ldax httpd_io_buffer
|
|
||||||
sta xmit_a_ptr+1
|
|
||||||
stx xmit_a_ptr+2
|
|
||||||
lda #0
|
|
||||||
sta output_buffer_length
|
|
||||||
sta output_buffer_length+1
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
emit_string:
|
|
||||||
stax scratch_ptr
|
|
||||||
ldy #0
|
|
||||||
@next_byte:
|
|
||||||
lda (scratch_ptr),y
|
|
||||||
beq @done
|
|
||||||
jsr xmit_a
|
|
||||||
iny
|
|
||||||
bne @next_byte
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
|
|
||||||
got_http_request:
|
|
||||||
|
|
||||||
jsr http_parse_request
|
|
||||||
|
|
||||||
ldax #path
|
|
||||||
jsr print
|
|
||||||
lda #$02
|
|
||||||
jsr http_get_value
|
|
||||||
stax scratch_ptr
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
@find_null:
|
|
||||||
lda (scratch_ptr),y
|
|
||||||
beq @found_null
|
|
||||||
iny
|
|
||||||
bne @find_null
|
|
||||||
@found_null:
|
|
||||||
sty param_length
|
|
||||||
|
|
||||||
lda #'P'
|
|
||||||
sta VARNAM
|
|
||||||
lda #'A'+$80
|
|
||||||
sta VARNAM+1
|
|
||||||
|
|
||||||
jsr GETVAR ;find the variable of this name (or else make a blank one)
|
|
||||||
lda param_length
|
|
||||||
jsr GETSPA ;create space in the string table of appropriate length
|
|
||||||
ldy #$00 ;set up string variable pointer
|
|
||||||
sta (VARPNT),Y ;string length
|
|
||||||
iny
|
|
||||||
lda FRESPC ;lo byte of area just reserved
|
|
||||||
sta (VARPNT),Y
|
|
||||||
iny
|
|
||||||
lda FRESPC+1 ;hi byte of area just reserved
|
|
||||||
sta (VARPNT),Y
|
|
||||||
|
|
||||||
ldx scratch_ptr
|
|
||||||
ldy scratch_ptr+1
|
|
||||||
lda param_length
|
|
||||||
jsr MOVSTR
|
|
||||||
|
|
||||||
;now restore stack to how it was when &HTTPD was called, and return to BASIC
|
|
||||||
ldx top_of_stack
|
|
||||||
txs
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
bang_handler:
|
|
||||||
jsr extract_string
|
|
||||||
lda sent_header
|
|
||||||
bne :+
|
|
||||||
jsr send_header
|
|
||||||
:
|
|
||||||
ldy #0
|
|
||||||
sty string_ptr
|
|
||||||
@loop:
|
|
||||||
lda transfer_buffer,y
|
|
||||||
jsr xmit_a
|
|
||||||
inc string_ptr
|
|
||||||
ldy string_ptr
|
|
||||||
cpy param_length
|
|
||||||
bne @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
send_header:
|
|
||||||
inc sent_header
|
|
||||||
ldax #http_version
|
|
||||||
jsr emit_string
|
|
||||||
ldax #status_code_buffer
|
|
||||||
jsr emit_string
|
|
||||||
ldax #crlf
|
|
||||||
jsr emit_string
|
|
||||||
ldax #content_type
|
|
||||||
jsr emit_string
|
|
||||||
ldax #content_type_buffer
|
|
||||||
jsr emit_string
|
|
||||||
ldax #end_of_header
|
|
||||||
jsr emit_string
|
|
||||||
|
|
||||||
flush_handler:
|
|
||||||
lda output_buffer_length
|
|
||||||
bne :+
|
|
||||||
ldx output_buffer_length+1
|
|
||||||
bne :+
|
|
||||||
rts
|
|
||||||
:
|
|
||||||
jmp send_buffer
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
keyword_table:
|
|
||||||
.byte "IPCFG",0
|
|
||||||
.word ipcfg_handler-1
|
|
||||||
.byte "DHCP",0
|
|
||||||
.word dhcp_handler-1
|
|
||||||
.byte "PING",0
|
|
||||||
.word ping_handler-1
|
|
||||||
.byte "MYIP",0
|
|
||||||
.word myip_handler-1
|
|
||||||
.byte "DNS",0
|
|
||||||
.word dns_handler-1
|
|
||||||
.byte "G",$c5,"EWAY",0 ;$C5 is token for 'AT'
|
|
||||||
.word gateway_handler-1
|
|
||||||
.byte "NETMASK",0
|
|
||||||
.word netmask_handler-1
|
|
||||||
.byte "HTTPD",0
|
|
||||||
.word httpd_handler-1
|
|
||||||
.byte "!",0
|
|
||||||
.word bang_handler-1
|
|
||||||
.byte "FLUSH",0
|
|
||||||
.word flush_handler-1
|
|
||||||
|
|
||||||
.byte $ff
|
|
||||||
|
|
||||||
keyword_table_size=*-keyword_table
|
|
||||||
.if keyword_table_size>255
|
|
||||||
.error "KEYWORD TABLE TOO BIG!"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
CR=$0D
|
|
||||||
LF=$0A
|
|
||||||
|
|
||||||
dhcp:
|
|
||||||
.byte "DHCP",0
|
|
||||||
address_resolution:
|
|
||||||
.byte "ADDRESS RESOLUTION",0
|
|
||||||
error:
|
|
||||||
.byte " ERROR $",0
|
|
||||||
pinging:
|
|
||||||
.byte "PINGING ",0
|
|
||||||
|
|
||||||
path:
|
|
||||||
.byte "PATH: ",0
|
|
||||||
http_version:
|
|
||||||
.byte "HTTP/1.0 ",0
|
|
||||||
|
|
||||||
status_ok:
|
|
||||||
.byte "200 OK",0
|
|
||||||
status_error:
|
|
||||||
.byte "500 "
|
|
||||||
system_error:
|
|
||||||
.byte "SYSTEM ERROR",0
|
|
||||||
content_type:
|
|
||||||
.byte "Content-Type: ",0
|
|
||||||
text_html:
|
|
||||||
.byte "text/html",0
|
|
||||||
|
|
||||||
end_of_header:
|
|
||||||
.byte CR,LF
|
|
||||||
.byte "Connection: Close",CR,LF
|
|
||||||
.byte "Server: AppleSoft.NET/0.2",CR,LF
|
|
||||||
crlf:
|
|
||||||
.byte CR,LF,0
|
|
||||||
|
|
||||||
connection_from: .byte "CONNECTION FROM ",0
|
|
||||||
chain_cmd:
|
|
||||||
|
|
||||||
.byte 13,4,"RUN AUTOEXEC.BAS",13,0
|
|
||||||
|
|
||||||
listening:
|
|
||||||
.byte"LISTENING ON ",0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
|
|
||||||
httpd_io_buffer: .word __httpd_io_buffer
|
|
||||||
httpd_port_number: .word 80
|
|
||||||
|
|
||||||
|
|
||||||
get_next_byte:
|
|
||||||
lda $ffff
|
|
||||||
inc get_next_byte+1
|
|
||||||
bne @skip
|
|
||||||
inc get_next_byte+2
|
|
||||||
@skip:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
xmit_a:
|
|
||||||
|
|
||||||
xmit_a_ptr:
|
|
||||||
sta $ffff
|
|
||||||
inc xmit_a_ptr+1
|
|
||||||
bne :+
|
|
||||||
inc xmit_a_ptr+2
|
|
||||||
:
|
|
||||||
inc output_buffer_length
|
|
||||||
bne :+
|
|
||||||
inc output_buffer_length+1
|
|
||||||
lda output_buffer_length+1
|
|
||||||
cmp #2
|
|
||||||
bne :+
|
|
||||||
stx temp_x
|
|
||||||
jsr send_buffer
|
|
||||||
ldx temp_x
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
param_length: .res 1
|
|
||||||
ping_counter: .res 1
|
|
||||||
handler_address: .res 2
|
|
||||||
temp_x: .res 1
|
|
||||||
output_buffer_length: .res 2
|
|
||||||
sent_header: .res 1
|
|
||||||
content_type_buffer: .res 128
|
|
||||||
status_code_buffer: .res 128
|
|
||||||
found_eol: .byte 0
|
|
||||||
connection_closed: .byte 0
|
|
||||||
tcp_buffer_ptr: .res 2
|
|
||||||
top_of_stack: .res 1
|
|
||||||
polling_counter: .res 1
|
|
||||||
string_ptr: .res 1
|
|
||||||
transfer_buffer: .res 256
|
|
||||||
__http_variables_buffer: .res 256; temp buffer for storing variables
|
|
||||||
__httpd_io_buffer: .res 1024 ;temp buffer for storing inbound requests.
|
|
|
@ -1,17 +0,0 @@
|
||||||
10 PRINT "HELLO FROM BASIC"
|
|
||||||
20 &MYIP"1.2.3.4"
|
|
||||||
21 &NETMASK"255.0.255.0"
|
|
||||||
22 &GATEWAY"7.6.5.4"
|
|
||||||
23 &DNS"8.8.7.6"
|
|
||||||
25 &IPCFG
|
|
||||||
30 &DHCP
|
|
||||||
40 &IPCFG
|
|
||||||
50 &PING "192.168.10.2"
|
|
||||||
60 &PING "192.168.10.2" , 5
|
|
||||||
70 PA$="DUMMY"
|
|
||||||
100 &HTTPD 8080
|
|
||||||
1000 PRINT "HELLO FOO!"
|
|
||||||
1005 PRINT PA$
|
|
||||||
1010 &!"HOWDY DOODY DOO!"
|
|
||||||
1020 &FLUSH
|
|
||||||
1030 GOTO 100
|
|
Binary file not shown.
|
@ -1,24 +0,0 @@
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/a2const.i"
|
|
||||||
.import exit_to_basic
|
|
||||||
|
|
||||||
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
|
|
||||||
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
|
|
||||||
.addr __CODE_LOAD__-$03 ; Start address
|
|
||||||
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; file size
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
init:
|
|
||||||
lday #chain_cmd
|
|
||||||
jsr STROUT
|
|
||||||
|
|
||||||
jmp exit_to_basic
|
|
||||||
chain_cmd:
|
|
||||||
.byte 13,4,"CATALOG",13,0
|
|
|
@ -1 +0,0 @@
|
||||||
10 PRINT CHR$(4);"BRUN AMPER.PG2"
|
|
Binary file not shown.
BIN
client/a2/make
BIN
client/a2/make
Binary file not shown.
|
@ -1,189 +0,0 @@
|
||||||
<h1>BASIC ON BAILS <h1>
|
|
||||||
<h2>COMMAND SUMMARY</h2>
|
|
||||||
<table border=1>
|
|
||||||
<tr>
|
|
||||||
<th>Command</th>
|
|
||||||
<th>Descrption</th>
|
|
||||||
<th>Parameters</th>
|
|
||||||
<th>Example</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>IPCFG</td>
|
|
||||||
<td>Display the current IP stack configuration</td>
|
|
||||||
<td>none</td>
|
|
||||||
<td><li>IPCFG</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>MAC</td>
|
|
||||||
<td>Set the last 3 bytes of the MAC address. Top 3 bytes will always be "00:80:10".<br> This command
|
|
||||||
also resets the whole IP stack, so new IP address will need to be assigned (via MYIP or DHCP) after calling MAC</td>
|
|
||||||
<td>3 byte string</td>
|
|
||||||
<td><li>MAC "FOO" - MAC will become 00:80:10:46:4F:4F (in PETSCII, $46 is 'F' and $4F is 'O') </td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>DHCP</td>
|
|
||||||
<td>Use DHCP to assign IP address, netmask, default gateway and DNS server </td>
|
|
||||||
<td>none</td>
|
|
||||||
<td><li>DHCP</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>MYIP</td>
|
|
||||||
<td>Assign a new IP address</td>
|
|
||||||
<td><li>IP address (string)</td>
|
|
||||||
<td><li>MYIP"10.1.1.2"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>NETMASK</td>
|
|
||||||
<td>Assign a new netmask</td>
|
|
||||||
<td><li>netmask (string)</td>
|
|
||||||
<td><li>NETMASK"255.255.255.0"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>GATEWAY</td>
|
|
||||||
<td>Assign a new default gateway (router to send non-local traffic to)</td>
|
|
||||||
<td><li>gateway IP address (string)</td>
|
|
||||||
<td><li>GATEWAY"10.1.1.1"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>DNS</td>
|
|
||||||
<td>Specify the DNS server to be used for resolving hostnames</td>
|
|
||||||
<td><li>DNS server IP address (string)</td>
|
|
||||||
<td><li>DNS"10.1.1.1"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>PING</td>
|
|
||||||
<td>Sends a number of ICMP echo requests to the specified host. For each packet sent, if a response is received a "." is displayed, if an error occurs (including a timeout) then a "!" is displayed.</td>
|
|
||||||
<td><li>hostname or IP ddress (string)<li>[optional] number of PING request to be sent (1..255) - default is 3</td>
|
|
||||||
<td><li>PING"JAMTRONIX.COM"<li>PING"10.1.1.1",10</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>HTTPD</td>
|
|
||||||
<td>start listening on a TCP port for inbound HTTP requests. When a HTTP request is received, go to the specified
|
|
||||||
default line number, unless the request happens to be for a path that has previously been HOOKed</td>
|
|
||||||
<td><li>port number (1..65535)<li>line number (1..65535)</td>
|
|
||||||
<td><li>HTTPD80,100 - will listen on port 80 and GOTO line 100 when a HTTP request is received</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>HOOK</td>
|
|
||||||
<td>sociate the 'path' part of a URL with a BASIC line number to jump to when a request for the specified path is received</td>
|
|
||||||
<td><li>path (string) - must start with "/"<li>line number (1..65535)</td>
|
|
||||||
<td><li>HOOK"/HELLO",200 - line 200 will be executed if request for "/HELLO" is received </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TYPE</td>
|
|
||||||
<td>change the HTTP Content Type field in the HTTP header
|
|
||||||
from the default "text/html" to whatever is specified. Be careful with
|
|
||||||
case - the remote end will be expecting ASCII not PETSCII! For this to be effective, it must
|
|
||||||
be set BEFORE any data is output with the ! or XSEND keywords</td>
|
|
||||||
<td><li>mime type (string)</td>
|
|
||||||
<td><li>TYPE"application/octet-stream"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>STATUS</td>
|
|
||||||
<td>change the HTTP status line from default
|
|
||||||
"200 OK". Be careful you include the 3 digit code (as an ASCII string)
|
|
||||||
then a space then a free form status description (ASCII NOT PETSCII).
|
|
||||||
To be effective, it must be set BEFORE any data is output with the ! or XSEND keywords</td>
|
|
||||||
<td><li>HTTP status line (string)</td>
|
|
||||||
<td><li>STATUS"404 File Not Found"</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>!</td>
|
|
||||||
<td>Send specified string expression. If no
|
|
||||||
HTTP header has been sent yet, one will be sent now.
|
|
||||||
</i></td>
|
|
||||||
<td><li>string to output</td>
|
|
||||||
<td><li>!"<H1>HELLO WORLD</H1>"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>XSEND</td>
|
|
||||||
<td>Send a file from the default drive. If the file does
|
|
||||||
not exist, then an error message will be sent to the remote browser. If no HTTP header has
|
|
||||||
been sent yet, one will be sent first.</td>
|
|
||||||
<td><li>filename (string)</td>
|
|
||||||
<td><li>XSEND"FAVICON.ICO"</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>YIELD</td>
|
|
||||||
<td>finish processing the current request, go back and wait for
|
|
||||||
another HTTP request.</td>
|
|
||||||
<td><li>none</td>
|
|
||||||
<td><li>YIELD</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
<h2>Magic Variables</h2>
|
|
||||||
The following BASIC variables are set by BASIC ON BAILS whenever a HTTP request is being handled.
|
|
||||||
<h3>PA$</h3>
|
|
||||||
Set to the "path" part of the HTTP request.
|
|
||||||
<h3>Query String Variables</h3>
|
|
||||||
For each variable in the query string part of the HTTP request,the value is
|
|
||||||
decoded and stuck into a BASIC string variable.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
Only the first letter of the query string variable is significant,
|
|
||||||
i.e. query strings N, NA, NAME, all would map to N$.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
If there are multiple query string variables that all start with the
|
|
||||||
same letter, the LAST such variable in the query string is the one
|
|
||||||
that would be effective
|
|
||||||
.e.g if BASIC ON BAILS is processing a HTTP request with a query string /FOO?N=1&NA=2?NAME=3 then
|
|
||||||
in the BASIC handler, N$ would be "3", and NA$ and NAME$ would be
|
|
||||||
empty (BASIC only treats first 2 chars as significant anyway, so NA$
|
|
||||||
is same as NAME$)
|
|
||||||
<br>
|
|
||||||
<h2>STARTUP</h2>
|
|
||||||
If you try and load BASIC ON BAILS twice (or some other BASIC extender before BASIC ON BAILS) you will get an 'insufficient memory' error.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
After BASIC ON BAILS has been installed, it will attempt to load (and run) a file (from whatever device BASIC ON BAILS was loaded from itself) called "INDEX.BAS".
|
|
||||||
If this file does not exist, then BASIC ON BAILS will exit with 'FILE NOT FOUND ERROR IN 10". This error can be ignored - you can load any file you want from then, or type
|
|
||||||
in a new one, or even use the commands in interactive mode.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<h2>ERROR HANDLING</h2>
|
|
||||||
Before HTTPD is called, BASIC errors are treated normally, i.e. on a SYNTAX ERROR or TYPE MISMATCH error, an error will be displayed on the screen, and
|
|
||||||
program execution will stop. But once you have fired up HTTPD, any BASIC errors are displayed on the
|
|
||||||
screen AND passed back to the browser as a HTTP error, and are non-fatal i.e. the HTTPD loop will keep running. You can exit HTTPD by
|
|
||||||
pressing RUN/STOP though.
|
|
||||||
<h2>EXAMPLE</h2>
|
|
||||||
<pre>
|
|
||||||
|
|
||||||
5 MAC CHR$(192)+CHR$(29)+CHR$(85)
|
|
||||||
10 DHCP
|
|
||||||
20 HOOK"/HELLO",1000
|
|
||||||
25 FA$="/"+CHR$(102)+CHR$(97)+CHR$(118)+CHR$(105)+CHR$(99)+CHR$(111)
|
|
||||||
27 FA$=FA$+CHR$(110)+CHR$(46)+CHR$(105)+CHR$(99)+CHR$(111)
|
|
||||||
30 HOOKFA$,2000
|
|
||||||
40 HTTPD80,100
|
|
||||||
|
|
||||||
100 !"<H1>HELLO</H1>"
|
|
||||||
110 !"<FORM ACTION=/HELLO>"
|
|
||||||
120 !"WHAT'S YOUR NAME?"
|
|
||||||
130 !"<INPUT TYPE=TEXT NAME=N>"
|
|
||||||
140 !"</FORM>"
|
|
||||||
200 YIELD
|
|
||||||
|
|
||||||
1000!"HELLO "+N$+", I'M A C64 RUNNING BASIC ON BAILS."
|
|
||||||
1010 FOR I=1 TO 10
|
|
||||||
1020 !"<BR>"
|
|
||||||
1030 !STR$(I)
|
|
||||||
1040 NEXT I
|
|
||||||
1100 YIELD
|
|
||||||
|
|
||||||
2000 TYPE"IMAGE/X-ICON"
|
|
||||||
2010 XSEND"FAVICON.ICO"
|
|
||||||
2020 YIELD
|
|
||||||
|
|
||||||
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
|
|
|
@ -1,193 +0,0 @@
|
||||||
<h1>KIPPER BASIC <h1>
|
|
||||||
<h2>COMMAND SUMMARY</h2>
|
|
||||||
<table border=1>
|
|
||||||
<tr>
|
|
||||||
<th>Command</th>
|
|
||||||
<th>Descrption</th>
|
|
||||||
<th>Parameters</th>
|
|
||||||
<th>Example</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>IPCFG</td>
|
|
||||||
<td>Display the current IP stack configuration</td>
|
|
||||||
<td>none</td>
|
|
||||||
<td><li>IPCFG</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>MAC</td>
|
|
||||||
<td>Set the last 3 bytes of the MAC address. Top 3 bytes will always be "00:80:10".<br> This command
|
|
||||||
also resets the whole IP stack, so new IP address will need to be assigned (via MYIP or DHCP) after calling MAC</td>
|
|
||||||
<td>3 byte string</td>
|
|
||||||
<td><li>MAC "FOO" - MAC will become 00:80:10:46:4F:4F (in PETSCII, $46 is 'F' and $4F is 'O') </td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>DHCP</td>
|
|
||||||
<td>Use DHCP to assign IP address, netmask, default gateway and DNS server </td>
|
|
||||||
<td>none</td>
|
|
||||||
<td><li>DHCP</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>MYIP</td>
|
|
||||||
<td>Assign a new IP address</td>
|
|
||||||
<td><li>IP address (string)</td>
|
|
||||||
<td><li>MYIP"10.1.1.2"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>NETMASK</td>
|
|
||||||
<td>Assign a new netmask</td>
|
|
||||||
<td><li>netmask (string)</td>
|
|
||||||
<td><li>NETMASK"255.255.255.0"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>GATEWAY</td>
|
|
||||||
<td>Assign a new default gateway (router to send non-local traffic to)</td>
|
|
||||||
<td><li>gateway IP address (string)</td>
|
|
||||||
<td><li>GATEWAY"10.1.1.1"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>DNS</td>
|
|
||||||
<td>Specify the DNS server to be used for resolving hostnames</td>
|
|
||||||
<td><li>DNS server IP address (string)</td>
|
|
||||||
<td><li>DNS"10.1.1.1"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TFTP</td>
|
|
||||||
<td>Specify the TFTP server that will be accessed by TFPUT and TFGET.</td>
|
|
||||||
<td><li>TFTP server IP address or hostname (string)</td>
|
|
||||||
<td><li>TFTP"10.1.1.5"<li>TFTP"JAMTRONIX.COM"</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>PING</td>
|
|
||||||
<td>Sends a number of ICMP echo requests to the specified host. For each packet sent, if a response is received a "." is displayed, if an error occurs (including a timeout) then a "!" is displayed.</td>
|
|
||||||
<td><li>hostname or IP ddress (string)<li>[optional] number of PING request to be sent (1..255) - default is 3</td>
|
|
||||||
<td><li>PING"JAMTRONIX.COM"<li>PING"10.1.1.1",10</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>NETCAT</td>
|
|
||||||
<td>Open a TCP connection to a remote server. Any data received on the connection will be displayed on screen, any keypress will be sent to the remote server. To exit, hit RUN/STOP. <br><br>The optional mode paramater determines whether the connection should be in PETSCII 'char at a time' mode, where every keypress is sent 'as is' to the remote site, or ASCII 'line mode', which allows a line to be edited and is sent (with a CR/LF at the end) only when the RETURN key is pressed. In this mode, data is converted between the PETSCII character set and standard ASCII - you will need to shift to the "lower case" char set for this to display properly.
|
|
||||||
<br><br> The PETSCII mode is appropriate for connecting to e.g. a PETSCII BBS. The ASCII mode is appropriate for connecting to a server running a "network ASCII" derived protocol, e.g. SMTP or HTTP.
|
|
||||||
'
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td><li>hostname or IP ddress (string)<li>port number (1..65535)<li>[optional] mode: <ul><li>0=PETSCII (default)<li>1=ASCII</ul></td>
|
|
||||||
<td><li>NETCAT"JAMTRONIX.COM",6464<li>NETCAT"10.1.1.1",25,1</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TFPUT</td>
|
|
||||||
<td>Upload a file to a TFTP server. By default, TFPUT will use the broadcast address (255.255.255.255), meaning
|
|
||||||
any TFTP server on the LAN will respond. To send a file to a specific TFTP server (including one not on the local network), specify the
|
|
||||||
destination TFTP server with the "TFTP" command prior to calling TFPUT. The filename specified will be looked for on whichever drive was last accessed.</td>
|
|
||||||
<td><li>filename (string)</td>
|
|
||||||
<td><li>TFPUT"KIPPERBAS.PRG"</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>TFGET</td>
|
|
||||||
<td>Download a file from a TFTP server. By default, TFPUT will use the broadcast address (255.255.255.255), meaning
|
|
||||||
any TFTP server on the LAN will respond. To download a file from a specific TFTP server (including one not on the local network), specify the
|
|
||||||
destination TFTP server with the "TFTP" command prior to calling TFGET. The file will be written (as a PRG file) to whichever drive was last accessed.</td>
|
|
||||||
<td><li>filename (string)</td>
|
|
||||||
<td><li>TFGET"KIPPERBAS.PRG"</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>TCPCONNECT</td>
|
|
||||||
<td>Open a TCP connection to a remote server.</td>
|
|
||||||
<td><li>hostname or IP address (string)<li>port number (1..65535)</td>
|
|
||||||
<td><li>TCPCONNECT"JAMTRONIX.COM",70<li>TCPCONNECT"10.1.1.1",80</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TCPLISTEN</td>
|
|
||||||
<td>Wait for an inbound TCP connection from a remote client. This is a blocking command, i.e. the BASIC program will not continue executing until either an inbound connection is made, or the program is terminated by pressing RUN/STOP</td>
|
|
||||||
<td><li>port number (1..65535)</td>
|
|
||||||
<td><li>TCPLISTEN 80</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>POLL</td>
|
|
||||||
<td>Check for network traffic. If data has arrived on a previously opened TCP connection, that data (up to a maximum of 255 bytes) will be set into string variable IN$.If no data has arrived since the last POLL, then IN$ will be an empty string. Integer variables CO% and ER%
|
|
||||||
are also set to indicate current connection state and error conditions (if any).
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>none</td>
|
|
||||||
<td>POLL</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TCPSEND</td>
|
|
||||||
<td>Send a string (up to 255 bytes) over a previously opened connection.Integer variables CO% and ER% are set to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
|
|
||||||
<td><li>data (string)</td>
|
|
||||||
<td><li>TCPSEND"HELLO "+"WORLD"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>TCPBLAT</td>
|
|
||||||
<td>Send a file (of any length) over a previously opened connection. The file will be looked for on the current 'default' device, i.e. which ever drive was last accessed. Integer variables CO% and ER% ae aset to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
|
|
||||||
<td><li>filename (string)</td>
|
|
||||||
<td><li>TCPBLAT"GOPHERMAP.TXT"</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>UDPSEND</td>
|
|
||||||
<td>Send a string (up to 255 bytes) over UDP . There is no need to connect first </i></td>
|
|
||||||
<td>
|
|
||||||
<li>destination hostname or IP address (string)
|
|
||||||
<li>destination port number (1..65535)
|
|
||||||
<li>local port number (1..65535)
|
|
||||||
<li>data (string)
|
|
||||||
</td>
|
|
||||||
<td><li>UDPSEND"JAMTRONIX.COM",7,6464,"echo test"</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h2>Magic Variables</h2>
|
|
||||||
The following BASIC variables are set by the TCP commands and POLL.
|
|
||||||
<h3>CO%</h3>
|
|
||||||
<li>CO%=1 means there is a current TCP connection</li>
|
|
||||||
<li>CO%=0 means there is no current TCP connection (either one has never been opened, or else it has been closed)
|
|
||||||
|
|
||||||
<h3>ER%</h3>
|
|
||||||
ER% is set to indicate any error occuring inside the <a href=http://ip65.sourceforge.net/>ip65 TCP/IP stack</a> that Kipper BASIC is built on top of.
|
|
||||||
Possible values:
|
|
||||||
|
|
||||||
<table><tr><th>ERROR CODE<br>HEX / DEC</th><th>DESCRIPTION</th></tr>
|
|
||||||
<tr><td>$80 / 128</td><td>PORT IN USE</td></tr>
|
|
||||||
<tr><td>$81 / 129</td><td>TIMEOUT ON RECEIVE</td></tr>
|
|
||||||
<tr><td>$82 / 130</td><td>TRANSMIT FAILED</td></tr>
|
|
||||||
<tr><td>$83 / 131</td><td>TRANSMISSION REJECTED BY PEER</td></tr>
|
|
||||||
<tr><td>$84 / 132</td><td>INPUT TOO LARGE</td></tr>
|
|
||||||
<tr><td>$85 / 133</td><td>DEVICE FAILURE</td></tr>
|
|
||||||
<tr><td>$86 / 134</td><td>ABORTED BY USER</td></tr>
|
|
||||||
<tr><td>$87 / 135</td><td>LISTENER NOT AVAILABLE</td></tr>
|
|
||||||
<tr><td>$88 / 136</td><td>NO SUCH LISTENER</td></tr>
|
|
||||||
<tr><td>$89 / 137</td><td>CONNECTION RESET BY PEER</td></tr>
|
|
||||||
<tr><td>$8A / 138</td><td>CONNECTION CLOSED</td></tr>
|
|
||||||
<tr><td>$8B / 139</td><td>TOO MANY ERRORS</td></tr>
|
|
||||||
<tr><td>$90 / 140</td><td>FILE ACCESS FAILURE</td></tr>
|
|
||||||
<tr><td>$A0 / 160</td><td>MALFORMED URL</td></tr>
|
|
||||||
<tr><td>$A1 / 161</td><td>DNS LOOKUP FAILED</td></tr>
|
|
||||||
<tr><td>$FE / 254</td><td>OPTION NOT SUPPORTED</td></tr>
|
|
||||||
<tr><td>$FF / 255</td><td>FUNCTION NOT SUPPORTED</td></tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h2>STARTUP</h2>
|
|
||||||
If you try and load Kipper BASIC twice (or some other BASIC extender before Kipper BASIC) you will get an 'insufficient memory' error.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
|
|
||||||
After Kipper BASIC has been installed, it will attempt to load (and run) a file (from whatever device Kipper BASIC was loaded from) called "AUTOEXEC.BAS".
|
|
||||||
If this file does not exist, then Kipper BASIC will exit with 'FILE NOT FOUND ERROR IN 10". This error can be ignored - you can load any file you want from then, or type
|
|
||||||
in a new one, or even use the commands in interactive mode.
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
For example, try:
|
|
||||||
<pre>
|
|
||||||
DHCP:NETCAT"JAMTRONIX.COM",6464
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
AS=ca65
|
|
||||||
LD=ld65
|
|
||||||
CFLAGS=-Oirs -t $(TARGET)
|
|
||||||
AFLAGS=
|
|
||||||
|
|
||||||
INCFILES=\
|
|
||||||
../inc/common.i\
|
|
||||||
../inc/commonprint.i\
|
|
||||||
../inc/net.i\
|
|
||||||
../inc/menu.i\
|
|
||||||
../inc/kipper_constants.i\
|
|
||||||
../inc/version.i\
|
|
||||||
|
|
||||||
IP65LIB=../ip65/ip65_tcp.lib
|
|
||||||
C64RRNETLIB=../drivers/c64rrnet.lib
|
|
||||||
VIC20RRNETLIB=../drivers/vic20rrnet.lib
|
|
||||||
|
|
||||||
all: ip65 kipperbas.d64 bails.d64 kipperbasv20.prg
|
|
||||||
|
|
||||||
ip65:
|
|
||||||
make -C ../ip65 all
|
|
||||||
|
|
||||||
%.o: %.s $(INCFILES) timestamp.rb
|
|
||||||
ruby timestamp.rb > timestamp.i
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/kipperbas.cfg
|
|
||||||
$(LD) -m $*.map -vm -C ../cfg/kipperbas.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64RRNETLIB)
|
|
||||||
|
|
||||||
kipperbasv20.prg: kipperbasv20.o $(IP65LIB) $(VIC20RRNETLIB) $(INCFILES) ../cfg/kipperbasv20.cfg
|
|
||||||
$(LD) -m kipperbasv20.map -vm -C ../cfg/kipperbasv20.cfg -o kipperbasv20.prg $(AFLAGS) $< $(IP65LIB) $(VIC20RRNETLIB)
|
|
||||||
|
|
||||||
|
|
||||||
bails.d64: bails.prg
|
|
||||||
c1541 -format bails,bb d64 $@ -attach $@ -write bails.prg
|
|
||||||
|
|
||||||
kipperbas.d64: kipperbas.prg
|
|
||||||
c1541 -format kipperbas,kb d64 $@ -attach $@ -write kipperbas.prg
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.bin *.map *.prg
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *~
|
|
|
@ -1,14 +0,0 @@
|
||||||
1FLOODGAP GOPHER / GOPHER.FLOODGAP.COM 70
|
|
||||||
8JAMTRONIX PETSCIIMATION /n JAMTRONIX.COM 6464
|
|
||||||
8ANTIDOTE /n ANTIDOTE.HOPTO.ORG 23
|
|
||||||
8EXCALIBUR'S STONE /n BBS.EXCALIBURSSTONE.COM 6400
|
|
||||||
8JAMMING SIGNAL /n BBS.JAMMINGSIGNAL.COM 23
|
|
||||||
8MAD WORLD /n MADWORLD.BOUNCEME.NET 23
|
|
||||||
8REALMS OF MYSTERY /n BBS.PIPESUP.CA 6400
|
|
||||||
8RIKTRONICS /n RKBBS.NET 23
|
|
||||||
8WIZARD'S REALM /n WIZBBS.DYNDNS.ORG 23
|
|
||||||
8COTTONWOOD BBS /n COTTONWOOD.SERVEBBS.COM 23
|
|
||||||
8COTTONWOOD II /n COTTONWOOD.SERVEBBS.COM 6400
|
|
||||||
8THE HIDDEN /n THE-HIDDEN.HOPTO.ORG 23
|
|
||||||
|
|
||||||
.
|
|
Binary file not shown.
1725
client/basic/bails.s
1725
client/basic/bails.s
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB |
|
@ -1,2 +0,0 @@
|
||||||
1FLOODGAP GOPHER / GOPHER.FLOODGAP.COM 70
|
|
||||||
1Interesting telnet destinations /ADDRESSES.TXT 10.5.1.9 70
|
|
|
@ -1,25 +0,0 @@
|
||||||
|
|
||||||
5 mac chr$(192)+chr$(29)+chr$(85)
|
|
||||||
10 dhcp
|
|
||||||
20 hook"/hello",1000
|
|
||||||
25 fa$="/"+chr$(102)+chr$(97)+chr$(118)+chr$(105)+chr$(99)+chr$(111)
|
|
||||||
27 fa$=fa$+chr$(110)+chr$(46)+chr$(105)+chr$(99)+chr$(111)
|
|
||||||
30 hookfa$,2000
|
|
||||||
40 httpd80,100
|
|
||||||
100 !"<h1>hello</h1>"
|
|
||||||
110 !"<form action=/hello>"
|
|
||||||
120 !"what's your name?"
|
|
||||||
130 !"<input type=text name=n>"
|
|
||||||
140 !"</form>"
|
|
||||||
200 yield
|
|
||||||
|
|
||||||
1000!"hello "+n$+", i'm a c64 running basic on bails."
|
|
||||||
1010 for i=1 to 10
|
|
||||||
1020 !"<br>"
|
|
||||||
1030 !str$(i)
|
|
||||||
1040 next i
|
|
||||||
1100 yield
|
|
||||||
|
|
||||||
2000 type"IMAGE/X-ICON"
|
|
||||||
2010 xsend"favicon.ico"
|
|
||||||
2020 yield
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
||||||
puts Time.now.strftime(".byte \" (%Y-%m-%d)\"")
|
|
|
@ -1 +0,0 @@
|
||||||
**** KIPPER BASIC 1.1 ****
|
|
|
@ -1,145 +0,0 @@
|
||||||
AS=ca65
|
|
||||||
LD=ld65
|
|
||||||
CFLAGS=-Oirs -t $(TARGET)
|
|
||||||
AFLAGS=
|
|
||||||
|
|
||||||
INCFILES=\
|
|
||||||
../inc/common.i\
|
|
||||||
../inc/commonprint.i\
|
|
||||||
../inc/net.i\
|
|
||||||
../inc/menu.i\
|
|
||||||
../inc/kipper_constants.i\
|
|
||||||
../inc/version.i\
|
|
||||||
|
|
||||||
IP65LIB=../ip65/ip65.lib
|
|
||||||
IP65TCPLIB=../ip65/ip65_tcp.lib
|
|
||||||
C64RRNETLIB=../drivers/c64rrnet.lib
|
|
||||||
C64WIZNETLIB=../drivers/c64wiznet.lib
|
|
||||||
IP65WIZNETLIB=../ip65/ip65_wiznet.lib
|
|
||||||
|
|
||||||
all: ip65 drivers\
|
|
||||||
kkwiz.bin \
|
|
||||||
kkwiz.prg \
|
|
||||||
bobcart.bin \
|
|
||||||
kipperkart.bin \
|
|
||||||
kipperkart_rr.bin \
|
|
||||||
netboot.bin \
|
|
||||||
kipperterm.bin \
|
|
||||||
kipperkart.prg \
|
|
||||||
kipperterm.prg \
|
|
||||||
kipperterm_rr.bin \
|
|
||||||
kippergo.bin \
|
|
||||||
kipperkart.prg \
|
|
||||||
kippergo.prg \
|
|
||||||
kippergo_rr.bin \
|
|
||||||
kkwiz_rr.bin \
|
|
||||||
telnetd.prg \
|
|
||||||
kipperdisk.d64 \
|
|
||||||
|
|
||||||
kipperkart.o: kipperkart.s $(INCFILES) ../inc/ping.i ../inc/disk_transfer.i ../inc/sidplay.i ../inc/config_menu.i
|
|
||||||
$(AS) $(AFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
kipperterm.o: kipperterm.s $(INCFILES) ../inc/telnet.i ../inc/config_menu.i
|
|
||||||
$(AS) $(AFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
kippergo.o: kippergo.s $(INCFILES) ../inc/gopher.i ../inc/telnet.i ../inc/config_menu.i
|
|
||||||
$(AS) $(AFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
%.o: %.s $(INCFILES)
|
|
||||||
ruby timestamp.rb > timestamp.i
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
kipperkart.prg: kipperkart.bin c64_cart_ram_header.prg
|
|
||||||
cat c64_cart_ram_header.prg kipperkart.bin > kipperkart.prg
|
|
||||||
|
|
||||||
|
|
||||||
kkwiz.prg: kkwiz.bin c64_cart_ram_header.prg
|
|
||||||
cat c64_cart_ram_header.prg kkwiz.bin > kkwiz.prg
|
|
||||||
|
|
||||||
kipperterm.prg: kipperterm.bin c64_cart_ram_header.prg
|
|
||||||
cat c64_cart_ram_header.prg kipperterm.bin > kipperterm.prg
|
|
||||||
|
|
||||||
kippergo.prg: kippergo.bin c64_cart_ram_header.prg
|
|
||||||
cat c64_cart_ram_header.prg kippergo.bin > kippergo.prg
|
|
||||||
|
|
||||||
%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
|
||||||
$(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o $*.prg $(AFLAGS) $< $(IP65LIB) $(C64RRNETLIB)
|
|
||||||
|
|
||||||
|
|
||||||
netboot.bin: netboot.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg
|
|
||||||
$(LD) -m netboot.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65LIB) $(C64RRNETLIB)
|
|
||||||
ruby fix_cart.rb $@ 8192
|
|
||||||
|
|
||||||
kipperkart.bin: kipperkart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg
|
|
||||||
$(LD) -m kipperkart.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
ruby fix_cart.rb $@ 16384
|
|
||||||
ruby set_ip_config.rb $@ mac auto
|
|
||||||
ruby dupe_cart.rb kipperkart.bin kipperkart_29c040.bin 32
|
|
||||||
|
|
||||||
kipperterm.bin: kipperterm.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg
|
|
||||||
$(LD) -m kipperterm.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
ruby fix_cart.rb $@ 16384
|
|
||||||
ruby dupe_cart.rb kipperterm.bin kipperterm_29c040.bin 32
|
|
||||||
|
|
||||||
kipperterm_rr.bin: kipperterm.bin
|
|
||||||
cp crt8040.obj rrnet_header.bin
|
|
||||||
cat rrnet_header.bin kipperterm.bin > kipperterm_rr.bin
|
|
||||||
ruby fix_cart.rb $@ 32768
|
|
||||||
|
|
||||||
|
|
||||||
kippergo.bin: kippergo.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg
|
|
||||||
$(LD) -m kippergo.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
ruby fix_cart.rb $@ 16384
|
|
||||||
ruby dupe_cart.rb kippergo.bin kippergo_29c040.bin 32
|
|
||||||
|
|
||||||
kippergo_rr.bin: kippergo.bin
|
|
||||||
cp crt8040.obj rrnet_header.bin
|
|
||||||
cat rrnet_header.bin kippergo.bin > kippergo_rr.bin
|
|
||||||
ruby fix_cart.rb $@ 32768
|
|
||||||
|
|
||||||
kipperkart_rr.bin: kipperkart.bin
|
|
||||||
cp crt8040.obj rrnet_header.bin
|
|
||||||
cat rrnet_header.bin kipperkart.bin > kipperkart_rr.bin
|
|
||||||
ruby fix_cart.rb $@ 32768
|
|
||||||
|
|
||||||
kipperdisk.d64: kipperkart.prg kipperterm.prg kipperkart.prg kippergo.prg
|
|
||||||
c1541 -format kipperdisk,kd d64 $@ -attach $@ -write kipperkart.prg -write kipperterm.prg -write kippergo.prg
|
|
||||||
cp $@ ../../server/boot/
|
|
||||||
|
|
||||||
bobcart.bin: bobcart.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg
|
|
||||||
$(LD) -m bobcart.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
ruby fix_cart.rb $@ 8192
|
|
||||||
|
|
||||||
kkwiz.bin: kipperkart.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64_16kcart.cfg
|
|
||||||
$(LD) -m kkwiz.map -vm -C ../cfg/c64_16kcart.cfg -o $@ $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
|
|
||||||
ruby fix_cart.rb $@ 16384
|
|
||||||
# ruby set_ip_config.rb $@ mac auto
|
|
||||||
|
|
||||||
kkwiz_rr.bin: kkwiz.bin
|
|
||||||
cp crt8040.obj rrnet_header.bin
|
|
||||||
cat rrnet_header.bin kkwiz.bin > kkwiz_rr.bin
|
|
||||||
ruby fix_cart.rb $@ 32768
|
|
||||||
cp kkwiz_rr.bin ../wiznet/
|
|
||||||
|
|
||||||
telnetd.bin: telnetd.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg
|
|
||||||
$(LD) -m telnetd.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
ruby ../carts/fix_cart.rb $@ 8192
|
|
||||||
|
|
||||||
telnetd.prg: telnetd.bin cartheader.prg
|
|
||||||
cat cartheader.prg telnetd.bin > $@
|
|
||||||
|
|
||||||
d64_upload.d64: d64_upload.prg
|
|
||||||
cp d64_upload.prg ../../server/boot/
|
|
||||||
c1541 -format d64upload,kd d64 $@ -attach $@ -write d64_upload.prg
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *~
|
|
||||||
|
|
||||||
ip65:
|
|
||||||
make -C ../ip65 all
|
|
||||||
|
|
||||||
drivers:
|
|
||||||
make -C ../drivers all
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,164 +0,0 @@
|
||||||
;#############
|
|
||||||
;
|
|
||||||
; This program looks for a TNDP server on the network, presents a catalog of volumes on that server, and allows a volume to be attached
|
|
||||||
;
|
|
||||||
; jonno@jamtronix.com - January 2009
|
|
||||||
;
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.include "../inc/net.i"
|
|
||||||
.import cls
|
|
||||||
|
|
||||||
.import exit_to_basic
|
|
||||||
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
|
|
||||||
.import __STARTUP_LOAD__
|
|
||||||
.import __STARTUP_SIZE__
|
|
||||||
.import __BSS_LOAD__
|
|
||||||
.import __DATA_LOAD__
|
|
||||||
.import __DATA_RUN__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __RODATA_LOAD__
|
|
||||||
.import __RODATA_RUN__
|
|
||||||
.import __RODATA_SIZE__
|
|
||||||
.import __CODE_LOAD__
|
|
||||||
.import __CODE_RUN__
|
|
||||||
.import __CODE_SIZE__
|
|
||||||
|
|
||||||
.segment "PAGE3"
|
|
||||||
|
|
||||||
disable_language_card: .res 3
|
|
||||||
bin_file_jmp: .res 3
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
.segment "EXEHDR"
|
|
||||||
|
|
||||||
.addr __STARTUP_LOAD__ ; Start address
|
|
||||||
.word __STARTUP_SIZE__+__CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP"
|
|
||||||
|
|
||||||
|
|
||||||
lda $c089 ;enable language : card read ROM, write RAM, BANK 1
|
|
||||||
|
|
||||||
;copy the monitor rom on to the language card
|
|
||||||
ldax #$f800
|
|
||||||
stax copy_src
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$0800
|
|
||||||
jsr startup_copymem
|
|
||||||
|
|
||||||
|
|
||||||
lda $c08b ;enable language : card read RAM, write RAM, BANK 1
|
|
||||||
lda $c08b ;this soft switch needs to be read twice
|
|
||||||
|
|
||||||
|
|
||||||
;relocate the CODE segment
|
|
||||||
ldax #__CODE_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__CODE_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__CODE_SIZE__
|
|
||||||
jsr startup_copymem
|
|
||||||
|
|
||||||
|
|
||||||
;relocate the RODATA segment
|
|
||||||
ldax #__RODATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__RODATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__RODATA_SIZE__
|
|
||||||
jsr startup_copymem
|
|
||||||
|
|
||||||
;relocate the DATA segment
|
|
||||||
ldax #__DATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__DATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__DATA_SIZE__
|
|
||||||
jsr startup_copymem
|
|
||||||
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
; copy memory
|
|
||||||
; set copy_src and copy_dest, length in A/X
|
|
||||||
|
|
||||||
|
|
||||||
end: .res 1
|
|
||||||
|
|
||||||
startup_copymem:
|
|
||||||
sta end
|
|
||||||
ldy #0
|
|
||||||
|
|
||||||
cpx #0
|
|
||||||
beq @tail
|
|
||||||
|
|
||||||
: lda (copy_src),y
|
|
||||||
sta (copy_dest),y
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
inc copy_src+1 ;next page
|
|
||||||
inc copy_dest+1 ;next page
|
|
||||||
dex
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
@tail:
|
|
||||||
lda end
|
|
||||||
beq @done
|
|
||||||
|
|
||||||
: lda (copy_src),y
|
|
||||||
sta (copy_dest),y
|
|
||||||
iny
|
|
||||||
cpy end
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
ldax #startup_msg
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
startup_msg: .byte "NETBOOT65 FOR APPLE 2 V0.1",13
|
|
||||||
.byte "SEE README.TXT FOR MORE INFO (INCLUDING",13
|
|
||||||
.byte "HOW TO RUN SOMETHING MORE INTERESTING)",13
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR bootmenu.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is netboot65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,117 +0,0 @@
|
||||||
.segment "IP65ZP" : zeropage
|
|
||||||
|
|
||||||
; pointers for copying
|
|
||||||
copy_src: .res 2 ; source pointer
|
|
||||||
copy_dest: .res 2 ; destination pointer
|
|
||||||
end: .res 1
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;clear screen
|
|
||||||
lda #147 ; 'CLR/HOME'
|
|
||||||
jsr $ffd2
|
|
||||||
;turn off BASIC
|
|
||||||
lda $01
|
|
||||||
and #$FE ;mask out bit 0
|
|
||||||
sta $01
|
|
||||||
|
|
||||||
;now relocate the cart
|
|
||||||
|
|
||||||
ldax #cart_data
|
|
||||||
stax copy_src
|
|
||||||
ldax #$8000
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$4000
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
;if this is a KIPPERKART, then set default drive to
|
|
||||||
;be whatever we just booted from
|
|
||||||
|
|
||||||
lda $8009
|
|
||||||
cmp #'K'
|
|
||||||
bne @drive_done
|
|
||||||
lda $8009
|
|
||||||
cmp #'K'
|
|
||||||
bne @drive_done
|
|
||||||
lda $8036 ;location in cart config of default drive
|
|
||||||
cmp #08
|
|
||||||
bne @drive_done
|
|
||||||
lda $ba
|
|
||||||
sta $8036
|
|
||||||
@drive_done:
|
|
||||||
jmp ($8002) ;warm start vector
|
|
||||||
|
|
||||||
;copy memory
|
|
||||||
;inputs:
|
|
||||||
; copy_src is address of buffer to copy from
|
|
||||||
; copy_dest is address of buffer to copy to
|
|
||||||
; AX = number of bytes to copy
|
|
||||||
;outputs: none
|
|
||||||
copymem:
|
|
||||||
sta end
|
|
||||||
ldy #0
|
|
||||||
|
|
||||||
cpx #0
|
|
||||||
beq @tail
|
|
||||||
|
|
||||||
: lda (copy_src),y
|
|
||||||
sta (copy_dest),y
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
inc copy_src+1 ;next page
|
|
||||||
inc copy_dest+1 ;next page
|
|
||||||
dex
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
@tail:
|
|
||||||
lda end
|
|
||||||
beq @done
|
|
||||||
|
|
||||||
: lda (copy_src),y
|
|
||||||
sta (copy_dest),y
|
|
||||||
iny
|
|
||||||
cpy end
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
|
|
||||||
;this is where the cart data will be appended to:
|
|
||||||
cart_data:
|
|
||||||
|
|
||||||
;-- LICENSE FOR c64_cart_ram_header.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is netboot65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,54 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
;copy BASIC to RAM
|
|
||||||
ldax #$A000
|
|
||||||
stax copy_src
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$2000
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
;copy cart data from end of file to $8000 (RAM)
|
|
||||||
ldax #cart_data
|
|
||||||
stax copy_src
|
|
||||||
ldax #$8000
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$2000
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
;swap out the cartridge (also swaps out BASIC)
|
|
||||||
|
|
||||||
lda $01
|
|
||||||
and #$fe ;reset bit 0
|
|
||||||
sta $01
|
|
||||||
|
|
||||||
;execute the cartridge from RAM
|
|
||||||
jmp ($8002)
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
cart_data: ;this should point to where the cart data gets appended.
|
|
||||||
.res $2000
|
|
Binary file not shown.
|
@ -1,107 +0,0 @@
|
||||||
;taken from DocBacardi's CRT8040 tool - http://freenet-homepage.de/LittleDreamLand/CRT8040.html
|
|
||||||
|
|
||||||
#segdef "zp", $57-$72
|
|
||||||
#segdef "bank0", $8000-$9f10, force, fillup
|
|
||||||
#segdef "common", $df10-$e000, force, fillup
|
|
||||||
|
|
||||||
#outfile @, $00, "bank0", "common"
|
|
||||||
|
|
||||||
;--------------------------------------
|
|
||||||
; init the startadr of all segments
|
|
||||||
|
|
||||||
.segment "zp"
|
|
||||||
* = $57
|
|
||||||
|
|
||||||
.segment "bank0"
|
|
||||||
* = $8000
|
|
||||||
|
|
||||||
.segment "common"
|
|
||||||
* = $df10
|
|
||||||
|
|
||||||
;--------------------------------------
|
|
||||||
; init the rr registers and copy
|
|
||||||
; bank 3 to ram
|
|
||||||
|
|
||||||
.segment "bank0"
|
|
||||||
|
|
||||||
.DW Bank0_Reset ;Reset vector
|
|
||||||
.DW $fe5e ;NMI vector is not used here, points to system
|
|
||||||
.PET "CBM80" ;Reset Magic
|
|
||||||
|
|
||||||
Bank0_Reset:
|
|
||||||
lda #%01000111 ;Standard Memory Map, No Freeze, No Banking in $DF00 (+ allow access to accessory connector - Jonno 2009-08-20)
|
|
||||||
sta $de01
|
|
||||||
|
|
||||||
ldx #kickStack_len-1
|
|
||||||
copyKickStack:
|
|
||||||
lda kickStack_org,x
|
|
||||||
sta kickStack,x
|
|
||||||
dex
|
|
||||||
bpl copyKickStack
|
|
||||||
jmp kickStack
|
|
||||||
|
|
||||||
kickStack_org:
|
|
||||||
.pseudopc $0900
|
|
||||||
kickStack:
|
|
||||||
|
|
||||||
ldx #$1f
|
|
||||||
ldy #0
|
|
||||||
copyCrt:
|
|
||||||
lda #%00101011 ; switch to bank 1
|
|
||||||
sta $de00
|
|
||||||
delay0:
|
|
||||||
nop
|
|
||||||
iny
|
|
||||||
bne delay0
|
|
||||||
copyPage0:
|
|
||||||
smod0:
|
|
||||||
lda $e000,y
|
|
||||||
sta $0400,y
|
|
||||||
iny
|
|
||||||
bne copyPage0
|
|
||||||
lda #%00110011 ; switch to bank 2
|
|
||||||
sta $de00
|
|
||||||
delay1:
|
|
||||||
nop
|
|
||||||
iny
|
|
||||||
bne delay1
|
|
||||||
copyPage1:
|
|
||||||
lda $0400,y
|
|
||||||
smod1:
|
|
||||||
sta $8000,y
|
|
||||||
iny
|
|
||||||
bne copyPage1
|
|
||||||
inc smod0+2
|
|
||||||
inc smod1+2
|
|
||||||
inc $d020
|
|
||||||
dex
|
|
||||||
bpl copyCrt
|
|
||||||
|
|
||||||
lda #%00110001 ; switch to 8040
|
|
||||||
sta $de00
|
|
||||||
delay2:
|
|
||||||
nop
|
|
||||||
iny
|
|
||||||
bne delay2
|
|
||||||
|
|
||||||
|
|
||||||
; during the copy process occured some irqs, clear them
|
|
||||||
lda $dc0d
|
|
||||||
lda $dd0d
|
|
||||||
asl $d019
|
|
||||||
|
|
||||||
; set registers
|
|
||||||
; NV-BDIZC
|
|
||||||
lda #%00110111
|
|
||||||
pha
|
|
||||||
lda #$c3
|
|
||||||
ldx #$00
|
|
||||||
plp
|
|
||||||
|
|
||||||
jmp ($8000)
|
|
||||||
|
|
||||||
kickStack_len = *-kickStack
|
|
||||||
.realpc
|
|
||||||
|
|
||||||
;--------------------------------------
|
|
||||||
|
|
|
@ -1,562 +0,0 @@
|
||||||
;use the NB65 API to send a d64 disk via TFTP
|
|
||||||
;
|
|
||||||
;
|
|
||||||
|
|
||||||
.ifndef NB65_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/nb65_constants.i"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.include "../ip65/copymem.s"
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
.import print_a
|
|
||||||
.import get_key
|
|
||||||
.import get_filtered_input
|
|
||||||
.import filter_dns
|
|
||||||
.macro cout arg
|
|
||||||
lda arg
|
|
||||||
jsr print_a
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
;######### KERNEL functions
|
|
||||||
CHKIN = $ffc6
|
|
||||||
CHKOUT = $ffc9
|
|
||||||
CHRIN = $ffcf
|
|
||||||
CHROUT = $ffd2
|
|
||||||
CLALL = $FFE7
|
|
||||||
CLOSE = $ffc3
|
|
||||||
OPEN = $ffc0
|
|
||||||
READST = $ffb7
|
|
||||||
SETNAM = $ffbd
|
|
||||||
SETLFS = $ffba
|
|
||||||
|
|
||||||
.bss
|
|
||||||
current_byte: .res 1
|
|
||||||
track: .res 1
|
|
||||||
sector: .res 1
|
|
||||||
sectors_in_track: .res 1
|
|
||||||
error_buffer: .res 128
|
|
||||||
|
|
||||||
command_buffer: .res 128
|
|
||||||
sector_buffer: .res 256
|
|
||||||
nb65_param_buffer: .res $20
|
|
||||||
sector_buffer_address: .res 2
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
temp_ptr: .res 2
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
.macro print arg
|
|
||||||
ldax arg
|
|
||||||
ldy #NB65_PRINT_ASCIIZ
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro print_cr
|
|
||||||
lda #13
|
|
||||||
jsr print_a
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro call arg
|
|
||||||
ldy arg
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
|
|
||||||
;look for NB65 signature at location pointed at by AX
|
|
||||||
look_for_signature:
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #3
|
|
||||||
@check_one_byte:
|
|
||||||
lda (temp_ptr),y
|
|
||||||
cmp nb65_signature,y
|
|
||||||
bne @bad_match
|
|
||||||
dey
|
|
||||||
bpl@check_one_byte
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@bad_match:
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
init:
|
|
||||||
|
|
||||||
print #signon_message
|
|
||||||
|
|
||||||
ldax #NB65_CART_SIGNATURE ;where signature should be in cartridge
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc @found_nb65_signature
|
|
||||||
|
|
||||||
ldax #NB65_RAM_STUB_SIGNATURE ;where signature should be in RAM
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc :+
|
|
||||||
jmp nb65_signature_not_found
|
|
||||||
:
|
|
||||||
jsr NB65_RAM_STUB_ACTIVATE ;we need to turn on NB65 cartridge
|
|
||||||
|
|
||||||
@found_nb65_signature:
|
|
||||||
|
|
||||||
print #initializing
|
|
||||||
print #nb65_signature
|
|
||||||
ldy #NB65_INITIALIZE
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
bcc :+
|
|
||||||
print #failed
|
|
||||||
jsr print_nb65_errorcode
|
|
||||||
jmp bad_boot
|
|
||||||
:
|
|
||||||
print #ok
|
|
||||||
print_cr
|
|
||||||
|
|
||||||
; ########################
|
|
||||||
; main program goes here:
|
|
||||||
;
|
|
||||||
|
|
||||||
jsr CLALL
|
|
||||||
|
|
||||||
|
|
||||||
; ldx #18
|
|
||||||
; stx track
|
|
||||||
; ldx #1
|
|
||||||
; stx sector
|
|
||||||
; ldx #21
|
|
||||||
; stx sectors_in_track
|
|
||||||
; ldax #sector_buffer
|
|
||||||
; jsr send_next_block
|
|
||||||
; rts
|
|
||||||
|
|
||||||
|
|
||||||
@send_1_image:
|
|
||||||
lda #$93 ;cls
|
|
||||||
jsr print_a
|
|
||||||
print #signon_message
|
|
||||||
jsr reset_counters_to_first_sector
|
|
||||||
print #enter_filename
|
|
||||||
ldax #filter_dns ;this is pretty close to being a filter for legal chars in file names as well
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_filename_entered
|
|
||||||
stax nb65_param_buffer+NB65_TFTP_FILENAME
|
|
||||||
print #position_cursor_for_track_display
|
|
||||||
ldax #send_next_block
|
|
||||||
stax nb65_param_buffer+NB65_TFTP_POINTER
|
|
||||||
ldax #nb65_param_buffer
|
|
||||||
call #NB65_TFTP_CALLBACK_UPLOAD
|
|
||||||
bcc :+
|
|
||||||
print_cr
|
|
||||||
print #failed
|
|
||||||
jmp print_nb65_errorcode
|
|
||||||
:
|
|
||||||
lda #15 ; filenumber 15 - command channel
|
|
||||||
jsr CLOSE
|
|
||||||
print_cr
|
|
||||||
print #ok
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
jsr get_key
|
|
||||||
jmp @send_1_image ;done! so go again
|
|
||||||
@no_filename_entered:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
send_next_block:
|
|
||||||
;tftp upload callback routine
|
|
||||||
;AX will point to address to fill
|
|
||||||
stax sector_buffer_address
|
|
||||||
lda track
|
|
||||||
cmp #36
|
|
||||||
beq @past_last_track
|
|
||||||
print #position_cursor_for_track_display
|
|
||||||
jsr print_current_sector
|
|
||||||
jsr read_sector
|
|
||||||
lda #$30
|
|
||||||
cmp error_buffer
|
|
||||||
bne @was_an_error
|
|
||||||
@after_error_check:
|
|
||||||
jsr move_to_next_sector
|
|
||||||
bcc @not_last_sector
|
|
||||||
ldax #$100
|
|
||||||
rts
|
|
||||||
@not_last_sector:
|
|
||||||
|
|
||||||
; jsr dump_sector ;DEBUG
|
|
||||||
|
|
||||||
inc sector_buffer_address+1
|
|
||||||
jsr read_sector
|
|
||||||
jsr move_to_next_sector
|
|
||||||
ldax #$200
|
|
||||||
|
|
||||||
; jsr dump_sector ;DEBUG
|
|
||||||
|
|
||||||
rts
|
|
||||||
@past_last_track:
|
|
||||||
ldax #$0000
|
|
||||||
rts
|
|
||||||
|
|
||||||
@was_an_error:
|
|
||||||
print #position_cursor_for_error_display
|
|
||||||
print #drive_error
|
|
||||||
print_cr
|
|
||||||
jsr print_current_sector
|
|
||||||
print #error_buffer
|
|
||||||
jmp @after_error_check
|
|
||||||
|
|
||||||
print_current_sector:
|
|
||||||
print #track_no
|
|
||||||
lda track
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
jsr print_a
|
|
||||||
pla
|
|
||||||
jsr print_a
|
|
||||||
print #sector_no
|
|
||||||
lda sector
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
jsr print_a
|
|
||||||
pla
|
|
||||||
jsr print_a
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
dump_sector:
|
|
||||||
;hex dump sector
|
|
||||||
lda #0
|
|
||||||
sta current_byte
|
|
||||||
@dump_byte:
|
|
||||||
ldy current_byte
|
|
||||||
lda sector_buffer,y
|
|
||||||
call #NB65_PRINT_HEX
|
|
||||||
inc current_byte
|
|
||||||
bne @dump_byte
|
|
||||||
rts
|
|
||||||
|
|
||||||
read_sector:
|
|
||||||
;routine to read a sector cribbed from http://codebase64.org/doku.php?id=base:reading_a_sector_from_disk
|
|
||||||
; - requires track and sector values be set first
|
|
||||||
; sector will be written to address whos value is stored in sector_data
|
|
||||||
; open the channel file
|
|
||||||
|
|
||||||
jsr make_read_sector_command
|
|
||||||
|
|
||||||
lda #1
|
|
||||||
ldx #<cname
|
|
||||||
ldy #>cname
|
|
||||||
jsr SETNAM
|
|
||||||
lda #02
|
|
||||||
ldx #08
|
|
||||||
ldy #02
|
|
||||||
jsr SETLFS
|
|
||||||
jsr OPEN
|
|
||||||
bcs @error
|
|
||||||
ldx #<command_buffer
|
|
||||||
ldy #>command_buffer
|
|
||||||
lda #12
|
|
||||||
jsr SETNAM
|
|
||||||
lda #15
|
|
||||||
ldx $BA ;use whatever was last device #
|
|
||||||
ldy #15
|
|
||||||
jsr SETLFS
|
|
||||||
jsr OPEN
|
|
||||||
bcs @error
|
|
||||||
|
|
||||||
|
|
||||||
jsr check_error_channel
|
|
||||||
lda #$30
|
|
||||||
cmp error_buffer
|
|
||||||
beq @was_not_an_error
|
|
||||||
print #error_buffer
|
|
||||||
|
|
||||||
@was_not_an_error:
|
|
||||||
ldx #$02 ; filenumber 2
|
|
||||||
jsr CHKIN ;(file 2 now used as input)
|
|
||||||
|
|
||||||
lda sector_buffer_address
|
|
||||||
sta temp_ptr
|
|
||||||
lda sector_buffer_address+1
|
|
||||||
sta temp_ptr+1
|
|
||||||
ldy #$00
|
|
||||||
@loop:
|
|
||||||
jsr CHRIN ;(get a byte from file)
|
|
||||||
sta (temp_ptr),Y ; write byte to memory
|
|
||||||
iny
|
|
||||||
bne @loop ; next byte, end when 256 bytes are read
|
|
||||||
@close:
|
|
||||||
lda #15 ; filenumber 15
|
|
||||||
jsr CLOSE
|
|
||||||
lda #$02 ; filenumber 2
|
|
||||||
jsr CLOSE
|
|
||||||
ldx #$00 ; filenumber 0 = keyboard
|
|
||||||
jsr CHKIN ;(keyboard now input device again)
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
pha
|
|
||||||
print #error_opening_channel
|
|
||||||
pla
|
|
||||||
call #NB65_PRINT_HEX
|
|
||||||
jmp @close
|
|
||||||
|
|
||||||
check_error_channel:
|
|
||||||
LDX #$0F ; filenumber 15
|
|
||||||
JSR CHKIN ;(file 15 now used as input)
|
|
||||||
LDY #$00
|
|
||||||
@loop:
|
|
||||||
JSR READST ;(read status byte)
|
|
||||||
BNE @eof ; either EOF or read error
|
|
||||||
JSR CHRIN ;(get a byte from file)
|
|
||||||
sta error_buffer,y
|
|
||||||
iny
|
|
||||||
JMP @loop ; next byte
|
|
||||||
|
|
||||||
@eof:
|
|
||||||
lda #0
|
|
||||||
sta error_buffer,y
|
|
||||||
LDX #$00 ; filenumber 0 = keyboard
|
|
||||||
JSR CHKIN ;(keyboard now input device again)
|
|
||||||
RTS
|
|
||||||
|
|
||||||
bad_boot:
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
restart:
|
|
||||||
jsr get_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
|
|
||||||
print_a_as_errorcode:
|
|
||||||
pha
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
print #error_code
|
|
||||||
pla
|
|
||||||
call #NB65_PRINT_HEX
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_nb65_errorcode:
|
|
||||||
print #error_code
|
|
||||||
call #NB65_GET_LAST_ERROR
|
|
||||||
call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
nb65_signature_not_found:
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda nb65_signature_not_found_message,y
|
|
||||||
beq restart
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
jmp :-
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
make_read_sector_command:
|
|
||||||
;fill command buffer with command to read in track & sector
|
|
||||||
;returns length of command in Y
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
lda #85 ;"U"
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$31 ;"1"
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$32 ;"2" - file number
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$30 ;"0" - drive number
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda track
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
sta command_buffer,y
|
|
||||||
pla
|
|
||||||
iny
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda sector
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
sta command_buffer,y
|
|
||||||
pla
|
|
||||||
iny
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta command_buffer,y ;make it ASCIIZ so we can print it
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
byte_to_ascii:
|
|
||||||
cmp #30
|
|
||||||
bmi @not_30
|
|
||||||
ldx #$33
|
|
||||||
clc
|
|
||||||
adc #18
|
|
||||||
rts
|
|
||||||
@not_30:
|
|
||||||
cmp #20
|
|
||||||
bmi @not_20
|
|
||||||
ldx #$32
|
|
||||||
clc
|
|
||||||
adc #28
|
|
||||||
rts
|
|
||||||
@not_20:
|
|
||||||
cmp #10
|
|
||||||
bmi @not_10
|
|
||||||
ldx #$31
|
|
||||||
clc
|
|
||||||
adc #38
|
|
||||||
rts
|
|
||||||
@not_10:
|
|
||||||
ldx #$30
|
|
||||||
clc
|
|
||||||
adc #48
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
reset_counters_to_first_sector:
|
|
||||||
ldx #1
|
|
||||||
stx track
|
|
||||||
dex
|
|
||||||
stx sector
|
|
||||||
ldx #21
|
|
||||||
stx sectors_in_track
|
|
||||||
rts
|
|
||||||
|
|
||||||
move_to_next_sector:
|
|
||||||
inc sector
|
|
||||||
lda sector
|
|
||||||
cmp sectors_in_track
|
|
||||||
beq @move_to_next_track
|
|
||||||
rts
|
|
||||||
@move_to_next_track:
|
|
||||||
lda #0
|
|
||||||
sta sector
|
|
||||||
inc track
|
|
||||||
lda track
|
|
||||||
cmp #18
|
|
||||||
bne @not_track_18
|
|
||||||
lda #19
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@not_track_18:
|
|
||||||
cmp #25
|
|
||||||
bne @not_track_25
|
|
||||||
lda #18
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@not_track_25:
|
|
||||||
cmp #31
|
|
||||||
bne @not_track_31
|
|
||||||
lda #17
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@not_track_31:
|
|
||||||
lda track
|
|
||||||
cmp #36 ;carry will be set if hit track 36
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
error_code:
|
|
||||||
.byte "ERROR CODE: $",0
|
|
||||||
press_a_key_to_continue:
|
|
||||||
.byte "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
|
|
||||||
failed:
|
|
||||||
.byte "FAILED ", 0
|
|
||||||
|
|
||||||
ok:
|
|
||||||
.byte "OK ", 0
|
|
||||||
|
|
||||||
initializing:
|
|
||||||
.byte "INITIALIZING ",0
|
|
||||||
track_no:
|
|
||||||
.byte "TRACK ",0
|
|
||||||
|
|
||||||
|
|
||||||
sector_no:
|
|
||||||
.byte " SECTOR ",0
|
|
||||||
|
|
||||||
signon_message:
|
|
||||||
.byte "D64 UPLOADER V0.1",13,0
|
|
||||||
|
|
||||||
enter_filename:
|
|
||||||
.byte "SEND AS: ",0
|
|
||||||
|
|
||||||
drive_error:
|
|
||||||
.byte "DRIVE ACCESS ERROR - ",0
|
|
||||||
nb65_signature_not_found_message:
|
|
||||||
.byte "NO NB65 API FOUND",13,"PRESS ANY KEY TO RESET", 0
|
|
||||||
error_opening_channel:
|
|
||||||
.byte "ERROR OPENING CHANNEL $",0
|
|
||||||
|
|
||||||
disk_access:
|
|
||||||
.byte 13,13,13,13,13,"SENDING TO CHANNEL $",0
|
|
||||||
|
|
||||||
nb65_signature:
|
|
||||||
.byte $4E,$42,$36,$35 ; "NB65" - API signature
|
|
||||||
.byte ' ',0 ; so we can use this as a string
|
|
||||||
position_cursor_for_track_display:
|
|
||||||
; .byte $13,13,13,13,13,13,13,13,13,13,13," SENDING ",0
|
|
||||||
.byte $13,13,13,"SENDING ",0
|
|
||||||
position_cursor_for_error_display:
|
|
||||||
.byte $13,13,13,13,"LAST ",0
|
|
||||||
|
|
||||||
cname: .byte '#'
|
|
||||||
;-- LICENSE FOR d64_upload.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is netboot65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,33 +0,0 @@
|
||||||
infilename=ARGV[0]
|
|
||||||
outfilename=ARGV[1]
|
|
||||||
duplication=ARGV[2].to_i
|
|
||||||
|
|
||||||
if duplication.nil? then
|
|
||||||
puts "usage: dupe_cart.rb [input filename] [output filename] [number of duplications]"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
infile=File.open(infilename,"rb").read
|
|
||||||
puts "copying #{infilename} to #{outfilename} #{duplication} times"
|
|
||||||
outfile=File.open(outfilename,"wb")
|
|
||||||
duplication.times {outfile<<infile}
|
|
||||||
outfile.close
|
|
||||||
#-- LICENSE FOR dupe_cart.rb --
|
|
||||||
# The contents of this file are subject to the Mozilla Public License
|
|
||||||
# Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
# compliance with the License. You may obtain a copy of the License at
|
|
||||||
# http://www.mozilla.org/MPL/
|
|
||||||
#
|
|
||||||
# Software distributed under the License is distributed on an "AS IS"
|
|
||||||
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing rights and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
# The Original Code is netboot65.
|
|
||||||
#
|
|
||||||
# The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
# jonno@jamtronix.com.
|
|
||||||
# Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
# Jonno Downes. All Rights Reserved.
|
|
||||||
# -- LICENSE END --
|
|
|
@ -1,44 +0,0 @@
|
||||||
#
|
|
||||||
# Vice will treat a cartridge bin file that is of an even length as if the first 2 bytes in the file are a load address to be skipped over
|
|
||||||
# so we want to make sure the bin file is an odd length - specifically 8193 bytes
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
PAD_BYTE=0xff.chr
|
|
||||||
filename=ARGV[0]
|
|
||||||
|
|
||||||
if filename.nil? then
|
|
||||||
puts "no filename specified"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
if ARGV[1].nil? then
|
|
||||||
puts "no padding length specified"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
file_length=ARGV[1].to_i
|
|
||||||
|
|
||||||
infile=File.open(filename,"rb").read
|
|
||||||
puts "fixing length of #{filename} from #{infile.length} to #{file_length} bytes"
|
|
||||||
outfile=File.open(filename,"wb")
|
|
||||||
outfile<<infile
|
|
||||||
outfile<<PAD_BYTE*(file_length-infile.length)
|
|
||||||
outfile.close
|
|
||||||
#-- LICENSE FOR fix_cart.rb --
|
|
||||||
# The contents of this file are subject to the Mozilla Public License
|
|
||||||
# Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
# compliance with the License. You may obtain a copy of the License at
|
|
||||||
# http://www.mozilla.org/MPL/
|
|
||||||
#
|
|
||||||
# Software distributed under the License is distributed on an "AS IS"
|
|
||||||
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing rights and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
# The Original Code is netboot65.
|
|
||||||
#
|
|
||||||
# The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
# jonno@jamtronix.com.
|
|
||||||
# Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
# Jonno Downes. All Rights Reserved.
|
|
||||||
# -- LICENSE END --
|
|
Binary file not shown.
|
@ -1,303 +0,0 @@
|
||||||
; #############
|
|
||||||
; KIPPER GO - Telnet/Gopher client for C64
|
|
||||||
; jonno@jamtronix.com
|
|
||||||
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.include "../inc/c64keycodes.i"
|
|
||||||
.include "../inc/menu.i"
|
|
||||||
.include "../inc/config_menu.i"
|
|
||||||
|
|
||||||
KEY_NEXT_PAGE=KEYCODE_F7
|
|
||||||
KEY_PREV_PAGE=KEYCODE_F1
|
|
||||||
KEY_SHOW_HISTORY=KEYCODE_F2
|
|
||||||
KEY_BACK_IN_HISTORY=KEYCODE_F3
|
|
||||||
KEY_NEW_SERVER=KEYCODE_F5
|
|
||||||
|
|
||||||
GOPHER_BUFFER_SIZE=16000
|
|
||||||
|
|
||||||
.include "../inc/gopher.i"
|
|
||||||
.include "../inc/telnet.i"
|
|
||||||
|
|
||||||
.import cls
|
|
||||||
.import beep
|
|
||||||
.import exit_to_basic
|
|
||||||
.import ip65_process
|
|
||||||
.import ip65_init
|
|
||||||
.import get_filtered_input
|
|
||||||
.import filter_text
|
|
||||||
.import filter_dns
|
|
||||||
.import filter_ip
|
|
||||||
.import arp_calculate_gateway_mask
|
|
||||||
.import parse_dotted_quad
|
|
||||||
.import dotted_quad_value
|
|
||||||
.import parse_integer
|
|
||||||
|
|
||||||
.import get_key_ip65
|
|
||||||
.import cfg_mac
|
|
||||||
.import dhcp_init
|
|
||||||
|
|
||||||
.import cfg_ip
|
|
||||||
.import cfg_netmask
|
|
||||||
.import cfg_gateway
|
|
||||||
.import cfg_dns
|
|
||||||
.import cfg_tftp_server
|
|
||||||
|
|
||||||
.import xmodem_receive
|
|
||||||
|
|
||||||
.export telnet_menu
|
|
||||||
|
|
||||||
.import print_a
|
|
||||||
.import print_cr
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import get_filtered_input
|
|
||||||
.import __DATA_LOAD__
|
|
||||||
.import __DATA_RUN__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __SELF_MODIFIED_CODE_LOAD__
|
|
||||||
.import __SELF_MODIFIED_CODE_RUN__
|
|
||||||
.import __SELF_MODIFIED_CODE_SIZE__
|
|
||||||
|
|
||||||
.import cfg_tftp_server
|
|
||||||
directory_buffer = $6000
|
|
||||||
|
|
||||||
.bss
|
|
||||||
;temp_ax: .res 2
|
|
||||||
|
|
||||||
|
|
||||||
.segment "CARTRIDGE_HEADER"
|
|
||||||
.word cold_init ;cold start vector
|
|
||||||
.word warm_init ;warm start vector
|
|
||||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
|
||||||
.byte "KIPTRM"
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cold_init:
|
|
||||||
|
|
||||||
;first let the kernal do a normal startup
|
|
||||||
sei
|
|
||||||
jsr $fda3 ;initialize CIA I/O
|
|
||||||
jsr $fd50 ;RAM test, set pointers
|
|
||||||
jsr $fd15 ;set vectors for KERNAL
|
|
||||||
jsr $ff5B ;init. VIC
|
|
||||||
cli ;KERNAL init. finished
|
|
||||||
|
|
||||||
warm_init:
|
|
||||||
;set some funky colours
|
|
||||||
|
|
||||||
jsr setup_screen
|
|
||||||
|
|
||||||
;relocate our r/w data
|
|
||||||
ldax #__DATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__DATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__DATA_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
;relocate the self-modifying code (if necessary)
|
|
||||||
ldax #__SELF_MODIFIED_CODE_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__SELF_MODIFIED_CODE_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__SELF_MODIFIED_CODE_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
; ldax #init_msg+1
|
|
||||||
; jsr print_ascii_as_native
|
|
||||||
print_driver_init
|
|
||||||
jsr ip65_init
|
|
||||||
bcs init_failed
|
|
||||||
jsr dhcp_init
|
|
||||||
bcc init_ok
|
|
||||||
jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to cartridge default values)
|
|
||||||
bcc init_ok
|
|
||||||
init_failed:
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
print_main_menu:
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #main_menu_msg
|
|
||||||
jmp print_ascii_as_native
|
|
||||||
|
|
||||||
init_ok:
|
|
||||||
|
|
||||||
main_menu:
|
|
||||||
jsr print_main_menu
|
|
||||||
jsr print_ip_config
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
@get_key:
|
|
||||||
jsr get_key_ip65
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne @not_f1
|
|
||||||
jsr cls
|
|
||||||
ldax #telnet_header
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jmp telnet_main_entry
|
|
||||||
|
|
||||||
@not_f1:
|
|
||||||
cmp #KEYCODE_F3
|
|
||||||
bne @not_f3
|
|
||||||
jsr cls
|
|
||||||
ldax #gopher_header
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr prompt_for_gopher_resource ;only returns if no server was entered.
|
|
||||||
jmp exit_gopher
|
|
||||||
@not_f3:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F5
|
|
||||||
bne @not_f5
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
ldax #gopher_initial_location
|
|
||||||
sta resource_pointer_lo
|
|
||||||
stx resource_pointer_hi
|
|
||||||
ldx #0
|
|
||||||
jsr select_resource_from_current_directory
|
|
||||||
jmp exit_gopher
|
|
||||||
@not_f5:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
beq @change_config
|
|
||||||
cmp #KEYCODE_F8
|
|
||||||
bne @not_f8
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #credits
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr get_key_ip65
|
|
||||||
jmp main_menu
|
|
||||||
@not_f8:
|
|
||||||
|
|
||||||
jmp @get_key
|
|
||||||
|
|
||||||
@change_config:
|
|
||||||
jsr configuration_menu
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wait_for_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key:
|
|
||||||
jmp get_key_ip65
|
|
||||||
|
|
||||||
cfg_get_configuration_ptr:
|
|
||||||
ldax #cfg_mac
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
setup_screen:
|
|
||||||
;make sure normal font
|
|
||||||
lda #$15
|
|
||||||
sta $d018
|
|
||||||
|
|
||||||
LDA #$06 ;blue
|
|
||||||
|
|
||||||
STA $D020 ;border
|
|
||||||
LDA #$00 ;black
|
|
||||||
STA $D021 ;background
|
|
||||||
lda #$05 ;petscii for white text
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
lda #14
|
|
||||||
jmp print_a ;switch to lower case
|
|
||||||
|
|
||||||
telnet_menu:
|
|
||||||
rts
|
|
||||||
|
|
||||||
exit_telnet:
|
|
||||||
exit_gopher:
|
|
||||||
jsr setup_screen
|
|
||||||
jmp main_menu
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
menu_header_msg:
|
|
||||||
.byte $13,10,"KipperGo V"
|
|
||||||
.include "../inc/version.i"
|
|
||||||
.byte 10,0
|
|
||||||
main_menu_msg:
|
|
||||||
.byte 10,"Main Menu",10,10
|
|
||||||
.byte "F1: Telnet F3: Gopher ",10
|
|
||||||
.byte "F5: Gopher (floodgap.com)",10
|
|
||||||
.byte "F7: Config F8: Credits",10,10
|
|
||||||
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gopher_initial_location:
|
|
||||||
.byte "1gopher.floodgap.com",$09,"/",$09,"gopher.floodgap.com",$09,"70",$0D,$0A,0
|
|
||||||
|
|
||||||
gopher_header: .byte "gopher",10,0
|
|
||||||
telnet_header: .byte "telnet",10,0
|
|
||||||
|
|
||||||
current:
|
|
||||||
.byte "current ",0
|
|
||||||
|
|
||||||
new:
|
|
||||||
.byte"new ",0
|
|
||||||
|
|
||||||
resolving:
|
|
||||||
.byte "resolving ",0
|
|
||||||
|
|
||||||
|
|
||||||
credits:
|
|
||||||
.byte 10,"License: Mozilla Public License v1.1",10,"http://www.mozilla.org/MPL/"
|
|
||||||
.byte 10
|
|
||||||
.byte 10,"Contributors:",10
|
|
||||||
.byte 10,"Jonno Downes"
|
|
||||||
.byte 10,"Glenn Holmer"
|
|
||||||
.byte 10,"Per Olofsson"
|
|
||||||
.byte 10,"Lars Stollenwerk"
|
|
||||||
.byte 10,10
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
;-- LICENSE FOR kipperterm.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is KipperTerm.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,724 +0,0 @@
|
||||||
; #############
|
|
||||||
; KIPPER KART - A C64 TCP/IP stack as a 16KB cartridge
|
|
||||||
; jonno@jamtronix.com
|
|
||||||
|
|
||||||
.macro print_failed
|
|
||||||
ldax #failed_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro print_ok
|
|
||||||
ldax #ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro kippercall arg
|
|
||||||
ldy arg
|
|
||||||
jsr KPR_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/kipper_constants.i"
|
|
||||||
.endif
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/c64keycodes.i"
|
|
||||||
.include "../inc/menu.i"
|
|
||||||
|
|
||||||
.include "../inc/ping.i"
|
|
||||||
.include "../inc/sidplay.i"
|
|
||||||
|
|
||||||
.include "../inc/disk_transfer.i"
|
|
||||||
.include "../inc/config_menu.i"
|
|
||||||
|
|
||||||
.import cls
|
|
||||||
.import beep
|
|
||||||
.import exit_to_basic
|
|
||||||
.import timer_vbl_handler
|
|
||||||
.import kipper_dispatcher
|
|
||||||
.import ip65_process
|
|
||||||
.import ip65_init
|
|
||||||
.import get_filtered_input
|
|
||||||
.import filter_text
|
|
||||||
.import filter_dns
|
|
||||||
.import filter_ip
|
|
||||||
.import arp_calculate_gateway_mask
|
|
||||||
.import parse_dotted_quad
|
|
||||||
.import dotted_quad_value
|
|
||||||
.import parse_integer
|
|
||||||
.import print_integer
|
|
||||||
.import get_key_ip65
|
|
||||||
.import cfg_ip
|
|
||||||
.import cfg_netmask
|
|
||||||
.import cfg_gateway
|
|
||||||
.import cfg_dns
|
|
||||||
.import cfg_tftp_server
|
|
||||||
|
|
||||||
.import timer_read
|
|
||||||
.import timer_timeout
|
|
||||||
|
|
||||||
.import print_ascii_as_native
|
|
||||||
.import print_dotted_quad
|
|
||||||
.import print_hex
|
|
||||||
.import print_errorcode
|
|
||||||
.import print_ip_config
|
|
||||||
.import ok_msg
|
|
||||||
.import failed_msg
|
|
||||||
.import init_msg
|
|
||||||
.import ip_address_msg
|
|
||||||
.import netmask_msg
|
|
||||||
.import gateway_msg
|
|
||||||
.import dns_server_msg
|
|
||||||
.import tftp_server_msg
|
|
||||||
.import press_a_key_to_continue
|
|
||||||
.import cfg_default_drive
|
|
||||||
.import print_a
|
|
||||||
.import print_cr
|
|
||||||
.import print
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import get_filtered_input
|
|
||||||
.import __DATA_LOAD__
|
|
||||||
.import __DATA_RUN__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __SELF_MODIFIED_CODE_LOAD__
|
|
||||||
.import __SELF_MODIFIED_CODE_RUN__
|
|
||||||
.import __SELF_MODIFIED_CODE_SIZE__
|
|
||||||
|
|
||||||
.import cfg_tftp_server
|
|
||||||
kipper_param_buffer = $6000
|
|
||||||
directory_buffer = $4020
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
|
||||||
filemask_ptr: .res 2
|
|
||||||
.segment "SELF_MODIFIED_CODE"
|
|
||||||
|
|
||||||
call_downloaded_prg:
|
|
||||||
jsr $0000 ;overwritten when we load a file
|
|
||||||
jmp cold_init
|
|
||||||
|
|
||||||
get_value_of_axy: ;some more self-modifying code
|
|
||||||
lda $ffff,y
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
.segment "CARTRIDGE_HEADER"
|
|
||||||
.word cold_init ;cold start vector
|
|
||||||
.word warm_init ;warm start vector
|
|
||||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
|
||||||
.byte "KIPPER" ; API signature
|
|
||||||
jmp kipper_dispatcher ; KPR_DISPATCH_VECTOR : entry point for KIPPER functions
|
|
||||||
jmp ip65_process ;KPR_PERIODIC_PROCESSING_VECTOR : routine to be periodically called to check for arrival of ethernet packets
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cold_init:
|
|
||||||
|
|
||||||
jsr init_tod
|
|
||||||
|
|
||||||
;first let the kernal do a normal startup
|
|
||||||
sei
|
|
||||||
jsr $fda3 ;initialize CIA I/O
|
|
||||||
jsr $fd50 ;RAM test, set pointers
|
|
||||||
jsr $fd15 ;set vectors for KERNAL
|
|
||||||
jsr $ff5B ;init. VIC
|
|
||||||
cli ;KERNAL init. finished
|
|
||||||
|
|
||||||
|
|
||||||
warm_init:
|
|
||||||
|
|
||||||
lda #14
|
|
||||||
jsr print_a ;switch to lower case
|
|
||||||
|
|
||||||
;set some funky colours
|
|
||||||
|
|
||||||
LDA #$04 ;purple
|
|
||||||
|
|
||||||
STA $D020 ;border
|
|
||||||
LDA #$00 ;black
|
|
||||||
STA $D021 ;background
|
|
||||||
lda #$05 ;petscii for white text
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
;relocate our r/w data
|
|
||||||
ldax #__DATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__DATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__DATA_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
;relocate the self-modifying code (if necessary)
|
|
||||||
ldax #__SELF_MODIFIED_CODE_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__SELF_MODIFIED_CODE_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__SELF_MODIFIED_CODE_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #init_msg+1
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
kippercall #KPR_INITIALIZE
|
|
||||||
bcc init_ok
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
print_main_menu:
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #main_menu_msg
|
|
||||||
jmp print_ascii_as_native
|
|
||||||
|
|
||||||
init_ok:
|
|
||||||
|
|
||||||
;look for an 'autoexec' file
|
|
||||||
jsr print_cr
|
|
||||||
ldax #loading_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda cfg_default_drive
|
|
||||||
sec
|
|
||||||
sbc #7
|
|
||||||
sta io_device_no
|
|
||||||
ldax #autoexec_filename
|
|
||||||
stax io_filename
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #$0000
|
|
||||||
jsr io_read_file
|
|
||||||
bcs main_menu
|
|
||||||
@file_read_ok:
|
|
||||||
ldax #load_ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax io_load_address
|
|
||||||
jmp boot_into_file
|
|
||||||
|
|
||||||
main_menu:
|
|
||||||
jsr print_main_menu
|
|
||||||
jsr print_ip_config
|
|
||||||
jsr print_default_drive
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
@get_key:
|
|
||||||
jsr get_key_ip65
|
|
||||||
|
|
||||||
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne @not_f1
|
|
||||||
jmp @tftp_boot
|
|
||||||
@not_f1:
|
|
||||||
cmp #KEYCODE_F2
|
|
||||||
bne @not_f2
|
|
||||||
jmp disk_boot
|
|
||||||
@not_f2:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F3
|
|
||||||
bne @not_f3
|
|
||||||
jsr upload_d64
|
|
||||||
jmp main_menu
|
|
||||||
@not_f3:
|
|
||||||
cmp #KEYCODE_F4
|
|
||||||
bne @not_f4
|
|
||||||
jsr d64_download
|
|
||||||
jmp main_menu
|
|
||||||
@not_f4:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F5
|
|
||||||
bne @not_f5
|
|
||||||
jmp netplay_sid
|
|
||||||
@not_f5:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F6
|
|
||||||
bne @not_f6
|
|
||||||
jsr cls
|
|
||||||
ldax #ping_header
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr ping_loop
|
|
||||||
jmp exit_ping
|
|
||||||
|
|
||||||
@not_f6:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
beq @change_config
|
|
||||||
|
|
||||||
|
|
||||||
jmp @get_key
|
|
||||||
|
|
||||||
@exit_to_prog:
|
|
||||||
ldax #$fe66 ;do a wam start
|
|
||||||
jmp call_downloaded_prg
|
|
||||||
|
|
||||||
|
|
||||||
@change_config:
|
|
||||||
jsr configuration_menu
|
|
||||||
jmp main_menu
|
|
||||||
@tftp_boot:
|
|
||||||
|
|
||||||
ldax #tftp_dir_filemask
|
|
||||||
stax filemask_ptr
|
|
||||||
jsr get_tftp_directory_listing
|
|
||||||
bcs return_to_main
|
|
||||||
|
|
||||||
@boot_filename_set:
|
|
||||||
;AX now points to filename
|
|
||||||
jsr download
|
|
||||||
bcc file_downloaded_ok
|
|
||||||
tftp_boot_failed:
|
|
||||||
jsr wait_for_keypress
|
|
||||||
return_to_main:
|
|
||||||
jmp error_handler
|
|
||||||
|
|
||||||
file_downloaded_ok:
|
|
||||||
ldax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
|
|
||||||
boot_into_file:
|
|
||||||
stax kipper_param_buffer ;use the param buffer as a temp holding place for the load address
|
|
||||||
;get ready to bank out
|
|
||||||
kippercall #KPR_DEACTIVATE
|
|
||||||
|
|
||||||
jsr $ffe7 ; make sure all files have been closed.
|
|
||||||
|
|
||||||
;check whether the file we just downloaded was a BASIC prg
|
|
||||||
lda kipper_param_buffer
|
|
||||||
cmp #01
|
|
||||||
bne @not_a_basic_file
|
|
||||||
|
|
||||||
lda kipper_param_buffer+1
|
|
||||||
cmp #$08
|
|
||||||
bne @not_a_basic_file
|
|
||||||
|
|
||||||
lda $805
|
|
||||||
cmp #$9e ;opcode for 'SYS'
|
|
||||||
bne @not_a_basic_stub
|
|
||||||
|
|
||||||
ldax #$806 ;should point to ascii string containing address that was to be SYSed
|
|
||||||
jsr parse_integer
|
|
||||||
jmp exit_cart_via_ax ;good luck!
|
|
||||||
@not_a_basic_stub:
|
|
||||||
ldax #cant_boot_basic
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp warm_init
|
|
||||||
|
|
||||||
@not_a_basic_file:
|
|
||||||
ldax kipper_param_buffer
|
|
||||||
exit_cart_via_ax:
|
|
||||||
sta call_downloaded_prg+1
|
|
||||||
stx call_downloaded_prg+2
|
|
||||||
jmp call_downloaded_prg
|
|
||||||
|
|
||||||
get_tftp_directory_listing:
|
|
||||||
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
stax copy_src
|
|
||||||
ldax #last_dir_mask
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$80
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
|
|
||||||
ldax #getting_dir_listing_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_TFTP_DOWNLOAD
|
|
||||||
|
|
||||||
bcs @dir_failed
|
|
||||||
|
|
||||||
lda directory_buffer ;get the first byte that was downloaded
|
|
||||||
bne :+
|
|
||||||
jmp @no_files_on_server
|
|
||||||
:
|
|
||||||
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
ldy #1 ;filenames will be ASCII
|
|
||||||
jsr select_option_from_menu
|
|
||||||
bcc @tftp_filename_set
|
|
||||||
rts
|
|
||||||
@tftp_filename_set:
|
|
||||||
stax copy_dest
|
|
||||||
stax get_value_of_axy+1
|
|
||||||
ldy #0
|
|
||||||
jsr get_value_of_axy ;A now == first char in string we just downloaded
|
|
||||||
cmp #'$'
|
|
||||||
bne @not_directory_name
|
|
||||||
;it's a directory name, so we need to append the file mask to end of it
|
|
||||||
;this will fail if the file path is more than 255 characters long
|
|
||||||
@look_for_trailing_zero:
|
|
||||||
iny
|
|
||||||
inc copy_dest
|
|
||||||
bne :+
|
|
||||||
inc copy_dest+1
|
|
||||||
:
|
|
||||||
jsr get_value_of_axy ;A now == next char in string we just downloaded
|
|
||||||
bne @look_for_trailing_zero
|
|
||||||
|
|
||||||
; got trailing zero
|
|
||||||
ldax filemask_ptr
|
|
||||||
clc
|
|
||||||
adc #1 ;skip the leading '$'
|
|
||||||
bcc :+
|
|
||||||
inx
|
|
||||||
:
|
|
||||||
stax copy_src
|
|
||||||
ldax #$07
|
|
||||||
jsr copymem
|
|
||||||
ldax get_value_of_axy+1
|
|
||||||
jmp get_tftp_directory_listing
|
|
||||||
|
|
||||||
@not_directory_name:
|
|
||||||
ldax get_value_of_axy+1
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
@dir_failed:
|
|
||||||
ldax #dir_listing_fail_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
@no_files_on_server:
|
|
||||||
ldax #no_files
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
disk_boot:
|
|
||||||
.import io_read_catalogue
|
|
||||||
.import io_device_no
|
|
||||||
.import io_filename
|
|
||||||
.import io_read_file
|
|
||||||
.import io_load_address
|
|
||||||
|
|
||||||
lda cfg_default_drive
|
|
||||||
sec
|
|
||||||
sbc #7
|
|
||||||
sta io_device_no
|
|
||||||
ldax #directory_buffer
|
|
||||||
jsr io_read_catalogue
|
|
||||||
|
|
||||||
lda directory_buffer ;get the first byte that was downloaded
|
|
||||||
bne :+
|
|
||||||
jmp @no_files_on_disk
|
|
||||||
:
|
|
||||||
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
ldy #0 ;filenames will NOT be ASCII
|
|
||||||
jsr select_option_from_menu
|
|
||||||
bcc @disk_filename_set
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
@dir_failed:
|
|
||||||
ldax #dir_listing_fail_msg
|
|
||||||
@print_error:
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_cr
|
|
||||||
jmp @wait_keypress_then_return_to_main
|
|
||||||
|
|
||||||
@no_files_on_disk:
|
|
||||||
ldax #no_files
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@wait_keypress_then_return_to_main:
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
@disk_filename_set:
|
|
||||||
stax io_filename
|
|
||||||
ldax #loading_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax io_filename
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #$0000
|
|
||||||
jsr io_read_file
|
|
||||||
bcc @file_read_ok
|
|
||||||
ldax #file_read_error
|
|
||||||
jmp @print_error
|
|
||||||
@file_read_ok:
|
|
||||||
ldax #load_ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax io_load_address
|
|
||||||
jmp boot_into_file
|
|
||||||
|
|
||||||
error_handler:
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_cr
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
netplay_sid:
|
|
||||||
|
|
||||||
ldax #sid_filemask
|
|
||||||
stax filemask_ptr
|
|
||||||
@get_sid_dir:
|
|
||||||
|
|
||||||
jsr get_tftp_directory_listing
|
|
||||||
bcc @sid_filename_set
|
|
||||||
jmp error_handler
|
|
||||||
@sid_filename_set:
|
|
||||||
;AX now points to filename
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
ldax #$1000 ;load address
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
jsr download2
|
|
||||||
|
|
||||||
|
|
||||||
bcc :+
|
|
||||||
jmp error_handler
|
|
||||||
:
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
ldax kipper_param_buffer+KPR_TFTP_FILESIZE
|
|
||||||
stax sidfile_length
|
|
||||||
ldax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
jsr load_sid
|
|
||||||
jsr play_sid
|
|
||||||
|
|
||||||
jsr print_cr
|
|
||||||
;wait a little bit to allow the RUN/STOP key to be released
|
|
||||||
jsr timer_read
|
|
||||||
inx ;add 256 ms
|
|
||||||
inx ;add 256 ms
|
|
||||||
:
|
|
||||||
jsr timer_timeout
|
|
||||||
bcs :-
|
|
||||||
|
|
||||||
jsr ip65_process
|
|
||||||
lda #0
|
|
||||||
sta $cb
|
|
||||||
|
|
||||||
ldax #last_dir_mask
|
|
||||||
jsr @get_sid_dir
|
|
||||||
|
|
||||||
|
|
||||||
d64_download:
|
|
||||||
|
|
||||||
ldax #d64_filemask
|
|
||||||
stax filemask_ptr
|
|
||||||
jsr get_tftp_directory_listing
|
|
||||||
bcc @d64_filename_set
|
|
||||||
jmp main_menu
|
|
||||||
@d64_filename_set:
|
|
||||||
;AX now points to filename
|
|
||||||
jsr download_d64
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bad_boot:
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp $fe66 ;do a wam start
|
|
||||||
|
|
||||||
download: ;AX should point at filename to download
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
ldax #$0000 ;load address will be first 2 bytes of file we download (LO/HI order)
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
|
|
||||||
download2:
|
|
||||||
ldax #downloading_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_TFTP_DOWNLOAD
|
|
||||||
|
|
||||||
bcc :+
|
|
||||||
|
|
||||||
ldax #tftp_download_fail_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
:
|
|
||||||
ldax #tftp_download_ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
wait_for_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key:
|
|
||||||
@loop:
|
|
||||||
jsr KPR_PERIODIC_PROCESSING_VECTOR
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
cfg_get_configuration_ptr:
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_GET_IP_CONFIG
|
|
||||||
rts
|
|
||||||
|
|
||||||
exit_ping:
|
|
||||||
lda #$05 ;petscii for white text
|
|
||||||
jsr print_a
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
|
|
||||||
;init the Time-Of-Day clock - cribbed from http://codebase64.org/doku.php?id=base:initialize_tod_clock_on_all_platforms
|
|
||||||
init_tod:
|
|
||||||
sei
|
|
||||||
lda #0
|
|
||||||
sta $d011 ;Turn off display to disable badlines
|
|
||||||
sta $dc0e ;Set TOD Clock Frequency to 60Hz
|
|
||||||
sta $dc0f ;Enable Set-TOD-Clock
|
|
||||||
sta $dc0b ;Set TOD-Clock to 0 (hours)
|
|
||||||
sta $dc0a ;- (minutes)
|
|
||||||
sta $dc09 ;- (seconds)
|
|
||||||
sta $dc08 ;- (deciseconds)
|
|
||||||
|
|
||||||
lda $dc08 ;
|
|
||||||
@wait_raster:
|
|
||||||
cmp $dc08 ;Sync raster to TOD Clock Frequency
|
|
||||||
beq @wait_raster
|
|
||||||
|
|
||||||
ldx #0 ;Prep X and Y for 16 bit
|
|
||||||
ldy #0 ; counter operation
|
|
||||||
lda $dc08 ;Read deciseconds
|
|
||||||
@loop1:
|
|
||||||
inx ;2 -+
|
|
||||||
bne @loop2 ;2/3 | Do 16 bit count up on
|
|
||||||
iny ;2 | X(lo) and Y(hi) regs in a
|
|
||||||
jmp @loop3 ;3 | fixed cycle manner
|
|
||||||
@loop2:
|
|
||||||
nop ;2 |
|
|
||||||
nop ;2 -+
|
|
||||||
@loop3:
|
|
||||||
cmp $dc08 ;4 - Did 1 decisecond pass?
|
|
||||||
beq @loop1 ;3 - If not, loop-di-doop
|
|
||||||
;Each loop = 16 cycles
|
|
||||||
;If less than 118230 cycles passed, TOD is
|
|
||||||
;clocked at 60Hz. If 118230 or more cycles
|
|
||||||
;passed, TOD is clocked at 50Hz.
|
|
||||||
;It might be a good idea to account for a bit
|
|
||||||
;of slack and since every loop is 16 cycles,
|
|
||||||
;28*256 loops = 114688 cycles, which seems to be
|
|
||||||
;acceptable. That means we need to check for
|
|
||||||
;a Y value of 28.
|
|
||||||
|
|
||||||
cpy #28 ;Did 114688 cycles or less go by?
|
|
||||||
bcc @hertz_correct ;- Then we already have correct 60Hz $dc0e value
|
|
||||||
lda #$80 ;Otherwise, we need to set it to 50Hz
|
|
||||||
sta $dc0e
|
|
||||||
@hertz_correct:
|
|
||||||
lda #$1b ;Enable the display again
|
|
||||||
sta $d011
|
|
||||||
cli
|
|
||||||
rts
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
menu_header_msg:
|
|
||||||
.byte $13,10,"KipperKart V"
|
|
||||||
.include "../inc/version.i"
|
|
||||||
.byte 10,0
|
|
||||||
main_menu_msg:
|
|
||||||
.byte 10,"Main Menu",10,10
|
|
||||||
.byte "F1: TFTP Boot F2: Disk Boot",10
|
|
||||||
.byte "F3: Upload D64 F4: Download D64",10
|
|
||||||
.byte "F5: SID Netplay F6: Ping",10
|
|
||||||
.byte "F7: Config",10,10
|
|
||||||
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cant_boot_basic:
|
|
||||||
.byte "BASIC file execution not supported",10,0
|
|
||||||
|
|
||||||
ping_header: .byte "ping",10,0
|
|
||||||
|
|
||||||
file_read_error: .asciiz "Error reading file"
|
|
||||||
autoexec_filename: .byte "AUTOEXEC.PRG",0
|
|
||||||
|
|
||||||
downloading_msg: .byte "down"
|
|
||||||
loading_msg: .asciiz "loading "
|
|
||||||
|
|
||||||
uploading_msg: .byte "uploading ",0
|
|
||||||
|
|
||||||
getting_dir_listing_msg: .byte "fetching directory",10,0
|
|
||||||
|
|
||||||
dir_listing_fail_msg:
|
|
||||||
.byte "directory listing failed",10,0
|
|
||||||
|
|
||||||
tftp_download_fail_msg:
|
|
||||||
.byte "download failed", 10, 0
|
|
||||||
|
|
||||||
tftp_download_ok_msg:
|
|
||||||
.byte "down"
|
|
||||||
load_ok_msg:
|
|
||||||
.byte "load OK", 10, 0
|
|
||||||
|
|
||||||
current:
|
|
||||||
.byte "current ",0
|
|
||||||
|
|
||||||
new:
|
|
||||||
.byte"new ",0
|
|
||||||
|
|
||||||
tftp_dir_filemask:
|
|
||||||
.asciiz "$/*.prg"
|
|
||||||
|
|
||||||
d64_filemask:
|
|
||||||
.asciiz "$/*.d64"
|
|
||||||
|
|
||||||
sid_filemask:
|
|
||||||
.asciiz "$/*.sid"
|
|
||||||
|
|
||||||
no_files:
|
|
||||||
.byte "no files",10,0
|
|
||||||
|
|
||||||
resolving:
|
|
||||||
.byte "resolving ",0
|
|
||||||
|
|
||||||
remote_host: .byte "hostname (return to quit)",10,": ",0
|
|
||||||
|
|
||||||
.segment "APP_SCRATCH"
|
|
||||||
last_dir_mask: .res 128
|
|
||||||
|
|
||||||
;-- LICENSE FOR kipperkart.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is netboot65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,677 +0,0 @@
|
||||||
; #############
|
|
||||||
; KIPPER TERM - Telnet (only) client for C64
|
|
||||||
; jonno@jamtronix.com
|
|
||||||
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.include "../inc/c64keycodes.i"
|
|
||||||
.include "../inc/menu.i"
|
|
||||||
.include "../inc/config_menu.i"
|
|
||||||
|
|
||||||
KEY_NEXT_PAGE=KEYCODE_F7
|
|
||||||
KEY_PREV_PAGE=KEYCODE_F1
|
|
||||||
KEY_SHOW_HISTORY=KEYCODE_F2
|
|
||||||
KEY_BACK_IN_HISTORY=KEYCODE_F3
|
|
||||||
KEY_NEW_SERVER=KEYCODE_F5
|
|
||||||
|
|
||||||
|
|
||||||
XMODEM_IN_TELNET = 1
|
|
||||||
|
|
||||||
.import xmodem_iac_escape
|
|
||||||
|
|
||||||
.include "../inc/telnet.i"
|
|
||||||
|
|
||||||
.import cls
|
|
||||||
.import beep
|
|
||||||
.import exit_to_basic
|
|
||||||
.import ip65_process
|
|
||||||
.import ip65_init
|
|
||||||
.import get_filtered_input
|
|
||||||
.import filter_text
|
|
||||||
.import filter_dns
|
|
||||||
.import filter_ip
|
|
||||||
.import arp_calculate_gateway_mask
|
|
||||||
.import parse_dotted_quad
|
|
||||||
.import dotted_quad_value
|
|
||||||
.import parse_integer
|
|
||||||
|
|
||||||
.import tcp_send
|
|
||||||
.import tcp_send_data_len
|
|
||||||
|
|
||||||
.import io_read_catalogue
|
|
||||||
.import io_device_no
|
|
||||||
|
|
||||||
.import dns_ip
|
|
||||||
.import dns_resolve
|
|
||||||
.import dns_set_hostname
|
|
||||||
|
|
||||||
.import get_key_ip65
|
|
||||||
.import get_key
|
|
||||||
.import cfg_mac
|
|
||||||
.import dhcp_init
|
|
||||||
|
|
||||||
.import cfg_ip
|
|
||||||
.import cfg_netmask
|
|
||||||
.import cfg_gateway
|
|
||||||
.import cfg_dns
|
|
||||||
.import cfg_tftp_server
|
|
||||||
|
|
||||||
.import xmodem_receive
|
|
||||||
.import xmodem_send
|
|
||||||
|
|
||||||
.export telnet_menu
|
|
||||||
|
|
||||||
.import print_a
|
|
||||||
.import print_cr
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import get_filtered_input
|
|
||||||
.import __DATA_LOAD__
|
|
||||||
.import __DATA_RUN__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __SELF_MODIFIED_CODE_LOAD__
|
|
||||||
.import __SELF_MODIFIED_CODE_RUN__
|
|
||||||
.import __SELF_MODIFIED_CODE_SIZE__
|
|
||||||
|
|
||||||
.import cfg_tftp_server
|
|
||||||
directory_buffer = $6000
|
|
||||||
|
|
||||||
|
|
||||||
.segment "CARTRIDGE_HEADER"
|
|
||||||
.word cold_init ;cold start vector
|
|
||||||
.word warm_init ;warm start vector
|
|
||||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
|
||||||
.byte "KIPTRM"
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cold_init:
|
|
||||||
|
|
||||||
;first let the kernal do a normal startup
|
|
||||||
sei
|
|
||||||
jsr $fda3 ;initialize CIA I/O
|
|
||||||
jsr $fd50 ;RAM test, set pointers
|
|
||||||
jsr $fd15 ;set vectors for KERNAL
|
|
||||||
jsr $ff5B ;init. VIC
|
|
||||||
cli ;KERNAL init. finished
|
|
||||||
|
|
||||||
warm_init:
|
|
||||||
;set some funky colours
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta $dc08 ;set deciseconds - starts TOD going
|
|
||||||
|
|
||||||
jsr setup_screen
|
|
||||||
|
|
||||||
;relocate our r/w data
|
|
||||||
ldax #__DATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__DATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__DATA_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
;relocate the self-modifying code (if necessary)
|
|
||||||
ldax #__SELF_MODIFIED_CODE_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__SELF_MODIFIED_CODE_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__SELF_MODIFIED_CODE_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #init_msg+1
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
jsr ip65_init
|
|
||||||
bcs init_failed
|
|
||||||
jsr dhcp_init
|
|
||||||
bcc init_ok
|
|
||||||
jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to cartridge default values)
|
|
||||||
bcc init_ok
|
|
||||||
init_failed:
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
print_main_menu:
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #main_menu_msg
|
|
||||||
jmp print_ascii_as_native
|
|
||||||
|
|
||||||
init_ok:
|
|
||||||
|
|
||||||
main_menu:
|
|
||||||
jsr print_main_menu
|
|
||||||
jsr print_ip_config
|
|
||||||
jsr print_default_drive
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
@get_key:
|
|
||||||
jsr get_key_ip65
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne @not_f1
|
|
||||||
jsr cls
|
|
||||||
ldax #telnet_header
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jmp telnet_main_entry
|
|
||||||
|
|
||||||
@not_f1:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
beq @change_config
|
|
||||||
cmp #KEYCODE_F8
|
|
||||||
bne @not_f8
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #credits
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr get_key_ip65
|
|
||||||
jmp main_menu
|
|
||||||
@not_f8:
|
|
||||||
|
|
||||||
jmp @get_key
|
|
||||||
|
|
||||||
@change_config:
|
|
||||||
jsr configuration_menu
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
|
|
||||||
wait_for_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
cfg_get_configuration_ptr:
|
|
||||||
ldax #cfg_mac
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
setup_screen:
|
|
||||||
;make sure normal font
|
|
||||||
lda #$15
|
|
||||||
sta $d018
|
|
||||||
|
|
||||||
LDA #$07 ;yellow
|
|
||||||
|
|
||||||
STA $D020 ;border
|
|
||||||
LDA #$00 ;black
|
|
||||||
STA $D021 ;background
|
|
||||||
lda #$05 ;petscii for white text
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
lda #14
|
|
||||||
jmp print_a ;switch to lower case
|
|
||||||
|
|
||||||
save_screen_settings:
|
|
||||||
;save current settings
|
|
||||||
lda $d018
|
|
||||||
sta temp_font
|
|
||||||
lda $d020
|
|
||||||
sta temp_border
|
|
||||||
lda $d021
|
|
||||||
sta temp_text_back
|
|
||||||
lda $0286
|
|
||||||
sta temp_text_fore
|
|
||||||
|
|
||||||
ldx #$27
|
|
||||||
@save_page_zero_vars_loop:
|
|
||||||
lda $cf,x
|
|
||||||
sta temp_page_zero_vars,x
|
|
||||||
dex
|
|
||||||
bne @save_page_zero_vars_loop
|
|
||||||
|
|
||||||
ldax #$400
|
|
||||||
stax copy_src
|
|
||||||
ldax #temp_screen_chars
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #$d800
|
|
||||||
stax copy_src
|
|
||||||
ldax #temp_colour_ram
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jmp copymem
|
|
||||||
|
|
||||||
restore_screen_settings:
|
|
||||||
lda temp_font
|
|
||||||
sta $d018
|
|
||||||
|
|
||||||
|
|
||||||
lda temp_border
|
|
||||||
sta $d020
|
|
||||||
lda temp_text_back
|
|
||||||
sta $d021
|
|
||||||
lda temp_text_fore
|
|
||||||
sta $0286
|
|
||||||
|
|
||||||
ldx #$27
|
|
||||||
@restore_page_zero_vars_loop:
|
|
||||||
lda temp_page_zero_vars,x
|
|
||||||
sta $cf,x
|
|
||||||
dex
|
|
||||||
bne @restore_page_zero_vars_loop
|
|
||||||
|
|
||||||
ldax #temp_screen_chars
|
|
||||||
stax copy_src
|
|
||||||
ldax #$400
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #temp_colour_ram
|
|
||||||
stax copy_src
|
|
||||||
ldax #$d800
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jmp copymem
|
|
||||||
|
|
||||||
|
|
||||||
telnet_menu:
|
|
||||||
|
|
||||||
jsr save_screen_settings
|
|
||||||
jsr setup_screen
|
|
||||||
|
|
||||||
@show_menu:
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #telnet_menu_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
@get_menu_option:
|
|
||||||
jsr get_key
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne :+
|
|
||||||
jsr xmodem_download
|
|
||||||
jmp @exit
|
|
||||||
:
|
|
||||||
cmp #KEYCODE_F3
|
|
||||||
bne :+
|
|
||||||
jsr xmodem_upload
|
|
||||||
jmp @exit
|
|
||||||
:
|
|
||||||
cmp #KEYCODE_F5
|
|
||||||
bne :+
|
|
||||||
@get_ascii_value:
|
|
||||||
ldax #enter_ascii
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldy #3 ;max chars
|
|
||||||
ldax #filter_number
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @show_menu
|
|
||||||
;AX now points a string containing 0..999
|
|
||||||
.import parse_integer
|
|
||||||
jsr parse_integer
|
|
||||||
cpx #0
|
|
||||||
bne @get_ascii_value
|
|
||||||
sta ascii_packet
|
|
||||||
lda #1
|
|
||||||
stax tcp_send_data_len
|
|
||||||
jsr restore_screen_settings ;since we won't return from tcp_send
|
|
||||||
ldax #ascii_packet
|
|
||||||
jmp tcp_send
|
|
||||||
|
|
||||||
|
|
||||||
:
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
beq @exit
|
|
||||||
jmp @get_menu_option
|
|
||||||
@exit:
|
|
||||||
jsr restore_screen_settings
|
|
||||||
rts
|
|
||||||
|
|
||||||
xmodem_upload:
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta eof
|
|
||||||
lda cfg_default_drive
|
|
||||||
sec
|
|
||||||
sbc #7
|
|
||||||
sta io_device_no
|
|
||||||
ldax #directory_buffer
|
|
||||||
jsr io_read_catalogue
|
|
||||||
bcs @dir_failed
|
|
||||||
lda directory_buffer ;get the first byte that was downloaded
|
|
||||||
bne :+
|
|
||||||
jmp @no_files_on_disk
|
|
||||||
:
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
ldy #0 ;filenames will NOT be ASCII
|
|
||||||
jsr select_option_from_menu
|
|
||||||
bcc @disk_filename_set
|
|
||||||
rts
|
|
||||||
|
|
||||||
@dir_failed:
|
|
||||||
ldax #dir_listing_fail_msg
|
|
||||||
@print_error:
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_cr
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
@no_files_on_disk:
|
|
||||||
ldax #no_files
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@wait_keypress_then_return_to_main:
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
|
|
||||||
@disk_filename_set:
|
|
||||||
|
|
||||||
;open file needs XY=pointer to name, A = length of name
|
|
||||||
stax copy_src
|
|
||||||
ldy #$ff
|
|
||||||
@next_byte:
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
bne @next_byte
|
|
||||||
tya
|
|
||||||
ldx copy_src
|
|
||||||
ldy copy_src+1
|
|
||||||
|
|
||||||
jsr open_file
|
|
||||||
ldax #read_byte
|
|
||||||
jsr xmodem_send
|
|
||||||
bcc @no_error
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp :+
|
|
||||||
@no_error:
|
|
||||||
print_ok
|
|
||||||
:
|
|
||||||
jsr close_file
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
|
|
||||||
read_byte:
|
|
||||||
lda eof
|
|
||||||
beq @not_eof
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
@not_eof:
|
|
||||||
ldx #$02 ; filenumber 2 = output file
|
|
||||||
jsr $FFC6 ; call CHKIN (file 2 now used as input)
|
|
||||||
|
|
||||||
jsr $FFCF ; call CHRIN (get a byte from file)
|
|
||||||
pha
|
|
||||||
|
|
||||||
jsr $FFB7 ; call READST (read status byte)
|
|
||||||
|
|
||||||
beq :+ ; either EOF or read error
|
|
||||||
inc eof
|
|
||||||
:
|
|
||||||
ldx #$00 ; filenumber 0 = console
|
|
||||||
jsr $FFC6 ; call CHKIN (console now used as input)
|
|
||||||
|
|
||||||
pla
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
xmodem_download:
|
|
||||||
ldax #opening_file
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr open_dl_file
|
|
||||||
bcs @error
|
|
||||||
ldax #ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #write_byte
|
|
||||||
jsr xmodem_receive
|
|
||||||
bcs @error
|
|
||||||
jsr close_file
|
|
||||||
ldax #transfer_complete
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #prompt_for_filename
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@get_filename:
|
|
||||||
ldax #filter_dns
|
|
||||||
ldy #40
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @get_filename
|
|
||||||
jsr rename_file
|
|
||||||
|
|
||||||
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr close_file
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
open_dl_file:
|
|
||||||
lda #temp_filename_end-temp_filename_start
|
|
||||||
ldx #<temp_filename_start
|
|
||||||
ldy #>temp_filename_start
|
|
||||||
|
|
||||||
|
|
||||||
open_file:
|
|
||||||
;A,X,Y set up ready for a call to SETNAM for file #2
|
|
||||||
jsr $FFBD ; call SETNAM
|
|
||||||
lda #$02 ; file number 2
|
|
||||||
.import cfg_default_drive
|
|
||||||
ldx cfg_default_drive
|
|
||||||
|
|
||||||
ldy #$02 ; secondary address 2
|
|
||||||
jsr $FFBA ; call SETLFS
|
|
||||||
|
|
||||||
jsr $FFC0 ; call OPEN
|
|
||||||
bcs @error ; if carry set, the file could not be opened
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
sta ip65_error
|
|
||||||
jsr close_file
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
write_byte:
|
|
||||||
pha
|
|
||||||
ldx #$02 ; filenumber 2 = output file
|
|
||||||
jsr $FFC9 ; call CHKOUT
|
|
||||||
pla
|
|
||||||
jsr $ffd2 ;write byte
|
|
||||||
JSR $FFB7 ; call READST (read status byte)
|
|
||||||
bne @error
|
|
||||||
ldx #$00 ; filenumber 0 = console
|
|
||||||
jsr $FFC9 ; call CHKOUT
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
lda #KPR_ERROR_FILE_ACCESS_FAILURE
|
|
||||||
sta ip65_error
|
|
||||||
jsr close_file
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
close_file:
|
|
||||||
|
|
||||||
lda #$02 ; filenumber 2
|
|
||||||
jsr $FFC3 ; call CLOSE
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
rename_file:
|
|
||||||
;AX points at new filename
|
|
||||||
stax copy_src
|
|
||||||
ldx #0
|
|
||||||
ldy #0
|
|
||||||
;first the "RENAME0:"
|
|
||||||
|
|
||||||
:
|
|
||||||
lda rename_cmd,y
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
cmp #':'
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
;now the new filename
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda (copy_src),y
|
|
||||||
beq @end_of_new_filename
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
@end_of_new_filename:
|
|
||||||
|
|
||||||
;now the "="
|
|
||||||
lda #'='
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
|
|
||||||
;now the old filename
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda temp_filename,y
|
|
||||||
cmp #','
|
|
||||||
beq @end_of_old_filename
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
@end_of_old_filename:
|
|
||||||
txa ;filename length
|
|
||||||
ldx #<command_buffer
|
|
||||||
ldy #>command_buffer
|
|
||||||
|
|
||||||
jsr $FFBD ; call SETNAM
|
|
||||||
lda #$0F ; filenumber 15
|
|
||||||
ldx cfg_default_drive
|
|
||||||
ldy #$0F ; secondary address 15
|
|
||||||
jsr $FFBA ; call SETLFS
|
|
||||||
jsr $FFC0 ; call OPEN
|
|
||||||
lda #$0F ; filenumber 15
|
|
||||||
jsr $FFC3 ; call CLOSE
|
|
||||||
rts
|
|
||||||
|
|
||||||
rename_cmd:
|
|
||||||
.byte "RENAME0:"
|
|
||||||
|
|
||||||
exit_telnet:
|
|
||||||
exit_gopher:
|
|
||||||
jsr setup_screen
|
|
||||||
jmp main_menu
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
menu_header_msg:
|
|
||||||
.byte $13,10,"KipperTerm V"
|
|
||||||
.include "../inc/version.i"
|
|
||||||
.byte 10,0
|
|
||||||
main_menu_msg:
|
|
||||||
.byte 10,"Main Menu",10,10
|
|
||||||
.byte "F1: Telnet ",10
|
|
||||||
.byte "F7: Config F8: Credits",10,10
|
|
||||||
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
|
|
||||||
telnet_menu_msg:
|
|
||||||
.byte 10,10,10
|
|
||||||
.byte "F1: D/L File (XMODEM)",10
|
|
||||||
.byte "F3: U/L File (XMODEM)",10
|
|
||||||
.byte "F5: Send ASCII char",10
|
|
||||||
.byte "F7: Return",10,10
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
telnet_header: .byte "telnet",10,0
|
|
||||||
|
|
||||||
opening_file:
|
|
||||||
.byte 10,"opening file",10,0
|
|
||||||
transfer_complete:
|
|
||||||
.byte "transfer complete.",10,0
|
|
||||||
prompt_for_filename: .byte "save file as?",10,0
|
|
||||||
current:
|
|
||||||
.byte "current ",0
|
|
||||||
|
|
||||||
enter_ascii:
|
|
||||||
.byte 10,"ASCII value (0..255)? ",0
|
|
||||||
|
|
||||||
byte_sent:
|
|
||||||
.byte 10,"byte sent.",0
|
|
||||||
|
|
||||||
new:
|
|
||||||
.byte"new ",0
|
|
||||||
|
|
||||||
resolving:
|
|
||||||
.byte "resolving ",0
|
|
||||||
|
|
||||||
no_files:
|
|
||||||
.byte "no files",10,0
|
|
||||||
|
|
||||||
dir_listing_fail_msg:
|
|
||||||
.byte "directory listing failed",10,0
|
|
||||||
|
|
||||||
temp_filename_start: .byte "@"
|
|
||||||
temp_filename:
|
|
||||||
.byte "0:XMODEM.TMP,P,W" ; @0: means 'overwrite if existing', ',P,W' is required to make this an output file
|
|
||||||
temp_filename_end:
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
credits:
|
|
||||||
.byte 10,"License: Mozilla Public License v1.1",10
|
|
||||||
.byte 10
|
|
||||||
.byte 10,"Contributors:",10
|
|
||||||
.byte 10,"Jonno Downes"
|
|
||||||
.byte 10,"Glenn Holmer"
|
|
||||||
.byte 10,"Per Olofsson"
|
|
||||||
.byte 10,"Lars Stollenwerk"
|
|
||||||
.byte 10,10
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
.segment "APP_SCRATCH"
|
|
||||||
|
|
||||||
temp_font: .res 1
|
|
||||||
temp_border: .res 1
|
|
||||||
temp_text_back: .res 1
|
|
||||||
temp_text_fore: .res 1
|
|
||||||
temp_page_zero_vars: .res $28
|
|
||||||
temp_screen_chars: .res $400
|
|
||||||
temp_colour_ram: .res $400
|
|
||||||
command_buffer: .res $80
|
|
||||||
eof: .res 1
|
|
||||||
ascii_packet: .res 1
|
|
||||||
|
|
||||||
;-- LICENSE FOR kipperterm.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is KipperTerm.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,173 +0,0 @@
|
||||||
;use the NB65 API to send a d64 disk via TFTP
|
|
||||||
|
|
||||||
.ifndef NB65_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/nb65_constants.i"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
.include "../ip65/copymem.s"
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
.import print_a
|
|
||||||
.import get_key
|
|
||||||
.macro cout arg
|
|
||||||
lda arg
|
|
||||||
jsr print_a
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
temp_ptr: .res 2
|
|
||||||
|
|
||||||
.bss
|
|
||||||
nb65_param_buffer: .res $20
|
|
||||||
block_number: .res $0
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
.macro print arg
|
|
||||||
ldax arg
|
|
||||||
ldy #NB65_PRINT_ASCIIZ
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro print_cr
|
|
||||||
lda #13
|
|
||||||
jsr print_a
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro call arg
|
|
||||||
ldy arg
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
|
|
||||||
;look for NB65 signature at location pointed at by AX
|
|
||||||
look_for_signature:
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #3
|
|
||||||
@check_one_byte:
|
|
||||||
lda (temp_ptr),y
|
|
||||||
cmp nb65_signature,y
|
|
||||||
bne @bad_match
|
|
||||||
dey
|
|
||||||
bpl@check_one_byte
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@bad_match:
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
init:
|
|
||||||
|
|
||||||
print #signon_message
|
|
||||||
|
|
||||||
ldax #NB65_CART_SIGNATURE ;where signature should be in cartridge
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc @found_nb65_signature
|
|
||||||
|
|
||||||
ldax #NB65_RAM_STUB_SIGNATURE ;where signature should be in RAM
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc :+
|
|
||||||
jmp nb65_signature_not_found
|
|
||||||
:
|
|
||||||
jsr NB65_RAM_STUB_ACTIVATE ;we need to turn on NB65 cartridge
|
|
||||||
|
|
||||||
@found_nb65_signature:
|
|
||||||
|
|
||||||
print #initializing
|
|
||||||
print #nb65_signature
|
|
||||||
ldy #NB65_INITIALIZE
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
bcc :+
|
|
||||||
print #failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp bad_boot
|
|
||||||
:
|
|
||||||
print #ok
|
|
||||||
print_cr
|
|
||||||
|
|
||||||
; ########################
|
|
||||||
; main program goes here:
|
|
||||||
;
|
|
||||||
rts
|
|
||||||
|
|
||||||
bad_boot:
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
restart:
|
|
||||||
jsr get_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
|
|
||||||
print_errorcode:
|
|
||||||
print #error_code
|
|
||||||
call #NB65_GET_LAST_ERROR
|
|
||||||
call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
nb65_signature_not_found:
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda nb65_signature_not_found_message,y
|
|
||||||
beq restart
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
jmp :-
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
error_code:
|
|
||||||
.asciiz "ERROR CODE: $"
|
|
||||||
press_a_key_to_continue:
|
|
||||||
.byte "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
|
|
||||||
failed:
|
|
||||||
.byte "FAILED ", 0
|
|
||||||
|
|
||||||
ok:
|
|
||||||
.byte "OK ", 0
|
|
||||||
|
|
||||||
initializing:
|
|
||||||
.byte "INITIALIZING ",0
|
|
||||||
|
|
||||||
signon_message:
|
|
||||||
.byte "NB65 UNNAMED TOOL V0.1",13,0
|
|
||||||
|
|
||||||
nb65_signature_not_found_message:
|
|
||||||
.byte "NO NB65 API FOUND",13,"PRESS ANY KEY TO RESET", 0
|
|
||||||
|
|
||||||
nb65_signature:
|
|
||||||
.byte $4E,$42,$36,$35 ; "NB65" - API signature
|
|
||||||
.byte ' ',0 ; so we can use this as a string
|
|
||||||
;-- LICENSE FOR nb65_skeleton.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is netboot65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,392 +0,0 @@
|
||||||
; #############
|
|
||||||
;
|
|
||||||
; This will boot a C64 with an RR-NET compatible cs8900a from the network
|
|
||||||
; requires
|
|
||||||
; 1) a DHCP server, and
|
|
||||||
; 2) a TFTP server that responds to requests on the broadcast address (255.255.255.255) and that will serve a file called 'BOOTC64.PRG'.
|
|
||||||
;
|
|
||||||
; jonno@jamtronix.com - January 2009
|
|
||||||
;
|
|
||||||
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.include "../inc/c64keycodes.i"
|
|
||||||
.include "../inc/menu.i"
|
|
||||||
|
|
||||||
.import ip65_init
|
|
||||||
.import dhcp_init
|
|
||||||
.import tftp_ip
|
|
||||||
.importzp tftp_filename
|
|
||||||
.import tftp_load_address
|
|
||||||
.import tftp_download
|
|
||||||
|
|
||||||
.import cls
|
|
||||||
.import beep
|
|
||||||
.import exit_to_basic
|
|
||||||
.import timer_vbl_handler
|
|
||||||
.import get_key_ip65
|
|
||||||
.import cfg_ip
|
|
||||||
.import cfg_netmask
|
|
||||||
.import cfg_gateway
|
|
||||||
.import cfg_dns
|
|
||||||
.import cfg_tftp_server
|
|
||||||
.import cfg_get_configuration_ptr
|
|
||||||
|
|
||||||
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import get_filtered_input
|
|
||||||
.import __DATA_LOAD__
|
|
||||||
.import __DATA_RUN__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __SELF_MODIFIED_CODE_LOAD__
|
|
||||||
.import __SELF_MODIFIED_CODE_RUN__
|
|
||||||
.import __SELF_MODIFIED_CODE_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
directory_buffer = $6020
|
|
||||||
.bss
|
|
||||||
tmp_load_address: .res 2
|
|
||||||
|
|
||||||
.data
|
|
||||||
exit_cart:
|
|
||||||
|
|
||||||
lda #$02
|
|
||||||
sta $de00 ;turns off RR cartridge by modifying GROUND and EXROM
|
|
||||||
call_downloaded_prg:
|
|
||||||
jsr $0000 ;overwritten when we load a file
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
get_value_of_axy: ;some more self-modifying code
|
|
||||||
lda $ffff,y
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
.segment "CARTRIDGE_HEADER"
|
|
||||||
.word init ;cold start vector
|
|
||||||
.word $FE47 ;warm start vector
|
|
||||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
|
|
||||||
;first let the kernal do a normal startup
|
|
||||||
sei
|
|
||||||
jsr $fda3 ;initialize CIA I/O
|
|
||||||
jsr $fd50 ;RAM test, set pointers
|
|
||||||
jsr $fd15 ;set vectors for KERNAL
|
|
||||||
jsr $ff5B ;init. VIC
|
|
||||||
cli ;KERNAL init. finished
|
|
||||||
|
|
||||||
|
|
||||||
;we need to set up BASIC as well
|
|
||||||
jsr $e453 ;set BASIC vectors
|
|
||||||
jsr $e3bf ;initialize zero page
|
|
||||||
|
|
||||||
|
|
||||||
;set some funky colours
|
|
||||||
LDA #$05 ;green
|
|
||||||
STA $D020 ;border
|
|
||||||
LDA #$00 ;black
|
|
||||||
STA $D021 ;background
|
|
||||||
|
|
||||||
lda #$05 ;petscii for white text
|
|
||||||
|
|
||||||
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
|
|
||||||
;relocate our r/w data
|
|
||||||
ldax #__DATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__DATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__DATA_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
ldax #__SELF_MODIFIED_CODE_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__SELF_MODIFIED_CODE_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__SELF_MODIFIED_CODE_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
ldax #netboot_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
print_driver_init
|
|
||||||
|
|
||||||
|
|
||||||
jsr ip65_init
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bcs @init_failed
|
|
||||||
jsr dhcp_init
|
|
||||||
bcc init_ok
|
|
||||||
jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to cartridge default values)
|
|
||||||
bcc init_ok
|
|
||||||
@init_failed:
|
|
||||||
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
|
|
||||||
init_ok:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldx #$03
|
|
||||||
:
|
|
||||||
lda cfg_tftp_server,x
|
|
||||||
sta tftp_ip,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
jsr print_cr
|
|
||||||
jsr print_ip_config
|
|
||||||
tftp_boot:
|
|
||||||
|
|
||||||
ldax #tftp_dir_filemask
|
|
||||||
jsr get_tftp_directory_listing
|
|
||||||
bcs return_to_main
|
|
||||||
|
|
||||||
@boot_filename_set:
|
|
||||||
;AX now points to filename
|
|
||||||
jsr download
|
|
||||||
bcc file_downloaded_ok
|
|
||||||
tftp_boot_failed:
|
|
||||||
jsr wait_for_keypress
|
|
||||||
return_to_main:
|
|
||||||
jmp tftp_boot
|
|
||||||
|
|
||||||
file_downloaded_ok:
|
|
||||||
ldax tftp_load_address
|
|
||||||
|
|
||||||
boot_into_file:
|
|
||||||
stax tmp_load_address ;use the param buffer as a temp holding place for the load address
|
|
||||||
;get ready to bank out
|
|
||||||
|
|
||||||
jsr $ffe7 ; make sure all files have been closed.
|
|
||||||
|
|
||||||
;check whether the file we just downloaded was a BASIC prg
|
|
||||||
lda tmp_load_address
|
|
||||||
cmp #01
|
|
||||||
bne @not_a_basic_file
|
|
||||||
|
|
||||||
lda tmp_load_address+1
|
|
||||||
cmp #$08
|
|
||||||
bne @not_a_basic_file
|
|
||||||
|
|
||||||
|
|
||||||
jsr $e453 ;set BASIC vectors
|
|
||||||
jsr $e3bf ;initialize BASIC
|
|
||||||
jsr $a86e
|
|
||||||
jsr $a533 ; re-bind BASIC lines
|
|
||||||
ldx $22 ;load end-of-BASIC pointer (lo byte)
|
|
||||||
ldy $23 ;load end-of-BASIC pointer (hi byte)
|
|
||||||
stx $2d ;save end-of-BASIC pointer (lo byte)
|
|
||||||
sty $2e ;save end-of-BASIC pointer (hi byte)
|
|
||||||
jsr $a659 ; CLR (reset variables)
|
|
||||||
ldax #$a7ae ; jump to BASIC interpreter loop
|
|
||||||
jmp exit_cart_via_ax
|
|
||||||
|
|
||||||
@not_a_basic_file:
|
|
||||||
ldax tmp_load_address
|
|
||||||
exit_cart_via_ax:
|
|
||||||
sta call_downloaded_prg+1
|
|
||||||
stx call_downloaded_prg+2
|
|
||||||
jmp exit_cart
|
|
||||||
|
|
||||||
get_tftp_directory_listing:
|
|
||||||
stax tftp_filename
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
stax tftp_load_address
|
|
||||||
|
|
||||||
ldax #getting_dir_listing_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
jsr tftp_download
|
|
||||||
|
|
||||||
bcs @dir_failed
|
|
||||||
|
|
||||||
lda directory_buffer ;get the first byte that was downloaded
|
|
||||||
bne :+
|
|
||||||
jmp @no_files_on_server
|
|
||||||
:
|
|
||||||
|
|
||||||
;switch to lower case charset
|
|
||||||
lda #23
|
|
||||||
sta $d018
|
|
||||||
|
|
||||||
@loop_till_filename_entered:
|
|
||||||
ldax #directory_buffer
|
|
||||||
ldy #1 ;filenames will be ASCII
|
|
||||||
jsr select_option_from_menu
|
|
||||||
bcs @loop_till_filename_entered
|
|
||||||
@tftp_filename_set:
|
|
||||||
stax copy_dest
|
|
||||||
stax get_value_of_axy+1
|
|
||||||
ldy #0
|
|
||||||
jsr get_value_of_axy ;A now == first char in string we just downloaded
|
|
||||||
cmp #'$'
|
|
||||||
bne @not_directory_name
|
|
||||||
;it's a directory name, so we need to append the file mask to end of it
|
|
||||||
;this will fail if the file path is more than 255 characters long
|
|
||||||
@look_for_trailing_zero:
|
|
||||||
iny
|
|
||||||
inc copy_dest
|
|
||||||
bne :+
|
|
||||||
inc copy_dest+1
|
|
||||||
:
|
|
||||||
jsr get_value_of_axy ;A now == next char in string we just downloaded
|
|
||||||
bne @look_for_trailing_zero
|
|
||||||
|
|
||||||
; got trailing zero
|
|
||||||
ldax #tftp_dir_filemask+1 ;skip the leading '$'
|
|
||||||
stax copy_src
|
|
||||||
ldax #$07
|
|
||||||
jsr copymem
|
|
||||||
ldax get_value_of_axy+1
|
|
||||||
jmp get_tftp_directory_listing
|
|
||||||
|
|
||||||
@not_directory_name:
|
|
||||||
ldax get_value_of_axy+1
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
@dir_failed:
|
|
||||||
ldax #dir_listing_fail_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #tftp_file
|
|
||||||
jmp @tftp_filename_set
|
|
||||||
|
|
||||||
@no_files_on_server:
|
|
||||||
ldax #no_files
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
jmp tftp_boot_failed
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bad_boot:
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp $fe66 ;do a wam start
|
|
||||||
|
|
||||||
download: ;AX should point at filename to download
|
|
||||||
stax tftp_filename
|
|
||||||
|
|
||||||
ldax #$0000 ;load address will be first 2 bytes of file we download (LO/HI order)
|
|
||||||
stax tftp_load_address
|
|
||||||
|
|
||||||
ldax #downloading_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax tftp_filename
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
jsr tftp_download
|
|
||||||
|
|
||||||
bcc :+
|
|
||||||
|
|
||||||
ldax #tftp_download_fail_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
:
|
|
||||||
ldax #tftp_download_ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
wait_for_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key:
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
netboot_msg:
|
|
||||||
.byte 14,10,"NETBOOT - V"
|
|
||||||
.include "../inc/version.i"
|
|
||||||
.byte 10,0
|
|
||||||
downloading_msg: .byte "down"
|
|
||||||
loading_msg: .asciiz "loading "
|
|
||||||
|
|
||||||
getting_dir_listing_msg: .byte "fetching directory",10,0
|
|
||||||
|
|
||||||
dir_listing_fail_msg:
|
|
||||||
.byte "dir failed",10,0
|
|
||||||
|
|
||||||
tftp_download_fail_msg:
|
|
||||||
.byte "download failed", 10, 0
|
|
||||||
|
|
||||||
tftp_download_ok_msg:
|
|
||||||
.byte "down"
|
|
||||||
load_ok_msg:
|
|
||||||
.byte "load OK", 10, 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tftp_dir_filemask:
|
|
||||||
.asciiz "$/*.prg"
|
|
||||||
|
|
||||||
tftp_file:
|
|
||||||
.asciiz "BOOTC64.PRG"
|
|
||||||
|
|
||||||
no_files:
|
|
||||||
.byte "No files",10,0
|
|
||||||
|
|
||||||
|
|
||||||
;we need a 'dummy' segment here - some drivers use this segment (e.g. wiznet), some don't (e.g. rr-net)
|
|
||||||
;if we don't declare this, we get an 'undefined segment' error when linking to a driver that doesn't use it.
|
|
||||||
.segment "SELF_MODIFIED_CODE"
|
|
||||||
|
|
||||||
;-- LICENSE FOR netboot.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is netboot65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,128 +0,0 @@
|
||||||
#cartridge offsets:
|
|
||||||
# $18=MAC address (6 bytes)
|
|
||||||
# $1E=IP address (4 bytes)
|
|
||||||
# $22=netmask (4 bytes)
|
|
||||||
# $26=gateway (4 bytes)
|
|
||||||
# $2A=DNS (4 bytes)
|
|
||||||
# $2E= DHCP server (4 bytes) (not changeable)
|
|
||||||
# $32=TFTP server (4 bytes)
|
|
||||||
# $36=drive (1 byte)
|
|
||||||
|
|
||||||
@cartridge_offsets={
|
|
||||||
#symobol => offset, length
|
|
||||||
:mac=>[0x18,6],
|
|
||||||
:ip=>[0x1e,4],
|
|
||||||
:netmask=>[0x22,4],
|
|
||||||
:gateway=>[0x26,4],
|
|
||||||
:dns=>[0x2a,4],
|
|
||||||
:tftp=>[0x32,4],
|
|
||||||
:drive=>[0x36,1]
|
|
||||||
}
|
|
||||||
|
|
||||||
@progname=File.basename($0)
|
|
||||||
def show_options
|
|
||||||
puts "valid options are: #{@cartridge_offsets.keys.join(", ")}"
|
|
||||||
puts "mac auto will automagically generate a pseudorandom MAC"
|
|
||||||
end
|
|
||||||
def usage
|
|
||||||
puts "#{@progname} <image> <option> <value> [<option> <value> ..]"
|
|
||||||
puts "multiple options may be set"
|
|
||||||
show_options
|
|
||||||
true
|
|
||||||
end
|
|
||||||
|
|
||||||
number_of_options=ARGV.length
|
|
||||||
usage && exit unless number_of_options>=3
|
|
||||||
usage && exit unless (number_of_options%2) ==1 #must be an odd number of options
|
|
||||||
filename=ARGV[0]
|
|
||||||
if !(FileTest.file?(filename)) then
|
|
||||||
puts "file '#{filename}' not found"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
filebytes=File.open(filename,"rb").read
|
|
||||||
|
|
||||||
start_of_kipper_cart_image=filebytes.index("80KIP")
|
|
||||||
if start_of_kipper_cart_image.nil? then
|
|
||||||
puts "file '#{filename}' does not appear to be a kipper cartridge image"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
(number_of_options/2).times do |i|
|
|
||||||
option=ARGV[i*2+1]
|
|
||||||
value=ARGV[i*2+2]
|
|
||||||
# puts "#{option} : #{value}"
|
|
||||||
offsets=@cartridge_offsets[option.to_sym]
|
|
||||||
if offsets.nil? then
|
|
||||||
puts "invalid option #{option}"
|
|
||||||
show_options
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
option_offset=start_of_kipper_cart_image+offsets[0]-7
|
|
||||||
option_length=offsets[1]
|
|
||||||
|
|
||||||
if option_length==6 then
|
|
||||||
if value.downcase=="auto" then
|
|
||||||
require 'digest/md5'
|
|
||||||
digest = Digest::MD5.digest(Time.now.to_s).bytes.to_a
|
|
||||||
mac=[0x00,0x80,0x10,digest[0],digest[1],Kernel.rand(255)]
|
|
||||||
else
|
|
||||||
|
|
||||||
split_values=value.split(":")
|
|
||||||
if (split_values.length!=6) || (split_values[5].nil?) then
|
|
||||||
puts "'#{value}' is not a valid MAC address. (e.g. 12:34:56:78:ab:cd)"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
mac=[]
|
|
||||||
6.times do |j|
|
|
||||||
mac[j]=split_values[j].hex
|
|
||||||
# puts "#{split_values[j]}->#{"%02X" % mac[j]}"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
packed_option=mac.pack("cccccc")
|
|
||||||
elsif option_length==1 then #it must be drive letter
|
|
||||||
packed_option=[value.to_i].pack("c")
|
|
||||||
else #it must be an IP
|
|
||||||
split_values=value.split(".")
|
|
||||||
if (split_values.length!=4) || (split_values[3].nil?) then
|
|
||||||
puts "'#{value}' is not a valid IP format. (e.g. 192.168.1.64)"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
ip=[]
|
|
||||||
4.times do |j|
|
|
||||||
ip[j]=split_values[j].to_i
|
|
||||||
# puts "#{split_values[j]}->#{ip[j]}"
|
|
||||||
if (ip[j]<0) || (ip[j]>255) then
|
|
||||||
puts "'#{value}' is not a valid IP format. (e.g. 192.168.1.64)"
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
packed_option=ip.pack("cccc")
|
|
||||||
end
|
|
||||||
filebytes[option_offset,option_length]=packed_option
|
|
||||||
end
|
|
||||||
|
|
||||||
filehandle=File.open(filename,"wb")
|
|
||||||
filehandle<<filebytes
|
|
||||||
filehandle.close
|
|
||||||
#-- LICENSE FOR set_ip_config.rb --
|
|
||||||
# The contents of this file are subject to the Mozilla Public License
|
|
||||||
# Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
# compliance with the License. You may obtain a copy of the License at
|
|
||||||
# http://www.mozilla.org/MPL/
|
|
||||||
#
|
|
||||||
# Software distributed under the License is distributed on an "AS IS"
|
|
||||||
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing rights and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
# The Original Code is netboot65.
|
|
||||||
#
|
|
||||||
# The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
# jonno@jamtronix.com.
|
|
||||||
# Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
# Jonno Downes. All Rights Reserved.
|
|
||||||
# -- LICENSE END --
|
|
|
@ -1,366 +0,0 @@
|
||||||
; #############
|
|
||||||
;
|
|
||||||
; jonno@jamtronix.com - June 2011
|
|
||||||
; Telnet server cartridge
|
|
||||||
;
|
|
||||||
|
|
||||||
TELNET_PORT=6400
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
|
|
||||||
.import ip65_init
|
|
||||||
.import dhcp_init
|
|
||||||
.import w5100_set_ip_config
|
|
||||||
.import cls
|
|
||||||
.import beep
|
|
||||||
.import exit_to_basic
|
|
||||||
.import timer_vbl_handler
|
|
||||||
.import get_key_ip65
|
|
||||||
.import cfg_mac
|
|
||||||
.import cfg_size
|
|
||||||
.import cfg_ip
|
|
||||||
.import cfg_netmask
|
|
||||||
.import cfg_gateway
|
|
||||||
.import cfg_dns
|
|
||||||
.import cfg_tftp_server
|
|
||||||
.import cfg_get_configuration_ptr
|
|
||||||
.import ip65_process
|
|
||||||
.import copymem
|
|
||||||
.import tcp_listen
|
|
||||||
.import tcp_callback
|
|
||||||
.import tcp_send
|
|
||||||
.import tcp_send_data_len
|
|
||||||
.import tcp_inbound_data_length
|
|
||||||
.import tcp_inbound_data_ptr
|
|
||||||
.import tcp_state
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
buffer_ptr=copy_dest
|
|
||||||
.import __DATA_LOAD__
|
|
||||||
.import __DATA_RUN__
|
|
||||||
.import __DATA_SIZE__
|
|
||||||
.import __SELF_MODIFIED_CODE_LOAD__
|
|
||||||
.import __SELF_MODIFIED_CODE_RUN__
|
|
||||||
.import __SELF_MODIFIED_CODE_SIZE__
|
|
||||||
|
|
||||||
|
|
||||||
CINV=$314 ;vector to IRQ interrupt routine
|
|
||||||
ISTOP=$328;vector to kernal routine to check if STOP key pressed
|
|
||||||
KEYD=$277 ;input keyboard buffer
|
|
||||||
NDX=$C6 ;number of keypresses in buffer
|
|
||||||
XMAX=$289 ;max keypresses in buffer
|
|
||||||
STKEY=$91 ;last key pressed
|
|
||||||
|
|
||||||
INIT_MAGIC_VALUE=$C7
|
|
||||||
.segment "CARTRIDGE_HEADER"
|
|
||||||
.word cold_init ;cold start vector
|
|
||||||
.word warm_init ;warm start vector
|
|
||||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cold_init:
|
|
||||||
|
|
||||||
;first let the kernal do a normal startup
|
|
||||||
sei
|
|
||||||
jsr $fda3 ;initialize CIA I/O
|
|
||||||
jsr $fd50 ;RAM test, set pointers
|
|
||||||
jsr $fd15 ;set vectors for KERNAL
|
|
||||||
jsr $ff5B ;init. VIC
|
|
||||||
cli ;KERNAL init. finished
|
|
||||||
|
|
||||||
warm_init:
|
|
||||||
lda #INIT_MAGIC_VALUE
|
|
||||||
cmp init_flag
|
|
||||||
bne @real_init
|
|
||||||
jmp $fe5e ; contine on to real RESTORE routine
|
|
||||||
@real_init:
|
|
||||||
sta init_flag
|
|
||||||
|
|
||||||
|
|
||||||
;we need to set up BASIC as well
|
|
||||||
jsr $e453 ;set BASIC vectors
|
|
||||||
jsr $e3bf ;initialize zero page
|
|
||||||
|
|
||||||
;relocate our r/w data
|
|
||||||
ldax #__DATA_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__DATA_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__DATA_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
ldax #__SELF_MODIFIED_CODE_LOAD__
|
|
||||||
stax copy_src
|
|
||||||
ldax #__SELF_MODIFIED_CODE_RUN__
|
|
||||||
stax copy_dest
|
|
||||||
ldax #__SELF_MODIFIED_CODE_SIZE__
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
;set normal BASIC colour
|
|
||||||
LDA #$0e ;light blue
|
|
||||||
STA $D020 ;border
|
|
||||||
LDA #$06 ;dark blue
|
|
||||||
STA $D021 ;background
|
|
||||||
lda #$9a
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
;copy KERNAL to RAM so we can patch it
|
|
||||||
|
|
||||||
|
|
||||||
ldax #startup_msg
|
|
||||||
jsr print
|
|
||||||
jsr ip65_init
|
|
||||||
|
|
||||||
bcs init_failed
|
|
||||||
jsr dhcp_init
|
|
||||||
bcc init_ok
|
|
||||||
init_failed:
|
|
||||||
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_ip_config
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
flash_forever:
|
|
||||||
inc $d020
|
|
||||||
jmp flash_forever
|
|
||||||
init_ok:
|
|
||||||
|
|
||||||
;install our new IRQ handler
|
|
||||||
sei
|
|
||||||
ldax CINV
|
|
||||||
stax old_tick_handler
|
|
||||||
ldax #tick_handler
|
|
||||||
stax CINV
|
|
||||||
|
|
||||||
;install our new STOP handler
|
|
||||||
|
|
||||||
ldax ISTOP
|
|
||||||
stax old_stop_handler
|
|
||||||
ldax #stop_handler
|
|
||||||
stax ISTOP
|
|
||||||
|
|
||||||
cli
|
|
||||||
|
|
||||||
start_listening:
|
|
||||||
|
|
||||||
ldax #telnet_callback
|
|
||||||
stax tcp_callback
|
|
||||||
ldax #listening
|
|
||||||
jsr print
|
|
||||||
ldax #cfg_ip
|
|
||||||
jsr print_dotted_quad
|
|
||||||
ldax #port
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
;we need to copy BASIC as well since swapping KERNAL forces swap of BASIC
|
|
||||||
ldax #$8000
|
|
||||||
stax copy_src
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$4000
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #$E000
|
|
||||||
stax copy_src
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$2000
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
;now intercept calls to $E716
|
|
||||||
;we do this instead of using the $326 vector because the BASIC
|
|
||||||
;'READY' loop calls $E716 directly rather than calling $FFD2
|
|
||||||
|
|
||||||
lda #$4C ;JMP
|
|
||||||
sta $e716
|
|
||||||
ldax #new_charout
|
|
||||||
stax $e717
|
|
||||||
|
|
||||||
|
|
||||||
;swap out BASIC & KERNAL
|
|
||||||
lda #$35
|
|
||||||
sta $01
|
|
||||||
|
|
||||||
|
|
||||||
ldax #TELNET_PORT
|
|
||||||
jsr tcp_listen
|
|
||||||
ldax #term_setup_string_length
|
|
||||||
sta tcp_send_data_len
|
|
||||||
ldax #term_setup_string
|
|
||||||
jsr tcp_send
|
|
||||||
|
|
||||||
|
|
||||||
jmp $E397
|
|
||||||
|
|
||||||
wait_for_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key:
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
tick_handler: ;called at least 60hz via $314
|
|
||||||
lda sending_flag
|
|
||||||
bne @done
|
|
||||||
inc jiffy_count
|
|
||||||
lda jiffy_count
|
|
||||||
cmp #$06 ;about 100ms
|
|
||||||
bne @done
|
|
||||||
lda #0
|
|
||||||
sta jiffy_count
|
|
||||||
lda tcp_state
|
|
||||||
beq @done
|
|
||||||
jsr ip65_process
|
|
||||||
@done:
|
|
||||||
jmp (old_tick_handler)
|
|
||||||
|
|
||||||
|
|
||||||
telnet_callback:
|
|
||||||
lda tcp_inbound_data_length+1
|
|
||||||
cmp #$ff
|
|
||||||
bne @not_eof
|
|
||||||
ldax #connection_closed
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
jmp start_listening
|
|
||||||
|
|
||||||
@not_eof:
|
|
||||||
ldax tcp_inbound_data_ptr
|
|
||||||
stax buffer_ptr
|
|
||||||
ldy #0
|
|
||||||
|
|
||||||
@next_byte:
|
|
||||||
ldx NDX
|
|
||||||
cpx XMAX
|
|
||||||
beq @done
|
|
||||||
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
cmp #$03 ;is ^C?
|
|
||||||
bne @not_ctrl_c
|
|
||||||
inc break_flag
|
|
||||||
jmp @key_done
|
|
||||||
@not_ctrl_c:
|
|
||||||
inc NDX
|
|
||||||
sta KEYD,x
|
|
||||||
@key_done:
|
|
||||||
iny
|
|
||||||
cpy tcp_inbound_data_length
|
|
||||||
bne @next_byte
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
|
|
||||||
new_charout:
|
|
||||||
pha ;original $e716 code we patched over
|
|
||||||
sta $d7 ;original $e716 code we patched over
|
|
||||||
stx temp_x
|
|
||||||
sty temp_y
|
|
||||||
sta output_buffer
|
|
||||||
pha
|
|
||||||
ldax #1
|
|
||||||
sta tcp_send_data_len
|
|
||||||
sta sending_flag
|
|
||||||
ldax #output_buffer
|
|
||||||
jsr tcp_send
|
|
||||||
dec sending_flag
|
|
||||||
pla
|
|
||||||
ldx temp_x
|
|
||||||
ldy temp_y
|
|
||||||
jmp $e719 ;after the code we patched
|
|
||||||
|
|
||||||
stop_handler:
|
|
||||||
|
|
||||||
lda break_flag
|
|
||||||
beq @no_stop
|
|
||||||
|
|
||||||
lda #$7F
|
|
||||||
sta $91
|
|
||||||
lda #0
|
|
||||||
sta break_flag
|
|
||||||
@no_stop:
|
|
||||||
jmp (old_stop_handler)
|
|
||||||
|
|
||||||
.bss
|
|
||||||
init_flag: .res 1
|
|
||||||
old_tick_handler: .res 2
|
|
||||||
old_stop_handler: .res 2
|
|
||||||
temp_x : .res 1
|
|
||||||
temp_y : .res 1
|
|
||||||
output_buffer: .res 64
|
|
||||||
|
|
||||||
.data
|
|
||||||
jiffy_count: .byte 0
|
|
||||||
break_flag: .byte 0
|
|
||||||
sending_flag: .byte 0
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
startup_msg:
|
|
||||||
.byte 147 ;cls
|
|
||||||
;.byte 14 ;lower case
|
|
||||||
.byte 142 ;upper case
|
|
||||||
.byte 13,"TELNETD "
|
|
||||||
.include "../inc/version.i"
|
|
||||||
.include "timestamp.i"
|
|
||||||
.byte 13
|
|
||||||
.byte 0
|
|
||||||
listening:
|
|
||||||
.byte 13,"LISTENING ON "
|
|
||||||
.byte 0
|
|
||||||
port:
|
|
||||||
.byte ":"
|
|
||||||
.if (TELNET_PORT > 999 )
|
|
||||||
.byte <(((TELNET_PORT / 1000) .mod 10) + $30)
|
|
||||||
.endif
|
|
||||||
.if TELNET_PORT>99
|
|
||||||
.byte <(((TELNET_PORT / 100 ) .mod 10) + $30)
|
|
||||||
.endif
|
|
||||||
.byte <(((TELNET_PORT / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((TELNET_PORT ) .mod 10) + $30)
|
|
||||||
.byte 13
|
|
||||||
.byte "HIT RUN/STOP TO ABORT"
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
connection_closed:
|
|
||||||
.byte 13,"CONNECTION CLOSED",13,0
|
|
||||||
|
|
||||||
term_setup_string:
|
|
||||||
|
|
||||||
.byte 142 ;upper case
|
|
||||||
.byte 147 ;cls
|
|
||||||
term_setup_string_length=*-term_setup_string
|
|
||||||
|
|
||||||
;we need a 'dummy' segment here - some drivers use this segment (e.g. wiznet), some don't (e.g. rr-net)
|
|
||||||
;if we don't declare this, we get an 'undefined segment' error when linking to a driver that doesn't use it.
|
|
||||||
.segment "SELF_MODIFIED_CODE"
|
|
||||||
|
|
||||||
;-- LICENSE FOR wizboot.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is wizboot.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2011
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1 +0,0 @@
|
||||||
puts Time.now.strftime(".byte \" (%Y-%m-%d)\"")
|
|
|
@ -1,23 +0,0 @@
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
ZP: start = $00, size = $08, type = rw, define = yes;
|
|
||||||
IP65ZP: start = $0f, size = $10, type = rw, define = yes;
|
|
||||||
HEADER: start = $0000, size = $4, file = %O;
|
|
||||||
RAM: start = $800, size = $8000, file = %O;
|
|
||||||
LANGUAGE_CARD: start= $D000, size=$2800, type=rw, define=yes;
|
|
||||||
PAGE3: start = $301, size = 20;
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
EXEHDR: load = HEADER, type = ro;
|
|
||||||
STARTUP: load = RAM,run=RAM, type = ro, define = yes;
|
|
||||||
CODE: load = RAM, run=LANGUAGE_CARD, type = ro, define = yes;
|
|
||||||
RODATA: load = RAM, run=LANGUAGE_CARD, type = ro , define = yes;
|
|
||||||
IP65_DEFAULTS: load = RAM, run=LANGUAGE_CARD, type = ro , define = yes;
|
|
||||||
DATA: load = RAM, run=LANGUAGE_CARD, type = rw , define = yes;
|
|
||||||
BSS: load=LANGUAGE_CARD, type = bss, define = yes;
|
|
||||||
ZEROPAGE: load = ZP, type = zp;
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
PAGE3: load=PAGE3,type=bss;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
ZP: start = $00, size = $08, type = rw, define = yes;
|
|
||||||
IP65ZP: start = $0f, size = $10, type = rw, define = yes;
|
|
||||||
C700_BANK: start = $c700, size = $100, file = %O;
|
|
||||||
C800_BANK_0: start = $c800, size = $800, file = %O, fill=yes, fillval=$F0;
|
|
||||||
C800_BANK_1: start = $c800, size = $800, file = %O, fill=yes, fillval=$F1;
|
|
||||||
C800_BANK_2: start = $c800, size = $800, file = %O, fill=yes, fillval=$F2;
|
|
||||||
C800_BANK_3: start = $c800, size = $800, file = %O, fill=yes, fillval=$F3;
|
|
||||||
C800_BANK_4: start = $c800, size = $800, file = %O, fill=yes, fillval=$F4;
|
|
||||||
C800_BANK_5: start = $c800, size = $800, file = %O, fill=yes, fillval=$F5;
|
|
||||||
C800_BANK_6: start = $c800, size = $800, file = %O, fill=yes, fillval=$F6;
|
|
||||||
C800_BANK_7: start = $c800, size = $800, file = %O, fill=yes, fillval=$F7;
|
|
||||||
C800_BANK_8: start = $c800, size = $800, file = %O, fill=yes, fillval=$F8;
|
|
||||||
C800_BANK_9: start = $c800, size = $800, file = %O, fill=yes, fillval=$F9;
|
|
||||||
C800_BANK_A: start = $c800, size = $800, file = %O, fill=yes, fillval=$FA;
|
|
||||||
C800_BANK_B: start = $c800, size = $800, file = %O, fill=yes, fillval=$FB;
|
|
||||||
C800_BANK_C: start = $c800, size = $800, file = %O, fill=yes, fillval=$FC;
|
|
||||||
C800_BANK_D: start = $c800, size = $800, file = %O, fill=yes, fillval=$FD;
|
|
||||||
C800_BANK_E: start = $c800, size = $800, file = %O, fill=yes, fillval=$FE;
|
|
||||||
RAM: start = $800, size = $8000, file = %O;
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
C700: load=C700_BANK, type=ro,define=yes;
|
|
||||||
CODE: load=C700_BANK, type=ro,define=yes;
|
|
||||||
C800_0: load=C800_BANK_0, type=ro,define=yes;
|
|
||||||
C800_1: load=C800_BANK_1, type=ro,define=yes;
|
|
||||||
C800_2: load=C800_BANK_2, type=ro,define=yes;
|
|
||||||
C800_3: load=C800_BANK_3, type=ro,define=yes;
|
|
||||||
C800_4: load=C800_BANK_4, type=ro,define=yes;
|
|
||||||
C800_5: load=C800_BANK_5, type=ro,define=yes;
|
|
||||||
C800_6: load=C800_BANK_6, type=ro,define=yes;
|
|
||||||
C800_7: load=C800_BANK_7, type=ro,define=yes;
|
|
||||||
C800_8: load=C800_BANK_8, type=ro,define=yes;
|
|
||||||
C800_9: load=C800_BANK_9, type=ro,define=yes;
|
|
||||||
C800_A: load=C800_BANK_A, type=ro,define=yes;
|
|
||||||
C800_B: load=C800_BANK_B, type=ro,define=yes;
|
|
||||||
C800_C: load=C800_BANK_C, type=ro,define=yes;
|
|
||||||
C800_D: load=C800_BANK_D, type=ro,define=yes;
|
|
||||||
C800_E: load=C800_BANK_E, type=ro,define=yes;
|
|
||||||
|
|
||||||
DATA: load = RAM, run=RAM, type = rw , define = yes;
|
|
||||||
BSS: load=RAM, type = bss, define = yes;
|
|
||||||
ZEROPAGE: load = ZP, type = zp;
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# CA65 config for a 16KB cart
|
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
ZP: start = $02, size = $1A, type = rw ;
|
|
||||||
IP65ZP: start = $20, size = $13, type = rw, define = yes; #this cart replaces BASIC so ok to use that space
|
|
||||||
HEADER: start = $8000, size = $18, file = %O;
|
|
||||||
DEFAULTS: start = $8018, size = $1F, file = %O;
|
|
||||||
ROM: start = $8037, size = $3FC9, define = yes, file = %O;
|
|
||||||
RAM: start = $C010, size = $0fE0, define = yes;
|
|
||||||
RAM2: start = $0334, size = $CB, define = yes; #extra scratch area - Tape I/O buffer
|
|
||||||
RAM3: start = $0200, size = $58, define = yes; #extra scratch area - Tape I/O buffer
|
|
||||||
RAM4: start = $0800, size = $7800, define = yes; #scratch area for apps embedded in cart to use
|
|
||||||
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
CARTRIDGE_HEADER: load = HEADER, type = ro;
|
|
||||||
IP65_DEFAULTS: load = DEFAULTS, type = ro;
|
|
||||||
CODE: load = ROM, type = ro;
|
|
||||||
|
|
||||||
RODATA: load = ROM, run=ROM, type = ro;
|
|
||||||
DATA: load = ROM, run = RAM, type = rw, define = yes;
|
|
||||||
SELF_MODIFIED_CODE: load = ROM, run = RAM2, type = rw, define = yes;
|
|
||||||
|
|
||||||
BSS: load = RAM, type = bss;
|
|
||||||
APP_SCRATCH: load = RAM4, type = bss;
|
|
||||||
TCP_VARS: load = RAM2, type = bss;
|
|
||||||
HTTP_VARS: load=ROM, run = RAM3, type = rw,define = yes;
|
|
||||||
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
# CA65 config for a Retro Replay cartridge
|
|
||||||
# default is for GAME=1, EXROM=0,
|
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
IP65ZP: start = $A3, size = $0E, type = rw, define = yes;
|
|
||||||
HEADER: start = $8000, size = $18, file = %O;
|
|
||||||
DEFAULTS: start = $8018, size = $1F, file = %O;
|
|
||||||
ROM: start = $8037, size = $1FC9, define = yes, file = %O;
|
|
||||||
RAM: start = $C010, size = $0fE0, define = yes;
|
|
||||||
RAM2: start = $0334, size = $CB, define = yes; #extra scratch area - Tape I/O buffer
|
|
||||||
RAM3: start = $0200, size = $58, define = yes; #extra scratch area - Tape I/O buffer
|
|
||||||
RAM4: start = $6000, size = $3FC9, define = yes; #scratch area for apps embedded in cart to use
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
CARTRIDGE_HEADER: load = HEADER, type = ro;
|
|
||||||
IP65_DEFAULTS: load = DEFAULTS, type = ro;
|
|
||||||
CODE: load = ROM, type = ro;
|
|
||||||
RODATA: load = ROM, run=ROM, type = ro;
|
|
||||||
DATA: load = ROM, run = RAM, type = rw, define = yes;
|
|
||||||
BSS: load = RAM, type = bss;
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
SELF_MODIFIED_CODE: load = ROM, run = RAM2, type = rw, define = yes;
|
|
||||||
APP_SCRATCH: load = RAM4, type = bss;
|
|
||||||
TCP_VARS: load = RAM4, type = bss;
|
|
||||||
HTTP_VARS: load=ROM, run = RAM3, type = rw,define = yes;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
# CA65 config for a M/L stub that will use memory from $6000..$A000 and $c010..$cfff
|
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
IP65ZP: start = $A3, size = $0E, type = rw;
|
|
||||||
MAINRAM: start = $3ffe, size = $3FC9, define = yes, file = %O;
|
|
||||||
HIRAM: start = $C010, size = $0fE0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SEGMENTS {
|
|
||||||
STARTUP: load = MAINRAM, type = ro;
|
|
||||||
IP65_DEFAULTS: load = MAINRAM, type = ro;
|
|
||||||
CODE: load = MAINRAM, type = ro;
|
|
||||||
SELF_MODIFIED_CODE: load = MAINRAM, type = rw;
|
|
||||||
RODATA: load = MAINRAM, type = ro;
|
|
||||||
DATA: load = MAINRAM, type = rw, define = yes;
|
|
||||||
BSS: load = MAINRAM, type = bss;
|
|
||||||
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
|
|
||||||
ZEROPAGE: load = IP65ZP, type = zp;
|
|
||||||
|
|
||||||
TCP_VARS: load = HIRAM, type = bss;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
MEMORY {
|
|
||||||
ZP: start = $02, size = $1A, type = rw ;
|
|
||||||
IP65ZP: start = $5f, size = $10, type = rw;
|
|
||||||
RAM: start = $07FF, size = $c7ab, file = %O;
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
STARTUP: load = RAM, type = ro ,define = yes, optional=yes;
|
|
||||||
SELF_MODIFIED_CODE: load = RAM, type = rw,define = yes, optional=yes;
|
|
||||||
VIC_DATA: load = RAM, type = rw,align = $800, optional=yes;
|
|
||||||
RODATA: load = RAM, type = ro,define = yes, optional=yes;
|
|
||||||
CARTRIDGE_HEADER: load = RAM, type = ro, optional=yes;
|
|
||||||
|
|
||||||
IP65_DEFAULTS: load = RAM, type = rw,define = yes, optional=yes;
|
|
||||||
DATA: load = RAM, type = rw,define = yes;
|
|
||||||
FONT_TABLE: load=RAM, type=rw, optional=yes,start=$2000;
|
|
||||||
|
|
||||||
CODE: load = RAM, type = ro,define = yes;
|
|
||||||
|
|
||||||
BSS: load = RAM, type = bss, optional=yes;
|
|
||||||
APP_SCRATCH: load = RAM, type = bss, optional=yes;
|
|
||||||
ZEROPAGE: load = ZP, type = zp, optional=yes;
|
|
||||||
IP65ZP: load = IP65ZP, type = zp, optional=yes;
|
|
||||||
TCP_VARS: load = RAM, type = bss, optional=yes;
|
|
||||||
HTTP_VARS: load = RAM, type = bss, optional=yes;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
IP65ZP: start = $A3, size = $12, type = rw;
|
|
||||||
STARTRAM: start = $07FF, size = $1000, file = %O;
|
|
||||||
MAINRAM: start = $4000, size = $3FC9, define = yes, file = %O;
|
|
||||||
HIRAM: start = $C010, size = $0fE0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SEGMENTS {
|
|
||||||
STARTUP: load = STARTRAM, type = rw;
|
|
||||||
MAINSTART: load = MAINRAM, type = rw;
|
|
||||||
|
|
||||||
IP65_DEFAULTS: load = MAINRAM, type = ro;
|
|
||||||
CODE: load = MAINRAM, type = ro;
|
|
||||||
SELF_MODIFIED_CODE: load = MAINRAM, type = rw;
|
|
||||||
RODATA: load = MAINRAM, type = ro;
|
|
||||||
DATA: load = MAINRAM, type = rw, define = yes;
|
|
||||||
HTTP_VARS: load = MAINRAM, type = rw, define = yes;
|
|
||||||
BSS: load = MAINRAM, type = bss;
|
|
||||||
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
|
|
||||||
ZEROPAGE: load = IP65ZP, type = zp;
|
|
||||||
|
|
||||||
TCP_VARS: load = HIRAM, type = bss;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
IP65ZP: start = $A3, size = $12, type = rw;
|
|
||||||
STARTRAM: start = $11FF, size = $1000, file = %O;
|
|
||||||
MAINRAM: start = $4000, size = $3FC9, define = yes, file = %O;
|
|
||||||
HIRAM: start = $A000, size = $1fE0;
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
STARTUP: load = STARTRAM, type = rw;
|
|
||||||
MAINSTART: load = MAINRAM, type = rw;
|
|
||||||
|
|
||||||
IP65_DEFAULTS: load = MAINRAM, type = ro;
|
|
||||||
CODE: load = MAINRAM, type = ro;
|
|
||||||
SELF_MODIFIED_CODE: load = MAINRAM, type = rw;
|
|
||||||
RODATA: load = MAINRAM, type = ro;
|
|
||||||
DATA: load = MAINRAM, type = rw, define = yes;
|
|
||||||
HTTP_VARS: load = MAINRAM, type = rw, define = yes;
|
|
||||||
BSS: load = MAINRAM, type = bss;
|
|
||||||
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
|
|
||||||
ZEROPAGE: load = IP65ZP, type = zp;
|
|
||||||
|
|
||||||
TCP_VARS: load = HIRAM, type = bss;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
# CA65 config for a Retro Replay cartridge
|
|
||||||
# default is for GAME=1, EXROM=0,
|
|
||||||
|
|
||||||
MEMORY {
|
|
||||||
IP65ZP: start = $A3, size = $0E, type = rw, define = yes;
|
|
||||||
HEADER: start = $8000, size = $18, file = %O;
|
|
||||||
DEFAULTS: start = $8018, size = $1E, file = %O;
|
|
||||||
ROM: start = $8036, size = $1FCA, define = yes, file = %O;
|
|
||||||
RAM: start = $C010, size = $0fE0, define = yes;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
SEGMENTS {
|
|
||||||
CARTRIDGE_HEADER: load = HEADER, type = ro;
|
|
||||||
IP65_DEFAULTS: load = DEFAULTS, type = ro;
|
|
||||||
CODE: load = ROM, type = ro;
|
|
||||||
RODATA: load = ROM, run=ROM, type = ro;
|
|
||||||
DATA: load = ROM, run = RAM, type = rw, define = yes;
|
|
||||||
BSS: load = RAM, type = bss;
|
|
||||||
IP65ZP: load = IP65ZP, type = zp;
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
start c:\temp\WinVICE-2.1\x64.exe -cart8 nb65\nb65_std_cart.bin nb65\d64_upload.d64
|
|
|
@ -1,80 +0,0 @@
|
||||||
CC=cl65
|
|
||||||
AS=ca65
|
|
||||||
|
|
||||||
DA=dasm
|
|
||||||
LD=ld65
|
|
||||||
CFLAGS=-Oirs -t $(TARGET)
|
|
||||||
AFLAGS=
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IP65TCPLIB=../ip65/ip65_tcp.lib
|
|
||||||
|
|
||||||
C64RRNETLIB=../drivers/c64rrnet.lib
|
|
||||||
|
|
||||||
#NT2PLAY=nt2play.o
|
|
||||||
|
|
||||||
INCFILES=\
|
|
||||||
../inc/common.i\
|
|
||||||
../inc/commonprint.i\
|
|
||||||
../inc/net.i\
|
|
||||||
|
|
||||||
|
|
||||||
all: upnatom.prg upnatom.d64 webnoter.d64
|
|
||||||
|
|
||||||
|
|
||||||
%.o: %.s
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
upnatom.o: upnatom.s sine_data.i
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
sine_data.i: make_sine_data.rb
|
|
||||||
ruby make_sine_data.rb
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
webnoter.o: webnoter.s form.html
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
webnoter.prg: webnoter.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
|
||||||
$(LD) -m webnoter.map -vm -C ../cfg/c64prg.cfg -o webnoter.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB) $(NT2PLAY)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
upnatom.prg: upnatom.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
|
||||||
$(LD) -m upnatom.map -vm -C ../cfg/c64prg.cfg -o upnatom.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB) $(NT2PLAY)
|
|
||||||
|
|
||||||
# cp upnatom.prg ../../server/boot/
|
|
||||||
|
|
||||||
%.prg: %.o $(IP65TCPLIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64prg.cfg
|
|
||||||
$(LD) -m $*.map -vm -C ../cfg/c64prg.cfg -o $*.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
upnatom.d64: upnatom.prg url.cfg
|
|
||||||
cp upnatom.prg autoexec.prg
|
|
||||||
c1541 -format upnatom,up d64 $@ -attach $@ -write ../carts/kipperkart.prg "kipperkart.prg" -write autoexec.prg -write "url.cfg" "url.cfg,s"
|
|
||||||
|
|
||||||
|
|
||||||
webnoter.d64: webnoter.prg
|
|
||||||
cp webnoter.prg autoexec.prg
|
|
||||||
c1541 -format webnoter,wn d64 $@ -attach $@ -write ../carts/kipperkart.prg "kipperkart.prg" -write autoexec.prg
|
|
||||||
|
|
||||||
httpd.prg: httpd.asm
|
|
||||||
$(DA) httpd.asm -ohttpd.prg
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%.d64: %.prg
|
|
||||||
cp $*.prg autoexec.prg
|
|
||||||
c1541 -format kipper,kp d64 $@ -attach $@ -write autoexec.prg
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.pg2 *.prg *.map upnatom.d64
|
|
||||||
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *~
|
|
|
@ -1,489 +0,0 @@
|
||||||
;NB65 API example in DASM format (http://www.atari2600.org/DASM/)
|
|
||||||
processor 6502
|
|
||||||
|
|
||||||
include "../inc/nb65_constants.i"
|
|
||||||
|
|
||||||
;useful macros
|
|
||||||
mac ldax
|
|
||||||
lda [{1}]
|
|
||||||
ldx [{1}]+1
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac ldaxi
|
|
||||||
lda #<[{1}]
|
|
||||||
ldx #>[{1}]
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac stax
|
|
||||||
sta [{1}]
|
|
||||||
stx [{1}]+1
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac cout
|
|
||||||
lda [{1}]
|
|
||||||
jsr print_a
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac print_cr
|
|
||||||
cout #13
|
|
||||||
jsr print_a
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac nb65call
|
|
||||||
ldy [{1}]
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac print
|
|
||||||
|
|
||||||
ldaxi [{1}]
|
|
||||||
ldy #NB65_PRINT_ASCIIZ
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
;some routines & zero page variables
|
|
||||||
print_a equ $ffd2
|
|
||||||
temp_ptr equ $FB ; scratch space in page zero
|
|
||||||
|
|
||||||
;######### KERNEL functions
|
|
||||||
CHKIN EQU $ffc6
|
|
||||||
CHKOUT EQU $ffc9
|
|
||||||
CHRIN EQU $ffcf
|
|
||||||
CHROUT EQU $ffd2
|
|
||||||
CLALL EQU $FFE7
|
|
||||||
CLOSE EQU $ffc3
|
|
||||||
OPEN EQU $ffc0
|
|
||||||
READST EQU $ffb7
|
|
||||||
SETNAM EQU $ffbd
|
|
||||||
SETLFS EQU $ffba
|
|
||||||
|
|
||||||
|
|
||||||
;start of code
|
|
||||||
;BASIC stub
|
|
||||||
org $801
|
|
||||||
dc.b $0b,$08,$d4,$07,$9e,$32,$30,$36,$31,$00,$00,$00
|
|
||||||
|
|
||||||
|
|
||||||
ldaxi #NB65_CART_SIGNATURE ;where signature should be in cartridge (if cart is banked in)
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc found_nb65_signature
|
|
||||||
|
|
||||||
ldaxi #NB65_RAM_STUB_SIGNATURE ;where signature should be in a RAM stub
|
|
||||||
jsr look_for_signature
|
|
||||||
bcs nb65_signature_not_found
|
|
||||||
jsr NB65_RAM_STUB_ACTIVATE ;we need to turn on NB65 cartridge
|
|
||||||
jmp found_nb65_signature
|
|
||||||
|
|
||||||
nb65_signature_not_found
|
|
||||||
ldaxi #nb65_api_not_found_message
|
|
||||||
jsr print_ax
|
|
||||||
rts
|
|
||||||
|
|
||||||
found_nb65_signature
|
|
||||||
|
|
||||||
print #initializing
|
|
||||||
nb65call #NB65_INITIALIZE
|
|
||||||
bcc .init_ok
|
|
||||||
print_cr
|
|
||||||
print #failed
|
|
||||||
print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
.init_ok
|
|
||||||
|
|
||||||
;if we got here, we have found the NB65 API and initialised the IP stack
|
|
||||||
|
|
||||||
jsr CLALL
|
|
||||||
.send_1_image
|
|
||||||
lda #$93 ;cls
|
|
||||||
jsr print_a
|
|
||||||
print #signon_message
|
|
||||||
jsr reset_counters_to_first_sector
|
|
||||||
print #enter_filename
|
|
||||||
ldaxi #filter_dns ;this is pretty close to being a filter for legal chars in file names as well
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs .no_filename_entered
|
|
||||||
stax nb65_param_buffer+NB65_TFTP_FILENAME
|
|
||||||
print #position_cursor_for_track_display
|
|
||||||
ldaxi #send_next_block
|
|
||||||
stax nb65_param_buffer+NB65_TFTP_POINTER
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_TFTP_CALLBACK_UPLOAD
|
|
||||||
bcc .upload_ok
|
|
||||||
print_cr
|
|
||||||
print #failed
|
|
||||||
jmp print_nb65_errorcode
|
|
||||||
.upload_ok
|
|
||||||
lda #15 ; filenumber 15 - command channel
|
|
||||||
jsr CLOSE
|
|
||||||
print_cr
|
|
||||||
print #ok
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
jsr get_key
|
|
||||||
jmp .send_1_image ;done! so go again
|
|
||||||
.no_filename_entered
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
send_next_block
|
|
||||||
;tftp upload callback routine
|
|
||||||
;AX will point to address to fill
|
|
||||||
stax sector_buffer_address
|
|
||||||
lda track
|
|
||||||
cmp #36
|
|
||||||
beq .past_last_track
|
|
||||||
print #position_cursor_for_track_display
|
|
||||||
jsr print_current_sector
|
|
||||||
jsr read_sector
|
|
||||||
lda #$30
|
|
||||||
cmp error_buffer
|
|
||||||
bne .was_an_error
|
|
||||||
.after_error_check
|
|
||||||
jsr move_to_next_sector
|
|
||||||
bcc .not_last_sector
|
|
||||||
ldaxi #$100
|
|
||||||
rts
|
|
||||||
.not_last_sector
|
|
||||||
|
|
||||||
inc sector_buffer_address+1
|
|
||||||
jsr read_sector
|
|
||||||
jsr move_to_next_sector
|
|
||||||
ldaxi #$200
|
|
||||||
|
|
||||||
rts
|
|
||||||
.past_last_track
|
|
||||||
ldaxi #$0000
|
|
||||||
rts
|
|
||||||
|
|
||||||
.was_an_error
|
|
||||||
print #position_cursor_for_error_display
|
|
||||||
print #drive_error
|
|
||||||
print_cr
|
|
||||||
jsr print_current_sector
|
|
||||||
print #error_buffer
|
|
||||||
jmp .after_error_check
|
|
||||||
|
|
||||||
print_current_sector
|
|
||||||
print #track_no
|
|
||||||
lda track
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
jsr print_a
|
|
||||||
pla
|
|
||||||
jsr print_a
|
|
||||||
print #sector_no
|
|
||||||
lda sector
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
jsr print_a
|
|
||||||
pla
|
|
||||||
jsr print_a
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
read_sector
|
|
||||||
;routine to read a sector cribbed from http://codebase64.org/doku.php?id=base:reading_a_sector_from_disk
|
|
||||||
; - requires track and sector values be set first
|
|
||||||
; sector will be written to address whos value is stored in sector_data
|
|
||||||
; open the channel file
|
|
||||||
|
|
||||||
jsr make_read_sector_command
|
|
||||||
|
|
||||||
lda #1
|
|
||||||
ldx #<cname
|
|
||||||
ldy #>cname
|
|
||||||
jsr SETNAM
|
|
||||||
lda #$02
|
|
||||||
ldx #$08
|
|
||||||
ldy #$02
|
|
||||||
jsr SETLFS
|
|
||||||
jsr OPEN
|
|
||||||
bcs .error
|
|
||||||
ldx #<command_buffer
|
|
||||||
ldy #>command_buffer
|
|
||||||
lda #12
|
|
||||||
jsr SETNAM
|
|
||||||
lda #15
|
|
||||||
ldx $BA ;use whatever was last device #
|
|
||||||
ldy #15
|
|
||||||
jsr SETLFS
|
|
||||||
jsr OPEN
|
|
||||||
bcs .error
|
|
||||||
|
|
||||||
|
|
||||||
jsr check_error_channel
|
|
||||||
lda #$30
|
|
||||||
cmp error_buffer
|
|
||||||
beq .was_not_an_error
|
|
||||||
print #error_buffer
|
|
||||||
|
|
||||||
.was_not_an_error
|
|
||||||
ldx #$02 ; filenumber 2
|
|
||||||
jsr CHKIN ;(file 2 now used as input)
|
|
||||||
|
|
||||||
lda sector_buffer_address
|
|
||||||
sta temp_ptr
|
|
||||||
lda sector_buffer_address+1
|
|
||||||
sta temp_ptr+1
|
|
||||||
ldy #$00
|
|
||||||
.loop
|
|
||||||
jsr CHRIN ;(get a byte from file)
|
|
||||||
sta (temp_ptr),Y ; write byte to memory
|
|
||||||
iny
|
|
||||||
bne .loop ; next byte, end when 256 bytes are read
|
|
||||||
.close
|
|
||||||
lda #15 ; filenumber 15
|
|
||||||
jsr CLOSE
|
|
||||||
lda #$02 ; filenumber 2
|
|
||||||
jsr CLOSE
|
|
||||||
ldx #$00 ; filenumber 0 = keyboard
|
|
||||||
jsr CHKIN ;(keyboard now input device again)
|
|
||||||
rts
|
|
||||||
.error
|
|
||||||
pha
|
|
||||||
print #error_opening_channel
|
|
||||||
pla
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
jmp .close
|
|
||||||
|
|
||||||
check_error_channel
|
|
||||||
ldx #$0F ; filenumber 15
|
|
||||||
jsr CHKIN ;(file 15 now used as input)
|
|
||||||
ldy #$00
|
|
||||||
.ecloop
|
|
||||||
jsr READST ;(read status byte)
|
|
||||||
bne .eof ; either EOF or read error
|
|
||||||
jsr CHRIN ;(get a byte from file)
|
|
||||||
sta error_buffer,y
|
|
||||||
iny
|
|
||||||
jmp .ecloop ; next byte
|
|
||||||
|
|
||||||
.eof
|
|
||||||
lda #0
|
|
||||||
sta error_buffer,y
|
|
||||||
ldx #$00 ; filenumber 0 = keyboard
|
|
||||||
jsr CHKIN ;(keyboard now input device again)
|
|
||||||
rts
|
|
||||||
|
|
||||||
make_read_sector_command
|
|
||||||
;fill command buffer with command to read in track & sector
|
|
||||||
;returns length of command in Y
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
lda #85 ;"U"
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$31 ;"1"
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$32 ;"2" - file number
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$30 ;"0" - drive number
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda track
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
sta command_buffer,y
|
|
||||||
pla
|
|
||||||
iny
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda #$20 ;" "
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
lda sector
|
|
||||||
jsr byte_to_ascii
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
sta command_buffer,y
|
|
||||||
pla
|
|
||||||
iny
|
|
||||||
sta command_buffer,y
|
|
||||||
iny
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta command_buffer,y ;make it ASCIIZ so we can print it
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
byte_to_ascii
|
|
||||||
cmp #30
|
|
||||||
bmi .not_30
|
|
||||||
ldx #$33
|
|
||||||
clc
|
|
||||||
adc #18
|
|
||||||
rts
|
|
||||||
.not_30
|
|
||||||
cmp #20
|
|
||||||
bmi .not_20
|
|
||||||
ldx #$32
|
|
||||||
clc
|
|
||||||
adc #28
|
|
||||||
rts
|
|
||||||
.not_20
|
|
||||||
cmp #10
|
|
||||||
bmi .not_10
|
|
||||||
ldx #$31
|
|
||||||
clc
|
|
||||||
adc #38
|
|
||||||
rts
|
|
||||||
.not_10
|
|
||||||
ldx #$30
|
|
||||||
clc
|
|
||||||
adc #48
|
|
||||||
rts
|
|
||||||
|
|
||||||
move_to_next_sector
|
|
||||||
inc sector
|
|
||||||
lda sector
|
|
||||||
cmp sectors_in_track
|
|
||||||
beq .move_to_next_track
|
|
||||||
rts
|
|
||||||
.move_to_next_track:
|
|
||||||
lda #0
|
|
||||||
sta sector
|
|
||||||
inc track
|
|
||||||
lda track
|
|
||||||
cmp #18
|
|
||||||
bne .not_track_18
|
|
||||||
lda #19
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
.not_track_18
|
|
||||||
cmp #25
|
|
||||||
bne .not_track_25
|
|
||||||
lda #18
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
.not_track_25
|
|
||||||
cmp #31
|
|
||||||
bne .not_track_31
|
|
||||||
lda #17
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
.not_track_31
|
|
||||||
lda track
|
|
||||||
cmp #36 ;carry will be set if hit track 36
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
reset_counters_to_first_sector
|
|
||||||
ldx #1
|
|
||||||
stx track
|
|
||||||
dex
|
|
||||||
stx sector
|
|
||||||
ldx #21
|
|
||||||
stx sectors_in_track
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
;look for NB65 signature at location pointed at by AX
|
|
||||||
look_for_signature subroutine
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #3
|
|
||||||
.check_one_byte
|
|
||||||
lda (temp_ptr),y
|
|
||||||
cmp nb65_signature,y
|
|
||||||
bne .bad_match
|
|
||||||
dey
|
|
||||||
bpl .check_one_byte
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
.bad_match
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_ax subroutine
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #0
|
|
||||||
.next_char
|
|
||||||
lda (temp_ptr),y
|
|
||||||
beq .done
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
jmp .next_char
|
|
||||||
.done
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key
|
|
||||||
jsr $ffe4
|
|
||||||
cmp #0
|
|
||||||
beq get_key
|
|
||||||
rts
|
|
||||||
|
|
||||||
reset_after_keypress
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
jsr get_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
|
|
||||||
print_errorcode
|
|
||||||
print #error_code
|
|
||||||
nb65call #NB65_GET_LAST_ERROR
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;constants
|
|
||||||
nb65_api_not_found_message dc.b "ERROR - NB65 API NOT FOUND.",13,0
|
|
||||||
nb65_signature dc.b $4E,$42,$36,$35 ; "NB65" - API signature
|
|
||||||
initializing dc.b "INITIALIZING ",13,0
|
|
||||||
error_code dc.b "ERROR CODE: $",0
|
|
||||||
press_a_key_to_continue dc.b "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
failed dc.b "FAILED ", 0
|
|
||||||
ok dc.b "OK ", 0
|
|
||||||
|
|
||||||
;variables
|
|
||||||
nb65_param_buffer DS.B $20
|
|
||||||
current_byte DS.B 1
|
|
||||||
track DS.B 1
|
|
||||||
sector DS.B 1
|
|
||||||
sectors_in_track DS.B 1
|
|
||||||
error_buffer DS.B 128
|
|
||||||
command_buffer DS.B 128
|
|
||||||
sector_buffer DS.B 256
|
|
||||||
sector_buffer_address DS.B 2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR dasm_d64_upload.asm --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,255 +0,0 @@
|
||||||
;NB65 API example in DASM format (http://www.atari2600.org/DASM/)
|
|
||||||
processor 6502
|
|
||||||
|
|
||||||
include "../inc/nb65_constants.i"
|
|
||||||
|
|
||||||
;useful macros
|
|
||||||
mac ldax
|
|
||||||
lda [{1}]
|
|
||||||
ldx [{1}]+1
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac ldaxi
|
|
||||||
lda #<[{1}]
|
|
||||||
ldx #>[{1}]
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac stax
|
|
||||||
sta [{1}]
|
|
||||||
stx [{1}]+1
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac cout
|
|
||||||
lda [{1}]
|
|
||||||
jsr print_a
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac print_cr
|
|
||||||
cout #13
|
|
||||||
jsr print_a
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac nb65call
|
|
||||||
ldy [{1}]
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac print
|
|
||||||
|
|
||||||
ldaxi [{1}]
|
|
||||||
ldy #NB65_PRINT_ASCIIZ
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
;some routines & zero page variables
|
|
||||||
print_a equ $ffd2
|
|
||||||
temp_ptr equ $FB ; scratch space in page zero
|
|
||||||
|
|
||||||
|
|
||||||
;start of code
|
|
||||||
;BASIC stub
|
|
||||||
org $801
|
|
||||||
dc.b $0b,$08,$d4,$07,$9e,$32,$30,$36,$31,$00,$00,$00
|
|
||||||
|
|
||||||
|
|
||||||
ldaxi #NB65_CART_SIGNATURE ;where signature should be in cartridge (if cart is banked in)
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc found_nb65_signature
|
|
||||||
|
|
||||||
ldaxi #NB65_RAM_STUB_SIGNATURE ;where signature should be in a RAM stub
|
|
||||||
jsr look_for_signature
|
|
||||||
bcs nb65_signature_not_found
|
|
||||||
jsr NB65_RAM_STUB_ACTIVATE ;we need to turn on NB65 cartridge
|
|
||||||
jmp found_nb65_signature
|
|
||||||
|
|
||||||
nb65_signature_not_found
|
|
||||||
ldaxi #nb65_api_not_found_message
|
|
||||||
jsr print_ax
|
|
||||||
rts
|
|
||||||
|
|
||||||
found_nb65_signature
|
|
||||||
|
|
||||||
print #initializing
|
|
||||||
nb65call #NB65_INITIALIZE
|
|
||||||
bcc .init_ok
|
|
||||||
print_cr
|
|
||||||
print #failed
|
|
||||||
print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
.init_ok
|
|
||||||
|
|
||||||
;if we got here, we have found the NB65 API and initialised the IP stack
|
|
||||||
;print out the current configuration
|
|
||||||
nb65call #NB65_PRINT_IP_CONFIG
|
|
||||||
|
|
||||||
|
|
||||||
;now set up for the nb65callback test
|
|
||||||
|
|
||||||
ldaxi #64 ;listen on port 64
|
|
||||||
stax nb65_param_buffer+NB65_UDP_LISTENER_PORT
|
|
||||||
ldaxi #udp_nb65callback
|
|
||||||
stax nb65_param_buffer+NB65_UDP_LISTENER_CALLBACK
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_UDP_ADD_LISTENER
|
|
||||||
bcc .add_listener_ok
|
|
||||||
print #failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
.add_listener_ok
|
|
||||||
|
|
||||||
print #listening
|
|
||||||
|
|
||||||
|
|
||||||
.loop_forever
|
|
||||||
jsr NB65_PERIODIC_PROCESSING_VECTOR
|
|
||||||
jmp .loop_forever
|
|
||||||
|
|
||||||
|
|
||||||
;here is the code that will execute whenever a UDP packet arrives on port 64
|
|
||||||
udp_nb65callback subroutine
|
|
||||||
|
|
||||||
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_GET_INPUT_PACKET_INFO
|
|
||||||
|
|
||||||
print_cr
|
|
||||||
print #recv_from
|
|
||||||
ldaxi #nb65_param_buffer+NB65_REMOTE_IP
|
|
||||||
nb65call #NB65_PRINT_DOTTED_QUAD
|
|
||||||
print #port
|
|
||||||
lda nb65_param_buffer+NB65_REMOTE_PORT+1
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
lda nb65_param_buffer+NB65_REMOTE_PORT
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
print #length
|
|
||||||
lda nb65_param_buffer+NB65_PAYLOAD_LENGTH+1
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
lda nb65_param_buffer+NB65_PAYLOAD_LENGTH
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
print #data
|
|
||||||
ldax nb65_param_buffer+NB65_PAYLOAD_POINTER
|
|
||||||
stax temp_ptr
|
|
||||||
ldx nb65_param_buffer+NB65_PAYLOAD_LENGTH ;assumes length is < 255
|
|
||||||
ldy #0
|
|
||||||
.next_byte
|
|
||||||
lda (temp_ptr),y
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bpl .next_byte
|
|
||||||
|
|
||||||
|
|
||||||
print_cr
|
|
||||||
|
|
||||||
;make and send a reply
|
|
||||||
ldaxi #reply_message
|
|
||||||
stax nb65_param_buffer+NB65_PAYLOAD_POINTER
|
|
||||||
|
|
||||||
ldaxi #reply_message_length
|
|
||||||
stax nb65_param_buffer+NB65_PAYLOAD_LENGTH
|
|
||||||
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_SEND_UDP_PACKET
|
|
||||||
bcc .sent_ok
|
|
||||||
jmp print_errorcode
|
|
||||||
.sent_ok
|
|
||||||
print #reply_sent
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
;look for NB65 signature at location pointed at by AX
|
|
||||||
look_for_signature subroutine
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #3
|
|
||||||
.check_one_byte
|
|
||||||
lda (temp_ptr),y
|
|
||||||
cmp nb65_signature,y
|
|
||||||
bne .bad_match
|
|
||||||
dey
|
|
||||||
bpl .check_one_byte
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
.bad_match
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_ax subroutine
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #0
|
|
||||||
.next_char
|
|
||||||
lda (temp_ptr),y
|
|
||||||
beq .done
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
jmp .next_char
|
|
||||||
.done
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key
|
|
||||||
jsr $ffe4
|
|
||||||
cmp #0
|
|
||||||
beq get_key
|
|
||||||
rts
|
|
||||||
|
|
||||||
reset_after_keypress
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
jsr get_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
|
|
||||||
print_errorcode
|
|
||||||
print #error_code
|
|
||||||
nb65call #NB65_GET_LAST_ERROR
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;constants
|
|
||||||
nb65_api_not_found_message dc.b "ERROR - NB65 API NOT FOUND.",13,0
|
|
||||||
nb65_signature dc.b $4E,$42,$36,$35 ; "NB65" - API signature
|
|
||||||
initializing dc.b "INITIALIZING ",13,0
|
|
||||||
error_code dc.b "ERROR CODE: $",0
|
|
||||||
press_a_key_to_continue dc.b "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
failed dc.b "FAILED ", 0
|
|
||||||
ok dc.b "OK ", 0
|
|
||||||
recv_from dc.b"RECEIVED FROM: ",0
|
|
||||||
listening dc.b "LISTENING ON UDP PORT 64",13,0
|
|
||||||
reply_sent dc.b "REPLY SENT.",0
|
|
||||||
port dc.b " PORT: $",0
|
|
||||||
length dc.b "LENGTH: $",0
|
|
||||||
data dc.b "DATA: ",0
|
|
||||||
space_colon_space dc.b " : ",0
|
|
||||||
reply_message dc.b "PONG!"
|
|
||||||
reply_message_length equ 5
|
|
||||||
|
|
||||||
;variables
|
|
||||||
nb65_param_buffer DS.B $20
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR dasm_example.asm --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
Binary file not shown.
|
@ -1,12 +0,0 @@
|
||||||
<head>
|
|
||||||
<style type="text/css">
|
|
||||||
body {
|
|
||||||
background-color: #d8e9ca;
|
|
||||||
}
|
|
||||||
</style></head>
|
|
||||||
<body><form><table align=center width=60%% height=60%%><tr><th colspan=2>WebNoter</tr>
|
|
||||||
<tr><td colspan=2>%?mhey %$h, thanks for saying '%$m'!%.</tr>
|
|
||||||
<tr><td>Your Handle:<td><input name=h type=text maxlength=20 value='%$h'></tr>
|
|
||||||
<tr><td>Your Message: <td><textarea name='m'></textarea></tr>
|
|
||||||
</tr><td><td><input type=submit value=enter></form></form></tr>
|
|
||||||
<table></body>
|
|
Binary file not shown.
|
@ -1,471 +0,0 @@
|
||||||
;NB65 API example in DASM format (http://www.atari2600.org/DASM/)
|
|
||||||
processor 6502
|
|
||||||
|
|
||||||
include "../inc/nb65_constants.i"
|
|
||||||
|
|
||||||
;useful macros
|
|
||||||
mac ldax
|
|
||||||
lda [{1}]
|
|
||||||
ldx [{1}]+1
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac ldaxi
|
|
||||||
lda #<[{1}]
|
|
||||||
ldx #>[{1}]
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac stax
|
|
||||||
sta [{1}]
|
|
||||||
stx [{1}]+1
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac cout
|
|
||||||
lda [{1}]
|
|
||||||
jsr print_a
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac print_cr
|
|
||||||
cout #13
|
|
||||||
jsr print_a
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac nb65call
|
|
||||||
ldy [{1}]
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
endm
|
|
||||||
|
|
||||||
mac print
|
|
||||||
|
|
||||||
ldaxi [{1}]
|
|
||||||
ldy #NB65_PRINT_ASCIIZ
|
|
||||||
jsr NB65_DISPATCH_VECTOR
|
|
||||||
endm
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protocol_http equ $00
|
|
||||||
protocol_gopher equ $01
|
|
||||||
|
|
||||||
;some routines & zero page variables
|
|
||||||
print_a equ $ffd2
|
|
||||||
temp_ptr equ $FB ; scratch space in page zero
|
|
||||||
|
|
||||||
|
|
||||||
;start of code
|
|
||||||
;NO BASIC stub! needs to be direct booted via TFTP
|
|
||||||
org $1000
|
|
||||||
|
|
||||||
jsr init_tod
|
|
||||||
|
|
||||||
ldaxi #NB65_CART_SIGNATURE ;where signature should be in cartridge (if cart is banked in)
|
|
||||||
jsr look_for_signature
|
|
||||||
bcc found_nb65_signature
|
|
||||||
|
|
||||||
ldaxi #NB65_RAM_STUB_SIGNATURE ;where signature should be in a RAM stub
|
|
||||||
jsr look_for_signature
|
|
||||||
bcs nb65_signature_not_found
|
|
||||||
jsr NB65_RAM_STUB_ACTIVATE ;we need to turn on NB65 cartridge
|
|
||||||
jmp found_nb65_signature
|
|
||||||
|
|
||||||
nb65_signature_not_found
|
|
||||||
ldaxi #nb65_api_not_found_message
|
|
||||||
jsr print_ax
|
|
||||||
rts
|
|
||||||
|
|
||||||
found_nb65_signature
|
|
||||||
|
|
||||||
lda NB65_API_VERSION
|
|
||||||
cmp #02
|
|
||||||
bpl .version_ok
|
|
||||||
print incorrect_version
|
|
||||||
jmp reset_after_keypress
|
|
||||||
.version_ok
|
|
||||||
print #initializing
|
|
||||||
nb65call #NB65_INITIALIZE
|
|
||||||
bcc .init_ok
|
|
||||||
print_cr
|
|
||||||
print #failed
|
|
||||||
print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
.init_ok
|
|
||||||
|
|
||||||
;if we got here, we have found the NB65 API and initialised the IP stack
|
|
||||||
;print out the current configuration
|
|
||||||
nb65call #NB65_PRINT_IP_CONFIG
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
listen_on_port_80
|
|
||||||
|
|
||||||
ldaxi #scratch_buffer
|
|
||||||
stax tcp_buffer_ptr
|
|
||||||
print #waiting
|
|
||||||
ldaxi #80 ;port number
|
|
||||||
stax nb65_param_buffer+NB65_TCP_PORT
|
|
||||||
stx nb65_param_buffer+NB65_TCP_REMOTE_IP
|
|
||||||
stx nb65_param_buffer+NB65_TCP_REMOTE_IP+1
|
|
||||||
stx nb65_param_buffer+NB65_TCP_REMOTE_IP+2
|
|
||||||
stx nb65_param_buffer+NB65_TCP_REMOTE_IP+3
|
|
||||||
ldaxi #http_callback
|
|
||||||
stax nb65_param_buffer+NB65_TCP_CALLBACK
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_TCP_CONNECT ;wait for inbound connect
|
|
||||||
bcc .connected_ok
|
|
||||||
print #error_while_waiting
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
.connected_ok
|
|
||||||
|
|
||||||
print #ok
|
|
||||||
lda #0
|
|
||||||
sta connection_closed
|
|
||||||
sta found_eol
|
|
||||||
clc
|
|
||||||
lda $dc09 ;time of day clock: seconds (in BCD)
|
|
||||||
sed
|
|
||||||
adc #$30
|
|
||||||
cmp #$60
|
|
||||||
bcc .timeout_set
|
|
||||||
sec
|
|
||||||
sbc #$60
|
|
||||||
.timeout_set:
|
|
||||||
cld
|
|
||||||
sta connection_timeout_seconds
|
|
||||||
|
|
||||||
|
|
||||||
.main_polling_loop
|
|
||||||
jsr NB65_PERIODIC_PROCESSING_VECTOR
|
|
||||||
|
|
||||||
lda found_eol
|
|
||||||
bne .got_eol
|
|
||||||
|
|
||||||
lda $dc09 ;time of day clock: seconds
|
|
||||||
|
|
||||||
cmp connection_timeout_seconds
|
|
||||||
beq .connection_timed_out
|
|
||||||
; nb65call #NB65_PRINT_HEX
|
|
||||||
lda connection_closed
|
|
||||||
beq .main_polling_loop
|
|
||||||
jmp listen_on_port_80
|
|
||||||
|
|
||||||
.connection_timed_out:
|
|
||||||
print #timeout
|
|
||||||
jmp listen_on_port_80
|
|
||||||
.got_eol:
|
|
||||||
|
|
||||||
;if we have a CR, we have got enough of a request to know if it's a HTTP or gopher request
|
|
||||||
lda #"G"
|
|
||||||
cmp scratch_buffer
|
|
||||||
bne .gopher
|
|
||||||
lda #"E"
|
|
||||||
cmp scratch_buffer+1
|
|
||||||
bne .gopher
|
|
||||||
lda #"T"
|
|
||||||
cmp scratch_buffer+2
|
|
||||||
bne .gopher
|
|
||||||
lda #" "
|
|
||||||
cmp scratch_buffer+3
|
|
||||||
bne .gopher
|
|
||||||
lda #protocol_http
|
|
||||||
sta protocol
|
|
||||||
print #http
|
|
||||||
ldx #4
|
|
||||||
jmp .copy_selector
|
|
||||||
.gopher
|
|
||||||
jsr print_a
|
|
||||||
lda #protocol_gopher
|
|
||||||
sta protocol
|
|
||||||
print #gopher
|
|
||||||
ldx #0
|
|
||||||
|
|
||||||
.copy_selector:
|
|
||||||
lda scratch_buffer,x
|
|
||||||
cmp #"/"
|
|
||||||
bne .copy_one_char
|
|
||||||
inx
|
|
||||||
.copy_one_char
|
|
||||||
lda scratch_buffer,x
|
|
||||||
cmp #$20
|
|
||||||
bcc .last_char_in_selector
|
|
||||||
sta selector,y
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
bne .copy_one_char
|
|
||||||
|
|
||||||
.last_char_in_selector
|
|
||||||
lda #0
|
|
||||||
sta selector,y
|
|
||||||
|
|
||||||
print #selector
|
|
||||||
|
|
||||||
;ldaxi #html_length
|
|
||||||
ldaxi #index_html_buffer_length
|
|
||||||
stax nb65_param_buffer+NB65_TCP_PAYLOAD_LENGTH
|
|
||||||
; ldaxi #html
|
|
||||||
ldaxi #index_html_buffer
|
|
||||||
stax nb65_param_buffer+NB65_TCP_PAYLOAD_POINTER
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_SEND_TCP_PACKET
|
|
||||||
|
|
||||||
nb65call #NB65_TCP_CLOSE_CONNECTION
|
|
||||||
.start_new_connection
|
|
||||||
jmp listen_on_port_80
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;look for NB65 signature at location pointed at by AX
|
|
||||||
look_for_signature subroutine
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #3
|
|
||||||
.check_one_byte
|
|
||||||
lda (temp_ptr),y
|
|
||||||
cmp nb65_signature,y
|
|
||||||
bne .bad_match
|
|
||||||
dey
|
|
||||||
bpl .check_one_byte
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
.bad_match
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_ax subroutine
|
|
||||||
stax temp_ptr
|
|
||||||
ldy #0
|
|
||||||
.next_char
|
|
||||||
lda (temp_ptr),y
|
|
||||||
beq .done
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
jmp .next_char
|
|
||||||
.done
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key
|
|
||||||
jsr $ffe4
|
|
||||||
cmp #0
|
|
||||||
beq get_key
|
|
||||||
rts
|
|
||||||
|
|
||||||
reset_after_keypress
|
|
||||||
print #press_a_key_to_continue
|
|
||||||
jsr get_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
|
|
||||||
;init the Time-Of-Day clock - cribbed from http://codebase64.org/doku.php?id=base:initialize_tod_clock_on_all_platforms
|
|
||||||
init_tod:
|
|
||||||
sei
|
|
||||||
lda #0
|
|
||||||
sta $d011 ;Turn off display to disable badlines
|
|
||||||
sta $dc0e ;Set TOD Clock Frequency to 60Hz
|
|
||||||
sta $dc0f ;Enable Set-TOD-Clock
|
|
||||||
sta $dc0b ;Set TOD-Clock to 0 (hours)
|
|
||||||
sta $dc0a ;- (minutes)
|
|
||||||
sta $dc09 ;- (seconds)
|
|
||||||
sta $dc08 ;- (deciseconds)
|
|
||||||
|
|
||||||
lda $dc08 ;
|
|
||||||
.wait_raster
|
|
||||||
cmp $dc08 ;Sync raster to TOD Clock Frequency
|
|
||||||
beq .wait_raster
|
|
||||||
|
|
||||||
ldx #0 ;Prep X and Y for 16 bit
|
|
||||||
ldy #0 ; counter operation
|
|
||||||
lda $dc08 ;Read deciseconds
|
|
||||||
.loop1
|
|
||||||
inx ;2 -+
|
|
||||||
bne .loop2 ;2/3 | Do 16 bit count up on
|
|
||||||
iny ;2 | X(lo) and Y(hi) regs in a
|
|
||||||
jmp .loop3 ;3 | fixed cycle manner
|
|
||||||
.loop2
|
|
||||||
nop ;2 |
|
|
||||||
nop ;2 -+
|
|
||||||
.loop3
|
|
||||||
cmp $dc08 ;4 - Did 1 decisecond pass?
|
|
||||||
beq .loop1 ;3 - If not, loop-di-doop
|
|
||||||
;Each loop = 16 cycles
|
|
||||||
;If less than 118230 cycles passed, TOD is
|
|
||||||
;clocked at 60Hz. If 118230 or more cycles
|
|
||||||
;passed, TOD is clocked at 50Hz.
|
|
||||||
;It might be a good idea to account for a bit
|
|
||||||
;of slack and since every loop is 16 cycles,
|
|
||||||
;28*256 loops = 114688 cycles, which seems to be
|
|
||||||
;acceptable. That means we need to check for
|
|
||||||
;a Y value of 28.
|
|
||||||
|
|
||||||
cpy #28 ;Did 114688 cycles or less go by?
|
|
||||||
bcc .hertz_correct ;- Then we already have correct 60Hz $dc0e value
|
|
||||||
lda #$80 ;Otherwise, we need to set it to 50Hz
|
|
||||||
sta $dc0e
|
|
||||||
.hertz_correct
|
|
||||||
lda #$1b ;Enable the display again
|
|
||||||
sta $d011
|
|
||||||
cli
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
print_errorcode
|
|
||||||
print #error_code
|
|
||||||
nb65call #NB65_GET_LAST_ERROR
|
|
||||||
nb65call #NB65_PRINT_HEX
|
|
||||||
print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
;http callback - will be executed whenever data arrives on the TCP connection
|
|
||||||
http_callback
|
|
||||||
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_GET_INPUT_PACKET_INFO
|
|
||||||
lda nb65_param_buffer+NB65_PAYLOAD_LENGTH+1
|
|
||||||
cmp #$ff
|
|
||||||
bne .not_eof
|
|
||||||
lda #1
|
|
||||||
sta connection_closed
|
|
||||||
rts
|
|
||||||
.not_eof
|
|
||||||
|
|
||||||
lda #"*"
|
|
||||||
jsr print_a
|
|
||||||
ldax nb65_param_buffer+NB65_PAYLOAD_POINTER
|
|
||||||
stax tcp_inbound_data_ptr
|
|
||||||
ldax nb65_param_buffer+NB65_PAYLOAD_LENGTH
|
|
||||||
stax tcp_inbound_data_length
|
|
||||||
|
|
||||||
;copy this chunk to our input buffer
|
|
||||||
ldax tcp_buffer_ptr
|
|
||||||
stax nb65_param_buffer+NB65_BLOCK_DEST
|
|
||||||
ldax tcp_inbound_data_ptr
|
|
||||||
stax nb65_param_buffer+NB65_BLOCK_SRC
|
|
||||||
ldax tcp_inbound_data_length
|
|
||||||
stax nb65_param_buffer+NB65_BLOCK_SIZE
|
|
||||||
ldaxi #nb65_param_buffer
|
|
||||||
nb65call #NB65_BLOCK_COPY
|
|
||||||
|
|
||||||
|
|
||||||
;increment the pointer into the input buffer
|
|
||||||
clc
|
|
||||||
lda tcp_buffer_ptr
|
|
||||||
adc tcp_inbound_data_length
|
|
||||||
sta tcp_buffer_ptr
|
|
||||||
sta temp_ptr
|
|
||||||
lda tcp_buffer_ptr+1
|
|
||||||
adc tcp_inbound_data_length+1
|
|
||||||
sta tcp_buffer_ptr+1
|
|
||||||
sta temp_ptr
|
|
||||||
|
|
||||||
;put a null byte at the end (assumes we have set temp_ptr already)
|
|
||||||
lda #0
|
|
||||||
tay
|
|
||||||
sta (temp_ptr),y
|
|
||||||
|
|
||||||
;look for CR or LF in input
|
|
||||||
sta found_eol
|
|
||||||
ldaxi #scratch_buffer
|
|
||||||
stax get_next_byte+1
|
|
||||||
|
|
||||||
.look_for_eol
|
|
||||||
jsr get_next_byte
|
|
||||||
cmp #$0a
|
|
||||||
beq .found_eol
|
|
||||||
cmp #$0d
|
|
||||||
bne .not_eol
|
|
||||||
.found_eol
|
|
||||||
inc found_eol
|
|
||||||
rts
|
|
||||||
.not_eol
|
|
||||||
cmp #0
|
|
||||||
bne .look_for_eol
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;constants
|
|
||||||
nb65_api_not_found_message dc.b "ERROR - NB65 API NOT FOUND.",13,0
|
|
||||||
incorrect_version dc.b "ERROR - NB65 API MUST BE AT LEAST VERSION 2.",13,0
|
|
||||||
|
|
||||||
nb65_signature dc.b $4E,$42,$36,$35 ; "NB65" - API signature
|
|
||||||
initializing dc.b "INITIALIZING ",13,0
|
|
||||||
error_code dc.b "ERROR CODE: $",0
|
|
||||||
error_while_waiting dc.b "ERROR WHILE "
|
|
||||||
waiting dc.b "WAITING FOR CLIENT CONNECTION",13,0
|
|
||||||
press_a_key_to_continue dc.b "PRESS ANY KEY TO CONTINUE",0
|
|
||||||
mode dc.b " MODE",13,0
|
|
||||||
disconnected dc.b 13,"CONNECTION CLOSED",13,0
|
|
||||||
failed dc.b "FAILED ", 0
|
|
||||||
ok dc.b "OK ", 0
|
|
||||||
timeout dc.b 13,"CONNECTION TIMEOUT ",13, 0
|
|
||||||
|
|
||||||
transmission_error dc.b "ERROR WHILE SENDING ",0
|
|
||||||
http: dc.b "HTTP: ",0
|
|
||||||
gopher: dc.b "GOPHER: ",0
|
|
||||||
;self modifying code
|
|
||||||
get_next_byte
|
|
||||||
lda $ffff
|
|
||||||
inc get_next_byte+1
|
|
||||||
bne .skip
|
|
||||||
inc get_next_byte+2
|
|
||||||
.skip
|
|
||||||
rts
|
|
||||||
|
|
||||||
reset_output_buffer
|
|
||||||
sta emit_a+1
|
|
||||||
stx emit_a+2
|
|
||||||
lda #0
|
|
||||||
sta output_buffer_length
|
|
||||||
sta output_buffer_length+1
|
|
||||||
rts
|
|
||||||
|
|
||||||
emit_a
|
|
||||||
sta $ffff
|
|
||||||
inc emit_a+1
|
|
||||||
bne .1
|
|
||||||
inc emit_a+2
|
|
||||||
.1
|
|
||||||
inc output_buffer_length
|
|
||||||
bne .2
|
|
||||||
inc output_buffer_length+1
|
|
||||||
.2
|
|
||||||
rts
|
|
||||||
|
|
||||||
;variables
|
|
||||||
protocol ds.b 1
|
|
||||||
connection_closed ds.b 1
|
|
||||||
connection_timeout_seconds ds.b 1
|
|
||||||
found_eol ds.b 1
|
|
||||||
nb65_param_buffer DS.B $20
|
|
||||||
tcp_buffer_ptr ds.b 2
|
|
||||||
scan_ptr ds.b 2
|
|
||||||
tcp_inbound_data_ptr ds.b 2
|
|
||||||
tcp_inbound_data_length ds.b 2
|
|
||||||
output_buffer_length: ds.b 2
|
|
||||||
selector: ds.b $100
|
|
||||||
scratch_buffer: ds.b $1000
|
|
||||||
index_html_buffer: ds.b $1000
|
|
||||||
index_html_buffer_length: ds.b 2
|
|
||||||
gopher_map_buffer: ds.b $1000
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR httpd.asm --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,324 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/kipper_constants.i"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
print_a = $ffd2
|
|
||||||
|
|
||||||
.import ascii_to_native
|
|
||||||
|
|
||||||
.macro kippercall function_number
|
|
||||||
ldy function_number
|
|
||||||
jsr KPR_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
temp_buff: .res 2
|
|
||||||
pptr: .res 2
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
.import cls
|
|
||||||
jsr cls
|
|
||||||
lda #14
|
|
||||||
jsr print_a ;switch to lower case
|
|
||||||
|
|
||||||
ldax #KPR_CART_SIGNATURE ;where signature should be in cartridge (if cart is banked in)
|
|
||||||
look_for_signature:
|
|
||||||
stax temp_buff
|
|
||||||
ldy #5
|
|
||||||
@check_one_byte:
|
|
||||||
lda (temp_buff),y
|
|
||||||
cmp kipper_signature,y
|
|
||||||
bne @bad_match
|
|
||||||
dey
|
|
||||||
bpl @check_one_byte
|
|
||||||
jmp @found_kipper_signature
|
|
||||||
|
|
||||||
@bad_match:
|
|
||||||
ldax #kipper_api_not_found_message
|
|
||||||
jsr print
|
|
||||||
rts
|
|
||||||
@found_kipper_signature:
|
|
||||||
ldax #init_msg
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_INITIALIZE
|
|
||||||
bcc @init_ok
|
|
||||||
jsr print_cr
|
|
||||||
ldax #failed_msg
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
@init_ok:
|
|
||||||
;if we got here, we have found the KIPPER API and initialised the IP stack
|
|
||||||
jsr print_ok
|
|
||||||
jsr print_cr
|
|
||||||
ldax #connecting_msg
|
|
||||||
jsr print
|
|
||||||
jsr connect_to_irc
|
|
||||||
bcc @connect_ok
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
@connect_ok:
|
|
||||||
|
|
||||||
jsr print_ok
|
|
||||||
jsr print_cr
|
|
||||||
jsr send_nick
|
|
||||||
jsr send_user
|
|
||||||
jsr send_join
|
|
||||||
|
|
||||||
@endless_loop:
|
|
||||||
jsr KPR_PERIODIC_PROCESSING_VECTOR
|
|
||||||
jmp @endless_loop
|
|
||||||
|
|
||||||
print_ok:
|
|
||||||
ldax #ok_msg
|
|
||||||
jmp print
|
|
||||||
|
|
||||||
reset_after_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print
|
|
||||||
@wait_key:
|
|
||||||
jsr $f142 ;not officially documented - where F13E (GETIN) falls through to if device # is 0 (KEYBD)
|
|
||||||
beq @wait_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
print_errorcode:
|
|
||||||
ldax #error_code
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_GET_LAST_ERROR
|
|
||||||
kippercall #KPR_PRINT_HEX
|
|
||||||
jmp print_cr
|
|
||||||
|
|
||||||
|
|
||||||
print:
|
|
||||||
sta pptr
|
|
||||||
stx pptr + 1
|
|
||||||
|
|
||||||
@print_loop:
|
|
||||||
ldy #0
|
|
||||||
lda (pptr),y
|
|
||||||
beq @done_print
|
|
||||||
jsr print_a
|
|
||||||
inc pptr
|
|
||||||
bne @print_loop
|
|
||||||
inc pptr+1
|
|
||||||
bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-)
|
|
||||||
@done_print:
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_cr:
|
|
||||||
lda #13
|
|
||||||
jmp print_a
|
|
||||||
|
|
||||||
|
|
||||||
connect_to_irc:
|
|
||||||
ldax #irc_server
|
|
||||||
stax param_buffer
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_DNS_RESOLVE
|
|
||||||
bcs @exit
|
|
||||||
|
|
||||||
;IP address now set
|
|
||||||
ldax irc_port
|
|
||||||
stax param_buffer+KPR_TCP_PORT
|
|
||||||
ldax #irc_callback
|
|
||||||
stax param_buffer+KPR_TCP_CALLBACK
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_TCP_CONNECT
|
|
||||||
|
|
||||||
@exit:
|
|
||||||
rts
|
|
||||||
|
|
||||||
send_nick:
|
|
||||||
ldx #0
|
|
||||||
:
|
|
||||||
lda nick_msg,x
|
|
||||||
beq :+
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
:
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda nick,y
|
|
||||||
beq :+
|
|
||||||
sta command_buffer,x
|
|
||||||
iny
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
:
|
|
||||||
|
|
||||||
add_crlf_and_send_command:
|
|
||||||
lda #13
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
lda #10
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
txa
|
|
||||||
ldx #0
|
|
||||||
stax param_buffer+KPR_TCP_PAYLOAD_LENGTH
|
|
||||||
ldax #command_buffer
|
|
||||||
stax param_buffer+KPR_TCP_PAYLOAD_POINTER
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_SEND_TCP_PACKET
|
|
||||||
rts
|
|
||||||
|
|
||||||
send_user:
|
|
||||||
ldax #user_msg_length
|
|
||||||
stax param_buffer+KPR_TCP_PAYLOAD_LENGTH
|
|
||||||
ldax #user_msg
|
|
||||||
stax param_buffer+KPR_TCP_PAYLOAD_POINTER
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_SEND_TCP_PACKET
|
|
||||||
rts
|
|
||||||
|
|
||||||
send_join:
|
|
||||||
ldx #0
|
|
||||||
:
|
|
||||||
lda join_msg,x
|
|
||||||
beq :+
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
:
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda irc_channel,y
|
|
||||||
beq :+
|
|
||||||
sta command_buffer,x
|
|
||||||
iny
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
:
|
|
||||||
|
|
||||||
jmp add_crlf_and_send_command
|
|
||||||
|
|
||||||
irc_callback:
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_GET_INPUT_PACKET_INFO
|
|
||||||
lda param_buffer+KPR_PAYLOAD_LENGTH+1
|
|
||||||
cmp #$ff
|
|
||||||
bne @not_eof
|
|
||||||
rts
|
|
||||||
@not_eof:
|
|
||||||
ldax param_buffer+KPR_PAYLOAD_POINTER
|
|
||||||
stax pptr
|
|
||||||
ldax param_buffer+KPR_PAYLOAD_LENGTH
|
|
||||||
stax input_length
|
|
||||||
:
|
|
||||||
|
|
||||||
@print_loop:
|
|
||||||
ldy #0
|
|
||||||
lda (pptr),y
|
|
||||||
jsr ascii_to_native
|
|
||||||
jsr print_a
|
|
||||||
dec input_length
|
|
||||||
lda input_length
|
|
||||||
cmp #$ff
|
|
||||||
bne :+
|
|
||||||
dec input_length+1
|
|
||||||
lda input_length
|
|
||||||
cmp #$ff
|
|
||||||
beq @done_print
|
|
||||||
:
|
|
||||||
inc pptr
|
|
||||||
bne @print_loop
|
|
||||||
inc pptr+1
|
|
||||||
bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-)
|
|
||||||
@done_print:
|
|
||||||
rts
|
|
||||||
|
|
||||||
.bss
|
|
||||||
param_buffer: .res 20
|
|
||||||
command_buffer: .res 256
|
|
||||||
input_length: .res 2
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
irc_server:
|
|
||||||
;.byte "irc.newnet.net",0
|
|
||||||
.byte "jamtronix.com",0
|
|
||||||
irc_port:
|
|
||||||
.word 6667
|
|
||||||
irc_channel:
|
|
||||||
.byte "#foo",0
|
|
||||||
|
|
||||||
|
|
||||||
nick_msg:
|
|
||||||
.byte "NICK ",0
|
|
||||||
|
|
||||||
nick:
|
|
||||||
.byte "kipper_nick2",0
|
|
||||||
|
|
||||||
join_msg:
|
|
||||||
.byte "JOIN ",0
|
|
||||||
|
|
||||||
user_msg:
|
|
||||||
.byte "USER kipper 0 unused :A Kipper User",13,10
|
|
||||||
user_msg_length=*-user_msg
|
|
||||||
|
|
||||||
kipper_api_not_found_message:
|
|
||||||
.byte "ERROR - KIPPER API NOT FOUND.",13,0
|
|
||||||
|
|
||||||
failed_msg:
|
|
||||||
.byte "FAILED", 0
|
|
||||||
|
|
||||||
ok_msg:
|
|
||||||
.byte "OK", 0
|
|
||||||
init_msg:
|
|
||||||
.byte "INITIALIZING ",0
|
|
||||||
connecting_msg:
|
|
||||||
.byte "CONNECTING ",0
|
|
||||||
|
|
||||||
press_a_key_to_continue:
|
|
||||||
.byte "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
|
|
||||||
kipper_signature:
|
|
||||||
.byte $4B,$49,$50,$50,$45,$52 ; "KIPPER"
|
|
||||||
|
|
||||||
error_code:
|
|
||||||
.asciiz "ERROR CODE: "
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR irc.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,37 +0,0 @@
|
||||||
f=File.open("sine_data.i","w")
|
|
||||||
|
|
||||||
TABLE_ENTRIES=0x80
|
|
||||||
AMPLITUDE=255
|
|
||||||
OFFSET=00
|
|
||||||
|
|
||||||
TABLE_ENTRIES.times do |i|
|
|
||||||
value=OFFSET+Math.sin(Math::PI*i.to_f/TABLE_ENTRIES.to_f)*AMPLITUDE
|
|
||||||
if i%0x08==0
|
|
||||||
f<<"\n.byte "
|
|
||||||
else
|
|
||||||
f<<", "
|
|
||||||
end
|
|
||||||
f<<"$%02x" % value
|
|
||||||
end
|
|
||||||
|
|
||||||
f.close
|
|
||||||
|
|
||||||
|
|
||||||
#-- LICENSE FOR make_sine_data.rb --
|
|
||||||
# The contents of this file are subject to the Mozilla Public License
|
|
||||||
# Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
# compliance with the License. You may obtain a copy of the License at
|
|
||||||
# http://www.mozilla.org/MPL/
|
|
||||||
#
|
|
||||||
# Software distributed under the License is distributed on an "AS IS"
|
|
||||||
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
# License for the specific language governing rights and limitations
|
|
||||||
# under the License.
|
|
||||||
#
|
|
||||||
# The Original Code is ip65.
|
|
||||||
#
|
|
||||||
# The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
# jonno@jamtronix.com.
|
|
||||||
# Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
# Jonno Downes. All Rights Reserved.
|
|
||||||
# -- LICENSE END --
|
|
Binary file not shown.
|
@ -1,293 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
print_a = $ffd2
|
|
||||||
|
|
||||||
|
|
||||||
SCREEN_RAM = $0400
|
|
||||||
COLOUR_RAM = $d800
|
|
||||||
VIC_CTRL_A = $d011
|
|
||||||
VIC_RASTER_REG = $d012
|
|
||||||
VIC_CTRL_B = $d016
|
|
||||||
VIC_MEMORY_CTRL=$d018
|
|
||||||
VIC_IRQ_FLAG = $d019
|
|
||||||
|
|
||||||
|
|
||||||
IRQ_VECTOR=$314
|
|
||||||
|
|
||||||
BORDER_COLOR = $d020
|
|
||||||
BACKGROUND_COLOR_0 = $d021
|
|
||||||
SCROLL_DELAY=4
|
|
||||||
CHARS_PER_LINE = 40
|
|
||||||
SCROLL_LINE=12
|
|
||||||
SCROLL_RAM = SCREEN_RAM+(SCROLL_LINE*CHARS_PER_LINE)
|
|
||||||
|
|
||||||
TOP_BORDER_SCAN_LINES = 50
|
|
||||||
|
|
||||||
|
|
||||||
BLACK = 0
|
|
||||||
WHITE = 1
|
|
||||||
RED = 2
|
|
||||||
CYAN = 3
|
|
||||||
PURPLE = 4
|
|
||||||
GREEN = 5
|
|
||||||
BLUE = 6
|
|
||||||
YELLOW = 7
|
|
||||||
ORANGE = 8
|
|
||||||
BROWN = 9
|
|
||||||
LIGHT_RED = 10
|
|
||||||
DARK_GRAY = 11
|
|
||||||
GRAY = 12
|
|
||||||
LIGHT_GREEN = 13
|
|
||||||
LIGHT_BLUE = 14
|
|
||||||
LIGHT_GRAY = 15
|
|
||||||
|
|
||||||
|
|
||||||
.macro wait_next_raster
|
|
||||||
lda VIC_RASTER_REG
|
|
||||||
:
|
|
||||||
cmp VIC_RASTER_REG
|
|
||||||
beq :-
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
temp_buff: .res 2
|
|
||||||
pptr: .res 2
|
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.code
|
|
||||||
init:
|
|
||||||
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
jsr clear_screen
|
|
||||||
lda #DARK_GRAY
|
|
||||||
sta BORDER_COLOR
|
|
||||||
lda #YELLOW
|
|
||||||
sta BACKGROUND_COLOR_0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sei ;disable maskable IRQs
|
|
||||||
|
|
||||||
lda #$7f
|
|
||||||
sta $dc0d ;disable timer interrupts which can be generated by the two CIA chips
|
|
||||||
sta $dd0d ;the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
|
|
||||||
;stop it.
|
|
||||||
|
|
||||||
lda $dc0d ;by reading this two registers we negate any pending CIA irqs.
|
|
||||||
lda $dd0d ;if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
|
|
||||||
;we don't want that to happen.
|
|
||||||
|
|
||||||
lda #$01 ;this is how to tell the VICII to generate a raster interrupt
|
|
||||||
sta $d01a
|
|
||||||
|
|
||||||
lda #$00 ;this is how to tell at which rasterline we want the irq to be triggered
|
|
||||||
sta VIC_RASTER_REG
|
|
||||||
|
|
||||||
ldax IRQ_VECTOR
|
|
||||||
stax old_irq
|
|
||||||
jsr set_next_irq_jump
|
|
||||||
cli ;enable maskable interrupts again
|
|
||||||
|
|
||||||
lda #23
|
|
||||||
@endless_loop:
|
|
||||||
nop
|
|
||||||
inc $ff
|
|
||||||
inc $400
|
|
||||||
tsx
|
|
||||||
stx $410
|
|
||||||
sta $411
|
|
||||||
ldy #$80
|
|
||||||
:
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
jmp @endless_loop
|
|
||||||
|
|
||||||
|
|
||||||
clear_screen:
|
|
||||||
|
|
||||||
ldx #$00
|
|
||||||
lda #$41
|
|
||||||
|
|
||||||
:
|
|
||||||
sta SCREEN_RAM,x
|
|
||||||
sta SCREEN_RAM+$100,x
|
|
||||||
sta SCREEN_RAM+$200,x
|
|
||||||
sta SCREEN_RAM+$300,x
|
|
||||||
sta COLOUR_RAM,x
|
|
||||||
sta COLOUR_RAM+$100,x
|
|
||||||
sta COLOUR_RAM+$200,x
|
|
||||||
sta COLOUR_RAM+$300,x
|
|
||||||
|
|
||||||
dex
|
|
||||||
bne :-
|
|
||||||
rts
|
|
||||||
|
|
||||||
set_next_irq_jump:
|
|
||||||
inc jump_counter
|
|
||||||
|
|
||||||
lda jump_counter
|
|
||||||
asl
|
|
||||||
asl
|
|
||||||
load_next_raster_entry:
|
|
||||||
tax
|
|
||||||
lda raster_jump_table,x ;bit 9 of raster to trigger on
|
|
||||||
|
|
||||||
cmp #$ff
|
|
||||||
bne not_last_entry
|
|
||||||
lda #0
|
|
||||||
sta jump_counter
|
|
||||||
jmp load_next_raster_entry
|
|
||||||
not_last_entry:
|
|
||||||
ora #$18 ;turn on bits 3 & 4
|
|
||||||
sta VIC_CTRL_A
|
|
||||||
lda raster_jump_table+1,x ;bits 0..7 of raster to trigger on
|
|
||||||
sta VIC_RASTER_REG
|
|
||||||
lda raster_jump_table+2,x ;LSB of IRQ handler
|
|
||||||
sta IRQ_VECTOR
|
|
||||||
lda raster_jump_table+3,x ;LSB of IRQ handler
|
|
||||||
sta IRQ_VECTOR+1
|
|
||||||
rts
|
|
||||||
|
|
||||||
exit_from_irq:
|
|
||||||
jsr set_next_irq_jump
|
|
||||||
jmp_to_original_irq_handler:
|
|
||||||
lda #$ff ;this is the orthodox and safe way of clearing the interrupt condition of the VICII.
|
|
||||||
sta VIC_IRQ_FLAG;if you don't do this the interrupt condition will be present all the time and you end
|
|
||||||
;up having the CPU running the interrupt code all the time, as when it exists the
|
|
||||||
;interrupt, the interrupt request from the VICII will be there again regardless of the
|
|
||||||
;rasterline counter.
|
|
||||||
|
|
||||||
old_irq = * + 1 ; Placeholder for self-modifying code
|
|
||||||
jmp $ffff
|
|
||||||
|
|
||||||
raster_irq:
|
|
||||||
|
|
||||||
ldax #synchronised_irq
|
|
||||||
stax IRQ_VECTOR
|
|
||||||
nop ; waste at least 12 cycles
|
|
||||||
nop ; (up to 64 cycles delay allowed here)
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
inc VIC_RASTER_REG ; At this stage, we have already moved to the next line
|
|
||||||
lda #1
|
|
||||||
sta VIC_IRQ_FLAG ; acknowledge the first raster interrupt
|
|
||||||
cli ; enable interrupts (the second interrupt can now occur)
|
|
||||||
ldy #9
|
|
||||||
dey
|
|
||||||
bne *-1 ; delay
|
|
||||||
nop ; The second interrupt will occur while executing these
|
|
||||||
nop ; two-cycle instructions.
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
|
|
||||||
jmp jmp_to_original_irq_handler
|
|
||||||
|
|
||||||
synchronised_irq:
|
|
||||||
|
|
||||||
ldx VIC_RASTER_REG
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
bit $24 ; 6569, 63 cycles/line
|
|
||||||
|
|
||||||
cpx VIC_RASTER_REG ; The comparison cycle is executed CYCLES or CYCLES+1 cycles
|
|
||||||
; after the interrupt has occurred.
|
|
||||||
beq :+ ; Delay by one cycle if $d012 hadn't changed.
|
|
||||||
; Now exactly CYCLES+3 cycles have passed since the interrupt
|
|
||||||
:
|
|
||||||
|
|
||||||
;now got a stable raster
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
inc BORDER_COLOR
|
|
||||||
inc BACKGROUND_COLOR_0
|
|
||||||
|
|
||||||
ldx #20
|
|
||||||
@loop:
|
|
||||||
wait_next_raster
|
|
||||||
dex
|
|
||||||
bne @loop
|
|
||||||
dec BORDER_COLOR
|
|
||||||
dec BACKGROUND_COLOR_0
|
|
||||||
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
raster_jump_table:
|
|
||||||
;format:
|
|
||||||
;offset meaning
|
|
||||||
; $00 BIT 9 OF RASTER TO TRIGGER ON ($00 if bit 8 =0 , $80 if bit 8 =1)
|
|
||||||
; $01 BITS 0..7 OF RASTER TO TRIGGER ON
|
|
||||||
; $02 LSB OF ROUTINE TO JUMP TO
|
|
||||||
; $03 MSB OF ROUTINE TO JUMP TO
|
|
||||||
;table needs to end with a single byte $ff
|
|
||||||
;table needs to be sorted by scanlines
|
|
||||||
; .byte $0,$01
|
|
||||||
; .word scroll_text_irq
|
|
||||||
.byte $0,$81
|
|
||||||
.word raster_irq
|
|
||||||
|
|
||||||
; .byte $0,$80
|
|
||||||
; .word raster_irq
|
|
||||||
.byte $ff ;end of list
|
|
||||||
|
|
||||||
jump_counter: .byte 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR raster.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,250 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
|
|
||||||
.import cfg_get_configuration_ptr
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import ascii_to_native
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
lda #14
|
|
||||||
jsr print_a
|
|
||||||
ldax #included_sid_length
|
|
||||||
stax sidfile_length
|
|
||||||
ldax #sid_data
|
|
||||||
jsr load_sid
|
|
||||||
bcc @ok
|
|
||||||
ldax #error
|
|
||||||
jmp print
|
|
||||||
@ok:
|
|
||||||
lda default_song
|
|
||||||
jsr init_song
|
|
||||||
jsr install_irq_handler
|
|
||||||
@loop:
|
|
||||||
jmp @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
load_sid:
|
|
||||||
stax sidfile_address
|
|
||||||
stax copy_src
|
|
||||||
|
|
||||||
ldy #1
|
|
||||||
lda (copy_src),y
|
|
||||||
cmp #'S' ;make sure the file starts with 'PSID' or 'RSID'
|
|
||||||
beq @ok
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
@ok:
|
|
||||||
ldy #7
|
|
||||||
lda (copy_src),y
|
|
||||||
sta header_length
|
|
||||||
|
|
||||||
inc header_length
|
|
||||||
inc header_length
|
|
||||||
|
|
||||||
tay
|
|
||||||
;y now points to the start of the real c64 file
|
|
||||||
lda (copy_src),y
|
|
||||||
sta copy_dest
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta copy_dest+1
|
|
||||||
|
|
||||||
ldy #$0a
|
|
||||||
lda (copy_src),y
|
|
||||||
sta init_song+2
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta init_song+1
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta play_song+2
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta play_song+1
|
|
||||||
|
|
||||||
ldy #$0f
|
|
||||||
lda (copy_src),y
|
|
||||||
sta number_of_songs
|
|
||||||
|
|
||||||
ldy #$11
|
|
||||||
lda (copy_src),y
|
|
||||||
sta default_song
|
|
||||||
|
|
||||||
ldy #$16
|
|
||||||
jsr print_ascii_string
|
|
||||||
|
|
||||||
ldy #$36
|
|
||||||
jsr print_ascii_string
|
|
||||||
ldy #$56
|
|
||||||
jsr print_ascii_string
|
|
||||||
|
|
||||||
ldax #songs
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
lda number_of_songs
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #init_address
|
|
||||||
jsr print
|
|
||||||
lda init_song+2
|
|
||||||
jsr print_hex
|
|
||||||
lda init_song+1
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #play_address
|
|
||||||
jsr print
|
|
||||||
lda play_song+2
|
|
||||||
jsr print_hex
|
|
||||||
lda play_song+1
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax sidfile_address
|
|
||||||
stax copy_src
|
|
||||||
|
|
||||||
|
|
||||||
clc
|
|
||||||
lda sidfile_address
|
|
||||||
adc header_length
|
|
||||||
pha
|
|
||||||
lda sidfile_address+1
|
|
||||||
adc #0
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
stax copy_src
|
|
||||||
sec
|
|
||||||
lda sidfile_length
|
|
||||||
sbc header_length
|
|
||||||
pha
|
|
||||||
lda sidfile_length+1
|
|
||||||
sbc #0
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
install_irq_handler:
|
|
||||||
ldax $314 ;previous IRQ handler
|
|
||||||
stax jmp_old_irq+1
|
|
||||||
sei ;don't want any interrupts while we fiddle with the vector
|
|
||||||
ldax #irq_handler
|
|
||||||
stax $314 ;previous IRQ handler
|
|
||||||
sta irq_handler_installed_flag
|
|
||||||
cli
|
|
||||||
rts
|
|
||||||
|
|
||||||
irq_handler:
|
|
||||||
lda $d012
|
|
||||||
cmp #100
|
|
||||||
bne irq_handler
|
|
||||||
lda $01
|
|
||||||
pha
|
|
||||||
lda #$35
|
|
||||||
sta $01
|
|
||||||
|
|
||||||
inc $d020
|
|
||||||
jsr play_song
|
|
||||||
dec $d020
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta $01
|
|
||||||
jmp jmp_old_irq
|
|
||||||
|
|
||||||
|
|
||||||
print_ascii_string:
|
|
||||||
:
|
|
||||||
lda (copy_src),y
|
|
||||||
beq :+
|
|
||||||
jsr ascii_to_native
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
:
|
|
||||||
jmp print_cr
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
|
||||||
number_of_songs: .res 1
|
|
||||||
default_song: .res 1
|
|
||||||
sidfile_address: .res 2
|
|
||||||
header_length: .res 1
|
|
||||||
sidfile_length: .res 2
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
songs:
|
|
||||||
.byte "SONGS $",0
|
|
||||||
error:
|
|
||||||
.byte "ERROR",13,0
|
|
||||||
init_address:
|
|
||||||
.byte "LOAD ADDRESS $",0
|
|
||||||
play_address:
|
|
||||||
.byte "PLAY ADDRESS $",0
|
|
||||||
|
|
||||||
sid_data:
|
|
||||||
;.incbin "Melonix.sid"
|
|
||||||
; .incbin "Power_Train.sid"
|
|
||||||
; .incbin "Y-Out.sid"
|
|
||||||
.incbin "outlaw.sid"
|
|
||||||
|
|
||||||
included_sid_length=*-sid_data
|
|
||||||
.data
|
|
||||||
|
|
||||||
irq_handler_installed_flag: .byte 0
|
|
||||||
|
|
||||||
init_song:
|
|
||||||
jmp $ffff
|
|
||||||
play_song:
|
|
||||||
jmp $ffff
|
|
||||||
jmp_old_irq:
|
|
||||||
jmp $ffff
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR sidplay.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,122 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
|
|
||||||
.import cfg_get_configuration_ptr
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import ascii_to_native
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
init_song=$1000
|
|
||||||
play_song=$1003
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldax #sid_data+2
|
|
||||||
stax copy_src
|
|
||||||
|
|
||||||
ldax $4000
|
|
||||||
stax copy_dest
|
|
||||||
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
|
|
||||||
ldax $4000
|
|
||||||
stax copy_src
|
|
||||||
|
|
||||||
ldax $1000
|
|
||||||
stax copy_dest
|
|
||||||
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
jsr init_song
|
|
||||||
jsr install_irq_handler
|
|
||||||
@loop:
|
|
||||||
jmp @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
install_irq_handler:
|
|
||||||
ldax $314 ;previous IRQ handler
|
|
||||||
stax jmp_old_irq+1
|
|
||||||
sei ;don't want any interrupts while we fiddle with the vector
|
|
||||||
ldax #irq_handler
|
|
||||||
stax $314 ;previous IRQ handler
|
|
||||||
sta irq_handler_installed_flag
|
|
||||||
cli
|
|
||||||
rts
|
|
||||||
|
|
||||||
irq_handler:
|
|
||||||
inc $d020
|
|
||||||
jsr play_song
|
|
||||||
dec $d020
|
|
||||||
jmp jmp_old_irq
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bss
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
sid_data:
|
|
||||||
;.incbin "Melonix.sid"
|
|
||||||
; .incbin "Power_Train.sid"
|
|
||||||
.incbin "zigzag.prg"
|
|
||||||
|
|
||||||
included_sid_length=*-sid_data
|
|
||||||
.data
|
|
||||||
|
|
||||||
irq_handler_installed_flag: .byte 0
|
|
||||||
|
|
||||||
jmp_old_irq:
|
|
||||||
jmp $ffff
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR sidplay_zigzag.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,37 +0,0 @@
|
||||||
|
|
||||||
.byte $00, $06, $0c, $12, $18, $1f, $25, $2b
|
|
||||||
.byte $31, $37, $3d, $44, $4a, $4f, $55, $5b
|
|
||||||
.byte $61, $67, $6d, $72, $78, $7d, $83, $88
|
|
||||||
.byte $8d, $92, $97, $9c, $a1, $a6, $ab, $af
|
|
||||||
.byte $b4, $b8, $bc, $c1, $c5, $c9, $cc, $d0
|
|
||||||
.byte $d4, $d7, $da, $dd, $e0, $e3, $e6, $e9
|
|
||||||
.byte $eb, $ed, $f0, $f2, $f4, $f5, $f7, $f8
|
|
||||||
.byte $fa, $fb, $fc, $fd, $fd, $fe, $fe, $fe
|
|
||||||
.byte $ff, $fe, $fe, $fe, $fd, $fd, $fc, $fb
|
|
||||||
.byte $fa, $f8, $f7, $f5, $f4, $f2, $f0, $ed
|
|
||||||
.byte $eb, $e9, $e6, $e3, $e0, $dd, $da, $d7
|
|
||||||
.byte $d4, $d0, $cc, $c9, $c5, $c1, $bc, $b8
|
|
||||||
.byte $b4, $af, $ab, $a6, $a1, $9c, $97, $92
|
|
||||||
.byte $8d, $88, $83, $7d, $78, $72, $6d, $67
|
|
||||||
.byte $61, $5b, $55, $4f, $4a, $44, $3d, $37
|
|
||||||
.byte $31, $2b, $25, $1f, $18, $12, $0c, $06
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR sine_data.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,949 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/kipper_constants.i"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
print_a = $ffd2
|
|
||||||
|
|
||||||
|
|
||||||
SCREEN_RAM = $0400
|
|
||||||
COLOUR_RAM = $d800
|
|
||||||
VIC_CTRL_A = $d011
|
|
||||||
VIC_RASTER_REG = $d012
|
|
||||||
VIC_CTRL_B = $d016
|
|
||||||
VIC_MEMORY_CTRL=$d018
|
|
||||||
VIC_IRQ_FLAG = $d019
|
|
||||||
|
|
||||||
|
|
||||||
IRQ_VECTOR=$fffe
|
|
||||||
|
|
||||||
MUSIC_BASE=$1000 ;where we relocate our music routine to
|
|
||||||
PLAYER_INIT=0
|
|
||||||
PLAYER_PLAY=3
|
|
||||||
|
|
||||||
BORDER_COLOR = $d020
|
|
||||||
BACKGROUND_COLOR_0 = $d021
|
|
||||||
SCROLL_DELAY=4
|
|
||||||
CHARS_PER_LINE = 40
|
|
||||||
SCROLL_LINE=12
|
|
||||||
SCROLL_RAM = SCREEN_RAM+(SCROLL_LINE*CHARS_PER_LINE)
|
|
||||||
|
|
||||||
TOP_BORDER_SCAN_LINES = 50
|
|
||||||
|
|
||||||
|
|
||||||
BLACK = 0
|
|
||||||
WHITE = 1
|
|
||||||
RED = 2
|
|
||||||
CYAN = 3
|
|
||||||
PURPLE = 4
|
|
||||||
GREEN = 5
|
|
||||||
BLUE = 6
|
|
||||||
YELLOW = 7
|
|
||||||
ORANGE = 8
|
|
||||||
BROWN = 9
|
|
||||||
LIGHT_RED = 10
|
|
||||||
DARK_GRAY = 11
|
|
||||||
GRAY = 12
|
|
||||||
LIGHT_GREEN = 13
|
|
||||||
LIGHT_BLUE = 14
|
|
||||||
LIGHT_GRAY = 15
|
|
||||||
|
|
||||||
.macro start_irq
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
pha
|
|
||||||
tya
|
|
||||||
pha
|
|
||||||
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
|
|
||||||
.macro end_irq
|
|
||||||
pla
|
|
||||||
tay
|
|
||||||
pla
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro wait_next_raster
|
|
||||||
lda VIC_RASTER_REG
|
|
||||||
@loop:
|
|
||||||
cmp VIC_RASTER_REG
|
|
||||||
beq @loop
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro kippercall function_number
|
|
||||||
ldy function_number
|
|
||||||
jsr KPR_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
temp_buff: .res 2
|
|
||||||
pptr: .res 2
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
ldax #KPR_CART_SIGNATURE ;where signature should be in cartridge (if cart is banked in)
|
|
||||||
look_for_signature:
|
|
||||||
stax temp_buff
|
|
||||||
ldy #5
|
|
||||||
@check_one_byte:
|
|
||||||
lda (temp_buff),y
|
|
||||||
cmp kipper_signature,y
|
|
||||||
bne @bad_match
|
|
||||||
dey
|
|
||||||
bpl @check_one_byte
|
|
||||||
jmp @found_kipper_signature
|
|
||||||
|
|
||||||
@bad_match:
|
|
||||||
ldax #kipper_api_not_found_message
|
|
||||||
jsr print
|
|
||||||
@loop:
|
|
||||||
jmp @loop
|
|
||||||
rts
|
|
||||||
@found_kipper_signature:
|
|
||||||
|
|
||||||
ldax #init_msg
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_INITIALIZE
|
|
||||||
bcc @init_ok
|
|
||||||
jsr print_cr
|
|
||||||
ldax #failed_msg
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
@init_ok:
|
|
||||||
|
|
||||||
;if we got here, we have found the KIPPER API and initialised the IP stack
|
|
||||||
|
|
||||||
;try and load the config file
|
|
||||||
ldax #read_url_file_param_buffer
|
|
||||||
kippercall #KPR_FILE_LOAD
|
|
||||||
bcs @use_default_url
|
|
||||||
clc
|
|
||||||
lda #0
|
|
||||||
ldy read_url_file_param_buffer+KPR_FILE_ACCESS_FILESIZE
|
|
||||||
sta feed_url,y ;put a zero at the end of the URL
|
|
||||||
|
|
||||||
@use_default_url:
|
|
||||||
jsr setup_static_scroll_text
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
jsr clear_screen
|
|
||||||
lda #DARK_GRAY
|
|
||||||
sta BORDER_COLOR
|
|
||||||
lda #YELLOW
|
|
||||||
sta BACKGROUND_COLOR_0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;copy our music data up to a temp buffer (in case it gets overwritten by
|
|
||||||
;one of the other unpacking moves)
|
|
||||||
ldax #musicdata+2 ;skip over the 2 byte address
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #download_buffer
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #musicdata_size-2 ;don't copy the 2 byte address
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
;copy our font data and the sprite data to $2000..$2fff
|
|
||||||
ldax #charset_font
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #$2000
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #MUSIC_BASE
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
;should now be now safe to copy the music data back down
|
|
||||||
;copy our music data to $1000..$1fff
|
|
||||||
ldax #download_buffer
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #MUSIC_BASE
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #musicdata_size-2 ;don't copy the 2 byte address
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
lda #$18 ; use charset at $2000
|
|
||||||
sta VIC_MEMORY_CTRL
|
|
||||||
|
|
||||||
|
|
||||||
sei ;disable maskable IRQs
|
|
||||||
|
|
||||||
lda #$7f
|
|
||||||
sta $dc0d ;disable timer interrupts which can be generated by the two CIA chips
|
|
||||||
sta $dd0d ;the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
|
|
||||||
;stop it.
|
|
||||||
|
|
||||||
lda $dc0d ;by reading this two registers we negate any pending CIA irqs.
|
|
||||||
lda $dd0d ;if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
|
|
||||||
;we don't want that to happen.
|
|
||||||
|
|
||||||
lda #$01 ;this is how to tell the VICII to generate a raster interrupt
|
|
||||||
sta $d01a
|
|
||||||
|
|
||||||
lda #$00 ;this is how to tell at which rasterline we want the irq to be triggered
|
|
||||||
sta VIC_RASTER_REG
|
|
||||||
|
|
||||||
|
|
||||||
;copy KERNAL to the RAM underneath, in case any ip65 routines need it
|
|
||||||
ldax #$e000
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #$1FFF
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
;copy KIPPER cart to the RAM underneath, so we can swap it out and modify the IRQ vector
|
|
||||||
ldax #$8000
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #$4000
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
|
|
||||||
lda #$35 ;we turn off the BASIC and KERNAL rom here, so we can overwrite the IRQ vector at $fffe
|
|
||||||
sta $01 ;the cpu now sees RAM everywhere except at $d000-$e000, where still the registers of
|
|
||||||
;SID/VICII/etc are visible
|
|
||||||
|
|
||||||
jsr setup_sprites
|
|
||||||
|
|
||||||
jsr setup_music
|
|
||||||
|
|
||||||
|
|
||||||
jsr set_next_irq_jump
|
|
||||||
cli ;enable maskable interrupts again
|
|
||||||
|
|
||||||
|
|
||||||
lda #3
|
|
||||||
sta scroll_state
|
|
||||||
;position for the first text
|
|
||||||
|
|
||||||
jsr reset_input_buffer
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta scroll_buffer_1 ;set this buffer to be an empty string, in case we try to scroll it
|
|
||||||
|
|
||||||
;now download the feed
|
|
||||||
@download_feed:
|
|
||||||
|
|
||||||
ldax #feed_url
|
|
||||||
stax param_buffer+KPR_URL
|
|
||||||
ldax #download_buffer
|
|
||||||
stax param_buffer+KPR_URL_DOWNLOAD_BUFFER
|
|
||||||
ldax #download_buffer_length
|
|
||||||
stax param_buffer+KPR_URL_DOWNLOAD_BUFFER_LENGTH
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_DOWNLOAD_RESOURCE
|
|
||||||
|
|
||||||
bcs @download_feed ;if at first we don't succeed, try try again
|
|
||||||
|
|
||||||
inc BORDER_COLOR ;little marker of success
|
|
||||||
|
|
||||||
|
|
||||||
lda #2
|
|
||||||
sta scroll_state
|
|
||||||
|
|
||||||
ldax #scroll_buffer_1
|
|
||||||
stax current_output_ptr
|
|
||||||
jsr emit_titles
|
|
||||||
|
|
||||||
|
|
||||||
@endless_loop:
|
|
||||||
jsr KPR_PERIODIC_PROCESSING_VECTOR
|
|
||||||
lda scroll_state
|
|
||||||
beq @download_feed
|
|
||||||
jmp @endless_loop
|
|
||||||
|
|
||||||
reset_input_buffer:
|
|
||||||
|
|
||||||
lda scroll_state
|
|
||||||
beq @config_scroller
|
|
||||||
dec scroll_state
|
|
||||||
cmp #1
|
|
||||||
beq @feed_scroller
|
|
||||||
cmp #3
|
|
||||||
beq @title_scroller
|
|
||||||
@config_scroller:
|
|
||||||
ldax #scroll_buffer_0
|
|
||||||
stax current_input_ptr
|
|
||||||
rts
|
|
||||||
|
|
||||||
@feed_scroller:
|
|
||||||
ldax #scroll_buffer_1
|
|
||||||
stax current_input_ptr
|
|
||||||
rts
|
|
||||||
@title_scroller:
|
|
||||||
ldax #static_title
|
|
||||||
stax current_input_ptr
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;set up the tune
|
|
||||||
setup_music:
|
|
||||||
lda #$00 ;init subtune 0
|
|
||||||
jsr MUSIC_BASE+PLAYER_INIT
|
|
||||||
rts
|
|
||||||
|
|
||||||
setup_sprites:
|
|
||||||
|
|
||||||
;turn on all 8 sprites
|
|
||||||
lda #$FF
|
|
||||||
sta $d015
|
|
||||||
|
|
||||||
ldx #$07
|
|
||||||
@setup_sprite:
|
|
||||||
;position each sprite
|
|
||||||
txa
|
|
||||||
asl
|
|
||||||
tay
|
|
||||||
lda sprite_x_pos,x
|
|
||||||
sta $d000,y ;sprite 0 X pos (LSB)
|
|
||||||
lda #0
|
|
||||||
sta $d001,y ;sprite 0 Y pos
|
|
||||||
|
|
||||||
;colour sprite 0
|
|
||||||
lda #BLUE
|
|
||||||
sta $d027,x ;sprite 0 color
|
|
||||||
|
|
||||||
;select bitmap for sprite
|
|
||||||
sec
|
|
||||||
lda sprite_text,x
|
|
||||||
sbc #'A'
|
|
||||||
clc
|
|
||||||
adc #<($2800/64) ;sprite font should be relocated to $2000
|
|
||||||
sta SCREEN_RAM+$03f8,x
|
|
||||||
dex
|
|
||||||
bpl @setup_sprite
|
|
||||||
|
|
||||||
lda sprite_x_msb
|
|
||||||
sta $d010
|
|
||||||
|
|
||||||
;turn on multicolor mode for all 8 sprites
|
|
||||||
lda #$FF
|
|
||||||
sta $d01c
|
|
||||||
|
|
||||||
sta sprite_ticker
|
|
||||||
|
|
||||||
lda #DARK_GRAY
|
|
||||||
sta $d025 ;sprite multicolor register 0
|
|
||||||
lda #LIGHT_GRAY
|
|
||||||
sta $d026 ;sprite multicolor register 1
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
clear_screen:
|
|
||||||
|
|
||||||
ldx #$00
|
|
||||||
lda #$20
|
|
||||||
|
|
||||||
:
|
|
||||||
sta SCREEN_RAM,x
|
|
||||||
sta SCREEN_RAM+$100,x
|
|
||||||
sta SCREEN_RAM+$200,x
|
|
||||||
sta SCREEN_RAM+$300,x
|
|
||||||
sta COLOUR_RAM,x
|
|
||||||
sta COLOUR_RAM+$100,x
|
|
||||||
sta COLOUR_RAM+$200,x
|
|
||||||
sta COLOUR_RAM+$300,x
|
|
||||||
|
|
||||||
dex
|
|
||||||
bne :-
|
|
||||||
rts
|
|
||||||
|
|
||||||
set_next_irq_jump:
|
|
||||||
inc jump_counter
|
|
||||||
|
|
||||||
lda jump_counter
|
|
||||||
asl
|
|
||||||
asl
|
|
||||||
load_next_raster_entry:
|
|
||||||
tax
|
|
||||||
lda raster_jump_table,x ;bit 9 of raster to trigger on
|
|
||||||
|
|
||||||
cmp #$ff
|
|
||||||
bne not_last_entry
|
|
||||||
lda #0
|
|
||||||
sta jump_counter
|
|
||||||
jmp load_next_raster_entry
|
|
||||||
not_last_entry:
|
|
||||||
ora #$18 ;turn on bits 3 & 4
|
|
||||||
sta VIC_CTRL_A
|
|
||||||
lda raster_jump_table+1,x ;bits 0..7 of raster to trigger on
|
|
||||||
sta VIC_RASTER_REG
|
|
||||||
lda raster_jump_table+2,x ;LSB of IRQ handler
|
|
||||||
sta IRQ_VECTOR
|
|
||||||
lda raster_jump_table+3,x ;LSB of IRQ handler
|
|
||||||
sta IRQ_VECTOR+1
|
|
||||||
rts
|
|
||||||
|
|
||||||
exit_from_irq:
|
|
||||||
jsr set_next_irq_jump
|
|
||||||
lda #$ff ;this is the orthodox and safe way of clearing the interrupt condition of the VICII.
|
|
||||||
sta VIC_IRQ_FLAG;if you don't do this the interrupt condition will be present all the time and you end
|
|
||||||
;up having the CPU running the interrupt code all the time, as when it exists the
|
|
||||||
;interrupt, the interrupt request from the VICII will be there again regardless of the
|
|
||||||
;rasterline counter.
|
|
||||||
|
|
||||||
end_irq
|
|
||||||
rti
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
scroll_text_irq:
|
|
||||||
start_irq
|
|
||||||
lda scroll_timer
|
|
||||||
bne done_scrolling_message
|
|
||||||
lda #SCROLL_DELAY
|
|
||||||
sta scroll_timer
|
|
||||||
ldx #1
|
|
||||||
ldy #0
|
|
||||||
scroll_1_char:
|
|
||||||
lda SCROLL_RAM,x
|
|
||||||
sta SCROLL_RAM,y
|
|
||||||
lda SCROLL_RAM+40,x
|
|
||||||
sta SCROLL_RAM+40,y
|
|
||||||
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
cpx #CHARS_PER_LINE
|
|
||||||
bne scroll_1_char
|
|
||||||
|
|
||||||
|
|
||||||
jsr get_a
|
|
||||||
cmp #0
|
|
||||||
beq last_char_in_message
|
|
||||||
sta SCROLL_RAM+CHARS_PER_LINE-1
|
|
||||||
clc
|
|
||||||
adc #$80
|
|
||||||
sta SCROLL_RAM+CHARS_PER_LINE+40-1
|
|
||||||
|
|
||||||
jmp done_scrolling_message
|
|
||||||
|
|
||||||
|
|
||||||
last_char_in_message:
|
|
||||||
jsr reset_input_buffer
|
|
||||||
|
|
||||||
done_scrolling_message:
|
|
||||||
dec scroll_timer
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
|
|
||||||
scroll_timer: .byte 1
|
|
||||||
scroll_counter: .byte 0
|
|
||||||
|
|
||||||
|
|
||||||
pixel_scroll_irq:
|
|
||||||
start_irq
|
|
||||||
wait_next_raster
|
|
||||||
; set X scroll offset
|
|
||||||
lda scroll_timer
|
|
||||||
clc
|
|
||||||
asl
|
|
||||||
clc
|
|
||||||
and #$07
|
|
||||||
sta VIC_CTRL_B
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
move_sprites_irq:
|
|
||||||
start_irq
|
|
||||||
wait_next_raster
|
|
||||||
ldy sprite_ticker
|
|
||||||
inc sprite_ticker
|
|
||||||
|
|
||||||
ldx #$0e ;7*2
|
|
||||||
@position_sprite:
|
|
||||||
lda sprite_y_pos,y
|
|
||||||
sta $d001,x ;sprite 0 Y pos
|
|
||||||
|
|
||||||
;change colour when the sprite goes off screen
|
|
||||||
; cmp #$ff ;are we off the screen?
|
|
||||||
; bne @not_off_screen
|
|
||||||
; txa
|
|
||||||
; pha
|
|
||||||
; lsr
|
|
||||||
; tax
|
|
||||||
; inc $d027,x ;sprite color
|
|
||||||
; pla
|
|
||||||
; tax
|
|
||||||
;@not_off_screen:
|
|
||||||
|
|
||||||
txa
|
|
||||||
beq @y_set
|
|
||||||
dex
|
|
||||||
dex
|
|
||||||
@mod_y:
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
dex
|
|
||||||
bpl @mod_y
|
|
||||||
@y_set:
|
|
||||||
|
|
||||||
tax
|
|
||||||
dex
|
|
||||||
dex
|
|
||||||
bpl @position_sprite
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
|
|
||||||
setup_static_scroll_text:
|
|
||||||
ldax #scroll_buffer_0
|
|
||||||
stax current_output_ptr
|
|
||||||
ldax #scroll_template
|
|
||||||
stax current_input_ptr
|
|
||||||
@next_byte:
|
|
||||||
jsr get_a
|
|
||||||
beq @next_byte
|
|
||||||
cmp #'%'
|
|
||||||
beq @operator
|
|
||||||
pha
|
|
||||||
jsr emit_a
|
|
||||||
pla
|
|
||||||
bne @next_byte
|
|
||||||
rts
|
|
||||||
|
|
||||||
@operator:
|
|
||||||
jsr get_a
|
|
||||||
cmp #'i'
|
|
||||||
bne @not_ip
|
|
||||||
lda #KPR_CFG_IP
|
|
||||||
jmp @loaded_offset
|
|
||||||
@not_ip:
|
|
||||||
cmp #'g'
|
|
||||||
bne @not_gateway
|
|
||||||
lda #KPR_CFG_GATEWAY
|
|
||||||
jmp @loaded_offset
|
|
||||||
@not_gateway:
|
|
||||||
cmp #'d'
|
|
||||||
bne @not_dns
|
|
||||||
lda #KPR_CFG_DNS_SERVER
|
|
||||||
jmp @loaded_offset
|
|
||||||
@not_dns:
|
|
||||||
cmp #'f'
|
|
||||||
bne @not_feed_url
|
|
||||||
ldy #0
|
|
||||||
@copy_feed_url_loop:
|
|
||||||
lda feed_url,y
|
|
||||||
cmp #$20
|
|
||||||
bcc @next_byte ;any control char (including CR,LF, and $00) should be treated as end of URL
|
|
||||||
jsr emit_a
|
|
||||||
iny
|
|
||||||
bne @copy_feed_url_loop
|
|
||||||
@not_feed_url:
|
|
||||||
jmp @next_byte
|
|
||||||
|
|
||||||
@loaded_offset:
|
|
||||||
sta param_offset
|
|
||||||
kippercall #KPR_GET_IP_CONFIG
|
|
||||||
adc param_offset
|
|
||||||
bcc :+
|
|
||||||
inx
|
|
||||||
:
|
|
||||||
jsr emit_dotted_quad
|
|
||||||
|
|
||||||
|
|
||||||
jmp @next_byte
|
|
||||||
|
|
||||||
;emit the 4 bytes pointed at by AX as dotted decimals
|
|
||||||
emit_dotted_quad:
|
|
||||||
sta pptr
|
|
||||||
stx pptr + 1
|
|
||||||
ldy #0
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
lda #'.'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
ldy #1
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
lda #'.'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
ldy #2
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
lda #'.'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
ldy #3
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
emit_decimal: ;emit byte in A as a decimal number
|
|
||||||
pha
|
|
||||||
sta temp_bin ;save
|
|
||||||
sed ; Switch to decimal mode
|
|
||||||
lda #0 ; Ensure the result is clear
|
|
||||||
sta temp_bcd
|
|
||||||
sta temp_bcd+1
|
|
||||||
ldx #8 ; The number of source bits
|
|
||||||
:
|
|
||||||
asl temp_bin+0 ; Shift out one bit
|
|
||||||
lda temp_bcd+0 ; And add into result
|
|
||||||
adc temp_bcd+0
|
|
||||||
sta temp_bcd+0
|
|
||||||
lda temp_bcd+1 ; propagating any carry
|
|
||||||
adc temp_bcd+1
|
|
||||||
sta temp_bcd+1
|
|
||||||
dex ; And repeat for next bit
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
cld ;back to binary
|
|
||||||
|
|
||||||
pla ;get back the original passed in number
|
|
||||||
bmi @emit_hundreds ; if N is set, the number is >=128 so emit all 3 digits
|
|
||||||
cmp #10
|
|
||||||
bmi @emit_units
|
|
||||||
cmp #100
|
|
||||||
bmi @emit_tens
|
|
||||||
@emit_hundreds:
|
|
||||||
lda temp_bcd+1 ;get the most significant digit
|
|
||||||
and #$0f
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
@emit_tens:
|
|
||||||
lda temp_bcd
|
|
||||||
lsr
|
|
||||||
lsr
|
|
||||||
lsr
|
|
||||||
lsr
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
jsr emit_a
|
|
||||||
@emit_units:
|
|
||||||
lda temp_bcd
|
|
||||||
and #$0f
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
reset_after_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print
|
|
||||||
@wait_key:
|
|
||||||
jsr $f142 ;not officially documented - where F13E (GETIN) falls through to if device # is 0 (KEYBD)
|
|
||||||
beq @wait_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
print_errorcode:
|
|
||||||
ldax #error_code
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_GET_LAST_ERROR
|
|
||||||
kippercall #KPR_PRINT_HEX
|
|
||||||
jmp print_cr
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
play_music_irq:
|
|
||||||
; inc BORDER_COLOR
|
|
||||||
start_irq
|
|
||||||
jsr MUSIC_BASE+PLAYER_PLAY
|
|
||||||
; dec BORDER_COLOR
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
emit_titles:
|
|
||||||
ldax #download_buffer
|
|
||||||
kippercall #KPR_PARSER_INIT
|
|
||||||
@next_title:
|
|
||||||
ldax #title
|
|
||||||
kippercall #KPR_PARSER_SKIP_NEXT
|
|
||||||
bcs @done
|
|
||||||
|
|
||||||
jsr emit_tag_contents
|
|
||||||
lda #' '
|
|
||||||
jsr emit_a
|
|
||||||
lda #'/'
|
|
||||||
jsr emit_a
|
|
||||||
lda #' '
|
|
||||||
jsr emit_a
|
|
||||||
jmp @next_title
|
|
||||||
@done:
|
|
||||||
lda #0
|
|
||||||
jsr emit_a
|
|
||||||
rts
|
|
||||||
|
|
||||||
emit_tag_contents:
|
|
||||||
stax temp_buff
|
|
||||||
lda #0
|
|
||||||
sta string_offset
|
|
||||||
@next_byte:
|
|
||||||
jsr @get_next_byte
|
|
||||||
cmp #0
|
|
||||||
beq @done
|
|
||||||
cmp #'<'
|
|
||||||
beq @done
|
|
||||||
cmp #'&'
|
|
||||||
beq @entity
|
|
||||||
jsr emit_a
|
|
||||||
beq @done
|
|
||||||
jmp @next_byte
|
|
||||||
@entity:
|
|
||||||
jsr @get_next_byte
|
|
||||||
cmp #'a'
|
|
||||||
bne @not_amper
|
|
||||||
lda #'&'
|
|
||||||
jsr emit_a
|
|
||||||
@not_amper:
|
|
||||||
cmp #'g'
|
|
||||||
bne @not_gt
|
|
||||||
lda #'>'
|
|
||||||
jsr emit_a
|
|
||||||
@not_gt:
|
|
||||||
cmp #'l'
|
|
||||||
bne @not_lt
|
|
||||||
lda #'<'
|
|
||||||
jsr emit_a
|
|
||||||
@not_lt:
|
|
||||||
|
|
||||||
@loop_till_semi_colon:
|
|
||||||
jsr @get_next_byte
|
|
||||||
cmp #0
|
|
||||||
beq @done
|
|
||||||
cmp #';'
|
|
||||||
bne @loop_till_semi_colon
|
|
||||||
jmp @next_byte
|
|
||||||
@get_next_byte:
|
|
||||||
ldy string_offset
|
|
||||||
lda (temp_buff),y
|
|
||||||
inc string_offset
|
|
||||||
@done:
|
|
||||||
rts
|
|
||||||
|
|
||||||
print:
|
|
||||||
sta pptr
|
|
||||||
stx pptr + 1
|
|
||||||
|
|
||||||
@print_loop:
|
|
||||||
ldy #0
|
|
||||||
lda (pptr),y
|
|
||||||
beq @done_print
|
|
||||||
jsr print_a
|
|
||||||
inc pptr
|
|
||||||
bne @print_loop
|
|
||||||
inc pptr+1
|
|
||||||
bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-)
|
|
||||||
@done_print:
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_cr:
|
|
||||||
lda #13
|
|
||||||
jmp print_a
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
sprite_ticker: .byte 0
|
|
||||||
|
|
||||||
emit_a:
|
|
||||||
current_output_ptr=emit_a+1
|
|
||||||
sta $ffff
|
|
||||||
inc current_output_ptr
|
|
||||||
bne :+
|
|
||||||
inc current_output_ptr+1
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_a:
|
|
||||||
current_input_ptr=get_a+1
|
|
||||||
lda $ffff
|
|
||||||
inc current_input_ptr
|
|
||||||
bne :+
|
|
||||||
inc current_input_ptr+1
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
raster_jump_table:
|
|
||||||
;format:
|
|
||||||
;offset meaning
|
|
||||||
; $00 BIT 9 OF RASTER TO TRIGGER ON ($00 if bit 8 =0 , $80 if bit 8 =1)
|
|
||||||
; $01 BITS 0..7 OF RASTER TO TRIGGER ON
|
|
||||||
; $02 LSB OF ROUTINE TO JUMP TO
|
|
||||||
; $03 MSB OF ROUTINE TO JUMP TO
|
|
||||||
;table needs to end with a single byte $ff
|
|
||||||
;table needs to be sorted by scanlines
|
|
||||||
.byte $0,$01
|
|
||||||
.word scroll_text_irq
|
|
||||||
.byte $0,$20
|
|
||||||
.word pixel_scroll_irq
|
|
||||||
|
|
||||||
|
|
||||||
.byte $0,$80
|
|
||||||
.word play_music_irq
|
|
||||||
|
|
||||||
.byte $80,$05
|
|
||||||
.word move_sprites_irq
|
|
||||||
|
|
||||||
.byte $ff ;end of list
|
|
||||||
|
|
||||||
jump_counter: .byte 0
|
|
||||||
|
|
||||||
|
|
||||||
sprite_x_pos:
|
|
||||||
.byte $34,$54,$78,$90,$Bb,$Db,$Fb,$1b
|
|
||||||
|
|
||||||
sprite_x_msb:
|
|
||||||
.byte $80
|
|
||||||
|
|
||||||
sprite_y_pos:
|
|
||||||
.repeat 128
|
|
||||||
.byte 0
|
|
||||||
.endrep
|
|
||||||
.include "sine_data.i"
|
|
||||||
|
|
||||||
;.include "sine_data.i"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static_title: .byte "up 'n atom - the old skool feed reader!",$20,0
|
|
||||||
sprite_text:
|
|
||||||
|
|
||||||
.byte "UP\NATOM" ;options are A-Z, "[\]^_"
|
|
||||||
|
|
||||||
scroll_template:
|
|
||||||
.byte " ip: %i / gateway: %g / dns server %d / polling %f /"
|
|
||||||
.byte " ",0
|
|
||||||
|
|
||||||
|
|
||||||
feed_url:
|
|
||||||
.byte "http://static.cricinfo.com/rss/livescores.xml",0
|
|
||||||
.byte "http://search.twitter.com/search.atom?q=kipper",0
|
|
||||||
;leave space for whatever we read in from disk
|
|
||||||
.repeat 128
|
|
||||||
.byte 0
|
|
||||||
.endrep
|
|
||||||
|
|
||||||
url_config_file:
|
|
||||||
|
|
||||||
.byte "URL.CFG",0
|
|
||||||
|
|
||||||
read_url_file_param_buffer:
|
|
||||||
.word url_config_file ;KPR_FILE_ACCESS_FILENAME
|
|
||||||
.word feed_url ;B65_FILE_ACCESS_POINTER
|
|
||||||
.word $0000 ;KPR_FILE_ACCESS_FILESIZE - should be filled in
|
|
||||||
.byte $00 ;KPR_FILE_ACCESS_DEVICE
|
|
||||||
|
|
||||||
|
|
||||||
title:
|
|
||||||
.byte "<title>",0
|
|
||||||
|
|
||||||
kipper_api_not_found_message:
|
|
||||||
.byte "ERROR - KIPPER API NOT FOUND.",13,0
|
|
||||||
|
|
||||||
failed_msg:
|
|
||||||
.byte "FAILED", 0
|
|
||||||
|
|
||||||
ok_msg:
|
|
||||||
.byte "OK", 0
|
|
||||||
|
|
||||||
|
|
||||||
init_msg:
|
|
||||||
.byte " INITIALIZING ",0
|
|
||||||
|
|
||||||
press_a_key_to_continue:
|
|
||||||
.byte "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
|
|
||||||
kipper_signature:
|
|
||||||
.byte $4B,$49,$50,$50,$45,$52 ; "KIPPER"
|
|
||||||
|
|
||||||
error_code:
|
|
||||||
.asciiz "ERROR CODE: "
|
|
||||||
|
|
||||||
charset_font:
|
|
||||||
.incbin "font16x8.bin"
|
|
||||||
sprite_font:
|
|
||||||
.incbin "spud_letters.spr"
|
|
||||||
musicdata:
|
|
||||||
;.incbin "tune.bin"
|
|
||||||
.incbin "powertrain.bin"
|
|
||||||
musicdata_size=*-musicdata
|
|
||||||
|
|
||||||
.segment "SAFE_BSS"
|
|
||||||
;we want our variables to start at $3000, out of the way of our music player and the font data
|
|
||||||
|
|
||||||
param_offset: .res 1
|
|
||||||
|
|
||||||
temp_bin: .res 1
|
|
||||||
temp_bcd: .res 2
|
|
||||||
|
|
||||||
scroll_state: .res 1
|
|
||||||
|
|
||||||
param_buffer: .res $20
|
|
||||||
|
|
||||||
download_buffer:
|
|
||||||
download_buffer_length=12000
|
|
||||||
.res download_buffer_length
|
|
||||||
|
|
||||||
.res 10 ;filler
|
|
||||||
scroll_buffer_0:
|
|
||||||
.res 1000
|
|
||||||
|
|
||||||
scroll_buffer_1:
|
|
||||||
.res 2000
|
|
||||||
|
|
||||||
string_offset: .res 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR upnatom.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1 +0,0 @@
|
||||||
http://static.cricinfo.com/rss/livescores.xml
|
|
|
@ -1,941 +0,0 @@
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
|
|
||||||
.ifndef KPR_API_VERSION_NUMBER
|
|
||||||
.define EQU =
|
|
||||||
.include "../inc/kipper_constants.i"
|
|
||||||
.endif
|
|
||||||
|
|
||||||
print_a = $ffd2
|
|
||||||
|
|
||||||
|
|
||||||
.export musicdata
|
|
||||||
.export musicdata_size
|
|
||||||
.export sprite_font
|
|
||||||
.export html
|
|
||||||
.export scroll_template_1
|
|
||||||
.export scroll_template_2
|
|
||||||
|
|
||||||
.import __DATA6K_LOAD__
|
|
||||||
.import __DATA6K_RUN__
|
|
||||||
.import __DATA6K_SIZE__
|
|
||||||
|
|
||||||
SCREEN_RAM = $0400
|
|
||||||
COLOUR_RAM = $d800
|
|
||||||
VIC_CTRL_A = $d011
|
|
||||||
VIC_RASTER_REG = $d012
|
|
||||||
VIC_CTRL_B = $d016
|
|
||||||
VIC_MEMORY_CTRL=$d018
|
|
||||||
VIC_IRQ_FLAG = $d019
|
|
||||||
|
|
||||||
copy_src = $24
|
|
||||||
|
|
||||||
|
|
||||||
IRQ_VECTOR=$fffe
|
|
||||||
|
|
||||||
MUSIC_BASE=$1000 ;where we relocate our music routine to
|
|
||||||
PLAYER_INIT=0
|
|
||||||
PLAYER_PLAY=3
|
|
||||||
|
|
||||||
BORDER_COLOR = $d020
|
|
||||||
BACKGROUND_COLOR_0 = $d021
|
|
||||||
SCROLL_DELAY=4
|
|
||||||
CHARS_PER_LINE = 40
|
|
||||||
SCROLL_LINE=12
|
|
||||||
SCROLL_RAM = SCREEN_RAM+(SCROLL_LINE*CHARS_PER_LINE)
|
|
||||||
|
|
||||||
TOP_BORDER_SCAN_LINES = 50
|
|
||||||
|
|
||||||
|
|
||||||
BLACK = 0
|
|
||||||
WHITE = 1
|
|
||||||
RED = 2
|
|
||||||
CYAN = 3
|
|
||||||
PURPLE = 4
|
|
||||||
GREEN = 5
|
|
||||||
BLUE = 6
|
|
||||||
YELLOW = 7
|
|
||||||
ORANGE = 8
|
|
||||||
BROWN = 9
|
|
||||||
LIGHT_RED = 10
|
|
||||||
DARK_GRAY = 11
|
|
||||||
GRAY = 12
|
|
||||||
LIGHT_GREEN = 13
|
|
||||||
LIGHT_BLUE = 14
|
|
||||||
LIGHT_GRAY = 15
|
|
||||||
|
|
||||||
.macro start_irq
|
|
||||||
pha
|
|
||||||
txa
|
|
||||||
pha
|
|
||||||
tya
|
|
||||||
pha
|
|
||||||
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
|
|
||||||
.macro end_irq
|
|
||||||
pla
|
|
||||||
tay
|
|
||||||
pla
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro wait_next_raster
|
|
||||||
lda VIC_RASTER_REG
|
|
||||||
@loop:
|
|
||||||
cmp VIC_RASTER_REG
|
|
||||||
beq @loop
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro kippercall function_number
|
|
||||||
ldy function_number
|
|
||||||
jsr KPR_DISPATCH_VECTOR
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.zeropage
|
|
||||||
temp_buff: .res 2
|
|
||||||
pptr: .res 2
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
init:
|
|
||||||
|
|
||||||
ldax #KPR_CART_SIGNATURE ;where signature should be in cartridge (if cart is banked in)
|
|
||||||
look_for_signature:
|
|
||||||
stax temp_buff
|
|
||||||
ldy #5
|
|
||||||
@check_one_byte:
|
|
||||||
lda (temp_buff),y
|
|
||||||
cmp kipper_signature,y
|
|
||||||
bne @bad_match
|
|
||||||
dey
|
|
||||||
bpl @check_one_byte
|
|
||||||
jmp @found_kipper_signature
|
|
||||||
|
|
||||||
@bad_match:
|
|
||||||
ldax #kipper_api_not_found_message
|
|
||||||
jsr print
|
|
||||||
@loop:
|
|
||||||
jmp @loop
|
|
||||||
rts
|
|
||||||
@found_kipper_signature:
|
|
||||||
|
|
||||||
ldax #init_msg
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_INITIALIZE
|
|
||||||
bcc @init_ok
|
|
||||||
jsr print_cr
|
|
||||||
ldax #failed_msg
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp reset_after_keypress
|
|
||||||
@init_ok:
|
|
||||||
|
|
||||||
;if we got here, we have found the KIPPER API and initialised the IP stack
|
|
||||||
|
|
||||||
|
|
||||||
;copy our runtime data to where it lives
|
|
||||||
ldax #__DATA6K_LOAD__
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #__DATA6K_RUN__
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #__DATA6K_SIZE__
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;copy our music data up to a temp buffer (in case it gets overwritten by
|
|
||||||
;one of the other unpacking moves)
|
|
||||||
ldax #musicdata+2 ;skip over the 2 byte address
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #download_buffer
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #musicdata_size-2 ;don't copy the 2 byte address
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
;copy our font data and the sprite data to $3000..$3fff
|
|
||||||
ldax #charset_font
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #$3000
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #MUSIC_BASE
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
;should now be now safe to copy the music data back down
|
|
||||||
;copy our music data to $1000..$1fff
|
|
||||||
ldax #download_buffer
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
ldax #MUSIC_BASE
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #musicdata_size-2 ;don't copy the 2 byte address
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
|
|
||||||
ldax #scroll_template_1
|
|
||||||
jsr setup_static_scroll_text
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
jsr clear_screen
|
|
||||||
lda #DARK_GRAY
|
|
||||||
sta BORDER_COLOR
|
|
||||||
lda #YELLOW
|
|
||||||
sta BACKGROUND_COLOR_0
|
|
||||||
|
|
||||||
lda #$1c ; use charset at $3000
|
|
||||||
sta VIC_MEMORY_CTRL
|
|
||||||
|
|
||||||
|
|
||||||
sei ;disable maskable IRQs
|
|
||||||
|
|
||||||
lda #$7f
|
|
||||||
sta $dc0d ;disable timer interrupts which can be generated by the two CIA chips
|
|
||||||
sta $dd0d ;the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
|
|
||||||
;stop it.
|
|
||||||
|
|
||||||
lda $dc0d ;by reading this two registers we negate any pending CIA irqs.
|
|
||||||
lda $dd0d ;if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
|
|
||||||
;we don't want that to happen.
|
|
||||||
|
|
||||||
lda #$01 ;this is how to tell the VICII to generate a raster interrupt
|
|
||||||
sta $d01a
|
|
||||||
|
|
||||||
lda #$00 ;this is how to tell at which rasterline we want the irq to be triggered
|
|
||||||
sta VIC_RASTER_REG
|
|
||||||
|
|
||||||
|
|
||||||
;copy KERNAL to the RAM underneath, in case any ip65 routines need it
|
|
||||||
ldax #$e000
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #$1FFF
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
;copy KIPPER cart to the RAM underneath, so we can swap it out and modify the IRQ vector
|
|
||||||
ldax #$8000
|
|
||||||
stax param_buffer+KPR_BLOCK_SRC
|
|
||||||
stax param_buffer+KPR_BLOCK_DEST
|
|
||||||
ldax #$4000
|
|
||||||
stax param_buffer+KPR_BLOCK_SIZE
|
|
||||||
ldax #param_buffer
|
|
||||||
kippercall #KPR_BLOCK_COPY
|
|
||||||
|
|
||||||
|
|
||||||
lda #$35 ;we turn off the BASIC and KERNAL rom here, so we can overwrite the IRQ vector at $fffe
|
|
||||||
sta $01 ;the cpu now sees RAM everywhere except at $d000-$e000, where still the registers of
|
|
||||||
;SID/VICII/etc are visible
|
|
||||||
|
|
||||||
lda #((SPRITE_FRAMES-1)*8)
|
|
||||||
sta sprite_text_frame
|
|
||||||
jsr setup_sprites
|
|
||||||
|
|
||||||
jsr setup_music
|
|
||||||
|
|
||||||
|
|
||||||
jsr set_next_irq_jump
|
|
||||||
cli ;enable maskable interrupts again
|
|
||||||
|
|
||||||
|
|
||||||
;position for the first text
|
|
||||||
|
|
||||||
jsr reset_input_buffer
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
start_web_server:
|
|
||||||
ldax #httpd_callback
|
|
||||||
kippercall #KPR_HTTPD_START ;this will only return if there is an error
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
reset_input_buffer:
|
|
||||||
|
|
||||||
lda new_message
|
|
||||||
beq @no_message_yet
|
|
||||||
ldax #scroll_template_2
|
|
||||||
jsr setup_static_scroll_text
|
|
||||||
ldx #0
|
|
||||||
stx new_message
|
|
||||||
|
|
||||||
@no_message_yet:
|
|
||||||
ldax #scroll_buffer
|
|
||||||
stax current_input_ptr
|
|
||||||
rts
|
|
||||||
|
|
||||||
httpd_callback:
|
|
||||||
lda #'h'
|
|
||||||
kippercall #KPR_HTTPD_GET_VAR_VALUE
|
|
||||||
bcs @not_complete_fields
|
|
||||||
stax copy_src
|
|
||||||
ldy #0
|
|
||||||
lda (copy_src),y
|
|
||||||
beq @not_complete_fields
|
|
||||||
|
|
||||||
@copy_handle_loop:
|
|
||||||
lda (copy_src),y
|
|
||||||
beq @end_of_handle
|
|
||||||
sta handle,y
|
|
||||||
iny
|
|
||||||
bne @copy_handle_loop
|
|
||||||
@end_of_handle:
|
|
||||||
lda #0
|
|
||||||
sta handle,y
|
|
||||||
lda #'m'
|
|
||||||
kippercall #KPR_HTTPD_GET_VAR_VALUE
|
|
||||||
bcs @not_complete_fields
|
|
||||||
stax copy_src
|
|
||||||
ldy #0
|
|
||||||
lda (copy_src),y
|
|
||||||
beq @not_complete_fields
|
|
||||||
|
|
||||||
@copy_message_loop:
|
|
||||||
lda (copy_src),y
|
|
||||||
beq @end_of_message
|
|
||||||
sta message_text,y
|
|
||||||
iny
|
|
||||||
bne @copy_message_loop
|
|
||||||
@end_of_message:
|
|
||||||
lda #0
|
|
||||||
sta message_text,y
|
|
||||||
inc new_message
|
|
||||||
|
|
||||||
@not_complete_fields:
|
|
||||||
|
|
||||||
ldax #html
|
|
||||||
ldy #2 ;text/html
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
;set up the tune
|
|
||||||
setup_music:
|
|
||||||
lda #$00 ;init subtune 0
|
|
||||||
jsr MUSIC_BASE+PLAYER_INIT
|
|
||||||
rts
|
|
||||||
|
|
||||||
setup_sprites:
|
|
||||||
|
|
||||||
;turn on all 8 sprites
|
|
||||||
lda #$FF
|
|
||||||
sta $d015
|
|
||||||
|
|
||||||
ldx #$07
|
|
||||||
@setup_sprite:
|
|
||||||
;position each sprite
|
|
||||||
txa
|
|
||||||
asl
|
|
||||||
tay
|
|
||||||
lda sprite_x_pos,x
|
|
||||||
sta $d000,y ;sprite 0 X pos (LSB)
|
|
||||||
lda #0
|
|
||||||
sta $d001,y ;sprite 0 Y pos
|
|
||||||
|
|
||||||
;colour sprite 0
|
|
||||||
lda #BLUE
|
|
||||||
sta $d027,x ;sprite 0 color
|
|
||||||
|
|
||||||
;select bitmap for sprite
|
|
||||||
dex
|
|
||||||
bpl @setup_sprite
|
|
||||||
|
|
||||||
lda sprite_x_msb
|
|
||||||
sta $d010
|
|
||||||
|
|
||||||
;turn on multicolor mode for all 8 sprites
|
|
||||||
lda #$FF
|
|
||||||
sta $d01c
|
|
||||||
|
|
||||||
sta sprite_ticker
|
|
||||||
|
|
||||||
lda #DARK_GRAY
|
|
||||||
sta $d025 ;sprite multicolor register 0
|
|
||||||
lda #LIGHT_GRAY
|
|
||||||
sta $d026 ;sprite multicolor register 1
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
clear_screen:
|
|
||||||
|
|
||||||
ldx #$00
|
|
||||||
lda #$20
|
|
||||||
|
|
||||||
:
|
|
||||||
sta SCREEN_RAM,x
|
|
||||||
sta SCREEN_RAM+$100,x
|
|
||||||
sta SCREEN_RAM+$200,x
|
|
||||||
sta SCREEN_RAM+$300,x
|
|
||||||
sta COLOUR_RAM,x
|
|
||||||
sta COLOUR_RAM+$100,x
|
|
||||||
sta COLOUR_RAM+$200,x
|
|
||||||
sta COLOUR_RAM+$300,x
|
|
||||||
|
|
||||||
dex
|
|
||||||
bne :-
|
|
||||||
rts
|
|
||||||
|
|
||||||
set_next_irq_jump:
|
|
||||||
inc jump_counter
|
|
||||||
|
|
||||||
lda jump_counter
|
|
||||||
asl
|
|
||||||
asl
|
|
||||||
load_next_raster_entry:
|
|
||||||
tax
|
|
||||||
lda raster_jump_table,x ;bit 9 of raster to trigger on
|
|
||||||
|
|
||||||
cmp #$ff
|
|
||||||
bne not_last_entry
|
|
||||||
lda #0
|
|
||||||
sta jump_counter
|
|
||||||
jmp load_next_raster_entry
|
|
||||||
not_last_entry:
|
|
||||||
ora #$18 ;turn on bits 3 & 4
|
|
||||||
sta VIC_CTRL_A
|
|
||||||
lda raster_jump_table+1,x ;bits 0..7 of raster to trigger on
|
|
||||||
sta VIC_RASTER_REG
|
|
||||||
lda raster_jump_table+2,x ;LSB of IRQ handler
|
|
||||||
sta IRQ_VECTOR
|
|
||||||
lda raster_jump_table+3,x ;LSB of IRQ handler
|
|
||||||
sta IRQ_VECTOR+1
|
|
||||||
rts
|
|
||||||
|
|
||||||
exit_from_irq:
|
|
||||||
jsr set_next_irq_jump
|
|
||||||
lda #$ff ;this is the orthodox and safe way of clearing the interrupt condition of the VICII.
|
|
||||||
sta VIC_IRQ_FLAG;if you don't do this the interrupt condition will be present all the time and you end
|
|
||||||
;up having the CPU running the interrupt code all the time, as when it exists the
|
|
||||||
;interrupt, the interrupt request from the VICII will be there again regardless of the
|
|
||||||
;rasterline counter.
|
|
||||||
|
|
||||||
end_irq
|
|
||||||
rti
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
scroll_text_irq:
|
|
||||||
start_irq
|
|
||||||
lda scroll_timer
|
|
||||||
bne done_scrolling_message
|
|
||||||
lda #SCROLL_DELAY
|
|
||||||
sta scroll_timer
|
|
||||||
ldx #1
|
|
||||||
ldy #0
|
|
||||||
scroll_1_char:
|
|
||||||
lda SCROLL_RAM,x
|
|
||||||
sta SCROLL_RAM,y
|
|
||||||
lda SCROLL_RAM+40,x
|
|
||||||
sta SCROLL_RAM+40,y
|
|
||||||
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
cpx #CHARS_PER_LINE
|
|
||||||
bne scroll_1_char
|
|
||||||
|
|
||||||
|
|
||||||
jsr get_a
|
|
||||||
cmp #0
|
|
||||||
beq last_char_in_message
|
|
||||||
sta SCROLL_RAM+CHARS_PER_LINE-1
|
|
||||||
clc
|
|
||||||
adc #$80
|
|
||||||
sta SCROLL_RAM+CHARS_PER_LINE+40-1
|
|
||||||
|
|
||||||
jmp done_scrolling_message
|
|
||||||
|
|
||||||
|
|
||||||
last_char_in_message:
|
|
||||||
jsr reset_input_buffer
|
|
||||||
|
|
||||||
done_scrolling_message:
|
|
||||||
dec scroll_timer
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
|
|
||||||
scroll_timer: .byte 1
|
|
||||||
scroll_counter: .byte 0
|
|
||||||
|
|
||||||
|
|
||||||
pixel_scroll_irq:
|
|
||||||
start_irq
|
|
||||||
wait_next_raster
|
|
||||||
; set X scroll offset
|
|
||||||
lda scroll_timer
|
|
||||||
clc
|
|
||||||
asl
|
|
||||||
clc
|
|
||||||
and #$07
|
|
||||||
sta VIC_CTRL_B
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
move_sprites_irq:
|
|
||||||
start_irq
|
|
||||||
wait_next_raster
|
|
||||||
|
|
||||||
inc sprite_ticker
|
|
||||||
bne @sprite_not_offscreen
|
|
||||||
clc
|
|
||||||
lda sprite_text_frame
|
|
||||||
adc #8
|
|
||||||
cmp #8*SPRITE_FRAMES
|
|
||||||
bne @not_last_frame
|
|
||||||
lda #0
|
|
||||||
@not_last_frame:
|
|
||||||
sta sprite_text_frame
|
|
||||||
ldx #$07
|
|
||||||
@set_sprite_text:
|
|
||||||
clc
|
|
||||||
txa
|
|
||||||
adc sprite_text_frame
|
|
||||||
tay
|
|
||||||
lda sprite_text,y
|
|
||||||
cmp #' '
|
|
||||||
bne @not_space
|
|
||||||
lda #'`' ;map a space in the sprite text to 0x60,so it ends up with font offset 0x1F after subbing 'A'
|
|
||||||
@not_space:
|
|
||||||
sec
|
|
||||||
sbc #'A'
|
|
||||||
clc
|
|
||||||
adc #<($3800/64) ;sprite font should be relocated here
|
|
||||||
sta SCREEN_RAM+$03f8,x
|
|
||||||
dex
|
|
||||||
bpl @set_sprite_text
|
|
||||||
|
|
||||||
@sprite_not_offscreen:
|
|
||||||
ldy sprite_ticker
|
|
||||||
ldx #$0e ;7*2
|
|
||||||
@position_sprite:
|
|
||||||
lda sprite_y_pos,y
|
|
||||||
sta $d001,x ;sprite 0 Y pos
|
|
||||||
|
|
||||||
;change colour when the sprite goes off screen
|
|
||||||
; cmp #$ff ;are we off the screen?
|
|
||||||
; bne @not_off_screen
|
|
||||||
; txa
|
|
||||||
; pha
|
|
||||||
; lsr
|
|
||||||
; tax
|
|
||||||
; inc $d027,x ;sprite color
|
|
||||||
; pla
|
|
||||||
; tax
|
|
||||||
;@not_off_screen:
|
|
||||||
|
|
||||||
txa
|
|
||||||
beq @y_set
|
|
||||||
dex
|
|
||||||
dex
|
|
||||||
@mod_y:
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
dex
|
|
||||||
bpl @mod_y
|
|
||||||
@y_set:
|
|
||||||
|
|
||||||
tax
|
|
||||||
dex
|
|
||||||
dex
|
|
||||||
bpl @position_sprite
|
|
||||||
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
|
|
||||||
setup_static_scroll_text:
|
|
||||||
stax current_input_ptr
|
|
||||||
lda #0
|
|
||||||
sta new_message
|
|
||||||
ldax #scroll_buffer
|
|
||||||
stax current_output_ptr
|
|
||||||
@next_byte:
|
|
||||||
jsr get_a
|
|
||||||
beq @next_byte
|
|
||||||
cmp #'%'
|
|
||||||
beq @operator
|
|
||||||
pha
|
|
||||||
jsr emit_a
|
|
||||||
pla
|
|
||||||
bne @next_byte
|
|
||||||
rts
|
|
||||||
|
|
||||||
@operator:
|
|
||||||
jsr get_a
|
|
||||||
cmp #'m'
|
|
||||||
bne @not_message
|
|
||||||
ldx #0
|
|
||||||
:
|
|
||||||
lda message_text,x
|
|
||||||
beq @next_byte
|
|
||||||
cmp #$20
|
|
||||||
bpl @not_ctrl_char
|
|
||||||
lda #' '
|
|
||||||
@not_ctrl_char:
|
|
||||||
jsr emit_a
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
@not_message:
|
|
||||||
cmp #'h'
|
|
||||||
bne @not_handle
|
|
||||||
ldx #0
|
|
||||||
:
|
|
||||||
lda handle,x
|
|
||||||
beq @next_byte
|
|
||||||
jsr emit_a
|
|
||||||
inx
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
@not_handle:
|
|
||||||
|
|
||||||
cmp #'i'
|
|
||||||
bne @not_ip
|
|
||||||
lda #KPR_CFG_IP
|
|
||||||
jmp @loaded_offset
|
|
||||||
@not_ip:
|
|
||||||
cmp #'g'
|
|
||||||
bne @not_gateway
|
|
||||||
lda #KPR_CFG_GATEWAY
|
|
||||||
jmp @loaded_offset
|
|
||||||
@not_gateway:
|
|
||||||
cmp #'d'
|
|
||||||
bne @not_dns
|
|
||||||
lda #KPR_CFG_DNS_SERVER
|
|
||||||
jmp @loaded_offset
|
|
||||||
@not_dns:
|
|
||||||
jmp @next_byte
|
|
||||||
|
|
||||||
@loaded_offset:
|
|
||||||
sta param_offset
|
|
||||||
kippercall #KPR_GET_IP_CONFIG
|
|
||||||
adc param_offset
|
|
||||||
bcc :+
|
|
||||||
inx
|
|
||||||
:
|
|
||||||
jsr emit_dotted_quad
|
|
||||||
|
|
||||||
|
|
||||||
jmp @next_byte
|
|
||||||
|
|
||||||
;emit the 4 bytes pointed at by AX as dotted decimals
|
|
||||||
emit_dotted_quad:
|
|
||||||
sta pptr
|
|
||||||
stx pptr + 1
|
|
||||||
ldy #0
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
lda #'.'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
ldy #1
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
lda #'.'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
ldy #2
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
lda #'.'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
ldy #3
|
|
||||||
lda (pptr),y
|
|
||||||
jsr emit_decimal
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
emit_decimal: ;emit byte in A as a decimal number
|
|
||||||
pha
|
|
||||||
sta temp_bin ;save
|
|
||||||
sed ; Switch to decimal mode
|
|
||||||
lda #0 ; Ensure the result is clear
|
|
||||||
sta temp_bcd
|
|
||||||
sta temp_bcd+1
|
|
||||||
ldx #8 ; The number of source bits
|
|
||||||
:
|
|
||||||
asl temp_bin+0 ; Shift out one bit
|
|
||||||
lda temp_bcd+0 ; And add into result
|
|
||||||
adc temp_bcd+0
|
|
||||||
sta temp_bcd+0
|
|
||||||
lda temp_bcd+1 ; propagating any carry
|
|
||||||
adc temp_bcd+1
|
|
||||||
sta temp_bcd+1
|
|
||||||
dex ; And repeat for next bit
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
cld ;back to binary
|
|
||||||
|
|
||||||
pla ;get back the original passed in number
|
|
||||||
bmi @emit_hundreds ; if N is set, the number is >=128 so emit all 3 digits
|
|
||||||
cmp #10
|
|
||||||
bmi @emit_units
|
|
||||||
cmp #100
|
|
||||||
bmi @emit_tens
|
|
||||||
@emit_hundreds:
|
|
||||||
lda temp_bcd+1 ;get the most significant digit
|
|
||||||
and #$0f
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
@emit_tens:
|
|
||||||
lda temp_bcd
|
|
||||||
lsr
|
|
||||||
lsr
|
|
||||||
lsr
|
|
||||||
lsr
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
jsr emit_a
|
|
||||||
@emit_units:
|
|
||||||
lda temp_bcd
|
|
||||||
and #$0f
|
|
||||||
clc
|
|
||||||
adc #'0'
|
|
||||||
jsr emit_a
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
reset_after_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print
|
|
||||||
@wait_key:
|
|
||||||
jsr $f142 ;not officially documented - where F13E (GETIN) falls through to if device # is 0 (KEYBD)
|
|
||||||
beq @wait_key
|
|
||||||
jmp $fce2 ;do a cold start
|
|
||||||
|
|
||||||
print_errorcode:
|
|
||||||
ldax #error_code
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_GET_LAST_ERROR
|
|
||||||
kippercall #KPR_PRINT_HEX
|
|
||||||
jmp print_cr
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
play_music_irq:
|
|
||||||
; inc BORDER_COLOR
|
|
||||||
start_irq
|
|
||||||
jsr MUSIC_BASE+PLAYER_PLAY
|
|
||||||
; dec BORDER_COLOR
|
|
||||||
jmp exit_from_irq
|
|
||||||
|
|
||||||
|
|
||||||
print:
|
|
||||||
sta pptr
|
|
||||||
stx pptr + 1
|
|
||||||
|
|
||||||
@print_loop:
|
|
||||||
ldy #0
|
|
||||||
lda (pptr),y
|
|
||||||
beq @done_print
|
|
||||||
jsr print_a
|
|
||||||
inc pptr
|
|
||||||
bne @print_loop
|
|
||||||
inc pptr+1
|
|
||||||
bne @print_loop ;if we ever get to $ffff, we've probably gone far enough ;-)
|
|
||||||
@done_print:
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_cr:
|
|
||||||
lda #13
|
|
||||||
jmp print_a
|
|
||||||
|
|
||||||
.data
|
|
||||||
|
|
||||||
sprite_ticker: .byte 0
|
|
||||||
|
|
||||||
emit_a:
|
|
||||||
current_output_ptr=emit_a+1
|
|
||||||
sta $ffff
|
|
||||||
inc current_output_ptr
|
|
||||||
bne :+
|
|
||||||
inc current_output_ptr+1
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_a:
|
|
||||||
current_input_ptr=get_a+1
|
|
||||||
lda $ffff
|
|
||||||
inc current_input_ptr
|
|
||||||
bne :+
|
|
||||||
inc current_input_ptr+1
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
raster_jump_table:
|
|
||||||
;format:
|
|
||||||
;offset meaning
|
|
||||||
; $00 BIT 9 OF RASTER TO TRIGGER ON ($00 if bit 8 =0 , $80 if bit 8 =1)
|
|
||||||
; $01 BITS 0..7 OF RASTER TO TRIGGER ON
|
|
||||||
; $02 LSB OF ROUTINE TO JUMP TO
|
|
||||||
; $03 MSB OF ROUTINE TO JUMP TO
|
|
||||||
;table needs to end with a single byte $ff
|
|
||||||
;table needs to be sorted by scanlines
|
|
||||||
.byte $0,$01
|
|
||||||
.word scroll_text_irq
|
|
||||||
.byte $0,$20
|
|
||||||
.word pixel_scroll_irq
|
|
||||||
|
|
||||||
|
|
||||||
.byte $0,$80
|
|
||||||
.word play_music_irq
|
|
||||||
|
|
||||||
.byte $80,$05
|
|
||||||
.word move_sprites_irq
|
|
||||||
|
|
||||||
.byte $ff ;end of list
|
|
||||||
|
|
||||||
jump_counter: .byte 0
|
|
||||||
|
|
||||||
.data
|
|
||||||
kipper_api_not_found_message:
|
|
||||||
.byte "ERROR - KIPPER API NOT FOUND.",13,0
|
|
||||||
|
|
||||||
failed_msg:
|
|
||||||
.byte "FAILED", 0
|
|
||||||
|
|
||||||
ok_msg:
|
|
||||||
.byte "OK", 0
|
|
||||||
|
|
||||||
|
|
||||||
init_msg:
|
|
||||||
.byte " INITIALIZING ",0
|
|
||||||
|
|
||||||
press_a_key_to_continue:
|
|
||||||
.byte "PRESS A KEY TO CONTINUE",13,0
|
|
||||||
|
|
||||||
kipper_signature:
|
|
||||||
.byte $4B,$49,$50,$50,$45,$52 ; "KIPPER"
|
|
||||||
|
|
||||||
error_code:
|
|
||||||
.asciiz "ERROR CODE: "
|
|
||||||
|
|
||||||
charset_font:
|
|
||||||
.incbin "font16x8.bin"
|
|
||||||
sprite_font:
|
|
||||||
.incbin "spud_letters.spr"
|
|
||||||
|
|
||||||
musicdata:
|
|
||||||
.incbin "powertrain.bin"
|
|
||||||
musicdata_size=*-musicdata
|
|
||||||
|
|
||||||
|
|
||||||
.segment "DATA6K"
|
|
||||||
|
|
||||||
|
|
||||||
sprite_x_pos:
|
|
||||||
.byte $34,$54,$78,$90,$Bb,$Db,$Fb,$1b
|
|
||||||
|
|
||||||
sprite_x_msb:
|
|
||||||
.byte $80
|
|
||||||
|
|
||||||
sprite_y_pos:
|
|
||||||
.repeat 128
|
|
||||||
.byte 0
|
|
||||||
.endrep
|
|
||||||
.include "sine_data.i"
|
|
||||||
|
|
||||||
;.include "sine_data.i"
|
|
||||||
|
|
||||||
|
|
||||||
html:
|
|
||||||
.incbin "form.html"
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
scroll_template_1:
|
|
||||||
.byte "WebNoter - go to http://%i/ and bang away! -"
|
|
||||||
.byte " ",0
|
|
||||||
|
|
||||||
scroll_template_2:
|
|
||||||
.byte "http://%i/"
|
|
||||||
.byte " - %h sez '%m' -"
|
|
||||||
.byte " ",0
|
|
||||||
|
|
||||||
sprite_text:
|
|
||||||
;[\]^_`=0,29?
|
|
||||||
.byte "WEBNOTER"
|
|
||||||
.byte "A KIPPER"
|
|
||||||
.byte " POWERED"
|
|
||||||
.byte "PRODUCT "
|
|
||||||
.byte "TUNE IS "
|
|
||||||
.byte "BY JCH "
|
|
||||||
.byte "FROM THE"
|
|
||||||
.byte "VIBRANTS"
|
|
||||||
.byte "GREETZ ]"
|
|
||||||
.byte "ALL AT "
|
|
||||||
.byte "DA BEACH"
|
|
||||||
.byte "PARTY I["
|
|
||||||
SPRITE_FRAMES=(*-sprite_text)/8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.segment "BSS4K"
|
|
||||||
;we want our variables to start at $4000, out of the way of our music player and the font data
|
|
||||||
|
|
||||||
handle: .res 256
|
|
||||||
message_text: .res 256
|
|
||||||
|
|
||||||
new_message:
|
|
||||||
.res 1
|
|
||||||
message_buffer:
|
|
||||||
.res 256
|
|
||||||
|
|
||||||
param_offset: .res 1
|
|
||||||
|
|
||||||
temp_bin: .res 1
|
|
||||||
temp_bcd: .res 2
|
|
||||||
|
|
||||||
|
|
||||||
param_buffer: .res $20
|
|
||||||
|
|
||||||
.res 10 ;filler
|
|
||||||
scroll_buffer:
|
|
||||||
.res 1000
|
|
||||||
sprite_text_frame: .res 1
|
|
||||||
string_offset: .res 1
|
|
||||||
|
|
||||||
download_buffer:
|
|
||||||
download_buffer_length=6000
|
|
||||||
.res download_buffer_length
|
|
||||||
|
|
|
@ -1,551 +0,0 @@
|
||||||
GOWARM = $00
|
|
||||||
GOSTROUT = $03
|
|
||||||
USR = $0A
|
|
||||||
CHARAC = $0D
|
|
||||||
ENDCHR = $0E
|
|
||||||
TKN_CNTR = $0F
|
|
||||||
EOL_PNTR = $0F
|
|
||||||
NUMDIM = $0F
|
|
||||||
DIMFLG = $10
|
|
||||||
VALTYP = $11
|
|
||||||
DATAFLG = $13
|
|
||||||
GARFLG = $13
|
|
||||||
SUBFLG = $14
|
|
||||||
INPUTFLG = $15
|
|
||||||
CPRMASK = $16
|
|
||||||
SIGNFLG = $16
|
|
||||||
HGR_SHAPE = $1A
|
|
||||||
HGR_BITS = $1C
|
|
||||||
HGR_COUNT = $1D
|
|
||||||
MON_CH = $24
|
|
||||||
MON_GBASL = $26
|
|
||||||
MON_GBASH = $27
|
|
||||||
MON_H2 = $2C
|
|
||||||
MON_V2 = $2D
|
|
||||||
MON_HMASK = $30
|
|
||||||
MON_INVFLG = $32
|
|
||||||
MON_PROMPT = $33
|
|
||||||
MON_A1L = $3C
|
|
||||||
MON_A1H = $3D
|
|
||||||
MON_A2L = $3E
|
|
||||||
MON_A2H = $3F
|
|
||||||
LINNUM = $50
|
|
||||||
TEMPPT = $52
|
|
||||||
LASTPT = $53
|
|
||||||
TEMPST = $55
|
|
||||||
INDEX = $5E
|
|
||||||
DEST = $60
|
|
||||||
RESULT = $62
|
|
||||||
TXTTAB = $67
|
|
||||||
VARTAB = $69
|
|
||||||
ARYTAB = $6B
|
|
||||||
STREND = $6D
|
|
||||||
FRETOP = $6F
|
|
||||||
FRESPC = $71
|
|
||||||
MEMSIZ = $73
|
|
||||||
CURLIN = $75
|
|
||||||
OLDLIN = $77
|
|
||||||
OLDTEXT = $79
|
|
||||||
DATLIN = $7B
|
|
||||||
DATPTR = $7D
|
|
||||||
INPTR = $7F
|
|
||||||
VARNAM = $81
|
|
||||||
VARPNT = $83
|
|
||||||
FORPNT = $85
|
|
||||||
TXPSV = $87
|
|
||||||
LASTOP = $87
|
|
||||||
CPRTYP = $89
|
|
||||||
TEMP3 = $8A
|
|
||||||
FNCNAM = $8A
|
|
||||||
DSCPTR = $8C
|
|
||||||
DSCLEN = $8F
|
|
||||||
JMPADRS = $90
|
|
||||||
LENGTH = $91
|
|
||||||
ARG_EXTENSION = $92
|
|
||||||
TEMP1 = $93
|
|
||||||
ARYPNT = $94
|
|
||||||
HIGHDS = $94
|
|
||||||
HIGHTR = $96
|
|
||||||
TEMP2 = $98
|
|
||||||
TMPEXP = $99
|
|
||||||
INDX = $99
|
|
||||||
EXPON = $9A
|
|
||||||
DPFLG = $9B
|
|
||||||
LOWTR = $9B
|
|
||||||
EXPSGN = $9C
|
|
||||||
FAC = $9D
|
|
||||||
DSCTMP = $9D
|
|
||||||
VPNT = $A0
|
|
||||||
FAC_SIGN = $A2
|
|
||||||
SERLEN = $A3
|
|
||||||
SHIFT_SIGN_EXT = $A4
|
|
||||||
ARG = $A5
|
|
||||||
ARG_SIGN = $AA
|
|
||||||
SGNCPR = $AB
|
|
||||||
FAC_EXTENSION = $AC
|
|
||||||
SERPNT = $AD
|
|
||||||
STRNG1 = $AB
|
|
||||||
STRNG2 = $AD
|
|
||||||
PRGEND = $AF
|
|
||||||
CHRGET = $B1
|
|
||||||
CHRGOT = $B7
|
|
||||||
TXTPTR = $B8
|
|
||||||
RNDSEED = $C9
|
|
||||||
HGR_DX = $D0
|
|
||||||
HGR_DY = $D2
|
|
||||||
HGR_QUADRANT = $D3
|
|
||||||
HGR_E = $D4
|
|
||||||
LOCK = $D6
|
|
||||||
ERRFLG = $D8
|
|
||||||
ERRLIN = $DA
|
|
||||||
ERRPOS = $DC
|
|
||||||
ERRNUM = $DE
|
|
||||||
ERRSTK = $DF
|
|
||||||
HGR_X = $E0
|
|
||||||
HGR_Y = $E2
|
|
||||||
HGR_COLOR = $E4
|
|
||||||
HGR_HORIZ = $E5
|
|
||||||
HGR_PAGE = $E6
|
|
||||||
HGR_SCALE = $E7
|
|
||||||
HGR_SHAPE_PNTR = $E8
|
|
||||||
HGR_COLLISIONS = $EA
|
|
||||||
FIRST = $F0
|
|
||||||
SPEEDZ = $F1
|
|
||||||
TRCFLG = $F2
|
|
||||||
FLASH_BIT = $F3
|
|
||||||
TXTPSV = $F4
|
|
||||||
CURLSV = $F6
|
|
||||||
REMSTK = $F8
|
|
||||||
HGR_ROTATION = $F9
|
|
||||||
|
|
||||||
M_NEG = $D0C7
|
|
||||||
M_EQU = $D0CA
|
|
||||||
M_REL = $D0CD
|
|
||||||
QT_ERROR = $D353
|
|
||||||
QT_IN = $D35B
|
|
||||||
QT_BREAK = $D35D
|
|
||||||
BLTU = $D393
|
|
||||||
BLTU2 = $D39A
|
|
||||||
CHKMEM = $D3D6
|
|
||||||
REASON = $D3E3
|
|
||||||
MEMERR = $D410
|
|
||||||
ERROR = $D412
|
|
||||||
INLIN = $D52C
|
|
||||||
INLIN2 = $D52E
|
|
||||||
INCHR = $D553
|
|
||||||
PARSE = $D56C
|
|
||||||
FNDLIN = $D61A
|
|
||||||
FL1 = $D61E
|
|
||||||
RTS_1 = $D648
|
|
||||||
NEW = $D649
|
|
||||||
SCRTCH = $D64B
|
|
||||||
CLEAR = $D66A
|
|
||||||
CLEARC = $D66C
|
|
||||||
STKINI = $D683
|
|
||||||
RTS_2 = $D696
|
|
||||||
STXTPT = $D697
|
|
||||||
LIST = $D6A5
|
|
||||||
LIST_0 = $D6DA
|
|
||||||
LIST_1 = $D6FE
|
|
||||||
LIST_2 = $D702
|
|
||||||
LIST_3 = $D724
|
|
||||||
GETCHR = $D72C
|
|
||||||
LIST_4 = $D734
|
|
||||||
FOR = $D766
|
|
||||||
STEP = $D7AF
|
|
||||||
NEWSTT = $D7D2
|
|
||||||
TRACE_ = $D805
|
|
||||||
GOEND = $D826
|
|
||||||
EXECUTE_STATEMENT=$D828
|
|
||||||
COLON_ = $D842
|
|
||||||
SYNERR_1 = $D846
|
|
||||||
SETDA = $D853
|
|
||||||
RTS_3 = $D857
|
|
||||||
ISCNTC = $D858
|
|
||||||
STOP = $D86E
|
|
||||||
END = $D870
|
|
||||||
END2 = $D871
|
|
||||||
END4 = $D88A
|
|
||||||
CONT = $D896
|
|
||||||
RTS_4 = $D8AF
|
|
||||||
SAVE = $D8B0
|
|
||||||
LOAD = $D8C9
|
|
||||||
VARTIO = $D8F0
|
|
||||||
PROGIO = $D901
|
|
||||||
RUN = $D912
|
|
||||||
GOSUB = $D921
|
|
||||||
GOTO = $D93E
|
|
||||||
RTS_5 = $D96A
|
|
||||||
POP = $D96B
|
|
||||||
UNDERR = $D97C
|
|
||||||
SYNERR_2 = $D981
|
|
||||||
RETURN = $D984
|
|
||||||
DATA = $D995
|
|
||||||
ADDON = $D998
|
|
||||||
RTS_6 = $D9A2
|
|
||||||
DATAN = $D9A3
|
|
||||||
REMN = $D9A6
|
|
||||||
PULL3 = $D9C5
|
|
||||||
IF = $D9C9
|
|
||||||
REM = $D9DC
|
|
||||||
ONGOTO = $D9EC
|
|
||||||
ON_1 = $D9F4
|
|
||||||
ON_2 = $D9F8
|
|
||||||
RTS_7 = $DA0B
|
|
||||||
LINGET = $DA0C
|
|
||||||
LET = $DA46
|
|
||||||
LET2 = $DA63
|
|
||||||
PUTSTR = $DA7B
|
|
||||||
PRINT = $DAD5
|
|
||||||
PRINT2 = $DAD7
|
|
||||||
CRDO = $DAFB
|
|
||||||
NEGATE = $DB00
|
|
||||||
RTS_8 = $DB02
|
|
||||||
NXSPC = $DB2C
|
|
||||||
DOSPC = $DB35
|
|
||||||
STROUT = $DB3A
|
|
||||||
STRPRT = $DB3D
|
|
||||||
OUTSP = $DB57
|
|
||||||
OUTQUES = $DB5A
|
|
||||||
OUTDO = $DB5C
|
|
||||||
ERLIN = $DB7F
|
|
||||||
INPERR = $DB86
|
|
||||||
GET = $DBA0
|
|
||||||
INPUT = $DBB2
|
|
||||||
NXIN = $DBDC
|
|
||||||
READ = $DBE2
|
|
||||||
INPFIN = $DC99
|
|
||||||
NEXT = $DCF9
|
|
||||||
NEXT_1 = $DCFF
|
|
||||||
NEXT_2 = $DD02
|
|
||||||
GERR = $DD0D
|
|
||||||
NEXT_3 = $DD0F
|
|
||||||
FRMNUM = $DD67
|
|
||||||
CHKNUM = $DD6A
|
|
||||||
CHKSTR = $DD6C
|
|
||||||
CHKVAL = $DD6D
|
|
||||||
JERROR = $DD78
|
|
||||||
FRMEVL = $DD7B
|
|
||||||
NXOP = $DDD6
|
|
||||||
SAVOP = $DDD7
|
|
||||||
PREFNC = $DDF6
|
|
||||||
SNTXERR = $DE0D
|
|
||||||
NOTMATH = $DE35
|
|
||||||
GOEX = $DE38
|
|
||||||
EXIT = $DE5D
|
|
||||||
STRTXT = $DE81
|
|
||||||
NOT_ = $DE90
|
|
||||||
EQUOP = $DE98
|
|
||||||
FN_ = $DEA4
|
|
||||||
SGN_ = $DEAB
|
|
||||||
PARCHK = $DEB2
|
|
||||||
CHKCLS = $DEB8
|
|
||||||
CHKOPN = $DEBB
|
|
||||||
CHKCOM = $DEBE
|
|
||||||
SYNCHR = $DEC0
|
|
||||||
SYNERR = $DEC9
|
|
||||||
MIN = $DECE
|
|
||||||
EQUL = $DED0
|
|
||||||
SCREEN = $DEF9
|
|
||||||
UNARY = $DF0C
|
|
||||||
OR_KWD = $DF4F
|
|
||||||
AND_KWD = $DF55
|
|
||||||
FALSE = $DF5D
|
|
||||||
TRUE = $DF60
|
|
||||||
RELOPS = $DF65
|
|
||||||
STRCMP = $DF7D
|
|
||||||
NUMCMP = $DFB0
|
|
||||||
PDL = $DFCD
|
|
||||||
NXDIM = $DFD6
|
|
||||||
DIM = $DFD9
|
|
||||||
PTRGET = $DFE3
|
|
||||||
BADNAM = $DFF4
|
|
||||||
NAMOK = $DFF7
|
|
||||||
ISLETC = $E07D
|
|
||||||
C_ZERO = $E09A
|
|
||||||
GETARY = $E0ED
|
|
||||||
NEG32768 = $E101
|
|
||||||
MAKINT = $E102
|
|
||||||
MKINT = $E108
|
|
||||||
AYINT = $E10C
|
|
||||||
MI1 = $E119
|
|
||||||
MI2 = $E11B
|
|
||||||
ARRAY = $E11E
|
|
||||||
SUBERR = $E196
|
|
||||||
IQERR = $E199
|
|
||||||
JER = $E19B
|
|
||||||
FAE_1 = $E253
|
|
||||||
GSE = $E269
|
|
||||||
GME = $E26C
|
|
||||||
FAE_2 = $E26F
|
|
||||||
FAE_3 = $E270
|
|
||||||
RTS_9 = $E2AC
|
|
||||||
MULTIPLY_SUBSCRIPT = $E2AD
|
|
||||||
FRE = $E2DE
|
|
||||||
GIVAYF = $E2F2
|
|
||||||
POS = $E2FF
|
|
||||||
SNGFLT = $E301
|
|
||||||
ERRDIR = $E306
|
|
||||||
UNDFNC = $E30E
|
|
||||||
DEF = $E313
|
|
||||||
FNC_ = $E341
|
|
||||||
FUNCT = $E354
|
|
||||||
STR = $E3C5
|
|
||||||
STRINI = $E3D5
|
|
||||||
STRSPA = $E3DD
|
|
||||||
STRLIT = $E3E7
|
|
||||||
STRLT2 = $E3ED
|
|
||||||
PUTNEW = $E42A
|
|
||||||
JERR = $E432
|
|
||||||
PUTEMP = $E435
|
|
||||||
GETSPA = $E452
|
|
||||||
GARBAG = $E484
|
|
||||||
CAT = $E597
|
|
||||||
MOVINS = $E5D4
|
|
||||||
MOVSTR = $E5E2
|
|
||||||
FRESTR = $E5FD
|
|
||||||
FREFAC = $E600
|
|
||||||
FRETMP = $E604
|
|
||||||
FRETMS = $E635
|
|
||||||
CHRSTR = $E646
|
|
||||||
MIDSTR = $E691
|
|
||||||
LEN = $E6D6
|
|
||||||
GETSTR = $E6DC
|
|
||||||
ASC = $E6E5
|
|
||||||
GOIQ = $E6F2
|
|
||||||
GTBYTC = $E6F5
|
|
||||||
GETBYT = $E6F8
|
|
||||||
CONINT = $E6FB
|
|
||||||
VAL = $E707
|
|
||||||
POINT = $E73D
|
|
||||||
GTNUM = $E746
|
|
||||||
COMBYTE = $E74C
|
|
||||||
GETADR = $E752
|
|
||||||
PEEK = $E764
|
|
||||||
POKE = $E77B
|
|
||||||
WAIT = $E784
|
|
||||||
RTS_10 = $E79F
|
|
||||||
FADDH = $E7A0
|
|
||||||
FSUB = $E7A7
|
|
||||||
FSUBT = $E7AA
|
|
||||||
FADD_1 = $E7B9
|
|
||||||
FADD = $E7BE
|
|
||||||
FADDT = $E7C1
|
|
||||||
FADD_2 = $E7CE
|
|
||||||
FADD_3 = $E7FA
|
|
||||||
FADD_4 = $E855
|
|
||||||
RTS_11 = $E89D
|
|
||||||
RTS_12 = $E8D4
|
|
||||||
CON_ONE = $E916
|
|
||||||
POLY_LOG = $E918
|
|
||||||
CON_SQR_HALF = $E930
|
|
||||||
CON_SQR_TWO = $E935
|
|
||||||
CON_NEG_HALF = $E93A
|
|
||||||
CON_LOG_TWO = $E93F
|
|
||||||
LOG = $E941
|
|
||||||
GIQ = $E948
|
|
||||||
LOG_2 = $E94B
|
|
||||||
FMULT = $E97F
|
|
||||||
FMULTT = $E982
|
|
||||||
RTS_13 = $E9E2
|
|
||||||
ZERO = $EA31
|
|
||||||
JOV = $EA36
|
|
||||||
MUL10 = $EA39
|
|
||||||
CON_TEN = $EA53
|
|
||||||
DIV10 = $EA55
|
|
||||||
DIV = $EA5E
|
|
||||||
FDIV = $EA66
|
|
||||||
FDIVT = $EA69
|
|
||||||
SETFOR = $EB27
|
|
||||||
MFA = $EB55
|
|
||||||
MAF = $EB66
|
|
||||||
RTS_14 = $EB71
|
|
||||||
SIGN = $EB82
|
|
||||||
SIGN1 = $EB86
|
|
||||||
SIGN2 = $EB88
|
|
||||||
RTS_15 = $EB8F
|
|
||||||
SGN = $EB90
|
|
||||||
FLOAT = $EB93
|
|
||||||
ABS = $EBAF
|
|
||||||
FCOMP = $EBB2
|
|
||||||
FCOMP2 = $EBB4
|
|
||||||
QINT = $EBF2
|
|
||||||
RTS_16 = $EC11
|
|
||||||
QINT_2 = $EC12
|
|
||||||
INT = $EC23
|
|
||||||
QINT_3 = $EC40
|
|
||||||
RTS_17 = $EC49
|
|
||||||
FIN = $EC4A
|
|
||||||
FIN_1 = $EC61
|
|
||||||
FIN_2 = $EC64
|
|
||||||
FIN_3 = $EC66
|
|
||||||
FIN_4 = $EC87
|
|
||||||
FIN_5 = $EC8A
|
|
||||||
FIN_6 = $EC8C
|
|
||||||
FIN_10 = $EC98
|
|
||||||
FIN_7 = $EC9E
|
|
||||||
FIN_8 = $ECA0
|
|
||||||
FIN_9 = $ECC1
|
|
||||||
ADDACC = $ECD5
|
|
||||||
GETEXP = $ECE8
|
|
||||||
CON_99999999_9 = $ED0D
|
|
||||||
CON_999999999 = $ED12
|
|
||||||
CON_BILLION = $ED17
|
|
||||||
INPRT = $ED19
|
|
||||||
LINPRT = $ED24
|
|
||||||
FOUT = $ED34
|
|
||||||
FOUT_1 = $ED36
|
|
||||||
FOUT_2 = $ED8C
|
|
||||||
FOUT_3 = $EE17
|
|
||||||
FOUT_4 = $EE57
|
|
||||||
FOUT_5 = $EE5A
|
|
||||||
FOUT_6 = $EE5F
|
|
||||||
CON_HALF = $EE67
|
|
||||||
DECTBL = $EE6C
|
|
||||||
SQR = $EE8D
|
|
||||||
FPWRT = $EE97
|
|
||||||
NEGOP = $EED0
|
|
||||||
RTS_18 = $EEDA
|
|
||||||
CON_LOG_E = $EEDE
|
|
||||||
POLY_EXP = $EEE0
|
|
||||||
EXP = $EF09
|
|
||||||
RTS_19 = $EFA5
|
|
||||||
CON_RND_1 = $EFA9
|
|
||||||
CON_RND_2 = $EFAD
|
|
||||||
RND = $EFAE
|
|
||||||
GO_MOVMF = $EFE7
|
|
||||||
COS = $EFEA
|
|
||||||
SIN = $EFF1
|
|
||||||
SIN_1 = $F023
|
|
||||||
SIN_2 = $F026
|
|
||||||
TAN = $F03A
|
|
||||||
TAN_1 = $F062
|
|
||||||
CON_PI_HALF = $F069
|
|
||||||
CON_PI_DOUB = $F06E
|
|
||||||
QUARTER = $F073
|
|
||||||
POLY_SIN = $F075
|
|
||||||
ATN = $F09E
|
|
||||||
RTS_20 = $F0CD
|
|
||||||
POLY_ATN = $F0CE
|
|
||||||
CALL = $F1D5
|
|
||||||
GOERR = $F206
|
|
||||||
PLOT = $F225
|
|
||||||
HLIN = $F232
|
|
||||||
VLIN = $F241
|
|
||||||
COLOR = $F24F
|
|
||||||
VTAB = $F256
|
|
||||||
SPEED = $F262
|
|
||||||
TRACE = $F26D
|
|
||||||
NORMAL = $F273
|
|
||||||
N_I_ = $F279
|
|
||||||
N_I_F_ = $F27B
|
|
||||||
FLASH = $F280
|
|
||||||
HIMEM = $F286
|
|
||||||
JMM = $F296
|
|
||||||
SETHI = $F299
|
|
||||||
LOMEM = $F2A6
|
|
||||||
ONERR = $F2CB
|
|
||||||
RESUME = $F318
|
|
||||||
JSYN = $F32E
|
|
||||||
DEL = $F331
|
|
||||||
GR = $F390
|
|
||||||
TEXT = $F399
|
|
||||||
STORE = $F39F
|
|
||||||
RECALL = $F3BC
|
|
||||||
HGR2 = $F3D8
|
|
||||||
HGR = $F3E2
|
|
||||||
SETHPG = $F3EA
|
|
||||||
HCLR = $F3F2
|
|
||||||
BKGND = $F3F6
|
|
||||||
HPOSN = $F411
|
|
||||||
HPLOT0 = $F457
|
|
||||||
LR_1 = $F46E
|
|
||||||
LR_2 = $F471
|
|
||||||
LR_3 = $F476
|
|
||||||
LR_4 = $F478
|
|
||||||
LRUDX1 = $F49C
|
|
||||||
LRUDX2 = $F49D
|
|
||||||
LRUD1 = $F4B3
|
|
||||||
LRUD2 = $F4B4
|
|
||||||
LRUD3 = $F4C4
|
|
||||||
LRUD4 = $F4C8
|
|
||||||
UD_1 = $F501
|
|
||||||
HLINRL = $F530
|
|
||||||
HGLIN = $F53A
|
|
||||||
MOVEX = $F57C
|
|
||||||
MOVEX2 = $F581
|
|
||||||
MSKTBL = $F5B8
|
|
||||||
CON_1C = $F5B9
|
|
||||||
HFIND = $F5CB
|
|
||||||
RTS_22 = $F600
|
|
||||||
DRAW0 = $F601
|
|
||||||
DRAW1 = $F605
|
|
||||||
XDRAW0 = $F65D
|
|
||||||
XDRAW1 = $F661
|
|
||||||
HFNS = $F6B9
|
|
||||||
GGERR = $F6E6
|
|
||||||
HCOLOR = $F6E9
|
|
||||||
RTS_23 = $F6F5
|
|
||||||
COLORTBL = $F6FC
|
|
||||||
HPLOT = $F6FE
|
|
||||||
ROT = $F721
|
|
||||||
SCALE = $F727
|
|
||||||
DRWPNT = $F72D
|
|
||||||
DRAW = $F769
|
|
||||||
XDRAW = $F76F
|
|
||||||
SHLOAD = $F775
|
|
||||||
HTAB = $F7E7
|
|
||||||
|
|
||||||
STACK = $100
|
|
||||||
INPUT_BUFFER = $200
|
|
||||||
AMPERSAND_VECTOR = $3F5
|
|
||||||
KEYBOARD = $C000
|
|
||||||
SW_TXTCLR = $C050
|
|
||||||
SW_MIXCLR = $C052
|
|
||||||
SW_MIXSET = $C053
|
|
||||||
SW_LOWSCR = $C054
|
|
||||||
SW_HISCR = $C055
|
|
||||||
SW_LORES = $C056
|
|
||||||
SW_HIRES = $C057
|
|
||||||
MON_PLOT = $F800
|
|
||||||
MON_HLINE = $F819
|
|
||||||
MON_VLINE = $F828
|
|
||||||
MON_SETCOL = $F864
|
|
||||||
MON_SCRN = $F871
|
|
||||||
MON_PREAD = $FB1E
|
|
||||||
MON_SETTXT = $FB39
|
|
||||||
MON_SETGR = $FB40
|
|
||||||
MON_TABV = $FB5B
|
|
||||||
MON_HOME = $FC58
|
|
||||||
MON_WAIT = $FCA8
|
|
||||||
MON_RD2BIT = $FCFA
|
|
||||||
MON_RDKEY = $FD0C
|
|
||||||
MON_GETLN = $FD6A
|
|
||||||
MON_COUT = $FDED
|
|
||||||
MON_INPORT = $FE8B
|
|
||||||
MON_OUTPORT = $FE95
|
|
||||||
MON_WRITE = $FECD
|
|
||||||
MON_READ = $FEFD
|
|
||||||
MON_READ2 = $FF02
|
|
||||||
TOKEN_FOR = $81
|
|
||||||
TOKEN_DATA = $83
|
|
||||||
TOKEN_POP = $A1
|
|
||||||
TOKEN_GOTO = $AB
|
|
||||||
TOKEN_GOSUB = $B0
|
|
||||||
TOKEN_REM = $B2
|
|
||||||
TOKEN_PRINT = $BA
|
|
||||||
TOKEN_TAB = $C0
|
|
||||||
TOKEN_TO = $C1
|
|
||||||
TOKEN_FN = $C2
|
|
||||||
TOKEN_SPC = $C3
|
|
||||||
TOKEN_THEN = $C4
|
|
||||||
TOKEN_AT = $C5
|
|
||||||
TOKEN_NOT = $C6
|
|
||||||
TOKEN_STEP = $C7
|
|
||||||
TOKEN_PLUS = $C8
|
|
||||||
TOKEN_MINUS = $C9
|
|
||||||
TOKEN_GREATER = $CF
|
|
||||||
TOKEN_EQUAL = $D0
|
|
||||||
TOKEN_SGN = $D2
|
|
||||||
TOKEN_SCRN = $D7
|
|
||||||
TOKEN_LEFTSTR = $E8
|
|
|
@ -1,28 +0,0 @@
|
||||||
KEYCODE_SLASH=('/'+$80)
|
|
||||||
KEYCODE_DOWN=$8a
|
|
||||||
KEYCODE_UP=$8b
|
|
||||||
KEYCODE_LEFT=$88
|
|
||||||
KEYCODE_RIGHT=$95
|
|
||||||
KEYCODE_ABORT=$9B
|
|
||||||
.define KEYNAME_ABORT "ESC"
|
|
||||||
.export KEYCODE_ABORT
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR a2keycodes.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,36 +0,0 @@
|
||||||
KEYCODE_SLASH=$2f
|
|
||||||
KEYCODE_DOWN=$11
|
|
||||||
KEYCODE_UP=$91
|
|
||||||
KEYCODE_LEFT=$9d
|
|
||||||
KEYCODE_RIGHT=$1d
|
|
||||||
KEYCODE_F1=$85
|
|
||||||
KEYCODE_F2=$89
|
|
||||||
KEYCODE_F3=$86
|
|
||||||
KEYCODE_F4=$8a
|
|
||||||
KEYCODE_F5=$87
|
|
||||||
KEYCODE_F6=$8b
|
|
||||||
KEYCODE_F7=$88
|
|
||||||
KEYCODE_F8=$8c
|
|
||||||
KEYCODE_ABORT=$03 ;RUN/STOP
|
|
||||||
.define KEYNAME_ABORT "RUN/STOP"
|
|
||||||
.export KEYCODE_ABORT
|
|
||||||
.export KEYCODE_F1
|
|
||||||
|
|
||||||
;-- LICENSE FOR c64keycodes.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,212 +0,0 @@
|
||||||
|
|
||||||
.import dns_ip
|
|
||||||
.import dns_resolve
|
|
||||||
.import dns_set_hostname
|
|
||||||
.import cfg_default_drive
|
|
||||||
.bss
|
|
||||||
temp_ax: .res 2
|
|
||||||
.code
|
|
||||||
|
|
||||||
configuration_menu:
|
|
||||||
jsr cls
|
|
||||||
@show_config_menu:
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #config_menu_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_ip_config
|
|
||||||
jsr print_default_drive
|
|
||||||
jsr print_cr
|
|
||||||
@get_key_config_menu:
|
|
||||||
jsr get_key_ip65
|
|
||||||
cmp #KEYCODE_ABORT
|
|
||||||
bne @not_abort
|
|
||||||
rts
|
|
||||||
@not_abort:
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne @not_ip
|
|
||||||
ldax #new
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #ip_address_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #filter_ip
|
|
||||||
ldy #20
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_ip_address_entered
|
|
||||||
jsr parse_dotted_quad
|
|
||||||
bcc @no_ip_resolve_error
|
|
||||||
jmp configuration_menu
|
|
||||||
@no_ip_resolve_error:
|
|
||||||
ldax #dotted_quad_value
|
|
||||||
stax copy_src
|
|
||||||
ldax #cfg_ip
|
|
||||||
stax copy_dest
|
|
||||||
ldax #4
|
|
||||||
jsr copymem
|
|
||||||
@no_ip_address_entered:
|
|
||||||
jmp configuration_menu
|
|
||||||
|
|
||||||
@not_ip:
|
|
||||||
cmp #KEYCODE_F2
|
|
||||||
bne @not_netmask
|
|
||||||
ldax #new
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #netmask_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #filter_ip
|
|
||||||
ldy #20
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_netmask_entered
|
|
||||||
jsr parse_dotted_quad
|
|
||||||
bcc @no_netmask_resolve_error
|
|
||||||
jmp configuration_menu
|
|
||||||
@no_netmask_resolve_error:
|
|
||||||
ldax #dotted_quad_value
|
|
||||||
stax copy_src
|
|
||||||
ldax #cfg_netmask
|
|
||||||
stax copy_dest
|
|
||||||
ldax #4
|
|
||||||
jsr copymem
|
|
||||||
@no_netmask_entered:
|
|
||||||
jmp configuration_menu
|
|
||||||
|
|
||||||
@not_netmask:
|
|
||||||
cmp #KEYCODE_F3
|
|
||||||
bne @not_gateway
|
|
||||||
ldax #new
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #gateway_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #filter_ip
|
|
||||||
ldy #20
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_gateway_entered
|
|
||||||
jsr parse_dotted_quad
|
|
||||||
bcc @no_gateway_resolve_error
|
|
||||||
jmp configuration_menu
|
|
||||||
@no_gateway_resolve_error:
|
|
||||||
ldax #dotted_quad_value
|
|
||||||
stax copy_src
|
|
||||||
ldax #cfg_gateway
|
|
||||||
stax copy_dest
|
|
||||||
ldax #4
|
|
||||||
jsr copymem
|
|
||||||
jsr arp_calculate_gateway_mask ;we have modified our netmask, so we need to recalculate gw_test
|
|
||||||
@no_gateway_entered:
|
|
||||||
jmp configuration_menu
|
|
||||||
|
|
||||||
|
|
||||||
@not_gateway:
|
|
||||||
cmp #KEYCODE_F4
|
|
||||||
bne @not_dns_server
|
|
||||||
ldax #new
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #dns_server_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #filter_ip
|
|
||||||
ldy #20
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_dns_server_entered
|
|
||||||
jsr parse_dotted_quad
|
|
||||||
bcc @no_dns_resolve_error
|
|
||||||
jmp configuration_menu
|
|
||||||
@no_dns_resolve_error:
|
|
||||||
ldax #dotted_quad_value
|
|
||||||
stax copy_src
|
|
||||||
ldax #cfg_dns
|
|
||||||
stax copy_dest
|
|
||||||
ldax #4
|
|
||||||
jsr copymem
|
|
||||||
@no_dns_server_entered:
|
|
||||||
|
|
||||||
jmp configuration_menu
|
|
||||||
|
|
||||||
@not_dns_server:
|
|
||||||
cmp #KEYCODE_F5
|
|
||||||
bne @not_tftp_server
|
|
||||||
ldax #new
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #tftp_server_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #filter_dns
|
|
||||||
ldy #40
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_server_entered
|
|
||||||
stax temp_ax
|
|
||||||
jsr print_cr
|
|
||||||
ldax #resolving
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax temp_ax
|
|
||||||
jsr dns_set_hostname
|
|
||||||
bcs @resolve_error
|
|
||||||
jsr dns_resolve
|
|
||||||
bcs @resolve_error
|
|
||||||
|
|
||||||
ldax #dns_ip
|
|
||||||
stax copy_src
|
|
||||||
ldax #cfg_tftp_server
|
|
||||||
stax copy_dest
|
|
||||||
ldax #4
|
|
||||||
jsr copymem
|
|
||||||
@no_server_entered:
|
|
||||||
jmp configuration_menu
|
|
||||||
|
|
||||||
@not_tftp_server:
|
|
||||||
|
|
||||||
|
|
||||||
cmp #KEYCODE_F6
|
|
||||||
bne @not_reset
|
|
||||||
jsr ip65_init ;this will reset everything
|
|
||||||
jmp configuration_menu
|
|
||||||
@not_reset:
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
bne @not_main_menu
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
@not_main_menu:
|
|
||||||
|
|
||||||
cmp #'+'
|
|
||||||
bne @not_plus
|
|
||||||
inc cfg_default_drive
|
|
||||||
jmp @show_config_menu
|
|
||||||
@not_plus:
|
|
||||||
|
|
||||||
cmp #'-'
|
|
||||||
bne @not_minus
|
|
||||||
dec cfg_default_drive
|
|
||||||
jmp @show_config_menu
|
|
||||||
|
|
||||||
@not_minus:
|
|
||||||
|
|
||||||
jmp @get_key_config_menu
|
|
||||||
|
|
||||||
@resolve_error:
|
|
||||||
print_failed
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp configuration_menu
|
|
||||||
|
|
||||||
|
|
||||||
print_default_drive:
|
|
||||||
ldax #default_drive
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda cfg_default_drive
|
|
||||||
jsr print_hex
|
|
||||||
jmp print_cr
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
config_menu_msg:
|
|
||||||
.byte 10,"Configuration",10,10
|
|
||||||
.byte "F1: IP Address F2: Netmask",10
|
|
||||||
.byte "F3: Gateway F4: DNS Server",10
|
|
||||||
.byte "F5: TFTP Server F6: Reset To Default",10
|
|
||||||
.byte "F7: Main Menu +/- Drive #",10,10
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
default_drive:
|
|
||||||
.byte "Use Drive # : $",0
|
|
|
@ -1,268 +0,0 @@
|
||||||
|
|
||||||
.import io_track_no
|
|
||||||
.import io_sector_no
|
|
||||||
.import io_write_sector
|
|
||||||
.import io_read_sector
|
|
||||||
|
|
||||||
|
|
||||||
.segment "APP_SCRATCH"
|
|
||||||
track: .res 1
|
|
||||||
sector: .res 1
|
|
||||||
errors: .res 1
|
|
||||||
sectors_in_track: .res 1
|
|
||||||
sector_buffer_address: .res 2
|
|
||||||
output_buffer_address: .res 2
|
|
||||||
;the io_* and tftp_* routines both use the 'output_buffer' so we lose the data in the second sector
|
|
||||||
;therefore we need to copy the data to here before we use it
|
|
||||||
sector_buffer: .res 512
|
|
||||||
|
|
||||||
.code
|
|
||||||
download_d64:
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
jsr cls
|
|
||||||
ldax #downloading_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr reset_counters_to_first_sector
|
|
||||||
ldax #write_next_block
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_TFTP_CALLBACK_DOWNLOAD
|
|
||||||
after_tftp_transfer:
|
|
||||||
bcc :+
|
|
||||||
jsr print_cr
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_cr
|
|
||||||
:
|
|
||||||
print_ok
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print
|
|
||||||
jsr get_key
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
upload_d64:
|
|
||||||
ldax #enter_filename
|
|
||||||
jsr print
|
|
||||||
kippercall #KPR_INPUT_HOSTNAME ;the 'hostname' filter is pretty close to being a filter for legal chars in file names as well
|
|
||||||
bcc :+
|
|
||||||
rts
|
|
||||||
:
|
|
||||||
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
jsr cls
|
|
||||||
;switch to lower case charset
|
|
||||||
lda #23
|
|
||||||
sta $d018
|
|
||||||
ldax #uploading_msg
|
|
||||||
jsr print
|
|
||||||
ldax kipper_param_buffer+KPR_TFTP_FILENAME
|
|
||||||
jsr print
|
|
||||||
jsr reset_counters_to_first_sector
|
|
||||||
ldax #read_next_block
|
|
||||||
stax kipper_param_buffer+KPR_TFTP_POINTER
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_TFTP_CALLBACK_UPLOAD
|
|
||||||
jmp after_tftp_transfer
|
|
||||||
|
|
||||||
copy_sector_buffer_to_output_buffer:
|
|
||||||
ldax #sector_buffer
|
|
||||||
stax copy_src
|
|
||||||
ldax output_buffer_address
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$200
|
|
||||||
jmp copymem
|
|
||||||
|
|
||||||
read_next_block:
|
|
||||||
;tftp upload callback routine
|
|
||||||
;AX will point to address to fill
|
|
||||||
stax output_buffer_address
|
|
||||||
ldax #sector_buffer
|
|
||||||
stax sector_buffer_address
|
|
||||||
|
|
||||||
lda track
|
|
||||||
cmp #36
|
|
||||||
beq @past_last_track
|
|
||||||
jsr read_sector
|
|
||||||
bcc @not_last_sector
|
|
||||||
jsr copy_sector_buffer_to_output_buffer
|
|
||||||
ldax #$100
|
|
||||||
rts
|
|
||||||
@not_last_sector:
|
|
||||||
inc sector_buffer_address+1
|
|
||||||
ldax sector_buffer_address
|
|
||||||
jsr read_sector
|
|
||||||
jsr copy_sector_buffer_to_output_buffer
|
|
||||||
ldax #$200
|
|
||||||
rts
|
|
||||||
@past_last_track:
|
|
||||||
ldax #$0000
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
save_sector:
|
|
||||||
ldax #position_cursor_for_track_display
|
|
||||||
jsr print
|
|
||||||
jsr print_current_sector
|
|
||||||
|
|
||||||
lda track
|
|
||||||
sta io_track_no
|
|
||||||
|
|
||||||
lda sector
|
|
||||||
sta io_sector_no
|
|
||||||
|
|
||||||
ldax sector_buffer_address
|
|
||||||
jsr io_write_sector
|
|
||||||
bcc :+
|
|
||||||
inc errors
|
|
||||||
:
|
|
||||||
jmp move_to_next_sector
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
read_sector:
|
|
||||||
ldax #position_cursor_for_track_display
|
|
||||||
jsr print
|
|
||||||
jsr print_current_sector
|
|
||||||
|
|
||||||
lda track
|
|
||||||
sta io_track_no
|
|
||||||
|
|
||||||
lda sector
|
|
||||||
sta io_sector_no
|
|
||||||
|
|
||||||
ldax sector_buffer_address
|
|
||||||
jsr io_read_sector
|
|
||||||
bcc :+
|
|
||||||
inc errors
|
|
||||||
:
|
|
||||||
jmp move_to_next_sector
|
|
||||||
|
|
||||||
write_next_block:
|
|
||||||
;tftp download callback routine
|
|
||||||
;AX will point at block to be written (prepended with 2 bytes indicating block length)
|
|
||||||
clc
|
|
||||||
adc #02 ;skip the 2 byte length at start of buffer
|
|
||||||
bcc :+
|
|
||||||
inx
|
|
||||||
:
|
|
||||||
stax copy_src
|
|
||||||
ldax #sector_buffer
|
|
||||||
stax copy_dest
|
|
||||||
stax sector_buffer_address
|
|
||||||
ldax #$200
|
|
||||||
jsr copymem
|
|
||||||
jsr save_sector
|
|
||||||
|
|
||||||
bcc @not_last_sector
|
|
||||||
rts
|
|
||||||
@not_last_sector:
|
|
||||||
inc sector_buffer_address+1
|
|
||||||
jsr save_sector
|
|
||||||
rts
|
|
||||||
|
|
||||||
@past_last_track:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
print_current_sector:
|
|
||||||
ldax #track_no
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda track
|
|
||||||
jsr print_hex
|
|
||||||
ldax #sector_no
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda sector
|
|
||||||
jsr print_hex
|
|
||||||
ldax #errors_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda errors
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
reset_counters_to_first_sector:
|
|
||||||
ldx #1
|
|
||||||
stx track
|
|
||||||
dex
|
|
||||||
stx sector
|
|
||||||
stx errors
|
|
||||||
ldx #21
|
|
||||||
stx sectors_in_track
|
|
||||||
rts
|
|
||||||
|
|
||||||
move_to_next_sector:
|
|
||||||
inc sector
|
|
||||||
lda sector
|
|
||||||
cmp sectors_in_track
|
|
||||||
beq @move_to_next_track
|
|
||||||
rts
|
|
||||||
@move_to_next_track:
|
|
||||||
lda #0
|
|
||||||
sta sector
|
|
||||||
inc track
|
|
||||||
lda track
|
|
||||||
cmp #18
|
|
||||||
bne @not_track_18
|
|
||||||
lda #19
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@not_track_18:
|
|
||||||
cmp #25
|
|
||||||
bne @not_track_25
|
|
||||||
lda #18
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@not_track_25:
|
|
||||||
cmp #31
|
|
||||||
bne @not_track_31
|
|
||||||
lda #17
|
|
||||||
sta sectors_in_track
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
@not_track_31:
|
|
||||||
lda track
|
|
||||||
cmp #36 ;carry will be set if hit track 36
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
track_no:
|
|
||||||
.byte "TRACK $",0
|
|
||||||
|
|
||||||
sector_no:
|
|
||||||
.byte " SECTOR $",0
|
|
||||||
errors_msg:
|
|
||||||
.byte " ERRORS $",0
|
|
||||||
position_cursor_for_track_display:
|
|
||||||
.byte $13,13,13,0
|
|
||||||
position_cursor_for_error_display:
|
|
||||||
.byte $13,13,13,0
|
|
||||||
enter_filename: .asciiz "FILENAME: "
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR disk_transfer.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,680 +0,0 @@
|
||||||
; C64 gopher browser
|
|
||||||
; july 2009 - jonno @ jamtronix.com
|
|
||||||
; this contains the key gopher rendering routines
|
|
||||||
; to use:
|
|
||||||
; 1) include this file
|
|
||||||
; 2) include these other files:
|
|
||||||
; .include "../inc/common.i"
|
|
||||||
; .include "../inc/commonprint.i"
|
|
||||||
; .include "../inc/net.i"
|
|
||||||
; .include "../inc/char_conv.i"
|
|
||||||
; .include "../inc/c64keycodes.i"
|
|
||||||
; 3) define a routine called 'exit_gopher'
|
|
||||||
|
|
||||||
|
|
||||||
.import get_key_if_available
|
|
||||||
.import mul_8_16
|
|
||||||
.importzp acc16
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import copymem
|
|
||||||
.import ascii_to_native
|
|
||||||
.import dns_ip
|
|
||||||
.import dns_resolve
|
|
||||||
.import dns_set_hostname
|
|
||||||
.import ip65_error
|
|
||||||
.import cls
|
|
||||||
.import get_filtered_input
|
|
||||||
.import filter_dns
|
|
||||||
.import filter_text
|
|
||||||
.importzp screen_current_row
|
|
||||||
.importzp screen_current_col
|
|
||||||
.import print_a_inverse
|
|
||||||
|
|
||||||
.import telnet_port
|
|
||||||
.import telnet_ip
|
|
||||||
.import telnet_connect
|
|
||||||
.import telnet_use_native_charset
|
|
||||||
|
|
||||||
.import url_ip
|
|
||||||
.import url_port
|
|
||||||
.import url_selector
|
|
||||||
.import url_resource_type
|
|
||||||
.import url_parse
|
|
||||||
.import url_download
|
|
||||||
.import url_download_buffer
|
|
||||||
.import url_download_buffer_length
|
|
||||||
.import resource_download
|
|
||||||
|
|
||||||
.segment "IP65ZP" : zeropage
|
|
||||||
|
|
||||||
; pointer for moving through buffers
|
|
||||||
buffer_ptr: .res 2 ; source pointer
|
|
||||||
|
|
||||||
.data
|
|
||||||
get_next_byte:
|
|
||||||
lda $ffff
|
|
||||||
inc get_next_byte+1
|
|
||||||
bne :+
|
|
||||||
inc get_next_byte+2
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
current_resource_history_entry: .byte 0
|
|
||||||
|
|
||||||
.segment "APP_SCRATCH"
|
|
||||||
|
|
||||||
DISPLAY_LINES=22
|
|
||||||
page_counter: .res 1
|
|
||||||
MAX_PAGES = 50
|
|
||||||
page_pointer_lo: .res MAX_PAGES
|
|
||||||
page_pointer_hi: .res MAX_PAGES
|
|
||||||
|
|
||||||
resource_counter: .res 1
|
|
||||||
MAX_RESOURCES = DISPLAY_LINES
|
|
||||||
|
|
||||||
resource_pointer_lo: .res MAX_RESOURCES
|
|
||||||
resource_pointer_hi: .res MAX_RESOURCES
|
|
||||||
resource_type: .res MAX_RESOURCES
|
|
||||||
|
|
||||||
download_flag: .res 1
|
|
||||||
dl_loop_counter: .res 2
|
|
||||||
this_is_last_page: .res 1
|
|
||||||
|
|
||||||
|
|
||||||
;temp_ax: .res 2
|
|
||||||
|
|
||||||
RESOURCE_HOSTNAME_MAX_LENGTH=64
|
|
||||||
current_resource:
|
|
||||||
resource_hostname: .res RESOURCE_HOSTNAME_MAX_LENGTH
|
|
||||||
resource_port: .res 2
|
|
||||||
resource_selector: .res 128
|
|
||||||
resource_selector_length: .res 1
|
|
||||||
displayed_resource_type: .res 1
|
|
||||||
|
|
||||||
|
|
||||||
RESOURCE_HISTORY_ENTRIES=8
|
|
||||||
resource_history:
|
|
||||||
.res $100*RESOURCE_HISTORY_ENTRIES
|
|
||||||
|
|
||||||
scratch_buffer_length=GOPHER_BUFFER_SIZE
|
|
||||||
scratch_buffer:
|
|
||||||
.res scratch_buffer_length
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
;display whatever is in the buffer either as plain text or gopher text
|
|
||||||
|
|
||||||
display_resource_in_buffer:
|
|
||||||
ldax #scratch_buffer
|
|
||||||
stax get_next_byte+1
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta page_counter
|
|
||||||
|
|
||||||
@do_one_page:
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
; ldax #page_header
|
|
||||||
; jsr print
|
|
||||||
; lda page_counter
|
|
||||||
; jsr print_hex
|
|
||||||
|
|
||||||
; jsr print_resource_description
|
|
||||||
ldx page_counter
|
|
||||||
lda get_next_byte+1
|
|
||||||
sta page_pointer_lo,x
|
|
||||||
lda get_next_byte+2
|
|
||||||
sta page_pointer_hi,x
|
|
||||||
inc page_counter
|
|
||||||
|
|
||||||
|
|
||||||
lda displayed_resource_type
|
|
||||||
cmp #'0'
|
|
||||||
bne @displayed_resource_is_directory
|
|
||||||
|
|
||||||
;if this is a text file, just convert ascii->petscii and print to screen
|
|
||||||
@show_one_char:
|
|
||||||
jsr get_next_byte
|
|
||||||
tax ;this sets Z flag
|
|
||||||
bne :+
|
|
||||||
lda #1
|
|
||||||
sta this_is_last_page
|
|
||||||
jmp @get_keypress
|
|
||||||
:
|
|
||||||
|
|
||||||
jsr ascii_to_native
|
|
||||||
jsr print_a
|
|
||||||
lda screen_current_row
|
|
||||||
cmp #DISPLAY_LINES
|
|
||||||
bmi @show_one_char
|
|
||||||
jmp @end_of_current_page
|
|
||||||
|
|
||||||
@displayed_resource_is_directory:
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta resource_counter
|
|
||||||
|
|
||||||
@next_line:
|
|
||||||
jsr get_next_byte
|
|
||||||
cmp #0
|
|
||||||
beq @last_line
|
|
||||||
cmp #'.'
|
|
||||||
bne @not_last_line
|
|
||||||
@last_line:
|
|
||||||
lda #1
|
|
||||||
sta this_is_last_page
|
|
||||||
jmp @done
|
|
||||||
@not_last_line:
|
|
||||||
cmp #'i'
|
|
||||||
beq @info_line
|
|
||||||
cmp #'0'
|
|
||||||
beq @standard_resource
|
|
||||||
cmp #'1'
|
|
||||||
beq @standard_resource
|
|
||||||
cmp #'7'
|
|
||||||
beq @standard_resource
|
|
||||||
cmp #'8'
|
|
||||||
beq @standard_resource
|
|
||||||
|
|
||||||
;if we got here, we know not what it is
|
|
||||||
jmp @skip_to_end_of_line
|
|
||||||
@standard_resource:
|
|
||||||
pha
|
|
||||||
ldx resource_counter
|
|
||||||
sta resource_type,x
|
|
||||||
sec
|
|
||||||
lda get_next_byte+1
|
|
||||||
sbc #1 ;since "get_next_byte" did the inc, we need to backtrack 1 byte
|
|
||||||
sta resource_pointer_lo,x
|
|
||||||
lda get_next_byte+2
|
|
||||||
sbc #0 ;in case there was an overflow on the low byte
|
|
||||||
sta resource_pointer_hi,x
|
|
||||||
inc resource_counter
|
|
||||||
|
|
||||||
lda screen_current_col ;are we at the start of the current line?
|
|
||||||
beq :+
|
|
||||||
|
|
||||||
jsr print_cr
|
|
||||||
:
|
|
||||||
pla ;get back the resource type
|
|
||||||
|
|
||||||
lda resource_counter
|
|
||||||
clc
|
|
||||||
adc #'a'-1
|
|
||||||
jsr print_a_inverse
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
@info_line:
|
|
||||||
@print_until_tab:
|
|
||||||
@next_byte:
|
|
||||||
jsr get_next_byte
|
|
||||||
cmp #0
|
|
||||||
beq @last_line
|
|
||||||
|
|
||||||
cmp #$09
|
|
||||||
beq @skip_to_end_of_line
|
|
||||||
jsr ascii_to_native
|
|
||||||
jsr print_a
|
|
||||||
jmp @next_byte
|
|
||||||
|
|
||||||
@skip_to_end_of_line:
|
|
||||||
jsr get_next_byte
|
|
||||||
cmp #0
|
|
||||||
beq @last_line
|
|
||||||
|
|
||||||
cmp #$0A
|
|
||||||
bne @skip_to_end_of_line
|
|
||||||
|
|
||||||
lda screen_current_col
|
|
||||||
cmp #0
|
|
||||||
beq :+
|
|
||||||
jsr print_cr
|
|
||||||
:
|
|
||||||
lda screen_current_row
|
|
||||||
cmp #DISPLAY_LINES
|
|
||||||
bpl @end_of_current_page
|
|
||||||
jmp @next_line
|
|
||||||
|
|
||||||
@end_of_current_page:
|
|
||||||
lda #0
|
|
||||||
sta this_is_last_page
|
|
||||||
@done:
|
|
||||||
@get_keypress:
|
|
||||||
jsr ip65_process ;keep polling the network, so we respond to arps/pings/late packets etc etc
|
|
||||||
jsr get_key_if_available
|
|
||||||
cmp #' '
|
|
||||||
beq @go_next_page
|
|
||||||
cmp #KEY_NEXT_PAGE
|
|
||||||
beq @go_next_page
|
|
||||||
cmp #KEYCODE_DOWN
|
|
||||||
beq @go_next_page
|
|
||||||
cmp #KEY_PREV_PAGE
|
|
||||||
beq @go_prev_page
|
|
||||||
cmp #KEYCODE_UP
|
|
||||||
beq @go_prev_page
|
|
||||||
cmp #KEY_SHOW_HISTORY
|
|
||||||
beq @show_history
|
|
||||||
cmp #KEYCODE_LEFT
|
|
||||||
beq @back_in_history
|
|
||||||
cmp #KEY_BACK_IN_HISTORY
|
|
||||||
beq @back_in_history
|
|
||||||
cmp #KEY_NEW_SERVER
|
|
||||||
beq @prompt_for_new_server
|
|
||||||
|
|
||||||
cmp #KEYCODE_ABORT
|
|
||||||
beq @quit
|
|
||||||
;if fallen through we don't know what the keypress means, go get another one
|
|
||||||
and #$7f ;turn off the high bit
|
|
||||||
sec
|
|
||||||
sbc #$40
|
|
||||||
bmi @not_a_resource
|
|
||||||
cmp resource_counter
|
|
||||||
beq @valid_resource
|
|
||||||
bcs @not_a_resource
|
|
||||||
@valid_resource:
|
|
||||||
tax
|
|
||||||
dex
|
|
||||||
jsr select_resource_from_current_directory
|
|
||||||
@not_a_resource:
|
|
||||||
jmp @get_keypress
|
|
||||||
@back_in_history:
|
|
||||||
ldx current_resource_history_entry
|
|
||||||
dex
|
|
||||||
beq @get_keypress ;if we were already at start of history, can't go back any further
|
|
||||||
stx current_resource_history_entry
|
|
||||||
txa
|
|
||||||
jsr load_resource_from_history
|
|
||||||
jsr load_resource_into_buffer
|
|
||||||
jmp display_resource_in_buffer
|
|
||||||
@show_history:
|
|
||||||
jsr show_history
|
|
||||||
jmp display_resource_in_buffer
|
|
||||||
@go_next_page:
|
|
||||||
lda this_is_last_page
|
|
||||||
bne @get_keypress
|
|
||||||
jmp @do_one_page
|
|
||||||
@prompt_for_new_server:
|
|
||||||
jsr prompt_for_gopher_resource ;that routine only returns if no server was entered.
|
|
||||||
jmp display_resource_in_buffer
|
|
||||||
|
|
||||||
@quit:
|
|
||||||
jmp exit_gopher
|
|
||||||
@go_prev_page:
|
|
||||||
ldx page_counter
|
|
||||||
dex
|
|
||||||
bne @not_first_page
|
|
||||||
jmp @get_keypress
|
|
||||||
@not_first_page:
|
|
||||||
dex
|
|
||||||
dec page_counter
|
|
||||||
dec page_counter
|
|
||||||
|
|
||||||
lda page_pointer_lo,x
|
|
||||||
sta get_next_byte+1
|
|
||||||
lda page_pointer_hi,x
|
|
||||||
sta get_next_byte+2
|
|
||||||
jmp @do_one_page
|
|
||||||
|
|
||||||
;get a gopher resource
|
|
||||||
;X should be the selected resource number
|
|
||||||
;the resources selected should be loaded into resource_pointer_*
|
|
||||||
select_resource_from_current_directory:
|
|
||||||
lda resource_pointer_lo,x
|
|
||||||
sta buffer_ptr
|
|
||||||
lda resource_pointer_hi,x
|
|
||||||
sta buffer_ptr+1
|
|
||||||
ldy #0
|
|
||||||
ldx #0
|
|
||||||
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
sta displayed_resource_type
|
|
||||||
|
|
||||||
@skip_to_next_tab:
|
|
||||||
iny
|
|
||||||
beq @done_skipping_over_tab
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
cmp #$09
|
|
||||||
bne @skip_to_next_tab
|
|
||||||
@done_skipping_over_tab:
|
|
||||||
|
|
||||||
;should now be pointing at the tab just before the selector
|
|
||||||
@copy_selector:
|
|
||||||
iny
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
cmp #09
|
|
||||||
beq @end_of_selector
|
|
||||||
sta resource_selector,x
|
|
||||||
inx
|
|
||||||
jmp @copy_selector
|
|
||||||
@end_of_selector:
|
|
||||||
stx resource_selector_length
|
|
||||||
;terminate with a CR,LF,$00
|
|
||||||
lda #$0D
|
|
||||||
sta resource_selector,x
|
|
||||||
lda #$0A
|
|
||||||
sta resource_selector+1,x
|
|
||||||
lda #$00
|
|
||||||
sta resource_selector+2,x
|
|
||||||
|
|
||||||
|
|
||||||
tax
|
|
||||||
;should now be pointing at the tab just before the hostname
|
|
||||||
@copy_hostname:
|
|
||||||
iny
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
cmp #09
|
|
||||||
beq @end_of_hostname
|
|
||||||
sta resource_hostname,x
|
|
||||||
inx
|
|
||||||
jmp @copy_hostname
|
|
||||||
|
|
||||||
@end_of_hostname:
|
|
||||||
lda #$00
|
|
||||||
sta resource_hostname,x
|
|
||||||
|
|
||||||
;should now be pointing at the tab just before the port number
|
|
||||||
lda #0
|
|
||||||
sta resource_port
|
|
||||||
sta resource_port+1
|
|
||||||
@parse_port:
|
|
||||||
iny
|
|
||||||
beq @end_of_port
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
cmp #$1F
|
|
||||||
bcc @end_of_port ;any control char should be treated as end of port field
|
|
||||||
|
|
||||||
ldax resource_port
|
|
||||||
stax acc16
|
|
||||||
lda #10
|
|
||||||
jsr mul_8_16
|
|
||||||
ldax acc16
|
|
||||||
stax resource_port
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
sec
|
|
||||||
sbc #'0'
|
|
||||||
clc
|
|
||||||
adc resource_port
|
|
||||||
sta resource_port
|
|
||||||
bcc :+
|
|
||||||
inc resource_port+1
|
|
||||||
:
|
|
||||||
jmp @parse_port
|
|
||||||
@end_of_port:
|
|
||||||
|
|
||||||
lda displayed_resource_type
|
|
||||||
|
|
||||||
cmp #'7' ;is it a 'search' resource?
|
|
||||||
bne @done
|
|
||||||
|
|
||||||
ldax #query
|
|
||||||
jsr print
|
|
||||||
@get_query_string:
|
|
||||||
ldy #32 ;max chars
|
|
||||||
ldax #filter_text
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @get_query_string
|
|
||||||
stax buffer_ptr
|
|
||||||
jsr print_cr
|
|
||||||
ldy #0
|
|
||||||
ldx resource_selector_length
|
|
||||||
lda #09
|
|
||||||
@copy_one_char:
|
|
||||||
sta resource_selector,x
|
|
||||||
inx
|
|
||||||
lda (buffer_ptr),y
|
|
||||||
beq @done_query_string
|
|
||||||
iny
|
|
||||||
bne @copy_one_char
|
|
||||||
@done_query_string:
|
|
||||||
;terminate with a CR,LF,$00
|
|
||||||
lda #$0D
|
|
||||||
sta resource_selector,x
|
|
||||||
lda #$0A
|
|
||||||
sta resource_selector+1,x
|
|
||||||
lda #$00
|
|
||||||
sta resource_selector+2,x
|
|
||||||
|
|
||||||
@done:
|
|
||||||
|
|
||||||
add_resource_to_history_and_display:
|
|
||||||
;add this to the resource history
|
|
||||||
lda current_resource_history_entry
|
|
||||||
cmp #RESOURCE_HISTORY_ENTRIES
|
|
||||||
bne @dont_shuffle_down
|
|
||||||
ldax #resource_history
|
|
||||||
stax copy_dest
|
|
||||||
inx ;one page higher up
|
|
||||||
stax copy_src
|
|
||||||
ldx #(RESOURCE_HISTORY_ENTRIES-1)
|
|
||||||
lda #$00
|
|
||||||
jsr copymem
|
|
||||||
dec current_resource_history_entry
|
|
||||||
|
|
||||||
@dont_shuffle_down:
|
|
||||||
ldax #current_resource
|
|
||||||
stax copy_src
|
|
||||||
lda #<resource_history
|
|
||||||
sta copy_dest
|
|
||||||
clc
|
|
||||||
lda #>resource_history
|
|
||||||
adc current_resource_history_entry
|
|
||||||
sta copy_dest+1
|
|
||||||
ldax #$100
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
inc current_resource_history_entry
|
|
||||||
|
|
||||||
jsr load_resource_into_buffer
|
|
||||||
bcs @error_in_loading
|
|
||||||
jmp display_resource_in_buffer
|
|
||||||
@error_in_loading:
|
|
||||||
jmp print_errorcode
|
|
||||||
|
|
||||||
|
|
||||||
;show the entries in the history buffer
|
|
||||||
show_history:
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
ldax #history
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
lda current_resource_history_entry
|
|
||||||
@show_one_entry:
|
|
||||||
pha
|
|
||||||
jsr load_resource_from_history
|
|
||||||
jsr print_resource_description
|
|
||||||
pla
|
|
||||||
sec
|
|
||||||
sbc #1
|
|
||||||
bne @show_one_entry
|
|
||||||
get_keypress_then_rts:
|
|
||||||
jsr print_cr
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print
|
|
||||||
jsr get_key_ip65
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
;load the 'current_resource' into the buffer
|
|
||||||
load_resource_into_buffer:
|
|
||||||
ldax #resolving
|
|
||||||
jsr print
|
|
||||||
ldax #resource_hostname
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
ldax #resource_hostname
|
|
||||||
jsr dns_set_hostname
|
|
||||||
|
|
||||||
bcs :+
|
|
||||||
jsr dns_resolve
|
|
||||||
:
|
|
||||||
bcc @no_error
|
|
||||||
rts
|
|
||||||
@no_error:
|
|
||||||
ldx #3 ; save IP address just retrieved
|
|
||||||
: lda dns_ip,x
|
|
||||||
sta url_ip,x
|
|
||||||
sta telnet_ip,x
|
|
||||||
dex
|
|
||||||
bpl :-
|
|
||||||
|
|
||||||
|
|
||||||
lda displayed_resource_type
|
|
||||||
cmp #'8' ;is it a 'telnet' resource?
|
|
||||||
bne @not_telnet_resource
|
|
||||||
ldax #connecting
|
|
||||||
jsr print
|
|
||||||
ldax resource_port
|
|
||||||
stax telnet_port
|
|
||||||
lda #0
|
|
||||||
sta telnet_use_native_charset
|
|
||||||
|
|
||||||
;if the username = '/n', then connect in native mode
|
|
||||||
lda resource_selector_length
|
|
||||||
|
|
||||||
cmp #2
|
|
||||||
bne @not_native
|
|
||||||
lda resource_selector
|
|
||||||
cmp #'/'
|
|
||||||
bne @not_native
|
|
||||||
lda resource_selector+1
|
|
||||||
cmp #'n'
|
|
||||||
bne @not_native
|
|
||||||
inc telnet_use_native_charset
|
|
||||||
@not_native:
|
|
||||||
jsr telnet_connect
|
|
||||||
jmp get_keypress_then_rts
|
|
||||||
|
|
||||||
@not_telnet_resource:
|
|
||||||
ldax resource_port
|
|
||||||
stax url_port
|
|
||||||
ldax #resource_selector
|
|
||||||
stax url_selector
|
|
||||||
ldax #scratch_buffer
|
|
||||||
stax url_download_buffer
|
|
||||||
ldax #scratch_buffer_length
|
|
||||||
stax url_download_buffer_length
|
|
||||||
|
|
||||||
jmp resource_download
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;retrieve entry specified by A from resource history
|
|
||||||
;NB 'A' = 1 means the first entry
|
|
||||||
load_resource_from_history:
|
|
||||||
clc
|
|
||||||
adc #(>resource_history)-1
|
|
||||||
sta copy_src+1
|
|
||||||
lda #<resource_history
|
|
||||||
sta copy_src
|
|
||||||
|
|
||||||
ldax #current_resource
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$100
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
print_resource_description:
|
|
||||||
; ldax #port_no
|
|
||||||
; jsr print
|
|
||||||
; lda resource_port+1
|
|
||||||
; jsr print_hex
|
|
||||||
; lda resource_port
|
|
||||||
; jsr print_hex
|
|
||||||
; jsr print_cr
|
|
||||||
|
|
||||||
ldax #server
|
|
||||||
jsr print
|
|
||||||
ldax #resource_hostname
|
|
||||||
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
ldax #selector
|
|
||||||
jsr print
|
|
||||||
ldax #resource_selector
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
prompt_for_gopher_resource:
|
|
||||||
ldax #gopher_server
|
|
||||||
jsr print
|
|
||||||
ldy #40
|
|
||||||
ldax #filter_dns
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_server_entered
|
|
||||||
stax copy_src
|
|
||||||
ldax #resource_hostname
|
|
||||||
stax copy_dest
|
|
||||||
ldax #RESOURCE_HOSTNAME_MAX_LENGTH
|
|
||||||
jsr copymem
|
|
||||||
ldax #70
|
|
||||||
stax resource_port
|
|
||||||
lda #'/'
|
|
||||||
sta resource_selector
|
|
||||||
lda #$0d
|
|
||||||
sta resource_selector+1
|
|
||||||
|
|
||||||
lda #$0a
|
|
||||||
sta resource_selector+2
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta resource_selector+3
|
|
||||||
sta resource_selector_length+1
|
|
||||||
lda #3
|
|
||||||
sta resource_selector_length
|
|
||||||
lda #'1'
|
|
||||||
sta displayed_resource_type
|
|
||||||
jsr print_cr
|
|
||||||
jmp add_resource_to_history_and_display
|
|
||||||
@no_server_entered:
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
.rodata
|
|
||||||
page_header:
|
|
||||||
.byte "PAGE NO $",0
|
|
||||||
port_no:
|
|
||||||
.byte "PORT NO ",0
|
|
||||||
history:
|
|
||||||
.byte "GOPHER HISTORY ",13,0
|
|
||||||
cr_lf: .byte $0D,$0A
|
|
||||||
connecting:
|
|
||||||
.byte "CONNECTING ",0
|
|
||||||
retrieving:
|
|
||||||
.byte "RETRIEVING ",0
|
|
||||||
gopher_server:
|
|
||||||
.byte "GOPHER "
|
|
||||||
server:
|
|
||||||
.byte "SERVER :",0
|
|
||||||
selector:
|
|
||||||
.byte "SELECTOR :",0
|
|
||||||
query:
|
|
||||||
.byte "QUERY :",0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR gopher.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,341 +0,0 @@
|
||||||
|
|
||||||
;REQUIRES KEYCODES TO BE DEFINED
|
|
||||||
|
|
||||||
OPTIONS_PER_PAGE = $10
|
|
||||||
.bss
|
|
||||||
|
|
||||||
number_of_options: .res 2
|
|
||||||
current_option: .res 2
|
|
||||||
temp_option_counter: .res 2
|
|
||||||
|
|
||||||
first_option_this_page: .res 2
|
|
||||||
options_shown_this_page: .res 1
|
|
||||||
options_table_pointer: .res 2
|
|
||||||
jump_to_prefix: .res 1
|
|
||||||
last_page_flag: .res 1
|
|
||||||
|
|
||||||
get_current_byte: .res 4
|
|
||||||
|
|
||||||
convert_to_native: .res 1
|
|
||||||
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
;on entry, AX should point to the list of null terminated option strings to be selected from
|
|
||||||
;Y should be 1 if menu items are in ASCII, 0 if they are in native char format
|
|
||||||
;on exit, AX points to the selected string
|
|
||||||
;carry is set of QUIT was selected, clear otherwise
|
|
||||||
select_option_from_menu:
|
|
||||||
sty convert_to_native
|
|
||||||
stax options_table_pointer
|
|
||||||
stax get_current_byte+1
|
|
||||||
;set the 'LDA' and RTS' opcodes for the 'get current byte' subroutine, which is self-modified-code, hence must be located in RAM not ROM
|
|
||||||
lda #$ad ;opcode for LDA absolute
|
|
||||||
sta get_current_byte
|
|
||||||
lda #$60 ;opcode for RTS
|
|
||||||
sta get_current_byte+3
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta current_option
|
|
||||||
sta current_option+1
|
|
||||||
sta number_of_options
|
|
||||||
sta number_of_options+1
|
|
||||||
|
|
||||||
|
|
||||||
;count the number of options. this is done by scanning till we find a double zero, incrementing the count on each single zero
|
|
||||||
@count_strings:
|
|
||||||
jsr @skip_past_next_null_byte
|
|
||||||
inc number_of_options
|
|
||||||
bne :+
|
|
||||||
inc number_of_options+1
|
|
||||||
:
|
|
||||||
jsr get_current_byte
|
|
||||||
bne @count_strings
|
|
||||||
|
|
||||||
jmp @display_first_page_of_options
|
|
||||||
|
|
||||||
@skip_past_next_null_byte:
|
|
||||||
jsr @move_to_next_byte
|
|
||||||
jsr get_current_byte
|
|
||||||
bne @skip_past_next_null_byte
|
|
||||||
jsr @move_to_next_byte
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
@move_to_next_byte:
|
|
||||||
inc get_current_byte+1
|
|
||||||
bne :+
|
|
||||||
inc get_current_byte+2
|
|
||||||
:
|
|
||||||
rts
|
|
||||||
|
|
||||||
;move the ptr along till it's pointing at the whatever is the value of current_option
|
|
||||||
@move_to_current_option:
|
|
||||||
ldax options_table_pointer
|
|
||||||
stax get_current_byte+1
|
|
||||||
lda #0
|
|
||||||
sta temp_option_counter
|
|
||||||
sta temp_option_counter+1
|
|
||||||
|
|
||||||
@skip_over_strings:
|
|
||||||
lda temp_option_counter
|
|
||||||
cmp current_option
|
|
||||||
bne @not_at_current_option
|
|
||||||
lda temp_option_counter+1
|
|
||||||
cmp current_option+1
|
|
||||||
bne @not_at_current_option
|
|
||||||
rts
|
|
||||||
@not_at_current_option:
|
|
||||||
jsr @skip_past_next_null_byte
|
|
||||||
|
|
||||||
inc temp_option_counter
|
|
||||||
bne :+
|
|
||||||
inc temp_option_counter+1
|
|
||||||
:
|
|
||||||
jmp @skip_over_strings
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@display_first_page_of_options:
|
|
||||||
lda #0
|
|
||||||
sta first_option_this_page
|
|
||||||
sta first_option_this_page+1
|
|
||||||
|
|
||||||
|
|
||||||
@print_current_page:
|
|
||||||
lda first_option_this_page
|
|
||||||
sta current_option
|
|
||||||
lda first_option_this_page+1
|
|
||||||
sta current_option+1
|
|
||||||
lda #0
|
|
||||||
sta last_page_flag
|
|
||||||
|
|
||||||
jsr @move_to_current_option
|
|
||||||
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
ldax #select_from_following_options
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
|
|
||||||
jsr print_cr
|
|
||||||
lda #0
|
|
||||||
sta options_shown_this_page
|
|
||||||
|
|
||||||
@print_loop:
|
|
||||||
|
|
||||||
lda options_shown_this_page
|
|
||||||
clc
|
|
||||||
adc #'A'
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
lda #')'
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
lda get_current_byte+1
|
|
||||||
ldx get_current_byte+2
|
|
||||||
ldy convert_to_native
|
|
||||||
beq :+
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jmp @printed
|
|
||||||
:
|
|
||||||
jsr print
|
|
||||||
@printed:
|
|
||||||
|
|
||||||
jsr print_cr
|
|
||||||
jsr @skip_past_next_null_byte
|
|
||||||
inc current_option
|
|
||||||
bne :+
|
|
||||||
inc current_option+1
|
|
||||||
:
|
|
||||||
lda current_option
|
|
||||||
cmp number_of_options
|
|
||||||
bne :+
|
|
||||||
lda current_option+1
|
|
||||||
cmp number_of_options+1
|
|
||||||
bne :+
|
|
||||||
inc last_page_flag
|
|
||||||
jmp @print_instructions_and_get_keypress
|
|
||||||
:
|
|
||||||
inc options_shown_this_page
|
|
||||||
lda options_shown_this_page
|
|
||||||
cmp #OPTIONS_PER_PAGE
|
|
||||||
beq @print_instructions_and_get_keypress
|
|
||||||
jmp @print_loop
|
|
||||||
|
|
||||||
@jump_to:
|
|
||||||
jsr print_cr
|
|
||||||
ldax #jump_to_prompt
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda #'?'
|
|
||||||
|
|
||||||
jsr get_key
|
|
||||||
ora #$80 ;set the high bit
|
|
||||||
|
|
||||||
|
|
||||||
sta jump_to_prefix
|
|
||||||
ldax options_table_pointer
|
|
||||||
stax get_current_byte+1
|
|
||||||
lda #0
|
|
||||||
sta current_option
|
|
||||||
sta current_option+1
|
|
||||||
|
|
||||||
@check_if_at_jump_to_prefix:
|
|
||||||
jsr get_current_byte
|
|
||||||
ora #$80 ;set high bit
|
|
||||||
cmp jump_to_prefix
|
|
||||||
beq @at_prefix
|
|
||||||
jsr @skip_past_next_null_byte
|
|
||||||
inc current_option
|
|
||||||
bne :+
|
|
||||||
inc current_option+1
|
|
||||||
:
|
|
||||||
jsr get_current_byte
|
|
||||||
bne @check_if_at_jump_to_prefix
|
|
||||||
jsr beep ;if we got to the end of the options table without finding the char we want, then sound a beep
|
|
||||||
jmp @jump_to_finished
|
|
||||||
@at_prefix:
|
|
||||||
lda current_option
|
|
||||||
sta first_option_this_page
|
|
||||||
lda current_option+1
|
|
||||||
sta first_option_this_page+1
|
|
||||||
@jump_to_finished:
|
|
||||||
jmp @print_current_page
|
|
||||||
|
|
||||||
|
|
||||||
@print_instructions_and_get_keypress:
|
|
||||||
lda number_of_options+1
|
|
||||||
bne @navigation_instructions
|
|
||||||
lda number_of_options
|
|
||||||
cmp #OPTIONS_PER_PAGE
|
|
||||||
bcc :+
|
|
||||||
@navigation_instructions:
|
|
||||||
ldax #navigation_instructions
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
:
|
|
||||||
@get_keypress:
|
|
||||||
lda #'?'
|
|
||||||
|
|
||||||
jsr get_key
|
|
||||||
|
|
||||||
; jsr print_hex
|
|
||||||
; @fixme:
|
|
||||||
; jmp @fixme
|
|
||||||
|
|
||||||
cmp #KEYCODE_ABORT
|
|
||||||
beq @quit
|
|
||||||
cmp #KEYCODE_SLASH
|
|
||||||
beq @jump_to
|
|
||||||
cmp #KEYCODE_RIGHT
|
|
||||||
beq @forward_one_page
|
|
||||||
cmp #KEYCODE_DOWN
|
|
||||||
beq @forward_one_page
|
|
||||||
cmp #KEYCODE_UP
|
|
||||||
beq @back_one_page
|
|
||||||
cmp #KEYCODE_LEFT
|
|
||||||
beq @back_one_page
|
|
||||||
|
|
||||||
ora #$e0 ;make it a lower case letter with high bit set
|
|
||||||
sec
|
|
||||||
sbc #$e1
|
|
||||||
bcc @get_keypress ;if we have underflowed, it wasn't a valid option
|
|
||||||
|
|
||||||
|
|
||||||
cmp #OPTIONS_PER_PAGE-1
|
|
||||||
beq @got_valid_option
|
|
||||||
bpl @get_keypress ;if we have underflowed, it wasn't a valid option
|
|
||||||
|
|
||||||
|
|
||||||
@got_valid_option:
|
|
||||||
clc
|
|
||||||
adc first_option_this_page
|
|
||||||
sta current_option
|
|
||||||
lda #0
|
|
||||||
adc first_option_this_page+1
|
|
||||||
|
|
||||||
sta current_option+1
|
|
||||||
|
|
||||||
jsr @move_to_current_option
|
|
||||||
ldax get_current_byte+1
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
@quit:
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
@forward_one_page:
|
|
||||||
clc
|
|
||||||
lda last_page_flag
|
|
||||||
beq :+
|
|
||||||
@back_to_first_page:
|
|
||||||
jmp @display_first_page_of_options
|
|
||||||
:
|
|
||||||
lda first_option_this_page
|
|
||||||
adc #OPTIONS_PER_PAGE
|
|
||||||
sta first_option_this_page
|
|
||||||
bcc :+
|
|
||||||
inc first_option_this_page+1
|
|
||||||
:
|
|
||||||
|
|
||||||
jmp @print_current_page
|
|
||||||
|
|
||||||
@back_one_page:
|
|
||||||
sec
|
|
||||||
lda first_option_this_page
|
|
||||||
sbc #OPTIONS_PER_PAGE
|
|
||||||
sta first_option_this_page
|
|
||||||
lda first_option_this_page+1
|
|
||||||
sbc #0
|
|
||||||
sta first_option_this_page+1
|
|
||||||
bmi @show_last_page_of_options
|
|
||||||
|
|
||||||
jmp @print_current_page
|
|
||||||
@show_last_page_of_options:
|
|
||||||
sec
|
|
||||||
lda number_of_options
|
|
||||||
sbc #OPTIONS_PER_PAGE
|
|
||||||
sta first_option_this_page
|
|
||||||
lda number_of_options+1
|
|
||||||
sbc #0
|
|
||||||
sta first_option_this_page+1
|
|
||||||
bmi @back_to_first_page
|
|
||||||
jmp @print_current_page
|
|
||||||
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
select_from_following_options: .byte "Select one of the following options:",10,0
|
|
||||||
navigation_instructions: .byte 10,"Arrow keys navigate between menu pages",10
|
|
||||||
.byte "/ to jump or "
|
|
||||||
.byte KEYNAME_ABORT
|
|
||||||
.byte " to quit",10,0
|
|
||||||
|
|
||||||
jump_to_prompt: .byte "jump to:",0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR menu.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,43 +0,0 @@
|
||||||
petscii_black = 144
|
|
||||||
petscii_white = 5
|
|
||||||
petscii_red = 28
|
|
||||||
petscii_cyan = 159
|
|
||||||
petscii_purple = 156
|
|
||||||
petscii_green = 30
|
|
||||||
petscii_blue = 31
|
|
||||||
petscii_yellow = 158
|
|
||||||
petscii_orange = 129
|
|
||||||
petscii_brown = 149
|
|
||||||
petscii_ltred = 150
|
|
||||||
petscii_dkgray = 151
|
|
||||||
petscii_gray = 152
|
|
||||||
petscii_ltgreen = 153
|
|
||||||
petscii_ltblue = 154
|
|
||||||
petscii_ltgray = 155
|
|
||||||
|
|
||||||
petscii_lower = 14
|
|
||||||
petscii_home = 19
|
|
||||||
petscii_clear = 147
|
|
||||||
|
|
||||||
petscii_down = 17
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR petscii.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,87 +0,0 @@
|
||||||
.import icmp_ping
|
|
||||||
.import icmp_echo_ip
|
|
||||||
|
|
||||||
NUM_PING_RETRIES=3
|
|
||||||
.bss
|
|
||||||
ping_retries: .res 1
|
|
||||||
|
|
||||||
.code
|
|
||||||
ping_loop:
|
|
||||||
ldax #remote_host
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
kippercall #KPR_INPUT_HOSTNAME
|
|
||||||
bcc @host_entered
|
|
||||||
;if no host entered, then bail.
|
|
||||||
rts
|
|
||||||
@host_entered:
|
|
||||||
stax kipper_param_buffer
|
|
||||||
jsr print_cr
|
|
||||||
ldax #resolving
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax kipper_param_buffer
|
|
||||||
kippercall #KPR_PRINT_ASCIIZ
|
|
||||||
jsr print_cr
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_DNS_RESOLVE
|
|
||||||
bcc @resolved_ok
|
|
||||||
@failed:
|
|
||||||
print_failed
|
|
||||||
jsr print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp ping_loop
|
|
||||||
@resolved_ok:
|
|
||||||
|
|
||||||
lda #NUM_PING_RETRIES
|
|
||||||
sta ping_retries
|
|
||||||
@ping_once:
|
|
||||||
ldax #pinging
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
jsr print_dotted_quad
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
lda #':'
|
|
||||||
jsr print_a
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
ldax #kipper_param_buffer
|
|
||||||
kippercall #KPR_PING_HOST
|
|
||||||
|
|
||||||
bcs @ping_error
|
|
||||||
jsr print_integer
|
|
||||||
ldax #ms
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@check_retries:
|
|
||||||
dec ping_retries
|
|
||||||
bpl @ping_once
|
|
||||||
jmp ping_loop
|
|
||||||
|
|
||||||
@ping_error:
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp @check_retries
|
|
||||||
|
|
||||||
|
|
||||||
ms: .byte " ms",10,0
|
|
||||||
pinging: .byte "pinging ",0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR ping.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,300 +0,0 @@
|
||||||
.import copymem
|
|
||||||
.import ascii_to_native
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
load_sid:
|
|
||||||
stax sidfile_address
|
|
||||||
stax copy_src
|
|
||||||
|
|
||||||
ldy #1
|
|
||||||
lda (copy_src),y
|
|
||||||
cmp #'S' ;make sure the file starts with 'PSID' or 'RSID'
|
|
||||||
beq @ok
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
@ok:
|
|
||||||
ldy #7
|
|
||||||
lda (copy_src),y
|
|
||||||
sta header_length
|
|
||||||
|
|
||||||
inc header_length
|
|
||||||
inc header_length
|
|
||||||
|
|
||||||
tay
|
|
||||||
;y now points to the start of the real c64 file
|
|
||||||
lda (copy_src),y
|
|
||||||
sta copy_dest
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta copy_dest+1
|
|
||||||
|
|
||||||
ldy #$0a
|
|
||||||
lda (copy_src),y
|
|
||||||
sta init_song_handler+2
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta init_song_handler+1
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta play_song_handler+2
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
sta play_song_handler+1
|
|
||||||
|
|
||||||
ldy #$0f
|
|
||||||
lda (copy_src),y
|
|
||||||
sta number_of_songs
|
|
||||||
|
|
||||||
ldy #$11
|
|
||||||
lda (copy_src),y
|
|
||||||
sta default_song
|
|
||||||
|
|
||||||
ldy #$16
|
|
||||||
jsr print_ascii_string
|
|
||||||
|
|
||||||
ldy #$36
|
|
||||||
jsr print_ascii_string
|
|
||||||
ldy #$56
|
|
||||||
jsr print_ascii_string
|
|
||||||
|
|
||||||
ldax #songs
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
lda number_of_songs
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
|
|
||||||
ldax #load_address
|
|
||||||
jsr print
|
|
||||||
lda copy_dest+1
|
|
||||||
jsr print_hex
|
|
||||||
lda copy_dest
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #play_address
|
|
||||||
jsr print
|
|
||||||
lda play_song_handler+2
|
|
||||||
jsr print_hex
|
|
||||||
lda play_song_handler+1
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
|
|
||||||
ldax #init_address
|
|
||||||
jsr print
|
|
||||||
lda init_song_handler+2
|
|
||||||
jsr print_hex
|
|
||||||
lda init_song_handler+1
|
|
||||||
jsr print_hex
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax sidfile_address
|
|
||||||
stax copy_src
|
|
||||||
|
|
||||||
|
|
||||||
clc
|
|
||||||
lda sidfile_address
|
|
||||||
adc header_length
|
|
||||||
pha
|
|
||||||
lda sidfile_address+1
|
|
||||||
adc #0
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
stax copy_src
|
|
||||||
sec
|
|
||||||
lda sidfile_length
|
|
||||||
sbc header_length
|
|
||||||
pha
|
|
||||||
lda sidfile_length+1
|
|
||||||
sbc #0
|
|
||||||
tax
|
|
||||||
pla
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
play_sid:
|
|
||||||
|
|
||||||
lda default_song
|
|
||||||
sta current_song
|
|
||||||
jsr init_song
|
|
||||||
jsr install_irq_handler
|
|
||||||
jsr print_current_song
|
|
||||||
@keypress_loop:
|
|
||||||
jsr get_key_ip65
|
|
||||||
cmp #KEYCODE_ABORT
|
|
||||||
bne @not_abort
|
|
||||||
jsr remove_irq_handler
|
|
||||||
jsr reset_sid
|
|
||||||
rts
|
|
||||||
|
|
||||||
@not_abort:
|
|
||||||
|
|
||||||
cmp #KEYCODE_DOWN
|
|
||||||
bne @not_down
|
|
||||||
dec current_song
|
|
||||||
bne :+
|
|
||||||
inc current_song
|
|
||||||
:
|
|
||||||
jmp @reset_song
|
|
||||||
@not_down:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cmp #KEYCODE_UP
|
|
||||||
bne @not_up
|
|
||||||
lda current_song
|
|
||||||
cmp number_of_songs
|
|
||||||
beq :+
|
|
||||||
inc current_song
|
|
||||||
:
|
|
||||||
jmp @reset_song
|
|
||||||
@not_up:
|
|
||||||
jmp @keypress_loop
|
|
||||||
|
|
||||||
@reset_song:
|
|
||||||
jsr print_current_song
|
|
||||||
jsr init_song
|
|
||||||
jmp @keypress_loop
|
|
||||||
|
|
||||||
|
|
||||||
print_current_song:
|
|
||||||
|
|
||||||
ldax #song_number
|
|
||||||
jsr print
|
|
||||||
lda current_song
|
|
||||||
jsr print_hex
|
|
||||||
rts
|
|
||||||
reset_sid:
|
|
||||||
lda #$00
|
|
||||||
sta $D404
|
|
||||||
sta $D40B
|
|
||||||
sta $D412
|
|
||||||
sta $D418
|
|
||||||
rts
|
|
||||||
|
|
||||||
remove_irq_handler:
|
|
||||||
ldax jmp_old_irq+1
|
|
||||||
sei ;don't want any interrupts while we fiddle with the vector
|
|
||||||
stax $314 ;previous IRQ handler
|
|
||||||
cli
|
|
||||||
rts
|
|
||||||
|
|
||||||
install_irq_handler:
|
|
||||||
ldax $314 ;previous IRQ handler
|
|
||||||
stax jmp_old_irq+1
|
|
||||||
sei ;don't want any interrupts while we fiddle with the vector
|
|
||||||
ldax #irq_handler
|
|
||||||
stax $314 ;previous IRQ handler
|
|
||||||
cli
|
|
||||||
rts
|
|
||||||
|
|
||||||
irq_handler:
|
|
||||||
|
|
||||||
lda play_song_handler+2
|
|
||||||
beq :+
|
|
||||||
lda $d012
|
|
||||||
cmp #100
|
|
||||||
bne irq_handler
|
|
||||||
|
|
||||||
|
|
||||||
inc $d020
|
|
||||||
jsr play_song
|
|
||||||
dec $d020
|
|
||||||
:
|
|
||||||
jmp jmp_old_irq
|
|
||||||
|
|
||||||
|
|
||||||
print_ascii_string:
|
|
||||||
:
|
|
||||||
lda (copy_src),y
|
|
||||||
beq :+
|
|
||||||
jsr ascii_to_native
|
|
||||||
jsr print_a
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
:
|
|
||||||
jmp print_cr
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.segment "APP_SCRATCH"
|
|
||||||
number_of_songs: .res 1
|
|
||||||
default_song: .res 1
|
|
||||||
sidfile_address: .res 2
|
|
||||||
header_length: .res 1
|
|
||||||
sidfile_length: .res 2
|
|
||||||
current_song: .res 1
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
songs:
|
|
||||||
.byte "SONGS $",0
|
|
||||||
error:
|
|
||||||
.byte "ERROR",13,0
|
|
||||||
load_address:
|
|
||||||
.byte "LOAD ADDRESS $",0
|
|
||||||
play_address:
|
|
||||||
.byte "PLAY ADDRESS $",0
|
|
||||||
init_address:
|
|
||||||
.byte "INIT ADDRESS $",0
|
|
||||||
|
|
||||||
song_number:
|
|
||||||
.byte 19,17,17,17,17,17,17,17,"CURRENT SONG NUMBER $",0
|
|
||||||
|
|
||||||
.segment "SELF_MODIFIED_CODE"
|
|
||||||
|
|
||||||
|
|
||||||
init_song:
|
|
||||||
lda $01
|
|
||||||
pha
|
|
||||||
lda #$35
|
|
||||||
sta $01
|
|
||||||
lda current_song
|
|
||||||
init_song_handler:
|
|
||||||
jsr $ffff
|
|
||||||
pla
|
|
||||||
sta $01
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
play_song:
|
|
||||||
lda $01
|
|
||||||
pha
|
|
||||||
lda #$35
|
|
||||||
sta $01
|
|
||||||
play_song_handler:
|
|
||||||
jsr $ffff
|
|
||||||
pla
|
|
||||||
sta $01
|
|
||||||
rts
|
|
||||||
|
|
||||||
jmp_old_irq:
|
|
||||||
jmp $ffff
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR sidplay.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1,171 +0,0 @@
|
||||||
;telnet routines
|
|
||||||
; to use:
|
|
||||||
; 1) include this file
|
|
||||||
; 2) include these other files:
|
|
||||||
; .include "../inc/common.i"
|
|
||||||
; .include "../inc/commonprint.i"
|
|
||||||
; .include "../inc/net.i"
|
|
||||||
; 3) define a routine called 'exit_telnet'
|
|
||||||
|
|
||||||
.import telnet_connect
|
|
||||||
.import telnet_use_native_charset
|
|
||||||
.import telnet_port
|
|
||||||
.import telnet_ip
|
|
||||||
.import filter_number
|
|
||||||
|
|
||||||
.export telnet_on_connection
|
|
||||||
|
|
||||||
.bss
|
|
||||||
original_border: .res 1
|
|
||||||
|
|
||||||
.code
|
|
||||||
telnet_main_entry:
|
|
||||||
;prompt for a hostname, then resolve to an IP address
|
|
||||||
|
|
||||||
ldax #remote_host
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldy #40 ;max chars
|
|
||||||
ldax #filter_dns
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcc @host_entered
|
|
||||||
;if no host entered, then bail.
|
|
||||||
jmp exit_telnet
|
|
||||||
@host_entered:
|
|
||||||
stax temp_ax
|
|
||||||
jsr print_cr
|
|
||||||
ldax #resolving
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax temp_ax
|
|
||||||
jsr print
|
|
||||||
jsr print_cr
|
|
||||||
ldax temp_ax
|
|
||||||
jsr dns_set_hostname
|
|
||||||
bcs @resolve_error
|
|
||||||
jsr dns_resolve
|
|
||||||
bcc @resolved_ok
|
|
||||||
@resolve_error:
|
|
||||||
print_failed
|
|
||||||
jsr print_cr
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp telnet_main_entry
|
|
||||||
@resolved_ok:
|
|
||||||
ldx #3
|
|
||||||
@copy_telnet_ip_loop:
|
|
||||||
lda dns_ip,x
|
|
||||||
sta telnet_ip,x
|
|
||||||
dex
|
|
||||||
bpl @copy_telnet_ip_loop
|
|
||||||
@get_port:
|
|
||||||
ldax #remote_port
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldy #5 ;max chars
|
|
||||||
ldax #filter_number
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @no_port_entered
|
|
||||||
;AX now points a string containing port number
|
|
||||||
jsr parse_integer
|
|
||||||
bcc @port_entered
|
|
||||||
@no_port_entered:
|
|
||||||
;if no port entered, then assume port 23
|
|
||||||
ldax #23
|
|
||||||
@port_entered:
|
|
||||||
stax telnet_port
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #char_mode_prompt
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@char_mode_input:
|
|
||||||
jsr get_key_ip65
|
|
||||||
cmp #'V'
|
|
||||||
beq @vt100_mode
|
|
||||||
cmp #'v'
|
|
||||||
beq @vt100_mode
|
|
||||||
|
|
||||||
cmp #'P'
|
|
||||||
beq @petscii_mode
|
|
||||||
cmp #'p'
|
|
||||||
beq @petscii_mode
|
|
||||||
|
|
||||||
jmp @char_mode_input
|
|
||||||
@vt100_mode:
|
|
||||||
lda #0
|
|
||||||
sta telnet_use_native_charset
|
|
||||||
|
|
||||||
.ifdef XMODEM_IN_TELNET
|
|
||||||
lda #1
|
|
||||||
sta xmodem_iac_escape
|
|
||||||
.endif
|
|
||||||
jmp @after_mode_set
|
|
||||||
@petscii_mode:
|
|
||||||
lda #1
|
|
||||||
sta telnet_use_native_charset
|
|
||||||
|
|
||||||
.ifdef XMODEM_IN_TELNET
|
|
||||||
lda #0
|
|
||||||
sta xmodem_iac_escape
|
|
||||||
.endif
|
|
||||||
|
|
||||||
@after_mode_set:
|
|
||||||
|
|
||||||
lda #147 ; 'CLR/HOME'
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
ldax #connecting_in
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda telnet_use_native_charset
|
|
||||||
beq @v_mode
|
|
||||||
ldax #petscii
|
|
||||||
jmp @c_mode
|
|
||||||
@v_mode:
|
|
||||||
ldax #vt100
|
|
||||||
@c_mode:
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #mode
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
lda $d020
|
|
||||||
sta original_border
|
|
||||||
|
|
||||||
jsr telnet_connect
|
|
||||||
|
|
||||||
lda original_border
|
|
||||||
sta $d020
|
|
||||||
;reset the background colour
|
|
||||||
|
|
||||||
jmp telnet_main_entry
|
|
||||||
|
|
||||||
telnet_on_connection:
|
|
||||||
;toggle the background colour
|
|
||||||
dec $d020
|
|
||||||
rts
|
|
||||||
|
|
||||||
;constants
|
|
||||||
connecting_in: .byte "connecting in ",0
|
|
||||||
vt100: .byte "vt100",0
|
|
||||||
petscii: .byte "petscii",0
|
|
||||||
mode: .byte " mode",10,0
|
|
||||||
remote_host: .byte "hostname (leave blank to quit)",10,": ",0
|
|
||||||
remote_port: .byte "port # (leave blank for default)",10,": ",0
|
|
||||||
char_mode_prompt: .byte "mode - V=vt100, P=petscii",10,0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR telnet.i --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
Binary file not shown.
|
@ -1,58 +0,0 @@
|
||||||
AS=ca65
|
|
||||||
LD=ld65
|
|
||||||
CFLAGS=-Oirs -t $(TARGET)
|
|
||||||
AFLAGS=
|
|
||||||
|
|
||||||
INCFILES=\
|
|
||||||
../inc/common.i\
|
|
||||||
../inc/commonprint.i\
|
|
||||||
../inc/net.i\
|
|
||||||
../inc/menu.i\
|
|
||||||
../inc/kipper_constants.i\
|
|
||||||
../inc/version.i\
|
|
||||||
|
|
||||||
IP65LIB=../ip65/ip65.lib
|
|
||||||
IP65TCPLIB=../ip65/ip65_tcp.lib
|
|
||||||
C64RRNETLIB=../drivers/c64rrnet.lib
|
|
||||||
IP65WIZNETLIB=../ip65/ip65_wiznet.lib
|
|
||||||
C64WIZNETLIB=../drivers/c64wiznet.lib
|
|
||||||
|
|
||||||
|
|
||||||
all: ip65 drivers kipperterm2.prg kt2wiz.prg kipperterm2.d64 kt2wiz.d64
|
|
||||||
|
|
||||||
|
|
||||||
kipperterm2.o: kipperterm2.s $(INCFILES) ../inc/telnet.i ../inc/config_menu.i ../inc/gopher.i
|
|
||||||
ruby -e "puts '.byte \"' + Time.now.strftime('%Y-%m-%d')+'\"'" > timestamp.i
|
|
||||||
$(AS) $(AFLAGS) -o $@ $<
|
|
||||||
|
|
||||||
%.o: %.s $(INCFILES)
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
%.prg: %.o $(IP65LIB) $(C64RRNETLIB) $(INCFILES) ../cfg/c64fullprg.cfg
|
|
||||||
$(LD) -m $*.map -vm -C ../cfg/c64fullprg.cfg -o $*.prg $(AFLAGS) $< $(IP65TCPLIB) $(C64RRNETLIB)
|
|
||||||
ruby ../carts/set_ip_config.rb $@ mac auto
|
|
||||||
|
|
||||||
kt2wiz.prg: kipperterm2.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64fullprg.cfg
|
|
||||||
$(LD) -m kt2wiz.map -vm -C ../cfg/c64fullprg.cfg -o kt2wiz.prg $(AFLAGS) $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
|
|
||||||
cp kt2wiz.prg ../../server/boot
|
|
||||||
|
|
||||||
|
|
||||||
kipperterm2.d64: kipperterm2.prg addresses.txt abe.bas
|
|
||||||
c1541 -format kipperterm2,k2 d64 $@ -attach $@ -write kipperterm2.prg -write "addresses.txt" "addresses.txt,s" -write abe
|
|
||||||
cp kipperterm2.d64 ../../server/boot
|
|
||||||
|
|
||||||
kt2wiz.d64: kt2wiz.prg addresses.txt abe.bas
|
|
||||||
c1541 -format kt2wiz,kw d64 $@ -attach $@ -write kt2wiz.prg -write "addresses.txt" "addresses.txt,s" -write abe
|
|
||||||
cp kt2wiz.d64 ../wiznet/
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *~
|
|
||||||
|
|
||||||
ip65:
|
|
||||||
make -C ../ip65 all
|
|
||||||
|
|
||||||
drivers:
|
|
||||||
make -C ../drivers all
|
|
|
@ -1,9 +0,0 @@
|
||||||
redo directory listing code (not hardcoded to 1541 disk format)
|
|
||||||
scrollback buffer
|
|
||||||
log session to disk
|
|
||||||
punter protocol
|
|
||||||
tftp individual files
|
|
||||||
allow changing of default drive from telnet menu
|
|
||||||
send dos command to current drive
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,14 +0,0 @@
|
||||||
1FLOODGAP GOPHER / GOPHER.FLOODGAP.COM 70
|
|
||||||
8JAMTRONIX PETSCIIMATION /n JAMTRONIX.COM 6464
|
|
||||||
8ANTIDOTE /n ANTIDOTE.HOPTO.ORG 23
|
|
||||||
8EXCALIBUR'S STONE /n BBS.EXCALIBURSSTONE.COM 6400
|
|
||||||
8JAMMING SIGNAL /n BBS.JAMMINGSIGNAL.COM 23
|
|
||||||
8MAD WORLD /n MADWORLD.BOUNCEME.NET 23
|
|
||||||
8REALMS OF MYSTERY /n BBS.PIPESUP.CA 6400
|
|
||||||
8RIKTRONICS /n RKBBS.NET 23
|
|
||||||
8WIZARD'S REALM /n WIZBBS.DYNDNS.ORG 23
|
|
||||||
8COTTONWOOD BBS /n COTTONWOOD.SERVEBBS.COM 23
|
|
||||||
8COTTONWOOD II /n COTTONWOOD.SERVEBBS.COM 6400
|
|
||||||
8THE HIDDEN /n THE-HIDDEN.HOPTO.ORG 23
|
|
||||||
|
|
||||||
.
|
|
|
@ -1,781 +0,0 @@
|
||||||
; #############
|
|
||||||
; KIPPERTERM 2 - Telnet/Gopher client for C64
|
|
||||||
; jonno@jamtronix.com
|
|
||||||
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
|
||||||
.include "../inc/commonprint.i"
|
|
||||||
.include "../inc/c64keycodes.i"
|
|
||||||
.include "../inc/menu.i"
|
|
||||||
.include "../inc/config_menu.i"
|
|
||||||
|
|
||||||
KEY_NEXT_PAGE=KEYCODE_F7
|
|
||||||
KEY_PREV_PAGE=KEYCODE_F1
|
|
||||||
KEY_SHOW_HISTORY=KEYCODE_F2
|
|
||||||
KEY_BACK_IN_HISTORY=KEYCODE_F3
|
|
||||||
KEY_NEW_SERVER=KEYCODE_F5
|
|
||||||
|
|
||||||
XMODEM_IN_TELNET = 1
|
|
||||||
GOPHER_BUFFER_SIZE = 2000
|
|
||||||
.include "../inc/gopher.i"
|
|
||||||
.include "../inc/telnet.i"
|
|
||||||
|
|
||||||
|
|
||||||
.import xmodem_iac_escape
|
|
||||||
.import io_error_buffer
|
|
||||||
.import cls
|
|
||||||
.import beep
|
|
||||||
.import exit_to_basic
|
|
||||||
.import ip65_process
|
|
||||||
.import ip65_init
|
|
||||||
.import get_filtered_input
|
|
||||||
.import filter_text
|
|
||||||
.import filter_dns
|
|
||||||
.import filter_ip
|
|
||||||
.import arp_calculate_gateway_mask
|
|
||||||
.import parse_dotted_quad
|
|
||||||
.import dotted_quad_value
|
|
||||||
.import parse_integer
|
|
||||||
|
|
||||||
|
|
||||||
.import xmodem_receive
|
|
||||||
.import xmodem_send
|
|
||||||
|
|
||||||
.import get_key_ip65
|
|
||||||
.import cfg_mac
|
|
||||||
.import dhcp_init
|
|
||||||
|
|
||||||
.import cfg_ip
|
|
||||||
.import cfg_netmask
|
|
||||||
.import cfg_gateway
|
|
||||||
.import cfg_dns
|
|
||||||
.import cfg_tftp_server
|
|
||||||
|
|
||||||
.import xmodem_receive
|
|
||||||
|
|
||||||
.import tcp_send
|
|
||||||
.import tcp_send_data_len
|
|
||||||
|
|
||||||
.import io_read_catalogue
|
|
||||||
.import io_device_no
|
|
||||||
.import io_read_file
|
|
||||||
.import io_filename
|
|
||||||
.import io_filesize
|
|
||||||
.export telnet_menu
|
|
||||||
|
|
||||||
.import print_a
|
|
||||||
.import print_cr
|
|
||||||
.import copymem
|
|
||||||
.importzp copy_src
|
|
||||||
.importzp copy_dest
|
|
||||||
.import get_filtered_input
|
|
||||||
|
|
||||||
.import cfg_tftp_server
|
|
||||||
|
|
||||||
.bss
|
|
||||||
;temp_ax: .res 2
|
|
||||||
|
|
||||||
|
|
||||||
.segment "STARTUP" ;this is what gets put at the start of the file on the C64
|
|
||||||
|
|
||||||
.word basicstub ; load address
|
|
||||||
|
|
||||||
basicstub:
|
|
||||||
.word @nextline
|
|
||||||
.word 2003
|
|
||||||
.byte $9e
|
|
||||||
.byte <(((init / 10000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 1000) .mod 10) + $30)
|
|
||||||
.byte <(((init / 100 ) .mod 10) + $30)
|
|
||||||
.byte <(((init / 10 ) .mod 10) + $30)
|
|
||||||
.byte <(((init ) .mod 10) + $30)
|
|
||||||
.byte 0
|
|
||||||
@nextline:
|
|
||||||
.word 0
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
init:
|
|
||||||
lda #$36
|
|
||||||
sta $01 ;turn off BASIC
|
|
||||||
jsr setup_screen
|
|
||||||
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #init_msg+1
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #eth_driver_name
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
lda eth_driver_io_base+1
|
|
||||||
jsr print_hex
|
|
||||||
lda eth_driver_io_base
|
|
||||||
jsr print_hex
|
|
||||||
lda #' '
|
|
||||||
jsr print_a
|
|
||||||
jsr ip65_init
|
|
||||||
bcs init_failed
|
|
||||||
jsr dhcp_init
|
|
||||||
bcc init_ok
|
|
||||||
jsr ip65_init ;if DHCP failed, then reinit the IP stack (which will reset IP address etc that DHCP messed with to default values)
|
|
||||||
bcc init_ok
|
|
||||||
init_failed:
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr wait_for_keypress
|
|
||||||
|
|
||||||
jmp exit_to_basic
|
|
||||||
|
|
||||||
print_main_menu:
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #main_menu_msg
|
|
||||||
jmp print_ascii_as_native
|
|
||||||
|
|
||||||
init_ok:
|
|
||||||
|
|
||||||
lda $ba
|
|
||||||
sta cfg_default_drive
|
|
||||||
|
|
||||||
main_menu:
|
|
||||||
jsr print_main_menu
|
|
||||||
jsr print_ip_config
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
@get_key:
|
|
||||||
jsr get_key_ip65
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne @not_f1
|
|
||||||
jsr cls
|
|
||||||
ldax #telnet_header
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jmp telnet_main_entry
|
|
||||||
|
|
||||||
@not_f1:
|
|
||||||
cmp #KEYCODE_F3
|
|
||||||
bne @not_f3
|
|
||||||
jsr cls
|
|
||||||
ldax #gopher_header
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr prompt_for_gopher_resource ;only returns if no server was entered.
|
|
||||||
jmp exit_gopher
|
|
||||||
@not_f3:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F5
|
|
||||||
bne @not_f5
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
clc
|
|
||||||
jsr set_io_device_no
|
|
||||||
ldax #address_book_filename
|
|
||||||
stax io_filename
|
|
||||||
ldax #scratch_buffer
|
|
||||||
jsr io_read_file
|
|
||||||
bcc @no_error_reading_address_book
|
|
||||||
ldax #address_book_fail_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
ldax #address_book_filename
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #drive_text
|
|
||||||
jsr print
|
|
||||||
lda $ba
|
|
||||||
ldx #0
|
|
||||||
jsr print_integer
|
|
||||||
jsr print_cr
|
|
||||||
|
|
||||||
ldax #io_error_buffer
|
|
||||||
jsr print
|
|
||||||
|
|
||||||
jsr wait_for_keypress
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
@no_error_reading_address_book:
|
|
||||||
|
|
||||||
|
|
||||||
lda #'1'
|
|
||||||
sta displayed_resource_type
|
|
||||||
|
|
||||||
;put a nul byte at end of file
|
|
||||||
ldax #scratch_buffer
|
|
||||||
stax pptr
|
|
||||||
clc
|
|
||||||
lda io_filesize
|
|
||||||
adc #<scratch_buffer
|
|
||||||
sta pptr
|
|
||||||
lda io_filesize+1
|
|
||||||
adc #>scratch_buffer
|
|
||||||
sta pptr+1
|
|
||||||
lda #0
|
|
||||||
tay
|
|
||||||
sta (pptr),y
|
|
||||||
inc $d020
|
|
||||||
jsr display_resource_in_buffer
|
|
||||||
|
|
||||||
jmp exit_gopher
|
|
||||||
@not_f5:
|
|
||||||
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
beq @change_config
|
|
||||||
cmp #KEYCODE_F8
|
|
||||||
bne @not_f8
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #credits
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr get_key_ip65
|
|
||||||
jmp main_menu
|
|
||||||
@not_f8:
|
|
||||||
|
|
||||||
jmp @get_key
|
|
||||||
|
|
||||||
@change_config:
|
|
||||||
jsr configuration_menu
|
|
||||||
jmp main_menu
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wait_for_keypress:
|
|
||||||
ldax #press_a_key_to_continue
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@loop:
|
|
||||||
jsr $ffe4
|
|
||||||
beq @loop
|
|
||||||
rts
|
|
||||||
|
|
||||||
get_key:
|
|
||||||
jmp get_key_ip65
|
|
||||||
|
|
||||||
cfg_get_configuration_ptr:
|
|
||||||
ldax #cfg_mac
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
setup_screen:
|
|
||||||
jsr cls
|
|
||||||
;make sure normal font
|
|
||||||
lda #$15
|
|
||||||
sta $d018
|
|
||||||
|
|
||||||
LDA #$06 ;blue
|
|
||||||
|
|
||||||
STA $D020 ;border
|
|
||||||
LDA #$00 ;black
|
|
||||||
STA $D021 ;background
|
|
||||||
lda #$05 ;petscii for white text
|
|
||||||
jsr print_a
|
|
||||||
|
|
||||||
lda #14
|
|
||||||
jmp print_a ;switch to lower case
|
|
||||||
|
|
||||||
save_screen_settings:
|
|
||||||
;save current settings
|
|
||||||
lda $d018
|
|
||||||
sta temp_font
|
|
||||||
lda $d020
|
|
||||||
sta temp_border
|
|
||||||
lda $d021
|
|
||||||
sta temp_text_back
|
|
||||||
lda $0286
|
|
||||||
sta temp_text_fore
|
|
||||||
|
|
||||||
ldx #$27
|
|
||||||
@save_page_zero_vars_loop:
|
|
||||||
lda $cf,x
|
|
||||||
sta temp_page_zero_vars,x
|
|
||||||
dex
|
|
||||||
bne @save_page_zero_vars_loop
|
|
||||||
|
|
||||||
ldax #$400
|
|
||||||
stax copy_src
|
|
||||||
ldax #temp_screen_chars
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #$d800
|
|
||||||
stax copy_src
|
|
||||||
ldax #temp_colour_ram
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jmp copymem
|
|
||||||
|
|
||||||
restore_screen_settings:
|
|
||||||
lda temp_font
|
|
||||||
sta $d018
|
|
||||||
|
|
||||||
|
|
||||||
lda temp_border
|
|
||||||
sta $d020
|
|
||||||
lda temp_text_back
|
|
||||||
sta $d021
|
|
||||||
lda temp_text_fore
|
|
||||||
sta $0286
|
|
||||||
|
|
||||||
ldx #$27
|
|
||||||
@restore_page_zero_vars_loop:
|
|
||||||
lda temp_page_zero_vars,x
|
|
||||||
sta $cf,x
|
|
||||||
dex
|
|
||||||
bne @restore_page_zero_vars_loop
|
|
||||||
|
|
||||||
ldax #temp_screen_chars
|
|
||||||
stax copy_src
|
|
||||||
ldax #$400
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jsr copymem
|
|
||||||
|
|
||||||
ldax #temp_colour_ram
|
|
||||||
stax copy_src
|
|
||||||
ldax #$d800
|
|
||||||
stax copy_dest
|
|
||||||
ldax #$400
|
|
||||||
jmp copymem
|
|
||||||
|
|
||||||
|
|
||||||
telnet_menu:
|
|
||||||
|
|
||||||
jsr save_screen_settings
|
|
||||||
jsr setup_screen
|
|
||||||
|
|
||||||
@show_menu:
|
|
||||||
|
|
||||||
jsr cls
|
|
||||||
|
|
||||||
ldax #menu_header_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #telnet_menu_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
|
|
||||||
@get_menu_option:
|
|
||||||
jsr get_key
|
|
||||||
cmp #KEYCODE_F1
|
|
||||||
bne :+
|
|
||||||
jsr xmodem_download
|
|
||||||
jmp @exit
|
|
||||||
:
|
|
||||||
cmp #KEYCODE_F3
|
|
||||||
bne :+
|
|
||||||
jsr xmodem_upload
|
|
||||||
jmp @exit
|
|
||||||
:
|
|
||||||
cmp #KEYCODE_F5
|
|
||||||
bne :+
|
|
||||||
@get_ascii_value:
|
|
||||||
ldax #enter_ascii
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldy #3 ;max chars
|
|
||||||
ldax #filter_number
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @show_menu
|
|
||||||
;AX now points a string containing 0..999
|
|
||||||
.import parse_integer
|
|
||||||
jsr parse_integer
|
|
||||||
cpx #0
|
|
||||||
bne @get_ascii_value
|
|
||||||
sta ascii_packet
|
|
||||||
lda #1
|
|
||||||
stax tcp_send_data_len
|
|
||||||
jsr restore_screen_settings ;since we won't return from tcp_send
|
|
||||||
ldax #ascii_packet
|
|
||||||
jmp tcp_send
|
|
||||||
|
|
||||||
|
|
||||||
:
|
|
||||||
cmp #KEYCODE_F7
|
|
||||||
beq @exit
|
|
||||||
jmp @get_menu_option
|
|
||||||
@exit:
|
|
||||||
jsr restore_screen_settings
|
|
||||||
rts
|
|
||||||
|
|
||||||
set_io_device_no:
|
|
||||||
lda cfg_default_drive
|
|
||||||
sec
|
|
||||||
sbc #7
|
|
||||||
sta io_device_no
|
|
||||||
rts
|
|
||||||
xmodem_upload:
|
|
||||||
jsr set_io_device_no
|
|
||||||
lda #0
|
|
||||||
sta eof
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
jsr io_read_catalogue
|
|
||||||
bcs @dir_failed
|
|
||||||
lda directory_buffer ;get the first byte that was downloaded
|
|
||||||
bne :+
|
|
||||||
jmp @no_files_on_disk
|
|
||||||
:
|
|
||||||
|
|
||||||
ldax #directory_buffer
|
|
||||||
ldy #0 ;filenames will NOT be ASCII
|
|
||||||
jsr select_option_from_menu
|
|
||||||
bcc @disk_filename_set
|
|
||||||
rts
|
|
||||||
|
|
||||||
@dir_failed:
|
|
||||||
ldax #dir_listing_fail_msg
|
|
||||||
@print_error:
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr print_cr
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
@no_files_on_disk:
|
|
||||||
ldax #no_files
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@wait_keypress_then_return_to_main:
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
|
|
||||||
@disk_filename_set:
|
|
||||||
|
|
||||||
;open file needs XY=pointer to name, A = length of name
|
|
||||||
stax copy_src
|
|
||||||
ldy #$ff
|
|
||||||
@next_byte:
|
|
||||||
iny
|
|
||||||
lda (copy_src),y
|
|
||||||
bne @next_byte
|
|
||||||
tya
|
|
||||||
ldx copy_src
|
|
||||||
ldy copy_src+1
|
|
||||||
|
|
||||||
jsr open_file
|
|
||||||
ldax #read_byte
|
|
||||||
jsr xmodem_send
|
|
||||||
bcc @no_error
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jmp :+
|
|
||||||
@no_error:
|
|
||||||
print_ok
|
|
||||||
:
|
|
||||||
jsr close_file
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
|
|
||||||
read_byte:
|
|
||||||
lda eof
|
|
||||||
beq @not_eof
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
@not_eof:
|
|
||||||
ldx #$02 ; filenumber 2 = output file
|
|
||||||
jsr $FFC6 ; call CHKIN (file 2 now used as input)
|
|
||||||
|
|
||||||
jsr $FFCF ; call CHRIN (get a byte from file)
|
|
||||||
pha
|
|
||||||
|
|
||||||
jsr $FFB7 ; call READST (read status byte)
|
|
||||||
|
|
||||||
beq :+ ; either EOF or read error
|
|
||||||
inc eof
|
|
||||||
:
|
|
||||||
ldx #$00 ; filenumber 0 = console
|
|
||||||
jsr $FFC6 ; call CHKIN (console now used as input)
|
|
||||||
|
|
||||||
pla
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
|
|
||||||
xmodem_download:
|
|
||||||
ldax #opening_file
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr open_dl_file
|
|
||||||
bcs @error
|
|
||||||
ldax #ok_msg
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
jsr print_cr
|
|
||||||
ldax #write_byte
|
|
||||||
jsr xmodem_receive
|
|
||||||
bcs @error
|
|
||||||
jsr close_file
|
|
||||||
ldax #transfer_complete
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
ldax #prompt_for_filename
|
|
||||||
jsr print_ascii_as_native
|
|
||||||
@get_filename:
|
|
||||||
ldax #filter_dns
|
|
||||||
ldy #40
|
|
||||||
jsr get_filtered_input
|
|
||||||
bcs @get_filename
|
|
||||||
jsr rename_file
|
|
||||||
|
|
||||||
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
print_failed
|
|
||||||
jsr print_errorcode
|
|
||||||
jsr close_file
|
|
||||||
jmp wait_for_keypress
|
|
||||||
|
|
||||||
open_dl_file:
|
|
||||||
|
|
||||||
;scratch the file first (if it exists)
|
|
||||||
;first copy the "S:"
|
|
||||||
ldx #0
|
|
||||||
:
|
|
||||||
lda scratch_cmd,x
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
cmp #':'
|
|
||||||
bne :-
|
|
||||||
jsr copy_tmp_filename_and_execute_cmd
|
|
||||||
|
|
||||||
lda #temp_filename_end-temp_filename
|
|
||||||
ldx #<temp_filename
|
|
||||||
ldy #>temp_filename
|
|
||||||
|
|
||||||
|
|
||||||
open_file:
|
|
||||||
;A,X,Y set up ready for a call to SETNAM for file #2
|
|
||||||
jsr $FFBD ; call SETNAM
|
|
||||||
lda #$02 ; file number 2
|
|
||||||
.import cfg_default_drive
|
|
||||||
ldx cfg_default_drive
|
|
||||||
|
|
||||||
ldy #$02 ; secondary address 2
|
|
||||||
jsr $FFBA ; call SETLFS
|
|
||||||
|
|
||||||
jsr $FFC0 ; call OPEN
|
|
||||||
bcs @error ; if carry set, the file could not be opened
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
sta ip65_error
|
|
||||||
jsr close_file
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
write_byte:
|
|
||||||
pha
|
|
||||||
ldx #$02 ; filenumber 2 = output file
|
|
||||||
jsr $FFC9 ; call CHKOUT
|
|
||||||
pla
|
|
||||||
jsr $ffd2 ;write byte
|
|
||||||
JSR $FFB7 ; call READST (read status byte)
|
|
||||||
bne @error
|
|
||||||
ldx #$00 ; filenumber 0 = console
|
|
||||||
jsr $FFC9 ; call CHKOUT
|
|
||||||
rts
|
|
||||||
@error:
|
|
||||||
lda #KPR_ERROR_FILE_ACCESS_FAILURE
|
|
||||||
sta ip65_error
|
|
||||||
jsr close_file
|
|
||||||
sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
close_file:
|
|
||||||
|
|
||||||
lda #$02 ; filenumber 2
|
|
||||||
jsr $FFC3 ; call CLOSE
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
rename_file:
|
|
||||||
;AX points at new filename
|
|
||||||
stax copy_src
|
|
||||||
ldx #0
|
|
||||||
;first the "RENAME0:"
|
|
||||||
|
|
||||||
:
|
|
||||||
lda rename_cmd,x
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
|
|
||||||
cmp #':'
|
|
||||||
bne :-
|
|
||||||
|
|
||||||
;now the new filename
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda (copy_src),y
|
|
||||||
beq @end_of_new_filename
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
@end_of_new_filename:
|
|
||||||
|
|
||||||
;now the "="
|
|
||||||
lda #'='
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
|
|
||||||
copy_tmp_filename_and_execute_cmd:
|
|
||||||
;now the old filename
|
|
||||||
ldy #0
|
|
||||||
:
|
|
||||||
lda temp_filename,y
|
|
||||||
cmp #','
|
|
||||||
beq @end_of_old_filename
|
|
||||||
sta command_buffer,x
|
|
||||||
inx
|
|
||||||
iny
|
|
||||||
bne :-
|
|
||||||
@end_of_old_filename:
|
|
||||||
txa ;filename length
|
|
||||||
ldx #<command_buffer
|
|
||||||
ldy #>command_buffer
|
|
||||||
jsr $FFBD ; call SETNAM
|
|
||||||
lda #$0F ; filenumber 15
|
|
||||||
ldx cfg_default_drive
|
|
||||||
ldy #$0F ; secondary address 15
|
|
||||||
jsr $FFBA ; call SETLFS
|
|
||||||
jsr $FFC0 ; call OPEN
|
|
||||||
lda #$0F ; filenumber 15
|
|
||||||
jsr $FFC3 ; call CLOSE
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
scratch_cmd:
|
|
||||||
.byte "S:"
|
|
||||||
|
|
||||||
rename_cmd:
|
|
||||||
.byte "RENAME:"
|
|
||||||
|
|
||||||
exit_telnet:
|
|
||||||
exit_gopher:
|
|
||||||
jsr setup_screen
|
|
||||||
jmp main_menu
|
|
||||||
.rodata
|
|
||||||
|
|
||||||
menu_header_msg:
|
|
||||||
.byte $13,10,"KIPPERTERM 2"
|
|
||||||
.byte 10,0
|
|
||||||
main_menu_msg:
|
|
||||||
.byte 10,"Main Menu",10,10
|
|
||||||
.byte "F1: Telnet F3: Gopher ",10
|
|
||||||
.byte "F5: Address Book",10
|
|
||||||
.byte "F7: Config F8: Credits",10,10
|
|
||||||
|
|
||||||
.byte 0
|
|
||||||
telnet_menu_msg:
|
|
||||||
.byte 10,10,10
|
|
||||||
.byte "F1: D/L File (XMODEM)",10
|
|
||||||
.byte "F3: U/L File (XMODEM)",10
|
|
||||||
.byte "F5: Send ASCII char",10
|
|
||||||
.byte "F7: Return",10,10
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
|
|
||||||
opening_file:
|
|
||||||
.byte 10,"opening file",10,0
|
|
||||||
transfer_complete:
|
|
||||||
.byte "transfer complete.",10,0
|
|
||||||
prompt_for_filename: .byte "save file as?",10,0
|
|
||||||
current:
|
|
||||||
.byte "current ",0
|
|
||||||
|
|
||||||
enter_ascii:
|
|
||||||
.byte 10,"ASCII value (0..255)? ",0
|
|
||||||
|
|
||||||
byte_sent:
|
|
||||||
.byte 10,"byte sent.",0
|
|
||||||
|
|
||||||
new:
|
|
||||||
.byte"new ",0
|
|
||||||
|
|
||||||
resolving:
|
|
||||||
.byte "resolving ",0
|
|
||||||
|
|
||||||
no_files:
|
|
||||||
.byte "no files",10,0
|
|
||||||
|
|
||||||
address_book_fail_msg:
|
|
||||||
.byte "couldn't open address book",10,0
|
|
||||||
|
|
||||||
dir_listing_fail_msg:
|
|
||||||
.byte "directory listing failed",10,0
|
|
||||||
|
|
||||||
temp_filename:
|
|
||||||
.byte "XMODEM.TMP,P,W" ; @ means 'overwrite if existing', ',P,W' is required to make this an output file
|
|
||||||
temp_filename_end:
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
|
|
||||||
address_book_filename: .byte "ADDRESSES.TXT",0
|
|
||||||
|
|
||||||
gopher_header: .byte "gopher",10,0
|
|
||||||
telnet_header: .byte "telnet",10,0
|
|
||||||
|
|
||||||
drive_text: .byte "drive #",0
|
|
||||||
|
|
||||||
|
|
||||||
credits:
|
|
||||||
.byte 10,"License: Mozilla Public License v1.1",10,"http://www.mozilla.org/MPL/"
|
|
||||||
.byte 10
|
|
||||||
.byte 10,"Contributors:",10
|
|
||||||
.byte 10,"Jonno Downes"
|
|
||||||
.byte 10,"Glenn Holmer"
|
|
||||||
.byte 10,"Per Olofsson"
|
|
||||||
.byte 10,"Lars Stollenwerk"
|
|
||||||
.byte 10,10
|
|
||||||
.byte "Build "
|
|
||||||
.include "../inc/version.i"
|
|
||||||
.byte " ("
|
|
||||||
.include "timestamp.i"
|
|
||||||
.byte ")"
|
|
||||||
.byte 10,10
|
|
||||||
|
|
||||||
.byte 0
|
|
||||||
|
|
||||||
.segment "APP_SCRATCH"
|
|
||||||
|
|
||||||
temp_font: .res 1
|
|
||||||
temp_border: .res 1
|
|
||||||
temp_text_back: .res 1
|
|
||||||
temp_text_fore: .res 1
|
|
||||||
temp_page_zero_vars: .res $28
|
|
||||||
temp_screen_chars: .res $400
|
|
||||||
temp_colour_ram: .res $400
|
|
||||||
command_buffer: .res $80
|
|
||||||
eof: .res 1
|
|
||||||
ascii_packet: .res 1
|
|
||||||
|
|
||||||
directory_buffer: .res $400
|
|
||||||
|
|
||||||
;we need to reserve space at $2000..$27FF for the VT100 font table
|
|
||||||
.segment "FONT_TABLE"
|
|
||||||
.res $800
|
|
||||||
|
|
||||||
;make a dummy cartdige header so our
|
|
||||||
.segment "CARTRIDGE_HEADER"
|
|
||||||
.byte "80"
|
|
||||||
.byte "KIPTRM"
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
.byte $0,$0,$0 ;reserved for future use
|
|
||||||
|
|
||||||
;-- LICENSE FOR kipperterm.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is KipperTerm.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
|
@ -1 +0,0 @@
|
||||||
.byte "2013-04-11"
|
|
|
@ -1 +0,0 @@
|
||||||
start c:\temp\WinVICE-2.1\x64.exe -cart16 carts\kipperkart.bin
|
|
|
@ -1,242 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<feed xmlns:google="http://base.google.com/ns/1.0" xml:lang="en-US" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.w3.org/2005/Atom" xmlns:twitter="http://api.twitter.com/">
|
|
||||||
<id>tag:search.twitter.com,2005:search/#c64</id>
|
|
||||||
<link type="text/html" rel="alternate" href="http://search.twitter.com/search?q=%23c64"/>
|
|
||||||
<link type="application/atom+xml" rel="self" href="http://search.twitter.com/search.atom?q=%23c64"/>
|
|
||||||
<title>#c64 - Twitter Search</title>
|
|
||||||
<link type="application/opensearchdescription+xml" rel="search" href="http://search.twitter.com/opensearch.xml"/>
|
|
||||||
<link type="application/atom+xml" rel="refresh" href="http://search.twitter.com/search.atom?q=%23c64&since_id=3222849162"/>
|
|
||||||
<twitter:warning>since_id removed for pagination.</twitter:warning>
|
|
||||||
<updated>2009-08-10T10:03:59Z</updated>
|
|
||||||
<openSearch:itemsPerPage>15</openSearch:itemsPerPage>
|
|
||||||
<link type="application/atom+xml" rel="next" href="http://search.twitter.com/search.atom?max_id=3222849162&page=2&q=%23c64"/>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3222849162</id>
|
|
||||||
<published>2009-08-10T10:03:59Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/aka_obi/statuses/3222849162"/>
|
|
||||||
<title>Lately I edited a Firebird music compilation. You can play it by using this player here. Please listen. http://bit.ly/DF8zQ #c64 #chiptune</title>
|
|
||||||
<content type="html">Lately I edited a Firebird music compilation. You can play it by using this player here. Please listen. <a href="http://bit.ly/DF8zQ">http://bit.ly/DF8zQ</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23chiptune">#chiptune</a></content>
|
|
||||||
<updated>2009-08-10T10:03:59Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://static.twitter.com/images/default_profile_normal.png"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>aka_obi (akaobi)</name>
|
|
||||||
<uri>http://twitter.com/aka_obi</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3222793961</id>
|
|
||||||
<published>2009-08-10T09:57:28Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/aka_obi/statuses/3222793961"/>
|
|
||||||
<title>Lately I edited a Firebird music compilation. You can play it by using this player here. Have fun. http://bit.ly/DF8zQ #c64 #chiptune</title>
|
|
||||||
<content type="html">Lately I edited a Firebird music compilation. You can play it by using this player here. Have fun. <a href="http://bit.ly/DF8zQ">http://bit.ly/DF8zQ</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23chiptune">#chiptune</a></content>
|
|
||||||
<updated>2009-08-10T09:57:28Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://static.twitter.com/images/default_profile_normal.png"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>aka_obi (akaobi)</name>
|
|
||||||
<uri>http://twitter.com/aka_obi</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3221757110</id>
|
|
||||||
<published>2009-08-10T07:30:45Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/chiptune/statuses/3221757110"/>
|
|
||||||
<title>is listening SID music on the iPhone! http://iphone.vanille.de/sidplayer/ #c64 #sid #iphone #chipmusic #8bit</title>
|
|
||||||
<content type="html">is listening SID music on the iPhone! <a href="http://iphone.vanille.de/sidplayer/">http://iphone.vanille.de/sidplayer/</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23sid">#sid</a> <a href="http://search.twitter.com/search?q=%23iphone">#iphone</a> <a href="http://search.twitter.com/search?q=%23chipmusic">#chipmusic</a> <a href="http://search.twitter.com/search?q=%238bit">#8bit</a></content>
|
|
||||||
<updated>2009-08-10T07:30:45Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/86599886/gameboy_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>chiptune (rez)</name>
|
|
||||||
<uri>http://twitter.com/chiptune</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3205731747</id>
|
|
||||||
<published>2009-08-09T10:16:06Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/wurstgranate/statuses/3205731747"/>
|
|
||||||
<title>Wenn man früher auf dem C64 nur mit S-Mon geproggt hat, dann ist das ScienceFiction! http://bit.ly/RuhAh
|
|
||||||
#c64</title>
|
|
||||||
<content type="html">Wenn man früher auf dem C64 nur mit S-Mon geproggt hat, dann ist das ScienceFiction! <a href="http://bit.ly/RuhAh">http://bit.ly/RuhAh</a>
|
|
||||||
<a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a></content>
|
|
||||||
<updated>2009-08-09T10:16:06Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://static.twitter.com/images/default_profile_normal.png"/>
|
|
||||||
<twitter:source><a href="http://thecosmicmachine.com/eventbox/">EventBox</a></twitter:source>
|
|
||||||
<twitter:lang>de</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>wurstgranate (Wurstgranate)</name>
|
|
||||||
<uri>http://twitter.com/wurstgranate</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3205709954</id>
|
|
||||||
<published>2009-08-09T10:13:18Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/wurstgranate/statuses/3205709954"/>
|
|
||||||
<title>http://bit.ly/RuhAh
|
|
||||||
#c64</title>
|
|
||||||
<content type="html"><a href="http://bit.ly/RuhAh">http://bit.ly/RuhAh</a>
|
|
||||||
<a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a></content>
|
|
||||||
<updated>2009-08-09T10:13:18Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://static.twitter.com/images/default_profile_normal.png"/>
|
|
||||||
<twitter:source><a href="http://thecosmicmachine.com/eventbox/">EventBox</a></twitter:source>
|
|
||||||
<twitter:lang></twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>wurstgranate (Wurstgranate)</name>
|
|
||||||
<uri>http://twitter.com/wurstgranate</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3205118149</id>
|
|
||||||
<published>2009-08-09T08:59:41Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/grabule/statuses/3205118149"/>
|
|
||||||
<title>http://www.remix64.com/amigacharts.html remix64 #c64 #amiga #charts ! check hybris 2009 :)</title>
|
|
||||||
<content type="html"><a href="http://www.remix64.com/amigacharts.html">http://www.remix64.com/amigacharts.html</a> remix64 <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23amiga">#amiga</a> <a href="http://search.twitter.com/search?q=%23charts">#charts</a> ! check hybris 2009 :)</content>
|
|
||||||
<updated>2009-08-09T08:59:41Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/290545289/mr2_normal.gif"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>fr</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>grabule (grabule)</name>
|
|
||||||
<uri>http://twitter.com/grabule</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3194733775</id>
|
|
||||||
<published>2009-08-08T16:35:20Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/grabule/statuses/3194733775"/>
|
|
||||||
<title>http://www.x-formz.com/music/ ultra great remixes of #c64 #amiga musics</title>
|
|
||||||
<content type="html"><a href="http://www.x-formz.com/music/">http://www.x-formz.com/music/</a> ultra great remixes of <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23amiga">#amiga</a> musics</content>
|
|
||||||
<updated>2009-08-08T16:35:20Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/290545289/mr2_normal.gif"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>eo</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>grabule (grabule)</name>
|
|
||||||
<uri>http://twitter.com/grabule</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3191289093</id>
|
|
||||||
<published>2009-08-08T09:16:19Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/gesus/statuses/3191289093"/>
|
|
||||||
<title>8bit-Prodigy really rocks! Praise the SID chip! ;) e.g. http://bit.ly/29WsHg (more at http://bit.ly/jPkYc) via @sv #wakeup_music #c64 #fb</title>
|
|
||||||
<content type="html">8bit-Prodigy really rocks! Praise the SID chip! ;) e.g. <a href="http://bit.ly/29WsHg">http://bit.ly/29WsHg</a> (more at <a href="http://bit.ly/jPkYc">http://bit.ly/jPkYc</a>) via <a href="http://twitter.com/sv">@sv</a> <a href="http://search.twitter.com/search?q=%23wakeup_music">#wakeup_music</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23fb">#fb</a></content>
|
|
||||||
<updated>2009-08-08T09:16:19Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/271664616/green_7541_starw_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>gesus (gesus)</name>
|
|
||||||
<uri>http://twitter.com/gesus</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3183233498</id>
|
|
||||||
<published>2009-08-07T20:50:04Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/sidshuman/statuses/3183233498"/>
|
|
||||||
<title>#StreetFighter II running on a #C64. Holy crap does that look bad! http://bit.ly/YgIdZ</title>
|
|
||||||
<content type="html"><a href="http://search.twitter.com/search?q=%23StreetFighter">#StreetFighter</a> II running on a <a href="http://search.twitter.com/search?q=%23C64"><b>#C64</b></a>. Holy crap does that look bad! <a href="http://bit.ly/YgIdZ">http://bit.ly/YgIdZ</a></content>
|
|
||||||
<updated>2009-08-07T20:50:04Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/131519015/tiny-blue3_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://www.tweetdeck.com/">TweetDeck</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>sidshuman (Sid Shuman)</name>
|
|
||||||
<uri>http://twitter.com/sidshuman</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3183089623</id>
|
|
||||||
<published>2009-08-07T20:39:47Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/sevik/statuses/3183089623"/>
|
|
||||||
<title>@IdleSi Armalyte rocks! My school mate held the high score in CVG magazine way back. Great loading music too. #retro #c64 #sid</title>
|
|
||||||
<content type="html"><a href="http://twitter.com/IdleSi">@IdleSi</a> Armalyte rocks! My school mate held the high score in CVG magazine way back. Great loading music too. <a href="http://search.twitter.com/search?q=%23retro">#retro</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23sid">#sid</a></content>
|
|
||||||
<updated>2009-08-07T20:39:47Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/351019145/face_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://www.tweetdeck.com/">TweetDeck</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>sevik (Sean Parker)</name>
|
|
||||||
<uri>http://twitter.com/sevik</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3164495376</id>
|
|
||||||
<published>2009-08-06T10:29:54Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/uberguineapig/statuses/3164495376"/>
|
|
||||||
<title>RT: @3typen der #iPhone #App #c64 #sid player für unterwegs http://twitpic.com/cypku wann kommt eigentlich ifrodo?</title>
|
|
||||||
<content type="html">RT: <a href="http://twitter.com/3typen">@3typen</a> der <a href="http://search.twitter.com/search?q=%23iPhone">#iPhone</a> <a href="http://search.twitter.com/search?q=%23App">#App</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23sid">#sid</a> player für unterwegs <a href="http://twitpic.com/cypku">http://twitpic.com/cypku</a> wann kommt eigentlich ifrodo?</content>
|
|
||||||
<updated>2009-08-06T10:29:54Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/323940395/guineapig_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://apiwiki.twitter.com/">API</a></twitter:source>
|
|
||||||
<twitter:lang>de</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>uberguineapig (Guinea Pigz)</name>
|
|
||||||
<uri>http://twitter.com/uberguineapig</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3164476839</id>
|
|
||||||
<published>2009-08-06T10:27:39Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/3typen/statuses/3164476839"/>
|
|
||||||
<title>der #iPhone #App #c64 #sid player für unterwegs http://twitpic.com/cypku wann kommt eigentlich ifrodo?</title>
|
|
||||||
<content type="html">der <a href="http://search.twitter.com/search?q=%23iPhone">#iPhone</a> <a href="http://search.twitter.com/search?q=%23App">#App</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23sid">#sid</a> player für unterwegs <a href="http://twitpic.com/cypku">http://twitpic.com/cypku</a> wann kommt eigentlich ifrodo?</content>
|
|
||||||
<updated>2009-08-06T10:27:39Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/17351832/twitter_logo_normal.gif"/>
|
|
||||||
<twitter:source><a href="http://www.tweetdeck.com/">TweetDeck</a></twitter:source>
|
|
||||||
<twitter:lang>de</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>3typen (3typen)</name>
|
|
||||||
<uri>http://twitter.com/3typen</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3152292799</id>
|
|
||||||
<published>2009-08-05T20:30:00Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/kevireilly/statuses/3152292799"/>
|
|
||||||
<title>Shredz64!!! Guitar Hero for Commodore 64.. wait what? people are still making stuff for Commodore? http://bit.ly/WpM41 #commodore #c64</title>
|
|
||||||
<content type="html">Shredz64!!! Guitar Hero for Commodore 64.. wait what? people are still making stuff for Commodore? <a href="http://bit.ly/WpM41">http://bit.ly/WpM41</a> <a href="http://search.twitter.com/search?q=%23commodore">#commodore</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a></content>
|
|
||||||
<updated>2009-08-05T20:30:00Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/82408033/icon_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://www.tweetdeck.com/">TweetDeck</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>kevireilly (Kevin Reilly)</name>
|
|
||||||
<uri>http://twitter.com/kevireilly</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3152230931</id>
|
|
||||||
<published>2009-08-05T20:26:26Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/falingo/statuses/3152230931"/>
|
|
||||||
<title>... Disk2 http://tinyurl.com/kwbxth #smashdesigns #ourdarkness #c64 #demoscene</title>
|
|
||||||
<content type="html">... Disk2 <a href="http://tinyurl.com/kwbxth">http://tinyurl.com/kwbxth</a> <a href="http://search.twitter.com/search?q=%23smashdesigns">#smashdesigns</a> <a href="http://search.twitter.com/search?q=%23ourdarkness">#ourdarkness</a> <a href="http://search.twitter.com/search?q=%23c64"><b>#c64</b></a> <a href="http://search.twitter.com/search?q=%23demoscene">#demoscene</a></content>
|
|
||||||
<updated>2009-08-05T20:26:26Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/340897397/logo_unten_transparent_80_normal.png"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>en</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>falingo (Michael)</name>
|
|
||||||
<uri>http://twitter.com/falingo</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
<entry>
|
|
||||||
<id>tag:search.twitter.com,2005:3151332602</id>
|
|
||||||
<published>2009-08-05T19:35:28Z</published>
|
|
||||||
<link type="text/html" rel="alternate" href="http://twitter.com/emju/statuses/3151332602"/>
|
|
||||||
<title>RT @SilwerSurfer: Bauernfeind @3Sat ! #Politik #zensursula #piraten #schäuble #C64</title>
|
|
||||||
<content type="html">RT <a href="http://twitter.com/SilwerSurfer">@SilwerSurfer</a>: Bauernfeind <a href="http://twitter.com/3Sat">@3Sat</a> ! <a href="http://search.twitter.com/search?q=%23Politik">#Politik</a> <a href="http://search.twitter.com/search?q=%23zensursula">#zensursula</a> <a href="http://search.twitter.com/search?q=%23piraten">#piraten</a> <a href="http://search.twitter.com/search?q=%23sch%C3%A4uble">#schäuble</a> <a href="http://search.twitter.com/search?q=%23C64"><b>#C64</b></a></content>
|
|
||||||
<updated>2009-08-05T19:35:28Z</updated>
|
|
||||||
<link type="image/png" rel="image" href="http://s3.amazonaws.com/twitter_production/profile_images/324556380/twitterProfilePhoto_normal.jpg"/>
|
|
||||||
<twitter:source><a href="http://twitter.com/">web</a></twitter:source>
|
|
||||||
<twitter:lang>de</twitter:lang>
|
|
||||||
<author>
|
|
||||||
<name>emju (EMJU)</name>
|
|
||||||
<uri>http://twitter.com/emju</uri>
|
|
||||||
</author>
|
|
||||||
</entry>
|
|
||||||
</feed>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<html>
|
|
||||||
This is file1
|
|
||||||
</html>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<html>
|
|
||||||
This is index.html
|
|
||||||
</html>
|
|
|
@ -1,44 +0,0 @@
|
||||||
AS=ca65
|
|
||||||
LD=ld65
|
|
||||||
CFLAGS=-Oirs -t $(TARGET)
|
|
||||||
AFLAGS=
|
|
||||||
|
|
||||||
INCFILES=\
|
|
||||||
../inc/common.i\
|
|
||||||
../inc/commonprint.i\
|
|
||||||
../inc/net.i\
|
|
||||||
../inc/menu.i\
|
|
||||||
../inc/kipper_constants.i
|
|
||||||
|
|
||||||
IP65LIB=../ip65/ip65.lib
|
|
||||||
|
|
||||||
APPLE2PROGLIB=../drivers/a2uther.lib
|
|
||||||
|
|
||||||
%.o: %.s $(INCFILES) $(APPLE2PROGLIB)
|
|
||||||
$(AS) $(AFLAGS) $<
|
|
||||||
|
|
||||||
all: utherboot.dsk
|
|
||||||
|
|
||||||
#c700_rom.bin: c700_rom.o ../cfg/a2rom.cfg
|
|
||||||
# $(LD) -C ../cfg/a2rom.cfg -o $@ c700_rom.o $(APPLE2PROGLIB)
|
|
||||||
#
|
|
||||||
#bankswitch_eeprom.bin: bankswitch_eeprom.o ../cfg/a2rom.cfg
|
|
||||||
# $(LD) -C ../cfg/a2rom.cfg -o $@ bankswitch_eeprom.o $(APPLE2PROGLIB)
|
|
||||||
#
|
|
||||||
#applewin.exe: c700_rom.bin bankswitch_eeprom.bin patch_applewin.rb
|
|
||||||
# ruby patch_applewin.rb
|
|
||||||
|
|
||||||
|
|
||||||
utherboot.pg2: utherboot.o $(IP65LIB) $(APPLE2PROGLIB) $(INCFILES) ../cfg/a2language_card.cfg
|
|
||||||
$(LD) -m utherboot.map -C ../cfg/a2language_card.cfg -o $@ $< $(IP65LIB) $(APPLE2PROGLIB)
|
|
||||||
|
|
||||||
utherboot.dsk: utherboot.pg2
|
|
||||||
ripxplore.rb --init AppleDos utherboot.dsk -a utherboot.pg2 -t AppleBinary
|
|
||||||
ripxplore.rb utherboot.dsk -a hello -t Applesoft
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.bin *.map *.prg *.pg2 *.dsk *.d64
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -f *~
|
|
|
@ -1,51 +0,0 @@
|
||||||
.segment "C800_0"
|
|
||||||
.asciiz "BANK $00"
|
|
||||||
.segment "C800_1"
|
|
||||||
.asciiz "BANK $01"
|
|
||||||
.segment "C800_2"
|
|
||||||
.asciiz "BANK $02"
|
|
||||||
.segment "C800_3"
|
|
||||||
.asciiz "BANK $03"
|
|
||||||
.segment "C800_4"
|
|
||||||
.asciiz "BANK $04"
|
|
||||||
.segment "C800_5"
|
|
||||||
.asciiz "BANK $05"
|
|
||||||
.segment "C800_6"
|
|
||||||
.asciiz "BANK $06"
|
|
||||||
.segment "C800_7"
|
|
||||||
.asciiz "BANK $07"
|
|
||||||
.segment "C800_8"
|
|
||||||
.asciiz "BANK $08"
|
|
||||||
.segment "C800_9"
|
|
||||||
.asciiz "BANK $09"
|
|
||||||
.segment "C800_A"
|
|
||||||
.asciiz "BANK $0A"
|
|
||||||
.segment "C800_B"
|
|
||||||
.asciiz "BANK $0B"
|
|
||||||
.segment "C800_C"
|
|
||||||
.asciiz "BANK $0C"
|
|
||||||
.segment "C800_D"
|
|
||||||
.asciiz "BANK $0D"
|
|
||||||
.segment "C800_E"
|
|
||||||
.asciiz "BANK $0E"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;-- LICENSE FOR bankswitch_eeprom.s --
|
|
||||||
; The contents of this file are subject to the Mozilla Public License
|
|
||||||
; Version 1.1 (the "License"); you may not use this file except in
|
|
||||||
; compliance with the License. You may obtain a copy of the License at
|
|
||||||
; http://www.mozilla.org/MPL/
|
|
||||||
;
|
|
||||||
; Software distributed under the License is distributed on an "AS IS"
|
|
||||||
; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
||||||
; License for the specific language governing rights and limitations
|
|
||||||
; under the License.
|
|
||||||
;
|
|
||||||
; The Original Code is ip65.
|
|
||||||
;
|
|
||||||
; The Initial Developer of the Original Code is Jonno Downes,
|
|
||||||
; jonno@jamtronix.com.
|
|
||||||
; Portions created by the Initial Developer are Copyright (C) 2009
|
|
||||||
; Jonno Downes. All Rights Reserved.
|
|
||||||
; -- LICENSE END --
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user