MSX-DOS2 working?

Post Reply
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

MSX-DOS2 working?

Post by DarkSchneider »

Hi, I'd like to ask for 2 features:

- Sub-dir access: if fopen i.e. "dir/file.ext" will work?

- Set program start address: instead always at $100, be able to do the same than with LINK-80 linker:
/P and /D allow the origin(s) to be set for the next
program loaded. /P and /D take effect when seen (not
deferred), and they have no effect on programs already
loaded. The form is /P:<address> or /D:<address>, where
<address> is the desired origin in the current typeout
radix. (Default radix is hex. /O sets radix to octal; /H
to hex.) LINK-80 dos a default /P:<link origin>+3 (i.e.,
103H for CP/M and 4003H for ISIS) to leave room for the
jump to the start address. NOTE: Do not use /P or /D to
load programs or data into the locations of the loader's
jump to the start address (100H to 102H for CP/M) unless
it is to load the start of the program there. If
programs or data are loaded into these locations, the
jump will not be generated.

If no /D is given, data areas are loaded before program
areas for each module. If a /D is given, all Data and
Common areas are loaded starting at the data origin and
the program area at the program origin. Example:

*/P:200,FOO
Data 200 300
*/R
*/P:200 /D:400,FOO
Data 400 480
Program 200 280
As summary, if we use /P:4000 the program is loaded at $4000 instead $100.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

The second request should already be possible with -pragma-define:CRT_ORG_CODE=0x4000

Opening files in directories will require work - we use the CP|/M BDOS interface for file handling and the filename is copied into an FCB so with a path the filename would overflow. Have you got a pointer to the MSXDOS2 documentation?
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

Post by DarkSchneider »

dom wrote:The second request should already be possible with -pragma-define:CRT_ORG_CODE=0x4000
Nice!, thanks.

About the MSXDOS2, maybe this could help:
http://map.grauw.nl/resources/
At "DOS2 documentation". Not sure if includes the required stuff.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

That's a perfect link and a nice API to work with as well.

I'll find some ROMs and add some support when I get a chance - it shouldn't take too long to add.
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

Post by DarkSchneider »

Thank you very much for the support.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I've added -subtype=msxdos2 to the +msx target. This will use the MSXDOS2 api to open/write etc files. The library should be available in the 20190301 nightly build.

I've made some basic tests and open/read/write look like things are working correctly - if you have any problems let me know and I'll fix them!
DarkSchneider
Member
Posts: 71
Joined: Sun Apr 01, 2018 4:02 pm

Post by DarkSchneider »

Nice, thanks.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

brilliant, thank you!
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Post by Timmy »

So what does it do? What is special about this than just for MSX1 or ROMs?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

MSXDOS2 added support for sub-directories, so this work was just adding a library that used the API calls rather than the regular FCB entry points that work for CP/M and MSXDOS1.

There's no further extra support for the MSX2 at this point in time, I've not got enough machine knowledge to add appropriate, usable APIs so I'd prefer to incorporate a proven 3rd party library.
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Post by Timmy »

Ok, thanks.
Post Reply