News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Prototron

WinAPE Disk creation/Formatting/Adding Headers

Started by Prototron, 13:00, 07 August 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Prototron

Hi everyone!

I'm making a little game in assembly language, and part of that is trying to learn how the 6218 disk system works by putting a RAW binary bitmap graphics file on a disk and then loading it to a buffer in RAM (I'll be using firmware, so that's why the Amdos header is needed).

I'm having a little trouble getting started though. I used WinAPE to create a disk image and dragged my file on to it, but that's all I have so far, and I'm unsure if the steps I've taken are correct.

Disk Type
I can't seem to find a breakdown on what type of disk image to make out of the selection of these four options that WinAPE offers:

- Disk Files
- RW CPC Disc Files
- MV CPCEMU FILES
- Xexor Archive

Format Type
Formatting gives a whole bunch of options which I can't find information on (the WinAPE manual does not go into these at all) so I'm confused about that. I just went with the default option of DATA (SS 40), but it'd be nice to know what the others are for too.

Header
Adding an AMDOS header to the file in Winape is also very confusing as there is only a checkbox, and it isn't clear what is happening or what needs to be done in order to achieve it. I've tried selecting the file then checking the box, then dragging the file onto the disk AFTER checking the box, but the size of the file remains the same whatever I do, and I know there should be en extra 128 bytes. The ONLY result I've got is when the box is UNCHECKED, and I drag the file over, but it only adds an extra 64 bytes to the file size.

As stated, I've consulted the WinAPE documentation, but it's quite vague and doesn't go into any great detail.

Can someone please clarify these points for me and offer a deeper explanation on what's happening (and maybe offer some specific steps I can take)?

Thanks!
"For the money, for the glory, and for the fun!

Mostly for the money."

Prodatron

#1
These are the most common standards:

Disc type:
- MV CPCEmu

Format type:
- DATA SS 40

Regarding headers:
- AMSDOS only shows file sizes in 1KB portions, as the clusters itself are 1KB.
If you add a file with e.g. 950 bytes, you will see a 1KB file.
If you add the same file and activate "Add headers", you will see a 2KB file.

WinApe will add binary headers with type "binary", which contain the exact file size. For the loading and executing address it will probably use #0000.
If you have a raw binary file "exampl.bin" of e.g. 1024 bytes: Choose "Add headers", drag and drop it to the disc in Winape, and then in the emulated CPC you can load it e.g. to address #4000:

MEMORY &3FFF
LOAD"exampl.bin",&4000

Now you can start peeking from address #4000... and will see, that the 1024 bytes have been loaded correctly.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

Prototron

Excellent! Thanks for the information.

Got a nice loader working now.
"For the money, for the glory, and for the fun!

Mostly for the money."

GUNHED

If you want to create a header by yourself, then you can use the Maxam Assembler and save the assembled file with the ".COM" extension. So maxam will NOT create a header. Instead you put your header in your source code, this way you get the header you want.

Here is an example of my custom headers...

                  ;---=== 128 Bytes FutureOS type 3 Graphic Icon - 24x * 16y MODE 1 pixel ===---*
                 
0000  00 2D 2D 46          DB    &00,"--FutureTex"
0004  75 74 75 72
0008  65 54 65 78
000C  FF FF FF FF          DB    &FF,&FF,&FF,&FF,&FF,&FF ;1st scan line icon
0010  FF FF

0012  82 00 00             DB    &82,&00,&00  ;FileType FutureOS binary

0015  00 00                DW    &0000        ;Address to load this file
0017  C0                   DB    &C0          ;RAM configuration to load file
0018  80 9B                DW    &9B80        ;Length of file
001A  00 00                DW    &0000        ;Autostart of this file

001C  00                   DB    &00          ;Over-Byte file-length
001D  C0                   DB    &C0          ;Autostart RAM config

001E  88 00 00 00          DB    &88,&00,&00,&00,&00,&11 ;Icon scan lines 2-6
0022  00 11
0024  BB FF EE 77          DB    &BB,&FF,&EE,&77,&FF,&DD
0028  FF DD
002A  AB 0F 2E 47          DB    &AB,&0F,&2E,&47,&0F,&5D
002E  0F 5D
0030  AB F0 A6 56          DB    &AB,&F0,&A6,&56,&F0,&5D
0034  F0 5D
0036  AB 0F 2E 47          DB    &AB,&0F,&2E,&47,&0F,&5D
003A  0F 5D
003C  AB D2 A6 56          DB    &AB,&D2,&A6,&56

0040  80 9B                DW    &9B80        ;irrelevant (repeat of file-length)
0042  03                   DB    &03          ;IconTyp &03
0043  62 1D                DW    &1D62        ;Checksum of header bytes &0000-&0042 (incl.)

0045  D2 5D                DB    &D2,&5D
0047  AB 0F 2E 47          DB    &AB,&0F,&2E,&47,&0F,&5D ;icon scan lines 8-16
004B  0F 5D
004D  AB F0 A6 56          DB    &AB,&F0,&A6,&56,&B4,&5D
0051  B4 5D
0053  AB 0F 2E 47          DB    &AB,&0F,&2E,&47,&0F,&5D
0057  0F 5D
0059  AB D2 A6 56          DB    &AB,&D2,&A6,&56,&F0,&5D
005D  F0 5D
005F  AB 0F 2E 47          DB    &AB,&0F,&2E,&47,&0F,&5D
0063  0F 5D
0065  AB 0F 2E 47          DB    &AB,&0F,&2E,&47,&0F,&5D
0069  0F 5D
006B  BB FF EE 77          DB    &BB,&FF,&EE,&77,&FF,&DD
006F  FF DD
0071  88 00 00 00          DB    &88,&00,&00,&00,&00,&11
0075  00 11
0077  FF FF FF FF          DB    &FF,&FF,&FF,&FF,&FF,&FF
007B  FF FF
007D  54 65 78             DB    "Tex"

http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod