1 /*---------------------------------------------------------------------------* 2 Project: NET demo 3 File: sample.h 4 5 Copyright 2006 Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Log: graphic.h,v $ 14 Revision 1.3 2006/09/05 10:55:54 yosizaki 15 added REXDEMOUsage. 16 17 Revision 1.2 2006/08/31 14:04:59 yosizaki 18 Added render setting function. 19 20 Revision 1.1 2006/08/29 07:18:24 adachi_hiroaki 21 Added common graphic process 22 23 24 $NoKeywords: $ 25 *---------------------------------------------------------------------------*/ 26 27 #ifndef __DEMOS_SHARED_H__ 28 #define __DEMOS_SHARED_H__ 29 30 #include <revolution/types.h> 31 #include <revolution/gx.h> 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 /*===========================================================================*/ 37 38 #ifdef WPADEMU 39 #define KPAD_BUTTON_PLUS KPAD_BUTTON_START 40 #define KPAD_BUTTON_MINUS KPAD_BUTTON_SELECT 41 #define KPAD_BUTTON_1 KPAD_BUTTON_SMALL_A 42 #define KPAD_BUTTON_2 KPAD_BUTTON_SMALL_B 43 #define KPAD_BUTTON_Z KPAD_BUTTON_Z1 44 #define KPAD_BUTTON_C KPAD_BUTTON_Z2 45 #endif 46 47 #define REXDEMO_COLOR_BLACK ( (const GXColor){ 0x00, 0x00, 0x00, 0xff } ) 48 #define REXDEMO_COLOR_WHITE ( (const GXColor){ 0xff, 0xff, 0xff, 0xff } ) 49 #define REXDEMO_COLOR_GRAY ( (const GXColor){ 0x7f, 0x7f, 0x7f, 0xff } ) 50 #define REXDEMO_COLOR_RED ( (const GXColor){ 0xff, 0x00, 0x00, 0xff } ) 51 #define REXDEMO_COLOR_GREEN ( (const GXColor){ 0x00, 0xff, 0x00, 0xff } ) 52 #define REXDEMO_COLOR_BLUE ( (const GXColor){ 0x00, 0x00, 0xff, 0xff } ) 53 #define REXDEMO_COLOR_YELLOW ( (const GXColor){ 0xff, 0xff, 0x00, 0xff } ) 54 #define REXDEMO_COLOR_SKY ( (const GXColor){ 0x00, 0xff, 0xff, 0xff } ) 55 #define REXDEMO_COLOR_PINK ( (const GXColor){ 0xff, 0x00, 0xff, 0xff } ) 56 #define REXDEMO_COLOR_ORANGE ( (const GXColor){ 0xff, 0x7f, 0x00, 0xff } ) 57 #define REXDEMO_COLOR_PURPLE ( (const GXColor){ 0x7f, 0x00, 0xff, 0xff } ) 58 59 #define REXDEMOReport( ... ) REXDEMOReportEx( REXDEMO_COLOR_BLACK, __VA_ARGS__ ) 60 #define REXDEMOWarning( ... ) REXDEMOReportEx( REXDEMO_COLOR_ORANGE, __VA_ARGS__ ) 61 #define REXDEMOError( ... ) REXDEMOReportEx( REXDEMO_COLOR_RED, __VA_ARGS__ ) 62 #define REXDEMOUsage( ... ) REXDEMOReportEx( REXDEMO_COLOR_BLUE, __VA_ARGS__ ) 63 64 /*---------------------------------------------------------------------------*/ 65 void REXDEMOInitScreen( BOOL autoRender ); 66 void REXDEMOWaitRetrace( void ); 67 void REXDEMOReportEx( GXColor col, const char* msg, ... ); 68 69 void REXDEMOSetTextColor( const GXColor col ); 70 void REXDEMOSetGroundColor( const GXColor col ); 71 void REXDEMOSetFontSize( int width, int height ); 72 void REXDEMOBeginRender( void ); 73 void REXDEMOPrintf( int x, int y, int z, const char *fmt, ... ); 74 75 76 /*===========================================================================*/ 77 #ifdef __cplusplus 78 } 79 #endif 80 #endif /* __DEMOS_SHARED_H__ */ 81 82 /*---------------------------------------------------------------------------* 83 End of file 84 *---------------------------------------------------------------------------*/ 85