From 09d075c5469f64f500de70123bbb1042315d7ac0 Mon Sep 17 00:00:00 2001 From: Colin Noga Date: Sat, 23 Jul 2011 11:47:43 -0500 Subject: Added Crowd clapper. Changed everything to LF only. If anyone on Windows tries to read the code now, they will be faced with a single impenetrable line! --- src/heapbar.cpp | 294 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 147 insertions(+), 147 deletions(-) (limited to 'src/heapbar.cpp') diff --git a/src/heapbar.cpp b/src/heapbar.cpp index 3759b22..386427d 100644 --- a/src/heapbar.cpp +++ b/src/heapbar.cpp @@ -1,147 +1,147 @@ -#define GEKKO - -#include -#include "rvl/mtx.h" -#include "rvl/GXEnum.h" -#include "rvl/GXStruct.h" -#include "rvl/GXTransform.h" -#include "rvl/GXGeometry.h" -#include "rvl/GXDispList.h" -#include "rvl/GXLighting.h" -#include "rvl/GXTev.h" -#include "rvl/GXTexture.h" -#include "rvl/GXCull.h" -#include "rvl/GXPixel.h" -#include "rvl/GXBump.h" -//#include "rvl/GXVert.h" -#include "rvl/vifuncs.h" - -extern u32 Global5758; - -#define GXPosition3f32(x,y,z) \ - *((volatile float*)0xCC008000) = (x); \ - *((volatile float*)0xCC008000) = (y); \ - *((volatile float*)0xCC008000) = (z); - -#define GXColor1u32(x) \ - *((volatile u32*)0xCC008000) = (x); - - -extern "C" { - - -void cppGXStart() { - Mtx44 ortho; - - MTXOrtho(ortho, 0, 456, 0, 686, 0.0F, 1.0F); - GXSetProjection(ortho, GX_ORTHOGRAPHIC); - - Mtx identity; - MTXIdentity(identity); - - GXLoadPosMtxImm(identity, GX_PNMTX0); - - GXSetNumTevStages(1); - GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0); - GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR); - GXSetTevDirect(GX_TEVSTAGE0); - - GXSetNumChans(1); - GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_VTX, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE); - - GXClearVtxDesc(); - GXSetVtxDesc(GX_VA_POS, GX_DIRECT); - GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); - GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBX8, 0); - - GXSetZMode(GX_TRUE, GX_ALWAYS, GX_TRUE); -} - -void cppGXEnd() { -} - - - -float y_positions[] = { - -1, - 0.0, - 16.0 -}; - -u32 colours[] = { - -1, - 0x0000ffff, - 0xff0000ff -}; - -u32 col_5758[] = { - 0x00ff00ff, - 0xffff00ff, - 0x00ffffff, - 0xf0ff0fff -}; - -void cppProcessHeap(u32 freeSize, u32 heapSize, int heapID, char *name) { - // get the info needed - float y_pos = y_positions[heapID]; - u32 colour = colours[heapID]; - - // width: 686 - - //OSReport("%s => size %d, free %d\n", name, heapSize, freeSize); - - float left = 0; - float right = ((heapSize - freeSize) * 686.0f) / heapSize; - float top = y_pos; - float bottom = y_pos+16; - - GXBegin(GX_QUADS, GX_VTXFMT0, 4); - - GXPosition3f32(left, top, 0.0); - GXColor1u32(colour); - GXPosition3f32(right, top, 0.0); - GXColor1u32(colour); - GXPosition3f32(right, bottom, 0.0); - GXColor1u32(colour); - GXPosition3f32(left, bottom, 0.0); - GXColor1u32(colour); - - GXEnd(); - - - GXBegin(GX_QUADS, GX_VTXFMT0, 16); - - for (int i = 0; i < 4; i++) { - GXPosition3f32(16*i, 32, 0.0); - GXColor1u32(col_5758[i]); - GXPosition3f32(16*i+16, 32, 0.0); - GXColor1u32(col_5758[i]); - GXPosition3f32(16*i+16, 48, 0.0); - GXColor1u32(col_5758[i]); - GXPosition3f32(16*i, 48, 0.0); - GXColor1u32(col_5758[i]); - } - - GXEnd(); - - for (int i = 0; i < 4; i++) { - if (Global5758 & (1 << i)) { - GXBegin(GX_QUADS, GX_VTXFMT0, 4); - - GXPosition3f32(16*i, 48, 0.0); - GXColor1u32(0xffffffff); - GXPosition3f32(16*i+16, 48, 0.0); - GXColor1u32(0xffffffff); - GXPosition3f32(16*i+16, 56, 0.0); - GXColor1u32(0xffffffff); - GXPosition3f32(16*i, 56, 0.0); - GXColor1u32(0xffffffff); - - GXEnd(); - } - } -} - - -}; +#define GEKKO + +#include +#include "rvl/mtx.h" +#include "rvl/GXEnum.h" +#include "rvl/GXStruct.h" +#include "rvl/GXTransform.h" +#include "rvl/GXGeometry.h" +#include "rvl/GXDispList.h" +#include "rvl/GXLighting.h" +#include "rvl/GXTev.h" +#include "rvl/GXTexture.h" +#include "rvl/GXCull.h" +#include "rvl/GXPixel.h" +#include "rvl/GXBump.h" +//#include "rvl/GXVert.h" +#include "rvl/vifuncs.h" + +extern u32 Global5758; + +#define GXPosition3f32(x,y,z) \ + *((volatile float*)0xCC008000) = (x); \ + *((volatile float*)0xCC008000) = (y); \ + *((volatile float*)0xCC008000) = (z); + +#define GXColor1u32(x) \ + *((volatile u32*)0xCC008000) = (x); + + +extern "C" { + + +void cppGXStart() { + Mtx44 ortho; + + MTXOrtho(ortho, 0, 456, 0, 686, 0.0F, 1.0F); + GXSetProjection(ortho, GX_ORTHOGRAPHIC); + + Mtx identity; + MTXIdentity(identity); + + GXLoadPosMtxImm(identity, GX_PNMTX0); + + GXSetNumTevStages(1); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0); + GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR); + GXSetTevDirect(GX_TEVSTAGE0); + + GXSetNumChans(1); + GXSetChanCtrl(GX_COLOR0A0, GX_DISABLE, GX_SRC_VTX, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE, GX_AF_NONE); + + GXClearVtxDesc(); + GXSetVtxDesc(GX_VA_POS, GX_DIRECT); + GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0); + GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGBA, GX_RGBX8, 0); + + GXSetZMode(GX_TRUE, GX_ALWAYS, GX_TRUE); +} + +void cppGXEnd() { +} + + + +float y_positions[] = { + -1, + 0.0, + 16.0 +}; + +u32 colours[] = { + -1, + 0x0000ffff, + 0xff0000ff +}; + +u32 col_5758[] = { + 0x00ff00ff, + 0xffff00ff, + 0x00ffffff, + 0xf0ff0fff +}; + +void cppProcessHeap(u32 freeSize, u32 heapSize, int heapID, char *name) { + // get the info needed + float y_pos = y_positions[heapID]; + u32 colour = colours[heapID]; + + // width: 686 + + //OSReport("%s => size %d, free %d\n", name, heapSize, freeSize); + + float left = 0; + float right = ((heapSize - freeSize) * 686.0f) / heapSize; + float top = y_pos; + float bottom = y_pos+16; + + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + + GXPosition3f32(left, top, 0.0); + GXColor1u32(colour); + GXPosition3f32(right, top, 0.0); + GXColor1u32(colour); + GXPosition3f32(right, bottom, 0.0); + GXColor1u32(colour); + GXPosition3f32(left, bottom, 0.0); + GXColor1u32(colour); + + GXEnd(); + + + GXBegin(GX_QUADS, GX_VTXFMT0, 16); + + for (int i = 0; i < 4; i++) { + GXPosition3f32(16*i, 32, 0.0); + GXColor1u32(col_5758[i]); + GXPosition3f32(16*i+16, 32, 0.0); + GXColor1u32(col_5758[i]); + GXPosition3f32(16*i+16, 48, 0.0); + GXColor1u32(col_5758[i]); + GXPosition3f32(16*i, 48, 0.0); + GXColor1u32(col_5758[i]); + } + + GXEnd(); + + for (int i = 0; i < 4; i++) { + if (Global5758 & (1 << i)) { + GXBegin(GX_QUADS, GX_VTXFMT0, 4); + + GXPosition3f32(16*i, 48, 0.0); + GXColor1u32(0xffffffff); + GXPosition3f32(16*i+16, 48, 0.0); + GXColor1u32(0xffffffff); + GXPosition3f32(16*i+16, 56, 0.0); + GXColor1u32(0xffffffff); + GXPosition3f32(16*i, 56, 0.0); + GXColor1u32(0xffffffff); + + GXEnd(); + } + } +} + + +}; -- cgit v1.2.3