Skip to content

Commit

Permalink
Merge pull request #1 from AnalogMan151/master
Browse files Browse the repository at this point in the history
Added MCR export, fixed hash output, reorganized project folders
  • Loading branch information
dots-tb authored Jul 24, 2019
2 parents 8649fab + 5afe245 commit be975b7
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 171 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
.vscode
59 changes: 41 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,51 @@
TARGET = vita-mcr2vmp
ifeq ($(OS),Windows_NT)
TARGET_EXEC ?= vita-mcr2vmp-win
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
TARGET_EXEC ?= vita-mcr2vmp-linux
endif
ifeq ($(UNAME_S),Darwin)
TARGET_EXEC ?= vita-mcr2vmp-macos
endif
endif

OBJS = aes.o main.o sha1.o
BUILD_DIR ?= ./build
SRC_DIRS ?= ./src ./include

SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s)
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:.o=.d)

LIBS = -lz
INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))

CFLAGS = -s -static -Wall -Wextra -std=c99
all: $(TARGET)
CPPFLAGS ?= $(INC_FLAGS) -s -static -Wall -Wextra -std=c99

$(TARGET): $(OBJS)
@echo "Creating binary $(TARGET)"
$(CXX) $(OBJS) -o $@ $(LIBS) -static -static-libgcc
$(BUILD_DIR)/$(TARGET_EXEC): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)

%.o: %.cpp
@echo "Compiling $^"
$(CXX) $(CFLAGS) -c $^ -o $@ -static -static-libgcc
# assembly
$(BUILD_DIR)/%.s.o: %.s
$(MKDIR_P) $(dir $@)
$(AS) $(ASFLAGS) -c $< -o $@

# c source
$(BUILD_DIR)/%.c.o: %.c
$(MKDIR_P) $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@

# c++ source
$(BUILD_DIR)/%.cpp.o: %.cpp
$(MKDIR_P) $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@


.PHONY: clean

clean:
@echo "Removing all the .o files"
@$(RM) $(OBJS)
$(RM) -r $(BUILD_DIR)

mrproper: clean
@echo "Removing binary"
@$(RM) $(TARGET)
-include $(DEPS)

install: all
@cp $(TARGET) ../bin
MKDIR_P ?= mkdir -p
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
# vita-mcr2vmp
by @dots_tb - signs psx mcr files for use with the vita's psp emulator
by [@dots_tb](https://github.com/dots-tb) - signs PSOne MCR files to create VMP files for use with Sony Vita/PSP and exports MCR files from VMP

With help from the CBPS (https://discord.gg/2nDCbxJ) , especially:

@AnalogMan151

@teakhanirons
[@AnalogMan151](https://github.com/AnalogMan151)
[@teakhanirons](https://github.com/teakhanirons)

## Usage:

Drag and drop a PSX MCR save file onto the exe. It will generate a VMP that you may use with your Vita's PSP emulator.
Drag and drop a PSOne MCR save file onto the program. It will generate a VMP that you may use with your Vita/PSP.
You may also drag and drop a VMP file and extract the contained MCR file for editing or sharing.

Or use CMD:

./vita-mcr2vmp mem.mcr
./vita-mcr2vmp <memorycard.mcr|SCEVMC*.VMP>

## Further Instructions:

### I wanna edit my PSX Save Data from the vita!

1. Grab your save data from here: ux0:/pspemu/PSP/SAVEDATA/<titleid>/SCEVMC<0|1>.VMP
2. Open your save data on the computer with a hexeditor and delete the first 0x80, this will convert it to an MCR.
3. Save it as <name>.MCR.
4. You may now use it with your save editor or emulators(I think) of choice.
5. Follow the USAGE section to convert it back to a VMP. Make sure you place it back to the same location with the same file name.
6. ENJOY!
2. Run VMP file through program to export MCR.
3. You may now use it with your save editor or emulators of choice.
4. Follow the USAGE section to convert it back to a VMP. Make sure you place it back to the same location with the same file name.
5. ENJOY!
File renamed without changes.
2 changes: 1 addition & 1 deletion sha1.h → include/sha1.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ void SHA1Final(
void SHA1(
char *hash_out,
const char *str,
int len);
unsigned int len);

#endif /* SHA1_H */
138 changes: 0 additions & 138 deletions main.c

This file was deleted.

File renamed without changes.
Loading

0 comments on commit be975b7

Please sign in to comment.