News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_TFM

Free Trojan Phaser for the CPCPlus

Started by TFM, 01:20, 16 February 12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

steve

I am not a programmer but a simple basic routine should be able to test the gun.

TFM

Well if the gun is lightpen compatible than you can move the mouse pointer under FutureOS with it. But I don't know if this is any help.

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

dragon

#77
Quote from: TFM on 21:55, 24 May 14
Well if the gun is lightpen compatible than you can move the mouse pointer under FutureOS with it. But I don't know if this is any help.

Maybe it works if i press the trigger... I try later. Amstrad Magnum Phaser - CPCWiki

In basic to read/write registers the instructions are inp/out?. The amstrad mannual does not say very clear

PD: cpc wiki crtc page is wrong?. He said: 16 Light Pen Address (High) 17 Light Pen Address (High) The two are the same?.

dragon

I' cant use the cpc today. But I put the gun Under the light.

And... My gun have cataracts?



It may be why it does not work? I think I will not be no choice but to open it, and use the lens sinclair. wtf.

Bryce

Is that a close up of the photodiode? Is the surface scratched or is the plastic cloudy?

Bryce.

arnoldemu

Quote from: dragon on 11:23, 25 May 14
Maybe it works if i press the trigger... I try later. Amstrad Magnum Phaser - CPCWiki

In basic to read/write registers the instructions are inp/out?. The amstrad mannual does not say very clear
Correct.

OUT &BC00,16:? INP(&BF00)
or
OUT &BC00,16:? INP(&BE00)

and

OUT &BC00,17:? INP(&BF00)
or
OUT &BC00,17:? INP(&BE00)

the value should look like a CRTC memory address, e.g for normal screen, the range is &3000-&33ff.

Try the following:

10 MODE 1: BORDER 0
20 INK 0,0
30 INK 1,26
40 LOCATE 20,10:PRINT CHR$(24);" ";CHR$(24)
50 LOCATE 1,1: OUT &BC00,16:PRINT HEX$(INP(&BF00));
60 OUT &BC00,17:PRINT HEX$(INP(&BF00)):
70 GOTO 50

The idea here is to make a black screen with a white square which you point the gun at.
Then it reads the values and prints them on the screen. If it works correctly it should display a good value.
You could try pointing at the text too, it may not trigger well.
May need to replace &bf00 with &be00. I can't remember which is correct and it may work differently on each crtc.

If you get FFFF, or something like that or 0000, then it's not reading the values at all.

Quote from: dragon on 11:23, 25 May 14
PD: cpc wiki crtc page is wrong?. He said: 16 Light Pen Address (High) 17 Light Pen Address (High) The two are the same?.
I have fixed the wiki.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Quote from: dragon on 11:23, 25 May 14
Maybe it works if i press the trigger... I try later. Amstrad Magnum Phaser - CPCWiki

You could also try this basic program to test the trigger:

10 MODE 1
20 OUT &BC00,17:A%=INP(&BF00):OUT &FBFE,&7F: OUT &FBFE,&80:OUT &BC00,17:B%=INP(&BF00)
30 IF A%<>B% THEN BORDER 3 ELSE BORDER 4
40 GOTO 20
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

Quote from: Bryce on 08:11, 26 May 14
Is that a close up of the photodiode? Is the surface scratched or is the plastic cloudy?

Bryce.

No, is the plastic lens outside fotodiode. View from cannon. Same as this but very close to the outside: Nor appear scratched,
but as spotted inside. I tried to clean it with a cloth for glasses, but was not removed anything. I'm not sure if it blocks the light or not.



I'll ride the cpc arnold, and test programs.

dragon

#83
Quote from: arnoldemu on 13:53, 26 May 14
Correct.

OUT &BC00,16:? INP(&BF00)
or
OUT &BC00,16:? INP(&BE00)

and

OUT &BC00,17:? INP(&BF00)
or
OUT &BC00,17:? INP(&BE00)

the value should look like a CRTC memory address, e.g for normal screen, the range is &3000-&33ff.

Try the following:

10 MODE 1: BORDER 0
20 INK 0,0
30 INK 1,26
40 LOCATE 20,10:PRINT CHR$(24);" ";CHR$(24)
50 LOCATE 1,1: OUT &BC00,16:PRINT HEX$(INP(&BF00));
60 OUT &BC00,17:PRINT HEX$(INP(&BF00)):
70 GOTO 50

The idea here is to make a black screen with a white square which you point the gun at.
Then it reads the values and prints them on the screen. If it works correctly it should display a good value.
You could try pointing at the text too, it may not trigger well.
May need to replace &bf00 with &be00. I can't remember which is correct and it may work differently on each crtc.

If you get FFFF, or something like that or 0000, then it's not reading the values at all.
I have fixed the wiki.

Testing in the 6128 cost down.

Without gun connected return the last valor, with the gun return constantly, 3XXX changin constantly. when i press trigger, the number stop. But that all, No matter where you aim, even off screen. always 3XXX changin constantly , inclusive if i tape the gun.

Can you modify the program so, when I put trigger, cpc draw in screen the block in the site the gun is aim?.

I modify the line 50 to view, what he es reciving, without aim the gun(that is the same at not aim the gun wtf):

and: img20140526162609

It not appear pas 37xx, I only eliminate the locate, and add a print, nothing more.

The gun is alone in the table, i think is broken.

Bryce

Ah, I didn't realise it had a second lense. You could try cleaning it with Displex or something similar?

Bryce.

arnoldemu

Quote from: dragon on 15:13, 26 May 14
Testing in the 6128 cost down.

Without gun connected return the last valor, with the gun return constantly, 3XXX changin constantly. when i press trigger, the number stop. But that all, No matter where you aim, even off screen. always 3XXX changin constantly , inclusive if i tape the gun.
without gun: expected
with gun and no trigger: interesting.
with gun and trigger: interesting.

CPCWiki seems to say other way around for trigger/no trigger.


Quote from: dragon on 15:13, 26 May 14
Can you modify the program so, when I put trigger, cpc draw in screen the block in the site the gun is aim?.
No.

Maybe I misunderstand what you are asking but the gun doesn't work that way.
The gun senses the white or any bright colour. This tells the CRTC to record it's position.

if the screen was black you would not get any response. So I could not tell you where it is pointing.

(On Wii, the remote has a led that shines - it's infra red?? - the sensor bar reads the light on each end. It sees two dots. The code then looks at the dots and decides where you are pointing. It's a different way that works great without needing any white rectangles on black).

In the games, when the trigger is pressed the screen goes black and one or more rectangles is shown in white. It only needs to do this for 1 frame or two.

You point the gun at the screen. The CRTC/Gate-array are drawing the screen starting at the top-left and moving to the right and down. When the gun senses the light the position is recorded by the CRTC. So if you are pointing at bottom-right and there is white there, it will take longer to sense this than if you were pointing at top-left where there is white.

The CRTC record which address it is displaying, the accuracy is 8 lines in vertical, and 1 char horizontally (8 pixels in mode 1, 4 in mode 0, 16 in mode 2).


Quote from: dragon on 15:13, 26 May 14
It not appear pas 37xx, I only eliminate the locate, and add a print, nothing more.
37xx is probably the bottom right of the screen without scrolling.
These values are crtc addresses.


Quote from: dragon on 15:13, 26 May 14
The gun is alone in the table, i think is broken.
I think it's working but I didn't expected it to work as you found. I don't have one, and I am only reading what the cpcwiki says.
I think it's saying the wrong way.

I will try and fix the code so it works the other way.

Perhaps I can also do something that will do more than one rectangle and tell you which you are pointing at.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

#86
Quote from: arnoldemu on 17:09, 26 May 14
without gun: expected
with gun and no trigger: interesting.
with gun and trigger: interesting.

CPCWiki seems to say other way around for trigger/no trigger.

No.

Maybe I misunderstand what you are asking but the gun doesn't work that way.
The gun senses the white or any bright colour. This tells the CRTC to record it's position.

if the screen was black you would not get any response. So I could not tell you where it is pointing.

(On Wii, the remote has a led that shines - it's infra red?? - the sensor bar reads the light on each end. It sees two dots. The code then looks at the dots and decides where you are pointing. It's a different way that works great without needing any white rectangles on black).

In the games, when the trigger is pressed the screen goes black and one or more rectangles is shown in white. It only needs to do this for 1 frame or two.

You point the gun at the screen. The CRTC/Gate-array are drawing the screen starting at the top-left and moving to the right and down. When the gun senses the light the position is recorded by the CRTC. So if you are pointing at bottom-right and there is white there, it will take longer to sense this than if you were pointing at top-left where there is white.

The CRTC record which address it is displaying, the accuracy is 8 lines in vertical, and 1 char horizontally (8 pixels in mode 1, 4 in mode 0, 16 in mode 2).

37xx is probably the bottom right of the screen without scrolling.
These values are crtc addresses.

I think it's working but I didn't expected it to work as you found. I don't have one, and I am only reading what the cpcwiki says.
I think it's saying the wrong way.

I will try and fix the code so it works the other way.

Perhaps I can also do something that will do more than one rectangle and tell you which you are pointing at.

Ok, but if its working, why I can't hit  nothing?.

In the game, missile laucher. first draw a vertical line to calibrate de gun, and in the game, when you shot and fail, you see in the screen a "explosion" where you fail, well, i shot, and i not view nothing, only the flashes of the trigger. and very very ocasionally, maybe a hit shots  in the upper screen(of course. And if i tape the gun. Then, the explosions fail appear in the screen!!.


Load the menu of the six games. He are basic not protected, I can't hit. I shot a name, and nothing happen, or with lucky If i shots at one game or a corner, he select another game!, the menu call a .bin 2k, but he extract from memory the coordinate, and if you press trigger.


http://www.cpc-power.com/index.php?page=detail&num=3825

As a the gun works, but he not works as he  expected to work, very strange. I do not expect an accuracy of 100% gun. But now is at 1%?.(and whith luck shot at crazy).

arnoldemu

Ok I understand. Can you try in cpc without cost down and others crtc type? Perhaps the gun is not compatible with cost down or plus.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

Quote from: arnoldemu on 18:14, 26 May 14
Ok I understand. Can you try in cpc without cost down and others crtc type? Perhaps the gun is not compatible with cost down or plus.

O.k, finally it works. youre' right arnold, it works. The problem are.... the distance. The gun needs at least 1,20/30 meters to the ctm, thats mean, put the cpc wires to the ctm streched  XD. I try it around 1,10m. jajaja. That's the problem.

Hey, it works very well :). Now i can chose a game in the menu.



arnoldemu

Quote from: dragon on 20:13, 26 May 14
O.k, finally it works. youre' right arnold, it works. The problem are.... the distance. The gun needs at least 1,20/30 meters to the ctm, thats mean, put the cpc wires to the ctm streched  XD. I try it around 1,10m. jajaja. That's the problem.

Hey, it works very well :). Now i can chose a game in the menu.
Great. I will add that info to the wiki.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

dragon

Quote from: arnoldemu on 20:29, 26 May 14
Great. I will add that info to the wiki.

And add the gun not work,If the street is reflected in the monitor. More dark, more better run the gun.

dragon

At the end to not complicate my life. I have lucky, and i found another amstrad gun, So as I have to open it to transform it for the plus.

I'll do some photos to the plate to cpcwiki. :).  According as the plastic stay, and I'll see if I use her case, or the of sinclair to made my trojan phanzer.

dragon

O.k, so after two weeks I can recuperate mi second gun and future gx4000/plus gun, The seller sent it funny for me in very strange system. So when i waiting to the postman. My gun is sleeping and waiting me in a "travel agency". ???

When, now time to buy for what is missing. The crimping  cost me 7e in a Chinese shop, the next i buy is the connectors and cable. Probably they no cost more than 3e.

When i investigating the gx4000 connector, I found a small problem with the description,  the plus connector is supposedly a rj11 6 pin/wire.


Well, today thats exactly not true, because today the standar rj11 have 4pin/wire  and is made to the telephone. The true name to the plus connector is  rj12. This is a rj11 connector, but with 6pin/wire. So when you buy a crimpper and connector, search a rj12 compatible or it not work.

Now about the motherboard gun..... well, he have a crappy plastic :D. The switch is the same model of the spectrun gun.

img20140531122331
img20140526190007
img20140526190212
img20140526185948

Note: the circuit is in a spectrum gun case in the picture, but is exactly the same.

Now One question about tutorial: How to build a Trojan Phazer gun from an Amstrad Magnum

33mf/16 or 47mf/25 capacitator?.

Bryce

It doesn't really matter, both 33µf/16 or 47µf/25 will work fine. If you are really short of space, then the 33µf/16 will be slightly smaller.

I think I still own an RJ11/12 crimper, so if you need any cable made in the future let me know.

Bryce.

remax

I got an Amstrad Magnum for next to nothing as it was probably broken.

After some tests, as stated by the seller, i think that the trigger is working ok but the lens is not receiving the light (in every game, in can launch the game with the trigger, then have a light flash everytime i shoot but i never hit an enemy, and i'm not THAT bad at it :D )

Of course i'm in a dark room and at a good distance (wire stretched) from a CTM 644

Any idea for software tests that would confirm my opinion?
Brain Radioactivity

TFM

If it works like a lightpen, use lightpen software, you should be able to see the mouse arrow moving. The Plus version of FutureOS also supports some lighpens and lightguns. But the best thing is probably to read the CRTC registers. A simple basic program can do that.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

remax

Quote from: TFM on 20:03, 07 August 14
If it works like a lightpen, use lightpen software, you should be able to see the mouse arrow moving. The Plus version of FutureOS also supports some lighpens and lightguns.

It's the Magnum Phaser and it use the Expansion port, so hard to use both XMem and the gun (eventhough it must be possible with the passthrough port, but i dont have the good connector).

QuoteBut the best thing is probably to read the CRTC registers. A simple basic program can do that.

Yeah, i saw the progs available by arnoldemu but it doesn't work (i have a cost down CPC like dragon) but he said after writing them that the gun weren't working like he thought...
Brain Radioactivity

TFM

Well, you should try it with the Plus. I also have one 6128 which makes troubles using lightpen/lightgun, while it works with the Plus.

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

remax

Quote from: TFM on 21:03, 07 August 14
Well, you should try it with the Plus. I also have one 6128 which makes troubles using lightpen/lightgun, while it works with the Plus.

I'm a little short on CPCs to do further tests implying a change of machine  :laugh:
Brain Radioactivity

TFM

Everybody is kinda... but you can attend a meeting.  :)
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Powered by SMFPacks Menu Editor Mod