git-svn-id: http://svn.code.sf.net/p/netboot65/code@198 93682198-c243-4bdb-bd91-e943c89aac3b

This commit is contained in:
jonnosan 2009-09-27 06:21:35 +00:00
parent e9ede61899
commit 159c255766
3 changed files with 0 additions and 398 deletions

View File

@ -1,46 +0,0 @@
CC=cl65
AS=ca65
LD=ld65
CFLAGS=-Oirs -t $(TARGET)
AFLAGS=
IP65LIB=../ip65/ip65.lib
IP65TCPLIB=../ip65/ip65_tcp.lib
C64PNB65LIB=../drivers/c64nb65.lib
APPLE2PROGLIB=../drivers/apple2prog.lib
INCFILES=\
../inc/common.i\
../inc/commonprint.i\
../inc/net.i\
all: \
kipper.dsk \
%.o: %.c
$(CC) -c $(CFLAGS) $<
%.o: %.s
$(AS) $(AFLAGS) $<
kipper.o: kipper.s ../inc/gopher.i ../inc/telnet.i
$(AS) $(AFLAGS) $<
kipper.pg2: kipper.o $(IP65TCPLIB) $(APPLE2PROGLIB) $(INCFILES) ../cfg/a2bin.cfg
$(LD) -C ../cfg/a2bin.cfg -m kipper.map -vm -o kipper.pg2 $(AFLAGS) $< $(IP65TCPLIB) $(APPLE2PROGLIB)
#%.pg2: %.o $(IP65LIB) $(APPLE2PROGLIB) $(INCFILES) ../cfg/a2bin.cfg
# $(LD) -C ../cfg/a2bin.cfg -o $*.pg2 $(AFLAGS) $< $(IP65LIB) $(APPLE2PROGLIB)
kipper.dsk: kipper.pg2
ripxplore.rb --init BeautifulBoot kipper.dsk -a kipper.pg2 -t AppleBinary
clean:
rm -f *.o *.pg2 *.prg
rm -f kipper.dsk
distclean: clean
rm -f *~

View File

@ -1,67 +0,0 @@
;Apple 2 gopher browser
;july 2009 - jonno @ jamtronix.com
.include "../inc/common.i"
.include "../inc/commonprint.i"
.include "../inc/net.i"
.include "../inc/a2keycodes.i"
; .include "../inc/c64keycodes.i"
KEY_NEXT_PAGE=$8E ; ^N
KEY_PREV_PAGE=$90; ^P
KEY_SHOW_HISTORY=$93; ^S
KEY_BACK_IN_HISTORY=$82 ; ^B
KEY_NEW_SERVER=$89 ;TAB key
.include "../inc/gopher.i"
.import __CODE_LOAD__
.import __CODE_SIZE__
.import __RODATA_SIZE__
.import __DATA_SIZE__
.import get_key
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
.addr __CODE_LOAD__-3 ; Start address
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
jmp init
.code
init:
jsr cls
jsr $c300 ; go to 80 column mode
ldax #title
jsr print
jsr print_cr
init_ip_via_dhcp
jsr print_ip_config
ldax #initial_location
sta resource_pointer_lo
stx resource_pointer_hi
ldx #0
jsr select_resource_from_current_directory
exit_gopher:
jmp $e000
; rts
.rodata
title:
.byte " GOPHER ][",13," jonno@jamtronix.com",13,0
resolving:
.byte "RESOLVING ",0
initial_location:
.byte "1gopher.floodgap.com",$09,"/",$09,"gopher.floodgap.com",$09,"70",$0D,$0A,0

View File

@ -1,285 +0,0 @@
; Kipper
;started as a port of c64 telnet to A2 at Mt Keira Fest, July 2009
; jonno @ jamtronix.com
.include "../inc/common.i"
.include "../inc/commonprint.i"
.include "../inc/net.i"
.include "../inc/a2keycodes.i"
.import __CODE_LOAD__
.import __CODE_SIZE__
.import __RODATA_SIZE__
.import __DATA_SIZE__
.import get_key
.import cls
.import print_a_inverse
.import telnet_connect
.import telnet_local_echo
.import telnet_line_mode
.import telnet_use_native_charset
.import telnet_port
.import telnet_ip
.import cfg_init
.import dns_ip
.import dns_resolve
.import dns_set_hostname
.import get_filtered_input
.import filter_dns
.import filter_number
KEY_NEXT_PAGE=$8E ; ^N
KEY_PREV_PAGE=$90; ^P
KEY_SHOW_HISTORY=$93; ^S
KEY_BACK_IN_HISTORY=$82 ; ^B
KEY_NEW_SERVER=$89 ;TAB key
.include "../inc/gopher.i"
.segment "EXEHDR" ;this is what gets put an the start of the file on the Apple 2
.addr __CODE_LOAD__-3 ; Start address
.word __CODE_SIZE__+__RODATA_SIZE__+__DATA_SIZE__+4 ; Size
jmp init
.code
init:
jsr cls
jsr $c300
ldax #title
jsr print
jsr print_cr
init_ip_via_dhcp
jsr print_ip_config
main_loop:
ldax #main_menu
jsr print
@command_input:
jsr get_key
and #$7f ;strip high bit
cmp #'T'
beq @telnet
cmp #'t'
beq @telnet
cmp #'G'
beq @gopher
cmp #'g'
beq @gopher
cmp #'Q'
beq @quit
cmp #'q'
beq @quit
jmp @command_input
@telnet:
jmp telnet_main_entry
@gopher:
ldax #gopher_initial_location
sta resource_pointer_lo
stx resource_pointer_hi
; jsr print
ldx #0
jsr select_resource_from_current_directory
jmp main_loop
@quit:
jmp $e000
exit_telnet:
exit_gopher:
jmp main_loop
telnet_main_entry:
;prompt for a hostname, then resolve to an IP address
ldax #remote_host
jsr print
ldax #filter_dns
ldy #40
jsr get_filtered_input
bcc @host_entered
;if no host entered, then bail.
jmp exit_telnet
@host_entered:
stax hostname_ptr
jsr print_cr
ldax #resolving
jsr print
ldax hostname_ptr
jsr print
jsr print_cr
ldax hostname_ptr
jsr dns_set_hostname
bcs :+
jsr dns_resolve
:
bcc @resolved_ok
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
jsr get_port_number
bcc @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
@char_mode_input:
jsr get_key
and #$7f ;strip high bit
cmp #'A'
beq @ascii_mode
cmp #'a'
beq @ascii_mode
cmp #'N'
beq @native_mode
cmp #'n'
beq @native_mode
cmp #'l'
beq @line_mode
cmp #'L'
beq @line_mode
jmp @char_mode_input
@ascii_mode:
lda #0
sta telnet_use_native_charset
sta telnet_line_mode
lda #1
sta telnet_local_echo
jmp @after_mode_set
@native_mode:
lda #1
sta telnet_use_native_charset
lda #0
sta telnet_local_echo
sta telnet_line_mode
jmp @after_mode_set
@line_mode:
lda #0
sta telnet_use_native_charset
lda #1
sta telnet_local_echo
sta telnet_line_mode
@after_mode_set:
jsr cls
ldax #connecting_in
jsr print
lda telnet_use_native_charset
beq @a_mode
ldax #native
jmp @c_mode
@a_mode:
lda telnet_line_mode
bne @l_mode
ldax #ascii
jmp @c_mode
@l_mode:
ldax #line
@c_mode:
jsr print
ldax #mode
jsr print
jsr telnet_connect
jmp telnet_main_entry
get_port_number:
.import mul_8_16
.importzp acc16
ldy #5 ;max chars
ldax #filter_number
jsr get_filtered_input
bcs @no_port_entered
;AX now points a string containing port number
stax buffer_ptr
lda #0
sta port_number
sta port_number+1
tay
@parse_port:
lda (buffer_ptr),y
cmp #$1F
bcc @end_of_port ;any control char should be treated as end of port field
ldax port_number
stax acc16
lda #10
jsr mul_8_16
ldax acc16
stax port_number
lda (buffer_ptr),y
sec
sbc #'0'
clc
adc port_number
sta port_number
bcc @no_rollover
inc port_number+1
@no_rollover:
iny
bne @parse_port
@end_of_port:
ldax port_number
clc
@no_port_entered:
rts
.bss
hostname_ptr: .res 2
port_number: .res 2
.rodata
gopher_initial_location:
.byte "1gopher.floodgap.com",$09,"/",$09,"gopher.floodgap.com",$09,"70",$0D,$0A,0
main_menu: .byte "COMMAND - T=TELNET, G=GOPHER, Q=QUIT",13,0
resolving: .byte "RESOLVING ",0
connecting_in: .byte "CONNECTING IN ",0
ascii: .byte "ASCII",0
native: .byte "NATIVE",0
line: .byte "LINE",0
mode: .byte " MODE",13,0
remote_host: .byte "HOSTNAME (LEAVE BLANK TO QUIT)",13,": ",0
remote_port: .byte "PORT # (LEAVE BLANK FOR DEFAULT)",13,": ",0
char_mode_prompt: .byte "MODE - A=ASCII, N=NATIVE, L=LINE",13,0
title: .byte "KIPPER ][",13,"jonno@jamtronix.com",13,0