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

This commit is contained in:
jonnosan 2011-06-21 11:46:33 +00:00
parent 763402b26f
commit 104a4fe6bf
4 changed files with 95 additions and 26 deletions

View File

@ -53,8 +53,8 @@ telnetd.bin: telnetd.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64_8
telnetd.prg: telnetd.bin cartheader.prg telnetd.prg: telnetd.bin cartheader.prg
cat cartheader.prg telnetd.bin > $@ cat cartheader.prg telnetd.bin > $@
wizbobcart.bin: wizbobcart.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) ../cfg/c64_8kcart.cfg wizbobcart.bin: wizbobcart.o $(IP65WIZNETLIB) $(C64WIZNETLIB) $(INCFILES) wizbobcart.cfg
$(LD) -m wizbobcart.map -vm -C ../cfg/c64_8kcart.cfg -o $@ $< $(IP65WIZNETLIB) $(C64WIZNETLIB) $(LD) -m wizbobcart.map -vm -C wizbobcart.cfg -o $@ $< $(IP65WIZNETLIB) $(C64WIZNETLIB)
ruby ../carts/fix_cart.rb $@ 8192 ruby ../carts/fix_cart.rb $@ 8192
wizbobcart.prg: wizbobcart.bin cartheader.prg wizbobcart.prg: wizbobcart.bin cartheader.prg

View File

@ -84,6 +84,7 @@ warm_init:
@real_init: @real_init:
sta init_flag sta init_flag
;we need to set up BASIC as well ;we need to set up BASIC as well
jsr $e453 ;set BASIC vectors jsr $e453 ;set BASIC vectors
jsr $e3bf ;initialize zero page jsr $e3bf ;initialize zero page
@ -103,6 +104,14 @@ warm_init:
jsr copymem 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 ;copy KERNAL to RAM so we can patch it
@ -133,6 +142,10 @@ init_ok:
;install our new STOP handler ;install our new STOP handler
ldax ISTOP
stax old_stop_handler
ldax #stop_handler
stax ISTOP
cli cli
@ -201,6 +214,8 @@ get_key:
tick_handler: ;called at least 60hz via $314 tick_handler: ;called at least 60hz via $314
lda sending_flag
bne @done
inc jiffy_count inc jiffy_count
lda jiffy_count lda jiffy_count
cmp #$06 ;about 100ms cmp #$06 ;about 100ms
@ -234,10 +249,10 @@ telnet_callback:
beq @done beq @done
lda (buffer_ptr),y lda (buffer_ptr),y
; cmp #$03 ;is ^C? cmp #$03 ;is ^C?
; bne @not_ctrl_c bne @not_ctrl_c
; inc break_flag inc break_flag
; jmp @key_done jmp @key_done
@not_ctrl_c: @not_ctrl_c:
inc NDX inc NDX
sta KEYD,x sta KEYD,x
@ -257,13 +272,26 @@ new_charout:
pha pha
ldax #1 ldax #1
sta tcp_send_data_len sta tcp_send_data_len
sta sending_flag
ldax #output_buffer ldax #output_buffer
jsr tcp_send jsr tcp_send
dec sending_flag
pla pla
ldx temp_x ldx temp_x
ldy temp_y ldy temp_y
jmp $e719 ;after the code we patched 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 .bss
init_flag: .res 1 init_flag: .res 1
@ -276,7 +304,7 @@ output_buffer: .res 64
.data .data
jiffy_count: .byte 0 jiffy_count: .byte 0
break_flag: .byte 0 break_flag: .byte 0
sending_flag: .byte 0
.rodata .rodata
startup_msg: startup_msg:

View File

@ -0,0 +1,27 @@
# 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;
RAM4: start = $7800, size = $07C9, 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 = RAM4, type = rw, define = yes;
APP_SCRATCH: load = RAM4, type = bss;
TCP_VARS: load = RAM4, type = bss;
HTTP_VARS: load=ROM, run = RAM4, type = rw,define = yes;
}

View File

@ -104,13 +104,15 @@ crunched_line = $0200 ;Input buffer
.import __SELF_MODIFIED_CODE_SIZE__ .import __SELF_MODIFIED_CODE_SIZE__
temp_ptr =copy_src temp_ptr =copy_src
temp=copy_src ;temp=copy_src
temp2=copy_dest ;temp2=copy_dest
.segment "IP65ZP" : zeropage
pptr: .res 2
temp2: .res 2
temp=pptr
;.zeropage
;temp: .res 2
;temp2: .res 2
pptr=temp_ptr
.segment "CARTRIDGE_HEADER" .segment "CARTRIDGE_HEADER"
.word cold_init ;cold start vector .word cold_init ;cold start vector
.word warm_init ;warm start vector .word warm_init ;warm start vector
@ -140,15 +142,22 @@ warm_init:
jmp $fe5e ; contine on to real RESTORE routine jmp $fe5e ; contine on to real RESTORE routine
@real_init: @real_init:
sta init_flag sta init_flag
;we need to set up BASIC as well ;we need to set up BASIC as well
jsr $e453 ;set BASIC vectors jsr $e453 ;set BASIC vectors
jsr $e3bf ;initialize zero page jsr $e3bf ;initialize zero page
;set normal BASIC colour
LDA #$0e ;light blue
STA $D020 ;border
LDA #$06 ;dark blue
STA $D021 ;background
lda #$9a
jsr print_a
;make some room for extra RAM ;make some room for extra RAM
ldax #$5800 ldax #$7000
stax MEMSIZ stax MEMSIZ
stax http_variables_buffer stax http_variables_buffer
@ -217,6 +226,9 @@ install_new_vectors_loop:
jsr $A644 ;do a "NEW" jsr $A644 ;do a "NEW"
; jmp $A474 ;"READY" prompt ;FIXME - delete this line to autoload 'INDEX.BAS'
ldax #loading_index_bas ldax #loading_index_bas
jsr print jsr print
@ -908,6 +920,7 @@ goto:
find_hook: find_hook:
jsr calc_hash jsr calc_hash
ldy #0 ldy #0
ldx hooks ldx hooks
beq @done beq @done
@ -953,20 +966,25 @@ calc_hash:
bne @loop bne @loop
@done: @done:
sta hash sta hash
; ldax #transfer_buffer
; jsr print
; lda hash
; jsr print_hex
; jsr print_cr
rts rts
yield_keyword: yield_keyword:
jsr flush_keyword jsr flush_keyword
jsr tcp_close jsr tcp_close
.ifdef DEBUG
dec $d020
.endif
jmp httpd_start jmp httpd_start
gosub: gosub:
bang_keyword: bang_keyword:
jsr FRMEVL jsr FRMEVL
bit VALTYP bit VALTYP
bmi @string_val bmi @string_val
@ -1017,6 +1035,7 @@ got_http_request:
sta transfer_buffer,y sta transfer_buffer,y
sty param_length sty param_length
sty tmp_length sty tmp_length
tya
clc clc
lda #'P' lda #'P'
sta VARNAM sta VARNAM
@ -1107,9 +1126,6 @@ httpd_start:
bcs @abort_key_pressed bcs @abort_key_pressed
@connect_ok: @connect_ok:
.ifdef DEBUG
inc $d020
.endif
ldax #connection_from ldax #connection_from
jsr print jsr print
ldax #tcp_remote_ip ldax #tcp_remote_ip
@ -1156,9 +1172,6 @@ httpd_start:
lda connection_closed lda connection_closed
beq @main_polling_loop beq @main_polling_loop
@connection_timed_out: @connection_timed_out:
.ifdef DEBUG
dec $d020
.endif
jmp @listen jmp @listen
@got_eol: @got_eol:
@ -1397,8 +1410,8 @@ xsend_keyword:
JSR CHRIN ;(get a byte from file) JSR CHRIN ;(get a byte from file)
sta error_buffer,y sta error_buffer,y
iny iny
cpy #error_buffer_length-1
JMP @error_loop ; next byte bne @error_loop ; next byte
@error_eof: @error_eof:
lda #0 lda #0
sta error_buffer,y sta error_buffer,y
@ -1711,6 +1724,7 @@ temp_x: .res 1
sent_header: .res 1 sent_header: .res 1
tmp_a: .res 1 tmp_a: .res 1
error_buffer: .res 80 error_buffer: .res 80
error_buffer_length=*-error_buffer
top_of_stack: .res 1 top_of_stack: .res 1
.segment "TCP_VARS" .segment "TCP_VARS"