uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit de3591c07e694099c68a51a3531cf4331005359a
parent a58ffb982806510b9d98640fa9f92c373c08d6df
Author: neauoire <aliceffekt@gmail.com>
Date:   Sun,  1 Aug 2021 21:51:43 -0700

Fixed issue with mouse zoom

Diffstat:
Mbuild.sh | 4++--
Msrc/uxnemu.c | 4++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/build.sh b/build.sh @@ -54,9 +54,9 @@ then fi echo "Assembling.." -./bin/uxnasm projects/examples/devices/screen.tal bin/screen.rom +./bin/uxnasm projects/examples/demos/theme.tal bin/theme.rom echo "Running.." -./bin/uxnemu bin/screen.rom +./bin/uxnemu bin/theme.rom echo "Done." diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -213,8 +213,8 @@ static void domouse(SDL_Event *event) { Uint8 flag = 0x00; - Uint16 x = clamp(event->motion.x - PAD, 0, ppu.width - 1); - Uint16 y = clamp(event->motion.y - PAD, 0, ppu.height - 1); + Uint16 x = clamp(event->motion.x / zoom - PAD, 0, ppu.width - 1); + Uint16 y = clamp(event->motion.y / zoom - PAD, 0, ppu.height - 1); mempoke16(devmouse->dat, 0x2, x); mempoke16(devmouse->dat, 0x4, y); switch(event->button.button) {