Page 1 of 1

OSDK 1.9

Posted: Sun Mar 19, 2017 12:16 pm
by Dbug
The version 1.9 of the OSDK is now available, with the following changes:

- Upgraded XA to the version 2.2.4 (Extended the values for a number of hardcoded defines (labels, blocks, number of open files, etc...))
- Upgraded Linker to the version 0.65 (Fixed some issues in the token pattern matching used to detect labels resulting in #includes containing relative paths to be incorrectly parsed)
- Upgraded FloppyBuilder to version 1.1 (New format, new commands, sector interleaving, ...)
- Upgraded PictConv to the version 0.24 (Fixed a problem in the color reduction code failing on a 32bit source image)
- 6502 syntax coloring for Notepad++, by Jede

As usual, the OSDK is available on the download page at
http://www.osdk.org/index.php?page=download

Regarding the Linker changes, they were done to accommodate Jede's work on the Telestrat stuff. The assembler fixes were for Chema.
The FloppyBuilder changes are more of the continuation of the work in progress that I had laying around for a while. The samples have been updated to reflect the changes.

As usual, please report any issue, changing things like the Linker or build script tend to have side effects for people who used different projects setups :)

Re: OSDK 1.9

Posted: Sun Mar 19, 2017 6:00 pm
by Chema
Great! Thanks Dbug!

I'll have a kook at it as soon as possible. I see it includes a coloring file for Notepad++ I already have one for me, but I will see how this one looks like :mrgreen:

BTW The link doesn't ent work :?:

Re: OSDK 1.9

Posted: Sun Mar 19, 2017 7:10 pm
by Dbug
I fixed the link.

Basically the problem is that I did not reenable the automatic finding of "php" files when they don't have the extension php...

Re: OSDK 1.9

Posted: Sun Mar 19, 2017 8:29 pm
by iss
Thanks for the update.
I rebuilt my Linux OSDK and everything seams to work fine. I'll check in detail the new FloppyBuilder asap.
Recently I collected some ideas for improvements in:
- PictConv - when used in char generator mode, to be able get more input files (sprites with different sizes), split them in 6x8 tiles and generate char definitions for all unique tiles (i.e. all repeated tiles will have only one definition). For my own purpose I solved this with a post-processing lua script but I think it's worth to have this option build-in.
- Ym2Mym - to add possibility for simple "in-music" commands like "jump to_xxxx-th_vbl_frame" and "loop 3_times_next_xxxx_vbl_frames". Additionally having such "commands" can help for reducing the size of the YM data ... I'm working already on this ;).

Re: OSDK 1.9

Posted: Mon Mar 20, 2017 8:48 pm
by coco.oric
Wonderful

The best tool to create dsk files has been upgraded.
Thanks for the complex floppybuilder

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 8:27 am
by Dbug
iss wrote:
Sun Mar 19, 2017 8:29 pm
- PictConv - when used in char generator mode, to be able get more input files (sprites with different sizes), split them in 6x8 tiles and generate char definitions for all unique tiles (i.e. all repeated tiles will have only one definition). For my own purpose I solved this with a post-processing lua script but I think it's worth to have this option build-in.
- Ym2Mym - to add possibility for simple "in-music" commands like "jump to_xxxx-th_vbl_frame" and "loop 3_times_next_xxxx_vbl_frames". Additionally having such "commands" can help for reducing the size of the YM data ... I'm working already on this ;).
For PictConv, I have some experimental code for handling batches of pictures in one single operation - the idea was to do things like video encoding for the Oric - but I guess that could be used to have your multiple input files as well. If you could share somewhere your source pictures so I get an idea on how you are doing at the moment, that could help.

For Ym2Mym, as long as the base feature sets continue to work the way they are, and if your new commands still compile fine on Windows and Linux and follow the way other parameters are passed to the OSDK tool (consistency), feel free to add some code - as long as your commit messages indicate what is being done

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 11:58 am
by iss
Dbug wrote:If you could share somewhere ...
I sent an e-mail with sprites and little demo - I took your e-mail address from your last message on comp.sys.oric :).
About Ym2Mym - when I have something well working I will post details. Maybe It would be better to create new tool and leave Ym2Mym as is ... will see.

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 12:30 pm
by Dbug
Bad idea, I don't use gmail, it just happen that to use comp.sys.oric with googlegroups you need a valid google mail account.
I wonder how many millions of mails I have there that I have never seen...

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 4:10 pm
by Chema
Regarding the tiling thing, that is what I am doing in my room editor. I could provide some code in C#.... The idea is dividing the pic in 6x8 cells called tiles (that is 8 bytes) and start from one corner checking if a tile does not exist and, if that is the case, then add it to the current tile set. I also note the tile number (entry in set) for that cell to create the map. I start the set with the empty tile, so the code for empty is 0.

Is that what you ask for?

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 4:19 pm
by iss
Yes, Chema, you described exactly the case.

@Dbug: I'll send PM.

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 6:43 pm
by Dbug
Chema wrote:
Tue Mar 21, 2017 4:10 pm
Regarding the tiling thing, that is what I am doing in my room editor. I could provide some code in C#.... The idea is dividing the pic in 6x8 cells called tiles (that is 8 bytes) and start from one corner checking if a tile does not exist and, if that is the case, then add it to the current tile set. I also note the tile number (entry in set) for that cell to create the map. I start the set with the empty tile, so the code for empty is 0.

Is that what you ask for?
It's what the charmap mode of PictConv is doing.
It goes through the picture, and extract the unique tiles, saving up to 96 of them.

Re: OSDK 1.9

Posted: Tue Mar 21, 2017 8:05 pm
by Chema
Oh, that is what you do :) I thought you HAD to put the letters in order and as a column :)

Anyway, this is what I am doing in the tile sectioning of my editor:

Code: Select all

  class TileSectioner
    {
        public List<byte[]> tileSet { get; private set; }
        public byte[,] tileMap { get; private set; }

        // Constructor. Pass the value for a blank tile
        // usually 0x40 or 0x7f
        public TileSectioner(byte blankTile=0x40)
        {
            tileSet = new List<byte[]>();
            byte[] t=new byte[8];

            for (int i=0;i<8;i++)
                t[i] = blankTile;

            tileSet.Add(t);
        }

        // Check if two tiles are equal
        private bool areTilesEqual(byte []t1, byte[] t2)
        {
            int i=0;
            while((i<8) && (t1[i]==t2[i]))
                i++;
            return !(i==8);
        }

        // Searches for tile t in the tile set and return its
        // code. If t is not in the set add it and return code.
        private byte GetTileCode(byte[] t)
        {
            // Search the code in the tile set
            int code = 0;
            while ((code < tileSet.Count) && (areTilesEqual(tileSet[code],t)))
                code++;
            if(code==tileSet.Count)
                tileSet.Add(t);

            return (byte)(code);
        }

        // Method to perform the sectioning of a picture in tiles.
        // Fills in the tilemap and tileset.
        public void doSection(byte[,] pic, bool usePalette1=false, bool usePalette2=false)
        {
            // Section the picture in tiles
            int sizx = pic.GetLength(0);
            int sizy = pic.GetLength(1)/8;

            // If using palette we have to skip first two scans
            int skip = 0;

            if(usePalette1)
            {
                sizx--;
                skip++;
            }
            if (usePalette2)
            {
                sizx --;
                skip++;
            }

            // Create the tile map
            tileMap = new byte[sizx,sizy];

            // Populate it
            for (int tiley = 0; tiley < sizy; tiley++) 
                for (int tilex= 0 ; tilex < sizx; tilex++)
                {
                    // Calculate the tile at (tilex,tiley)
                    var t = new byte[8];
                    for (int k=0; k<8; k++)
                    {
                        t[k] = pic[tilex+skip, tiley*8+ k];
                    }
                    // Get entry in array (creates one if tile does not exist)
                    var code=GetTileCode(t);
                    // Store in the tilemap
                    tileMap[tilex, tiley] = code;
                }
        }

    }
Ignore the "palette" thing and it takes the graphic as a matrix of bytes and produces the tile graphics and the tile map. Yeah, I know I should use collections and such things... I am too used to C and was learning C# on the fly! And I am lazy :)