PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
common.c File Reference
#include <stdio.h>
#include <thbase.h>
#include <thsemap.h>
#include <loadcore.h>
#include <sysmem.h>
#include <intrman.h>
#include <sysclib.h>
#include "common.h"
+ Include dependency graph for common.c:

Go to the source code of this file.

Functions

int create_thread (void *func, int priority, void *param)
 
void print_hex_buffer (unsigned char *ptr, int len)
 

Detailed Description

audsrv helpers

Definition in file common.c.

Function Documentation

◆ create_thread()

int create_thread ( void *  func,
int  priority,
void *  param 
)

Helper function to easily create threads

Parameters
functhread procedure
prioritythread priority (usually 40)
paramoptional argument for thread procedure
Returns
thread_id (int), negative on error

Creates a thread based on the given parameter. Upon completion, thread is started.

Definition at line 34 of file common.c.

Referenced by audsrv_cd_play_sectors(), and audsrv_init().

◆ print_hex_buffer()

void print_hex_buffer ( unsigned char *  ptr,
int  len 
)

Helper to print buffer in hex. Useful for debugging.

Parameters
ptrpointer to buffer
lenbuffer length

Definition at line 58 of file common.c.