Skip to content

Commit

Permalink
SBTVDI: fix Crash if no argument is given to 'list' command. SBTCVM B…
Browse files Browse the repository at this point in the history
…ench: Clean up formatting of source code a bit.
  • Loading branch information
ThomasTheSpaceFox committed Feb 21, 2021
1 parent 60d50ad commit f8d50cb
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 66 deletions.
20 changes: 11 additions & 9 deletions apps/bench/bench/boot.stnp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ gsub common.print_version
prline bootup...
prline Starting desktop.app...
gamode @30
val @-121
set pl.posx
set pl.posy
val @3
set pl.pixy
asm setreg1;>image1
set pl.offset
gsub pl.decode
drawcopy @13

#draw wallpaper
val @-121
set pl.posx
set pl.posy
val @3
set pl.pixy
asm setreg1;>image1
set pl.offset
gsub pl.decode
drawcopy @13

vdi rstld -1 desktop.app
gamode @0
Expand Down
92 changes: 45 additions & 47 deletions apps/bench/bench/desktop2.stnp
Original file line number Diff line number Diff line change
Expand Up @@ -68,66 +68,64 @@ goto main


label info
prline Starting info.app...
gsub backup_self
vdi rstld -1 info.app
prline ERROR! info.app not found!
prline Starting info.app...
gsub backup_self
vdi rstld -1 info.app
prline ERROR! info.app not found!
return

label dos
prline Starting dos.app...
gsub backup_self
vdi rstld -1 dos.app
prline ERROR! dos.app not found!
prline Starting dos.app...
gsub backup_self
vdi rstld -1 dos.app
prline ERROR! dos.app not found!
return

label credits
prline Starting credits.app...
gsub backup_self
vdi rstld -1 credits.app
prline ERROR! credits.app not found!
prline Starting credits.app...
gsub backup_self
vdi rstld -1 credits.app
prline ERROR! credits.app not found!
return


label backup_self
vdi membak 2 desktop.back.tri
vdi membak 2 desktop.back.tri
return

label draw_desktop



gsub ui.base_draw

val @3
set pl.pixx
set pl.pixy

val @-120
set pl.posx
set pl.posy

#vertical spacing: start+(3*9)+5

#info
val @-90
set pl.posy
asm setreg1;>ICON_info
set pl.offset
gsub pl.decode

#dos
val @-58
set pl.posy
asm setreg1;>ICON_dos
set pl.offset
gsub pl.decode

val @-26
set pl.posy
asm setreg1;>ICON_credits
set pl.offset
gsub pl.decode
gsub ui.base_draw

val @3
set pl.pixx
set pl.pixy

val @-120
set pl.posx
set pl.posy

#vertical spacing: start+(3*9)+5

#info
val @-90
set pl.posy
asm setreg1;>ICON_info
set pl.offset
gsub pl.decode

#dos
val @-58
set pl.posy
asm setreg1;>ICON_dos
set pl.offset
gsub pl.decode

#credits
val @-26
set pl.posy
asm setreg1;>ICON_credits
set pl.offset
gsub pl.decode
return


Expand Down
1 change: 1 addition & 0 deletions apps/bench/bench/info.stnp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ prline Starting desktop.app...
vdi rstld 2 desktop.back.tri
prline ERROR! desktop.app not found!
stop

include plrle_noalpha as pl
include bench/lib/common as common
include bench/lib/ui as ui
Expand Down
21 changes: 11 additions & 10 deletions vmsystem/SBTVDI_IO_G2x_9.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,17 @@ def cmdparse(self, cmdstr):
if not len(cmdlist_as)>=2:
self.outstr("ERROR: specify 'list [diskid] (optional pattern)'!\n")
self.status=-2
try:
if len(cmdlist_as)==2:
if int(cmdlist_as[1]) in self.disks or int(cmdlist_as[1]) == -1:
self.filelist(int(cmdlist_as[1]), None)
else:
if int(cmdlist_as[1]) in self.disks or int(cmdlist_as[1]) == -1:
self.filelist(int(cmdlist_as[1]), cmdlist_as[2])
except ValueError:
self.outstr("ERROR: Invalid Integer in disk id! '" + cmdlist_as[1] + "'\n")
self.status=-1
else:
try:
if len(cmdlist_as)==2:
if int(cmdlist_as[1]) in self.disks or int(cmdlist_as[1]) == -1:
self.filelist(int(cmdlist_as[1]), None)
else:
if int(cmdlist_as[1]) in self.disks or int(cmdlist_as[1]) == -1:
self.filelist(int(cmdlist_as[1]), cmdlist_as[2])
except ValueError:
self.outstr("ERROR: Invalid Integer in disk id! '" + cmdlist_as[1] + "'\n")
self.status=-1


else:
Expand Down

0 comments on commit f8d50cb

Please sign in to comment.