Added vim modelines to all files.

Set them to 2-space indent, I hope this is ok.


git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1161 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2009-11-10 20:08:11 +00:00
parent 2239adbd58
commit e6e698c2bd
89 changed files with 225 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
/* vim:expandtab:ts=2 sw=2:
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
Copyright 2009 Petter Lindquist
@@ -2539,8 +2541,55 @@ void Save_C64(void)
// SCR (Amstrad CPC)
void Test_SCR(void)
{
// Mmh... not sure what we could test. Any idea ?
// The palette file can be tested, if it exists and have the right size it's
// ok. But if it's not there the pixel data may still be valid. And we can't
// use the filesize as this depends on the screen format.
// An AMSDOS header would be a good indication but in some cases it may not
// be there
}
void Load_SCR(void)
{
// The Amstrad CPC screen memory is mapped in a weird mode, somewhere
// between bitmap and textmode. Basically the only way to decode this is to
// emulate the video chip and read the bytes as needed...
// Moreover, the hardware allows the screen to have any size from 8x1 to
// 800x273 pixels, and there is no indication of that in the file besides
// its size. It can also use any of the 3 screen modes. Fortunately this
// last bit of information is stored in the palette file.
// Oh, and BTW, the picture can be offset, and it's even usual to do it,
// because letting 128 pixels unused at the beginning of the file make it a
// lot easier to handle screens using more than 16K of VRam.
// The pixel encoding change with the video mode so we have to know that
// before attempting to load anything...
// As if this wasn't enough, Advanced OCP Art Studio, the reference tool on
// Amstrad, can use RLE packing when saving files, meaning we also have to
// handle that.
// All this mess enforces us to load (and unpack if needed) the file to a
// temporary 32k buffer before actually decoding it.
// 1) Seek for a palette
// 2) If palette found get screenmode from there, else ask user
// 3) ask user for screen size (or register values)
// 4) Load color data from palette (if found)
// 5) Close palette
// 6) Open the file
// 7) Run around the screen to untangle the pixeldata
// 8) Close the file
}
void Save_SCR(void)
{
// TODO : Add possibility to set R9, R12, R13 values
// TODO : Add OCP packing support
// TODO : Add possibility to include AMSDOS header, with proper loading
// address guessed from r12/r13 values.
unsigned char* output;
unsigned long outsize;
unsigned char r1;