How To: Try It Now!

Announcements by the development team or forum staff.
BruceRMcF
Posts: 222
Joined: Sat Jan 07, 2023 10:33 pm

Re: How To: Try It Now

Post by BruceRMcF »

Ed Minchau wrote: Sat Apr 08, 2023 6:28 pm
mwiedmann wrote: Mon Apr 03, 2023 12:40 am My game organized files into subfolders and loads them from there. Example:
sounds/sound1.zsm
sounds/sound2.zsm
levels/level1.bin
levels/leve2.bin
images/sprite1.bin
...etc...

Can the "resources" reference subdirectories like that?
OR do I have to flatten everything out and change my code to load everything from the main directory?
I tried it with subfolders and without, and for me it didn't work with subfolders but worked when everything was in the same directory.
Directories can be confusing, since running inside the X16, the directories would be sounds/:sound1.zsm and etc. "/" is not a special character for IEC devices, but ":" is, to support different drive numbers on the same IEC device, so CMD put all of the subdirectory information before a ":" when it implemented subdirectories for its IEC hard drives and high density floppy drives.
grml
Posts: 60
Joined: Sat Aug 13, 2022 8:31 pm

Re: How To: Try It Now

Post by grml »

(nevermind, mods - I just realized the code for the web feature is actually in the main repo. sorry)
Last edited by grml on Mon Apr 10, 2023 6:48 am, edited 1 time in total.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

grml wrote: Mon Apr 03, 2023 10:03 am This is too complicated and could be done better. Why make a list of files, the zip already has a list of all files. I'm not gonna do that.
Sorry for late reply. I saw your PR on ommiting manifest file list inside zip.

Personally I don't like removing "resources" declaration. This file list allows you to include files that are needed to run program, and ommit additional files like readme, license, docs, use examples, etc. And it's not that hard to make a file list in manifest after you already wrote a whole program.

But I'm not the only one to decide that. My view might be too old fashioned. So let PR be for others to see.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

mobluse wrote: Thu Apr 06, 2023 3:21 pm I have included name and author in the manifest. What should I do to get the name and author displayed.
TomXP411 wrote: Thu Apr 06, 2023 4:49 pm I think that's just the comment field, to the right of the filename when you're editing the attachment list.
Yes, name and author fields in the manifest are not used for now.
Like Tom said, put that in the file comment when uplodaing attachment to forum.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

mobluse wrote: Thu Apr 06, 2023 5:54 pm Can one have files in the zip-file that are not needed by the program and that are not in the manifest? but are there for other reasons: e.g. a BAS file of the program even if the web emulator uses the PRG file, since BAS files often work with later versions, but takes longer time to load. PRG file for the iPhone version, which is still R38, I believe.
Yes, you can.
This is one of the useful features of manifest file.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

grml wrote: Mon Apr 03, 2023 10:03 am It should also just run a bare PRG without the zip shenanigans.
I also thought about that.
I also thought it would be convenient to run a plain text BAS file in one click.
It is not hard to implement this in web emu, but there is some hurdles to make all this work with forum "Try It Now" feature.
Currently forum uses a custom version of web emu that uses a dirty trick to make it work. I'm thinking now on a better solution.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

BruceRMcF wrote: Sun Apr 09, 2023 3:31 pm Directories can be confusing, since running inside the X16, the directories would be sounds/:sound1.zsm and etc. "/" is not a special character for IEC devices, but ":" is, to support different drive numbers on the same IEC device, so CMD put all of the subdirectory information before a ":" when it implemented subdirectories for its IEC hard drives and high density floppy drives.
Thank you! You explained it much better than I could.

I don't fully understand how subdirectories work in X16, but I know it is different from modern filesystems. So it is not only up to web emu to solve that. This needs more thinking.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

mwiedmann wrote: Mon Apr 03, 2023 12:40 am My game organized files into subfolders and loads them from there. Example:
sounds/sound1.zsm
sounds/sound2.zsm
levels/level1.bin
levels/leve2.bin
images/sprite1.bin
...etc...

Can the "resources" reference subdirectories like that?
OR do I have to flatten everything out and change my code to load everything from the main directory?
I want to redirect this question to all developers, since I'm only a beginner in X16 development field. If I'm not mistaken Commodore disk drives did not support subdirectories. And I notice many X16 developers also don't use subdirectories, despite X16 supports them. Is it just a habbit? Or a safe side? Or is there more to it?
BruceRMcF
Posts: 222
Joined: Sat Jan 07, 2023 10:33 pm

Re: How To: Try It Now

Post by BruceRMcF »

Cyber wrote: Tue Apr 11, 2023 5:37 am ... I want to redirect this question to all developers, since I'm only a beginner in X16 development field. If I'm not mistaken Commodore disk drives did not support subdirectories. And I notice many X16 developers also don't use subdirectories, despite X16 supports them. Is it just a habbit? Or a safe side? Or is there more to it?
If I understand correctly, the X16 SD routines followed the subdirectory system used by CMD drives that supported subdirectories.

The dual drive systems for PET computers use a "1:" or "2:" to distinguish drive 1 and drive 2 on a disk drive unit. So CMD took advantage of the fact that ":" is a reserved separator in front of the file name to allow path references to be included before the ":", as in "//files/misc/:game1.prg", if "files" is a directory in the root directory.

Only a lucky minority of Commodore owners had CMD drives (though quite a lot had CMD JiffyDos), so it could well just be habit that sees many of us continuing to pile all of our files together without using sub-directories, when developing for retro systems.

Note that cross-developers have to keep straight two different different ways to refer to the same thing -- when working with the cross-development tools in the modern operating system, they are in the system they are used to ... be it C:\ or C:/ or /mnt/c or whatever ... but when operating on the X16, then any directory name has to be ENCLOSED by "/", so the relative reference to the "files/misc/game1.prg" file in the Commodore world (from CMD and inherited by, eg, SD2IEC, etc.) is "/files/misc/:game1.prg" and the absolute reference to the "/files/misc/game1.prg" file is "//files/misc/:game1.prg".

Those doing development hosted on the X16 would simply stay in "CMD subdirectories" world, so it will be less confusing, but only a small handful of us can, at present, be entirely in that space, since most of us are still reliance on the emulator which keeps us being cross-developers to at least some extent.
Last edited by BruceRMcF on Wed Apr 12, 2023 3:07 am, edited 1 time in total.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: How To: Try It Now

Post by Cyber »

Thank you, Bruce, for detailed answer, as always! )
Post Reply