Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intro application closes on Windows 7 #15

Open
dartfnm opened this issue Feb 27, 2020 · 2 comments
Open

Intro application closes on Windows 7 #15

dartfnm opened this issue Feb 27, 2020 · 2 comments

Comments

@dartfnm
Copy link

dartfnm commented Feb 27, 2020

The problem with GetAsyncKeyState, MSDN says:

Determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to GetAsyncKeyState.

You need to call

	push 01bH ;ESC key code for GetAsyncKeyState
	call GetAsyncKeyState ; RESET KEYS STATES

Before asking a key for exit from application

call GetAsyncKeyState
jz mainloop

@w23
Copy link
Owner

w23 commented Feb 28, 2020

I'm not sure I understand what the problem is. Is it the case that ESC being pressed just before an intro is run results in intro just exiting at once?

If so, I don't think adding additional call for handling a rare case can be justified from size perspective. After all, we cut so many corners in an attempt to make it under 4096 bytes.

@dartfnm
Copy link
Author

dartfnm commented Mar 11, 2020

Проблема была у меня под Виндой 7-кой, интра закрывалась сразу после загрузки, без ошибок. Пришлось подебажить - и оказалась что интра выходит из цикла сразу же, на первом Loop'e, потому что это async функция GetAsyncKeyState - возвращаяет дельту состояний, между прошлым вызовом и этим, а раз ты вызов этой функции до этого не делал, - то происходит сразу выход из нее.
Лечится просто добавлением 2х строк перед основным циклом:

	push 01bH ;ESC key code for GetAsyncKeyState
	call GetAsyncKeyState ; RESET KEYS STATES

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants