English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 07 August 2016, 20:05   #1
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Read Mouse Port 1 possible?

Is there anyway to read the mouse in port 1?
Retro1234 is offline  
Old 07 August 2016, 20:17   #2
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
i've just tested this example with Amos 1.36 in WinUAE-A1200 setup with mouse in port1:
Quote:
Cls 0
Do
If Mouse Key
Plot X Screen(X Mouse),Y Screen(Y Mouse),Mouse Key and 1
End If
Loop
really cool for what it is
taken from ada.underground.
emufan is offline  
Old 07 August 2016, 20:38   #3
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
That looks like it would only work with port 0.
Samurai_Crow is offline  
Old 07 August 2016, 20:43   #4
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Samurai_Crow View Post
That looks like it would only work with port 0.
i always count 1-2 , so does winuae (at least the gui says Port 1 and 2) - but i already thought,
that this might be wrong in Retro's case
emufan is offline  
Old 07 August 2016, 21:09   #5
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
hehe I always see this, I count 0 and 1 - strange my version of winuae also does but thanks for you reply
I only want to read the mouse clicks - to read two buttons without a extension if possible.
Retro1234 is offline  
Old 07 August 2016, 21:40   #6
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
is there some sort of peek command , so you may read from the register $DFF00A/$DFF00C/$BFE001 or
whatever the second mouse/joy port is?

Last edited by emufan; 07 August 2016 at 21:47. Reason: all those custom registers :D
emufan is offline  
Old 07 August 2016, 22:18   #7
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
I always thought there was a way with the existing commands but it doesnt look like there is.
Retro1234 is offline  
Old 08 August 2016, 23:12   #8
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
i don't believe there is an AMOS command for this, you will have to do it the Hard Way, which isn't really all that hard tbh, except for reading the right mouse button, which is a bit of a trick.

In the hardware register names they are called 0 and 1. Because Computer.
Mrs Beanbag is offline  
Old 09 August 2016, 00:58   #9
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
im realy not sure how I would do this and it is the Right mouse button I would want to read - for some reason I had it in my mind from way back that you could read a two button pad like this but it must have been for port 0 only.
Retro1234 is offline  
Old 09 August 2016, 01:19   #10
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
What programming language are you using?
Galahad/FLT is offline  
Old 09 August 2016, 01:30   #11
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Galahad/FLT View Post
What programming language are you using?
we are in the deep waters of AMOS
"English Amiga Board > Coders > Coders. Language > Coders. AMOS > Read Mouse Port 1 possible?"

btw. "AMOS could also include inline Assembly Language".
so someone could write some asm lines which you can include ?!
emufan is offline  
Old 09 August 2016, 15:56   #12
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
http://www.ultimateamiga.co.uk/Hoste...gamemouse.html
idrougge is offline  
Old 09 August 2016, 22:32   #13
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by emufan View Post
btw. "AMOS could also include inline Assembly Language".
so someone could write some asm lines which you can include ?!
This seems like quite a misleading line. You can't write assembler inline in an AMOS program. You can load an executable into an AMOS bank (with Pload command - as long as the executable satisfies certain requirements) and you can have machine language procedures (the compiler can generate these, i never found out how to do it manually, and they cannot be expanded in the editor).
Mrs Beanbag is offline  
Old 09 August 2016, 23:44   #14
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
ok, i understand - so far, that it is not possible

#1) but wait: just another article about AMOS and assembler:

Quote:
Another one of his child prodigies, was revealed to us in digging through the disk of AMOS Compile : AMOS Assembler.

This wonder, also, does not lack interest. It allows, and it is without a doubt his sole purpose, easily integrate parts of machine code in your program AMOS. A little sidelined by the compiler, it is no less a programming tool, powerful and useful.
while reading abit on that website, it seems, that thing is an extension too, in "Bank 14" or something,

Last edited by emufan; 10 August 2016 at 00:39.
emufan is offline  
Old 31 December 2016, 01:42   #15
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,538
Quote:
Originally Posted by Mrs Beanbag View Post
This seems like quite a misleading line. You can't write assembler inline in an AMOS program.

You can load an executable into an AMOS bank (with Pload command - as long as the executable satisfies certain requirements) and you can have machine language procedures (the compiler can generate these, i never found out how to do it manually, and they cannot be expanded in the editor).
Persuambly you are referring to this:

http://www.ultimateamiga.co.uk/Hoste...l/14/1411.html

Quote:
Machine code procedures


The easiest option for exploiting assembly language is to install machine code directly into an AMOS Professional procedure. These procedures can be saved and loaded using standard commands, and then executed from the Basic program simply by typing their name! Apart from the fact that it cannot be listed on screen, the only effective difference between a machine code procedure and its Basic equivalent is speed.


Machine code procedures are completely compatible with the AMOS Compiler, which will not only run most of your programs at double speed, but also compact them to a fraction of their original size. This means that if you decide to compile your programs at a later date, you will not need to alter your assembly language at all. The following points should be noted before using an assembler:

To answer the thread's intent, i would just use the AMCAF extension, as idrougge pointed to.


I actually came here looking for a way to 'detect' mouse in either port. I'd like to implement in AMOS, but if it meant delving into the realm of in-line assembler code like mentioned above, i'd be willing to get to know it a bit better.
Hungry Horace is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using PotGo on Mouse Port (Port 0)? Daedalus Coders. System 14 02 March 2016 20:44
overscan and mouse settings option to be read from external file _psy project.WHDLoad 5 15 April 2015 13:30
Direct serial port read/write demolition Coders. Asm / Hardware 6 23 March 2013 03:59
A1200 mouse port pinball_dreads support.Hardware 3 17 February 2005 18:31
amiga mouse port 1 unregistered support.WinUAE 0 15 November 2002 22:28

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:15.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.17208 seconds with 15 queries