home *** CD-ROM | disk | FTP | other *** search
- /* eshot.c */
-
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <sys/iocs.h>
- #include "XSP2lib.H"
-
- #define PCG_MAX 32 /* パターンデータの個数 */
-
- static char pcg_alt[PCG_MAX + 1]; /* PCG配置管理テーブル */
- static char pcg_dat[PCG_MAX * 128]; /* PCGデータファイル読み込みバッファ */
-
- static unsigned short pal_dat[16][15]; /* パレットデータ */
-
-
- int main (int argc, char *argv[])
- {
- FILE *fp;
- int i, j;
-
- _iocs_crtmod (10); /* 256x256ドット グラフィック画面 256色 2画面 */
- _iocs_sp_init (); /* スプライトの初期化 */
- _iocs_sp_on ();
-
- /* pcg_dat にパターンデータを読み込む */
- fp = fopen ("ESHOT.SP", "rb");
- fread (pcg_dat, sizeof (char), PCG_MAX * 128, fp);
- fclose (fp);
-
-
- /* pal_buf に一旦パレットデータを読み込む */
- fp = fopen ("ESHOT.PAL", "rb");
- fread (pal_dat, sizeof (unsigned short), 16 * 15, fp);
- fclose (fp);
- /* パレットデータを定義 */
- /* (1パレットブロック=16色) × (15ブロックぶん) 定義する */
- {
- unsigned short *p = (unsigned short *) pal_dat;
- for (i = 1; i < 15; i++)
- for (j = 0; j < 16; j++)
- _iocs_spalet (0x80000000 | j, i, *p++);
- }
-
- xsp_on ();
- xsp_mode (3);
- /* パターンデータを定義 */
- xsp_pcgdat_set (pcg_dat, pcg_alt, sizeof (pcg_alt));
-
- /* 座標(128,144), スプライト No.3, パレット3, 優先順位 $3f */
- xsp_set (128, 144, 3, 0x033f);
- /* 座標(144,144), スプライト No.5, パレット3, 優先順位 $3f */
- xsp_set (144, 144, 5, 0x033f);
- /* 座標(160,144), スプライト No.9, パレット3, 優先順位 $3f */
- xsp_set (160, 144, 9, 0x033f);
- xsp_out (); /* 表示 */
-
- printf("何かキーを押して下さい\n");
- getche ();
- xsp_off ();
-
- _iocs_crtmod (16);
- return (0);
- }
-