#include #define WIDTH 144 #define HEIGHT 100 #define AMIGA_BITPLANES 4 #define ANIMATION_DELTA 20 static int cycle_index; /* Animation cycle index */ /* Copied from Amiga Boing demo at http://amiga.filfre.net/?page_id=5 */ const Uint16 ball_bitplanes[] = { /*Bitplane 0*/ 0x0, 0x0, 0x0, 0x0, 0x7, 0xff80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1f, 0xffff, 0xfc00, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf8, 0x7f, 0xffff, 0xff80, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfe6, 0x3ff, 0xffff, 0xfff0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xfd1b, 0x980f, 0xffff, 0xfffc, 0x0, 0x0, 0x0, 0x0, 0xf, 0xc14e, 0xb410, 0xffff, 0xffff, 0x8000, 0x0, 0x0, 0x0, 0xfc, 0x927a, 0xe92a, 0x7fff, 0xffff, 0xf000, 0x0, 0x0, 0x0, 0xc5, 0x9db, 0xa26f, 0x6fff, 0xffff, 0xfe00, 0x0, 0x0, 0x0, 0x1d0, 0x46ee, 0xc4d2, 0xfff, 0xffff, 0xff80, 0x0, 0x0, 0x0, 0xbba, 0x3bbd, 0x99b2, 0xd5bf, 0xffff, 0xffc0, 0x0, 0x0, 0x0, 0xd76, 0x5ef6, 0x3324, 0xd57f, 0xffff, 0xffe0, 0x0, 0x0, 0x0, 0x5dec, 0x8fdc, 0x4665, 0xd55f, 0xffff, 0xfff0, 0x0, 0x0, 0x0, 0xab99, 0x18f8, 0x8ccd, 0x9455, 0xffff, 0xfff8, 0x0, 0x0, 0x2, 0xd772, 0x3103, 0x19c9, 0x96aa, 0xffff, 0xfffc, 0x0, 0x0, 0xd, 0xaecc, 0x6238, 0x3199, 0x96aa, 0x6fff, 0xfffe, 0x0, 0x0, 0x1a, 0xbd98, 0xc673, 0x8399, 0xb695, 0x97ff, 0xffff, 0x8000, 0x0, 0x6d, 0x7331, 0x8c73, 0x1b39, 0xb255, 0xbbff, 0xffff, 0xc000, 0x0, 0xd2, 0xe663, 0x18e7, 0x30f3, 0x324a, 0x9dff, 0xffff, 0xe000, 0x0, 0xfa5, 0xccc3, 0x31ce, 0x31c3, 0x324b, 0xebff, 0xffff, 0xf000, 0x0, 0x1917, 0xb986, 0x23ce, 0x618c, 0x336d, 0x71ff, 0xffff, 0xf800, 0x0, 0x1ade, 0x670c, 0x639c, 0x639c, 0xc325, 0xa8ff, 0xffff, 0xfc00, 0x0, 0x32a3, 0xce18, 0xc73c, 0xc319, 0xcf26, 0xf37f, 0xffff, 0xfe00, 0x0, 0x35a6, 0x7c31, 0x8e38, 0xc719, 0xccf2, 0xd5df, 0xffff, 0xff00, 0x0, 0x6946, 0xc463, 0x1e71, 0x8739, 0x8ccf, 0x7a6f, 0xffff, 0xff00, 0x0, 0xcacc, 0xc707, 0x1c71, 0x8e31, 0x9ccc, 0x6d37, 0xffff, 0xff80, 0x0, 0xd69d, 0x8e7e, 0x38e3, 0xe33, 0x98cc, 0xcd4b, 0xffff, 0xff80, 0x1, 0x9599, 0x8e73, 0xb9e3, 0x1c73, 0x98cc, 0xc9b7, 0xffff, 0xffc0, 0x1, 0xad33, 0x1ce3, 0x81c6, 0x1c63, 0x98cc, 0xc92b, 0xffff, 0xffc0, 0x3, 0x4b33, 0x1ce7, 0xdc6, 0x3c63, 0x18cc, 0xc92b, 0xffff, 0xffe0, 0x3, 0x5666, 0x39c7, 0x1c4c, 0x38e7, 0x18cc, 0xccaa, 0x3fff, 0xffe0, 0x6, 0x96e6, 0x39ce, 0x1872, 0x78c7, 0x19cc, 0xc495, 0x3fff, 0xfff0, 0xd, 0x2ccc, 0x738e, 0x38f3, 0xb0c7, 0x19cc, 0xc495, 0x1fff, 0xfff0, 0xd, 0x5dcc, 0x739c, 0x30e7, 0x89c7, 0x39ce, 0xc495, 0x1fff, 0xfff0, 0x1a, 0x5b98, 0xe71c, 0x71e7, 0xf8e, 0x31ce, 0x64d4, 0xffff, 0xfff8, 0x1a, 0xbb18, 0xe738, 0x71cf, 0x1e4e, 0x31ce, 0x64ca, 0x8fff, 0xfff8, 0x8, 0xb731, 0xce38, 0xe1ce, 0x1c71, 0x31ce, 0x664a, 0x8fff, 0xfffc, 0xa, 0xf631, 0xce78, 0xe38e, 0x3cf1, 0xf1ce, 0x664a, 0x77ff, 0xfffc, 0xa, 0x9e63, 0x9c71, 0xc39e, 0x3ce3, 0xc9ce, 0x6649, 0x47ff, 0xfffe, 0xa, 0x9063, 0x9cf1, 0xc71c, 0x38e3, 0x8ece, 0x6261, 0x5fff, 0xfffe, 0x4, 0x9327, 0x38e3, 0x873c, 0x78e3, 0x9e36, 0x6265, 0x1bff, 0xffff, 0x15, 0x933f, 0x39e3, 0x8e38, 0x79e3, 0x9c30, 0x6264, 0x23ff, 0xffff, 0x15, 0x3339, 0xb1c7, 0x8e38, 0xf1c7, 0x9c71, 0x9324, 0xafff, 0xffff, 0x15, 0x2639, 0x83c7, 0xc78, 0xf1c7, 0x1c61, 0x9f30, 0x8dff, 0xffff, 0x15, 0x2671, 0x8d8f, 0x1c70, 0xe3c7, 0x3c63, 0x9cf2, 0x91ff, 0xffff, 0x15, 0x2673, 0x8c76, 0x1871, 0xe38f, 0x3863, 0x1cce, 0x16ff, 0xffff, 0x9, 0x2673, 0x1c71, 0x38f1, 0xe38e, 0x38e3, 0x38cd, 0xc6ff, 0xffff, 0xb, 0x2673, 0x1861, 0xf0e1, 0xc78e, 0x78c3, 0x39cd, 0xbbff, 0xffff, 0xb, 0x6663, 0x18e3, 0xc9e3, 0xc70e, 0x70c7, 0x399d, 0xb47f, 0xffff, 0xb, 0x6c67, 0x18e3, 0x8ec3, 0xc71e, 0x71c6, 0x3999, 0xb4ff, 0xffff, 0x4b, 0x6ce7, 0x38e3, 0x9e27, 0x871c, 0x71c6, 0x3199, 0x34ff, 0xffff, 0x2b, 0x6ce7, 0x30c3, 0x9c38, 0x4f1c, 0xf1c6, 0x339b, 0x2cff, 0xfffe, 0x12, 0x6ce6, 0x31c7, 0x9c78, 0x761c, 0xe186, 0x739b, 0x6aff, 0xfffe, 0x16, 0x4cc6, 0x31c7, 0x1c70, 0xf13c, 0xe38e, 0x739b, 0x69ff, 0xfffe, 0x96, 0xccce, 0x3187, 0x3c70, 0xe1d8, 0xe38c, 0x733b, 0x69ff, 0xfffe, 0xe6, 0xd8ce, 0x718f, 0x3871, 0xe3c1, 0xe38c, 0x6333, 0x69ff, 0xfffe, 0x68, 0xd9ce, 0x618e, 0x38f1, 0xc386, 0xc30c, 0x6732, 0x69ff, 0xfffe, 0x71, 0x198e, 0x638e, 0x78e1, 0xc78e, 0x271c, 0x6732, 0x59ff, 0xfffe, 0x74, 0x219c, 0x630e, 0x70e3, 0xc70c, 0x3898, 0xe732, 0x55ff, 0xfffe, 0x34, 0xa61c, 0xe31e, 0x71e3, 0x871c, 0x78f8, 0xc732, 0x55ff, 0xfffe, 0x38, 0x866c, 0xc31c, 0x71c7, 0x8f18, 0x71e4, 0xce72, 0x55ff, 0xfffe, 0x3a, 0x9263, 0xc71c, 0xf1c7, 0xe38, 0xf1c7, 0xe66, 0xd5ff, 0xfffe, 0x1a, 0x1323, 0x261c, 0xe3c7, 0x1e38, 0xe3ce, 0x7664, 0xd5ff, 0xfffe, 0x1c, 0x5323, 0x393c, 0xe38f, 0x1c70, 0xe38e, 0x71e4, 0xb3ff, 0xfffc, 0x15, 0x4323, 0x39d8, 0xe38e, 0x1c71, 0xc79c, 0xe304, 0xabff, 0xfffc, 0x15, 0x933, 0x39c1, 0xe38e, 0x3ce1, 0xc71c, 0xe33b, 0xabff, 0xfff8, 0xf, 0x2933, 0x39c6, 0xc79e, 0x38e3, 0x8f39, 0xc636, 0x6bff, 0xfff8, 0xa, 0xa933, 0x39c6, 0x3b1c, 0x39c3, 0x8e39, 0xc676, 0x97ff, 0xfff0, 0xa, 0xa993, 0x39c6, 0x383c, 0x79c7, 0xe73, 0x8c6c, 0xafff, 0xfff0, 0x7, 0x9591, 0x39ce, 0x30d8, 0x73c7, 0x1c73, 0x8ccd, 0x2fff, 0xffe0, 0x5, 0x5491, 0xb9cc, 0x71c4, 0xf386, 0x1ce7, 0x19db, 0x5fff, 0xffe0, 0x5, 0x5491, 0x99cc, 0x7187, 0x678e, 0x38e7, 0x1992, 0x9fff, 0xffe0, 0x2, 0xd491, 0x998c, 0x718e, 0x1b0c, 0x39ce, 0x33b4, 0xbfff, 0xffc0, 0x1, 0x2a99, 0x998c, 0x638e, 0x389c, 0x71ce, 0x3325, 0x7fff, 0xffc0, 0x0, 0x9249, 0x998c, 0x631c, 0x31f8, 0x739c, 0x6669, 0x7fff, 0xff80, 0x0, 0x4849, 0x998c, 0xe31c, 0x71c4, 0xe39c, 0x665a, 0xffff, 0xff80, 0x0, 0x26b9, 0x998c, 0xe718, 0x63cf, 0x738, 0xccd4, 0xffff, 0xff00, 0x0, 0x95f, 0x999c, 0xc638, 0xe38e, 0x3f38, 0xd8b5, 0xffff, 0xff00, 0x0, 0x65b, 0x1998, 0xc630, 0xc71c, 0x71b1, 0x9969, 0xffff, 0xfe00, 0x0, 0x32f, 0x6198, 0xce71, 0xc73c, 0xe301, 0xb153, 0xffff, 0xfe00, 0x0, 0x1d5, 0xa619, 0xcc61, 0x8e38, 0xc61c, 0x32d7, 0xffff, 0xfc00, 0x0, 0x2e7, 0xb279, 0x8c63, 0x9c71, 0xcc39, 0x82a7, 0xffff, 0xf800, 0x0, 0x112, 0xd367, 0x9cc3, 0x1ce3, 0x9873, 0x3baf, 0xffff, 0xe000, 0x0, 0x85, 0x5b26, 0x78c7, 0x39e7, 0x30e6, 0x748f, 0xffff, 0xc000, 0x0, 0x4b, 0xe926, 0x6186, 0x39ce, 0x619d, 0xe96f, 0xffff, 0x8000, 0x0, 0x1c, 0xad26, 0x664e, 0x739c, 0x6333, 0xa6df, 0xffff, 0x0, 0x0, 0xe, 0xd5a6, 0xcefc, 0x6718, 0xc667, 0x4b7f, 0xfffe, 0x0, 0x0, 0x4, 0xd4b6, 0x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 0xe00f, 0xf8f8, 0x6000, 0x0, 0xe, 0x7e00, 0x7fe0, 0x3ff8, 0x1ff, 0xc00f, 0xf8f8, 0x6000, 0x0, 0x1c, 0x7c00, 0xffe0, 0x7ff8, 0x1ff, 0xc00f, 0xf8f8, 0x6000, 0x0, 0x1c, 0xfc00, 0xffc0, 0x7ff0, 0x7f, 0xc00f, 0xf8fc, 0x3000, 0x0, 0x30, 0xf801, 0xffc0, 0xfff0, 0x7f, 0xc00f, 0xf87c, 0x3000, 0x0, 0x30, 0xf801, 0xff80, 0xfff0, 0xff, 0xc00f, 0xf87c, 0x3000, 0x0, 0x30, 0xf003, 0xff81, 0xffe0, 0xff, 0xf00f, 0xf87e, 0x1800, 0x0, 0x30, 0xfc03, 0xff01, 0xffe0, 0xff, 0xf00f, 0xfc7e, 0x1800, 0x0, 0x30, 0xfc27, 0xff03, 0xffc0, 0xff, 0xe03f, 0xfc7e, 0x1800, 0x0, 0x61, 0xfc3f, 0xfe03, 0xffc0, 0x1ff, 0xe03f, 0xfc7f, 0x800, 0x0, 0x61, 0xfc3f, 0xfe07, 0xffc0, 0x1ff, 0xe07f, 0xec3f, 0xc00, 0x0, 0x61, 0xf83f, 0xfc07, 0xff80, 0x1ff, 0xe07f, 0xe03f, 0xc00, 0x0, 0x61, 0xf87f, 0xf00f, 0xff80, 0x3ff, 0xc07f, 0xe03f, 0x400, 0x0, 0x61, 0xf87f, 0xf007, 0xff80, 0x3ff, 0xc07f, 0xe00f, 0x8600, 0x0, 0x61, 0xf87f, 0xe001, 0xff00, 0x3ff, 0xc0ff, 0xc00f, 0x8600, 0x0, 0x63, 0xf87f, 0xe001, 0xff00, 0x7ff, 0x80ff, 0xc00f, 0xc300, 0x0, 0x63, 0xf87f, 0xe003, 0xfe00, 0x7ff, 0x80ff, 0xc01f, 0xc700, 0x0, 0x63, 0xf07f, 0xe003, 0xff00, 0x7ff, 0x81ff, 0xc01f, 0xc700, 0x0, 0xe3, 0xf0ff, 0xc003, 0xffc0, 0x7ff, 0x81ff, 0xc01f, 0xc700, 0x0, 0xc3, 0xf0ff, 0xc003, 0xffc0, 0x4fff, 0x1ff, 0xc01f, 0xcf00, 0x0, 0xc3, 0xf0ff, 0xc007, 0xff80, 0x7fff, 0x1ff, 0x801f, 0x8f00, 0x0, 0xc7, 0xf0ff, 0xc007, 0xff80, 0xffff, 0x3ff, 0x801f, 0x8e00, 0x0, 0xc7, 0xf0ff, 0xc007, 0xff80, 0xffff, 0x3ff, 0x803f, 0x8e00, 0x0, 0xc7, 0xe0ff, 0x800f, 0xff81, 0xfffe, 0x3ff, 0x803f, 0x8e00, 0x0, 0xcf, 0xe1ff, 0x800f, 0xff01, 0xfff8, 0x3ff, 0x803f, 0x8e00, 0x0, 0x67, 0xe1ff, 0x800f, 0xff01, 0xfff0, 0x7ff, 0x803f, 0x9e00, 0x0, 0x67, 0xc1ff, 0x800f, 0xff03, 0xfff0, 0xff, 0x3f, 0x9e00, 0x0, 0x27, 0xc07f, 0x1f, 0xfe03, 0xffe0, 0xff, 0x3f, 0x9e00, 0x0, 0x33, 0xe07f, 0x1f, 0xfe07, 0xffe0, 0x1ff, 0x7f, 0x9e00, 0x0, 0x33, 0xe07f, 0x1f, 0xfe07, 0xffc0, 0x1ff, 0xc07f, 0x1e00, 0x0, 0x13, 0xe03f, 0xc01f, 0xfc07, 0xffc0, 0x3ff, 0x807f, 0x1e00, 0x0, 0x19, 0xe03f, 0xc13f, 0xfc0f, 0xff80, 0x3ff, 0x81ff, 0x3c00, 0x0, 0x19, 0xf03f, 0xc1ff, 0xfc0f, 0xff80, 0x7ff, 0x3ff, 0x3c00, 0x0, 0x19, 0xf03f, 0xc1ff, 0xfc0f, 0xff00, 0x7ff, 0x3fc, 0x3c00, 0x0, 0xd, 0xf03f, 0xc1ff, 0xf81f, 0xff00, 0xffe, 0x7f8, 0x3c00, 0x0, 0xc, 0xf03f, 0xc1ff, 0xc01f, 0xfe00, 0xffe, 0x7f8, 0x1c00, 0x0, 0xc, 0x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0xfe18, 0x0, 0x0, 0x0, 0x7ff, 0xf00f, 0xff00, 0x3f, 0xfff0, 0xe0c, 0x0, 0x0, 0x0, 0x7ff, 0xf000, 0x3e00, 0x7f, 0xfff0, 0x106, 0x0, 0x0, 0x0, 0xfff, 0xe000, 0xe00, 0x7f, 0xfff0, 0x1e3, 0x0, 0x0, 0x0, 0xfff, 0xe000, 0xe00, 0x7f, 0xfff0, 0x1ff, 0x8000, 0x0, 0x0, 0x1fff, 0xc000, 0x1fc0, 0xff, 0xfff0, 0xff, 0x0, 0x0, 0x0, 0x1fff, 0xc000, 0x1ffe, 0xff, 0xfff0, 0xff, 0x0, 0x0, 0x0, 0x3fff, 0x8000, 0x3fff, 0xc0ff, 0xfff0, 0xff, 0x8000, 0x0, 0x0, 0x7fff, 0x8000, 0x3fff, 0xf9ff, 0xfff0, 0xff, 0x8000, 0x0, 0x0, 0x7fff, 0x0, 0x7fff, 0xffff, 0xfff0, 0xff, 0x8000, 0x0, 0x0, 0xffff, 0x0, 0x7fff, 0xffbf, 0xfff0, 0xff, 0xc000, 0x0, 0x3c, 0xfffe, 0x0, 0xffff, 0xff80, 0xfff0, 0x7f, 0xc000, 0x0, 0x3f, 0x7ffe, 0x0, 0xffff, 0xff00, 0x3ff0, 0x7f, 0xc000, 0x0, 0x3f, 0xffc, 0x1, 0xffff, 0xff00, 0x7f0, 0x7f, 0xe000, 0x0, 0x3f, 0x3fc, 0x1, 0xffff, 0xff00, 0xf0, 0x7f, 0xe000, 0x0, 0x3f, 0x38, 0x3, 0xffff, 0xff00, 0x38, 0x7f, 0xe000, 0x0, 0x7e, 0x38, 0x3, 0xffff, 0xfe00, 0x3e, 0x7f, 0xf000, 0x0, 0x7e, 0x3f, 0xc007, 0xffff, 0xfe00, 0x7f, 0xf03f, 0xf000, 0x0, 0x7e, 0x3f, 0xf007, 0xffff, 0xfe00, 0x7f, 0xfc3f, 0xf000, 0x0, 0x7e, 0x7f, 0xfe0f, 0xffff, 0xfc00, 0x7f, 0xffff, 0xf800, 0x0, 0x7e, 0x7f, 0xffff, 0xffff, 0xfc00, 0x7f, 0xfff3, 0xf800, 0x0, 0x7e, 0x7f, 0xfffe, 0xffff, 0xfc00, 0xff, 0xfff0, 0x7800, 0x0, 0x7c, 0x7f, 0xfffe, 0x3fff, 0xf800, 0xff, 0xfff0, 0xc00, 0x0, 0x7c, 0x7f, 0xfffc, 0x7ff, 0xf800, 0xff, 0xffe0, 0x700, 0x0, 0x7c, 0x7f, 0xfffc, 0xff, 0xf800, 0x1ff, 0xffe0, 0x780, 0x0, 0xfc, 0xff, 0xfffc, 0x1f, 0xf800, 0x1ff, 0xffe0, 0x780, 0x0, 0xfc, 0xff, 0xfffc, 0x0, 0x7000, 0x1ff, 0xffe0, 0xf80, 0x0, 0xfc, 0xff, 0xfff8, 0x0, 0x7800, 0x1ff, 0xffe0, 0xf00, 0x0, 0xf8, 0xff, 0xfff8, 0x0, 0xff00, 0x3ff, 0xffe0, 0xf00, 0x0, 0x78, 0xff, 0xfff8, 0x0, 0xffe0, 0x3ff, 0xffc0, 0xf00, 0x0, 0x8, 0xff, 0xfff0, 0x1, 0xfff8, 0x3ff, 0xffc0, 0xf00, 0x0, 0xe, 0x1ff, 0xfff0, 0x1, 0xffff, 0x3ff, 0xffc0, 0xf00, 0x0, 0x7, 0xc1ff, 0xfff0, 0x1, 0xffff, 0xe7ff, 0xffc0, 0x1f00, 0x0, 0x7, 0xf9ff, 0xfff0, 0x3, 0xffff, 0xff7f, 0xffc0, 0x1e00, 0x0, 0x7, 0xffff, 0xffe0, 0x3, 0xffff, 0xff1f, 0xffc0, 0x1e00, 0x0, 0x3, 0xff8f, 0xffe0, 0x7, 0xffff, 0xfe03, 0xff80, 0x1e00, 0x0, 0x3, 0xff80, 0xffe0, 0x7, 0xffff, 0xfe00, 0x3f80, 0x1e00, 0x0, 0x3, 0xffc0, 0x1fe0, 0x7, 0xffff, 0xfc00, 0x780, 0x1e00, 0x0, 0x1, 0xffc0, 0x1c0, 0xf, 0xffff, 0xfc00, 0x180, 0x3e00, 0x0, 0x1, 0xffc0, 0x1e0, 0xf, 0xffff, 0xf800, 0x3e0, 0x3c00, 0x0, 0x1, 0xffc0, 0x1f8, 0xf, 0xffff, 0xf800, 0x3ff, 0x3c00, 0x0, 0x1, 0xffc0, 0x1ff, 0x1f, 0xffff, 0xf000, 0x7ff, 0xfc00, 0x0, 0x0, 0xffc0, 0x1ff, 0xfc1f, 0xffff, 0xf000, 0x7ff, 0xe000, 0x0, 0x0, 0xffe0, 0x1ff, 0xff3f, 0xffff, 0xf000, 0xfff, 0xc000, 0x0, 0x0, 0xffe0, 0x1ff, 0xffff, 0xffff, 0xe000, 0xfff, 0xc000, 0x0, 0x0, 0x7fe0, 0x1ff, 0xfffb, 0xffff, 0xe000, 0x1fff, 0x8000, 0x0, 0x0, 0x7fe0, 0x1ff, 0xfff8, 0x7fff, 0xc000, 0x1fff, 0x0, 0x0, 0x0, 0x7fe0, 0x1ff, 0xfff0, 0x3ff, 0xc000, 0x3fff, 0x0, 0x0, 0x3, 0xbfe0, 0x1ff, 0xfff0, 0x7f, 0x8000, 0x3ffe, 0x0, 0x0, 0x1, 0xe7f0, 0x1ff, 0xffe0, 0x1f, 0x8000, 0x7ffe, 0x0, 0x0, 0x0, 0xf1f0, 0x1ff, 0xffe0, 0x7, 0x0, 0x7ffc, 0x0, 0x0, 0x0, 0x7830, 0x1ff, 0xffe0, 0xf, 0xe000, 0xfff8, 0x0, 0x0, 0x0, 0x3c1e, 0x1ff, 0xffc0, 0xf, 0xf800, 0xfff8, 0x0, 0x0, 0x0, 0x1c1f, 0x81ff, 0xffc0, 0x1f, 0xffc1, 0xfff0, 0x0, 0x0, 0x0, 0xe0f, 0xf9ff, 0xff80, 0x3f, 0xfff1, 0xffe0, 0x0, 0x0, 0x0, 0x707, 0xffff, 0xff80, 0x3f, 0xffff, 0xffe0, 0x0, 0x0, 0x0, 0x787, 0xff9f, 0xff80, 0x7f, 0xfffe, 0x1fc0, 0x0, 0x0, 0x0, 0x3c3, 0xff81, 0xff00, 0xff, 0xfffc, 0x1c0, 0x0, 0x0, 0x0, 0x1e1, 0xffc0, 0x1f00, 0x1ff, 0xfff8, 0xc0, 0x0, 0x0, 0x0, 0xf1, 0xffc0, 0x600, 0x1ff, 0xffe0, 0x1f0, 0x0, 0x0, 0x0, 0x70, 0xffc0, 0x7c0, 0x3ff, 0xffc0, 0x7e0, 0x0, 0x0, 0x0, 0x38, 0xffc0, 0xff0, 0x7ff, 0xff80, 0xf80, 0x0, 0x0, 0x0, 0x1c, 0x7fc0, 0xfff, 0x7ff, 0xff00, 0x3f00, 0x0, 0x0, 0x0, 0x0, 0x3fc0, 0xfff, 0xffff, 0xfe00, 0x7c00, 0x0, 0x0, 0x0, 0x0, 0x7fe0, 0x1fff, 0xfcff, 0xfc00, 0xf800, 0x0, 0x0, 0x0, 0x0, 0x13e0, 0x1fff, 0xf83f, 0xf003, 0xe000, 0x0, 0x0, 0x0, 0x0, 0x460, 0x1fff, 0xe007, 0xe007, 0x8000, 0x0, 0x0, 0x0, 0x0, 0x110, 0x1fff, 0xc000, 0xc01f, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4e, 0x3fff, 0x8003, 0xf03c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x17, 0xfffe, 0xf, 0xfff8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5, 0xc3fc, 0x7f, 0xff80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xc038, 0x3ff, 0xfe00, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x87f8, 0xfff, 0xe000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7ff, 0x7ffe, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7, 0x8fe0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x600, 0x0, 0x0, 0x0, 0x0 }; static Uint8 *bitplanes_to_bitmap(const Uint16 *bit_data, int w, int h, int count_bitplanes) { /* Convert bitplanes to pixel data */ int count_pixels = w * h; SDL_assert(count_pixels % AMIGA_BITPLANES == 0); SDL_assert(count_bitplanes <= 8); Uint8 *pixel_data = SDL_calloc(1, count_pixels); int bit_index = 0; int bitplane; for (bitplane = 0; bitplane < count_bitplanes; bitplane++) { int pixel; for (pixel = 0; pixel < count_pixels;) { int i; Uint16 mask = 0x8000; Uint16 d = bit_data[bit_index]; for (i = 0; i < 16; i++) { pixel_data[pixel] |= (!!(d & mask)) << bitplane; mask >>= 1; pixel += 1; } bit_index += 1; } } return pixel_data; } /* Palette: 0 => background, 1 => shadow, 2:15 => ball */ static SDL_Color palette_colors[16]; static void cycle_palette(void) { int i; for (i = 0; i < 7; i++) { int p_i = 2 + (cycle_index + i) % 14; palette_colors[p_i].r = 0xff; palette_colors[p_i].g = 0; palette_colors[p_i].b = 0; palette_colors[p_i].a = SDL_ALPHA_OPAQUE; } for (i = 0; i < 7; i++) { int p_i = 2 + (7 + cycle_index + i) % 14; palette_colors[p_i].r = 0xff; palette_colors[p_i].g = 0xff; palette_colors[p_i].b = 0xff; palette_colors[p_i].a = SDL_ALPHA_OPAQUE; } cycle_index += 1; cycle_index %= 14; } int main(int argc, char *argv[]) { int i; Uint8 *pixels; Uint32 bg_color; enum { SCALE_NONE, SCALE_BEST, SCALE_LINEAR, SCALE_NEAREST, } scale_mode = SCALE_NONE; for (i = 1; i < argc; i++) { int consumed = -1; if (SDL_strcmp(argv[i], "--scale-none") == 0) { scale_mode = SCALE_NONE; consumed = 1; } else if (SDL_strcmp(argv[i], "--scale-best") == 0) { scale_mode = SCALE_BEST; consumed = 1; } else if (SDL_strcmp(argv[i], "--scale-linear") == 0) { scale_mode = SCALE_LINEAR; consumed = 1; } else if (SDL_strcmp(argv[i], "--scale-nearest") == 0) { scale_mode = SCALE_NEAREST; consumed = 1; } else if (SDL_strcmp(argv[i], "--help") == 0) { SDL_Log("Usage: %s [--scale-best] [--scale-linear] [--scale-nearest] [--scale-none]", argv[0]); return 0; } if (consumed < 0) { SDL_Log("Invalid argument"); return 1; } } pixels = bitplanes_to_bitmap(ball_bitplanes, WIDTH, HEIGHT, AMIGA_BITPLANES); SDL_COMPILE_TIME_ASSERT(size, SDL_arraysize(ball_bitplanes) * AMIGA_BITPLANES == WIDTH * HEIGHT); SDL_Window *window = SDL_CreateWindow("testpalette", 640, 480, SDL_WINDOW_RESIZABLE); SDL_Surface *window_surface = SDL_GetWindowSurface(window); SDL_Log("window pixelformat = %s", SDL_GetPixelFormatName(window_surface->format)); SDL_SetWindowSurfaceVSync(window, SDL_TRUE); bg_color = SDL_MapSurfaceRGB(window_surface, 0x30, 0x30, 0x30); SDL_Surface *ball_surface = SDL_CreateSurface(WIDTH, HEIGHT, SDL_PIXELFORMAT_INDEX4LSB); SDL_Palette *ball_palette = SDL_CreateSurfacePalette(ball_surface); for (i = 0; i < WIDTH * HEIGHT / 2; i++) { /* Pack 2 4-bit pixels into 1 byte */ ((Uint8*)ball_surface->pixels)[i] = pixels[2 * i + 0] << 0 | pixels[2 * i + 1] << 4; } SDL_free(pixels); #if 1 SDL_SetSurfaceColorKey(ball_surface, SDL_TRUE, 0); #endif /* 0: background */ palette_colors[0].r = 0x0; palette_colors[0].g = 0x0; palette_colors[0].b = 0x0; palette_colors[0].a = SDL_ALPHA_TRANSPARENT; /* 1: shadow */ palette_colors[1].r = 0x80; palette_colors[1].g = 0x80; palette_colors[1].b = 0x80; palette_colors[1].a = SDL_ALPHA_OPAQUE; cycle_palette(); SDL_SetPaletteColors(ball_palette, palette_colors, 0, 16); Uint64 next_switch = SDL_GetTicks() + ANIMATION_DELTA; SDL_bool quit = SDL_FALSE; while (!quit) { SDL_Event event; int r; if (SDL_GetTicks() >= next_switch) { next_switch = SDL_GetTicks() + ANIMATION_DELTA; cycle_palette(); SDL_SetPaletteColors(ball_palette, palette_colors + 2, 2, 14); } while (SDL_PollEvent(&event)) { if (event.type == SDL_EVENT_QUIT) { quit = SDL_TRUE; } else if (event.type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { window_surface = SDL_GetWindowSurface(window); } else if (event.type == SDL_EVENT_KEY_DOWN) { if (event.key.scancode == SDL_SCANCODE_ESCAPE) { quit = SDL_TRUE; } } } SDL_FillSurfaceRect(window_surface, NULL, bg_color); switch (scale_mode) { case SCALE_NONE: /* Works, but does not scale ball */ r = SDL_BlitSurface(ball_surface, NULL, window_surface, NULL); break; case SCALE_LINEAR: /* Does not work: black window */ r = SDL_BlitSurfaceScaled(ball_surface, NULL, window_surface, NULL, SDL_SCALEMODE_LINEAR); break; case SCALE_BEST: /* Does not work: black window */ r = SDL_BlitSurfaceScaled(ball_surface, NULL, window_surface, NULL, SDL_SCALEMODE_BEST); break; case SCALE_NEAREST: /* Does not work: returns error code (lots of console spam) */ r = SDL_BlitSurfaceScaled(ball_surface, NULL, window_surface, NULL, SDL_SCALEMODE_NEAREST); break; } if (r < 0) { SDL_Log("%d (%s)", r, SDL_GetError()); } SDL_UpdateWindowSurface(window); } SDL_DestroyWindow(window); SDL_DestroySurface(ball_surface); SDL_Quit(); return 0; }