From 5ad32405319d62f702c6f93585e4161d1e9b7a5e Mon Sep 17 00:00:00 2001 From: jonnosan Date: Sun, 5 Apr 2009 06:46:55 +0000 Subject: [PATCH] move scratch ram to $C000, bank out cart ROMN when running d/led prg - this means can now d/l prgs up to 47K in size. git-svn-id: http://svn.code.sf.net/p/netboot65/code@82 93682198-c243-4bdb-bd91-e943c89aac3b --- client/cfg/rrbin.cfg | 2 +- client/clients/rrnetboot.s | 25 +++++++++++++++++-------- client/test/test_cart_api.s | 3 +++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/client/cfg/rrbin.cfg b/client/cfg/rrbin.cfg index 24f09c8..b467c9f 100644 --- a/client/cfg/rrbin.cfg +++ b/client/cfg/rrbin.cfg @@ -6,7 +6,7 @@ MEMORY { IP65ZP: start = $5f, size = $10, type = rw, define = yes; HEADER: start = $8000, size = $16, file = %O; ROM: start = $8016, size = $1F00, define = yes, file = %O; - RAM: start = $7000, size = $1000, define = yes; + RAM: start = $C000, size = $1000, define = yes; } diff --git a/client/clients/rrnetboot.s b/client/clients/rrnetboot.s index 9081dee..a43307d 100644 --- a/client/clients/rrnetboot.s +++ b/client/clients/rrnetboot.s @@ -33,11 +33,19 @@ .import __DATA_SIZE__ tftp_dir_buffer = $6000 - .bss + .data +exit_cart: + lda #$02 + sta $de00 ;turns off RR cartridge - obviously we need to execut this from RAM else we fall into never-never land :-) +jmp_to_downloaded_prg: + jmp $0000 ;overwritten when we load a file + + .bss + nb65_param_buffer: .res $10 -bin_file_jmp: .res 3 + @@ -94,7 +102,8 @@ init: jmp @get_key @exit_to_basic: - jmp $fe66 ;do a wam start + ldax #$fe66 ;do a wam start + jmp exit_to_cart_via_ax @tftp_boot: @@ -209,14 +218,14 @@ init: stx $2d ;save end-of-BASIC pointer (lo byte) sty $2e ;save end-of-BASIC pointer (hi byte) jsr $a659 ; CLR (reset variables) - jmp $a7ae ; jump to BASIC interpreter loop + ldax #$a7ae ; jump to BASIC interpreter loop + jmp exit_to_cart_via_ax @not_a_basic_file: - lda #$4C ;opcode for JMP - sta bin_file_jmp ldax nb65_param_buffer+NB65_TFTP_POINTER - stax bin_file_jmp+1 - jmp bin_file_jmp +exit_to_cart_via_ax: + stax jmp_to_downloaded_prg+1 + jmp exit_cart print_errorcode: ldax #error_code diff --git a/client/test/test_cart_api.s b/client/test/test_cart_api.s index 391b8fc..2726f81 100644 --- a/client/test/test_cart_api.s +++ b/client/test/test_cart_api.s @@ -28,6 +28,9 @@ basicstub: init: + lda #$01 + sta $de00 ;turns on RR cartridge (since it will have been banked out when exiting to BASIC) + jsr print_cr jsr print_ip_config