Jump to content
Philsan

Atari mouse basic routine?

Recommended Posts

I've just received an Atari ST mouse.

I would like to write a simple basic program that moves a pointer on the screen but I don't know how to read mouse movements.

I need a basic routine that reads mouse movements.

Share this post


Link to post
Share on other sites

BASIC is a bit slow to be able to read the mouse and do anything useful as well.

 

There are other threads which a search should be able to find - people have posted assembler routines which you could use.

 

To get decent accurate movement, a VBI routine would be the least you need - 50 samples per second might be sufficient.

 

On the ST, each graduation actually produces an interrupt, which allows it to give precise tracking (albeit at some CPU cost).

Share this post


Link to post
Share on other sites

I've already searched the forum but I've found only assembler routines and I am unable to insert them in a basic program.

If it is really impossible for basic (turbo basic?) to read the mouse, can someone write an assembler routine to copy and paste in a basic program?

Share this post


Link to post
Share on other sites
I've already searched the forum but I've found only assembler routines and I am unable to insert them in a basic program.

If it is really impossible for basic (turbo basic?) to read the mouse, can someone write an assembler routine to copy and paste in a basic program?

 

I have found it difficult to get a mouse to track very well with an Atari 8-bit, unless the computer is doing little else.

 

However, that said, there is a pretty good mouse program that I believe came from the UK. IIRC, it was published in Page 6 in the early 1990's. I don't remember its name, but as I recall, it was not named "mouse". I also know that I have it, but so far, can't find it.

 

Perhaps someone else remembers it, or you can find it at the Page 6 archive. It may also have been published in Atari Classics. (?)

 

-Larry

Share this post


Link to post
Share on other sites

Hello guys

 

John Maris wrote an assembler routine that takes up relatively few time. You can find it and a description of how it works here on my site.

 

Greetings

 

Mathy

Share this post


Link to post
Share on other sites

Here http://www.zimmers.net/anonftp/pub/cbm/man.../1351-mouse.txt

you can find official Commodore basic/machine language programs for 1351 C64/128 mouse.

Perhaps this code, in particular ML, could be useful for Atari programmers.

I need a similar basic program that loads ML and moves mouse (or at least reads movements) in background.

If you want I can attach the .d64 image of the 1351 disk with various mouse programs.

Edited by Philsan

Share this post


Link to post
Share on other sites

Buy yourself a copy of the Quick Programming Language... It has a built-in mouse routine... Quite a wonderful little language to be truthful... Best $5 I've ever spent with pay-pal...

  • Like 1

Share this post


Link to post
Share on other sites

That Commodore document won't be of any use.

 

The 1531 mouse operates totally differently from ST/Amiga mice.

 

Interesting - in proportional mode it provides a delta value to the pot registers dependant on H/V velocity. In joystick mode, it simulates rapidly pressing the joystick in a given direction and returning to centre.

Share this post


Link to post
Share on other sites

The mouse routine from John Maris Mathy was referring to seems to be quite good. Unfortunately on Mathys page the routine is hidden in a ARC File, so that Google cannot index it and people using Mac or PC cannot easily unpack it. So I reformatted the text without changing the content and converted the MAC65 Sourcecode into an Listing and have that now in the Wiki for easy access (Mathy, I hope that is OK with you).

 

The Link is

http://atariwiki.strotmann.de/xwiki/bin/vi...astMouseRoutine

 

Best regards

 

Carsten Strotmann

Share this post


Link to post
Share on other sites

Hi, I'm a bit new here, but try my program. I wrote it in 1997 for myself.

It is a bootable disk with turbobasic, and when you've loaded turbobasic you can type:

RUN "D:PBRUSH.BAT"

 

It loads a custom mouse routine. It's a pity though that I've lost the sourcecode of the mouse routine, but it's a fully functioning program.

The machine language routine does several things. It reads the mouse input at some moments, triggered by a displaylist interrupt. Then it computes the movement of the arrow. After that it draws the arrow in a sprite.

 

In the turbobasic program only the position of the arrow can be accessed. It is read in lines 900-930. The mouse button is simply the same as a joystick trigger.

Share this post


Link to post
Share on other sites

Nice way to introduce oneself!

Your program is very interesting!

I will try to understand it.

Thank you.

Share this post


Link to post
Share on other sites

Hello Carsten

 

(Mathy, I hope that is OK with you).

 

That's OK with me. Maybe I'll have to rethink my "ARC" policy. Hmm, now that I think of it... Once I get past my laziness and finally unpack the computer that's still in the crate I put it in, when I packed my stuff at the Fujiama 2007, I might even make stuff available in "ARC" and "ZIP" format. But don't hold your breath.

 

Greetings

 

Mathy

Share this post


Link to post
Share on other sites

It would be cool if someone could hack Centipede to allow mouse support, I have played a PC version this way, and it isa really cool way to enjoy the game

Share this post


Link to post
Share on other sites
Hi, I'm a bit new here, but try my program. I wrote it in 1997 for myself.

The machine language routine does several things. It reads the mouse input at some moments, triggered by a displaylist interrupt. Then it computes the movement of the arrow. After that it draws the arrow in a sprite.

In the turbobasic program only the position of the arrow can be accessed. It is read in lines 900-930. The mouse button is simply the same as a joystick trigger.

 

I've tested your routine (both in emulator and 130XE with ST1 mouse) and it works very well.

I've some question but I think you cannot answer to them because you've lost the source code:

- is it possible to avoid the arrow player garbage (see screenshot)? The garbage is removed when you move the arrow up and down.

- is it possible to make only one basic file (with DATAs) or two files (the main program loads the ML routine with a simple BLOAD command) instead of three files (loader, ML, program)?

- is it possible to change arrow's shape?

- what is the meaning of POKEs in lines 1100-1135?

 

I've tried to send you a message but your personal messenger seems to bee disabled.

post-12528-1193327474_thumb.png

Share this post


Link to post
Share on other sites

Thanks to MrFish, who has attached the disk image in another thread, I have discovered a simple working Turbo Basic XL ML routine to use ST's mouse.

The funny thing is that this routine has always been present inside the disk of the beautiful drawing program TBM Draw, that everyone could download here:

http://gury.atari8.info/details_software/1615.htm

For example, here is a simple basic listing to move the arrow pointer:

1000 POKE 106,$B0

1010 GRAPHICS 0

1020 BLOAD "D:TBMOUSE6.OBJ"

1030 DIM MOUSE$(3):MOUSE$="000"

1040 COLOUR=15

1050 X=USR($B400,ADR(MOUSE$),COLOUR)

1060 X=USR($B400,0)

You can find all the informations inside the disk or in the .txt file (both attached).

I have also attached an autorun .atr (8bit Mouse Test.atr) so you can quickly test the routine.

8bit_Mouse__The.zip

Edited by Philsan

Share this post


Link to post
Share on other sites

I have tested the above ML routine on a real Atari 130XE with an Atari ST mouse.

The pointer's movement is wonderful.

You can move it with a mouse in port 2 or a joystick in port 1 *at the same time*.

Very useful to make graphics interfaces.

Edited by Philsan

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...