Jump to content
IGNORED

Keyboard reading discrepancy between emulators


TheMole

Recommended Posts

Hi all, I've been working on adding some new features to Ghostbusters that require keyboard input. One of these features is the scrolling status bar that shows your battery charge, men and traps when you press the spacebar. Unfortunately, I'm running into a discrepancy between mess and the other emulators I can run on my system (js99er and bulwip).

 

When running the game in Mess, the code that checks the spacebar will also return true if fire is pressed on joystick 1. This does not seem to happen in the other emulators. Now, given that I'm on a mac, and mess has had some issues with the mac keyboard for me in the past (mostly weird key definitions and not reading some meta keys, nothing major), I'm wondering if there's a bug in my code that is not triggering on js99er and bulwip, or if it's a mess keyboard issue...

 

Here's the code that scans the keyboard matrix for a spacebar press:

unsigned char read_spacebar() 
{
	unsigned int col = 0, key;

	__asm__
	(
		"li r12,>0024	\n\t"
		"ldcr %1,3	\n\t"
		"src r12,7	\n\t"
		"li r12,>0006	\n\t"
		"clr %0		\n\t"
		"stcr %0,8" 
		: "=r"(key) 
		: "r"(col) 
		: "r12"
	);

	return !(key & 0x0200);
}

 

I've attached a bin and an rpk for testing, I'd be really grateful if someone could test this on classic99 or mess-on-windows for me. If pressing fire shows something like the below (scrolling text in the blue bar), the bug exists there as well (pressing spacebar should show this message):

Screenshot2023-10-04at19_52_35.thumb.png.995babae3bf2387dd98e153d1e1c7388.png

 

 

 

ghostbusters.rpk ghostbusters.bin

  • Like 1
Link to comment
Share on other sites

Yeah, first thing I did was double check the assignments, but those looked fine. I went back now to try some different configurations and did notice that if I changed the keyboard mode from 'natural' to 'emulated' the problem went away, so I guess that confirms its an issue with the way mess implement the natural keyboard routines.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...