Page 6 of 8
Re: MSX Inbound!!
Posted: 09 Feb 2022 15:07
by rubber_jonnie
mrbombermillzy wrote: 09 Feb 2022 14:46
What did reading the pad values give you? (I take it you read the values into a variable, like eg: 'x=Pad(17)' or whatever and then displayed x value?)
Those commands give an illegal function call error so don't work at all.
if I use pad(0) I get a value of -1 for up, but nothing else. If I use pdl(1) I get a constant value of 255, changing for 0 when I push up. I get no read in any other direction. Need to read up on those commands, there is some info here:
https://www.msx.org/wiki/PDL(), it looks like you need to read 2 channels, one for X and one for Y.
I'd expect values between 0 and 255 based on what I'm seeing, but it is just doing it digitally it seems.
Re: MSX Inbound!!
Posted: 09 Feb 2022 15:12
by mrbombermillzy
I've been using that site for figuring the commands. As I'm not MSX savvy, maybe I'm missing something.
However, I don't think you should get an error from the pad commands, just possibly useless read data..... :coffee:
Re: MSX Inbound!!
Posted: 09 Feb 2022 15:13
by rubber_jonnie
mrbombermillzy wrote: 09 Feb 2022 15:12
I've been using that site for figuring the commands. As I'm not MSX savvy, maybe I'm missing something.
However, I don't think you should get an error from the pad commands, just possibly useless read data..... :coffee:
Me either, my first MSX :)
I'm sure it'll get figured out in the end!!
Re: MSX Inbound!!
Posted: 09 Feb 2022 15:26
by mrbombermillzy
mrbombermillzy wrote: 07 Feb 2022 20:18
Had a quick look for you :)
It seems that an analog stick on an MSX is not a very commonly supported thing, so try the BASIC commands Pad(17) and Pad(18) for joystick port 1 and Pad(17) and Pad(18) for port 2 to get paddle values (offset x/y -128 to +127). This should work.
If not, you may have to get dirty in that old Z80 ASM code.
Damn. the first set of values SHOULD have been Pad(13) and Pad(14) for port 1. (Silly typo :roll: )
Re: MSX Inbound!!
Posted: 09 Feb 2022 15:39
by rubber_jonnie
mrbombermillzy wrote: 09 Feb 2022 15:26
mrbombermillzy wrote: 07 Feb 2022 20:18
Had a quick look for you :)
It seems that an analog stick on an MSX is not a very commonly supported thing, so try the BASIC commands Pad(17) and Pad(18) for joystick port 1 and Pad(17) and Pad(18) for port 2 to get paddle values (offset x/y -128 to +127). This should work.
If not, you may have to get dirty in that old Z80 ASM code.
Damn. the first set of values SHOULD have been Pad(13) and Pad(14) for port 1. (Silly typo :roll: )
Ok, will try that in a bit and report back.
Re: MSX Inbound!!
Posted: 09 Feb 2022 17:11
by rubber_jonnie
mrbombermillzy wrote: 09 Feb 2022 15:26
mrbombermillzy wrote: 07 Feb 2022 20:18
Had a quick look for you :)
It seems that an analog stick on an MSX is not a very commonly supported thing, so try the BASIC commands Pad(17) and Pad(18) for joystick port 1 and Pad(17) and Pad(18) for port 2 to get paddle values (offset x/y -128 to +127). This should work.
If not, you may have to get dirty in that old Z80 ASM code.
Damn. the first set of values SHOULD have been Pad(13) and Pad(14) for port 1. (Silly typo :roll: )
Ok, so PAD only goes up to 7 for MSX1, goes up to 19 for MSX2 and beyond. Let's see what happens now!
Re: MSX Inbound!!
Posted: 09 Feb 2022 17:37
by rubber_jonnie
mrbombermillzy wrote: 09 Feb 2022 15:12
I've been using that site for figuring the commands. As I'm not MSX savvy, maybe I'm missing something.
However, I don't think you should get an error from the pad commands, just possibly useless read data..... :coffee:
Ok, so the pad() commands don't really seem to work so well on MSX1, at least for this joystick, but pdl() is working as expected, and apparently only returns 0 & 255 if I read this correctly
https://www.msx.org/wiki/MSX_Paddle_Controller
So how to make an analog joystick digital only!!!
Re: MSX Inbound!!
Posted: 09 Feb 2022 19:05
by mrbombermillzy
@rubber_jonnie Oh dear.
Ok. From what I can fathom from that site (and what I put originally), I guess analog joysticks on the MSX1 SEEM to be a bit of an anomaly.
Therefore we will have to probably go with plan B; kit up and get dirty with assembly (or at least POKE statements will do it hopefully) and start looking at the Memory map for the analog inputs.
Is there a decent programmers ref guide or at least a memory map for one of these?
Just had a quick look at that site again, but it's a bit of a pain to navigate. :lol:
Re: MSX Inbound!!
Posted: 09 Feb 2022 19:14
by rubber_jonnie
mrbombermillzy wrote: 09 Feb 2022 19:05
@rubber_jonnie Oh dear.
Ok. From what I can fathom from that site (and what I put originally), I guess analog joysticks on the MSX1 SEEM to be a bit of an anomaly.
Therefore we will have to probably go with plan B; kit up and get dirty with assembly (or at least POKE statements will do it hopefully) and start looking at the Memory map for the analog inputs.
Is there a decent programmers ref guide or at least a memory map for one of these?
Just had a quick look at that site again, but it's a bit of a pain to navigate. :lol:
Hmm, getting dirty with ASM isn't going to happen any time soon I think :(
I don't have the time or any way of saving my data at the moment, so I'll have to cross that bridge first before I can do anything else.
Re: MSX Inbound!!
Posted: 09 Feb 2022 19:28
by mrbombermillzy
Ok, well, I did a very similar project for my GCSE Technology project.
I built a Start Wars style controller for my C64; (remember the original vector arcade version controller?) Had 2 pots and a fire button; had to code a program to move a crosshair reading the analog inputs.
However, that's for a 6510 CPU. This has a Z80.
If you don't get any 'joy' :lol: I can maybe look at learning enough Zilog assembler syntax to test the bloody thing.
(@exxos can tell you how much time I have for hobby coding, so it may take some time, considering the above as well.).
EDIT: Or it may be easier/quicker just to POKE from BASIC if I can find a memory map, like I said.