+Philsan Posted October 11, 2007 Share Posted October 11, 2007 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. Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 11, 2007 Share Posted October 11, 2007 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). Quote Link to comment Share on other sites More sharing options...
+Philsan Posted October 11, 2007 Author Share Posted October 11, 2007 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? Quote Link to comment Share on other sites More sharing options...
+Larry Posted October 11, 2007 Share Posted October 11, 2007 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 Quote Link to comment Share on other sites More sharing options...
Mathy Posted October 11, 2007 Share Posted October 11, 2007 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 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted October 12, 2007 Author Share Posted October 12, 2007 (edited) 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 October 12, 2007 by Philsan Quote Link to comment Share on other sites More sharing options...
dwhyte Posted October 12, 2007 Share Posted October 12, 2007 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... 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 12, 2007 Share Posted October 12, 2007 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. Quote Link to comment Share on other sites More sharing options...
cas Posted October 16, 2007 Share Posted October 16, 2007 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 Quote Link to comment Share on other sites More sharing options...
Ruby Port Posted October 16, 2007 Share Posted October 16, 2007 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. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted October 16, 2007 Author Share Posted October 16, 2007 Nice way to introduce oneself! Your program is very interesting! I will try to understand it. Thank you. Quote Link to comment Share on other sites More sharing options...
Mathy Posted October 16, 2007 Share Posted October 16, 2007 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 Quote Link to comment Share on other sites More sharing options...
mimo Posted October 17, 2007 Share Posted October 17, 2007 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 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted October 17, 2007 Share Posted October 17, 2007 Mathy's Mouse Routine looks interesting and seems not to consume too much "polling" time... Quote Link to comment Share on other sites More sharing options...
+Philsan Posted October 25, 2007 Author Share Posted October 25, 2007 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. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted December 7, 2007 Author Share Posted December 7, 2007 (edited) 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 December 7, 2007 by Philsan Quote Link to comment Share on other sites More sharing options...
+Philsan Posted January 14, 2008 Author Share Posted January 14, 2008 (edited) 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 January 14, 2008 by Philsan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.