Login  •  Register


The time is now: Sat Jul 20, 2019 7:42 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 17 posts ]
Print view Previous topic  |  Next topic
Author Message
PostPosted: Tue Jan 22, 2019 2:17 am 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
When I run BasiliskII (built from kanjitalk755's code) under Windows, and press Alt-F4, an window opens in System 7 that I've never seen before:
Image

It accepts keyboard input, and clears its contents (but remains open) when I press Alt-F4 again. But I can't imagine what it's doing. It doesn't seem connected with any extensions or control panels, because it happens when

There seems to be no way out of this except to restart BasiliskII (with Shift-Alt-F4, apparently). And the window opens with Alt-F4 even if I start with no extensions at all.

I can't reproduce this in BasiliskII for macOS, and I don't see it in older builds. I can't find anything the source code that might be involved, but probably I haven't looked hard enough.

Does anyone recognize this?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 22, 2019 2:28 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2644
Location: Emaculation.com
What happens if you type in "SM 0 A9F4" <return> "G 0" <return> ?

It looks a lot like the programmer's screen when you don't have a debugger installed, although not quite.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 22, 2019 2:44 am 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
adespoton wrote:
What happens if you type in "SM 0 A9F4" <return> "G 0" <return> ?

It looks a lot like the programmer's screen when you don't have a debugger installed, although not quite.


Hmm... I see that the codes you asked me to type are supposed to let you exit to the shell (or Finder?). Is that right?

When I type in those lines, after the first, a big display of hex codes appears. Then after the second line, BasiliskII quits abruptly.

Is Alt-F4 somehow acting as the programmer key? As far as I can tell, I don't have MacsBug installed anywhere. And I've never seen it before now.

And I see that I can press G and exit this input window. Now to search for the debugger in the source code and see if I can stop this from happening...

EDIT: I wonder if this has something to do with SDL2 under Windows? Some odd keyboard effect associated with switching to SDL2?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 22, 2019 6:38 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
Well, I'm completely baffled by this. I can't find anything in the source code that suggests what might be going on. Next, I suppose, is to search the SDL2 code...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 22, 2019 9:00 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2644
Location: Emaculation.com
This is definitely the programmer key being triggered; all the behaviour you're describing and the generic window shape lines up with that.

Is this due to you using an SDL1 keycodes file with SDL2?

[and yes, SM = Set Memory, at address 0, to A9F4 which is the code for quitting the frontmost application. G = Resume processing instructions, at address 0]

If you had MacsBug installed, you'd get the full-blown debugger on your screen instead of the programmer window you saw.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Tue Jan 22, 2019 10:06 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
adespoton wrote:
Is this due to you using an SDL1 keycodes file with SDL2?


I'm away from my build machine right now, but will check this later on. I know that kanjitalk755's macOS code explicitly removes the keycodes file from the resources, but I'm not sure whether this was also done under Windows. (I'll experiment with renaming the keycodes files and rebuilding.)


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 9:57 am 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5460
Location: Amsterdam, Netherlands
Here is a keycodes file that is updated to include translation of cocoa (SDL2) scancodes to Mac keycodes: http://ronaldpr.home.xs4all.nl/basiliskiiforum/keycodes


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 2:32 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
Ronald P. Regensburg wrote:
Here is a keycodes file that is updated to include translation of cocoa (SDL2) scancodes to Mac keycodes: http://ronaldpr.home.xs4all.nl/basiliskiiforum/keycodes


I downloaded that file, renamed it BasiliskII_keycodes so that BII would use it, and got the error message "Cannot find vendor 'windows' in keycode translation file BasiliskII_keycodes."

So I added the string "sdl windows" at the top of the each of the keyboard definition groups, and BasiliskII loaded those definitions, but the debug window still opens with Alt+F4.

Still puzzled...


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 3:50 pm 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5460
Location: Amsterdam, Netherlands
emendelson wrote:
So I added the string "sdl windows" at the top of the each of the keyboard definition groups,

I do not think that is correct. BasiliskII should choose only one of the translation sets from the keycodes file. Did the error message not appear with the old keycodes file? Was there an "sdl windows" in that file?


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 3:54 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
Ronald P. Regensburg wrote:
emendelson wrote:
So I added the string "sdl windows" at the top of the each of the keyboard definition groups,

I do not think that is correct. BasiliskII should choose only one of the translation sets from the keycodes file. Did the error message not appear with the old keycodes file? Was there an "sdl windows" in that file?


With "keycodes true" in the prefs file, and with the old BasiliskII_keycodes file in the same folder, I get exactly the same error message. There is no "sdl windows" definition in the file. Perhaps SDL2 requires it?

EDIT: And if I add "sdl windows" to the Windows definition, BII launches, but Alt+F4 causes the debug window to open - and then that window won't accept input, so I have to force-quit from the task manager.

My guess is that this won't be fixed until kanjitalk755 figures out what is happening. Meanwhile, the Windows version of the BII code isn't really usable.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 4:10 pm 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5460
Location: Amsterdam, Netherlands
As far as I know, the SDL2 scancodes are platform independent. Then the place to add a line "sdl windows" or possibly just "windows" is above or below the line "sdl cocoa". The correct string will be somewhere in the source code. I suppose kanjitalk755 will know.

You can check if the correct translations are used when you switch to a different keyboard layout on both host and guest, for instance to the French AZERTY keyboard. Pressing the Q and W keys on your QWERTY keyboard should then result in an A and a Z.


Last edited by Ronald P. Regensburg on Wed Jan 23, 2019 4:15 pm, edited 1 time in total.
 


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 4:15 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
I tried putting "sdl windows" at the top of all the definitions, including cocoa. None worked to solve the Alt+F4 issue. The keyboard definitions were clearly being loaded, as keys like the tilde and others changed according to which definition got loaded.


Last edited by emendelson on Wed Jan 23, 2019 4:25 pm, edited 1 time in total.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 4:20 pm 
Offline
Expert User
User avatar

Joined: Thu Feb 09, 2006 10:24 pm
Posts: 5460
Location: Amsterdam, Netherlands
Well, so it worked. But not to solve the Alt-F4 issue.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Wed Jan 23, 2019 4:25 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
Yes, I clarified my earlier post.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Sat Mar 30, 2019 4:27 am 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 90
I have changed to ignore Alt+F4.

https://github.com/kanjitalk755/macemu


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Apr 01, 2019 12:05 pm 
Offline
Forum All-Star

Joined: Tue Oct 14, 2008 12:12 am
Posts: 1052
kanjitalk755 wrote:
I have changed to ignore Alt+F4.

https://github.com/kanjitalk755/macemu


Thank you, kanjitalk755. I hope someday we might find out the cause of this problem, in case there is some Mac software that uses Option-F4.


Top
 Profile  
Reply with quote Post a reply  
PostPosted: Mon Apr 01, 2019 12:53 pm 
Offline
Tinkerer

Joined: Thu Nov 09, 2017 12:06 pm
Posts: 90
Under Windows, Alt+F4 generates SDL_QUIT event.
BasiliskII emulates to press power button when processing that event.
At this time, if Alt key is also pressed, the key combination is equivalent to the programmer's key on the old mac.

Applications can read the key value, so it should be no problem.


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 17 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group