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

DwarfStar, a small editor with WordStar keybindings #174

Merged
merged 6 commits into from
Sep 16, 2024

Conversation

ivop
Copy link
Contributor

@ivop ivop commented Sep 13, 2024

I always wanted to write a text editor, so here's my take on it. Because qe is already a a gap-buffer based text editor, I tried the "Build Your Own" text editor approach, which is a vector of pointers to lines. It's a little less memory friendly, but on the other hand a lot easier to render to the screen. It includes a malloc implementation (other programs can use it, too) that's somewhat tweaked for decent performance, but also overallocs a bit to reduce memory fragmentation, at the cost of four bytes on average for each allocation. I also found that allocating at the end of free blocks is a lot faster, but reduces overall memory utilization, so I decided against it and switched back to allocating at the beginning of free blocks. Once the cpm65 target of llvm-mos grows heap support we could switch to that and see how it performs. I found it non-trivial to add to llvm-mos, and I've always wanted to write my own malloc, too :)

Currently it is installed on the Oric, Atari, nano6502 and neo6502 ports. The other ports don't have enough free disk space. It would be nice if they gained multi drive support, because recently I briefly looked into adding all native asm sources to the "distribution" and several ports couldn't fit them on their disk either.

Anyway, here's DwarfStar.

Oric:
ds-oric
Atari:
ds-atari
BBC: (I disabled atbasic and ansiterm to test it)
ds-bbc131

included in the Oric, Atari, nano6502, and neo6502 port. PET, Apple,
BBC, and C64 don't have enough free disk space.
@ivop
Copy link
Contributor Author

ivop commented Sep 13, 2024

Hmm, that's weird. Mametest ran successfully on my branch. It seems to error out on a missing sound device?

ivop and others added 3 commits September 13, 2024 22:55
remove all checks for previous and next blocks. Resulting binary is
smaller and faster.
realloc to the application to make the zmalloc library more universally
usable instead of imposing application specific behaviour to every user.
the resulting binary is slightly larger, but speed is the same.
@ivop
Copy link
Contributor Author

ivop commented Sep 14, 2024

CI keeps failing during the Oric mametest with: fail
ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

But it passes on my branch.

@davidgiven
Copy link
Owner

Very nice! Possibly less buggy than qe, too... question: do you want this in apps or would you rather it went into third_party, to make it clear that it's yours? This is probably a large enough piece of work to matter.

Re the Oric mame failure: that warning always appears. Chances are that it's a timing edge case caused by the disk being fuller and it taking longer to do the disk seeking, but it's weird it's only happening on the CI system. Maybe a different version of mame? You might try editing src/arch/oric/mame-test.lua and increasing the wait values.

@ivop
Copy link
Contributor Author

ivop commented Sep 14, 2024

Thanks. I moved it to third_party. I left zmalloc.c in lib as it is usable by other future projects and people might otherwise not notice its existence.

Edit: as for the Oric/mametest failure, I cannot test whether changing the wait values works because in my fork/branch here: https://github.com/ivop/cpm65/tree/dwarfstar the CI does not fail :) Which is pretty strange. You'd think that the merge test and CI here as a pull request should result in the exact same tree as my fork and both should behave identical, but they don't.

@davidgiven
Copy link
Owner

Looks like I'm fixing the test failure on master, then... merging. Thanks very much!

@davidgiven davidgiven merged commit 351c4a7 into davidgiven:master Sep 16, 2024
1 check failed
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.

2 participants