Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Tracing a line with the Light Phaser (was: Dumb question about the light phaser)

Reply to topic
Author Message
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Tracing a line with the Light Phaser (was: Dumb question about the light phaser)
Post Posted: Wed Jun 24, 2015 1:21 pm
If I understand the docs right, the light phaser can only be used for individual shots by pulling and releasing the trigger, and it can't be used to trace a line while holding down the trigger, right?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8653
  • Location: Paris, France
Reply with quote
Post Posted: Wed Jun 24, 2015 2:36 pm
The screen needs to be whitened so that'd be hard unless you are willing to have a constant white flashing screen. Also some games capture the information for multiple frames to make an average suggesting that single capture isn't precise enough.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Wed Jun 24, 2015 2:43 pm
Too bad, I just had an idea for a homebrew game, but I guess it's just unfeasible. Thanks.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14749
  • Location: London
Reply with quote
Post Posted: Wed Jun 24, 2015 4:39 pm
The gun reading code needs two things:

- A light colour screen
- Lots of CPU

The button is almost irrelevant. In theory you could then plot a crosshair where it's pointing, or even draw the detected transition pixels (in a light colour), for every frame with no flashing. I think it would be a useful tech demo to allow testing light phasers and to demonstrate how noisy the data is, as well as showing how inaccurate emulators are...

So you could also draw a line, but it would interfere unless its colour was also light enough to trigger the gun. Maybe you could draw white on light grey (or maybe a pale colour). In an emulator, colours don't matter so anything would work.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Wed Jun 24, 2015 11:15 pm
The fact that the "Light Phaser Reading" section is literally the only empty one in the Code Snippets section isn't motivating, either.

I know I never did homebrew before and I might be setting the bar too high for a first timer but I'm crazy like that, I can slumber for years and have weird ideas all of a sudden.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14749
  • Location: London
Reply with quote
Post Posted: Wed Jun 24, 2015 11:44 pm
There's more missing snippets than that. It's kind of complicated to take the collection of detected left edge points and derive a centre from them, but it ought to be simple enough to rip the code from a game.
  View user's profile Send private message Visit poster's website
  • Joined: 16 May 2002
  • Posts: 1356
  • Location: italy
Reply with quote
Post Posted: Thu Jun 25, 2015 12:33 am
Since it's not technically feasible, I can disclose the idea I had anyway, since I can't just wait for the next contest and say "surprise!" like I wanted to.

Basically, since recreations of current games are quite popular these days, I was thinking about a clone of Ruzzle. At first, I thought about using the Light Phaser continuously to pick the letters while holding the trigger, but that has been proven to be unrealistic. I guess it would be possible to "shoot" at one letter per time (with a 17th "done" tile to submit a word), but that would be unintuitive and it might even induce seizures or something given the high number of required flashes.

Either way, the game logic to parse the entered words is far beyond my league as well, so I guess I just wasted your time to answer me for nothing, and I'm sorry about that.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14749
  • Location: London
Reply with quote
Post Posted: Thu Jun 25, 2015 7:11 am
I guess that's a Boggle clone? I think it's hard to match a touch optimised interface on the SMS. You could attempt to show a live gun crosshair for selection, provided the screen is mostly bright, but I'd guess it's not very accurate. You could write it for the Graphic Board, but again there would have to be a crosshair and it would be acting like a touchpad with a pen.

Verifying the words would probably be a task in dictionary lookups in minimal space, there are techniques there but they get quite computer sciencey (e.g. a trie).

Probably a bit tough for a first project, but don't be negative about the idea.
  View user's profile Send private message Visit poster's website
  • Joined: 20 Feb 2008
  • Posts: 118
  • Location: Saintes, France
Reply with quote
Post Posted: Thu Jun 25, 2015 9:31 pm
Last edited by vingazole on Fri Jun 26, 2015 8:32 pm; edited 1 time in total
...
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14749
  • Location: London
Reply with quote
Post Posted: Thu Jun 25, 2015 9:52 pm
Well, the code is hardly clear... and "some sort of averaging and extrapolation" isn't given. I'd like to have something more concrete, but it is quite strongly linked to the rest of the game (palette swaps, VBlank detection) that it's quite different to most other peripheral read routines (which are simple and standalone).
  View user's profile Send private message Visit poster's website
  • Joined: 08 Oct 2012
  • Posts: 108
  • Location: Colmar PA, United States
Reply with quote
Post Posted: Thu Jun 25, 2015 10:08 pm
Need sample code for the light phaser?

http://www.smspower.org/Homebrew/ShootingStars-SMS


I used a simple algorithm for 'centering' the raw X,Y coordinate you get from the hardware, but it's not 100% perfect. Maybe you could improve upon it?

If you use scanline interrupts, it only takes 1 frame to read the phaser data. If you don't mind blinking, you could insert a frame of white every 12 or 24 frames without the result being too annoying.

Or you could draw a black line on a white screen.
* If you get a valid (x,y), then the phaser sees white, so turn that area black.
* If you don't get a valid (x,y), then the phaser sees black (already written area) so do nothing.

It would be enough for a 'sign you name' game. Or entering letters like on some cell phones.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!