D-Bug & Automation Forum
D-Bug & Automation Forum >> Coding >> Either a force relocation packer or a routine to relocate
http://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1334222877

Message started by Phill on 12.04.12 at 09:27:56

Title: Re: Either a force relocation packer or a routine to relocate
Post by ggn on 16.04.12 at 10:31:24

Phill wrote on 16.04.12 at 10:17:17:
[quote author=12353829382C23302C2A590 link=1334222876/14#14 date=1334568206]Still got the mouse code to figure out :(


Phill, take a look at the IKBD manual: http://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1280676368

Generally mouse packets come from the IKBD one byte at a time. The address that the ST uses for grabbing IKBD packets is $fffc02.w. The IKBD vector is at $118.w. Usually what happens in games is that they set up $118 to a custom routine, and when a ikbd interrupt occurs, that routine fires.

First thing that those routines do is to fetch a byte from $fffc02.w and figure out what type of packet they're getting. As you see from the ikbd manual, 0xF8-0xFB is relative mouse position records(lsbs determind by mouse button states), so if the routine detects this range, it fetches 2 more bytes that contain the delta x and delta y.

The only exception to the above is if the game programs the mouse to report absolute positions instead of relative, but this is very rarely the case and you can eliminate that by analyzing a couple of mouse packets using steem debug.

Hope this helps, but if you get totally stumped, give us a heads up :)

D-Bug & Automation Forum » Powered by YaBB 2.6.0!
YaBB Forum Software © 2000-2024. All Rights Reserved.