MB02+ software and system developments

13

Comments

  • edited April 2008
    glancaster wrote: »
    Glad you like it :)



    I think that you can do what you want already, without requiring any additional ResiDOS commands. LOAD %"filename" CODE addr, len command will load any file from a FAT16 disk, even if it is not a ResiDOS file. So you can use this to load the file into memory, then switch to BS-DOS and save it from there.

    For the other direction, SAVE %"filename" CODE addr, len can be used. This will add a +3DOS header to the file, but this can easily be stripped away with a tool on the PC if required (eg John Elliott's taptools at http://www.seasip.demon.co.uk/ZX/unix.html). I could also add commands to add/remove +3DOS headers to ResiDOS, as I have been meaning to do this for a while.

    Yes Garry, I saw the command in the manual, but what if I have a long TAP file for example, and want to transfer it FAT16<->BSDOS, then I have to load it part by part. Eg. I have a TAP file long 100kB, than I have to load and save (ie. also switch BSDOS<->RESIDOS is three times). But, I think, this command will not allow to do that. Am I right?

    Hood
  • edited April 2008
    glancaster wrote: »
    ResiDOS uses "%" for commands, but it is optional. It is usually useful to use it so that you can get out of "K" mode. If you use an alternative BASIC, such as Gosh Wonderful or SE BASIC, which doesn't use keywords, then you can just type "cp" etc without any need for a "%".

    The "." only works because ResiDOS treats it as an abbreviation character. For example, if you type "%p." then ResiDOS will expand this to "%partitions". So, in your case, ResiDOS treated "cp ." as an abbreviation of "cp" ;-)


    I just meant exchange of "%" for "." in the beginning of a command. "CP 37" was an instruction I found in the installation file.

    So a question, how can I change the initial "%" before a command for "." instead, please?

    Thanks

    Hood
  • edited April 2008
    Hood wrote: »
    Yes Garry, I saw the command in the manual, but what if I have a long TAP file for example, and want to transfer it FAT16<->BSDOS, then I have to load it part by part. Eg. I have a TAP file long 100kB, than I have to load and save (ie. also switch BSDOS<->RESIDOS is three times). But, I think, this command will not allow to do that. Am I right?

    Ah yes, you are correct in this case.

    It may be best to write a small program to do this. I'll write one for you, and this will also give you an example of how to use the ResiDOS & +3DOS APIs.
  • edited April 2008
    Hood wrote: »
    I just meant exchange of "%" for "." in the beginning of a command. "CP 37" was an instruction I found in the installation file.

    So a question, how can I change the initial "%" before a command for "." instead, please?

    The short answer is that you can't, because "." is reserved for abbreviations.
  • edited April 2008
    glancaster wrote: »
    Ah yes, you are correct in this case.

    It may be best to write a small program to do this. I'll write one for you, and this will also give you an example of how to use the ResiDOS & +3DOS APIs.

    Fabulous. Thanks very much. If you are programming it, please also design it in the opposite direction, ie. writing from ZX conventional RAM into FAT16 file (TAP. or BIN maybe) part by part (sector by sector)

    Hood
  • edited April 2008
    glancaster wrote: »
    The short answer is that you can't, because "." is reserved for abbreviations.

    Strange. If the instalation file was loaded on 25500, then on 50169 and 50214 you find two instructions cp "%". I just tried to replace "%" with "." and it worked. I could use "." instead of "%" in the beginning of commands and it this syntax was succesfully accepted by RESIDOS. I only do not know whether this was a reliable way and if those 2 changes I made did not influence anything.

    Hood
  • edited April 2008
    Hood wrote: »
    Strange. If the instalation file was loaded on 25500, then on 50169 and 50214 you find two instructions cp "%". I just tried to replace "%" with "." and it worked. I could use "." instead of "%" in the beginning of commands and it this syntax was succesfully accepted by RESIDOS. I only do not know whether this was a reliable way and if those 2 changes I made did not influence anything.

    Oh, I see... I have been completely misunderstanding you. I thought you were talking about the ResiDOS command "%cp" (copy file) rather than the Z80 instruction CP % (compare). It all becomes clear now :lol:

    This modification probably works as far as it goes. However, I would not recommend using it. If you do, then you will be unable to run any previously-written ResiDOS software (such as ZXZVM, the package installer, IDESpeed, Sami Vehmaa's games and utilities, the ResiDOS installer itself for upgrades etc) without having to manually modify all the BASIC programs... Any ResiDOS software that you write would use "." instead of "%", and so would not work on any other ResiDOS systems.

    One of the key advantages of ResiDOS is that programs written for it will run without any changes on any system that supports it (MB02+, ZXCF, ZXBadaloc, divIDE Plus etc). I would strongly discourage trying to break this feature.
  • edited April 2008
    glancaster wrote: »
    Oh, I see... I have been completely misunderstanding you. I thought you were talking about the ResiDOS command "%cp" (copy file) rather than the Z80 instruction CP % (compare). It all becomes clear now :lol:

    This modification probably works as far as it goes. However, I would not recommend using it. If you do, then you will be unable to run any previously-written ResiDOS software (such as ZXZVM, the package installer, IDESpeed, Sami Vehmaa's games and utilities, the ResiDOS installer itself for upgrades etc) without having to manually modify all the BASIC programs... Any ResiDOS software that you write would use "." instead of "%", and so would not work on any other ResiDOS systems.

    One of the key advantages of ResiDOS is that programs written for it will run without any changes on any system that supports it (MB02+, ZXCF, ZXBadaloc, divIDE Plus etc). I would strongly discourage trying to break this feature.


    Oh yes Garry, I do not want to change syntax of RESIDOS, at all. I am aware of that fact of incompatibility. I would just use "." instead of "%" for only my purposes, mainly for typing form command line in BASIC. Because I am used to write"." from BSDOS and also because by typing character "." I do not have to press SS together with it. So, you mean, for this and only personal purpose should I change both CP "%"? Or just one is enough. Nothing will be corrupted? Why are ther two CP instructions?

    Of course, I strongly bear in mind when writing any programs for RESIDOS, that "%" is used and not "." I am not going to open new standart. Really, have no worries, please.

    Thanks

    Hood
  • edited April 2008
    Hood wrote: »
    Oh yes Garry, I do not want to change syntax of RESIDOS, at all. I am aware of that fact of incompatibility. I would just use "." instead of "%" for only my purposes, mainly for typing form command line in BASIC. Because I am used to write"." from BSDOS and also because by typing character "." I do not have to press SS together with it.

    Okay, I understand.
    So, you mean, for this and only personal purpose should I change both CP "%"? Or just one is enough. Nothing will be corrupted? Why are ther two CP instructions?

    The first is for commands, the second is for functions. You only need to change the first one; there is never any need to type % for functions anyway (it's just in there for completeness).
  • edited April 2008
    glancaster wrote: »
    Okay, I understand.



    The first is for commands, the second is for functions. You only need to change the first one; there is never any need to type % for functions anyway (it's just in there for completeness).

    Great info, thanks very much Garry.


    Hood
  • edited April 2008
    Just a silly question, would be possible to run +3 DSK files on "non +3" machine? It seems to me that all ResiDos enabled machines might be able to use patched +3 ROMs in order to run +3 software.

    I like later +3 versions of Level 9 games with graphics...
  • edited April 2008
    RESIDOS version for Divide+ interface work in Divide mode (paging on port 227) or in MB02 mode ?

    VELESOFT
  • edited April 2008
    omega wrote: »
    Just a silly question, would be possible to run +3 DSK files on "non +3" machine? It seems to me that all ResiDos enabled machines might be able to use patched +3 ROMs in order to run +3 software.

    I like later +3 versions of Level 9 games with graphics...

    Unfortunately, I don't think this is really feasible. Whilst it might be possible to patch the +3 ROMs so that you could run +3 BASIC successfully (probably on 128K machines only), any machine-code programs would almost certainly use the hardware ROM-switching on ports 1ffd & 7ffd, and this would have no effect on which patched ROMs were in place. So it would all fall over in a heap. :(
  • edited April 2008
    velesoft wrote: »
    RESIDOS version for Divide+ interface work in Divide mode (paging on port 227) or in MB02 mode ?

    It uses the MB02+ compatible paging mode. This is why making a version for MB02+IDE was so easy ;-)
  • edited April 2008
    velesoft wrote: »
    EASY SWAP SYSTEMS on MB02+ :

    Now is possible easy switching between original ZX ROM, BS-DOS or RESIDOS with use one OUT 23,xx command in BASIC.

    OUT 23,64 = MB02 ram - BS-DOS
    OUT 23,74 = MB02 ram - RESIDOS
    OUT 23,70 = MB02 ram - new OS (in development)
    OUT 23,0 = ORIGINAL ZX ROM

    By the way, I have just been playing around with the MB02+IDE that ingo sent to me. This easy switching is, in fact, already possible; I had forgotten that ResiDOS already has support for this type of switching (it has been used for disabling ResiDOS and allowing Interface I to run, for example).

    The correct commands are:

    OUT 23, 64 = BS-DOS
    OUT 23, 0 = ZX ROM
    OUT 23, 105 = ResiDOS

    This seems to work quite nicely!
  • edited April 2008
    glancaster wrote: »
    By the way, I have just been playing around with the MB02+IDE that ingo sent to me. This easy switching is, in fact, already possible; I had forgotten that ResiDOS already has support for this type of switching (it has been used for disabling ResiDOS and allowing Interface I to run, for example).

    The correct commands are:

    OUT 23, 64 = BS-DOS
    OUT 23, 0 = ZX ROM
    OUT 23, 105 = ResiDOS

    This seems to work quite nicely!

    No, OUT 23,105 (105= BIN 1101001) will not work correct.
    If bit D7 =1 and D6 = 1 then MB02 interface will reset ZX and port23 too. (after OUT 23,11xxxxxx is on port 23 value 10000000 = rom page 0).

    Use OUT 23,BIN 11xxxxxx can't work on all MB02 interfaces. Hardware reset function is active only if jumper S3 is connect !!! If jumper S3 is disconnect then OUT 23,11xxxxxx is same as OUT 23,00xxxxxx = MB02 memory off. My MB02 memory upgrade not use this reset feature - OUT 23,11xxxxxx disable MB02 memory.

    VELESOFT
  • edited April 2008
    velesoft wrote: »
    No, OUT 23,105 (105= BIN 1101001) will not work correct.
    If bit D7 =1 and D6 = 1 then MB02 interface will reset ZX and port23 too. (after OUT 23,11xxxxxx is on port 23 value 10000000 = rom page 0).

    It does work. This is probably because 105=BIN 01101001, so bit D7=0 :D
  • edited April 2008
    glancaster wrote: »
    It does work. This is probably because 105=BIN 01101001, so bit D7=0 :D

    Yes, this is correct. OUT 23,105 set ram page 9(residos) + write enable.
  • edited April 2008
    glancaster wrote: »
    ...any machine-code programs would almost certainly use the hardware ROM-switching on ports 1ffd & 7ffd, and this would have no effect on which patched ROMs were in place. So it would all fall over in a heap. :(

    I am have no knowledge about +3, do you need to page ROM banks manually to access standard +3 dos?
  • edited April 2008
    omega wrote: »
    I am have no knowledge about +3, do you need to page ROM banks manually to access standard +3 dos?

    Yes, before calling a +3DOS function you have to page in ROM 2 and RAM 7, and ensure that SP is below $C000. There are some examples in the (very comprehensive) +3 manual, which should be online somewhere at WOS.
  • edited April 2008
    glancaster wrote: »
    Ah yes, you are correct in this case.

    It may be best to write a small program to do this. I'll write one for you, and this will also give you an example of how to use the ResiDOS & +3DOS APIs.

    We were just thinking with Velesoft about the posibility to extend the residos for new commands. Please Garry, think about the following:

    Residos could have a command for copying between FAT16 and BSDOS. Eg:
    from residos2bsdos: %CP"filename" MB02disk, MB02directory
    from bsdos2residos: %CP MB02disk, MB02directory"filename (or number)","location(optional)"
    (the syntax could be different, of course)


    Would you be willing to do that for us, please? From MB02+ we would give you all the know-how.


    Thanks


    Hood
  • edited April 2008
    Hood wrote: »
    Definitely, I was thinking about such Task manager years ago.

    ...

    I am rather thinking of saving the tasks and managing them from/to disk rather than SRAM. Would be easier. But, first things first.

    ...

    Hood

    Hi Hood,

    you said it's an idea for future but nevertheless a short statement / question:

    Because most of users use CF cards or similar flash product:
    Might it be better to use S-RAM for task manager because flash memory does not allow infinte numer of write accesses?

    If I may ask for: Would it be possible to use S-RAM as well as disk space for task manager? So for fast switching between applications normally S-RAM is used and if there isn't enough S-RAM to store in it disk space can be (will be) used.

    Ingo.

    BTW: Respect and thanks for your intensive work on MB02+ system tools Hood, Velesoft and Glancaster! It is a long time ago that so much attention is paid to MB02+.
  • edited April 2008
    ingo wrote: »
    Hi Hood,

    you said it's an idea for future but nevertheless a short statement / question:

    Because most of users use CF cards or similar flash product:
    Might it be better to use S-RAM for task manager because flash memory does not allow infinte numer of write accesses?

    If I may ask for: Would it be possible to use S-RAM as well as disk space for task manager? So for fast switching between applications normally S-RAM is used and if there isn't enough S-RAM to store in it disk space can be (will be) used.

    Ingo.

    BTW: Respect and thanks for your intensive work on MB02+ system tools Hood, Velesoft and Glancaster! It is a long time ago that so much attention is paid to MB02+.


    Hello Ingo,

    for me, using SRAM pages looks, AT THE MOMENT harder (I am really lame coder:). And also there is not much of space left in SRAM. We have 512kB in 32 banks. Definitely, you must substract at least 4 banks at the moment (BSDOS, NMI MENU), at most you must substract 14 pages (BSDOS, RESIDOS, NMI MENU, NEW OS). So 14- 28 pages are left for tasks. We will stay with 28 pages, ie. 448kB. It is no point in supporting 48k tasks so I will support 128k snaps. It means, that finally 28 SRAM pages will hold only 3 tasks, which is very few.

    WHEREAS, AT THE MOMENT, I am thinking to store tasks on MB02+ virtual disk (so not on FAT16, but on BSDOS format). Such virtual diskette has over 2MB capacity, which means, it can contain 15 tasks. The difference in speed will not be drastic, at all.

    Thanks for support:), I am glad I am active now and can be on the scene in time of such major happenings for MB02+. I am now speeding up loading of .Z80 snaps in my nmi menu, one snap lasts 10 secs to load. The same snap takes 9secs for demfir, 6secs for fatware (both on divide+) and 3 secs in residos. i just cannot understand how is that posiible to depack 110kb of mamory so fast. Good job, Garry.

    Hood
  • edited April 2008
    Hood wrote: »
    Residos could have a command for copying between FAT16 and BSDOS. Eg:
    from residos2bsdos: %CP"filename" MB02disk, MB02directory
    from bsdos2residos: %CP MB02disk, MB02directory"filename (or number)","location(optional)"
    (the syntax could be different, of course)

    I think this would be quite a lot of work, really. I would rather continue with my original suggestion of a program to do the copy. It could be automated quite easily, since we can switch back and forth between ResiDOS & BS-DOS easily in software. So, the program would accept a filename for ResiDOS and one for BS-DOS. Then it would perform the following steps:
    1. Switch to ResiDOS and open file for reading
    2. Switch to BS-DOS and open file for writing
    3. Switch to ResiDOS and read up to 32K of file to memory
    4. Switch to BS-DOS and write memory to file
    5. Repeat last two steps until all file transferred
    6. Switch to ResiDOS and close file
    7. Switch to BS-DOS and close file

    Of course the same could be done in the opposite direction. I will get the ResiDOS side written over the next few days when I have some time, and then hand it to you for writing the BS-DOS side.

    If you're impatient, you can check the following link for ResiDOS programming details, including some example code:
    http://www.worldofspectrum.org/residos/programming.html

    For file access, all the calls used are described in the +3DOS section of the Spectrum +3 manual, online somewhere on this site.
  • edited April 2008
    Hood wrote: »
    at most you must substract 14 pages (BSDOS, RESIDOS, NMI MENU, NEW OS).

    This is correct after initial installation of ResiDOS. However, if you install anything else (ie ZX80/ZX81 emulators, TapeIO package, TaskMan, SE BASIC etc) then even more SRAM will be used by ResiDOS.

    You could avoid any clashes by calling ResiDOS's bank allocation functions to obtain free bank numbers. These are RESI_ALLOC & RESI_DEALLOC. See:
    http://www.worldofspectrum.org/residos/residos_package.html#resi_alloc
    WHEREAS, AT THE MOMENT, I am thinking to store tasks on MB02+ virtual disk (so not on FAT16, but on BSDOS format). Such virtual diskette has over 2MB capacity, which means, it can contain 15 tasks. The difference in speed will not be drastic, at all.

    Yes, there won't be much speed difference if the filesystem is efficient. The reasons I decided to use SRAM for the ResiDOS TaskMan were: (i) because I had lots of SRAM, and nothing to use it for ;-) and (ii) it's a way of transferring files/snapshots between two CF cards even if you only have a single slot.
    The same snap takes 9secs for demfir, 6secs for fatware (both on divide+) and 3 secs in residos.

    I didn't know this - thanks for pointing it out! :)
  • edited April 2008
    glancaster wrote: »
    I think this would be quite a lot of work, really. I would rather continue with my original suggestion of a program to do the copy. It could be automated quite easily, since we can switch back and forth between ResiDOS & BS-DOS easily in software. So, the program would accept a filename for ResiDOS and one for BS-DOS. Then it would perform the following steps:
    1. Switch to ResiDOS and open file for reading
    2. Switch to BS-DOS and open file for writing
    3. Switch to ResiDOS and read up to 32K of file to memory
    4. Switch to BS-DOS and write memory to file
    5. Repeat last two steps until all file transferred
    6. Switch to ResiDOS and close file
    7. Switch to BS-DOS and close file

    Of course the same could be done in the opposite direction. I will get the ResiDOS side written over the next few days when I have some time, and then hand it to you for writing the BS-DOS side.

    If you're impatient, you can check the following link for ResiDOS programming details, including some example code:
    http://www.worldofspectrum.org/residos/programming.html

    For file access, all the calls used are described in the +3DOS section of the Spectrum +3 manual, online somewhere on this site.


    I understand, it would be a lot of work to do a new such command.

    I think your proposal is from my point of view acceptable, simple and straightforward and sounds very good. Looking forward to that programme, already:)

    Best regards and thanks

    Hood
  • edited April 2008
    glancaster wrote: »


    I didn't know this - thanks for pointing it out! :)

    Oh yes Garry, it is the ADDAMS.Z80, 110kB long .Z80 snap. 3secs, really amazing. I must look into your code for the secret;)

    Hood
  • edited April 2008
    Hood wrote: »
    Residos could have a command for copying between FAT16 and BSDOS. Eg:

    ...

    Hood

    One question:

    Discobolos can easily read/write from/to MS-DOS (FAT12) disks and copy from/to BS-DOS drives including CF card.

    Might it not be possible to expand Discobolos in this direction?

    Drive 9 is still unused on BS-DOS system I think because it is impossible (and not usefull) to use RAMdrive beside IDE drives.

    I don't know if it very complicated to include access to FAT IDE into Discobolos via virtual FAT drive 9 ???


    Ingo.
  • edited April 2008
    ingo wrote: »
    One question:

    Discobolos can easily read/write from/to MS-DOS (FAT12) disks and copy from/to BS-DOS drives including CF card.

    Might it not be possible to expand Discobolos in this direction?

    Drive 9 is still unused on BS-DOS system I think because it is impossible (and not usefull) to use RAMdrive beside IDE drives.

    I don't know if it very complicated to include access to FAT IDE into Discobolos via virtual FAT drive 9 ???


    Ingo.

    I am not the author of Discobolos, but I have made some slight improvements in it. I think, if there should be a native commander for BSDOS than can work with FAT16/32, it will be MB Commander, not Discobolos. Discobolos is older and have less functions. Shrek is the author of MBC. If he will be expanding it, hard to say, now...

    Hood
  • edited April 2008
    I noted a hot (?) discussion on www.1-2-8.net (unfortunately don't understand it although I tried it using a dictionary).
    Does it make sense to ask Shrek there in english???

    Ingo.
Sign In or Register to comment.