Jump to content



1

Lightgun detection incorrect


16 replies to this topic

#1 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Tue Dec 27, 2011 9:35 AM

I am using Eckhard Stolberg's light gun detection routing modified to work on the right controller port. However for some reason the detection code doesn't work as the cross-hair sprite isn't moved to where the player fired his light gun. I have tested my lightning with his GUNTEST binary to verify that my light gun isn't at fault and verified that the light gun is working. I have attached the latest version of my source code for reference. Any assistance in this matter would be greatly appreciated.

Sincerely,

Primordial Ooze

Attached Files



#2 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Thu Jan 19, 2012 12:35 PM

View PostPrimordial Ooze, on Tue Dec 27, 2011 9:35 AM, said:

I am using Eckhard Stolberg's light gun detection routing modified to work on the right controller port. However for some reason the detection code doesn't work as the cross-hair sprite isn't moved to where the player fired his light gun. I have tested my lightning with his GUNTEST binary to verify that my light gun isn't at fault and verified that the light gun is working. I have attached the latest version of my source code for reference. Any assistance in this matter would be greatly appreciated.

Sincerely,

Primordial Ooze
We it's been almost a month and 100+ views and not a single reply has been made. There has been 13 downloads of the source code, yet still no solutions? Can someone please look into this as i really want to start this up again.

Sincerely,

Primordial Ooze

#3 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,782 posts
  • Busy bee!
  • Location:North, England

Posted Thu Jan 19, 2012 1:05 PM

View PostPrimordial Ooze, on Thu Jan 19, 2012 12:35 PM, said:

We it's been almost a month and 100+ views and not a single reply has been made. There has been 13 downloads of the source code, yet still no solutions? Can someone please look into this as i really want to start this up again.

A better debugging strategy would be :-

- Modify Eckhard's original light gun source to use a different port and verify it is working. Make the same changes to your code (if different to what you have now).
- If that doesn't work modify your code to fake a lightgun trigger when a normal stick fire button is pressed. E.g. hard code x and y coordinates and watch them being processed in your code as you single step through it.

You need to find where the bug(s) are, so isolating blocks of functionality is the only way to do it.

#4 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Thu Jan 19, 2012 2:10 PM

View PostGroovyBee, on Thu Jan 19, 2012 1:05 PM, said:

View PostPrimordial Ooze, on Thu Jan 19, 2012 12:35 PM, said:

We it's been almost a month and 100+ views and not a single reply has been made. There has been 13 downloads of the source code, yet still no solutions? Can someone please look into this as i really want to start this up again.

A better debugging strategy would be :-

- Modify Eckhard's original light gun source to use a different port and verify it is working. Make the same changes to your code (if different to what you have now).
- If that doesn't work modify your code to fake a lightgun trigger when a normal stick fire button is pressed. E.g. hard code x and y coordinates and watch them being processed in your code as you single step through it.

You need to find where the bug(s) are, so isolating blocks of functionality is the only way to do it.
I modified the code to meet both conditions above. I also removed the screen flashing code to make debugging easier both in code and the eyes. I still haven't managed to get it working and am very frusterated as there doesn't seem to be any problems in the logic of my code. I have tested my lightgun and it is working propperly. I have attached the latest version of my source code with the modifications stated above. Any assistance would be greatly appreciated.

Sincerely

Primordial Ooze

Attached Files



#5 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Jan 19, 2012 2:40 PM

Where does the cross-hair move to? Is there a constant offset or does it move just randomly?

#6 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,992 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Jan 19, 2012 2:56 PM

View PostPrimordial Ooze, on Thu Jan 19, 2012 12:35 PM, said:

We it's been almost a month and 100+ views and not a single reply has been made.

Considering you're using an uncommon controller for the 2600, I'm not surprised. It's difficult to diagnose problems w/out the appropriate equipment.

#7 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Thu Jan 19, 2012 3:26 PM

View PostThomas Jentzsch, on Thu Jan 19, 2012 2:40 PM, said:

Where does the cross-hair move to? Is there a constant offset or does it move just randomly?
Nope it doesn't move at all. I am not using a constant offset, just purely the lightgun code you posted in another thread with no modifications. Any assistance would be greatly appreciated.

Sincerely,

Primordial Ooze

P.S. Yes, the lightgun is an uncommon controller which is why I'm trying to create more demand for it. Of course you can buy it from ebay for about $40.

Edited by Primordial Ooze, Thu Jan 19, 2012 3:27 PM.


#8 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,782 posts
  • Busy bee!
  • Location:North, England

Posted Thu Jan 19, 2012 3:59 PM

How about in the faking the trigger code you increment the trigger X coordinate to see the sprite move when you hit fire on the stick. Do the same with Y too.

#9 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Jan 19, 2012 4:22 PM

If I would know how to read the lightgun, I might be able to help. :)

The HitCycleAdjust loop looks very odd, but that could be because see above.

#10 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Fri Jan 20, 2012 9:21 AM

View PostGroovyBee, on Thu Jan 19, 2012 3:59 PM, said:

How about in the faking the trigger code you increment the trigger X coordinate to see the sprite move when you hit fire on the stick. Do the same with Y too.
Done and it still does work. Seems it may be skipping HitCycleAdjust but, not sure and even then why..

View PostThomas Jentzsch, on Thu Jan 19, 2012 4:22 PM, said:

If I would know how to read the lightgun, I might be able to help. :)

The HitCycleAdjust loop looks very odd, but that could be because see above.
For your first question see this post. For your second question the HitCycleAjust was take from Eckhard Stolberg's light gun detection routine which was taken from Sentinel.

Any assistance would be greatly appreciated.

Sincerely,

Primordial Ooze

Attached Files



#11 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,782 posts
  • Busy bee!
  • Location:North, England

Posted Fri Jan 20, 2012 9:32 AM

Please can you post Eckhard's source code that you modified to work in the 2nd port.

#12 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Fri Jan 20, 2012 10:15 AM

View PostGroovyBee, on Fri Jan 20, 2012 9:32 AM, said:

Please can you post Eckhard's source code that you modified to work in the 2nd port.
I have attached the original source code(guntest5.asm) and the modified source code(QuackerBlaster.asm) to this post. As you will see it is largely unchanged becides replacing INPT4 with INPT5 and bit4 of SWCHA with bit0 of SWCHA based on the reference provided in the link i posted above. Any assistance would be greatly appreciated.

Sincerely,

Primordial Ooze

Attached Files



#13 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Fri Jan 20, 2012 4:09 PM

I cannot see anything wrong in the positioning code. But I cannot see the crosshair AT ALL. Are you sure your display code works?

#14 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Sat Jan 21, 2012 1:44 PM

View PostThomas Jentzsch, on Fri Jan 20, 2012 4:09 PM, said:

I cannot see anything wrong in the positioning code. But I cannot see the crosshair AT ALL. Are you sure your display code works?
If the display wasn't working then why is the duck being displayed??? Any assistance would be greatly appreciated.

Sincerely,

Primordial Ooze

#15 GroovyBee OFFLINE  

GroovyBee

    7800 Developer

  • 5,782 posts
  • Busy bee!
  • Location:North, England

Posted Sat Jan 21, 2012 1:55 PM

What happens if you single step the code and simulate a light gun trigger press 25 scan lines down and half way into the screen. What coordinates is the cross hair positioned to?

#16 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!

  • 16,745 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Sat Jan 21, 2012 1:58 PM

View PostPrimordial Ooze, on Sat Jan 21, 2012 1:44 PM, said:

If the display wasn't working then why is the duck being displayed???
Because that's different code. Can you see the crosshair AT ALL? I can't.

#17 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Wed Feb 1, 2012 9:51 AM

If i modify the x/y position of the crosshair and step through the code, the crosshair appears on screen. However when i press the lightgun trigger normally it doesn't.

Sincerely,

Primordial Ooze




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users