First, I added XBlast modchip detection capability in "CSysInfo::SmartXXModCHIP()" method.
XBlast modchips use the same IO address to report their ID as SmartXX modchips except they generate a 8-bit value (whereas SmartXX only generate a 4-bit).
Since I used the same logic as SmartXX to ID their modchip, I thought it would not be that relevant to code an entirely separate method for detecting an XBlast modchip.
The updated code of the method first retreive the whole byte from 0xF701, check against known values from XBlast modchips and either returns the proper string if found. If no XBlast modchip is found, the same byte is ANDed with 0xF and then checked against known values from SmartXX modchips; just like before.
Here's the new code:
Code: Select all
CStdString CSysInfo::SmartXXModCHIP()
{
// SmartXX ModChip Detection
unsigned char uSmartXX_ID = _inp(0xf701);
if( uSmartXX_ID == 0x11 )
return "Aladdin XBlast";
else if( uSmartXX_ID == 0x15 )
return "XBlast Lite V1";
uSmartXX_ID &= 0xf;
if ( uSmartXX_ID == 1 ) // SmartXX V1+V2
return "SmartXX V1/V2";
else if ( uSmartXX_ID == 2 ) // SmartXX V1+V2
return "SmartXX V1/V2";
else if ( uSmartXX_ID == 5 ) // SmartXX OPX
return "SmartXX OPX";
else if ( uSmartXX_ID == 8 ) // SmartXX V3
return "SmartXX V3";
else
return "None";
}
Secondly, I added proper LCD support in XBMC4Xbox. XBlast LCD uses almost the same logic as SmartXX LCD and so I created a CXBlastLCD class that inherits from CSmartXXLCD class instead of ILCD and overloaded the relevant methods.
The result is a very small class that depends on CSmartXXLCD class. Seeing that this code is in the library portion of the project, would it be preferable to have the CXBlastLCD class inherit directly from ILCD without any dependency on CSmartXXLCD instead?
Finally, I took the liberty to add a new feature called "Power Off On Exit" in the LCD settings. When set to "true" it will turn OFF the LCD when XBMC quits. If set to "false" it will simply display "Playing <name of xbe>". This feature is available to all types of modchips that support LCD (Xenium, SmartXX, Xecuter 3 and XBlast) and have their proper "shutdown" implementation in their Stop() method.
Where should I keep the boolean variable that holds the setting. Currently it's held as a private member of ILCD class and have the traditional "Set/Get" methods that are called when populating the setting (XBMC launch and setting change by user) and quitting the program. Should this setting value be held in the CAdvancedSettings class instead of ILCD?
Side question, should I hide this new setting entry in the GUI menu if there's an entry (let's say "<lcdpoweroffonexit>" set in an "advancedsettings.xml" file?
Thanks