Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jedeoric committed May 6, 2024
1 parent a161eea commit f071502
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 17 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.2
2024.3
13 changes: 6 additions & 7 deletions docs/basic11.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ basic11 - start atmos rom

basic11 [OPTION]... ["FILE]




## DESCRIPTION

This command starts the atmos rom. This rom did not test RAM and cload/csave are done on sdcard. It means that it calls file from sdcard.
Expand All @@ -31,6 +28,12 @@ Get a tape file, and place it in the root folder of the sdcard.
-r [id_rom]
Set type of rom to load (value = 0, 1, 2)

-v
Displays version

-h
Displays help

"MYTAPE
Load MYTAPE

Expand Down Expand Up @@ -180,8 +183,6 @@ not done.
Some others games uses special keys (SHIFT, CTRL) for direction or the first button. Theses cases are not handle yet : but it
could in the future.



## Example

Starts basic11 :
Expand All @@ -202,8 +203,6 @@ A path can be specified :
/#basic11 -p /home/jede
```



In basic rom :
CLOAD "ZORGONS => it will load zorgons.tap

Expand Down
41 changes: 34 additions & 7 deletions src/commands/basic11.asm
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
.define BASIC11_DEFAULT_PATH_SET $03
.define BASIC11_END_OF_ARGS $04
.define BASIC11_SET_ROM $05
.define BASIC11_DISPLAY_VERSION $06
.define BASIC11_DISPLAY_HELP $07
.define BASIC11_OPTION_UNKNOWN $FF

.define BASIC11_NMI_VECTOR $F88F
.define BASIC11_OFFSET_ROOT_PATH $FE70
.define BASIC11_OFFSET_LENGTH_ROOT_PATH BASIC11_OFFSET_ROOT_PATH-1

.define BASIC10_OFFSET_ROOT_PATH $FCED
.define BASIC10_OFFSET_ROOT_PATH $FCEC
.define BASIC11_OFFSET_FOR_ID_OF_ROM_TO_LOAD $F2
.define BASIC11_MAX_LENGTH_DEFAULT_PATH 16 ; MAX : 32

Expand Down Expand Up @@ -112,8 +114,8 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path
ldy #$00

lda (basic11_argv1_ptr),y
cmp #'-' ; is it Dash ?
bne @is_a_tape_file_in_arg ; No we check if a .tape file is provieded
cmp #'-' ; is it Dash ?
bne @is_a_tape_file_in_arg ; No we check if a .tape file is provieded
jmp @basic11_option_management ; Yes, check options

@no_arg:
Expand Down Expand Up @@ -353,6 +355,7 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path

@basic11_option_management:
jsr basic11_manage_option_cmdline

cmp #BASIC11_START_GUI
beq @gui

Expand All @@ -362,13 +365,31 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path
cmp #BASIC11_SET_ROM
beq @set_rom

cmp #BASIC11_END_OF_ARGS
beq @start_rom
cmp #BASIC11_DISPLAY_VERSION
beq @display_version

cmp #BASIC11_DISPLAY_HELP
beq @display_help

cmp #BASIC11_DEFAULT_PATH_SET
beq @root_path

cmp #BASIC11_END_OF_ARGS
beq @start_rom
bne @option_not_known

@display_version:
print version_str
crlf
rts

@display_help:
getmainarg #0, (basic11_argv_ptr) ; Get first arg
BRK_KERNEL XWSTR0
print basic11_usage
crlf
rts

@start_list:
mfree (basic11_argv_ptr)

Expand Down Expand Up @@ -402,6 +423,9 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path
inc basic11_current_arg_id
jmp @basic11_option_management

@start_rom:
jmp @load_ROM_in_memory_and_start

@root_path:
getmainarg basic11_current_arg_id, (basic11_argv_ptr)
sta basic11_rootpath_ptr
Expand Down Expand Up @@ -436,8 +460,7 @@ basic11_rootpath_ptr := userzp + 29 ; Used to save ptr of the path
inc basic11_current_arg_id
jmp @basic11_option_management

@start_rom:
jmp @load_ROM_in_memory_and_start


@continue_l_option:
; Search now
Expand Down Expand Up @@ -947,6 +970,7 @@ basic11_driver:

@jmp_basic10_vector:
jmp $F42D

end_basic11_driver:


Expand Down Expand Up @@ -1128,6 +1152,9 @@ str_basic10_maindb:
.byte BASIC10_PATH_DB
.asciiz "basic10.db"

basic11_usage:
.asciiz " [-r rom] [-p path] [-l] [-g] [\"TAPEFILE]"

basic_str_search:
.byte "+--------+-----------------------------+"
.byte "| key | NAME |"
Expand Down
14 changes: 14 additions & 0 deletions src/commands/basic11/basic11_manage_option_cmdline.s
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
lda (basic11_argv1_ptr),y
beq @unknown_option

cmp #'v'
beq @version

cmp #'h'
beq @help

cmp #'g'
beq @gui

Expand Down Expand Up @@ -48,4 +54,12 @@
@list:
lda #BASIC11_START_LIST
rts

@version:
lda #BASIC11_DISPLAY_VERSION
rts

@help:
lda #BASIC11_DISPLAY_HELP
rts
.endproc
7 changes: 5 additions & 2 deletions src/shell.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,7 @@ str_not_found:
.byte " : No such file or directory",$0D,$0A,0

str_oom:
.byte "Out of memory",$0D,$0A,0 ; FIXME
.byte "Out of memory",$0D,$0A,0 ; FIXME

str_too_many_open_files:
.byte "Too many open files",$0D,$0A,0
Expand All @@ -1328,7 +1328,10 @@ str_max_malloc_reached:
.asciiz "Max number of malloc reached"

signature:
.asciiz "Shell v2024.2"
.byte "Shell v"
; Don't put 0 here
version_str:
.asciiz "2024.3"

shellext_found:
.byte "Shell extentions found",$0A,$0D,$00
Expand Down

0 comments on commit f071502

Please sign in to comment.