Hacking [Release] Vita Hardware Test

Status
Not open for further replies.

ifrit05

Well-Known Member
OP
Newcomer
Joined
Aug 11, 2014
Messages
85
Trophies
0
Age
33
XP
340
Country
United States
I'm releasing version 1.0 of my homebrew. It has evolved from Vita Button Test to include a much nicer GUI and some extra features.

Now tests sound as well.

yxvB6VE.jpg


Any comments are welcome. Thanks!

Downloads:
v1.0: https://drive.google.com/file/d/0B_lylA38VpPINmpJdHFVQkFxRFU/view?usp=sharing
 
Last edited by ifrit05,
D

Deleted User

Guest
whats the purpose of this homebrew?:unsure:
Looks like a button/screen tester, as well as a battery measure in the top-right.

Great work seeing this though; it's great to see more homebrew pouring into the scene! :)
 

PSSceneIsBestScene

Member
Newcomer
Joined
Sep 23, 2015
Messages
24
Trophies
0
Age
23
XP
152
Country
I'm releasing version 1.0 of my homebrew. It has evolved from Vita Button Test to include a much nicer GUI and some extra features.

Any comments are welcome. Thanks!

You could mention that you copied SMOKE's work and improved on it, instead of pretending it is all your work.
Releases are nice, but you should always give props to the person or software that helped you release yours, it is the courteous thing to do.
Doing so will make it so we avoid things like this:

https://twitter.com/SMOKE587/status/764601221529362433
 
  • Like
Reactions: Zeroba

dfsa3fdvc1

Well-Known Member
Member
Joined
Jan 3, 2015
Messages
226
Trophies
0
XP
214
Country
Albania
I've made a slight improvement to the tester. Cleaned the way directories are handled
I've made it so that touch screen input is drawn onto the onscreen vita image proportionally. So if you're touching the top right part of your screen it's drawn on the top right of the virtual vita.

For convenience I'm going to copy paste my entire index.lua but the relevant lines about the touch screen (near the very bottom) are
if(tx1 + ty1 > 0) then
Graphics.fillCircle( (tx1*( (769-189)/Scr.w) )+168+21 , (ty1*( (469-146)/Scr.h) )+150-3 ,radius, white) --the +21 and -3 is some magic to fix some unknown problem..
end;

I've only been able to test this on a vita TV using the virtual touchscreen input with a dualshock but it should work on all Vitas.
Perhaps this could be a replacement for the x1, y2, debug text output.

And suggestion, change the whitenoise audio clip to something like a piano scale ascending and descending. White noise is probably what a BROKEN vita would sound like.

Code:
----------------------------------------
-- Vita Hardware Test v1.0 by @SMOKE587 --
----------------------------------------

Scr = { w = 960,	--The screen resolution of the vita screen 960x544
		h = 544};
		
-- init  colors
white		= Color.new(255,255,255,255)
yellow		= Color.new(255,255,0,255)

red			= Color.new(255,0,0,255)
lightred	= Color.new(255,102,102,255)

blue		= Color.new(0,0,255,255)
lightblue	= Color.new(102,102,255,255)

imgDir	= "app0:/res/img/"
sndDir	= "app0:/res/snd/"

radius=10

-- init images 
mainbg		= Graphics.loadImage(imgDir .. "mainbg.png")
crossimg	= Graphics.loadImage(imgDir .. "cross.png")
squareimg	= Graphics.loadImage(imgDir .. "square.png")
circleimg	= Graphics.loadImage(imgDir .. "circle.png")
triangleimg	= Graphics.loadImage(imgDir .. "triangle.png")
startimg	= Graphics.loadImage(imgDir .. "start.png")
selectimg	= Graphics.loadImage(imgDir .. "select.png")
rtrigimg	= Graphics.loadImage(imgDir .. "rtrig.png")
ltrigimg	= Graphics.loadImage(imgDir .. "ltrig.png")
upimg		= Graphics.loadImage(imgDir .. "up.png")
downimg		= Graphics.loadImage(imgDir .. "down.png")
leftimg		= Graphics.loadImage(imgDir .. "left.png")
rightimg	= Graphics.loadImage(imgDir .. "right.png")
battlow		= Graphics.loadImage(imgDir .. "battlow.png")
batt2550	= Graphics.loadImage(imgDir .. "batt2550.png")
batt5075	= Graphics.loadImage(imgDir .. "batt5075.png")
batt75100	= Graphics.loadImage(imgDir .. "batt75100.png")
battcharge	= Graphics.loadImage(imgDir .. "battcharge.png")

-- init short button names
cross		= SCE_CTRL_CROSS
square		= SCE_CTRL_SQUARE
circle		= SCE_CTRL_CIRCLE
triangle	= SCE_CTRL_TRIANGLE
start		= SCE_CTRL_START
selct		= SCE_CTRL_SELECT
rtrigger	= SCE_CTRL_RTRIGGER
ltrigger	= SCE_CTRL_LTRIGGER
up			= SCE_CTRL_UP
down		= SCE_CTRL_DOWN
left		= SCE_CTRL_LEFT
right		= SCE_CTRL_RIGHT

-- init sound
Sound.init() 
sndtest = Sound.openOgg(sndDir .. "sndtest.ogg")
Sound.play(sndtest, LOOP)

-- main loop
while true do
	
	-- init sticks/touch stuff
	rx,ry					= Controls.readRightAnalog()
	lx,ly					= Controls.readLeftAnalog()
	tx1,ty1,tx2,ty2		= Controls.readTouch() 
	rtx1,rty1,rtx2,rty2	= Controls.readRetroTouch() 
	
	-- prevent nil concatenation
	if tx2 == nil then
        tx2 = 0
        ty2 = 0
        if tx1 == nil then
            tx1 = 0
            ty1 = 0
        end
    end
    
	-- ditto
    if rtx2 == nil then
        rtx2 = 0
        rty2 = 0
        if rtx1 == nil then
            rtx1 = 0
            rty1 = 0
        end
    end
	
	-- init screen
	Graphics.initBlend()
	Screen.clear()
	
	--init ui
	Graphics.drawImage(0, 0, mainbg)
	Graphics.debugPrint(0, 0, "Vita Hardware Test v1.0 by @SMOKE587", yellow)
	Graphics.debugPrint(0, 30, "LStick X: " .. lx .. " - LStick Y: " .. ly .. " - RStick X: " .. rx .. " - RStick Y: " .. ry .."\nScreen X1: " .. tx1 .. " - Screen X2: " .. tx2 .. " - Screen Y1: " .. ty1 .. " - Screen Y2: "	.. ty2 .."\nRetro X1: " .. rtx1 .. " - Retro X2: " .. rtx2 .. " - Retro Y1: " .. rty1 .. " - Retro Y2: " .. rty2, white)
	Screen.flip()

	-- check for button input
	if Controls.check(Controls.read(), cross) then
		Graphics.drawImage(0, 0, crossimg)
	end
	if Controls.check(Controls.read(), square) then
		Graphics.drawImage(0, 0, squareimg)
	end
	if Controls.check(Controls.read(), circle) then
		Graphics.drawImage(0, 0, circleimg)
	end
	if Controls.check(Controls.read(), triangle) then
		Graphics.drawImage(0, 0, triangleimg)
	end
	if Controls.check(Controls.read(), start) then
		Graphics.drawImage(0, 0, startimg)
	end
	if Controls.check(Controls.read(), selct) then
		Graphics.drawImage(0, 0, selectimg)
	end
	if Controls.check(Controls.read(), rtrigger) then
		Graphics.drawImage(0, 0, rtrigimg)
	end
	if Controls.check(Controls.read(), ltrigger) then
		Graphics.drawImage(0, 0, ltrigimg)
	end
	if Controls.check(Controls.read(), up) then
		Graphics.drawImage(0, 0, upimg)
	end
	if Controls.check(Controls.read(), down) then
		Graphics.drawImage(0, 0, downimg)
	end
	if Controls.check(Controls.read(), left) then
		Graphics.drawImage(0, 0, leftimg)
	end
	if Controls.check(Controls.read(), right) then
		Graphics.drawImage(0, 0, rightimg)
	end
	
	-- init battstats
	battpercent = System.getBatteryPercentage()
	if System.isBatteryCharging() then
		Graphics.drawImage(0, 0, battcharge)
	elseif battpercent >= 75 then
		Graphics.drawImage(0, 0, batt75100)
	elseif battpercent >= 50 then
		Graphics.drawImage(0, 0, batt5075)
	elseif battpercent >= 25 then
		Graphics.drawImage(0, 0, batt2550)
	else Graphics.drawImage(0, 0, battlow)
	end
	
	----TOUCH---
	if(tx1 + ty1 > 0) then
		Graphics.fillCircle( (tx1*( (769-189)/Scr.w) )+168+21 ,  (ty1*( (469-146)/Scr.h) )+150-3 ,radius, red)  --the +21 and -3 is some magic to fix some unknown problem..
	end;
	
	if(tx2 + ty2 > 0) then
		Graphics.fillCircle( (tx2*( (769-189)/Scr.w) )+168+21 ,  (ty2*( (469-146)/Scr.h) )+150-3 ,radius, lightred)  --the +21 and -3 is some magic to fix some unknown problem..
	end;
	------
	
	----REAR------- NOTE REAR TOUCH Y AXIS WAY OFF
	if(rtx1 + rty1 > 0) then
		Graphics.fillCircle( (rtx1*( (769-189)/Scr.w) )+168+21 ,  (rty1*( (469-146)/Scr.h) )+150-3 ,radius, blue)  --the +21 and -3 is some magic to fix some unknown problem..
	end;
	
	if(rtx2 + rty2 > 0) then
		Graphics.fillCircle( (rtx2*( (769-189)/Scr.w) )+168+21 ,  (rty2*( (469-146)/Scr.h) )+150-3 ,radius, lightblue)  --the +21 and -3 is some magic to fix some unknown problem..
	end;
	------
	
	Screen.flip()
	Graphics.termBlend()

end

I wonder if it would be possible to detect what kind of Vita is being used. If it's a original, slim, or TV. That would be cool.
 
Last edited by dfsa3fdvc1,

ifrit05

Well-Known Member
OP
Newcomer
Joined
Aug 11, 2014
Messages
85
Trophies
0
Age
33
XP
340
Country
United States
You could mention that you copied SMOKE's work and improved on it, instead of pretending it is all your work.
Releases are nice, but you should always give props to the person or software that helped you release yours, it is the courteous thing to do.
Doing so will make it so we avoid things like this:

https://twitter.com/SMOKE587/status/764601221529362433

I never even touched his app or seen it before. I was just messing around and having fun learning Lua.

I spent a week creating this app from scratch (with no prior Lua experience).

If he thinks I stole or "copied" he can P.M. me or post here and we can talk it out.

I've made a slight improvement to the tester. Cleaned the way directories are handled
I've made it so that touch screen input is drawn onto the onscreen vita image proportionally. So if you're touching the top right part of your screen it's drawn on the top right of the virtual vita.

For convenience I'm going to copy paste my entire index.lua but the relevant lines about the touch screen (near the very bottom) are
if(tx1 + ty1 > 0) then
Graphics.fillCircle( (tx1*( (769-189)/Scr.w) )+168+21 , (ty1*( (469-146)/Scr.h) )+150-3 ,radius, white) --the +21 and -3 is some magic to fix some unknown problem..
end;

I've only been able to test this on a vita TV using the virtual touchscreen input with a dualshock but it should work on all Vitas.
Perhaps this could be a replacement for the x1, y2, debug text output.

And suggestion, change the whitenoise audio clip to something like a piano scale ascending and descending. White noise is probably what a BROKEN vita would sound like.


I wonder if it would be possible to detect what kind of Vita is being used. If it's a original, slim, or TV. That would be cool.

Wait, are you SMOKE?
If so I was going to attempt to creat a Stuck/Dead Pixel fixer but you already made that? Well, guess that's out of the question...
 
Last edited by ifrit05,

dfsa3fdvc1

Well-Known Member
Member
Joined
Jan 3, 2015
Messages
226
Trophies
0
XP
214
Country
Albania
Wait, are you SMOKE?

No, I'm just messing with you

@PSSceneIsBestScene it's pretty dumb that Smoke is complaining that someone else made a button tester. First the one in this thread uses LPP and Smoke's uses the Vita SDK so it's not possible for them to be direct copies. If Smoke is really going to get upset that someone did something similar he should have gone out of his way to make something not so generic.
It's totally understandable that someone else would make something like this even if they had never seen Smoke's button tester.
 

ifrit05

Well-Known Member
OP
Newcomer
Joined
Aug 11, 2014
Messages
85
Trophies
0
Age
33
XP
340
Country
United States
No, I'm just messing with you

@PSSceneIsBestScene it's pretty dumb that Smoke is complaining that someone else made a button tester. First the one in this thread uses LPP and Smoke's uses the Vita SDK so it's not possible for them to be direct copies. If Smoke is really going to get upset that someone did something similar he should have gone out of his way to make something not so generic.
It's totally understandable that someone else would make something like this even if they had never seen Smoke's button tester.

Me and SMOKE talked it out. Everything is good. Please don't think he's pissed off. I don't want him to think I'm letting you guys think he's an a**hole. :)

Oh thank you for that awesome addition to the code. If, I choose to go any further with this, can I use your additions with accreditation to you?
 
Last edited by ifrit05,
  • Like
Reactions: PSSceneIsBestScene
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan
    The snack that smiles back, Ballsack!
  • Veho @ Veho:
    Nah, family is like the initial party in an RPG, they're just a suggestion but you can ditch them once you level up.
    +1
  • BigOnYa @ BigOnYa:
    I love that analogy
  • K3Nv2 @ K3Nv2:
    People are too closed in over the idea of blood is blood I believe people are people and you can choose the ones you want to be around easily
  • BigOnYa @ BigOnYa:
    Ofcourse you can choose, but Family is bond, no matter, you have to go out of your way for family. Golden rule. "You can choose your friends, but unfortunately, you can cannot choose your family"
  • K3Nv2 @ K3Nv2:
    Yeah but no one said you have to talk to them the only difference is sharing a name
    +1
  • K3Nv2 @ K3Nv2:
    Like how kids are born into a family business that may want to do something different and become a complete disappointment to them
    +1
  • BigOnYa @ BigOnYa:
    True. I have cousins on my dad side I've never spoke to. Only knew of them when going to Grandma's funeral. N still don't speak with them (I tried, left my # with them, have invited them to dinner-nothing) That's life
  • K3Nv2 @ K3Nv2:
    Not saying I'd wish any ill will but I don't want their drama
    +1
  • BigOnYa @ BigOnYa:
    My wifey got some stupid sleep abtinovue thingy that makes noise in bedroom and I can't deal with it, Loud AF. She don't care if I'm in bed with her now, so I feel like I'm free again, I can sleep wherever, whenever. I just wondering how long this will last.
  • Veho @ Veho:
    It's like yeah, we have a few genes in common, but then again we have genes in common with a banana.
    +1
  • Veho @ Veho:
    So is your wife single now?
    +2
  • BigOnYa @ BigOnYa:
    Sure, as long as you can deal with a generator sound at night
  • BigOnYa @ BigOnYa:
    And she ain't already at @K3Nv2 house.
  • K3Nv2 @ K3Nv2:
    Pull the plug
  • Veho @ Veho:
    Pull my finger.
  • AncientBoi @ AncientBoi:
    [farrrrrrrrrt]
  • TraderBoom @ TraderBoom:
    Оne more
  • TraderBoom @ TraderBoom:
    :поклон::rofl2:
  • AncientBoi @ AncientBoi:
    [fart]
  • BakerMan @ BakerMan:
    (burps AncientBoi's fart and Xdqwerty's yawn away)
  • fluff663 @ fluff663:
    Good morning everyone!
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Why was Dragon Quest IX only on the DS.... Game is worthy of a remake
  • BakerMan @ BakerMan:
    if being attractive is a crime then my only charges are the war crimes i committed in kyrgyzstan
  • BakerMan @ BakerMan:

    YALL SEEING THIS?
    BakerMan @ BakerMan: YALL SEEING THIS?