SWILIB API (SG)    
Loading...
Searching...
No Matches
PATCH

Detailed Description

Functions from patches.

Usage: #include <swilib/patch.h>

Warning
Don't use in ELF's.

Data Structures

struct  CHAN_BAN_Q
 GSM Channel item. More...
 
struct  SFN_DATA
 Channels list container. More...
 

Typedefs

typedef struct CHAN_BAN_Q CHAN_BAN_Q
 
typedef struct SFN_DATA SFN_DATA
 

Enumerations

enum  AccessoryTypeID {
  ACC_TYPE_SERIAL_CABLE = 15 ,
  ACC_TYPE_IMS_700 = 29
}
 Accessory types. More...
 
enum  MissedEvent {
  MISSED_EVENT_ALL = 0 ,
  MISSED_EVENT_CALLS = 1 ,
  MISSED_EVENT_SMS = 2 ,
  MISSED_EVENT_OTHER = 3
}
 Missed event types. More...
 

MasterPatch

void RunDispatcher ()
 Run MasterPatch dispatcher.
 
void GetAllPatchesByInject ()
 Unknown.
 
void * GetBuffer (int patch_id)
 [MasterPatch] Get memory buffer for the patch by ID.
 
void RunScaner ()
 Run MasterPatch scaner.
 
void * FreeRAM ()
 Pointer to the free memory for MasterPatch patches.
 

API

char * OpenReadCloseFile (const char *path, void *ram)
 Read file content.
 
char * GetLP (int lgp_id)
 Get message from langpack.
 
void SendMP_cmd (uint16_t cmd, int16_t substract)
 Send cmd to the MediaPlayer.
 
void StrAnsi2Uni (const char *in, uint16_t *out)
 Convert ANSI string to Unicode (1st word - len).
 
void StrUni2Ansi (const uint16_t *in, char *out)
 Convert Unicode string (1st word - len) to ANSI.
 
void DrawPicWithCanvas (int x, int y, int picture)
 Draw image from the PIT table with "canvas" on background.
 
void DrawColorPicWithCanvas (int x, int y, int picture, const char *pen, const char *brush)
 Draw image from the PIT table with "canvas" on background.
 
void DrawText (const WSHDR *text, int x, int y, int font, int w, int h, int align, const char *pen, const char *brush, int inversion)
 Draw a multi-line string.
 
void ProcessFiles (const char *path, void(*callback)(const char *text))
 Read all files in the specified folder and run a callback for each.
 
void PlayVibra (int freq, int duration, int force)
 Play vibration.
 
void PlaySoundVibra (int sound_n, int vibra_freq, int vibra_duration, int vibra_force)
 Play sound with vibration.
 
const WSHDR * CreatePath (const WSHDR *path)
 Recursive mkdir.
 
long Seconds2iTime (int timeval)
 Unknown.
 
long GetFileSize (const char *path)
 Get file size.
 
char GetAccessoryType (void)
 Get the type of current accessory connected to the phone.
 
int GetMissedEventCount (uint32_t event)
 Get missed events count.
 
void gb2ws (WSHDR *destination, const char *source, int size)
 Convert Chinese one-byte C-string to WHSDR.
 
void ws2gb (const WSHDR *source, char *destination, int size)
 Convert WSHDR to the Chinese one-byte C-string.
 

Screen Shooter

void ScreenShoot ()
 Make screenshot.
 

Talking phone

void SpellTime ()
 Spell current time.
 

Channel Banner

SFN_DATA * DATA_N_SFB (void)
 Get list of the GSM channels RX levels.
 

BoBaPack

void * GetConfig (uint32_t id)
 Unknown function.
 
void Vibration (uint32_t power, uint32_t duration)
 Do vibration.
 
void * GetMinAdrScan ()
 Unknown function.
 
void * GetMaxAdrScan ()
 Unknown function.
 

Extending PIT and Shortcuts.

void * ShortcutsTableAddr ()
 Shortcuts table address.
 
void * PictureRelocationTableAddr ()
 Picture relocation table address.
 
uint32_t PictureRelocationBaseAddr ()
 Picture relocation base address.
 
uint32_t NextPictureMagicValue ()
 Magic value for the next picture.
 
void * Additional_PIT_address ()
 Additional PIT address.
 
uint32_t Additional_PIT_start ()
 First PIT number for additional table.
 
uint32_t Additional_PIT_end ()
 Last PIT number for additional table.
 

MiniGPS.

uint32_t MiniGPS ()
 Run MiniGPS patch.
 

Extra Info on ProgressBars.

int ProgressCalculate (int current, int total)
 Calculate current progress by current & total.
 

Chinese patches.

void * GetBuildCanvas (void)
 Unknown.
 
int GetLunarDate (const TDate *date, TDate *lunar_date)
 Convert normal date to the Lunar date.
 
int GetLunarYearID (int year)
 Get Lunar Year ID by year.
 
int GetLunarAnimal (int year)
 Get Lunar Year animal picture by year.
 

Unknown functions from unknown patches.

void CallLibFunByNumber (int func_id)
 Unknown.
 

Data Structure Documentation

◆ CHAN_BAN_Q

struct CHAN_BAN_Q

◆ SFN_DATA

struct SFN_DATA

Typedef Documentation

◆ CHAN_BAN_Q

typedef struct CHAN_BAN_Q CHAN_BAN_Q

Definition at line 29 of file patch.h.

◆ SFN_DATA

typedef struct SFN_DATA SFN_DATA

Definition at line 30 of file patch.h.

Enumeration Type Documentation

◆ AccessoryTypeID

Accessory types.

Enumerator
ACC_TYPE_SERIAL_CABLE 

DCA-510.

ACC_TYPE_IMS_700 

IMS-700.

Definition at line 24 of file patch.h.

◆ MissedEvent

Missed event types.

Enumerator
MISSED_EVENT_ALL 
MISSED_EVENT_CALLS 
MISSED_EVENT_SMS 
MISSED_EVENT_OTHER 

Definition at line 50 of file patch.h.

Function Documentation

◆ RunDispatcher()

void RunDispatcher ( )

Run MasterPatch dispatcher.

Warning
Function from the patch "MasterPatch", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Master+Patch

◆ GetAllPatchesByInject()

void GetAllPatchesByInject ( )

Unknown.

Warning
Function from the patch "MasterPatch", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Master+Patch

◆ GetBuffer()

void * GetBuffer ( int patch_id)

[MasterPatch] Get memory buffer for the patch by ID.

Parameters
patch_iduniq patch ID
Warning
Function from the patch "MasterPatch", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Master+Patch

◆ RunScaner()

void RunScaner ( )

Run MasterPatch scaner.

Warning
Function from the patch "MasterPatch", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Master+Patch

◆ FreeRAM()

void * FreeRAM ( )

Pointer to the free memory for MasterPatch patches.

Warning
Function from the patch "MasterPatch", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Master+Patch

◆ OpenReadCloseFile()

char * OpenReadCloseFile ( const char * path,
void * ram )

Read file content.

Parameters
pathpath to the file
ramunknown
Returns
file content
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ GetLP()

char * GetLP ( int lgp_id)

Get message from langpack.

Parameters
lgp_idlangpack ID
Returns
message
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ SendMP_cmd()

void SendMP_cmd ( uint16_t cmd,
int16_t substract )

Send cmd to the MediaPlayer.

Parameters
cmdcommand
substractmagic value
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API
Deprecated
see mplayer.h and Send_MPlayer_Command

◆ StrAnsi2Uni()

void StrAnsi2Uni ( const char * in,
uint16_t * out )

Convert ANSI string to Unicode (1st word - len).

Parameters
ininput string
outoutput string
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API
Deprecated
use str_2ws or utf8_2ws

◆ StrUni2Ansi()

void StrUni2Ansi ( const uint16_t * in,
char * out )

Convert Unicode string (1st word - len) to ANSI.

Parameters
ininput string
outoutput string
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API
Deprecated
use ws_2str or ws_2utf8

◆ DrawPicWithCanvas()

void DrawPicWithCanvas ( int x,
int y,
int picture )

Draw image from the PIT table with "canvas" on background.

Parameters
x,yimage coordinates
pictureimage number
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ DrawColorPicWithCanvas()

void DrawColorPicWithCanvas ( int x,
int y,
int picture,
const char * pen,
const char * brush )

Draw image from the PIT table with "canvas" on background.

Parameters
x,yimage coordinates
pictureimage number
penreplace black color or NULL
brushreplace background color or NULL (SG and X75 only)
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ DrawText()

void DrawText ( const WSHDR * text,
int x,
int y,
int font,
int w,
int h,
int align,
const char * pen,
const char * brush,
int inversion )

Draw a multi-line string.

You can use UnicodeControlChars for custom formatting of the text.

Parameters
textUTF-16 text
x,yleft+top coordinates
fontfont ID, see SystemFontID
w,hdrawing region size
alignalign flags, see TextAttributesFlags
penstroke color
brushfill color
inversioninvert colors
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ ProcessFiles()

void ProcessFiles ( const char * path,
void(* callback )(const char *text) )

Read all files in the specified folder and run a callback for each.

File content will be passed in the text argument of the callback.

Parameters
pathfolder path (example: 0:\Misc\*)
callbackcallback
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ PlayVibra()

void PlayVibra ( int freq,
int duration,
int force )

Play vibration.

Parameters
freqfrequency of the vibration
durationduration of the vibration
forcerun vibration even if disabled in settings
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ PlaySoundVibra()

void PlaySoundVibra ( int sound_n,
int vibra_freq,
int vibra_duration,
int vibra_force )

Play sound with vibration.

Parameters
sound_nsound ID (if > 0x80, plays with vibra)
vibra_freqfrequency of the vibration
vibra_durationduration of the vibration
vibra_forcerun vibration even if disabled in settings
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ CreatePath()

const WSHDR * CreatePath ( const WSHDR * path)

Recursive mkdir.

Parameters
pathpath for creation
Returns
path
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ Seconds2iTime()

long Seconds2iTime ( int timeval)

Unknown.

Parameters
timevalunknown
Returns
timeval * 0x64 / 6
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ GetFileSize()

long GetFileSize ( const char * path)

Get file size.

Parameters
pathpath to the file
Returns
size in bytes
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ GetAccessoryType()

char GetAccessoryType ( void )

Get the type of current accessory connected to the phone.

Returns
see AccessoryTypeID
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ GetMissedEventCount()

int GetMissedEventCount ( uint32_t event)

Get missed events count.

Parameters
eventsee MissedEvent
Returns
count
Warning
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ gb2ws()

void gb2ws ( WSHDR * destination,
const char * source,
int size )

Convert Chinese one-byte C-string to WHSDR.

Parameters
destinationpointer to the destination WSHDR, which should be large enough to contain the source string
sourceinput C-string to be converted to WSHDR
sizemaximum number of characters to be converted
Warning
Only for Chinese firmwares!
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ ws2gb()

void ws2gb ( const WSHDR * source,
char * destination,
int size )

Convert WSHDR to the Chinese one-byte C-string.

Parameters
sourceinput WSHDR to be converted to C-string
destinationpointer to the destination C-string, which should be large enough to contain the source WSHDR
sizemaximum number of characters to be converted
Warning
Only for Chinese firmwares!
Function from the patch "API", see: https://patches.kibab.com/patches/search.php5?action=search&kw=API

◆ ScreenShoot()

void ScreenShoot ( )

Make screenshot.

Warning
Function from the patch "Screen Shooter", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Screen+Shooter

◆ SpellTime()

void SpellTime ( )

Spell current time.

Warning
Function from the patch "Talking phone", see: https://patches.kibab.com/patches/search.php5?action=search&kw=talking+phone

◆ DATA_N_SFB()

SFN_DATA * DATA_N_SFB ( void )

Get list of the GSM channels RX levels.

Warning
Function from the patch "Channel Banner", see: https://patches.kibab.com/patches/search.php5?action=search&kw=channel+banner
Returns
pointer

◆ GetConfig()

void * GetConfig ( uint32_t id)

Unknown function.

Warning
Function from the patch "BoBaPack", see: https://patches.kibab.com/patches/search.php5?action=search&kw=BoBaPack

◆ Vibration()

void Vibration ( uint32_t power,
uint32_t duration )

Do vibration.

Parameters
powerpower of vibration
durationduration of the vibration
Warning
Function from the patch "BoBaPack", see: https://patches.kibab.com/patches/search.php5?action=search&kw=BoBaPack

◆ GetMinAdrScan()

void * GetMinAdrScan ( )

Unknown function.

Warning
Function from the patch "BoBaPack", see: https://patches.kibab.com/patches/search.php5?action=search&kw=BoBaPack

◆ GetMaxAdrScan()

void * GetMaxAdrScan ( )

Unknown function.

Warning
Function from the patch "BoBaPack", see: https://patches.kibab.com/patches/search.php5?action=search&kw=BoBaPack

◆ ShortcutsTableAddr()

void * ShortcutsTableAddr ( )

Shortcuts table address.

Returns
address

◆ PictureRelocationTableAddr()

void * PictureRelocationTableAddr ( )

Picture relocation table address.

Returns
address
Pointer to the memory:
FLASH

◆ PictureRelocationBaseAddr()

uint32_t PictureRelocationBaseAddr ( )

Picture relocation base address.

Returns
address

◆ NextPictureMagicValue()

uint32_t NextPictureMagicValue ( )

Magic value for the next picture.

Returns
address

◆ Additional_PIT_address()

void * Additional_PIT_address ( )

Additional PIT address.

Returns
address
Pointer to the memory:
FLASH

◆ Additional_PIT_start()

uint32_t Additional_PIT_start ( )

First PIT number for additional table.

Returns
address

◆ Additional_PIT_end()

uint32_t Additional_PIT_end ( )

Last PIT number for additional table.

Returns
address

◆ MiniGPS()

uint32_t MiniGPS ( )

Run MiniGPS patch.

Returns
address

◆ ProgressCalculate()

int ProgressCalculate ( int current,
int total )

Calculate current progress by current & total.

Parameters
currentsomething "current" value
totalsomething "total" value
Returns
0-100
Warning
Function from the patch "Extra Info on ProgressBars", see: https://patches.kibab.com/patches/search.php5?action=search&kw=Extra+Info+on+ProgressBars

◆ GetBuildCanvas()

void * GetBuildCanvas ( void )

Unknown.

Returns
unknown
Warning
Function from the patch "GraphPatchManager", see: https://patches.kibab.com/patches/search.php5?action=search&kw=GraphPatchManager

◆ GetLunarDate()

int GetLunarDate ( const TDate * date,
TDate * lunar_date )

Convert normal date to the Lunar date.

Parameters
datenormal date
[out]lunar_dateoutput for converted date
Returns
0 or error
Warning
Only in Chinese firmware.

◆ GetLunarYearID()

int GetLunarYearID ( int year)

Get Lunar Year ID by year.

Parameters
yeargiven year
Returns
0-11
Warning
Only in Chinese firmware.

◆ GetLunarAnimal()

int GetLunarAnimal ( int year)

Get Lunar Year animal picture by year.

Parameters
yeargiven year
Returns
picture number in PIT
Warning
Only in Chinese firmware.

◆ CallLibFunByNumber()

void CallLibFunByNumber ( int func_id)

Unknown.

Parameters
func_idunknown