Skip to content

Fix output garbling and allow clean restart after game exit #15

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

Closed

Conversation

liangchingyun
Copy link

This pull request includes two key improvements:

  1. Fix output garbling issue

    • Ensures the display buffer is null-terminated by adding:
      display_buf[DRAWBUFFER_SIZE - 1] = '\0';
    • This prevents garbled output when printing the buffer.
  2. Enable clean re-execution of the user program

    • Previously, after quitting the game via Ctrl+Q, an internal flag remained set,
      preventing subsequent game runs unless the module was reloaded.
    • This patch resets the termination flag when the device is closed.

- Resolved the issue where the output was garbled.
- Added comments to parts of the code
  for better clarity and understanding.
After Ctrl+Q is used to quit the game, an internal flag is set to
indicate termination. This prevents the user program from entering
its main loop on subsequent runs.

This patch ensures the flag is cleared when the device file is
closed, so the game can be restarted without needing to reload the
kernel module.
@liangchingyun liangchingyun deleted the fix-output-and-reset-flag branch April 14, 2025 02:31
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

Successfully merging this pull request may close these issues.

1 participant