Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #4154 > unrolled thread
| Started by | Anthony Ortiz <anthonypaulo@gmail.com> |
|---|---|
| First post | 2018-01-30 16:08 -0800 |
| Last post | 2018-02-01 11:34 -0600 |
| Articles | 11 — 6 participants |
Back to article view | Back to comp.sys.apple2.programmer
Mouse - direct access to position Anthony Ortiz <anthonypaulo@gmail.com> - 2018-01-30 16:08 -0800
Re: Mouse - direct access to position gids.rs@sasktel.net - 2018-01-30 17:25 -0800
Re: Mouse - direct access to position Anthony Ortiz <anthonypaulo@gmail.com> - 2018-01-30 17:42 -0800
Re: Mouse - direct access to position gids.rs@sasktel.net - 2018-01-30 19:28 -0800
Re: Mouse - direct access to position Anthony Ortiz <anthonypaulo@gmail.com> - 2018-01-30 19:34 -0800
Re: Mouse - direct access to position "Frank M." <frank_o_rama@hotmail.com> - 2018-01-30 21:02 -0800
Re: Mouse - direct access to position Antoine Vignau <antoine.vignau@laposte.net> - 2018-01-30 22:04 -0800
Re: Mouse - direct access to position "Frank M." <frank_o_rama@hotmail.com> - 2018-01-30 22:29 -0800
Re: Mouse - direct access to position Brian Patrie <bpatrie@bellsouth.spamisicky.net> - 2018-02-01 03:01 -0600
Re: Mouse - direct access to position Anthony Ortiz <anthonypaulo@gmail.com> - 2018-02-01 06:43 -0800
Re: Mouse - direct access to position Michael J. Mahon <mjmahon@aol.com> - 2018-02-01 11:34 -0600
| From | Anthony Ortiz <anthonypaulo@gmail.com> |
|---|---|
| Date | 2018-01-30 16:08 -0800 |
| Subject | Mouse - direct access to position |
| Message-ID | <8c29dd08-8f59-4dd2-bd5b-97e398290b06@googlegroups.com> |
Is there any way to directly access the absolute mouse position on a IIe via the IO space rather than calling the readmouse routine (which updates text screen hole) and having to read screen hole?
[toc] | [next] | [standalone]
| From | gids.rs@sasktel.net |
|---|---|
| Date | 2018-01-30 17:25 -0800 |
| Message-ID | <7c4a0a81-e4b0-44df-8339-27006cc83a91@googlegroups.com> |
| In reply to | #4154 |
On Tuesday, January 30, 2018 at 6:08:40 PM UTC-6, Anthony Ortiz wrote: > Is there any way to directly access the absolute mouse position on a IIe via the IO space rather than calling the readmouse routine (which updates text screen hole) and having to read screen hole? What are you calling the IO space, if its not the screen holes? I just copy the old coordinates from the screen holes to somewhere in memory before calling READMOUSE, and updating the new coordinates. Another thing you could do is set up a mouse interrupt so that your program is interrupted only when either the mouse moves or a button is pressed. This way you know the screen holes are still the same until you actually do the READMOUSE to update the screen holes. Or if you want the mouse coordinates to be somewhere totally different than where you pressed the button, is to set the coordinates in the screen holes, then call SETMOUSE.
[toc] | [prev] | [next] | [standalone]
| From | Anthony Ortiz <anthonypaulo@gmail.com> |
|---|---|
| Date | 2018-01-30 17:42 -0800 |
| Message-ID | <83de9411-0d30-44e7-a0a7-98aa4860434d@googlegroups.com> |
| In reply to | #4158 |
On Tuesday, January 30, 2018 at 8:25:35 PM UTC-5, gid...@sasktel.net wrote: > On Tuesday, January 30, 2018 at 6:08:40 PM UTC-6, Anthony Ortiz wrote: > > Is there any way to directly access the absolute mouse position on a IIe via the IO space rather than calling the readmouse routine (which updates text screen hole) and having to read screen hole? > > > What are you calling the IO space, if its not the screen holes? > > I just copy the old coordinates from the screen holes to somewhere in memory before calling READMOUSE, and updating the new coordinates. > > Another thing you could do is set up a mouse interrupt so that your program is interrupted only when either the mouse moves or a button is pressed. This way you know the screen holes are still the same until you actually do the READMOUSE to update the screen holes. > > Or if you want the mouse coordinates to be somewhere totally different than where you pressed the button, is to set the coordinates in the screen holes, then call SETMOUSE. I meant the $CXXX IO space. I want to be able to directly poll the mouse coordinates via the $CXXX space without making any JSR calls to the mouse card rom read routine which, from what I understand, updates the text screen holes with position data that you then have to read from. The reason for this is that I want the peripheral card I'm making poll this IO space for mouse coordinates; it would complicate matters if I have to actually run the mouse rom routine first.
[toc] | [prev] | [next] | [standalone]
| From | gids.rs@sasktel.net |
|---|---|
| Date | 2018-01-30 19:28 -0800 |
| Message-ID | <552204aa-e044-4285-89cb-d394f8dd31df@googlegroups.com> |
| In reply to | #4159 |
> > What are you calling the IO space, if its not the screen holes? > > > > I just copy the old coordinates from the screen holes to somewhere in memory before calling READMOUSE, and updating the new coordinates. > > > > Another thing you could do is set up a mouse interrupt so that your program is interrupted only when either the mouse moves or a button is pressed. This way you know the screen holes are still the same until you actually do the READMOUSE to update the screen holes. > > > > Or if you want the mouse coordinates to be somewhere totally different than where you pressed the button, is to set the coordinates in the screen holes, then call SETMOUSE. > > I meant the $CXXX IO space. I want to be able to directly poll the mouse coordinates via the $CXXX space without making any JSR calls to the mouse card rom read routine which, from what I understand, updates the text screen holes with position data that you then have to read from. The reason for this is that I want the peripheral card I'm making poll this IO space for mouse coordinates; it would complicate matters if I have to actually run the mouse rom routine first. Right! I drew a blank there for a second. I thought I remembered the mouse using the I/O space, so checked my notes. Only the IIGS supports these locations. $C024 - mouse data byte $C027 - mouse status byte $C040.C047 $C040 - reserved $C041 - read mouse interrupts $C042 - reserved $C043 - reserved $C044 - Mouse Delta X $C045 - Mouse Delta Y $C046 - Mouse flags $C047 - Vblint
[toc] | [prev] | [next] | [standalone]
| From | Anthony Ortiz <anthonypaulo@gmail.com> |
|---|---|
| Date | 2018-01-30 19:34 -0800 |
| Message-ID | <d6d15d76-3a10-4f48-b74e-9d7d73dba6ba@googlegroups.com> |
| In reply to | #4164 |
On Tuesday, January 30, 2018 at 10:28:14 PM UTC-5, gid...@sasktel.net wrote: > > > What are you calling the IO space, if its not the screen holes? > > > > > > I just copy the old coordinates from the screen holes to somewhere in memory before calling READMOUSE, and updating the new coordinates. > > > > > > Another thing you could do is set up a mouse interrupt so that your program is interrupted only when either the mouse moves or a button is pressed. This way you know the screen holes are still the same until you actually do the READMOUSE to update the screen holes. > > > > > > Or if you want the mouse coordinates to be somewhere totally different than where you pressed the button, is to set the coordinates in the screen holes, then call SETMOUSE. > > > > I meant the $CXXX IO space. I want to be able to directly poll the mouse coordinates via the $CXXX space without making any JSR calls to the mouse card rom read routine which, from what I understand, updates the text screen holes with position data that you then have to read from. The reason for this is that I want the peripheral card I'm making poll this IO space for mouse coordinates; it would complicate matters if I have to actually run the mouse rom routine first. > > > > Right! I drew a blank there for a second. I thought I remembered the mouse using the I/O space, so checked my notes. > > Only the IIGS supports these locations. > > $C024 - mouse data byte > $C027 - mouse status byte > $C040.C047 > > $C040 - reserved > $C041 - read mouse interrupts > $C042 - reserved > $C043 - reserved > $C044 - Mouse Delta X > $C045 - Mouse Delta Y > $C046 - Mouse flags > $C047 - Vblint Darn... was hoping for some luck on the IIe. Does anyone have a disassembly of the mouse rom? I'm interested in knowing how it's copying position data to the text screen hole, particularly how/where it's getting it from in the first place.
[toc] | [prev] | [next] | [standalone]
| From | "Frank M." <frank_o_rama@hotmail.com> |
|---|---|
| Date | 2018-01-30 21:02 -0800 |
| Message-ID | <2cb872b6-1230-4ef4-b687-d6c594ad46f1@googlegroups.com> |
| In reply to | #4165 |
Get either "Apple IIE IIC firmware source code.2mg" or "Apple IIC firmware v2 source code.2mg" from your favorite FTP repository. Code will be for a IIc which should be the similar to the IIe with a mouse card installed. You can use ciderpress to extract the text source files from the disk image. Relevant files: TWOC/SOURCE/MOUSE TWOC/SOURCE/MINT TWOC/SOURCE/MCODE TWOC/SOURCE/MBASIC TWOC/SOURCE/IRQBUF "MOUSE" shows the following hardware equates: * Hardware addresses mouxint equ $C015 ;D7 = x interrupt mouyint equ $C017 ;D7 = y interrupt vblint equ $C019 ;D7 = vbl interrupt ioudsbl equ $C078 ;Disable iou access iouenbl equ $C079 ;Enable iou access mouclr equ $C048 ;Clear mouse interrupt iou equ $C058 ;IOU interrupt switches moudsbl equ $C058 ;Disable mouse interrupts mouenbl equ $C059 ;Enable mouse interrupts moubut equ $C063 ;D7 = Mouse button moux1 equ $C066 ;D7 = X1 mouy1 equ $C067 ;D7 = Y1 vblclr equ $C070 ;Clear VBL interrupt Frank
[toc] | [prev] | [next] | [standalone]
| From | Antoine Vignau <antoine.vignau@laposte.net> |
|---|---|
| Date | 2018-01-30 22:04 -0800 |
| Message-ID | <88bad9e4-a0af-4550-9334-489fc4516568@googlegroups.com> |
| In reply to | #4166 |
Favorite FTP site? I thought the original and only source was http://www.brutaldeluxe.fr/public/ Antoine
[toc] | [prev] | [next] | [standalone]
| From | "Frank M." <frank_o_rama@hotmail.com> |
|---|---|
| Date | 2018-01-30 22:29 -0800 |
| Message-ID | <28fd87ff-54ea-4d7d-8c67-7b1f67483a76@googlegroups.com> |
| In reply to | #4167 |
My bad! Didn't have the link handy. I meant favorite HTTP site.
[toc] | [prev] | [next] | [standalone]
| From | Brian Patrie <bpatrie@bellsouth.spamisicky.net> |
|---|---|
| Date | 2018-02-01 03:01 -0600 |
| Message-ID | <p4ul0o$52b$1@gioia.aioe.org> |
| In reply to | #4166 |
On 2018-01-30 23:02, Frank M. wrote: > Get either "Apple IIE IIC firmware source code.2mg" or "Apple IIC firmware v2 source code.2mg" from your favorite FTP repository. Code will be for a IIc which should be the similar to the IIe with a mouse card installed. > > You can use ciderpress to extract the text source files from the disk image. > > Relevant files: > > TWOC/SOURCE/MOUSE > TWOC/SOURCE/MINT > TWOC/SOURCE/MCODE > TWOC/SOURCE/MBASIC > TWOC/SOURCE/IRQBUF > > > "MOUSE" shows the following hardware equates: > > * Hardware addresses > mouxint equ $C015 ;D7 = x interrupt > mouyint equ $C017 ;D7 = y interrupt > vblint equ $C019 ;D7 = vbl interrupt > ioudsbl equ $C078 ;Disable iou access > iouenbl equ $C079 ;Enable iou access > mouclr equ $C048 ;Clear mouse interrupt > iou equ $C058 ;IOU interrupt switches > moudsbl equ $C058 ;Disable mouse interrupts > mouenbl equ $C059 ;Enable mouse interrupts > moubut equ $C063 ;D7 = Mouse button > moux1 equ $C066 ;D7 = X1 > mouy1 equ $C067 ;D7 = Y1 > vblclr equ $C070 ;Clear VBL interrupt > > Frank I think mouse blood & guts on a IIc is very different than on a IIe. I know that the IOU-enable/disable switch does not exist on the IIe.
[toc] | [prev] | [next] | [standalone]
| From | Anthony Ortiz <anthonypaulo@gmail.com> |
|---|---|
| Date | 2018-02-01 06:43 -0800 |
| Message-ID | <663c5822-89f2-4b11-969b-ae0f5d281556@googlegroups.com> |
| In reply to | #4169 |
Thanks guys. I looked at the source on brutaldeluxe’s site and it seems that I should be able to init the mouse and poll $C015-$C018 for coordinates and $C063 for button. What I don’t know is if this will work with interrupts disabled, I’ll have to write a quick basic program that inits the mouse, disables interrupts, and polls those locations for changes.
[toc] | [prev] | [next] | [standalone]
| From | Michael J. Mahon <mjmahon@aol.com> |
|---|---|
| Date | 2018-02-01 11:34 -0600 |
| Message-ID | <ROOdndIahfws0u7HnZ2dnUU7-SPNnZ2d@giganews.com> |
| In reply to | #4170 |
Anthony Ortiz <anthonypaulo@gmail.com> wrote: > Thanks guys. I looked at the source on brutaldeluxe’s site and it seems > that I should be able to init the mouse and poll $C015-$C018 for > coordinates and $C063 for button. What I don’t know is if this will work > with interrupts disabled, I’ll have to write a quick basic program that > inits the mouse, disables interrupts, and polls those locations for changes. > I'd expect that you'll have to poll pretty frequently to not miss mouse movement if interrupts are disabled. -- -michael - NadaNet 3.1 and AppleCrate II: http://michaeljmahon.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.apple2.programmer
csiph-web