xboxscene.org forums

Pages: [1] 2 3

Author Topic: Temp Information In Xdk  (Read 288 times)

axc97c

  • Archived User
  • Jr. Member
  • *
  • Posts: 55
Temp Information In Xdk
« 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
Logged

hfmls

  • Archived User
  • Sr. Member
  • *
  • Posts: 347
Temp Information In Xdk
« Reply #1 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?
Logged

axc97c

  • Archived User
  • Jr. Member
  • *
  • Posts: 55
Temp Information In Xdk
« Reply #2 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
Logged

axc97c

  • Archived User
  • Jr. Member
  • *
  • Posts: 55
Temp Information In Xdk
« Reply #3 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
Logged

axc97c

  • Archived User
  • Jr. Member
  • *
  • Posts: 55
Temp Information In Xdk
« Reply #4 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
Logged

Jbonzo

  • Archived User
  • Full Member
  • *
  • Posts: 109
Temp Information In Xdk
« Reply #5 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)
Logged

hfmls

  • Archived User
  • Sr. Member
  • *
  • Posts: 347
Temp Information In Xdk
« Reply #6 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
Logged

aubrey_76

  • Archived User
  • Jr. Member
  • *
  • Posts: 76
Temp Information In Xdk
« Reply #7 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.
Logged

hfmls

  • Archived User
  • Sr. Member
  • *
  • Posts: 347
Temp Information In Xdk
« Reply #8 on: February 11, 2010, 01:46:00 AM »

ask the coder biggrin.gif
Logged

JQE

  • Archived User
  • Jr. Member
  • *
  • Posts: 55
Temp Information In Xdk
« Reply #9 on: February 12, 2010, 11:36:00 AM »

Anyone help with the Temperature Readings in the XDK?
Logged

p4r0l3

  • Archived User
  • Full Member
  • *
  • Posts: 194
Temp Information In Xdk
« Reply #10 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?
Logged

hfmls

  • Archived User
  • Sr. Member
  • *
  • Posts: 347
Temp Information In Xdk
« Reply #11 on: February 18, 2010, 03:28:00 AM »

yes
Logged

hemah

  • Archived User
  • Newbie
  • *
  • Posts: 2
Temp Information In Xdk
« Reply #12 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
Logged

dstruktiv

  • Archived User
  • Full Member
  • *
  • Posts: 204
Temp Information In Xdk
« Reply #13 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).
Logged

dakaku

  • Archived User
  • Full Member
  • *
  • Posts: 102
Temp Information In Xdk
« Reply #14 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.
Logged
Pages: [1] 2 3