Skip to content

Conversation

@ghaerr
Copy link
Owner

@ghaerr ghaerr commented Apr 9, 2024

As a final tty game before the v0.8.0 release, mostly to test the ELKS curses library (which worked for the most part for this port), ttypong is now running on ELKS.

The per-frame output routine had to be rewritten, much like sl running extremely slowly as discussed in #1619 (comment) until it was rewritten. ELKS just can't process the huge amount of ANSI escape sequences our mini version of curses spits out.

Tested only on QEMU. The default inter-frame delay is 40000 usecs, which can be changed to be half that using ttypong 20000 for instance, to speed things up. It would be interesting to see how fast this runs on real hardware.

Unfortunately, at the moment ttypong is only available on the 2880k disk image, as the 1440k only has ~10k bytes left, and ttypong is 11k. Speaking of which, all these ncurses-based games are huge, compared to what ELKS is used to.

Here are the current sizes of the tty games and fm, which also uses curses:

-rwxr-xr-x  1 greg  staff  19904 Apr  8 17:45 ttyclock
-rwxr-xr-x  1 greg  staff  11360 Apr  8 18:08 ttypong
-rwxr-xr-x  1 greg  staff   6336 Apr  8 15:19 ttytetris
-rwxr-xr-x  1 greg  staff  21632 Apr  8 17:45 fm
ttypong

Use the up/down arrow keys or h and j to move the racket, and q to quit.

ghaerr added 2 commits April 8, 2024 17:14
of the curses routines emitted far too many escape
sequences which slowed down ELKS. There is now an
inter-frame delay of 40000 usecs by default. This
can be changed by passing a new value as an argument,
"ttypong 20000" for instance, to speed it up.
@ghaerr ghaerr merged commit 0e523f9 into master Apr 9, 2024
@ghaerr ghaerr deleted the ttypong branch April 9, 2024 01:36
@toncho11
Copy link
Contributor

toncho11 commented Apr 9, 2024

Awesome!

But all these tty apps and games should be on the hdd images where there is enough space, right? It is not so clear looking at elkscmd/Applications file.

@ghaerr
Copy link
Owner Author

ghaerr commented Apr 9, 2024

Yes, all programs specified in the elkscmd/Applications file, including the somewhat confusing lines without a :1440k (or other) size tag are copied to the HD and 2880k floppy images.

I am thinking about creating a new facility where individual application program files can be compressed on the distribution, which would allow more programs on each floppy size. The drawback is that the kernel decompression slows down the application start, and can be pretty slow on older 8088 machines. Another idea would be a permanent decompressor that could be run by a user for more often-used binaries.

@toncho11
Copy link
Contributor

toncho11 commented Apr 10, 2024

I noticed that you control the racket on the left. Interestingly even if the racket is not there the ball still bounces back in some kind of invisible wall? Can you actually lose the game?

@ghaerr
Copy link
Owner Author

ghaerr commented Apr 10, 2024

Interestingly even if the racket is not there the ball still bounces back in some kind of invisible wall?

Yes, that seems to be the way the game was written. Take a look, its a pretty small program, perhaps you can modify it to optionally require a racket hit to bounce back or add other enhancements.

Can you actually lose the game?

No! I suppose this means its more of a pong demo lol.

Did you run this on your 8088 PC, or just QEMU? I'm interested to see how fast it is on real hardware, and what the sleep usecs needs to be.

@toncho11
Copy link
Contributor

Not yet on real 8088, only https://copy.sh/v86/.

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.

3 participants