xboxscene.org forums

Xbox360 Forums => Xbox360 Software Forums => XeXDK development => Topic started by: axc97c on February 10, 2010, 02:58:00 AM

Title: Temp Information In Xdk
Post by: axc97c on February 10, 2010, 02:58:00 AM
Hello

Do anyone know how i can get the temperature information to display in the xdk? (Want to add this to the freestyle dash)

Thanks

Adam
Title: Temp Information In Xdk
Post by: hfmls on February 10, 2010, 04:30:00 AM
yes, if someone could help would be great (IMG:style_emoticons/default/smile.gif)
xexmenu guys maybe?
Title: Temp Information In Xdk
Post by: axc97c on February 10, 2010, 08:51:00 AM
Im also looking for info on how to stop the disk being ejected kicking freestyle dash back to the ms dashboard?

Can anyone help please?

Adam
Title: Temp Information In Xdk
Post by: axc97c on February 10, 2010, 10:05:00 AM
Had a little more progress on this.

The xexmenu has the following usign Xextool.exe...

Xex Info
  Devkit
  Uncompressed
  Not-Encrypted
  Title Module
  No Forced Reboot
  Has Secure Sockets

I think the thing that allows disc swaps is No Forced Reboot. Ive been through all the Privelage Values available, and havent found this flag. Anyone know how to set this on a xex?

Just for info, i found the following privelage values...

1    Foreground Tasks
2    No ODD Mapping
3   Handles MCE Input
4   Restricted HUD Features
5   Handles Gamepad Disconnect
6   Has Secure Sockets
7   Xbox1 Interoperability
8   Dash Context
9   Uses Game Voice Channel
10   Pal 50 Incompatable
11   Insecure Utility Drive Support
12   Xam Hooks
13   PII
14   Cross Platform System Link
15   Multidisk Swap
16   Supports Insecure Multidisc Media
17   AntiPiracy25 Media
18   No Confirm Exit
19   Allow Background Downloading
20   Create Persistable Ram Drive
21   Inherit Persistent ram drive
22   Allow HUD vibration
23   Allow Access to Both Utility Partitions
24   Handles input for IPTV
25   Prefers Big Button Input


Some of which sound interesting. 6 is used to enable networking.

Tried 15 and 16 for the disc swap but no success.

Adam
Title: Temp Information In Xdk
Post by: axc97c on February 10, 2010, 10:44:00 AM
I forgot to test privelage 0, which is No Forced Reboot. Disc swap problem solved, i can now get on with writing the disc copy stuff.

Still need info on temp readings if anyone can help.

Also, setting the clock by code.

Adam
Title: Temp Information In Xdk
Post by: Jbonzo on February 10, 2010, 01:59:00 PM
So excited to see a new version of your awesome dash (IMG:style_emoticons/default/biggrin.gif)
Title: Temp Information In Xdk
Post by: hfmls on February 10, 2010, 02:09:00 PM
i can confirm it's gonna be a complete XEXMENU replacer.

it has it all! and pretty too

This post has been edited by hfmls: Feb 10 2010, 10:09 PM
Title: Temp Information In Xdk
Post by: aubrey_76 on February 10, 2010, 05:58:00 PM
QUOTE(hfmls @ Feb 10 2010, 04:09 PM) View Post

i can confirm it's gonna be a complete XEXMENU replacer.

it has it all! and pretty too



Cool....so this is going to boot from NXE from the get go????......no more shortcut making and such????....this would be awesome.
Title: Temp Information In Xdk
Post by: hfmls on February 11, 2010, 01:46:00 AM
ask the coder biggrin.gif
Title: Temp Information In Xdk
Post by: JQE on February 12, 2010, 11:36:00 AM
Anyone help with the Temperature Readings in the XDK?
Title: Temp Information In Xdk
Post by: p4r0l3 on February 17, 2010, 01:24:00 PM
Bump, i'm also interested in temp output. Would be a perfect addition to Freestyle, or even to always be displayed in the corner of XeXMenu. Right now it's looking like Freestyle will be my dash of choice. Obviously the XeDev team has figured out how to read the temperature sensors, as they are present in the XeXMenu configuration dialog. Perhaps we should ask them via their forums or IRC?
Title: Temp Information In Xdk
Post by: hfmls on February 18, 2010, 03:28:00 AM
yes
Title: Temp Information In Xdk
Post by: hemah on February 18, 2010, 05:21:00 PM
I have included source code which will allow you to read the temps and set the front panel LEDs color.  It's a work in progress that I only take credit for putting the sources and info together, the actual calls and values came from other sources which I have annotated in the code.

With out further ado:

smc_constants.h
CODE
//Thanks to www.free60.org/SMC for helping me get front LEDs right
#pragma once
#ifndef _SMC_CONSTANTS_H
#define _SMC_CONSTANTS_H

//sorry for the extreme amount of constants trying to make functions
//easier to use

//Power LED
#define POWER_LED_BLINK            0x10
#define POWER_LED_DEFAULT        0x02
#define POWER_LED_ON            0x01
#define POWER_LED_OFF            0X03

//Quadrant LEDs
//NOTE: LED constants are determined with console laying down
//        with LED color bits being, starting from tope left 1, 2, 4, 8

//Thanks to unknown v2 for the following
typedef enum _LEDState
{
    OFF        = 0x00,
    RED        = 0x08,
    GREEN    = 0x80,
    ORANGE    = 0x88
}LEDState;


#endif


smc.h

CODE
//Thanks to tmbinc for smc.c
#pragma once
#ifndef _SMC_H
#define _SMC_H

#include
#include "smc_constants.h"

//Call to SMC message function in xboxkrnl.lib
extern "C" void __stdcall HalSendSMCMessage(LPVOID input, LPVOID output);   //thanks to cory1492

class smc
{
    public:
        void SetPowerLED(unsigned char command, bool animate);
        void SetLEDS(LEDState s1, LEDState s2, LEDState s3, LEDState s4);    //Thanks unknown v2
        void GetTemps(float *temps, bool celsius);

    private:
};

#endif


smc.cpp

CODE
#include "smc.h"
#include



//Usage: command is one of the POWER_LED constants from smc_constant.h
//         animate is true for ring LED startup light sequence
void smc::SetPowerLED(unsigned char command, bool animate)
{
    unsigned char msg[0x10];

    memset(msg, 0x00, 0x10);
    msg[0] = 0x8c;
    msg[1] = command;
    msg[2] = (animate ? 0x01 : 0x00);

    HalSendSMCMessage(msg, NULL);
}


//Usage: color is one of LED constants from smc_constant.h
void smc::SetLEDS(LEDState s1, LEDState s2, LEDState s3, LEDState s4)
{
    unsigned char msg[0x10];
    msg[0] = 0x99;
    msg[1] = 0x01;
    msg[2] = ((s1>>3) | (s2>>2) | (s3>>1) | (s4));    //Thanks unknown v2
    HalSendSMCMessage(msg, NULL);
}

//Usage:  temps contains the returned temperature values
//          temps[0] = CPU
//          temps[1] = GPU
//          temps[2] = EDRAM
//          temps[3] = MB
void smc::GetTemps(float *temps, bool celsius)
{
    unsigned char msg[0x10];
    unsigned char values[0x10];
    int i;

    memset(msg, 0x00, 0x10);
    memset(values, 0x00, 0x10);

    msg[0] = 0x07;

    HalSendSMCMessage(msg, values);

    for(i=0; i<4; i++)
        temps = (values[i * 2 + 1] | (values[i * 2 +2] <<8)) / 256.0;        

    if(!celsius)
        for(i=0; i<4; i++)
            temps = (9/5) * temps + 32;
}


This post has been edited by hemah: Feb 19 2010, 01:33 AM
Title: Temp Information In Xdk
Post by: dstruktiv on February 18, 2010, 06:46:00 PM
Ask [cOz] or Cpasjuste on EFNET - I'm sure either of them will happily give out the code that XexMenu uses. It's quite basic just grabs temps from the SMC but it's formatted nicely and differentiates each different sensor (cpu, gpu, M/B).
Title: Temp Information In Xdk
Post by: dakaku on February 18, 2010, 11:38:00 PM
@ hemah, would be great if this could be put into the kernel...so it is always present. Nice work.
Title: Temp Information In Xdk
Post by: unknown v2 on February 20, 2010, 08:32:00 PM
QUOTE(xtrminatr @ Feb 20 2010, 10:28 PM) View Post

It'd be cool if the LED changing could be incorporated even without a temp reading, would love to have a working box and the red LEDs wink.gif


That is already possible, as you can see in the code.
Title: Temp Information In Xdk
Post by: hemah on February 20, 2010, 08:34:00 PM
Slow to the draw, thanks unknown. Maybe I'll eventually figure out how to disassemble the kernel with IDA and add this to it while I add fan speed changing to header.  Anyone with info or a tut PM me here or on xboxhacker.
Title: Temp Information In Xdk
Post by: segobi on February 21, 2010, 01:25:00 AM
CODE

smc MeinSMC;
float * temperaturen;

MeinSMC.GetTemps(temperaturen,true);
//    temps[0] = CPU
//          temps[1] = GPU
//          temps[2] = EDRAM
//          temps[3] = MB
string temperaturenstring;
temperaturenstring = sprintfa("CPU: %.1f, GPU: %.1f , EDRAM: %.1f, MB: %.1f",temperaturen[0],temperaturen[1],temperaturen[2],temperaturen[3]);

console.Format("Temperaturen: %s\n",temperaturenstring);


console.Format("Setting LEDs... ");

MeinSMC.SetLEDS(RED,GREEN,RED,GREEN);
wait2s();
MeinSMC.SetLEDS(GREEN,RED,GREEN,RED);


Title: Temp Information In Xdk
Post by: dakaku on February 21, 2010, 02:26:00 AM
Well thats for the (not so near) future but anyway:
Would be nice if you could make a patcher for the kernel, if that is possible.
Then everyone could decide if they want it.
And different temperature areas for the different motherboards, maybe custom temperature areas within the patcher.
Title: Temp Information In Xdk
Post by: segobi on February 21, 2010, 02:44:00 AM
QUOTE(dakaku @ Feb 21 2010, 10:26 AM) View Post

Well thats for the (not so near) future but anyway:
Would be nice if you could make a patcher for the kernel, if that is possible.
Then everyone could decide if they want it.
And different temperature areas for the different motherboards, maybe custom temperature areas within the patcher.



rofl wtf are you talking about ?
Title: Temp Information In Xdk
Post by: dakaku on February 21, 2010, 03:52:00 AM
QUOTE(segobi @ Feb 21 2010, 10:44 AM) View Post

rofl wtf are you talking about ?

read the thread and consider thinking before you hit the "add reply" button...
(
If the temperature could be displayed by the led ring, this should be put into the kernel.
If it would be put into the kernel, youd have to consider that different mobo revs run on different temperature.
If we'd have a patcher to include this into the kernel, the patcher (once it exists) could be easy changed to set custom temperature ranges for the different led colours.
Plus a patch would most likely be built without xdk.
)
Title: Temp Information In Xdk
Post by: dakaku on February 21, 2010, 05:01:00 AM
Wish i could edit my post.
Sorry @segobi, my reply which you didnt understand wasnt meant to be a reply to your post.
I should have quoted hemah. That caused the missunderstanding.
Title: Temp Information In Xdk
Post by: BladeWing on February 21, 2010, 05:03:00 AM
Thats would be fraking awesome !!!

Like MB temp would be on the 3rd led and would change colour.

15 degrees = Green
30 degrees = Orange
45+ degrees = Red


And maybe fade in/out the diferent colors to show just how hot it is.

Add in all 4 leds 1 for each piece (CPU/GPU/EDRAM/MB) it would be one hell of a light show !!!
Title: Temp Information In Xdk
Post by: p4r0l3 on February 22, 2010, 02:53:00 PM
You need the XDK & visual studio 2005 sp1. You'll have to edit the code in by hand & recompile Freestyle.

Simple copy-pasta won't do it, you need some coding experience
Title: Temp Information In Xdk
Post by: Porta360 on February 22, 2010, 02:58:00 PM
LED changing to indicate temp. now that's saying something.
Title: Temp Information In Xdk
Post by: p4r0l3 on February 23, 2010, 07:29:00 PM
I can confirm the LED setting & temp info works from this supplied code. lovin red->orange->red->orange
Title: Temp Information In Xdk
Post by: BladeWing on February 25, 2010, 08:30:00 AM
Seems like some people like the Temp Led Idea biggrin.gif

Now, i would do it, but i have limited coding experience on my pc, let alone the 360, so maybe someone will figure out how to do it, for it would be super fancy pants !!! biggrin.gif
Title: Temp Information In Xdk
Post by: p4r0l3 on February 25, 2010, 10:30:00 AM
QUOTE
Seems like some people like the Temp Led Idea


Got it working here, but can only post ya the code. Check it here:
http://forums.xbox-s...o...6895&st=27#
Title: Temp Information In Xdk
Post by: BladeWing on February 25, 2010, 03:10:00 PM
Im unable to test this at the moment. Bloody Jtag'ed xbox needs a re-flow.

Anyway, does it actually do the led too ?? If so, sweet as cherry pies man  biggrin.gif
Title: Temp Information In Xdk
Post by: p4r0l3 on February 26, 2010, 10:38:00 AM
QUOTE(DarthMingus @ Feb 26 2010, 08:41 AM) View Post

Wow, this is really fantastic! THANK YOU!

On the 360 thing: How is this JTAG Hack any different from the previous 360 firmware cracks? Also, there are a few things that make me not excited about this:

1. The emulators are going to be new/buggy. The XBox1 emus have been refined for years. Its going take a while for the ball to get rolling.

2. I don't think porting the Xbox1 (or PC) emulators is an option. Its my understanding that the 360 is running on a PPC derivative CPU.

3. 360s break, a lot. Every one of my friends that has (had) one have have them crap out multiple times. They were really poorly designed.

Just my 2 cents. smile.gif


Yeah it constantly refreshes temps & adjusts LEDs accordingly (as long as Freestyle is running)
When you launch a game the leds stay @ whatever they last read when you exited Freestyle. They update normally again if you go back to it.

Will be a long time before we can add led changing support to the kernel (so the leds can update in-game)
Title: Temp Information In Xdk
Post by: metalguitarist112 on February 26, 2010, 12:13:00 PM
Could anyone send me or upload the files? I know virtually nothing about coding.