Jump to content

Photo

SpartaDOS X 4.48


268 replies to this topic

#51 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Sat Jul 30, 2016 1:54 PM

I can see that this is not documented anywhere, but NEXT actually accepts more arguments than just the counting variable name. The syntax is:

NEXT varname [atr] [filemask]

The atr and filemask are supposed to be the same as in the FOR var IN [atr] [filemask]. When these are not given, "all files" and "*.*" are assumed.

In other words, if the line starting the loop specifies attribute different than none ("all files") and/or a mask different than *.*, these must also be specified in NEXT:
 

for %d in +s *.FOO
  echo $%d
next %d +s *.FOO
I have no idea how this escaped the documentation. I will probably have to update the examples and let GoodByteXL know about it, so that this information will be reflected in next revisions of the User's Manual.

 

 

Super!  Thanks for the explanation.  I was just getting ready to make a posting saying I was suspecting the bug was somewhere in the for loop mechanism.  As it happens, it's not so much a bug as an errata for the docs.  And now that I'm aware of this, I have no problem using it in that way.

 

Just out of curiosity though, might it not make better sense to modify SDX to not require such specification in both the FOR and the NEXT, and instead just have it honor what was specified in the FOR?  Unless there can be some kind of advantage I'm not imagining, it seems unnecessarily redundant.

 

But in any case, thank you for yet another even better version of SDX.  It is one of the best contributions to the A8 community.



#52 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Sat Jul 30, 2016 6:56 PM

I can see that this is not documented anywhere, but NEXT actually accepts more arguments than just the counting variable name. The syntax is:

NEXT varname [atr] [filemask]

The atr and filemask are supposed to be the same as in the FOR var IN [atr] [filemask]. When these are not given, "all files" and "*.*" are assumed.

In other words, if the line starting the loop specifies attribute different than none ("all files") and/or a mask different than *.*, these must also be specified in NEXT:
 

for %d in +s *.FOO
  echo $%d
next %d +s *.FOO
I have no idea how this escaped the documentation. I will probably have to update the examples and let GoodByteXL know about it, so that this information will be reflected in next revisions of the User's Manual.

 

 

That code still fails if there are no .FOO files in the directory at all.  For the time being I will work around it in my program, as doing so won't be too difficult.



#53 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Sat Jul 30, 2016 8:11 PM

Okay... here is the batch file which will get the job done of recursively expanding all arcs into folders.  Remember to be in the directory (current working directory) that you want processing to begin in.  As the operator, you will have to manage free space considerations.  For example, if you are using the SDX Toolkit disk on drive A: as a source of ARCs, there may not be enough free space on it to convert in place.  You would need to all the stuff from A: to a place with more free space.  On the up side though, the ARCs themselves are deleted as they are each successfully expanded.  That means the free space requirements might not be so taxing.  Unfortunately though, the 4.48 Toolkit disk does not have enough free space and so it must 1st be copied elsewhere 1st.

 

I do realize that as is, this batch program will not be very useful to those without some kind of large storage like, HDD, APE, or at least a very large RAMdisk.  That being said, I imagine a lot of the people using SDX these days tend to be power users who are likely to have larger storage options.  But for those who don't, and for the rest of us who do but would rather not be bothered with copying 1st; I plan to update this program in the near future to allow you to specify a source which is in one place (like a floppy drive), and target which is somewhere else (perhaps another floppy which is larger).

 

Let me know what you think and if it works for you.  I tested it... but... there is always room for Murphy.

; RUNPACK.BAT
; Recursive (.ARC) Unpack by FujiDude 2016-07-30

proc bunpack
; %sfd is used as "safe for deletion" flag.

  if exists -s *.arc
    for %a in -s *.arc /n
      set %sfd=yes
      echo .
      echo Processing $%a$.ARC...
      seterrno 0
      md $%a$
      if error
        set %sfd=no
      else
        seterrno 0
        arc e $%a$.arc $%a$>
        if error
          set %sfd=no
        fi
      fi
      if %sfd=="yes"
        delete $%a$.arc
      else
        echo There was a problem unpacking.
        echo $%a$.ARC not deleted.
      fi
    next %a -s *.arc
  fi
  sortdir . >>nul:
return


proc walkdir
  gosub bunpack
  if exists +s *.*
    for %d in +s *.*
      cd $%d
      gosub walkdir
      cd <
    next %d +s *.*
  fi
return


load command.com
seterrno 0
echo Recursive (.ARC) Unpack (2016) Fujidude.
echo Stand-by...
gosub walkdir
echo Recursive (.ARC) Unpack completed.
load


Edited by fujidude, Sat Jul 30, 2016 8:15 PM.


#54 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Sat Jul 30, 2016 8:17 PM

By the way, the real little gem in that batch script, the "walkdir" procedure.  In this case it is used to call a ARC unpacker recursively down a tree branch, but could be used to perform other actions instead too.  Use your imagination.



#55 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Sun Jul 31, 2016 2:52 AM

That code still fails if there are no .FOO files in the directory at all.


Obviously, because, as I wrote before, this problem is unrelated to NEXT: it is a problem with FOR not handling EOF correctly.

Nice batch-script. Do you mind if we put it onto the Toolkit?

#56 576XE ONLINE  

576XE

    Dragonstomper

  • 753 posts
  • Location:Moscow, Russia

Posted Sun Jul 31, 2016 3:25 AM

Many thanks to All DLT!

 

Supercart and IDEPlus 2.0 bioses works for me. :)

 

Ingeniously! :thumbsup:



#57 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Sun Jul 31, 2016 5:11 AM

Many thanks to All DLT!


People directly involved in this release are: GoodByteXL, mono, trub and yours truly. Mono is a member of the Tristesse group, all the rest - DLT.

@fuijdude: your script works great, I am impressed. It should be added that it requires ENV.SYS to be loaded, because otherwise the environment space will get completely filled up and an error will occur.

#58 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Sun Jul 31, 2016 9:18 AM

Thanks for the kind words about the script.  That makes my day.  Of course it can be included; I would be honored.  I should mention though that I'm attempting to improve it yet a little more.  Anything I come up with I will post here.



#59 pirx OFFLINE  

pirx

    Moonsweeper

  • 372 posts
  • Location:Poland

Posted Sun Jul 31, 2016 1:05 PM

oh man, would never guess the sdx batch lingo is so powerful



#60 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Mon Aug 1, 2016 5:19 AM

The supercart build and Antonia upgrade:  Now I just get a scrambled video and nothing boots.
Also Side ! (use to work) with Antonia Upgrade now reacts the same as the Supercart no boot and scrambled video.


It may be a bug in the SDX after all. Please enable the "linear" RAM in Antonia and drop an info, if it helped.

#61 rdea6 OFFLINE  

rdea6

    River Patroller

  • 2,564 posts
  • Location:Arizona USA

Posted Mon Aug 1, 2016 8:07 AM

With Linear ON it will truly boot to DOS but it hangs while trying to load the side.sys driver for CF access. 

With nothing loaded to SIO D1: I get a full boot with Side(1) and also CF access.

The MyIDE original version 3.1 and the super cart will boot to the CF card with the MyIDE.sys driver.

 

MyIDE ][ works ok with the MyIDE 512 rom and the MyIDE CF cartridge comes up and is read with the Myide2.sys driver.

 

And if I stack the Side (1) on the Super Cart and turn off SDX on the Super Cart it will boot and the side.sys driver loads to the CF card giving full access.  XVER claims SIDE with out passthrough..

 

Side 2 still defaults to basic prompt or Self Test.


Edited by rdea6, Mon Aug 1, 2016 8:45 AM.


#62 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Mon Aug 1, 2016 10:51 AM

Alright, I have updated the RUNPACK.BAT to allow specifying a different source directory.  So let's say your current working directory is C:\TOOLKIT and you want to bring everything in from the Toolkit disk (inserted in drive A:).  You would do it like this:

-RUNPACK A:\

That also assumes you have RUNPACK.BAT located in directory included in your PATH environment.  Here is the source.  I will also attach an .ATR with it for convenience.

; RUNPACK.BAT
; Recursive (.ARC) Unpack by FujiDude 2016-08-01
; This script requires the use of ENV.SYS.

; RUNPACK.BAT extracts files from .ARC files into a folder with the same name
; (without .ARC), and then deletes the original .ARC file if no errors.  It
; will also recurse through subdirectories performing the same actions in
; each directory, on any .ARC files that exist.

; Pass source path on the command line if different than current directory.
; Otherwise contents of currnet directory will be processed in-place.

proc bunpack
; %sfd is used as "safe for deletion" flag.

  if exists -s *.arc
    for %a in -s *.arc /n
      set %sfd=yes
      echo .
      echo Processing $%a$.ARC...
      seterrno 0
      md $%a$
      if error
        set %sfd=no
      else
        arc e $%a$.arc $%a$>
        if error
          set %sfd=no
        fi
      fi
      if %sfd=="yes"
        echo Deleting $%a$.ARC
        delete $%a$.arc
      else
        echo There was a problem unpacking.
        echo $%a$.ARC not deleted.
      fi
    next %a -s *.arc
  fi
  sortdir . >>nul:
return


proc walkdir
  gosub bunpack
  if exists +s *.*
    for %d in +s *.*
      cd $%d
      gosub walkdir
      cd <
    next %d +s *.*
  fi
return


load command.com
seterrno 0
echo Recursive (.ARC) Unpack (2016) Fujidude.
echo Stand-by...
if _11
  echo Copying files from $_11$...
  copy /r %1
  if error
    exit
  fi
fi
gosub walkdir
echo .
echo Recursive (.ARC) Unpack completed.
load

Attached File  RUNPACK.ATR   90.02KB   40 downloads



#63 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Wed Aug 3, 2016 1:38 AM

Works great, thank you :)

#64 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Wed Aug 3, 2016 4:02 AM

Since it turns out that the SDX development suffers from insufficient testing (which, I guess, is a result of insufficient manpower), it is perhaps time to change the hitherto practice of passing the beta versions only to few people.

So, I have setup a subdirectory on the SDX website where current betas will be stored. It is ROM files only, anyone who wants to try them out, will have to create a flashing disk: it is not complicated, just get the 4.48 flashing ATR for the appropriate build and replace the ROM file.

Here is the link:

http://sdx.atari8.in...urrent/449a.zip

The list of changes is as always in the whatsnew*.txt file.

#65 JoSch OFFLINE  

JoSch

    Moonsweeper

  • 424 posts
  • Location:Germany

Posted Wed Aug 3, 2016 4:58 AM

Great news.



#66 Stephen OFFLINE  

Stephen

    Quadrunner

  • 6,457 posts
  • A8 Gear Head
  • Location:No longer in Crakron, Ohio

Posted Wed Aug 3, 2016 8:45 AM

Awesome!



#67 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Wed Aug 3, 2016 9:38 AM

I'm guessing the new model will work out well.  Phaeron and FJC have been doing it that way with a very similar set of users now for some time and it seems to work.



#68 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Wed Aug 3, 2016 6:55 PM

From the 4.49a notes:

 

  2) during interpretation of a BAT file the "ECHO ON" command was
  ignored.

 

Strange, while I was just developing the unpacker script, I'm pretty sure I made use of the ECHO ON inside the batch to aid in troubleshooting the code.  I suppose it's possible I had also entered the command on the CL too, and assumed it was the one in the batch making it happen.



#69 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Wed Aug 3, 2016 7:11 PM

Feature suggestion:

 

The PROMPT can utilize some variables for things like device letter(s), and path of the current working directory.  It would be fantastic if such information could be made available to the batch language.  I wish I could remember an example of code that required it, but I can't think of right now.  Yes, one can simply code things so that the assumed cwd etc. is used, but I'm sure there was something I had thought of that needed it.

 

Oh well, I suppose the least I could do is offer an example of why it would even be useful before asking anyone to put effort into it.  I'll revisit this if and when I think of something. :)



#70 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,646 posts
  • Location:United Kingdom

Posted Thu Aug 4, 2016 1:38 AM

One observation regarding the user manual is that it would be convenient if the table of contents entries were hyperlinks to the corresponding page. Quite a few PDFs work this way and it eases navigation through large documents.

#71 JoSch OFFLINE  

JoSch

    Moonsweeper

  • 424 posts
  • Location:Germany

Posted Thu Aug 4, 2016 1:46 AM

One observation regarding the user manual is that it would be convenient if the table of contents entries were hyperlinks to the corresponding page. Quite a few PDFs work this way and it eases navigation through large documents.

That would be especially useful, because most of the time the PDF page number  is not the same as the document page number. The consequence is that the page number in the TOC is not sufficient to go the correct PDF page.



#72 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Thu Aug 4, 2016 3:39 AM

User's Guide: I guess that Walter did so to avoid ugly look of the TOC in print. When you open the PDF in a standalone PDF reader (and not just in the web browser), a list of bookmarks should open on the left, which is a clickable version of TOC.

@fuijdude: strictly speaking the ECHO ON was not ignored, it was just not effective, because the code taking care of echoing the commands being executed was simply missing from the relevant SC module :)

Apart from that the same module had yet two problems, which I believe I have already fixed. For convenience, I have split the 449a.zip archive contents into three parts: a) the SDX 4.49a beta ROMs (which are not changed), b) the toolkit-beta ATR (which has been updated a minute ago), and c) the relevant whatsnew file.

Link: http://sdx.atari8.in...ownload_special (at the bottom of the page).

As to whether or not the new model will be more efficient than the old one, hope so, but we will see.

Edited by drac030, Thu Aug 4, 2016 3:52 AM.


#73 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,646 posts
  • Location:United Kingdom

Posted Thu Aug 4, 2016 4:19 AM

User's Guide: I guess that Walter did so to avoid ugly look of the TOC in print. When you open the PDF in a standalone PDF reader (and not just in the web browser), a list of bookmarks should open on the left, which is a clickable version of TOC.


I'd forgotten about the link pane in stand-alone PDF readers, but nevertheless there's really no need for clickable links to be ugly. See Phaeron's Hardware Reference Manual, Ultimate 1MB Alt BIOS Manual, etc, for clickable TOC links which do not look like URLs. Thankfully the fact most browsers are now able to read PDFs removes the need to install bloatware such as Adobe Reader. :)

Edited by flashjazzcat, Thu Aug 4, 2016 4:23 AM.


#74 drac030 OFFLINE  

drac030

    Stargunner

  • Topic Starter
  • 1,820 posts
  • Location:Warszawa, Poland

Posted Thu Aug 4, 2016 5:26 AM

I hope that Walter will take these suggestions into account.

@fujidude: I overlooked the PROMPT-related question, sorry. Well, yes, a practical example would be most useful :)

Edited by drac030, Thu Aug 4, 2016 5:26 AM.


#75 fujidude OFFLINE  

fujidude

    River Patroller

  • 4,685 posts
  • Location:United States of America

Posted Thu Aug 4, 2016 11:49 AM

I'd forgotten about the link pane in stand-alone PDF readers, but nevertheless there's really no need for clickable links to be ugly. See Phaeron's Hardware Reference Manual, Ultimate 1MB Alt BIOS Manual, etc, for clickable TOC links which do not look like URLs. Thankfully the fact most browsers are now able to read PDFs removes the need to install bloatware such as Adobe Reader. :)

 

If anyone wants some tips on how to do this pretty easily, just raise your hand.  I already know a pretty easy to use way to do this with MS Word 2010 (likely other versions too but I can't vouch).  The method I use results in the side bookmarks as well as clickable TOC entries.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users