Jump to content
RealModScene
Sign in to follow this  
ianboy1987

Xbox 360 Hello World C++ Help

Recommended Posts

Iv been Trying to learn to code for the 360, there isnt much info online about it.
i started https://dev360.fandom.com/wiki/Hello_World thats all well and good compiled fine and runs on my RGloader.
i have edited it down removed what i thort i not need and added + changed stuff. for some reason i cant get it working right 
im sure its very basic stuff for some of the users here, the start button never brings any think up. i did think its a syntax error but i cant seem to fix it atall
here the part thats giving me troubles

VOID __cdecl main()
{
    bool done =FALSE;
    init();
    g_console.Format( "PRESS A TO START\n" );
    while(!done)
    {
      ATG::GAMEPAD* pGamepad = ATG::Input::GetMergedInput();// get input from controlers
       if( pGamepad->wPressedButtons  & XINPUT_GAMEPAD_A)
     {
       g_console.Format( "*** WARNING ***\n" );
       g_console.Format("Press Start to continue or B to exit\n");
       ATG::GAMEPAD* pGamepad = ATG::Input::GetMergedInput();
        if( pGamepad->wPressedButtons  & XINPUT_GAMEPAD_START)
        {
           g_console.Create( "game:\\Media\\Fonts\\Arial_16.xpr", 0xff000000, 0xffffffff );
          g_console.Format( "not working\n" );
        }
     }
      if( pGamepad->wPressedButtons  & XINPUT_GAMEPAD_B)
    {
        done = true;
     }
    }
    
}

 

Share this post


Link to post
Share on other sites

I made a totally useless .xex today so thought id share with you lot here. The hdd mounting was taken from swizzys github 

#include <xtl.h>
#include "stdafx.h"
#include <xtl.h>
#include <d3d9.h>
#include <xam.h>
#include <xui.h>
#include <xuiapp.h>
#include <iostream>
#include <fstream>
#include <string>
#include "xfilecache.h"
#include "AtgConsole.h"//simple text output to screen
#include "AtgFont.h"
#include "AtgInput.h"//get input from controler
#include "mount.h"
using std::ofstream;//needed for the debug log
//--------------------------------------------------------
//GLOBALS

ATG::Console xecout;

void MountDevice(const char* mountPath, char* path, char* msg, int* mounted){
	if (Map(mountPath, path) == S_OK)
	{
		*mounted++;
	}
}

void mountdrives()
{
	int mounted = 0;
	MountDevice("HDD:", "\\Device\\Harddisk0\\Partition1", "hdd mounted", &mounted);
	//MountDevice("USB0:", "\\Device\\Mass0", "usb0 mounted", &mounted);
	//MountDevice("USB1:", "\\Device\\Mass1", "usb1 mounted", &mounted);
	//MountDevice("USB2:", "\\Device\\Mass2", "usb2 mounted", &mounted);
	//MountDevice("USB3:", "\\Device\\Mass3", "usb3 mounted", &mounted);
	//MountDevice("USB4:", "\\Device\\Mass4", "usb4 mounted", &mounted);
	//MountDevice("USBMU0:", "\\Device\\Mass0PartitionFile\\Storage", "usbmu0 mounted", &mounted);
	//MountDevice("USBMU1:", "\\Device\\Mass1PartitionFile\\Storage", "usbmu1 mounted", &mounted);
	//MountDevice("USBMU2:", "\\Device\\Mass2PartitionFile\\Storage", "usbmu2 mounted", &mounted);
	//MountDevice("USBMU3:", "\\Device\\Mass3PartitionFile\\Storage", "usbmu3 mounted", &mounted);
	//MountDevice("USBMU4:", "\\Device\\Mass4PartitionFile\\Storage", "usbmu4 mounted", &mounted);
	if (mounted != 0)
	{
		xecout.Format("Scanning folders, please wait...");
	}
	else
	{
		xecout.Format("WORKING\n");
	}
}
void __cdecl main()
{
	BOOL quit = FALSE;
	xecout.Create( "game:\\Media\\Fonts\\Arial_16.xpr", 0xFF1F005F, 0xFFFFFFFF ); 	//create console
    xecout.Format( " XBOX 360 JTAG/RGH TEST \n " );									//simple text output to screen
	xecout.Format( " Press Buttons to continue or Back to exit \n");
	while (!quit)
	{
		// get input from controllers
		ATG::GAMEPAD* pGamepad = ATG::Input::GetMergedInput();
		
		// Check for button A press.
		if ((pGamepad->wPressedButtons & XINPUT_GAMEPAD_A))
		{
			xecout.Format("A Button Pressed\n");
		}

		// Check for button B press.
		if ((pGamepad->wPressedButtons & XINPUT_GAMEPAD_B))
		{
			xecout.Format("B Button Pressed\n");
		}

		// Check for button X press.
		if ((pGamepad->wPressedButtons & XINPUT_GAMEPAD_X))
		{
			xecout.Format("X Button Pressed\n");
		}

		// Check for button Y press.
		if ((pGamepad->wPressedButtons & XINPUT_GAMEPAD_Y))
		{
			xecout.Format("Y Button Pressed\n");
		}
		
		// Check for button START press.
		if ((pGamepad->wPressedButtons & XINPUT_GAMEPAD_START))
		{
			mountdrives();
			{
			void launchXexFile();
			{
				//XLaunchNewImage("game:\\Media\\nuiview\\nuiview.xex", 0);		// WORKS
				XLaunchNewImage("HDD:\\DEVKIT\\xbmc360\\xbmc360.xex", 0);		// DONT WORK -- NOW WORKING 
			}
			}
		}
		// Check for button Back press. If true, set done to true and exit the program
		if (pGamepad->wPressedButtons & XINPUT_GAMEPAD_BACK)
		{
			xecout.Format("Application terminated because user decided to exit!\n");
			quit = TRUE;
		}
	}
}

 Any tips or points in the right direction im all ears.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...