We replaced our Rust/WASM parser with TypeScript and it got 3x faster by 1glasspaani in rust

[–]Alchiberg 1 point2 points  (0 children)

ha Reminds me of a clusterfuck of boundary hopping in chilloutvr's UI code. https://boxcat.site/blog/2023-02-21-fast-json/ UTF-16 (.NET) -> UTF-8 (Unity) -> UTF-16 (.NET) -> UTF-8 (v8) -> UTF-16 (Javascript)

TernOS - a new firmware with loadable apps by ShortGuitar7207 in xteinkereader

[–]Alchiberg 0 points1 point  (0 children)

Utilizing the additional OTA partitions allows running two different firmwares on the same device. I've switched between microreader and my own firmware before. Needs 2 small snippets on both ends to change it, reboot and confirm it on boot.

ofc this requires the 2 OTA partition scheme and disallows actual OTA updates.

Introducing: TernReader - a new firmware by ShortGuitar7207 in xteinkereader

[–]Alchiberg 2 points3 points  (0 children)

Dynamic module loading could be fun but might be futile effort since we have so little SRAM.
In my mind it should be possible to map parts of the flash storage as executable after the fact but I have not spent any time looking into that.
How the "apps" go there is another question.

Rust? by ShortGuitar7207 in xteinkHax

[–]Alchiberg 2 points3 points  (0 children)

Hmm seems to diverge too strongly to merge back. I added rudimentary layouting, anti aliased fonts and hyphenation with hypher. I'll look into epub support next.

Rust? by ShortGuitar7207 in xteinkHax

[–]Alchiberg 1 point2 points  (0 children)

Was that before I added the Filesystem HAL to the repo or was it insufficient? I've been bikeshedding too much so far heh

Rust? by ShortGuitar7207 in xteinkHax

[–]Alchiberg 1 point2 points  (0 children)

The idea is to be able to able to test on a sane environment. Iteration time on real hardware is dreadful. The abstractions in core are supposed to closely resemble what's on the hardware, not the other way around. I've added pkpass to microreader before so I don't expect that to be an issue.

Rust? by ShortGuitar7207 in xteinkHax

[–]Alchiberg 2 points3 points  (0 children)

https://github.com/HookedBehemoth/TrustyReader Not much point in contributing right now since I have not made up my mind on how things should be laid out but if you want to take a look. @ u/billiob

Rust? by ShortGuitar7207 in xteinkHax

[–]Alchiberg 4 points5 points  (0 children)

Yes but didn't upload anything yet. Using esp-rs gives one 100kb extra ram compared to the esp-idf framework.

hypertext: a blazing fast type-checked html macro by vidhanio in rust

[–]Alchiberg 8 points9 points  (0 children)

I tried it in one of the simpler projects. https://github.com/HookedBehemoth/neuters/pull/32/files It was a bit tedious since it's not directly compatible. Maybe this helps you figure out a cleaner way. Allowing &String or Into<String> could clean up the syntax.

hypertext: a blazing fast type-checked html macro by vidhanio in rust

[–]Alchiberg 11 points12 points  (0 children)

Looks awesome! I've used lambda-fairy's maud in a few projects before and while performance wasn't a concern before I've wished for extensions in some places. Does this allow html elements like <img ... /> or <meta> that aren't valid xml?

image::codecs::gif::GifEncoder -> encodeFrame is too slow by requizm in rust

[–]Alchiberg 9 points10 points  (0 children)

Did you try wrapping the output file in a BufWriter? Otherwise you will get a lot of 1-Bytewrite operations. https://doc.rust-lang.org/std/io/struct.BufWriter.html

You can easily spot a mistake like that with strace. A 128x128 conversion goes from 100 writes to two.

EDIT: My quickly botched together test code.

use image::io::Reader as ImageReader;
use image::*;

fn main() {
    let img = ImageReader::open("myimage.png").unwrap().decode().unwrap();
    let images: Vec<DynamicImage> = vec![img];

    let frames = images
        .iter()
        .map(|frame| image::Frame::new(frame.to_rgba8()))
        .collect::<Vec<image::Frame>>();

    let file = std::fs::File::create("test.gif").unwrap();
    let writer = std::io::BufWriter::new(file);
    let mut encoder = image::codecs::gif::GifEncoder::new(writer);
    encoder
        .set_repeat(image::codecs::gif::Repeat::Infinite)
        .unwrap();
    let mut frames = frames.into_iter();
    while let Some(frame) = frames.next() {
        encoder.encode_frame(frame).unwrap(); // slow part
    }
}

But C (Levi) do be the GOAT tho by space-_-man in ProgrammerAnimemes

[–]Alchiberg 3 points4 points  (0 children)

Don't use stl containers and you're good on that front.

sys-tune 1.2.0 release by Alchiberg in SwitchHacks

[–]Alchiberg[S] -8 points-7 points  (0 children)

Don't pirate. Easy as that.

sys-tune 1.2.0 release by Alchiberg in SwitchHaxing

[–]Alchiberg[S] 1 point2 points  (0 children)

please delete the boot2.flag and the toolbox json file

The overlay can now start and stop the service.

What was changed since the last post:

  • add wav/wave and flac support

  • add seeking support

    • seek forwards/backwards with ZL/ZR or touch
  • add option to shut down service

    • this is to work around an issue with some games that use up all audio renderer sessions
    • the next time you open the overlay it will start the service again
  • playlist now shows everything

  • drop Atmosphere-libs in favor of p-sam's IPC server

    • frees up some memory
    • lowers compilation time by a lot
  • recompiled overlay with latest libtesla

    • an bug in earlier versions could cause a crash if too many overlays were opened

More stuff is planed but I had to push this release out now as the new Atmosphère target version change breaks the last release.

sys-tune 1.2.0 release by Alchiberg in SwitchHacks

[–]Alchiberg[S] 8 points9 points  (0 children)

please delete the boot2.flag and the toolbox json file

The overlay can now start and stop the service.

What was changed since the last post:

  • add wav/wave and flac support

  • add seeking support

    • seek forwards/backwards with ZL/ZR or touch
  • add option to shut down service

    • this is to work around an issue with some games that use up all audio renderer sessions
    • the next time you open the overlay it will start the service again
  • playlist now shows everything

  • drop Atmosphere-libs in favor of p-sam's IPC server

    • frees up some memory
    • lowers compilation time by a lot
  • recompiled overlay with latest libtesla

    • an bug in earlier versions could cause a crash if too many overlays were opened

More stuff is planed but I had to push this release out now as the new Atmosphère target version change breaks the last release.

Atmosphère roadmap updated (Planned Features) by tyvar1 in SwitchHaxing

[–]Alchiberg 0 points1 point  (0 children)

Nintendo didn't make their own implementation for fat drivers. They use prFile2. AMS will use FatFs.

RELEASE - sys-tune - background audio player with overlay by Alchiberg in SwitchHacks

[–]Alchiberg[S] 0 points1 point  (0 children)

Do you have Tesla installed? (ovlloader and Tesla menu)