mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-08-07 07:29:03 +00:00
very early (and not at all working) function dispatcher (instead of jump table).
git-svn-id: http://svn.code.sf.net/p/netboot65/code@66 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
parent
13f277ef44
commit
b9afc2c949
@ -4,8 +4,8 @@
|
||||
MEMORY {
|
||||
ZP: start = $02, size = $1A, type = rw, define = yes;
|
||||
IP65ZP: start = $5f, size = $10, type = rw, define = yes;
|
||||
HEADER: start = $0000, size = $9, file = %O;
|
||||
ROM: start = $8009, size = $1FF7, define = yes, file = %O;
|
||||
HEADER: start = $8000, size = $16, file = %O;
|
||||
ROM: start = $8016, size = $1F00, define = yes, file = %O;
|
||||
RAM: start = $6000, size = $2000, define = yes;
|
||||
|
||||
|
||||
|
@ -9,15 +9,25 @@
|
||||
; jonno@jamtronix.com - January 2009
|
||||
;
|
||||
|
||||
RRNETBOOT_IP65_DISPATCHER = $800d
|
||||
RRNETBOOT_IP65_PROCESS =$8010
|
||||
RRNETBOOT_IP65_VBL =$8013
|
||||
|
||||
|
||||
|
||||
.include "../inc/common.i"
|
||||
.include "../inc/commonprint.i"
|
||||
.include "../inc/net.i"
|
||||
.include "../inc/menu.i"
|
||||
.include "../inc/net.i"
|
||||
.include "../inc/c64keycodes.i"
|
||||
.include "../inc/ip65_function_numbers.i"
|
||||
.import cls
|
||||
.import get_key
|
||||
.import beep
|
||||
.import exit_to_basic
|
||||
.import timer_vbl_handler
|
||||
.import ip65_dispatcher
|
||||
.import ip65_process
|
||||
|
||||
.importzp tftp_filename
|
||||
.import tftp_load_address
|
||||
@ -34,13 +44,6 @@
|
||||
.import __DATA_RUN__
|
||||
.import __DATA_SIZE__
|
||||
|
||||
|
||||
.export jmp_ip65_init
|
||||
.export jmp_dhcp_init
|
||||
.export jmp_tftp_download
|
||||
.export jmp_tftp_directory_listing
|
||||
.export jmp_tftp_set_download_callback
|
||||
|
||||
.bss
|
||||
|
||||
;temp_bin: .res 1
|
||||
@ -54,28 +57,30 @@ tftp_dir_buffer: .res 2000
|
||||
.word init ;cold start vector
|
||||
.word init ;warm start vector
|
||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
||||
.byte "NB65" ;netboot 65 signature
|
||||
jmp ip65_dispatcher ; RRNETBOOT_IP65_DISPATCHER : entry point for IP65 functions
|
||||
jmp ip65_process ;RRNETBOOT_IP65_PROCESS : routine to be periodically called to check for arrival of ethernet packects
|
||||
jmp timer_vbl_handler ;RRNETBOOT_IP65_VBL : routine to be called during each vertical blank interrupt
|
||||
|
||||
.segment "JUMP_TABLE"
|
||||
.data
|
||||
jmp_old_irq:
|
||||
jmp $0000
|
||||
|
||||
jmp_ip65_init:
|
||||
jmp ip65_init
|
||||
|
||||
jmp_dhcp_init:
|
||||
jmp dhcp_init
|
||||
|
||||
jmp_tftp_directory_listing:
|
||||
jmp tftp_directory_listing
|
||||
|
||||
jmp_tftp_download:
|
||||
jmp tftp_download
|
||||
|
||||
jmp_tftp_set_download_callback:
|
||||
jmp tftp_set_download_callback
|
||||
|
||||
filler:
|
||||
.res 17
|
||||
.code
|
||||
|
||||
|
||||
|
||||
irq_handler:
|
||||
jsr RRNETBOOT_IP65_VBL
|
||||
jmp jmp_old_irq
|
||||
|
||||
remove_irq_handler:
|
||||
ldax jmp_old_irq+1 ;previous IRQ handler
|
||||
sei ;don't want any interrupts while we fiddle with the vector
|
||||
stax $314
|
||||
cli
|
||||
rts
|
||||
|
||||
init:
|
||||
|
||||
;first let the kernal do a normal startup
|
||||
@ -89,6 +94,8 @@ init:
|
||||
jsr $e3bf ;initialize zero page
|
||||
|
||||
|
||||
|
||||
|
||||
;relocate our r/w data
|
||||
ldax #__DATA_LOAD__
|
||||
stax copy_src
|
||||
@ -97,6 +104,13 @@ init:
|
||||
ldax #__DATA_SIZE__
|
||||
jsr copymem
|
||||
|
||||
;install our 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
|
||||
|
||||
ldax #startup_msg
|
||||
jsr print
|
||||
@ -112,14 +126,32 @@ init:
|
||||
jmp @get_key
|
||||
|
||||
@exit_to_basic:
|
||||
jsr remove_irq_handler
|
||||
jmp $fe66 ;do a wam start
|
||||
|
||||
@tftp_boot:
|
||||
|
||||
init_ip_via_dhcp
|
||||
bcc :+
|
||||
print_driver_init
|
||||
ldy #FN_IP65_INIT
|
||||
jsr RRNETBOOT_IP65_DISPATCHER
|
||||
|
||||
bcc :+
|
||||
print_failed
|
||||
jmp bad_boot
|
||||
:
|
||||
|
||||
print_ok
|
||||
|
||||
print_dhcp_init
|
||||
|
||||
ldy #FN_DHCP_INIT
|
||||
jsr RRNETBOOT_IP65_DISPATCHER
|
||||
bcc :+
|
||||
print_failed
|
||||
jmp bad_boot
|
||||
:
|
||||
print_ok
|
||||
|
||||
jsr print_ip_config
|
||||
|
||||
ldx #3
|
||||
@ -195,6 +227,8 @@ init:
|
||||
jmp bad_boot
|
||||
|
||||
@file_downloaded_ok:
|
||||
|
||||
jsr remove_irq_handler
|
||||
;check whether the file we just downloaded was a BASIC prg
|
||||
lda tftp_load_address
|
||||
cmp #01
|
||||
@ -227,6 +261,7 @@ bad_boot:
|
||||
ldax #press_a_key_to_continue
|
||||
jsr print
|
||||
jsr get_key
|
||||
jsr remove_irq_handler
|
||||
jmp $fe66 ;do a wam start
|
||||
|
||||
download:
|
||||
|
3
client/inc/ip65_function_numbers.i
Normal file
3
client/inc/ip65_function_numbers.i
Normal file
@ -0,0 +1,3 @@
|
||||
|
||||
FN_IP65_INIT= 1
|
||||
FN_DHCP_INIT=2
|
@ -27,6 +27,7 @@ ETHOBJS= \
|
||||
dns.o \
|
||||
dottedquad.o \
|
||||
tftp.o \
|
||||
function_dispatcher.o \
|
||||
|
||||
all: ip65.lib
|
||||
|
||||
|
26
client/ip65/function_dispatcher.s
Normal file
26
client/ip65/function_dispatcher.s
Normal file
@ -0,0 +1,26 @@
|
||||
.include "../inc/ip65_function_numbers.i"
|
||||
|
||||
.import ip65_init
|
||||
.import dhcp_init
|
||||
|
||||
.export ip65_dispatcher
|
||||
|
||||
|
||||
.code
|
||||
|
||||
ip65_dispatcher:
|
||||
|
||||
cpy #FN_IP65_INIT
|
||||
bne :+
|
||||
jmp ip65_init
|
||||
:
|
||||
|
||||
cpy #FN_DHCP_INIT
|
||||
bne :+
|
||||
jmp dhcp_init
|
||||
:
|
||||
|
||||
;default function handler
|
||||
lda #$ff ;function undefined
|
||||
sec ;carry flag set = error
|
||||
rts
|
Loading…
Reference in New Issue
Block a user