reduced zero page usage

fixed up jmp to BASIC after downloading

git-svn-id: http://svn.code.sf.net/p/netboot65/code@97 93682198-c243-4bdb-bd91-e943c89aac3b
This commit is contained in:
jonnosan 2009-04-12 12:45:25 +00:00
parent 3e452eb112
commit 6e24956a43
4 changed files with 24 additions and 18 deletions

View File

@ -2,8 +2,7 @@
# default is for GAME=1, EXROM=0,
MEMORY {
ZP: start = $02, size = $1A, type = rw, define = yes;
IP65ZP: start = $5f, size = $10, type = rw, define = yes;
IP65ZP: start = $A3, size = $0E, type = rw, define = yes;
HEADER: start = $8000, size = $18, file = %O;
ROM: start = $8018, size = $1F00, define = yes, file = %O;
RAM: start = $C080, size = $0f80, define = yes;
@ -16,8 +15,5 @@ SEGMENTS {
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;
ZEROPAGE: load = ZP, type = zp;
IP65ZP: load = IP65ZP, type = zp;
}

View File

@ -68,10 +68,10 @@
.data
exit_cart:
.if (BANKSWITCH_SUPPORT=$01)
.if (BANKSWITCH_SUPPORT=$02)
lda #$02
sta $de00 ;turns off RR cartridge by modifying GROUND and EXROM
.elseif (BANKSWITCH_SUPPORT=$02)
.elseif (BANKSWITCH_SUPPORT=$01)
lda #$36
sta $0001 ;turns off ordinary cartridge by modifying HIRAM/LORAM (this will also bank out BASIC)
.endif
@ -245,6 +245,7 @@ init:
lda nb65_param_buffer+NB65_TFTP_POINTER
cmp #01
bne @not_a_basic_file
lda nb65_param_buffer+NB65_TFTP_POINTER+1
cmp #$08
bne @not_a_basic_file
@ -258,13 +259,15 @@ init:
stx $2d ;save end-of-BASIC pointer (lo byte)
sty $2e ;save end-of-BASIC pointer (hi byte)
jsr $a659 ; CLR (reset variables)
ldax #$a7ae ; jump to BASIC interpreter loop
ldax #$a7ae ; jump to BASIC interpreter loop
jmp exit_cart_via_ax
@not_a_basic_file:
ldax nb65_param_buffer+NB65_TFTP_POINTER
exit_cart_via_ax:
stax call_downloaded_prg+1
sta call_downloaded_prg+1
stx call_downloaded_prg+2
jmp exit_cart
print_errorcode:
@ -364,10 +367,10 @@ press_a_key_to_continue:
nb65_ram_stub: ; this gets copied to $C000 so programs can bank in the cartridge
.byte $4E,$42,$36,$35 ; "NB65" - API signature
.if (BANKSWITCH_SUPPORT=$01)
.if (BANKSWITCH_SUPPORT=$02)
lda #$01
sta $de00 ;turns on RR cartridge (since it will have been banked out when exiting to BASIC)
.elseif (BANKSWITCH_SUPPORT=$02)
.elseif (BANKSWITCH_SUPPORT=$01)
lda #$37
sta $0001 ;turns on ordinary cartridge by modifying HIRAM/LORAM (this will also bank in BASIC)
.endif

View File

@ -12,9 +12,10 @@
.export print
.export print_decimal
.import cs_driver_name
.importzp copy_src
.zeropage
pptr: .res 2
;reuse the copy_src zero page var
pptr = copy_src
.bss
temp_bin: .res 1
temp_bcd: .res 2

View File

@ -39,10 +39,12 @@
.importzp copy_src
.importzp copy_dest
.zeropage
nb65_params: .res 2
;reuse the copy_src zero page location
nb65_params = copy_src
.data
old_ax: .res 2
jmp_old_irq:
jmp $0000
@ -91,7 +93,7 @@ set_tftp_params:
nb65_dispatcher:
stax nb65_params
stax old_ax
cpy #NB65_INITIALIZE
@ -128,12 +130,16 @@ irq_handler_installed:
@after_tftp_call: ;write the current load address back to the param buffer (so if $0000 was passed in, the caller can find out the actual value used)
bcs @tftp_error
ldax old_ax
stax nb65_params
ldy #NB65_TFTP_POINTER
lda tftp_load_address
sta (nb65_params),y
iny
lda tftp_load_address+1
sta (nb65_params),y
sta (nb65_params),y
clc
@tftp_error:
@dns_error: