Open pcnimdock opened 2 years ago
Hi, Nice find!
My pc is currently not connected to a CRT but I will try to configure it again.
The 0, 0, 0, 0, 0, 1
command is to disable the "progressive screen" mode
https://github.com/sonik-br/GunconUSB/blob/main/src/Guncon2Console/Guncon2.cs#L26
I will have to verify this first byte. It makes sense to be an offset correction indeed. When I was making an GC1 to GC2 adapter for use on a real PS2, I found that virtua cop have a big offset difference.
BTW do you know that a plugin already exists for PCSX2? And it does have per game hard coded offset settings.
Yes, I know the nuvee plugin and I am using it like base for translate to USBqemu-Wheel, this last it's working on linux. The problem with nuvee is that I need to push the game in the combobox in configuration and if this number is really a offset number, i can delete this step. Also I created a bridge with wiimote and a ESP32 to real ps2, and I want ignore the combobox step.
Amazing! This combobox step is why I don't use the emulator with guncon games. Can't promise but I will do my best to put my setup working today and test those commands.
Btw if you find out how to make the gc2 work in real progressive mode (ie: game outputting at 480p to a 480p screen) it will be amazing! It's he holy grail for real guncon2 gaming on a vga crt display.
For nuvee plugin https://github.com/mirror/nuvee/blob/b710557c5812f6fae6d015827cfc88b194ee9ccb/nuvee_ps2_usb%20-%20guncon2%2C%20keyboard%2C%20mouse/ps2_lightgun_list.txt
"- At calibration screen, hold trigger offscreen + press SELECT
change screen: 480i, 480p, 100 Hz ('Progressive Scan' is 480p)"
I 'm gonna to read the code if there are any hack for this.
Ok, in the code https://github.com/mirror/nuvee/blob/b710557c5812f6fae6d015827cfc88b194ee9ccb/nuvee_ps2_usb%20-%20guncon2%2C%20keyboard%2C%20mouse/src/guncon2.cpp //--------------------------------------------
// buttons (default) pad_out[0] = 0xffff & ~PROGRESSIVE_SCAN;
// usually tv scan flag (mode $0100 = interlace) pad_out[0] |= DEVICE.vars[ GUNCON2_PARAM_MODE ]; //---------------------------
pad_out[0] is an unsigned int where is located the buttons states
Also, in the code show a diference with x and y data //--------------------- if( DEVICE.vars[ GUNCON2_PARAM_MODE ] & PROGRESSIVE_SCAN ) { // interlace mode data_x -= (s16) ( DEVICE.vars[ GUNCON2_PARAM_X ] ) / 2; data_y -= (s16) ( DEVICE.vars[ GUNCON2_PARAM_Y ] ) / 2; }
else {
// progressive mode
data_x -= (s16) ( DEVICE.vars[ GUNCON2_PARAM_X ] );
data_y -= (s16) ( DEVICE.vars[ GUNCON2_PARAM_Y ] );
}
//--------------------- I guess it was useful
Edit: May be, pushing 0 in last byte in ControlOut frame, it will force to progressive
This "progressive" mode is for console outputting 480i to a sony tv that internally does 480i > 480p.
This way the input on the GC2 is 480i but it will read 480p on the tv. It defaults to this and it what causes the "rolling x" problem when used on a pc. Older GC2 drivers had this problem until beardypig found the correct command to disable this mode.
It's still unknown if the gc2 does indeed support a real 480p input.
Guncon2 connected and ready top test. Some findings...
The first byte is indeed the horizontal offset
Pointing to an fixed part of the screen (in decimal values)
Command on the left and actual reading on the right, 00 | 315 20 | 300 32 | 300 60 | 280 94 | 265
The third byte changes the vertical offset 00 | 36 20 | 16
Changing the command forces it to output a negative offset. Still need to figure out how to change it to a positive offset. And a very long offset crashes the guncon2 when pointing at the edges of the screen. Had to disconnect the usb and reconnect again to make it work.
WOo! thanks! For a negative comand you need to write 0xFF in the second byte. Examples: 5 -> 0x05 0x00 = {5,0...} 0 -> 0x00 0x00 = {0,0.. } -5 -> 0xFB 0xFF = {251,255...} With windows calculator, in programmer mode, you can show it
-20 -> EC FF -32 -> E0 FF -60 -> C4 FF -94 |-> A2 FF
Cool! Those findings will be handy if I ever make the GC1 to CG2 adapter :)
Need me to test anything more with a real gc2?
Also, beardypig said the GC2 have "Normal/High-Density" and "Progressive/Interlaced" But it was not documented :(
Normal/High-Density mode is indicated by bit 8 of the buttons data and bit ?? indicates Progressive/Interlaced.
In the nuvee plugin, for "Time Crisis - Crisis Zone" and "Vampire Night (U)", have a resolution of 768x768 pixels, may be I can show if there are any extra configuration
Can you try to put Vampire Night in progressive mode and see if it sends any command?
I'm trying now :D
Ok, my findings: At begin,I'm forcing to my emulated guncon to set progressive. When Vampire Night (U) begin, it sends to guncon: SET_REPORT length: 6 14, 0, 0, 0, 0, 1,
Because mode is 1, I put my guncon is setted to interlianced.
When is showed the calibration screen, the game puts: SET_REPORT length: 6 a, 0, 0, 0, 0, 0,
Because mode is 0, I put guncon to progressive. At now in the screen show High Density 2 point calibration.
I probe same on Virtua Cop, but now I have problems with y axis. It's needed more inventigation for me.
Conclusions:
You can query to your guncon2 set to progressive, but it's the guncon2 who accepts this state putting '0' at 0b0001000 in the second byte.
Game is outputting in 480i or 480p? (I think the emulator can show this info. If it's rendering/outputting in 480p, how to enable this?
480i
Would be cool if we could get any guncon2 game to render at 480p :) This link says that Vampire Night supports 480p mode. https://en.everybodywiki.com/List_of_PlayStation_2_games_with_alternative_display_modes
I'm looking for how to do in pcsx2 but i don't find anything. I think that the unique form to do it is connect a playstation 2 in a progressive CRT.
Hi @pcnimdock !
I did some testing with your guncon2 plugin and it's working quite good on windows! You did an amazing job!
I would like to ask for a feature. Can you add "offscreen" mode using the MAME pattern? MAME defined that lightgun is offscreen when X = MAX and Y = MAX... ie: left bottom of the screen.
I think for pcsx2/ps2 an offscreen shot is when x=0 y=0 (from nuvee plugin). At now, the offscreen feature is not implemented. I will change this soon
If you have a guncon2, could you test if changing this number produce any linear change on pointing? Thanks