Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting PCSX2 to render messages to the graphical output
#1
And I'm willing to help when I have free time. But I have some questions first. Anyway:

I believe it is high time that we had message output rendered to the GS output screen in game. E.g. "Save state successfully saved to slot 1" in the actual graphical window, not the console. Console is nice, but I know many of us play full screen and this is something I think the emulator really needs.

Now, in my own admittedly far less complicated programs, I do a similar thing this way: I have a variable for screen output. If my program needs to write a message to the graphical display, it puts it in that variable. If that variable is not 0 length, it is rendered to the display. A counter ticks down while there is data in the variable, and once it hits 0, the variable is blanked. It might be easier to explain in pseudocode
Code:
//this is a program

function SomeFunctionThatDoesStuff
//do stuff
//do stuff
//do stuff that needs message passed
notificationvar="This is a message for the screen"
notificationdelay = 300 //this is in frames
// do more stuff
// do more stuff
// do more stuff
end function

function renderingFunction
//draw pretty pixels
// make shapes
//render crap
//etc
if notificationvar != "" then
      render notificationvar to the screen
      notificationdelay--
      if notificationdelay <= 0 then
           notificationdelay = 0
           notificationvar = ""
      end if
end if
end function

Since we already have the console.writeLn command writing the commands to the console, there is really only three parts to implement this:

1. Determine which messages need to be OSD and locate them
2. make those write to the variable and set it's counter in addition to writing to the console
3. Write a function or code in GSdx to write that variable to the screen

1 and 2 I should be able to manage, even with my limited C++ skills

3 I can't do

So in summary, does everyone agree this is a feature we need, and is there anyone who can do #3?

Notes: I realize I oversimplified the variable itself, It most likely might work best as a 2d array, where the first index is the line number and the second the counter, that way we can have more than a single line. I explained it as I did for simplicity sake.
[Image: vwah44]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply

Sponsored links

#2
http://en.wikibooks.org/wiki/OpenGL_Prog...ndering_01 Tongue2 Not perfect but a good start.

We need to create a texture that contains all letters. To convert text you need to compute
1/ position of the letter on the screen (aka vertex position)
2/ position of the letter on the texture (aka texture coord)

You pack everythings (vertex data) and you ask to draw.

From a performance point of view. The best will be to add those vertex data in the final draw of the frame but might be tedious to change GSdx. For a first run, we could create a hook after the present function (before the flip). I.e.:
GSDevice:116.
Reply
#3
There's GPUdisplayText for ps1 plugins, maybe something for ps2? That is, for the part of sending the message to the plugin before even thinking of drawing it. Some changes to the console class and it could already be sending messages to the gpu plugin, in a "standard" way.
Reply
#4
What do you mean by standard way?
Reply
#5
(03-29-2014, 01:30 PM)KrossX Wrote: Some changes to the console class and it could already be sending messages to the gpu plugin

This is what I was talking about in the OP.
[Image: vwah44]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply
#6
in DX you have a font/text output option, no need to store a texture of fonts and render a texture afaik.

example of it here: http://www.two-kings.de/tutorials/dxgrap...ics09.html

from what i remember, ZeroGS does this
[Image: ref_sig_anim.gif]
Like our Facebook Page and visit our Facebook Group!
Reply
#7
Well it is the same. You just got a higher level function. Easier but it will potentially cost extra draw. Not sure how it will impact the perf. On opengl the couple of extra draw to handle scaling (x2) cost me a couple of FPS.
Reply
#8
Considering that OSD is not used frequently and it's quite useful when it is used, its performance cost - if there's such at all - would be definitely worth it IMO (especially if it only affects performance while displaying the OSD).
[i7-3630qm/gt650m-2G/Win-7] [i7-4500u/R.HD8850m/Win-8.1] [2010-MBA/OSX-10.9.x]. Scroll smoothly with SmoothWheel for Firefox.
Reply
#9
Anyway, in all cases I need to implement the dx function by hand on openGL. Then we see the perf impact (if any)
Reply
#10
(03-30-2014, 02:13 PM)avih Wrote: Considering that OSD is not used frequently and it's quite useful when it is used, its performance cost - if there's such at all - would be definitely worth it IMO (especially if it only affects performance while displaying the OSD).

I agree.
[Image: vwah44]
Gaming: Intel i7 3770k @ 4.2Ghz | R9 290 | 16GB RAM | 480GB(240GB+240GB RAID0) SSD | 3 TB HDD | 1 TB HDD | 500GB HDD
Server: AMD FX 6300 @ 4.4Ghz | GTX 670 | 16GB RAM | 240GB SSD | 320GB HDD
PCSX2 General Troubleshooting FAQ
Reply




Users browsing this thread: 1 Guest(s)