Skip to content

Commit

Permalink
support two ways for debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
hrimfaxi committed Jun 26, 2011
1 parent d7351ab commit 5fee319
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
7 changes: 4 additions & 3 deletions popsloader/core/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
TARGET = popscore
OBJS = main.o resolve_nid.o ../common/libs.o ../common/conf.o $(PRO_HOME)/Common/utils.o $(PRO_HOME)/Common/printk.o
#../common/utils.o ../common/vsnprintf.o
# $(PRO_HOME)/Common/utils.o $(PRO_HOME)/Common/printk.o
OBJS = main.o resolve_nid.o ../common/libs.o ../common/conf.o

OBJS += nid_635_to_620.o \
nid_635_to_639.o \
Expand All @@ -16,6 +14,9 @@ CFLAGS = -Os -G0 -Wall -I../common -I$(PRO_HOME)/include -I$(PRO_HOME)/Common

ifeq ($(DEBUG), 1)
CFLAGS += -DDEBUG=1
OBJS += $(PRO_HOME)/Common/utils.o $(PRO_HOME)/Common/printk.o
else
OBJS += ../common/utils.o ../common/vsnprintf.o
endif

LDFLAGS = -mno-crt0 -nostartfiles -L. -L $(PRO_HOME)/libs
Expand Down
4 changes: 1 addition & 3 deletions popsloader/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "strsafe.h"
#include "systemctrl.h"
#include "main.h"
#include "printk.h"

struct ModuleList {
char *path;
Expand Down Expand Up @@ -222,7 +221,7 @@ static int load_start_module(const char *path)
mod = (SceModule2*) sceKernelFindModuleByUID(modid);

if(mod != NULL) {
fix_nid((SceModule2*)mod);
fix_nid((SceModule*)mod);
}

modid = sceKernelStartModule(modid, 0, 0, 0, 0);
Expand Down Expand Up @@ -447,7 +446,6 @@ int module_start(SceSize args, void* argp)

psp_fw_version = sceKernelDevkitVersion();
psp_model = sceKernelGetModel();
// printk_init();
printk_init("ms0:/core.txt");
mount_memory_stick();

Expand Down
14 changes: 12 additions & 2 deletions popsloader/core/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@
#ifndef MAIN_H
#define MAIN_H

#if 0
//#define USE_PRINTK 1
#undef USE_PRINTK

#ifdef USE_PRINTK
#include "printk.h"
#else
#ifdef DEBUG
#define printk pspDebugScreenPrintf
#define printk_init pspDebugScreenInit

static inline void printk_init()
{
pspDebugScreenInit();
}

#else
#define printk(...)
#define printk_init(...)
Expand Down

0 comments on commit 5fee319

Please sign in to comment.