CC65 to DSK
CC65 to DSK
Hey Guyz,
I just released a new online game for the Apple//e, Atari, and C64 (see: viewtopic.php?f=23&t=1904)
The game was programmed with CC65, and I am now starting the ATMOS port. I have a few questions, the first of which is: what is the best way to pack the output of CC65 (TAP file with BASIC loader) into a disk?
Should I use the floppy builder utility? There is a documentation page, but it is rather obscure and seem to rely on some boot files that require building OSDK first of all (http://osdk.org/index.php?page=document ... ppybuilder).
Any help would be greatly appreciated, as I can only spend spare time on this project. So I am eager to overcome this first hurdle quickly.
I just released a new online game for the Apple//e, Atari, and C64 (see: viewtopic.php?f=23&t=1904)
The game was programmed with CC65, and I am now starting the ATMOS port. I have a few questions, the first of which is: what is the best way to pack the output of CC65 (TAP file with BASIC loader) into a disk?
Should I use the floppy builder utility? There is a documentation page, but it is rather obscure and seem to rely on some boot files that require building OSDK first of all (http://osdk.org/index.php?page=document ... ppybuilder).
Any help would be greatly appreciated, as I can only spend spare time on this project. So I am eager to overcome this first hurdle quickly.
Re: CC65 to DSK
To create working DSK you need to use some tools from OSDK.
But first I think it's good idea to compile with CC65 a "plain" binary (i.e. no tap header, no basic loader).
For this you need to adjust the cfg file (attached you can find my cfg files - atmosA.cfg for assembler only projects and atmosC.cfg - for C/asm mixed projects).
You can use FloppyBuilder as in documentation page.
Or you can use 'header' and 'tap2dsk' utilities from OSDK to create Sedoric DSK file.
But first I think it's good idea to compile with CC65 a "plain" binary (i.e. no tap header, no basic loader).
For this you need to adjust the cfg file (attached you can find my cfg files - atmosA.cfg for assembler only projects and atmosC.cfg - for C/asm mixed projects).
You can use FloppyBuilder as in documentation page.
Or you can use 'header' and 'tap2dsk' utilities from OSDK to create Sedoric DSK file.
- Attachments
-
- atmos.cfgs.zip
- (1.61 KiB) Downloaded 777 times
Re: CC65 to DSK
FloppyBuilder is intended for demos and specific games, such as my Blake's 7. It does not have a filesystem.
I'd recommend using tap2dsk, as it builds a sedoric disk that can be opened, dir'd and copied with no problems.
If you plan to access data I can provide some working routines and ideas, which are also available as sources in the repository (Space:1999 and 1337 use this technique).
I'd recommend using tap2dsk, as it builds a sedoric disk that can be opened, dir'd and copied with no problems.
If you plan to access data I can provide some working routines and ideas, which are also available as sources in the repository (Space:1999 and 1337 use this technique).
Re: CC65 to DSK
As said previously by ISS and Chema, you have (mostly) two options: Tap2DSK and FloppyBuilder
FloppyBuilder was designed to allow you to extract every single byte of memory, but that obviously comes with a lot of specific restrictions, such as a custom build model where the Build System and FloppyBuilder interact to know the exact size of what is being built, etc... custom file format, etc...
Since you are doing that casually, and using CC65, Tap2DSK is probably the best way to get your started.
One thing to remember is that Tap2DSK generates old style DSK files, you need to convert them with old2mfm to get the final DSK file in the modern format.
Assuming you game is called SUPRSPRINT.TAP, you can just do that:
FloppyBuilder was designed to allow you to extract every single byte of memory, but that obviously comes with a lot of specific restrictions, such as a custom build model where the Build System and FloppyBuilder interact to know the exact size of what is being built, etc... custom file format, etc...
Since you are doing that casually, and using CC65, Tap2DSK is probably the best way to get your started.
One thing to remember is that Tap2DSK generates old style DSK files, you need to convert them with old2mfm to get the final DSK file in the modern format.
Assuming you game is called SUPRSPRINT.TAP, you can just do that:
Code: Select all
tap2dsk -iCLS:SUPRSPRINT SUPRSPRINT.TAP SUPRSPRINT.DSK
old2mfm SUPRSPRINT.DSK
Re: CC65 to DSK
@iss: Thanks for the config file.
It worked after I set a value for the __START_ADDRESS__ ($0501)
It is long winded, but with the following commands I can get a working disk:
cl65 -o hello.bin -Cl -O -t atmos -C atmosc.cfg hello.c
header hello.bin hello.bin $0501
tap2dsk -iHELLO.COM hello.bin hello.dsk
old2mfm hello.dsk
@Chema: Thanks for the offer of help. CC65 does not support fopen(), fread() for the atmos.
My game needs to load bitmap files into HIRES memory, as well as load navigation files into single bytes and ints.
Any code snippets for that purpose will be awesome!
It worked after I set a value for the __START_ADDRESS__ ($0501)
It is long winded, but with the following commands I can get a working disk:
cl65 -o hello.bin -Cl -O -t atmos -C atmosc.cfg hello.c
header hello.bin hello.bin $0501
tap2dsk -iHELLO.COM hello.bin hello.dsk
old2mfm hello.dsk
@Chema: Thanks for the offer of help. CC65 does not support fopen(), fread() for the atmos.
My game needs to load bitmap files into HIRES memory, as well as load navigation files into single bytes and ints.
Any code snippets for that purpose will be awesome!
Re: CC65 to DSK
I know. You can try the Sedoric() function, which is a hack, and tries ro execute a sedoric command such as "!LOAD ..." (I have no experience with this, but it was quite straightforward), or take a long path using custom routines to load sectors and create the disk so you know which sectors your data is in.
If the former does not suit you, let me know and I'll try to provide further help.
If the former does not suit you, let me know and I'll try to provide further help.
Re: CC65 to DSK
Oops... Sedoric is in the OSDK C library. You should look there for an implementation to use with another compiler.
Re: CC65 to DSK
In the attached file you can find sources and compiled (with CC65 + OSDK tools) DSK file for Sedoric compatible 'save' and 'load' functions. After boot the test saves first 4 lines of the screen to a file 'TEST.TXT' then screen is CLSed, after key press these 4 lines are restored from file. In the zip file I added just for reference 'libsedoric-cc65_preprocessed.s' which is 'libsedoric.s' but preprocessed/converted to more ca65 fompatible format.
I hope this will help and boost your game to the 'FINISH'
.
I hope this will help and boost your game to the 'FINISH'

- Attachments
-
- libsedoric-cc65.zip
- (34.68 KiB) Downloaded 804 times
Re: CC65 to DSK
Sweet!!! Thanks a lot ISS!
Please can you also take a look at the Network thread? I have a question about ACK.

Please can you also take a look at the Network thread? I have a question about ACK.
Re: CC65 to DSK
The library seems to work just fine, but now the question is: how to add data files to a DSK in the first place?
tap2sdk seems to only allow 1 file as input (I cannot append a list of data files to the DSK).
I tried generating a DSK header+tap2dsk+old2mfm, then used this JAVA app (viewtopic.php?t=1804) to add the data files. But the resulting DSK does not work correctly, the atmos does not load sedoric...
tap2sdk seems to only allow 1 file as input (I cannot append a list of data files to the DSK).
I tried generating a DSK header+tap2dsk+old2mfm, then used this JAVA app (viewtopic.php?t=1804) to add the data files. But the resulting DSK does not work correctly, the atmos does not load sedoric...
Re: CC65 to DSK
You can use :
tap2dsk file1.tap file2.tap file3.tap fileN.tap dskname.dsk
And remember old dsk format so you need to use old2mfm but Dbug or others have already told you about that.
If you use DSK manager you should tick the "boot" box just left to the diskname and it should be a sedoric bootable disk.
tap2dsk file1.tap file2.tap file3.tap fileN.tap dskname.dsk
And remember old dsk format so you need to use old2mfm but Dbug or others have already told you about that.
If you use DSK manager you should tick the "boot" box just left to the diskname and it should be a sedoric bootable disk.
Re: CC65 to DSK
Alright, but say I have a just a memory buffer (8000 bytes of screen data).
How should I make this into a tap file? Does it need a load address as the first 2 bytes??
How should I make this into a tap file? Does it need a load address as the first 2 bytes??
Re: CC65 to DSK
Tap2DSK requires valid Tape files with the correct header.
If you have a binary file in the format you want, you can just use Header.exe (from the OSDK)
-> http://www.osdk.org/index.php?page=docu ... age=header
In the specific case of a picture, you could also use PictConv which will convert your picture and save it to a TAP file with the correct header
-> http://www.osdk.org/index.php?page=docu ... e=pictconv
If you have a binary file in the format you want, you can just use Header.exe (from the OSDK)
-> http://www.osdk.org/index.php?page=docu ... age=header
In the specific case of a picture, you could also use PictConv which will convert your picture and save it to a TAP file with the correct header
-> http://www.osdk.org/index.php?page=docu ... e=pictconv
Re: CC65 to DSK
I see! I will try header on the binary file tonight.
By the way, the AIC mode in PictConv seems broken. Using the -f7 flag, I only get B/W images.
By the way, the AIC mode in PictConv seems broken. Using the -f7 flag, I only get B/W images.
Re: CC65 to DSK
In -f7 mode, the attributes are not saved, to leave you the option of choosing whatever combination of INK you want, it also makes it easier to generate bitmap blocks without wasting room.
Maybe that's your problem?
To see if it worked, just put black PAPER in column zero, and then alternate between YELLOW and CYAN ink
Here are some examples of AIC graphics:
- Attachments
-
- metro_train_front.png (1.86 KiB) Viewed 21833 times