Jump to content
IGNORED

Atari mouse basic routine?


Philsan

Recommended Posts

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).

Link to comment
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?

Link to comment
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

Link to comment
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
Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
Share on other sites

  • 1 month later...

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
Link to comment
Share on other sites

  • 1 month later...

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
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...