Path: chuka.playstation.co.uk!news1.scei.co.jp!usenet From: minoru@isl.intec.co.jp (Minoru Matsumoto) Newsgroups: playstation.ny.program.beginner Subject: Re: balltex.h? Date: 13 Jan 1998 16:23:48 GMT Organization: INTEC System Laboratory Inc. Ltd. Lines: 52 Message-ID: <34bb9372pa198@base.minoru.isl.intec.co.jp> References: <34BAA702.874A5DFC@interlink.or.jp> NNTP-Posting-Host: 202.226.28.128 Mime-Version: 1.0 Content-Type: Text/Plain; charset=ISO-2022-JP X-Newsreader: WinVN 0.99.7J PL01 (x86 32bit) cqz03222 の松本 実です。 In article <34BAA702.874A5DFC@interlink.or.jp>, sezaki@interlink.or.jp says... >サンプルプログラムで 「ball.h」という物を使っていますが、 >この変わりにTIMデータを使うとすると、どのようにプログラム >を変更したらいいのでしょうか? SCEI のサンプルプログラムに答えがあります。たとえば、sndcube の main.c を見ると、以下のようになっています。 tex_addr には、CIP などで転送したデータのアドレスが入ると 考えてください。 会員の方のホームページや Yaroze Japan の過去の号にも解説が あったと思ったので、探して見てください。 /* * テクスチャの読み込み (VRAMへの転送) */ #define TIM_HEADER 0x00000010 void initTexture (unsigned long *tex_addr) { RECT rect1; GsIMAGE tim1; int i; while (1) { if (*tex_addr != TIM_HEADER) { break; } tex_addr ++; /* ヘッダのスキップ(1word) */ GsGetTimInfo (tex_addr, &tim1); tex_addr += tim1.pw*tim1.ph/2+3+1; /* 次のブロックまで進める */ rect1.x = tim1.px; rect1.y = tim1.py; rect1.w = tim1.pw; rect1.h = tim1.ph; LoadImage (&rect1,tim1.pixel); if ((tim1.pmode >> 3) & 0x01) { /* CLUTがあれば転送 */ rect1.x = tim1.cx; rect1.y = tim1.cy; rect1.w = tim1.cw; rect1.h = tim1.ch; LoadImage (&rect1, tim1.clut); tex_addr += tim1.cw * tim1.ch / 2 + 3; } } } ---