Language…
11 users online:  AmperSam, Anas, Cristian Cardoso, Golden Yoshi, Hayashi Neru, mmmdoggy, MorrieTheMagpie, nonamelol1, PMH, Rauf, Sokobansolver - Guests: 249 - Bots: 457
Users: 64,795 (2,377 active)
Latest user: mathew

SNES Mouse Coding?

Can someone tell me how to code stuff with the SNES Mouse? I want to see what I can do with it. Thanks!
I have no idea what to change my layout it to...
It's been done, I suggest you ask 1024 about it.

World Community Grid: Thread | Team
 
If you don't know assembly as it stands then don't bother, otherwise:

It's documented in full in multiple places.

http://www.romhacking.net/docs/SNESDevManual.rar

I can't view this at the moment but it has official sample code to use with the mouse, as in you copy it over and it will read the mouse properties for you into some RAM addreses of your choosing. It's a massive document, but it does have bookmarks for all the major peripherals for easier navigation.

http://www.romhacking.net/docs/%5B196%5Dregs.txt

CTRL+F "Mouse" but it's strictly technical and may not help as much. See nintendo's code up above first, or any code from anyone willing to share.

It's piss easy to interface with and it's been known how to do so in full for many years, no one's just bothered to put it into SMW until recently, perhaps due to it being mostly a gimmick that doesn't tie so well into tradtional SMW. Now someone just needs to make a superscope hack, no!, a konami justifiers hack! twice the guns! =)

Someone willing to share sample code beyond nintendo's? I have a 256 col mario paint-esque homebrew but the source isn't on this computer.
I have done some messing around with the mouse, but haven't utilized it to nearly full potential.

Basically, I've written some terribly crap code for checking the left/right button being pressed in port 2:

Code
mowz:

	
	REP #$30                ;16 bits
	LDA $421A		;check port 2 for input
	AND #$0080		;test bit 7
	BNE ClickRight		;do something
	LDA $421A               ;load port 2 data again (sloppy)
	AND #$0040
	BNE ClickLeft
	SEP #$30
	RTL

ClickRight:
	SEP #$30
	LDA #$7F           ;effect for right click
	STA $7B
	RTL

ClickLeft:

	SEP #$30
	LDA #$80           ;effect for left
	STA $7D
	RTL


You can use the above code, though I would recommend against it, to do stuff based on right/left clicks only, and only if the mouse is in port 2.

I haven't gotten around to using the movement/speed bits, so if anyone has any method of applying those on hand that would be super cool.

EDIT: After reading the SNES dev manual that was referenced to, I'm even more sure the code I posted is pure garbage, but also I'm curious about the included routine for Mouse controls. Is it viable for use in SMW? I'm not sure how many things you would have to mess around with to get it to work right.
Originally posted by smkdan
If you don't know assembly as it stands then don't bother, otherwise:

It's documented in full in multiple places.

http://www.romhacking.net/docs/SNESDevManual.rar

I can't view this at the moment but it has official sample code to use with the mouse, as in you copy it over and it will read the mouse properties for you into some RAM addreses of your choosing. It's a massive document, but it does have bookmarks for all the major peripherals for easier navigation.

http://www.romhacking.net/docs/%5B196%5Dregs.txt

CTRL+F "Mouse" but it's strictly technical and may not help as much. See nintendo's code up above first, or any code from anyone willing to share.

It's piss easy to interface with and it's been known how to do so in full for many years, no one's just bothered to put it into SMW until recently, perhaps due to it being mostly a gimmick that doesn't tie so well into tradtional SMW. Now someone just needs to make a superscope hack, no!, a konami justifiers hack! twice the guns! =)

Someone willing to share sample code beyond nintendo's? I have a 256 col mario paint-esque homebrew but the source isn't on this computer.


Sorry, but none of those pages exist. :/
I have no idea what to change my layout it to...
Originally posted by smkdan
oh they exist, looks like they now show up as 404 without a proper referrer.

http://www.romhacking.net/docs/196/
http://www.romhacking.net/docs/226/

download links for the two files on these pages.


Okay, I looked at the code for the SNES Mouse, copied the whole thing, and it won't insert with Xkas GUI. I think there's some ending or starting tags I'm missing, so could you tell me what they might be? (I can't find them in the ASM tut, so I think it's okay to ask here)
I have no idea what to change my layout it to...
OK, after looking at the RAM Map, I have an idea, but I'm not sure how to do it.

I need to figure out way to make it where the game detects the mouse and then sets the controller data RAM based on where it is. Anbody got any pointers? I kind of know how to do something like that, but I don't know where to fit itin the SNES Mouse code.
I have no idea what to change my layout it to...