// C Header File // Created 6/6/2003; 3:47:38 PM unsigned long tiles[2][480] = {{ // tile 0 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000001,0x00000005,0x0000001f,0x0000003e,0x0000003f, 0x000001fc,0x000003f9,0x00007f82,0x0003feaf,0x0011e3d8,0x000e8015,0x00560c00,0x00f96084,0x01ed0170,0x1f0c4275, 0x7cd7bfae,0x98424d12,0x2c1134e8,0x4604d4b3,0x53f7e95f,0x213c632f,0xd0e102bf,0x0250873f,0x00704478,0x6c702e7a, 0x60613da1,0x676f71d8, // tile 1 0x000403f9,0x00a200b9,0x07c847fb,0x0ec26f79,0x3f41fff6,0xb1003ff4,0xe3401fcc,0xcc400fc8,0x1dc007c8,0x36000110, 0xed8000b0,0xbbc00060,0xff800000,0xe7800000,0x73406800,0x2240b800,0x00040043,0x9200acc2,0xee811991,0xf4b42000, 0xa58b4021,0xef955d03,0xefffa807,0x9fffd870,0xcffb9080,0xb7fd0113,0x8b09c41b,0x0600033c,0x88006dff,0x0400d669, 0x180230f7,0x900376fe, // tile 2 0x9195c000,0x98ebe000,0x2010e000,0x236ff000,0x02fbf000,0x04f3d000,0x0683d401,0x0926d401,0x19ead401,0x1af6c001, 0x17f68001,0x27fc8003,0x4ffda004,0x93fd1000,0xb7fe0011,0x07ffa8c2,0x01fed624,0x907c1108,0xfe3fc00c,0x6607502c, 0x6c80d53c,0xd8002a02,0xf0003deb,0x00000000,0x43eb1bbb,0xafb8d404,0x13bffbd8,0x7411d511,0xc9f6c3df,0xc5e0f67f, 0xc5fb7c1f,0x6de3c93f, // tile 3 0x00000000,0x00000000,0x00000000,0x00000000,0xe0007000,0xe0003800,0xf003c000,0xf0000000,0xf1000000,0xf1000000, 0x1101e408,0x000be3f8,0x28044a90,0x0009b620,0x57406840,0x10260400,0x822d52ca,0x6c5f40dd,0x28003cdc,0x262d44dd, 0x8a5cfa8e,0x3804022c,0x60ad5004,0xc000e08c,0x27bc1c8b,0xc000236e,0x671e027a,0xf9044cb8,0x783f977f,0xf87d417e, 0xf8461f3c,0xfb9e107a, // tile 4 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00018000,0x0003c000,0x0003c000, 0x0003c000,0x00038000,0x21250000,0x91380000,0xa40a8000,0x42f60000,0x48340000,0x23100000,0x8d620000,0x42400000, 0xf7800000,0x02000000,0x8b200000,0x00d00000,0xef100000,0xc1a00000,0x216001f0,0xd04001f0,0x5ab001f0,0x20f00180, 0x40f00180,0x81b00180, // tile 3 0x602fa3dc,0x626fbb84,0xf97b1372,0x292a9ac1,0x36b3c82c,0x373e0a02,0x3484178c,0x3783114c,0x3781c248,0x2709e3a0, 0x2a80a2d8,0x2a84ac7a,0x2b84efd3,0x2382cf80,0x21e2d7f8,0x1f4277ff,0x1f9ab007,0x0c24d800,0x15e33400,0x17423fff, 0x07667bfc,0x0766faa1,0x07f37e00,0x06f67e01,0x06f27e0f,0x04fb7e0e,0x01c1be86,0x03692e07,0x01e4de29,0x01bcc597, 0x0136f253,0x014ec06d, // tile 4 0x60c831b0,0x4e1411e4,0xc96a5af8,0x4a28cada,0x00e5f7b0,0x01c317a3,0x00b5c302,0x00231311,0x000b1691,0xc63cb411, 0x49fbfc01,0xa7a5fc01,0x0546f801,0x4d18f011,0x1f81e0fd,0x1883c7f9,0x3047c401,0x329bc0ef,0x44b72007,0xcb7f7ff1, 0x046741f1,0x8b1e4075,0xf63e5005,0x153f5805,0x777d0707,0xfefdc705,0x4b70c005,0x4df4c104,0x85f62004,0x81e6e12b, 0x1be4c095,0x87c00d65, // tile 5 0x9de9513f,0x4de9e67f,0xc1f9e25f,0x8dfee01f,0xfbf2771f,0x21f5f4ff,0x13c774ff,0x9bc1b13f,0x9353103f,0xfa8b026d, 0x921e0079,0x3af61437,0x3403111f,0x2672a07f,0x4beee03b,0x49c8c03a,0x21cfc43f,0xe1f7e059,0xd7e1e33d,0x2de763bc, 0x05fa6010,0x1feac0d0,0x31ec47b4,0x9bffc2d0,0xc1f46435,0x7de0e0b0,0x1bf5e000,0xc7c450b8,0x23620864,0x90821639, 0x06c3d040,0xefffffff, // tile 6 0xf8545192,0xf87c0001,0xfa2520e1,0xfd0406c9,0xf8144023,0xf80458e0,0xf80c5072,0xf88ed032,0xf9b6d026,0xf85494c4, 0xf828d114,0xf42ec476,0xf9dc4879,0xa1a64818,0xb8d61198,0xd88e12fc,0xe8749069,0x78769033,0x109413ae,0x106445bd, 0xa90604db,0x280e666b,0x68c60266,0x28241363,0x290459f2,0x40063bde,0x68066174,0x380e0b24,0x28c5da31,0xd3155420, 0x7a13e1c6,0xffff77fb, // tile 7 0x80b40080,0x20780080,0xe0780000,0x00f80000,0x20b80000,0xa02c0000,0x20780000,0xa8480000,0x64340000,0x4c340000, 0x403e0000,0x407e0000,0x00360000,0xc0d50000,0xaf0b0000,0x881a0000,0x0d0e0000,0x442b0000,0xb2578000,0x4d058000, 0x04578030,0x008d8030,0x70078000,0x00038000,0x8883c000,0xb843e000,0xfa06c000,0xfe13c000,0xf8b46000,0x42342000, 0x24109800,0xb7ffe800, // tile 6 0x00f67d0c,0x00ce3443,0x00374c40,0x00397e62,0x00797e45,0x001cf6d9,0x0008b5e0,0x00047cc8,0x00834be2,0x000cc547, 0x0003b7ff,0x00030b9f,0x0007af3f,0x000f107f,0x000ee6b7,0x000fa5bf,0x000f0b7f,0x000e59bf,0x009cd28f,0x004aa6d5, 0x800014cf,0x80620a86,0x800409b1,0x0004b76d,0x00c012fc,0x00c10dfe,0x07004bff,0x06100b81,0x0510b780,0x0401b800, 0x18412400,0x00000000, // tile 7 0x77c302de,0x9fd305a7,0x9bed872f,0x3d000aff,0xfe41ed6f,0x50b9825f,0x4937c1bf,0x07d00c7f,0x259c217f,0x045a21df, 0xfffe8fff,0xfffffffe,0xfffffffe,0xfffffffe,0xfffffffe,0xfffffffc,0xfffffffb,0x00406676,0x9c0016e4,0x004787d9, 0x40103ee0,0x603007c0,0x80193f80,0x50173980,0xa020f400,0x3366ca00,0x9c1d7c00,0xdaa3e400,0x1ddd8000,0x0f3a4000, 0x03cc4000,0x00000000, // tile 8 0xffed7fef,0xff587fff,0xff200500,0xff000000,0xbe800000,0x22000000,0x6e000000,0xbf000000,0xd2000000,0x66000000, 0x3a000000,0x58000000,0xd8000000,0xe0000000,0xd0000000,0xc0000000,0x00000000,0x40000000,0x00100000,0x00100000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000100,0x00000100,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000, // tile 9 0x8117e1a7,0xf3ffae7c,0x0040a040,0x00004000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000002,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000, // tile 10 0x62384000,0x8e470200,0x82000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000,0x00000000,0x00000000,0x00000100,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x80000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000, 0x00000000,0x00000000, }, // ---- plane 2 ---- { // tile 0 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xfffffffe,0xfffffffa,0xffffffe0,0xffffffc0,0xffffffc0, 0xfffffe03,0xfffffc06,0xffff806d,0xfffc0148,0xffee1c77,0xfff07f80,0xffa1f380,0xff079f7b,0xfe1efe8c,0xe0f3bd82, 0x83b2c651,0x77bd3ea9,0x9beeff17,0x8dfbff4f,0x838fdea7,0xc0ff9cdf,0x107fbd5f,0xc06f38ff,0xc06f3bff,0x806f71f4, 0x807e67fc,0x80742ff2, // tile 1 0xfffbfc00,0xff4dff40,0xf847b801,0xf1419083,0xc1400002,0x4ec04006,0x1c400024,0x32400008,0xe2400018,0xc9c00010, 0x12400030,0x44400020,0x00400000,0x20404000,0xf4407000,0x90000800,0x00000001,0x6c784003,0x01020007,0x00000227, 0x5a74b48f,0xffffe04f,0xffffc25f,0xffff8220,0xffff4530,0xffff443c,0xb704287e,0x1a0198ff,0x560312be,0xbc03217e, 0x6804a1fe,0x70044bff, // tile 2 0xc30e3fff,0x91141fff,0x117a1fff,0x13180fff,0x03f80fff,0x06cc2fff,0x04042bff,0x0c052bff,0x08052bff,0x10093fff, 0x30097fff,0x20037fff,0x40027fff,0xc002efff,0x0001ffff,0x0000577f,0x00010049,0x6c03e66d,0xfe003769,0xfe00a641, 0xfc002241,0xf80015ff,0xf0004214,0x00000001,0x04108043,0x90476bff,0x6040642c,0x0bfa5ada,0x03f94c30,0x13ff4990, 0x3bfc43f0,0x23fc46d0, // tile 3 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xeffdffff,0x6ce11251,0xeecf3b5d,0xeedd555d,0xe8c53651, 0x60a106d3,0xdffffdff,0x9f52affb,0x20001f70,0x50000374,0x3fffdc93,0x88e1fd81,0x06ffbe45,0x83c76e00,0x0384bf80, 0x03bcf180,0x00646f80, // tile 4 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xff5fffff,0xd35fffff,0xb97fffff,0xb93fffff,0x9b7fffff, 0x4a7fffff,0xfdffffff,0x74dfffff,0x010fffff,0x114fffff,0xff5fffff,0xdf9fffff,0xbfbfffff,0x2d8fffff,0x7f8fffff, 0x7f8fffff,0x7ecfffff, // tile 3 0x86743b80,0x80349309,0x00349723,0xc0350a36,0xc03a53db,0xc01963fe,0xc00fa476,0xc003c6bc,0xc001b5b8,0xd0049c50, 0xd000dd27,0xd002d385,0xd000d02c,0xd8b0d07f,0xd800c807,0xe0004800,0xe0004ff8,0xf08087ff,0xe8010bff,0xe8064000, 0xf8060403,0xf806055f,0xf80601ff,0xf80301fe,0xf80301f0,0xfa0301f1,0xfe0b0179,0xfc1191f9,0xfe198194,0xfe00da6d, 0xfe80ccab,0xfe906d92, // tile 4 0xb004cbf9,0xfffbc7f1,0x4e9187e7,0x85572fe1,0x031e1fcd,0x012cbfde,0x00c03fff,0x00d87fee,0x01a4fc6e,0x39d2fcee, 0xfe04fffe,0x5879fbfe,0xfafbfffe,0xb2c7ffee,0xe19fff02,0xe73ff806,0xce6ffbfe,0xcdcffffe,0xbb7fdffe,0x369f800e, 0xffbfbe0e,0x7dffbf8e,0x19ffeffe,0xfafee7fe,0xb6fef8fe,0x277e38fe,0xedff3ffe,0xdbfb3fff,0xbff9dfdc,0x7ff91fd9, 0x6ffb3f72,0xfffffee7, // tile 5 0x63e6ced0,0x93e64990,0x2fe64db0,0x73e14ff0,0x07f7c8f0,0x5be64b10,0xa5edcb10,0x67cf4ed0,0x4a9f0fd0,0x04370d90, 0x69e70fb2,0x950f0bd0,0xebfe0ef0,0xdbce4f90,0xb7d64fd0,0xb7f64fd0,0xdff64bd0,0x1fee4ff0,0x2bfe4cd0,0xdffccdd0, 0x7bfdcff0,0xe3fd4f30,0x8ffbc8d0,0x63f84f30,0x3ffbcbd0,0x87ff4fd1,0xe7fa4ff1,0x3bfbcf53,0xdd9dc7bb,0x6e7fd9cf, 0xf93c2fbf,0xffffffff, // tile 6 0x03ec2ec0,0x03943fc0,0x01dc1f40,0x02fc1960,0x03ec1fe0,0x03fc07a3,0x03f40fa1,0x03740fe5,0x02dc0ff1,0x03ac0bb3, 0x03d60fe3,0x03b40fa7,0x036c07b6,0x1adc07f7,0x1b2c0ff7,0x3b740db7,0x1b9c0fb7,0x1bac0fee,0x7b6c0cf5,0x7b9c1f6b, 0x5afc1f6f,0xdbf419df,0xdb3c3fdb,0xdbfc3ede,0xdafc36de,0xfbfc2fb2,0x9bfc3fae,0xdbf4765c,0xd93bac6e,0x72ee70df, 0x85ffe13d,0xffff8fff, // tile 7 0x7fcbffff,0xdfc7ffff,0xdfc7ffff,0xff47ffff,0xff67ffff,0xffe3ffff,0xffa7ffff,0x77b7ffff,0xfff3ffff,0xc7f3ffff, 0xcfd1ffff,0xcfd1ffff,0xcfd9ffff,0x8fbaffff,0xc2f8ffff,0x77e9ffff,0xfff9ffff,0xfbfcffff,0xffec7fff,0xb7fc7fff, 0x03bc7fff,0x03f67fff,0x03fe7fff,0x03fe7fff,0x03fe3fff,0x03be1fff,0x01fb3fff,0x01ff3fff,0x007b9fff,0xb1cfdfff, 0xc3ff6fff,0xcffff7ff, // tile 6 0xff0972f6,0xff2133bd,0xffc883bf,0xffc681b9,0xff8681de,0xffe30966,0xfff34abd,0xfff983f7,0xfffcb45d,0xfff27bba, 0xfffc2fff,0xfffc343f,0xfff818bf,0xfff05fbf,0xfff0177f,0xfff0237f,0xfff061ff,0xfff040ff,0xffe08060,0xffb0807b, 0xfff10184,0xff920183,0xffe20303,0xffe40300,0xff040602,0xff082601,0xf8880c00,0xf9105c7e,0xfa00187f,0xfa2033ff, 0xe40073ff,0xffffffff, // tile 7 0x9ffffdcf,0xfffffb9d,0x7f927f3f,0xff007e6f,0xfffffcdf,0x8000019f,0xa448225f,0xffefffff,0xda33dbbf,0xfbedfe3f, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xfffffffe,0xfffffffc,0xffbffff9,0x63fffe73,0xffffffe6, 0xffffff1f,0x9ffffe3f,0xfffffc7f,0xeffffc7f,0x7ffff3ff,0x3eb7e5ff,0x4fff83ff,0x277e1bff,0xe3bc7fff,0xf0f5bfff, 0xfc33bfff,0xffffffff, // tile 8 0xffc28010,0xff838000,0xff9ffaff,0xff7fffff,0xff7fffff,0xfeffffff,0xfdffffff,0xf8ffffff,0xb9ffffff,0xf1ffffff, 0xe5ffffff,0xe7ffffff,0xc7ffffff,0x9fffffff,0x2fffffff,0x3fffffff,0xffffffff,0xbfffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff, // tile 9 0x76e81ed8,0x08005103,0xffff5fbf,0xffffbfff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff, // tile 10 0x9dc7bfff,0x71b8ffff,0x7fffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xffffffff, }}; void intro() { int x,y; int tilewidth = 32; int tileheight = 32; int vcount = 3; int hcount = 5; int i; if (!GrayMode(GRAY_ON)) return; memset(GetPlane(0),0,LCD_SIZE); memset(GetPlane(1),0,LCD_SIZE); for (y=0;y short _ti92plus; short _ti89; //----------------------------------------------------------------------------- // in this tutorial I use a blackwhite bitmap of 160x100 pixels (uncompressed) // as background (converted using ImageStudio and TTBin2Hex) //----------------------------------------------------------------------------- unsigned long data[] = { 0xffffffff,0xffffffff,0xffffffff,0xfffffff6,0xfdffffff,0xffffffff,0xffffffff,0xffffffff, 0xffffffff,0xad7fffff,0xffffffff,0xffffffff,0xffffffff,0xfffff873,0xffffffff,0xffffffff, 0xffffffff,0xffffffff,0xfffff00b,0xfedfffff,0xffffffff,0xffffffff,0xffffffff,0xffffe024, 0xffdfffff,0xffffffff,0xffffffff,0xffffffff,0xffff9cd0,0xac87ffff,0xffffffff,0xffffffff, 0xffffffff,0xfffff27e,0x60e1ffff,0xffffffff,0xffffffff,0xffffffff,0xffffe66b,0x1388ffff, 0xffffffff,0xffffffff,0xfffffeff,0xffffa269,0xe1fd4fff,0xffffffff,0xffffffff,0xfffffeff, 0xffff71d8,0x60c99fff,0xffffffff,0xffffffff,0xffffffff,0xfffe1e55,0x98768fff,0xffffffff, 0xffffffff,0xffffffff,0xfffe8919,0x187713ff,0xffffffff,0xffffffff,0xffffffff,0xffff7fcd, 0x687fc3ff,0xffffffff,0xffffffff,0xfffffffe,0xffffbf9b,0x80ee41ff,0xffffffff,0xffffffff, 0xffffffff,0xffffa1da,0xc01088ff,0xffffffff,0xffffffff,0xffffffff,0xfffffa76,0xc0700dff, 0xffffffff,0xffffffff,0xffffffff,0xfffffbf3,0x007013ff,0xffffffff,0xffffffff,0xffffffff, 0xffffff90,0x001035ff,0xffffffff,0xffffffff,0xffffffff,0xffffdf41,0x400046ff,0xffffffff, 0xffffffff,0xffffffff,0xffffff97,0xc00043ff,0xffffffff,0xffffffff,0xffffffff,0xffffe97b, 0x00022dff,0xffffffff,0xffffffff,0xffffffff,0xffffe262,0x580187b7,0xffffffff,0xffffffff, 0xffffffff,0xfffffede,0x700121b7,0xffffffff,0xffffffff,0xffffffff,0xfffff99d,0xf8a2cd7f, 0xffffffff,0xffffffff,0xffffffff,0xfffff2b8,0xcb7a3cdf,0xffffffff,0xffaeffff,0xffffffff, 0xfffffef8,0x1f72165b,0xffffffff,0xff063fff,0xffffffff,0xffffffe6,0x6372737f,0xffffffff, 0xfce667ff,0xffffffff,0xfffffebb,0xb020c1bf,0xffffffff,0xf20007ff,0xffffffff,0xf7fffc8a, 0xb723795f,0xffffffff,0xf80001ff,0xffffffff,0xffffffc3,0xf783ff07,0xffffffff,0xd800007f, 0xffffffff,0xfffffef3,0xff62e74b,0xffffffff,0x900000f0,0x01ffffff,0xffffffde,0x381acecf, 0xfffffffd,0x80000080,0x0027ffff,0xffffffff,0x9015246f,0xfffffffe,0x2000010f,0x8001ffff, 0xffffffff,0xe2e5d9e3,0xfffffffa,0xc000020f,0xffac2fff,0xffffffff,0x9f140fa3,0xffffffff, 0x0000003f,0xffffc5ff,0xffffffff,0xffb03ff7,0xfffffffd,0x800000ff,0xfffff07f,0xffffffff, 0xfe03fff7,0xffffffff,0x000003ff,0xfffffa3f,0xffffffff,0xfccffff7,0xfffffffd,0x80001fff, 0xffffff07,0xffffffff,0xfe79fff7,0xfffffffd,0x8000ffff,0xffffffa7,0xffffffff,0xfffffff7, 0xffffffff,0x8001ffff,0xfffffff9,0xffffffff,0xffffffdf,0xfffffffe,0x8007ffff,0xfffffffc, 0x7fffffff,0xffffffff,0xfffffffe,0x017fffff,0xffffffff,0x3fffffff,0xfffffffe,0xfffffffe, 0x07ffffff,0xffffffff,0x9fffffff,0xfffffffe,0xfffffffc,0x3fffffff,0xffffffff,0xc7ffffff, 0xffffffff,0xffffffb4,0x7fffffff,0xffffffff,0xc3fffeff,0xfffffffe,0xfffffff8,0xffffffff, 0xffffffff,0xf1ffffff,0xffffffff,0xffffffe0,0xffffffff,0xffffffff,0xf9ffffff,0xffffffff, 0xfffffee1,0xffffffff,0xffffffff,0xfcffffff,0xffffffff,0xffffffc3,0xffffffff,0xffffffff, 0xfcfffffe,0xffff7f7f,0xfffffd87,0xffffffff,0xffffffff,0xff3fffff,0xffffffff,0x3fffff9f, 0xffffffff,0xffffffff,0xff1fffff,0xffffffff,0xbffffb9f,0xffffffff,0xffffffff,0xff9fffff, 0xffffffff,0x9fffff3f,0xffffffff,0xffffffff,0xffcfffff,0xffffffff,0x97fffe7f,0xffffffff, 0xffffffff,0xffcfffff,0xffffffff,0xc7fffe3f,0xffffffff,0xffffffff,0xffcfffff,0xefffffff, 0xc7fffc7f,0xffffffff,0xffffffff,0xffe7ffff,0xefffffff,0x90fffcff,0xffffffff,0xffffffff, 0xffe3ffff,0xffffffff,0x887ffc7f,0xffffffff,0xffffffff,0xfff3ffff,0xffffffff,0xc83ffdff, 0xffffffff,0xffffffff,0xfff3ffff,0xffffffff,0x46cff9ff,0xffffffff,0xffffffff,0xfff9ffff, 0xffffffff,0x467ff9ff,0xffffffff,0xffffffff,0xfffdffff,0xffffffff,0x637ff1ff,0xffffffff, 0xffffffff,0xfff8ffff,0xffffffff,0xf3c7f3ff,0xffffffff,0xffffffff,0xfffcffff,0xffffffff, 0xb3e7f1ff,0xffffffff,0xffffffff,0xfffa7fff,0x67f9d1cf,0x11fbf3ff,0xffffffff,0xffffffff, 0xffed3ffe,0xdff091ef,0x19f9f5ff,0xffffffff,0xffffffff,0xffc9bffe,0xd7f273ff,0x98c1f5ff, 0xfff7ffff,0xfffff9df,0xffd9dffc,0xcff7c1ff,0x98fcbd83,0xc5240b20,0x3cd26215,0x1db9f470, 0x97e1bcff,0xa97cf981,0xb62c90c8,0x1b87a3e0,0x0631f0e1,0x27e1fefe,0x7cce2126,0x890e3692, 0x6ca11c63,0xee33f606,0x2fe5efc1,0xfca50b36,0x5c0bee37,0x6fa67cab,0x9ca4c176,0x2ff1ffd9, 0xecc1d5c9,0xfce7cff0,0x201bc3aa,0x324c0ffc,0x6ff5ffaa,0xf8ab75c6,0x907f97af,0xefc9c3e1, 0x7e70137d,0xa635ff98,0x78c13967,0x0d97b785,0xbffed829,0xc2cfde38,0xfa21ff39,0xf87d517e, 0x7b7777ca,0x3fff88cc,0x783fde30,0xf2c1ffb9,0xfe6d16e3,0x3dbffaff,0x9fff29c3,0x9201de71, 0xf671ff1d,0xea6f17d6,0xb9bf7ca4,0x8ffff7da,0x80045bff,0xe561fe36,0xfa4d85ac,0xfbfffe60, 0x1ffffff9,0xac17e91f,0xcbe7ff3d,0xfdbdcfc4,0xf5e7ff3c,0x2ffffffb,0xb81fd8ce,0x486fff77, 0xf8874ee8,0x73ffffd9,0xefffffff,0xeb5f88dc,0x9aefff1f,0xfb67cb19,0x22f7ffdb,0x1fffffff, 0xf7ff9cf0,0xb4efff5f,0xfe47ed71,0x41f3ffea,0x1fe0ffff,0xfffffc19,0xa78cff1f,0xfe778d17, 0xd9fb8fed,0xdf187fff,0xfffffa71,0xcffdff1f,0xff678d10,0x33fe77fe,0xdd4e6e3f,0xfffffc05, 0x4cf1ff5f,0xfef7cb84,0xe7fe7bfb,0x3c4fe01f,0xfffffac4,0x5e01cf1f,0xffffa994,0x81fe7ffb, 0xf31fc9b2,0x1ffffe85,0xc80bcf3f,0xffbfae47,0x0ffe79f0,0x274f53f0,0x21fffe94,0x1201c71f, 0xff87afcf,0x5bfcfc18,0x678f0f71,0xec3ffff9,0x40c1037f,0xff9b85cf,0x37fcfef3,0xa72b71f0, 0x501fffb3,0xf47718f0,0xff11d74e,0xeff97ffb,0xecf5e0fe,0x33dfffbb,0xf0ef7400,0xff198f82, 0x7ff47d6f,0xfc3d067f,0x9b5ffff3,0xf3fe7c7f,0xff98e7cf,0xefe57f6f,0xc1bbffef,0xb0c2fffb, 0xf2fefd6f,0xff99ef98,0x5eefbf7f,0x9bdfffc0,0x24f23ff9,0xf0fe0f0f,0xffa8efa5,0x8dffffbe, 0x50ffffe0,0x41f4e1fb,0xf7ff731f,0xfffcffa9,0xd8fffe60,0x56ffffff,0x4ff0f83b,0xf7ff7b7f, 0xffbc6f87,0xfb7e22a0,0x06ffffff,0x5c26921f,0xffffffff,0xffeeffc7,0x9ff060fd,0x4fffffff, 0x7060725f,0xffffffff,0xff78ff9f,0xc7f044f4,0xc1ffffff,0xf1479b5f,0xffffffff,0xfff8ffaf, 0xc7ff8ef4,0xa1fffffc,0x7f8eb8ef,0xffffffff,}; unsigned long* textplane = NULL; // the pointer to the allocated textplane // goes here ... #define ADDITIONALLY_LINES 8 // the textplane is oversized, so no // clipping is necessary #define LINES_TO_SCROLL 1 // how much lines gets scrolled each time INT_HANDLER save_int_1 = NULL; // used to save the old interrupt 1 handler volatile unsigned short counter = 0; // counter used for delay //============================================================================= // our own interrupt 1 handler which only increments the counter and calls // the old interrupt 1 handler afterwards //============================================================================= DEFINE_INT_HANDLER (my_int_1_handler) { counter++; ExecuteHandler(save_int_1); } //============================================================================= // allocates space for textplane and installs own interrupt handler //============================================================================= short InitScroller() { if (!(textplane = (unsigned long*)malloc(20*(100+ADDITIONALLY_LINES)))) { return 0; } // install our own interrupt 1 handler for synchronization and delay save_int_1 = GetIntVec(AUTO_INT_1); counter = 0; SetIntVec(AUTO_INT_1, my_int_1_handler); return 1; } //============================================================================= // frees allocated space again and re-installs own interrupt handler //============================================================================= void CleanupScroller() { if (textplane) { free(textplane); textplane = NULL; SetIntVec(AUTO_INT_1,save_int_1); } PortRestore(); } //============================================================================= // Blits background planes to grayplanes (combining them with the textplane) //============================================================================= void BlitPage(short offset) { unsigned long* backplane_0 = data; unsigned long* tmptext = textplane; unsigned long* p0 = (unsigned long*)((unsigned char*)GetPlane(0)+offset); unsigned long* p1 = (unsigned long*)((unsigned char*)GetPlane(1)+offset); short i; // NOTE: the lightplane is not taken from the image, but filled // with black (0xffffffff). otherwise the white text wouldn't // be readable anymore. // // (The textplane contains white text on black background) // loop once for each line to copy ... for (i=0;i<100;i++) { *p0++ = *(backplane_0++) & ((*tmptext)); *p1++ = 0xffffffff & ((*tmptext++)); *p0++ = *(backplane_0++) & ((*tmptext)); *p1++ = 0xffffffff & ((*tmptext++)); *p0++ = *(backplane_0++) & ((*tmptext)); *p1++ = 0xffffffff & ((*tmptext++)); *p0++ = *(backplane_0++) & ((*tmptext)); *p1++ = 0xffffffff & ((*tmptext++)); *p0++ = *(backplane_0++) & ((*tmptext)); *p1++ = 0xffffffff & ((*tmptext++)); ((unsigned char*)p0)+=10; ((unsigned char*)p1)+=10; } } //============================================================================= // the text which will be scrolled (the number of strings within this array // will be evaluated by searching the terminating NULL) //============================================================================= char* demotext[] = { "TICT-Tutorial S1P6","", "How to write a simple", "Grayscale Text Scroller", "with a Background Image","using","the TIGCC Environment","", "TiCT (c) 19/02/2001","","http://tict.ticalc.org","","","Greetings to Everyone", "Especially my Beta-Testers","","","You can modify the","Scrolling Speed with", "the [+] and [-] Keys.", "","To pause the Scrolling","press [F1].","", "I know that the Text","flickers.","The Program synchronizes", "to the Interrupt 1, so it","is in Principle in Sync","with the Grayscale", "Routine, but it cannot","synchronize to the","Grayscale Pageflip", "Frequency, because it","have no Access to the","necessary Counter.","", "Additionally the Phasing","Effect which is a","Principle Problem of the", "Grayscale Support","comes into Play.","For a short period of", "Time the two Grayplanes","are displayed with an", "Line Offset of 1, although","the data is already stored","in the Planes.","", "","Have a nice Day, Tom","","Credits for the", "Background GFX go to:","","The Developers of","the GENESIS Game","","* * * * *", "Phantasy Star III (tm)","* * * * *","","","","","", NULL }; //============================================================================= // the scrolling routine itself //============================================================================= void ProcessTextScrolling() { short nr_lines = 0; short actline = 0; short i = 9; unsigned short waitnr = 28; short offset = (TI89) ? 0 : 4+30*12; // for the TI92p we center the image short leave = 0; unsigned long* src; unsigned long* dest; short loop; while (demotext[nr_lines++]); // evalute number of lines in demo text // initialize all graphic functions to use our invisible textplane PortSet(textplane,159,99+ADDITIONALLY_LINES); // fill textplane with black memset(textplane,0xff,20*(100+ADDITIONALLY_LINES)); // fill grayplane 0 and 1 with white memset(GetPlane(0),0,LCD_SIZE); memset(GetPlane(1),0,LCD_SIZE); // loop until the user gets bored ... do { dest = textplane; src = &textplane[LINES_TO_SCROLL*5]; // scrolling up the invisible textplane is performed by // a kind of memmove ... for (loop=0;loop<(100+ADDITIONALLY_LINES-LINES_TO_SCROLL)*5;loop++) *dest++ = *src++; // fill part below the last "visible" line with blacks if (i>=7) { memset(&textplane[100*5],0xff,ADDITIONALLY_LINES*20); } // it's time to print the next line to the part below the last // "visible" line ... if (i==9) { i = 0; memset(&textplane[100*5],0xff,ADDITIONALLY_LINES*20); // draw the string centered DrawStr((160-DrawStrWidth(demotext[actline],F_6x8))>>1,100,demotext[actline],A_REVERSE); actline++; if (actline==nr_lines) actline = 0; } else { i+=LINES_TO_SCROLL; } // perform a page blit (combines background planes // with textplane and copy the result to the grayplanes) //BlitPage(offset); // wait a little bit ... while (counter < waitnr); BlitPage(offset); counter=0; // process a key press ... if (kbhit()) { leave = ngetchx(); if (leave == '+') { if (waitnr) waitnr--; leave = 0; } else if (leave == '-') { if (waitnr < 199) waitnr++; leave = 0; } else if (leave == KEY_F1) { ngetchx(); leave = 0; } } } while (!leave); } //============================================================================= // where all the fun starts ... //============================================================================= void _main(void) { if (!InitScroller()) { ST_showHelp("error: out of mem"); return; } if (!GrayMode(GRAY_ON)) { CleanupScroller(); return; } FontSetSys(F_6x8); ProcessTextScrolling(); GrayMode(GRAY_OFF); CleanupScroller(); }