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,14 +4,14 @@
|
|||||||
MEMORY {
|
MEMORY {
|
||||||
ZP: start = $02, size = $1A, type = rw, define = yes;
|
ZP: start = $02, size = $1A, type = rw, define = yes;
|
||||||
IP65ZP: start = $5f, size = $10, type = rw, define = yes;
|
IP65ZP: start = $5f, size = $10, type = rw, define = yes;
|
||||||
HEADER: start = $0000, size = $9, file = %O;
|
HEADER: start = $8000, size = $16, file = %O;
|
||||||
ROM: start = $8009, size = $1FF7, define = yes, file = %O;
|
ROM: start = $8016, size = $1F00, define = yes, file = %O;
|
||||||
RAM: start = $6000, size = $2000, define = yes;
|
RAM: start = $6000, size = $2000, define = yes;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
SEGMENTS {
|
SEGMENTS {
|
||||||
CARTRIDGE_HEADER: load = HEADER, type = ro;
|
CARTRIDGE_HEADER: load = HEADER, type = ro;
|
||||||
CODE: load = ROM, type = ro;
|
CODE: load = ROM, type = ro;
|
||||||
RODATA: load = ROM, run=ROM, type = ro;
|
RODATA: load = ROM, run=ROM, type = ro;
|
||||||
DATA: load = ROM, run = RAM, type = rw, define = yes;
|
DATA: load = ROM, run = RAM, type = rw, define = yes;
|
||||||
|
@ -9,15 +9,25 @@
|
|||||||
; jonno@jamtronix.com - January 2009
|
; jonno@jamtronix.com - January 2009
|
||||||
;
|
;
|
||||||
|
|
||||||
|
RRNETBOOT_IP65_DISPATCHER = $800d
|
||||||
|
RRNETBOOT_IP65_PROCESS =$8010
|
||||||
|
RRNETBOOT_IP65_VBL =$8013
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.include "../inc/common.i"
|
.include "../inc/common.i"
|
||||||
.include "../inc/commonprint.i"
|
.include "../inc/commonprint.i"
|
||||||
.include "../inc/net.i"
|
|
||||||
.include "../inc/menu.i"
|
.include "../inc/menu.i"
|
||||||
|
.include "../inc/net.i"
|
||||||
.include "../inc/c64keycodes.i"
|
.include "../inc/c64keycodes.i"
|
||||||
|
.include "../inc/ip65_function_numbers.i"
|
||||||
.import cls
|
.import cls
|
||||||
.import get_key
|
.import get_key
|
||||||
.import beep
|
.import beep
|
||||||
.import exit_to_basic
|
.import exit_to_basic
|
||||||
|
.import timer_vbl_handler
|
||||||
|
.import ip65_dispatcher
|
||||||
|
.import ip65_process
|
||||||
|
|
||||||
.importzp tftp_filename
|
.importzp tftp_filename
|
||||||
.import tftp_load_address
|
.import tftp_load_address
|
||||||
@ -34,13 +44,6 @@
|
|||||||
.import __DATA_RUN__
|
.import __DATA_RUN__
|
||||||
.import __DATA_SIZE__
|
.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
|
.bss
|
||||||
|
|
||||||
;temp_bin: .res 1
|
;temp_bin: .res 1
|
||||||
@ -54,27 +57,29 @@ tftp_dir_buffer: .res 2000
|
|||||||
.word init ;cold start vector
|
.word init ;cold start vector
|
||||||
.word init ;warm start vector
|
.word init ;warm start vector
|
||||||
.byte $C3,$C2,$CD,$38,$30 ; "CBM80"
|
.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_ip65_init:
|
jmp $0000
|
||||||
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
|
.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:
|
init:
|
||||||
|
|
||||||
@ -89,6 +94,8 @@ init:
|
|||||||
jsr $e3bf ;initialize zero page
|
jsr $e3bf ;initialize zero page
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;relocate our r/w data
|
;relocate our r/w data
|
||||||
ldax #__DATA_LOAD__
|
ldax #__DATA_LOAD__
|
||||||
stax copy_src
|
stax copy_src
|
||||||
@ -97,7 +104,14 @@ init:
|
|||||||
ldax #__DATA_SIZE__
|
ldax #__DATA_SIZE__
|
||||||
jsr copymem
|
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
|
ldax #startup_msg
|
||||||
jsr print
|
jsr print
|
||||||
|
|
||||||
@ -112,14 +126,32 @@ init:
|
|||||||
jmp @get_key
|
jmp @get_key
|
||||||
|
|
||||||
@exit_to_basic:
|
@exit_to_basic:
|
||||||
|
jsr remove_irq_handler
|
||||||
jmp $fe66 ;do a wam start
|
jmp $fe66 ;do a wam start
|
||||||
|
|
||||||
@tftp_boot:
|
@tftp_boot:
|
||||||
|
|
||||||
init_ip_via_dhcp
|
print_driver_init
|
||||||
bcc :+
|
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
|
jmp bad_boot
|
||||||
:
|
:
|
||||||
|
print_ok
|
||||||
|
|
||||||
jsr print_ip_config
|
jsr print_ip_config
|
||||||
|
|
||||||
ldx #3
|
ldx #3
|
||||||
@ -195,6 +227,8 @@ init:
|
|||||||
jmp bad_boot
|
jmp bad_boot
|
||||||
|
|
||||||
@file_downloaded_ok:
|
@file_downloaded_ok:
|
||||||
|
|
||||||
|
jsr remove_irq_handler
|
||||||
;check whether the file we just downloaded was a BASIC prg
|
;check whether the file we just downloaded was a BASIC prg
|
||||||
lda tftp_load_address
|
lda tftp_load_address
|
||||||
cmp #01
|
cmp #01
|
||||||
@ -214,7 +248,7 @@ init:
|
|||||||
jsr $a659 ; CLR (reset variables)
|
jsr $a659 ; CLR (reset variables)
|
||||||
jmp $a7ae ; jump to BASIC interpreter loop
|
jmp $a7ae ; jump to BASIC interpreter loop
|
||||||
|
|
||||||
@not_a_basic_file:
|
@not_a_basic_file:
|
||||||
lda #$4C ;opcode for JMP
|
lda #$4C ;opcode for JMP
|
||||||
sta bin_file_jmp
|
sta bin_file_jmp
|
||||||
ldax tftp_load_address
|
ldax tftp_load_address
|
||||||
@ -227,6 +261,7 @@ bad_boot:
|
|||||||
ldax #press_a_key_to_continue
|
ldax #press_a_key_to_continue
|
||||||
jsr print
|
jsr print
|
||||||
jsr get_key
|
jsr get_key
|
||||||
|
jsr remove_irq_handler
|
||||||
jmp $fe66 ;do a wam start
|
jmp $fe66 ;do a wam start
|
||||||
|
|
||||||
download:
|
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
|
@ -26,7 +26,8 @@ ETHOBJS= \
|
|||||||
dhcp.o \
|
dhcp.o \
|
||||||
dns.o \
|
dns.o \
|
||||||
dottedquad.o \
|
dottedquad.o \
|
||||||
tftp.o \
|
tftp.o \
|
||||||
|
function_dispatcher.o \
|
||||||
|
|
||||||
all: ip65.lib
|
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