Hacking Paranoia

  • Thread starter Thread starter calthephenom
  • Start date Start date
  • Views Views 7,633
  • Replies Replies 46
Status
Not open for further replies.
calthephenom said:
i just used Wiindows source, and threw out all the wiindows stuff, and added the paranoia banner and shutdown.
Any code that will never be executed should get removed automatically by gcc when linking so I still wonder why all that nand and network stuff is in there... maybe I'm just being Paranoid about Paranoia....
 
here is the main file
/*
main.c -- main function, pretty much calls functions in other files
tongue.gif

For Info On The Usage Of Wiindows, Visit http://wiindows.info
i may add a forum there, and am currently taking requests
To Do:
Add MP3 Playback Support

Picture Viewing

Simple DOS Commands( mkdir, rmdir, etc)

Executable launching

basic text editor

Basic GUI (X)

the source for the Wiindows project is available at

http://svn.wiindows.sourceforge.net/build/

wiindows is currently licensed as Freeware.

© Calvin Roberts 2010

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.

1. The origin of this software must not be misrepresented; you
must not claim that you wrote the original software. If you use
this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.

2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "clock.h"
#include
#include
#include
#include
#include
#include
#include
#include

/*
#include "FreeTypeGX.h"
*/
/* MLib */

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* Local Includes */
#include "gui.h"
#include "menu.h"
#include "restart.h"
#include "sys.h"
#include "video.h"
#include "wpad.h"

#include "kbd.h"
#include "pngu.h"
#include "png.h"
#include "Bootmii_IOS.h"
#include "background_png.h"

extern const u8 cursor_jpg_end[];
extern const u8 cursor_jpg[];
extern const u32 cursor_jpg_size;

extern const u8 arial_ttf[];
extern const u32 arial_ttf_size;

extern const u8 logo_png_end[];
extern const u8 logo_png[];
extern const u32 logo_png_size;

//Wiimote IR
ir_t ir;
static int *xfb = NULL;
static GXRModeObj *rmode = NULL;
int wiindowsLogo () {
PNGUPROP logo;
IMGCTX ctx;

if (!(ctx = PNGU_SelectImageFromBuffer (logo_png)))
return -1;
if (PNGU_GetImageProperties (ctx, &logo) != PNGU_OK)
return -1;
if (PNGU_DecodeToYCbYCr (ctx, logo.imgWidth, logo.imgHeight, xfb, 640 - logo.imgWidth) != PNGU_OK)
return -1;

return 1;
}
int loadBackground () {
PNGUPROP background;
IMGCTX ctx;

if (!(ctx = PNGU_SelectImageFromBuffer (background_png)))
return -1;
if (PNGU_GetImageProperties (ctx, &background) != PNGU_OK)
return -1;
if (PNGU_DecodeToYCbYCr (ctx, background.imgWidth, background.imgHeight, xfb, 640 - background.imgWidth) != PNGU_OK)
return -1;

return 1;
}

#include "awesomeness_png.h"
int loadAwesomeness () {
PNGUPROP awesomeness;
IMGCTX ctx;

if (!(ctx = PNGU_SelectImageFromBuffer (awesomeness_png)))
return -1;
if (PNGU_GetImageProperties (ctx, &awesomeness) != PNGU_OK)
return -1;
if (PNGU_DecodeToYCbYCr (ctx, awesomeness.imgWidth, awesomeness.imgHeight, xfb, 640 - awesomeness.imgWidth) != PNGU_OK)
return -1;

return 1;
}
int awesome() {
printf("\x1b[%d;%dH", 2, 3 );
printf("Powering Off In 3...");
sleep(1);
printf("2...");
sleep(1);
printf("1...");
sleep(1);
WPAD_Shutdown();
STM_ShutdownToStandby();
}
int debug_sd ()
{
char *date;

time_t timer;

timer=time(NULL);

date = asctime(localtime(&timer));

FILE * pFile;
int n;

pFile = fopen ("sd:/wiindows.debug","wb+");
for (n=0 ; nfbWidth*VI_DISPLAY_PIX_SZ);

// Set up the video registers with the chosen mode
VIDEO_Configure(rmode);

// Tell the video hardware where our display memory is
VIDEO_SetNextFramebuffer(xfb);

// Make the display visible
VIDEO_SetBlack(FALSE);

// Flush the video register changes to the hardware
VIDEO_Flush();

// Wait for Video setup to complete
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
wiindowsLogo();
WIILIGHT_Init();
//Main App
WIILIGHT_SetLevel(255);
WIILIGHT_TurnOn();
ASND_Init(NULL);
MP3Player_Init();

sleep(3);
ClearScreen();


#define CSI 0x1b

/* RIP Paranoia
ClearScreen();
loadAwesomeness();
awesome();
sleep(10);
*/
/* Draw background */
loadBackground();

printf("\x1b[%d;%dH", 27, 61);




while(1)
{



// Call WPAD_ScanPads each loop, this reads the latest controller states
// this is the little note app. itis actually pretty cool. untested as of 4/18/2010 . feel free to test =P
WPAD_ScanPads();
u32 pressed = WPAD_ButtonsDown(0);
if ( pressed & WPAD_BUTTON_HOME )
{
WPAD_Rumble(0,5);
sleep(1);
WPAD_Rumble(0,0);
ClearScreen();
if (*(u32*)0x80001800) exit(0);
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
}


if(pressed & WPAD_BUTTON_B)
{
usleep(1000);
bootmii_ios_failsafe();
}

/* Simple JPEG Cursor */
WPAD_IR(0, &ir);
JPEGIMG cursor;
memset(&cursor, 0, sizeof(JPEGIMG));
cursor.inbuffer = cursor_jpg;
cursor.inbufferlength = cursor_jpg_size;
JPEG_Decompress(&cursor);
display_jpeg(cursor, ir.x, ir.y);

if((pressed & WPAD_BUTTON_1) & (pressed & WPAD_BUTTON_2))
{
pong();
}
/* wot
*/



/*
the clock
*/

printf("\x1b[%d;%dH", 2, 53);
clocker();

if(pressed & WPAD_BUTTON_A)
{
WPAD_Rumble(0,5);
sleep(1);
WPAD_Rumble(0,0);
utils();
}




if(pressed & WPAD_BUTTON_B) update();
fatInitDefault();
}
return 0;
}
 
Please, guys, be polite. If you feel that the program is not useful for you, just say why in a polite manner, or otherwise, please refrain from posting. Thanks!
wink.gif
 
raulpica said:
Please, guys, be polite. If you feel that the program is not useful for you, just say why in a polite manner, or otherwise, please refrain from posting. Thanks!
wink.gif

This program is not useful to me. However if it is to you, then congrats
 
Theres at least already two existing apps that do the exact same thing, they are heck as easy to make and end up only being a few hundred kb or so max. You should be able to find them on wiibrew AND this very forum. I might have even compiled one for myself back in the day lols (could prob find it in my post history unless i'm getting confused with the disk eject app i compiled).

Anyways, sorry to break it to ya'll, but it's been done and bettered long ago. This whole topic has become a spamfest and a waste of space. Closed.
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum