Hi,
many years ago I wrote a suite of programs which, when used with an overley card, provided subtitling and such to videos. quite something all those years ago. Now that I am retired, I recently came across this set of programs again and thought it would be fun to run them in the excellent PC-Basic emulator. Unfortunately I cant get a mouse to work inside the programs. At the time i used the following to do it:
40 DEFINT A-Z
50 DEF SEG=0
60 MSEG=256PEEK(514+3)+PEEK(514+2)
70 MOUSE=256PEEK(514+1)+PEEK(514)+2
80 IF MSEG OR (MOUSE-2) THEN 100
90 PRINT " De muis is niet aktief":END etc etc
a well know method at the time. I could reptram everything to work strictly with keyboard choices but thats a massive job and it strikes me that if it worked all those years ago I should be able to get a mouse working in PC-Basic. alas I am stuck. any suggestions?
i know the cut and paste works fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, that code won't work in PC-BASIC at present. It looks like it addresses some mouse driver in memory, but that really assumes you are running GW-BASIC on a DOS computer with a specific mouse driver loaded. Any PEEK calls in PC-BASIC only work if the memory address has been specifically implemented in the emulator. If you send me the program I can have a look if it makes sense to do so in this case, but it would take a while before I'd get to that.
However, PC-BASIC can read the mouse position as if it's a light pen, i.e. by giving a PEN ON statement at the start and using the PEN function. See the documentation for details on these.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for your quick reply. I had in fact been wondering if the PEN function could be used. I am going to look into that rather than bother you with my programs. If I cant resolve then, if I may, I will come back to you.
thanks for the reply.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK got the PEN function PEN(6) to work. I have assigned variable N to it. it works great first time, PEN waits for the keypress and I check the result and then goto the relevant subroutine and open the relevant program.
however the PEN variable seems to be retained. so if I then reload the initial master program and RUN it immediately loads the second program.
I cant seem to clear or reassign the variable. Tried everything, introducing a PEN OFF statement, assigning 0 to N, nothing works. the original choice seems retained.
10 REM ** MASTER **
20 CLEAR
25 SCREEN 0,0,0
30 REM (this once only sets op the menu screen not shown in this short listing) GOSUB 400
35 PEN ON
40 N = PEN(6)
210 IF N = 8 THEN CLOSE:GOTO 290
220 IF N = 10 THEN CLOSE: GOTO 310
230 IF N = 12 THEN CLOSE: GOTO 330
240 IF N = 14 THEN CLOSE: GOTO 350
250 IF N = 16 THEN CLOSE: GOTO 370
260 IF N = 18 THEN CLOSE: GOTO 380
270 GOTO 35
290 LOAD "dubbel.bas",R
etc
etc
etc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PEN(6) returns the position of the last click, so it will not change. You'll need PEN(0) to check if there has been a new click since last time. Maybe something like this:
40 N=-1: IF PEN(0) THEN N=PEN(6)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks. its been almost 30 years since I last wrote BASIC so hence my stupidity :)
now I see this example the 'mist' is lifting. By the way I just like to thank you for this emulator I have come to quit late, but that has enabled me to pick up an old hobby in my retirement.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Try the above but I get a error message "Syntax error in 60 "
So what is the problem
**run
Syntax error in 60
60 MSEG=256 PEEK(514+3)+PEEK(514+2)
list
10 REM MASTER
20 CLEAR
25 SCREEN 0,0,0
30 REM (this once only sets op the menu screen not shown in this short listing) GOSUB 400
35 PEN ON
40 DEFINT A-Z
50 DEF SEG=0
60 MSEG=256 PEEK(514+3)+PEEK(514+2)
70 MOUSE=256 PEEK(514+1)+PEEK(514)+2
80 IF MSEG OR (MOUSE-2) THEN 100
90 PRINT " De muis is niet aktief":END ETC ETC40 DEFINT A-Z
Ok
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think peeking the mouse stuff from where a real DOS mouse driver might put the values in memory will work. At least in 2017 it did not work as Rob wrote back then.
The syntax error is the missing operator between 256 and PEEK. If you take a look at the whole line it's easy to guess that theres a * missing. But again, that doesn't work anyway.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was hopping is something I was doing wrong
I have back around 1985 program and used a mouse in basic but since then I have lost all my notes on how to . I think got from PC magazine on how to.
Thank you for your reply
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "[CLOSED] General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hi,
many years ago I wrote a suite of programs which, when used with an overley card, provided subtitling and such to videos. quite something all those years ago. Now that I am retired, I recently came across this set of programs again and thought it would be fun to run them in the excellent PC-Basic emulator. Unfortunately I cant get a mouse to work inside the programs. At the time i used the following to do it:
40 DEFINT A-Z
50 DEF SEG=0
60 MSEG=256PEEK(514+3)+PEEK(514+2)
70 MOUSE=256PEEK(514+1)+PEEK(514)+2
80 IF MSEG OR (MOUSE-2) THEN 100
90 PRINT " De muis is niet aktief":END etc etc
a well know method at the time. I could reptram everything to work strictly with keyboard choices but thats a massive job and it strikes me that if it worked all those years ago I should be able to get a mouse working in PC-Basic. alas I am stuck. any suggestions?
i know the cut and paste works fine.
Hi, that code won't work in PC-BASIC at present. It looks like it addresses some mouse driver in memory, but that really assumes you are running GW-BASIC on a DOS computer with a specific mouse driver loaded. Any
PEEK
calls in PC-BASIC only work if the memory address has been specifically implemented in the emulator. If you send me the program I can have a look if it makes sense to do so in this case, but it would take a while before I'd get to that.However, PC-BASIC can read the mouse position as if it's a light pen, i.e. by giving a
PEN ON
statement at the start and using thePEN
function. See the documentation for details on these.View and moderate all "[CLOSED] General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
thank you for your quick reply. I had in fact been wondering if the PEN function could be used. I am going to look into that rather than bother you with my programs. If I cant resolve then, if I may, I will come back to you.
thanks for the reply.
View and moderate all "[CLOSED] General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
OK got the PEN function PEN(6) to work. I have assigned variable N to it. it works great first time, PEN waits for the keypress and I check the result and then goto the relevant subroutine and open the relevant program.
however the PEN variable seems to be retained. so if I then reload the initial master program and RUN it immediately loads the second program.
I cant seem to clear or reassign the variable. Tried everything, introducing a PEN OFF statement, assigning 0 to N, nothing works. the original choice seems retained.
10 REM ** MASTER **
20 CLEAR
25 SCREEN 0,0,0
30 REM (this once only sets op the menu screen not shown in this short listing) GOSUB 400
35 PEN ON
40 N = PEN(6)
210 IF N = 8 THEN CLOSE:GOTO 290
220 IF N = 10 THEN CLOSE: GOTO 310
230 IF N = 12 THEN CLOSE: GOTO 330
240 IF N = 14 THEN CLOSE: GOTO 350
250 IF N = 16 THEN CLOSE: GOTO 370
260 IF N = 18 THEN CLOSE: GOTO 380
270 GOTO 35
290 LOAD "dubbel.bas",R
etc
etc
etc
PEN(6)
returns the position of the last click, so it will not change. You'll needPEN(0)
to check if there has been a new click since last time. Maybe something like this:View and moderate all "[CLOSED] General Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
thanks. its been almost 30 years since I last wrote BASIC so hence my stupidity :)
now I see this example the 'mist' is lifting. By the way I just like to thank you for this emulator I have come to quit late, but that has enabled me to pick up an old hobby in my retirement.
Try the above but I get a error message "Syntax error in 60 "
So what is the problem
**run
Syntax error in 60
60 MSEG=256 PEEK(514+3)+PEEK(514+2)
list
10 REM MASTER
20 CLEAR
25 SCREEN 0,0,0
30 REM (this once only sets op the menu screen not shown in this short listing) GOSUB 400
35 PEN ON
40 DEFINT A-Z
50 DEF SEG=0
60 MSEG=256 PEEK(514+3)+PEEK(514+2)
70 MOUSE=256 PEEK(514+1)+PEEK(514)+2
80 IF MSEG OR (MOUSE-2) THEN 100
90 PRINT " De muis is niet aktief":END ETC ETC40 DEFINT A-Z
Ok
I don't think peeking the mouse stuff from where a real DOS mouse driver might put the values in memory will work. At least in 2017 it did not work as Rob wrote back then.
The syntax error is the missing operator between 256 and
PEEK
. If you take a look at the whole line it's easy to guess that theres a*
missing. But again, that doesn't work anyway.I was hopping is something I was doing wrong
I have back around 1985 program and used a mouse in basic but since then I have lost all my notes on how to . I think got from PC magazine on how to.
Thank you for your reply