Access to the lightpen using Vectrex32

Started by jamel, October 31, 2019, 08:13:50 PM

Previous topic - Next topic

jaymzjulian

Super cool, at least from the video - sadly I couldn't get it to pick at all with my original lightpen (it works fine with artmaster/animaction, so i think the hardware is fine?).  The result of the peek is always 129, if that means anything. 

I'm assuming this wants the pen in port 2, as per usual, right?

Malban

I only tested it with my "work" Vectrex -- there (as in the Video) it works.
I can test it (later today) with some other Vectrex.

I used Vectrex32 firmware 1.20 - didn't put a test in front.

If you have a very "dim" vectrex - perhaps you only need to regulate the brightness a bit?

Anyways.. the result of the peek = 129?
That would be $81.

Which is a strange value. The function writes (on success) the "which" value - which is 3.
And before the function call, I explicitly write a 0 to it (pokeRAM(0, $c880)).

So... I have no clue on how that value could be put into that location.

best guess on my part is the firmware?



jaymzjulian

I'll try with a 1.20 firmware later today (I'm on a beta firmware so it's entirely possible that's what is up :)).  Nectar given that you're setting the byte to 0, something is obviously up on my end   

Vectrex32

I can't imagine how any of the changes in the beta software would affect this. But I guess the proof of the pudding is in the eating.

- Bob

jaymzjulian

So here's something interesting:

I can reproduce this failing on 1.20, but I can reproduce it for a weirdly small case:

repeat
   wasSelected = 0
   call pokeRAM(44, $c880)
   CALL Peek($c880, 1, peekdata)

   ' Get user input
   controls = WaitForFrame( JoystickDigital, Controller1 , JoystickX + JoystickY )

   WHILE   peekdata[1] = 0
   ENDWHILE
   print peekdata[2][1]

   wasSelected =peekdata[2][1]
   print "wassel: ",wasSelected

   call ClearScreen()

until controls[1, 6]
stop


Will _always_ return 129 on my vectrex for c880, no matter what i poke in it.  When I tried c886 instead, it does correctly return whatever value I place in there!  Sure enough, if I changed the light pen code to use c886 instaed of c880, it works great :).

I'm hoping to have time on the weekend to turn this into a small little POC vector drawing program demo, mostly because it'd be nice to sketch on the screen without having to swap the cartridge for artmaster ;)

I wonder if the c880 thing is something mildly wrong with my vectrex - i do have this other weird issue, where i have to prop up the vectrex32 cart for it to contact right (currently using a can of compressed air ;)), but every game I've thrown at this has run flawlessly, and i haven't had other weird problems with the vectrex32, so it's def weird, especially since even c881 seems to work!  Surely it couldn't be just "that cell of ram is dead in my vectrex, but it affects "nothing else".....


Vectrex32

The light pen bug is my fault. Turns out I am using memory location $C880.

I'll fix that in the next release.

- Bob