Advertising (This ad goes away for registered users. You can Login or Register)

Request: Hello World - eboot.bin/.vpk with loop?

Open discussions on programming specifically for the PS Vita.
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Post Reply
User avatar
crait
Posts: 13
Joined: Mon Aug 08, 2016 7:28 pm
Location: Dallas, Texas
Contact:

Request: Hello World - eboot.bin/.vpk with loop?

Post by crait » Mon Aug 08, 2016 7:39 pm

I'm requesting that someone either write or post an example Hello World program that can be compiled using the Vita SDK.

However, there are a few requests that go along with it...
1) Please include a main loop that clears the screen, then prints "Hello world" inside of the loop, so that it does not exit as soon as it's run.
2) Please include info in the makefile that will put everything into a VPK.

Yes, I understand that there is a sample with this, but it escapes immediately and does not include clearing the screen, etc. And yes, I know a .vpk is just a .ZIP file....

Does anyone think that they can upload something like this for me? :D :D :D I would really love you for it.
Advertising
Last edited by crait on Tue Aug 09, 2016 3:25 am, edited 1 time in total.

xyz
Posts: 61
Joined: Thu Jan 20, 2011 7:06 pm

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by xyz » Mon Aug 08, 2016 10:24 pm

https://github.com/vitasdk/samples/tree/master/net/http
Advertising

User avatar
crait
Posts: 13
Joined: Mon Aug 08, 2016 7:28 pm
Location: Dallas, Texas
Contact:

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by crait » Mon Aug 08, 2016 11:02 pm

I've seen gone through this sample, but it does not help...

I want to do something like the following, but this causes the screen to flicker.

Code: Select all

	int i = 0;
	while(true) {
		psvDebugScreenClear(0x00000000);
		i += 1;
		psvDebugScreenPrintf("Count: %d", i);
	}

CptPugsy
Posts: 4
Joined: Mon Aug 08, 2016 11:38 pm

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by CptPugsy » Tue Aug 09, 2016 2:13 am

crait wrote:
I've seen gone through this sample, but it does not help...

I want to do something like the following, but this causes the screen to flicker.

Code: Select all

	int i = 0;
	while(true) {
		psvDebugScreenClear(0x00000000);
		i += 1;
		psvDebugScreenPrintf("Count: %d", i);
	}
I'm no expert here, but couldn't you use a type of event driven loop to stop the flickering?

Code: Select all

	bool quit = false;
	psvDebugScreenClear(0x00000000);
	psvDebugScreenPrintf("Hello, World!\n");
	while (!quit) {
		CheckPad(&pad);
		if (pad.value & START_BUTTON == 1) {
			quit = true;
		}
	}
This code is in no way accurate, just an idea of how it would work with psp2/ctrl.h. No idea how to use these libraries though, we need some documentation. Header files don't contain nearly enough documentation.

User avatar
crait
Posts: 13
Joined: Mon Aug 08, 2016 7:28 pm
Location: Dallas, Texas
Contact:

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by crait » Tue Aug 09, 2016 3:05 am

CpyPugsy, that wouldn't work at all. What I was writing in my above post was a loop that increases the int and displays that number. It should refresh the screen to just show the count one time. While you do include a loop, you don't have a printf inside of that loop. If you moved it inside of the loop, it would print out the hello statement until the screen was full. That's not what I'm looking for.

CptPugsy
Posts: 4
Joined: Mon Aug 08, 2016 11:38 pm

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by CptPugsy » Tue Aug 09, 2016 4:13 am

Ah, ok. Sorry about that. I can't write up one now, I don't even think I have the skills necessary yet (We need some dang documentation!). I know it's not ideal as you don't really learn what is going on in the program, but I can only suggests looking at xerpi's libvita2d library. He has some hello world samples that use his library, and is easy to understand.

xyz
Posts: 61
Joined: Thu Jan 20, 2011 7:06 pm

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by xyz » Tue Aug 09, 2016 11:32 am

If you want the screen not to flicker, you should render to a back buffer and swap them on vsync, at which point it's easier to just use vita2d, it also has a sample here: https://github.com/xerpi/libvita2d

User avatar
crait
Posts: 13
Joined: Mon Aug 08, 2016 7:28 pm
Location: Dallas, Texas
Contact:

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by crait » Wed Aug 10, 2016 3:50 am

Hey, thanks for the pointer, XYZ! So glad that you're helping out around the forums even though you're being a boss hacking the Vita.

I played around with this for a bit and was having various issues with Vita2D. I got the sample to compile, but now I'm trying to edit the makefile to compile it into a eboot.bin or even a .vpk. Do you mind helping me come up with one?

Code: Select all

TITLE_ID = testappid
TARGET   = testapp
OBJS     = main.o image.o

LIBS = -lvita2d -lSceKernel_stub -lSceDisplay_stub -lSceGxm_stub \
	-lSceSysmodule_stub -lSceCtrl_stub -lScePgf_stub \
	-lSceCommonDialog_stub -lfreetype -lpng -ljpeg -lz -lm -lc

PREFIX  = arm-vita-eabi
CC      = $(PREFIX)-gcc
CFLAGS  = -Wl,-q -Wall -O3
ASFLAGS = $(CFLAGS)

all: $(TARGET).vpk

%.vpk: eboot.bin
	vita-mksfoex -s TITLE_ID=$(TITLE_ID) "$(TARGET)" param.sfo
	vita-pack-vpk -s param.sfo -b eboot.bin $@

eboot.bin: $(TARGET).velf
	vita-make-fself $< $@

%.velf: %.elf
	vita-elf-create $< $@

$(TARGET).elf: $(OBJS)
	$(CC) $(CFLAGS) $^ $(LIBS) -o $@

%.o: %.png
	$(PREFIX)-ld -r -b binary -o $@ $^

clean:
	@rm -rf $(TARGET).vpk $(TARGET).velf $(TARGET).elf $(OBJS) \
		eboot.bin param.sfo

vpksend: $(TARGET).vpk
	curl -T $(TARGET).vpk ftp://$(PSVITAIP):1337/ux0:/
	@echo "Sent."

send: eboot.bin
	curl -T eboot.bin ftp://$(PSVITAIP):1337/ux0:/app/$(TITLE_ID)/
	@echo "Sent."

My output shows I can't find part of the library?

Code: Select all

$ make
arm-vita-eabi-gcc -Wl,-q -Wall -O3 main.o image.o -lvita2d -lSceKernel_stub -lSceDisplay_stub -lSceGxm_stub -lSceSysm                 odule_stub -lSceCtrl_stub -lScePgf_stub -lSceCommonDialog_stub -lfreetype -lpng -ljpeg -lz -lm -lc -o testapp.elf
c:/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/4.9.3/../../../../arm-vita-eabi/bin/ld.exe: cannot find -lfr                 eetype
c:/msys64/usr/local/vitasdk/bin/../lib/gcc/arm-vita-eabi/4.9.3/../../../../arm-vita-eabi/bin/ld.exe: cannot find -lpn                 g
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:27: testapp.elf] Error 1
This is weird because I thought I could compile further than this at one point before modifying it.

User avatar
crait
Posts: 13
Joined: Mon Aug 08, 2016 7:28 pm
Location: Dallas, Texas
Contact:

Re: Request: Hello World - eboot.bin/.vpk with loop?

Post by crait » Thu Aug 11, 2016 4:39 am

Anyone reading this post down the line should know that I ended up reinstalling the SDK and toolchain using the following: http://wololo.net/2016/08/10/setup-vita-sdk-windows/

Afterwards, I was able to successfully compile and transfer my files over to my Vita. XYZ's suggestion of using Vita2D was perfect since it was finally able to compile and be packaged up properly. Please use that!

Post Reply

Return to “Programming and Security”