In memory of Ben “bushing” Byer, who passed away on Monday, February 8th, 2016.

User:Cboomf: Difference between revisions

From WiiBrew
Jump to navigation Jump to search
Cboomf (talk | contribs)
No edit summary
Cboomf (talk | contribs)
No edit summary
 
(91 intermediate revisions by 10 users not shown)
Line 1: Line 1:
I am currently coding ( attempting ;-) ) a package of seemingly random bits of code that may server a purpose, may not but, it is just to learn C and have some fun with my wii.
{{Infobox homebrew
| image      = [[Image:Lines WiiWebServer.png]]
| title      = [[Wii Web Server]]
| type        = utility
| author      = Cboomf
| version    = alpha 1.20
| licence    = GPL
| download    = https://sourceforge.net/projects/wiiwebserver/
| website    = https://sourceforge.net/projects/wiiwebserver/
| source      = http://sourceforge.net/scm/?type=svn&group_id=229938
| peripherals = {{Wiimote1}}{{Nunchuk}}{{WiFi}}{{Internet}}{{FrontSD}}{{GCNController}}{{USBMSD}}{{LesPaul}}
| hbb        = yes
}}


===Code dump : ===
{{Infobox development tools
| image      =  
| title      = [[libwiilight]]
| desc        = A library for the disc slot light
| type        = library
| author      = Cboomf
| version    = Beta 1
| download    = Media:libwiilight.zip
| peripherals = {{Wii}}
}}


<source lang="c">
I am a '''NERD''' ;-)<br />
#include <stdio.h>
[http://bridgesrail.blogspot.com]
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <ogcsys.h>
#include <gccore.h>
#include <ogc/ipc.h>
#include <stdarg.h>
#include <ctype.h>
#include <unistd.h>
#include <assert.h>


static void *xfb = NULL;
<div style="clear: both; padding-top: 24pt;">
static GXRModeObj *rmode = NULL;
==Me==
</div>
{{Userbox lang|en}}
{{Userbox dev|Win}}
{{Userbox developer}}
{{Userbox beta}}


#include "ios.c"
#include "stm.c"
#include "es.h"
#include "es.c"
#include "ipc.h"
#include "gu.c"


#include "GRRLIB.h"
<div style="clear: both; padding-top: 24pt;">
==Major Experience==
</div>
{{Userbox code|C}}
{{Userbox code|PAS}}
{{Userbox code|VB}}
{{Userbox code|VB.net}}
{{Userbox code|VBS}}
{{Userbox code|PHP}}
{{Userbox code|JS}}
{{Userbox code|HTML}}
{{Userbox code|MySQL}}
{{Userbox code|BAS}}


#include "../gfx/music.h"
<div style="clear: both; padding-top: 24pt;">


typedef void (*Loader_Entry)(void);
==Minor Experience==
static u32 *xjb;
</div>
{{Userbox code|C++}}
{{Userbox code|Java}}
{{Userbox code|ASM}}
{{Userbox code|Cobol}}


Loader_Entry loader = (Loader_Entry)0x80001800;
<div style="clear: both; padding-top: 24pt;">
==Wii + Hardware==
</div>
{{Userbox sdcard|2gb}}
{{Userbox wiimote|2}}
{{Userbox wiizapper|1}}
{{Userbox wiiwheel|1}}
{{Userbox nunchuk|2}}
{{Userbox classic controller|1}}
{{Userbox gamecube controller|1}}
{{Userbox balance board|1}}
{{Userbox USBKeyboard|1}}
{{Userbox wifi}}
{{Userbox system menu|4.0}}
{{Userbox Trucha}}
{{Userbox motionplus|1}}


extern u16 *GRRLIB_buffer;
<div style="clear: both; padding-top: 24pt;">


void hello(void)
==Homebrew==
{
</div>
    printf("Hello world!\n");
{{Userbox DVDx}}
printf("v 0.3");
{{Userbox homebrew channel|1.0.3}}
}
{{Userbox bootmii|beta2}}
 
{{Userbox homebrew browser}}
void menutext(void)
{{Userbox mplayer ce}}
{
{{Userbox bannerbomb}}
    printf("Menu\n");
printf("----\n");
printf("Start + Z    = Return to loader\n");
printf("A !!        = Elf Loader\n");
printf("B !!        = System Utils\n");
printf("Y !          = Fun\n");
printf("X            = Reboot Wii\n");
    return;
}
 
void clearscreen(void)
{
int y;
    for(y=0;y<34;y++)
printf("                                                                          \n");
}
 
void checkAndReload(void) {
  PAD_ScanPads();
  int buttonsDown = PAD_ButtonsHeld(0);
  if( (buttonsDown & PAD_TRIGGER_Z) && (buttonsDown & PAD_BUTTON_START)) {
    loader();
  }
}
 
void console(void) {
    xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
xjb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
}
 
void sysutils(void) {  
    bool pressed;
 
    pressed=false;
clearscreen();
    printf("System Utils Menu\n");
printf("-----------------\n\n");
    printf("X = Load IOS37\n");
printf("Y = Load IOS9\n");
printf("B = Go Back\n");
printf("Press A to continue \n");
while((pressed=false)) {
VIDEO_WaitVSync();
PAD_ScanPads();
int buttonsDown = PAD_ButtonsHeld(0);
if (buttonsDown & PAD_BUTTON_X){
            __IOS_LaunchNewIOS(37);
pressed=true;
    }
if (buttonsDown & PAD_BUTTON_Y){
    IOS_ReloadIOS(9);
pressed=true;
}
if (buttonsDown & PAD_BUTTON_B){
    pressed=true;
}
    }
return;
}
 
void shutdown(void) {
    __STM_Init();
STM_RebootSystem();
__STM_Close();
}
 
void fun(void) {
 
    clearscreen();
__STM_Init();
 
    printf("FUN\n");
printf("---\n\n");
int ver;
int revma;
int revmi;
int di_fd;
int es_fd;
int vec;
u32 wiiid;
static u8 stm_inbuf[0x20] ATTRIBUTE_ALIGN(32);
static u8 stm_iobuf[0x20] ATTRIBUTE_ALIGN(32);
ver=IOS_GetVersion();
revma=IOS_GetRevisionMajor();
revmi=IOS_GetRevisionMinor();
    printf("IOS Version : %d  Revision : %d.%d \n\n", ver, revma, revmi);
di_fd=IOS_Open("/dev/di",1);
    ((u32*)stm_inbuf)[0x00] = 0x70000000;
IOS_Ioctl( di_fd, stm_inbuf[0x00], stm_inbuf, 0x20, stm_iobuf, 0x20);
printf("DVD ID : %s \n\n",stm_iobuf);
IOS_Close(di_fd);
vec=0;
es_fd=IOS_Open("/dev/es",1);
vec = ES_GetDeviceID(&wiiid);
// printf("Console ID : %08x \n\n", wiiid);
IOS_Close(es_fd);
GRRLIB_DrawImg(10,50, music_width, music_high, music_img);
GRRLIB_Render();
printf("Press A to continue\n");
while(1) {
VIDEO_WaitVSync();
PAD_ScanPads();
int buttonsDown = PAD_ButtonsHeld(0);
if (buttonsDown & PAD_BUTTON_A){
    console();
            clearscreen();
        menutext();
__STM_Close();
        return;     
    }
}
}
 
void menu(void) {
    clearscreen();
menutext();
while(1) {
VIDEO_WaitVSync();
    checkAndReload();
PAD_ScanPads();
int buttonsDown = PAD_ButtonsHeld(0);
if (buttonsDown & PAD_BUTTON_Y){
            fun();
    }
if (buttonsDown & PAD_BUTTON_X){
            shutdown();
    }
if (buttonsDown & PAD_BUTTON_B){
    //sysutils();
}
if (buttonsDown & PAD_BUTTON_A){
    //elfloader();
}
    }
}
 
 
void start(void) {
    PAD_ScanPads();
    int buttonsDown = PAD_ButtonsHeld(0);
    if(buttonsDown & PAD_BUTTON_START) {
      menu();
    }
}
 
int main(int argc, char **argv) {
 
  /****************************************************************************
Initialise Video
  Initialise GCPad for input
****************************************************************************/
 
GRRLIB_buffer=(u16 *)malloc(640*240*2);
VIDEO_Init();
PAD_Init();
GRRLIB_InitVideo();
GRRLIB_Start();
GRRLIB_FillScreen(0x0000);
GRRLIB_Render();
 
switch(VIDEO_GetCurrentTvMode()) {
case VI_NTSC:
rmode = &TVNtsc480IntDf;
break;
case VI_PAL:
rmode = &TVPal528IntDf;
break;
case VI_MPAL:
rmode = &TVMpal480IntDf;
break;
default:
rmode = &TVNtsc480IntDf;
break;
}
 
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
xjb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
console_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(FALSE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();
    /****************************************************************************
Main code
****************************************************************************/
 
hello();
printf("\n");
printf("My first native wii homebrew\n\n");
printf("Press Start :-)\n\n");
while(1) {
VIDEO_WaitVSync();
start();
}
return 0;
}
 
</source>

Latest revision as of 21:32, 9 January 2010

Wii Web Server
General
Author(s)Cboomf
TypeUtility
Versionalpha 1.20
LicenceGPL
Links
Download
Website
Source
Downloadable via the Homebrew Browser
Peripherals
Local WiFiInternetLoads files from the Front SD slotGameCube ControllerUSB mass storage deviceLes Paul Controller
libwiilight
General
Author(s)Cboomf
TypeLibrary
VersionBeta 1
Links
Download

I am a NERD ;-)
[1]

Me

en This user is a native speaker of English.
This user develops using Windows.
This user has developed homebrew for the Wii.


This user beta tests homebrew.


Major Experience

C This user codes in C.
PAS This user codes in Pascal.
VB This user codes in Visual Basic.
VB.net This user codes in Visual Basic .NET.
VBS This user codes in Visual Basic Script.
PHP This user codes in PHP: Hypertext Preprocessor.
JS This user codes in JavaScript.
HTML This user codes in HTML.
MySQL This user codes in MySQL.
BAS This user codes in BASIC.

Minor Experience

C++ This user codes in C++.
Java This user codes in Java.
ASM This user codes in Assembly.
Cobol This user codes in Cobol.

Wii + Hardware

SD Card This user owns a 2gb SD card.
2 Wii Remotes This user owns 2 Wii Remotes.
Wii Zapper This user owns 1 Wii Zapper.
Wii Wheel This user owns 1 Wii Wheel.
This user owns 2 Nunchuks.
This user owns 1 Classic Controller.
GameCube Controller This user owns 1 GameCube Controller.
Wii Balance Board This user owns 1 Wii Balance Board.
USB Keyboard This user owns a USB Keyboard.
Wi-Fi This user uses Wi-Fi.
Wii This user is running System Menu 4.0 on their Wii.
This user has at least one trucha vulnerable IOS.
Wii MotionPlus This user owns 1 Wii MotionPlus unit.

Homebrew

DVDX This user has installed DVDX on their Wii.
This user has installed the Homebrew Channel version 1.0.3 on their Wii.


BootMii This user has installed BootMii version beta2 on their Wii.
Homebrew Browser This user uses the Homebrew Browser to download and update their homebrew.
MPlayer CE This user uses MPlayer CE to play media on their Wii.
This user used Bannerbomb to install homebrew.