b8  p_À € € € €þÿÿÿઠ€.text € €@ .rdata@ €@ € @<.data` €` €€ `?@.sdataà* €à* €ÀàJ.sbss + € + €P.bssð+ €ð+ €À_€********* * FUNCTION: a * DESCRIPTION: b * PARAMETERS: c * RETURNS: d ****************************************************************************/ #include #include #include #include "types.h" #include "asssert.h" #include "pad.h" #include "dump.h" #include "psxdefs.h" #include "sincos.h" /* Debug Macros */ /* NB: May be overruled in makefile */ //#define DEBUG #define ASSERT_ON #define DEF_VDMODE MODE_NTSC #define FLAG_WIDTH 220 #define FLAG_HEIGHT 140 #define NUM_POLYW 13 // 13 for 60Hz NTSC #define NUM_POLYH 13 #define MAX_POLYS ((NUM_POLYW * NUM_POLYH * 2) + 10) #define OT_LENGTH 2 u_char FlagDefCols[3][3] = {{0xbb,0x00,0x00}, {0x00,0xbb,0x00}, {0x00,0x00,0xbb}}; short FlagPoints[NUM_POLYW + 1][NUM_POLYH + 1][2]; short FlagPoints2[NUM_POLYW + 1][NUM_POLYH + 1][2]; u_char FlagCols[NUM_POLYW + 1][NUM_POLYH + 1][3]; int FlagColsCp[NUM_POLYW + 1][NUM_POLYH + 1][3]; GsOT W_OT[2]; GsOT_TAG W_OT_Tag[2][1<' int menu_sel; char sel[6] = {MENU_SELCHAR, ' ', ' ', ' ', ' ', ' '}; // Default screen information is PAL based, but is converted by initScrMode if necessary typedef struct { int w; int h; int intl; int dither; int vram; } SCRMODE; int scr_width; int scr_height; int scr_interlace; int scr_vdmode; SCRMODE scr_mode = {320, 256, GsOFSGPU, GsDITHER, GsDEPTH16}; void initData(void); void renderScreen(void); void cleanUp(void); void initFlagPoints(void); void initDisplace_Tabs(void); void fpsCount(void); SCRMODE * initScrMode(SCRMODE *); int augmentInput(void); int i, j; // Wanted these to be type register, but gcc won't allow it void main() { initData(); renderScreen(); cleanUp(); } void renderScreen(void) { register int x1s, y1s, x1, y1; int tmp; while( (augmentInput() & (PADstart | PADselect)) != (PADstart | PADselect)) { GsClearOt(0,0,&W_OT[scr_buf]); x1s = x1sin_cur; y1s = y1sin_cur; for (j = 0; j <= NUM_POLYH; j++) { x1 = x1s; y1 = y1s; for (i = 0; i <= NUM_POLYW; i++) { FlagPoints2[i][j][0] = FlagPoints[i][j][0] + XDisp_Tab[x1]; FlagPoints2[i][j][1] = FlagPoints[i][j][1] + XDisp_Tab[y1]; // quick (slooo) faked lighting! tmp = -(rsin(x1) + rsin(y1)) + (4096 * 2) + 4096; FlagCols[i][j][0] = (u_char) ((FlagColsCp[i][j][0] * tmp) >> 14); FlagCols[i][j][1] = (u_char) ((FlagColsCp[i][j][1] * tmp) >> 14); FlagCols[i][j][2] = (u_char) ((FlagColsCp[i][j][2] * tmp) >> 14); x1 += x1_modw; x1 &= 4095; y1 += y1_modw; y1 &= 4095; } x1s += x1_modh; x1s &= 4095; y1s += y1_modh; y1s &= 4095; } pck = PacketArea[scr_buf]; for (j = 0; j < NUM_POLYH; j++) { for (i = 0; i < NUM_POLYW; i++) àÿ½'¿¯›F €@4¿�0¶�,µ�(´�$³� ²�±�°�à8½'àÿ½'°¯!€€! ±¯ €< ?1&Ø€‚�!(¿¯€0!0€0“‰ !0ÑØ€„�À!D#D@!C!D €<�Nc$!C$C $C P P P Ø€…�Ô€‡�£8ãÿ<DŒÿÿÆ4@¤Ð€ƒ�)G¤ÿ< C¤ €< ?c$!(£@ H¤£Œ$ ‡$f% ƒD¬! £Œ$F$g%bS  £¬šò ! H† Ø€‚�€ ! ‚€ Љ ! ‘S  ! ¿�±�°�à ½'Øÿ½'³¯!˜ ´¯ €<ð+”&$¿¯²¯±¯°¯!ˆ!�€ÂE !!ÂE !€@!€#€@!PÂ!CC$!|(€" 0€‚�@B0@@"2@Ü€ƒ�b( @b$Ü€‚¯ $!|(€" Ü€ƒ�>$!|(€" 0€ƒ�:b0@ b0@ "2@Åb0&0€ƒ�Åb0@€b0@€"2@ÿÿ&4Ü€ƒ�b,/@€ €DJPV]ciou{�ˆŽ”𠦬²¹¿ÅËÑ×Ýãéïöü &,28>DKQW]ciou{�‡�“™Ÿ¥«±·½ÃÉÏÕÛáçíóùÿ #)/4:@FLRX^djpv|�‡�“™Ÿ¥«±¶¼ÂÈÎÔÚßåëñ÷ý%+17<BHNTY_ekpv|‚‡�“™ž¤ª¯µ»ÁÆÌÒ×Ýãèîôùÿ !&,27=BHNSY^djouz€…‹�–›¡¦¬²·½ÂÈÍÒØÝãèîóùþ $*/4:?EJOUZ_ejouz…Š�•šŸ¥ª¯´º¿ÄÉÏÔÙÞäéîóøþ     " ' , 1 7 < A F K P U Z _ e j o t y ~ ƒ ˆ � ’ — œ ¡ ¦ « ° µ º ¿ Ä É Î Ó Ø Ý â ç ì ñ ö û ÿ      " & + 0 5 : ? D H M R W \ ` e j o s x } ‚ † ‹ � • ™ ž £ § ¬ ± µ º ¿ Ã È Í Ñ Ö Û ß ä è í ò ö û ÿ       $ ( - 1 6 : > C G L P U Y ^ b f k o t x | � … ‰ Ž ’ — › Ÿ £ ¨ ¬ ° µ ¹ ½ Á Æ Ê Î Ò × Û ß ã è ì ð ô ø ü       " & * . 2 6 : > B F J N R V Z ^ b f j n r v z ~ ‚ † Š Ž ‘ • ™ � ¡ ¥ © ¬ ° ´ ¸ ¼ À Ã Ç Ë Ï Ò Ö Ú Þ á å é í ð ô ø û ÿ        # ' * . 2 5 9 < @ C G J N Q U X \ _ b f i m p t w z ~ � … ˆ ‹ � ’ • ™ œ Ÿ ¢ ¦ © ¬ ° ³ ¶ ¹ ¼ À Ã Æ É Ì Ð Ó Ö Ù Ü ß ã æ é ì ï ò õ ø û þ   "%(+.147:<?BEHKMPSVY[^adfiloqtwy|�„‡‰Œ�‘”–™›ž¡£¦¨«­°²µ·º¼¿ÁÃÆÈËÍÏÒÔÖÙÛÝàâäçéëîðòô÷ùûýÿ  !#%')+-/13579;=?ACEFHJLNPQSUWYZ\^`aceghjlmoqrtvwyz|}�‚„…‡ˆŠ‹�Ž�‘“”•—˜š›œžŸ¡¢£¥¦§¨ª«¬®¯°±³´µ¶·¸º»¼½¾¿ÀÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÕÖרÙÚÛÜÜÝÞßààáâããäåææçèèéêêëììííîïïððññòòóóôôõõöö÷÷øøøùùùúúúûûûüüüüýýýýþþþþþÿÿÿÿÿÿÿ !$&)+.0358:=?BEGJLOQTVY[^`cehjloqtvy{~€ƒ…ˆŠŒ�‘”–˜›� ¢¤§©¬®°³µ·º¼¾ÁÃÅÈÊÌÏÑÓÖØÚÜßáãåèêìîñóõ÷ùüþ    "$&(*,.02468:<>@BDFHJLNPRTVXZ[]_aceghjlnprsuwy{|~€‚ƒ…‡‰ŠŒŽ�‘“•–˜š›�Ÿ ¢£¥§¨ª¬­¯°²³µ·¸º»½¾ÀÁÃÄÆÇÉÊÌÍÏÐÒÓÕÖ×ÙÚÜÝßàáãäæçèêëìîïðòóôö÷øúûüýÿof˜Zq4€€> ÿÿÿÿÿÿÿÿઠ€°‹ €tXY0((BLK_FILL *)pck, PSDOFSX[scr_buf ^ 1], PSDOFSY[scr_buf ^ 1]); setXY0((BLK_FILL *)pck, 0, d main() { printf("\n ***Wibbly Flag!*** \n\nby Alex Amsel [IBEYOND] alex@teeth.demon.co.uk\n\n"); printf("Currently using %d Goraud Textured Triangles and no big tables\n\n", NUM_POLYW * NUM_POLYH * 2); printf("All controller buttons can be used on the menu\n"); printf("Start Button resets all values to defaults\n"); printf("Select Button resets current value to zero\n"); printf("Select Button on CONTROLLER 2 ***while loading*** to switch PAL/NTSC\n"); printf("Select & Start to Quit\n\n"); initData(); renderScreen(); cleanUp(); } void renderScreen(void) { register PACKET *pck; register int i, j, x1, y1; register u_char col1, col2, col3, col4; int x1s, y1s; fps_count = ON; while( (augmentInput() & (PADstart | PADselect)) != (PADstart | PADselect)) { GsClearOt(0,0,&W_OT[scr_buf]); x1s = x1sin_cur; y1s = y1sin_cur; for (j = 0; j <= NUM_POLYH; j++) { x1 = x1s; y1 = y1s; for (i = 0; i <= NUM_POLYW; i++) { Flb