Hi,
I've managed to implement Edwin's assembly mouse routine and it works but the sprite I'm controlling keeps randomly jumping 16 pixels in every direction. Can it be a stray bit somewhere?
I've been looking around but MSX1 mouse control in assembly seems to be a very sparse topic.
As GTPAD only seems to work on then MSX2 I'm stuck with Edwin's approach.
I'm using openMXS 0.15.0.
Here is my routine:
ld d,0x93 ; mouse number 1 ld e,0x10 ; mouse number 1 mouse: call gtmous ; the mouse reading routine ld a,(pos) sub a,h ld (pos),a ld a,(pos+1) sub a,l ld (pos+1),a ld a,(pos) ld hl,6913 call wrtvrm ld hl,0x1800 call wrtvrm ld a,(pos+1) ld hl,6912 call wrtvrm ld hl,0x1801 call wrtvrm jp mouse
Yes, I'm more than a little assembly impaired :P
EDIT:
Ok, I've done something very terrible, I've added this
ld a,15 cp h jp z,mouse ld a,240 cp h jp z,mouse ld a,15 cp l jp z,mouse ld a,240 cp l jp z,mouse
right after call gtmous
to filter the 15 bits jumps and it worked but come on, I feel dirty!
Login sesión o register para postear comentarios