Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOfficialFloW committed Apr 15, 2017
0 parents commit 4158ac2
Show file tree
Hide file tree
Showing 307 changed files with 34,328 additions and 0 deletions.
159 changes: 159 additions & 0 deletions adrenaline_compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/*
Adrenaline
Copyright (C) 2016-2017, TheFloW
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __ADRENALINE_COMPAT_H__
#define __ADRENALINE_COMPAT_H__

#define SCE_PSPEMU_FLASH0_PACKAGE_SIZE 0x920000
#define SCE_PSPEMU_EXTRA_MEMORY 0x8B000000

#define SCE_PSPEMU_FRAMEBUFFER 0x74000000
#define SCE_PSPEMU_FRAMEBUFFER_SIZE 0x88000

#define PSP_RAM_SIZE (64 * 1024 * 1024)

#define PSP_SCREEN_WIDTH 480
#define PSP_SCREEN_HEIGHT 272
#define PSP_SCREEN_LINE 512

enum KermitModes {
KERMIT_MODE_NONE,
KERMIT_MODE_UNK_1,
KERMIT_MODE_UNK_2,
KERMIT_MODE_MSFS,
KERMIT_MODE_FLASHFS,
KERMIT_MODE_AUDIOOUT,
KERMIT_MODE_ME,
KERMIT_MODE_LOWIO,
KERMIT_MODE_POCS_USBPSPCM,
KERMIT_MODE_PERIPHERAL,
KERMIT_MODE_WLAN,
KERMIT_MODE_AUDIOIN,
KERMIT_MODE_USB,
KERMIT_MODE_UTILITY,
KERMIT_MODE_EXTRA_1,
KERMIT_MODE_EXTRA_2,
};

enum KermitVirtualInterrupts {
KERMIT_VIRTUAL_INTR_NONE,
KERMIT_VIRTUAL_INTR_AUDIO_CH1,
KERMIT_VIRTUAL_INTR_AUDIO_CH2,
KERMIT_VIRTUAL_INTR_AUDIO_CH3,
KERMIT_VIRTUAL_INTR_ME_DMA_CH1,
KERMIT_VIRTUAL_INTR_ME_DMA_CH2,
KERMIT_VIRTUAL_INTR_ME_DMA_CH3,
KERMIT_VIRTUAL_INTR_WLAN_CH1,
KERMIT_VIRTUAL_INTR_WLAN_CH2,
KERMIT_VIRTUAL_INTR_IMPOSE_CH1,
KERMIT_VIRTUAL_INTR_POWER_CH1,
KERMIT_VIRTUAL_INTR_UNKNOWN_CH1, // <- used after settings
KERMIT_VIRTUAL_INTR_USBGPS_CH1,
KERMIT_VIRTUAL_INTR_USBPSPCM_CH1,
};

typedef struct {
uint32_t cmd; //0x0
SceUID sema_id; //0x4
uint64_t *response; //0x8
uint32_t padding; //0xC
uint64_t args[14]; // 0x10
} SceKermitRequest; //0x80

// 0xBFC00800
typedef struct {
uint32_t cmd; //0x00
SceKermitRequest *request; //0x04
} SceKermitCommand; //0x8

// 0xBFC00840
typedef struct {
uint64_t result; //0x0
SceUID sema_id; //0x8
int32_t unk_C; //0xC
uint64_t *reponse; //0x10
uint64_t unk_1C; //0x1C
} SceKermitReponse; //0x24 or 0x30????

// 0xBFC008C0
typedef struct {
int32_t unk_0; //0x0
int32_t unk_4; //0x4
} SceKermitInterrupt; //0x8

typedef struct SceCtrlDataPsp {
unsigned int TimeStamp; // 0x00
unsigned int Buttons; // 0x04
unsigned char Lx; // 0x05
unsigned char Ly; // 0x06
unsigned char Rx; // 0x07
unsigned char Ry; // 0x08
unsigned char Rsrv[4]; // 0x9
} SceCtrlDataPsp;

enum SaveStateModes {
SAVESTATE_MODE_NONE,
SAVESTATE_MODE_SAVE,
SAVESTATE_MODE_LOAD,
};

enum AdrenalinePspCommands {
ADRENALINE_PSP_CMD_NONE,
ADRENALINE_PSP_CMD_REINSERT_MS,
ADRENALINE_PSP_CMD_SAVESTATE,
ADRENALINE_PSP_CMD_LOADSTATE,
};

enum AdrenalineVitaCommands {
ADRENALINE_VITA_CMD_NONE,
ADRENALINE_VITA_CMD_SAVESTATE,
ADRENALINE_VITA_CMD_LOADSTATE,
ADRENALINE_VITA_CMD_GET_USB_STATE,
ADRENALINE_VITA_CMD_START_USB,
ADRENALINE_VITA_CMD_STOP_USB,
};

enum AdrenalineVitaResponse {
ADRENALINE_VITA_RESPONSE_NONE,
ADRENALINE_VITA_RESPONSE_SAVED,
ADRENALINE_VITA_RESPONSE_LOADED,
};

typedef struct {
int savestate_mode;
int num;
unsigned int sp;
unsigned int ra;

int pops_mode;
char title[128];
char titleid[12];
char filename[256];

int open_homescreen;

int psp_cmd;
int vita_cmd;
int psp_response;
int vita_response;
} SceAdrenaline;

#define ADRENALINE_SIZE 0x4000
#define ADRENALINE_ADDRESS 0xABFFC000

#endif
66 changes: 66 additions & 0 deletions cef/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
all: clean _payloadex _rebootex _binary _systemctrl _popcorn _vshctrl _satelite _recovery bin2h

_payloadex:
make -C payloadex clean
make -C payloadex
cp "payloadex/payloadex.bin" "flash0/payloadex.bin"
make -C payloadex clean
bin2c flash0/payloadex.bin ../user/files/payloadex.h payloadex

_rebootex:
make -C rebootex clean
make -C rebootex
bin2c rebootex/rebootex.bin systemctrl/rebootex.h rebootex
make -C rebootex clean

_binary:
make -C binary clean
make -C binary
bin2c binary/binary.bin systemctrl/binary.h binary
make -C binary clean

_systemctrl:
make -C systemctrl clean
make -C systemctrl
psp-packer systemctrl/systemctrl.prx
cp "systemctrl/systemctrl.prx" "flash0/kd/systemctrl.prx"
make -C systemctrl clean
bin2c flash0/kd/systemctrl.prx ../user/files/systemctrl.h systemctrl

_popcorn:
make -C popcorn clean
make -C popcorn
psp-packer popcorn/popcorn.prx
cp "popcorn/popcorn.prx" "flash0/kd/popcorn.prx"
make -C popcorn clean
bin2c flash0/kd/popcorn.prx ../user/files/popcorn.h popcorn

_vshctrl:
make -C vshctrl clean
make -C vshctrl
psp-packer vshctrl/vshctrl.prx
cp "vshctrl/vshctrl.prx" "flash0/kd/vshctrl.prx"
make -C vshctrl clean
bin2c flash0/kd/vshctrl.prx ../user/files/vshctrl.h vshctrl

_satelite:
make -C satelite clean
make -C satelite
psp-packer satelite/satelite.prx
cp "satelite/satelite.prx" "flash0/vsh/module/satelite.prx"
make -C satelite clean
bin2c flash0/vsh/module/satelite.prx ../user/files/satelite.h satelite
_recovery:
make -C recovery clean
make -C recovery
psp-packer recovery/recovery.prx
cp "recovery/recovery.prx" "flash0/vsh/module/recovery.prx"
make -C recovery clean
bin2c flash0/vsh/module/recovery.prx ../user/files/recovery.h recovery

bin2h:
bin2c flash0/kd/pspbtjnf.bin ../user/files/pspbtjnf.h pspbtjnf
bin2c flash0/kd/pspbtknf.bin ../user/files/pspbtknf.h pspbtknf
bin2c flash0/kd/pspbtlnf.bin ../user/files/pspbtlnf.h pspbtlnf
bin2c flash0/kd/pspbtmnf.bin ../user/files/pspbtmnf.h pspbtmnf
bin2c flash0/kd/pspbtrnf.bin ../user/files/pspbtrnf.h pspbtrnf
11 changes: 11 additions & 0 deletions cef/binary/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
TARGET = binary
OBJS = start.o main.o

CFLAGS = -O2 -Os -G0 -Wall -fshort-wchar -fno-pic -mno-check-zero-division
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LDFLAGS = -nostartfiles -T linkfile.x -nostdlib

PSPSDK = $(shell psp-config --pspsdk-path)
include build_bin.mak
69 changes: 69 additions & 0 deletions cef/binary/build_bin.mak
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# PSP Software Development Kit - http://www.pspdev.org
# -----------------------------------------------------------------------
# Licensed under the BSD license, see LICENSE in PSPSDK root for details.
#
# build.mak - Base makefile for projects using PSPSDK.
#
# Copyright (c) 2005 Marcus R. Brown <[email protected]>
# Copyright (c) 2005 James Forshaw <[email protected]>
# Copyright (c) 2005 John Kelley <[email protected]>
#
# $Id: build.mak 355 2005-06-27 07:38:48Z mrbrown $

# Note: The PSPSDK make variable must be defined before this file is included.
ifeq ($(PSPSDK),)
$(error $$(PSPSDK) is undefined. Use "PSPSDK := $$(shell psp-config --pspsdk-path)" in your Makefile)
endif

CC = psp-gcc
CXX = psp-g++
AS = psp-gcc
#LD = psp-gcc
LD = psp-ld
AR = psp-ar
RANLIB = psp-ranlib
STRIP = psp-strip

# Add in PSPSDK includes and libraries.
INCDIR := $(INCDIR) . $(PSPSDK)/include
LIBDIR := $(LIBDIR) . $(PSPSDK)/lib

CFLAGS := $(addprefix -I,$(INCDIR)) $(CFLAGS)
CXXFLAGS := $(CFLAGS) $(CXXFLAGS)
ASFLAGS := $(CFLAGS) $(ASFLAGS)

LDFLAGS := $(addprefix -L,$(LIBDIR)) $(LDFLAGS)

# Library selection. By default we link with PSPSDK's libc. Allow the
# user to link with Newlib's libc if USE_NEWLIB_LIBC is set to 1.
#PSPSDK_LIBC_LIB = -lpsplibc
#ifeq ($(USE_NEWLIB_LIBC),1)
#PSPSDK_LIBC_LIB = -lc -lpspglue
#endif

# Link with following default libraries. Other libraries should be specified in the $(LIBS) variable.
# TODO: This library list needs to be generated at configure time.
#PSPSDK_LIBS = -lpspdebug
#LIBS := $(LIBS) $(PSPSDK_LIBS) $(PSPSDK_LIBC_LIB) -lpspkernel
#
ifneq ($(TARGET_LIB),)
FINAL_TARGET = $(TARGET_LIB)
else
FINAL_TARGET = $(TARGET).bin
endif

all: $(EXTRA_TARGETS) $(FINAL_TARGET)

$(TARGET).bin: $(TARGET).elf
$(STRIP) -s -O binary $(TARGET).elf -o $(TARGET).bin
-rm -f $(TARGET).elf

$(TARGET).elf: $(OBJS)
-rm -f $(TARGET).elf
$(LINK.c) $^ $(LIBS) -o $(TARGET).elf

$(TARGET_LIB): $(OBJS)
$(AR) cru $@ $(OBJS)

clean: $(EXTRA_CLEAN)
-rm -f $(FINAL_TARGET) $(OBJS)
24 changes: 24 additions & 0 deletions cef/binary/linkfile.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
OUTPUT_FORMAT("elf32-littlemips")
OUTPUT_ARCH(mips)

ENTRY(_start)

SECTIONS
{
. = 0x00010000;
.text.start : {
*(.text.start)
}
.text : {
*(.text)
}
.data : {
*(.data)
}
.rodata : {
*(.rodata)
}
.bss : {
*(.bss)
}
}
Loading

0 comments on commit 4158ac2

Please sign in to comment.