diff --git a/client/clients/Makefile b/client/clients/Makefile index 4740a26..2aabc68 100644 --- a/client/clients/Makefile +++ b/client/clients/Makefile @@ -2,7 +2,7 @@ CC=cl65 AS=ca65 LD=ld65 CFLAGS=-Oirs -t $(TARGET) -AFLAGS= +AFLAGS= INCFILES=\ ../inc/common.i\ @@ -30,18 +30,18 @@ all: \ $(BOOTA2.PG2) \ rrnetboot.bin: rrnetboot.o $(IP65LIB) $(C64NETLIB) $(INCFILES) ../cfg/rrbin.cfg - $(LD) -m rrnetboot.map -C ../cfg/rrbin.cfg -o rrnetboot.bin $(AFLAGS) $< $(IP65LIB) $(C64NETLIB) + $(LD) -m rrnetboot.map -vm -C ../cfg/rrbin.cfg -o rrnetboot.bin $< $(IP65LIB) $(C64NETLIB) ruby fix_cart.rb rrnetboot.bin utherboot.pg2: utherboot.o $(IP65LIB) $(APPLE2NETLIB) $(INCFILES) ../cfg/a2language_card.cfg - $(LD) -m utherboot.map -C ../cfg/a2language_card.cfg -o utherboot.pg2 $(AFLAGS) $< $(IP65LIB) $(APPLE2NETLIB) + $(LD) -m utherboot.map -C ../cfg/a2language_card.cfg -o utherboot.pg2 $< $(IP65LIB) $(APPLE2NETLIB) utherboot.dsk: utherboot.pg2 ripxplore.rb --init AppleDos utherboot.dsk -a utherboot.pg2 -t AppleBinary ripxplore.rb utherboot.dsk -a hello -t Applesoft $(BOOTA2.PG2): bootmenu.o $(IP65LIB) $(APPLE2NETLIB) $(INCFILES) ../cfg/a2language_card.cfg - $(LD) -m bootmenu.map -C ../cfg/a2language_card.cfg -o $(BOOTA2.PG2) $(AFLAGS) $< $(IP65LIB) $(APPLE2NETLIB) + $(LD) -m bootmenu.map -C ../cfg/a2language_card.cfg -o $(BOOTA2.PG2) $< $(IP65LIB) $(APPLE2NETLIB) clean: rm -f *.o diff --git a/client/clients/rrnetboot.s b/client/clients/rrnetboot.s index fe585f6..100df5f 100644 --- a/client/clients/rrnetboot.s +++ b/client/clients/rrnetboot.s @@ -24,7 +24,8 @@ .import tftp_ip .import tftp_download .import tftp_directory_listing - + .import tftp_set_download_callback + .import copymem .importzp copy_src .importzp copy_dest @@ -33,6 +34,13 @@ .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 @@ -47,8 +55,26 @@ tftp_dir_buffer: .res 2000 .word init ;warm start vector .byte $C3,$C2,$CD,$38,$30 ; "CBM80" -.code +.segment "JUMP_TABLE" +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 init: @@ -62,11 +88,8 @@ init: jsr $e453 ;set BASIC vectors jsr $e3bf ;initialize zero page - - ldax #startup_msg - jsr print - - ;relocate our r/w data + +;relocate our r/w data ldax #__DATA_LOAD__ stax copy_src ldax #__DATA_RUN__ @@ -74,7 +97,24 @@ init: ldax #__DATA_SIZE__ jsr copymem + + ldax #startup_msg + jsr print +@get_key: + jsr get_key + cmp #KEYCODE_F1 + beq @tftp_boot + cmp #KEYCODE_F3 + + beq @exit_to_basic + + jmp @get_key + +@exit_to_basic: + jmp $fe66 ;do a wam start + +@tftp_boot: init_ip_via_dhcp bcc :+ @@ -210,7 +250,10 @@ download: .rodata -startup_msg: .byte "NETBOOT65 - C64 NETWORK BOOT CLIENT V0.1",13,0 +startup_msg: +.byte "NETBOOT65 - C64 NETWORK BOOT CLIENT V0.2",13 +.byte "F1=TFTP BOOT, F3=BASIC",13 +.byte 0 downloading_msg: .asciiz "DOWNLOADING "