forum.defence-force.org

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

Tap2DSK: Missing INIST and DiskName options
Details: Fabrice's version has two options, -i and -n, that can be used to set the INIST startup string and the name of the disk. The version of the OSDK does not have these options.The issue is actually that MAKE.BAT does not pass the parameters: Replacing the call to Tap2DSk by '%OSDK%\bin ap2dsk.exe -n%OSDKDNAME% -i%OSDKINIST% %OSDKDISK% build\%OSDKNAME%.tap build\%OSDKNAME%.dsk' fixes the issue.

Issue #10: Reported by Dbug the Tue 14th July 2015

FloppyBuilder: Add command to reserve space in description file
Details: It would be nice to be able to reserve a certain number of sectors without having to add a file. That would be particularly useful to reserve space for saving data in a game for example.

Actually it works and it's clear why it does, but .... it's bug and must be Dbug'ged .

- in script file 'AddFile loader $XXXX' - specifying load address for loader is useless now,
because the real value is #define'd in disk_info.h as 'location_loader'. I had the idea to remove
this #define from disk_info.h, and put it in generated 'floppy_description.h', but this will not work
because 'location_loader' must be defined before#include "floppy_description.h"
Generating one more 'floppy_locations.h' file which contains only: #define location_loader $XXXX
will solve the problem.

- make ZP usage movable to not conflict with C compiler - actually it can be 'AddDefine location_zp $XX' value which is written to same generated 'floppy_locations.h' file (because of the same reason as above).

- make disk_buffer movable (i.e. not fixed at $200) - the same as ZP.

And some 'nice to have' things are:
- make 'switch to hires' to depend on 'AddDefine' value - this will allow easy to select hires or text during boot.
- make possible to declare 'AddDefine' before 'AddFile' - just for better script readability.
- add command line option to FloppyBuilder tool: -DOPTION=VALUE to overload 'AddDefine'.

Additionally:
I succeeded with 'writing to pre-allocated space'. I didn't used the code from 'disk.s' - it helped me only to find bug in my witting code, which looks just like the 'reading' code. In regard of writing I found very handy to make pre-allocating with simple: 'AddFile dummy_file.bin $XXXX', where 'dummy_file.bin' is an empty file with desired size, than I can access this space for writing exactly as for reading - with the 'FileIndex'. The limitations are clear: fixed file size, the whole file is read/written at once and only uncompressed data - but this is totally OK for 'high-score' or 'save-game' usage
So, 'ReserveSectors' seems to me bit useless now, but may be just because I don't know how to use it.

Jasmin booting works now too - it was bit tricky.

I extended the Loader API, here is my 'loader_api.h' - all functions are self explained and working:

Regarding ReserveSectors, all it does is to let you write somewhere that some sectors should be skipped and you get the track/sector/length somewhere in the list of data.
It's basically the same thing as providing a placeholder file, except you don't have to provide a file. Nothing more

I extended the Loader API, here is my 'loader_api.h' - all functions are self explained and working:

Hmm, not sure about "self explained" because I have no idea what LoadIndOnand LoadIndOffare supposed to do

- in script file 'AddFile loader $XXXX' - specifying load address for loader is useless now,
because the real value is #define'd in disk_info.h as 'location_loader'. I had the idea to remove
this #define from disk_info.h, and put it in generated 'floppy_description.h', but this will not work
because 'location_loader' must be defined before #include "floppy_description.h"
Generating one more 'floppy_locations.h' file which contains only: #define location_loader $XXXX
will solve the problem.

Indeed the idea is to specify this value in the description script, possibly should have a dedicated instruction "SetLoader" that would automatically generate the values for the loader track, sector and load address in the generated header file.

Regarding the order, I've not checked the code, so just thinking out loud.

Making the zp and sector buffer defined in the description file seem like a good idea as well.
I guess by default it could use $50 and $200 by default.

For the rest, would be nice if you could send me the changes you made, including your loader, loader api, etc...

So, I started updating Oric Tech with the changes we have discussed, the full changes will be done step by step so everybody can agree on them, I'm not going to add the new include files or anything like that right now, so all the changes are compatible with the existing OSDK and set of files.

Here is what I have at the moment:

Added the missing defines to disc_infos.h

disk_info.h wrote:
#define loader_zp_start $80 ; Location of the first zero page address used during the loading
#define loader_sector_buffer $200 ; Location of the 256 bytes buffer used to load the sectors

When the FloppyBuilder will be able to parse the symbol files, the LoadFileAt instruction will basically become more or less unnecessary because you will be able to specify directly a label in the description file.

I now see why my loading code did not work on Jasmin, forgot to change the FDC commands :p

So, regarding your changes, imo there's a number of things we could do.

1) Since the Jasmin and Microdisc boot sectors are now in charge of setting the values to use, there's no real reason for keeping the #ifdef MICRODISC_LOADER and #ifdef JASMIN_LOADER sections in the disk_info.h, they should just go in their respective files.

2) For generic purposes it's important to keep the loader api as small as possible, I will think about it, but I have some ideas on how to get something generic that the user can implement if they want a display while loading

3) Still for practicality, if we have some room remaining in the boot sectors, we should probably have the init_via_defaults moved into the boot sectors instead of having stay in the loader file.

The rest of your changes mostly make sense, one note regarding size optimization, when you have a jsr followed by a rts, jump put a jmp instead

I'm glad that my modifications are accepted.
jsr+rts=jmp - of course that's clear . but I was so happy that writing worked and simply forgot for code cleanup and optimization. btw, maybe to leave such thing the reason is that I removed some sei/cli pairs. I know that these sei/cli were in the code to allow (for instance) music playback during disk operations, but without them was easy to me to solve Jasmin booting problems.

Just one small note. I guess you want to target the Telestrat too. Are you aware the there is a bug in that machine which makes the normal Microdisc code fail? It was discovered by Fabrice when he helped me with the routines in 1337 (in Space1999 and Pinforic we used the code in page 4). This bug does not happen in the emulators.

He wrote an article in CEO mag about it, but the result was that accesses to FDD registers should be done with code alligned at a specific address, depending on the page3 address of he register.

Chema wrote:He wrote an article in CEO mag about it, but the result was that accesses to FDD registers should be done with code alligned at a specific address, depending on the page3 address of he register.

If anyone can point me to the original article, I will take that into consideration.
Of course want to support as many machines as possible, and that's the whole point of trying to get the FloppyBuilder/loader system to work for everybody: If we fix a bug or add a feature, it's just a matter of rebuilding the project with the new version.

Chema wrote:Sorry, I can't remember the number, but the posts about this in the 1337 forum (including some explanations) is here:http://forum.defence-force.org/viewtopi ... &start=420
And simply adding those assembler directives did the trick and the code worked not in a telestrat and normal Orics with Microdisc.

Ok, I see, that's going to increase the size of the code even more
Damn it :p

I've been thinking a bit more about the loader code, technically it's totally possible to make it in two parts: One part that can be overwritten, which can be used for the setup, initialization of VIA, clearing the screen, etc... followed by the rest of the code that remains in memory.

That would of course make sense only if the loader is kept in highmemory.