@jsbarretto@social.coop
@jsbarretto@social.coop avatar

jsbarretto

@jsbarretto@social.coop

Interested in Rust ๐Ÿฆ€, trains & sustainable urbanism ๐Ÿš‡, politics of the left ๐ŸŒน, gardening ๐ŸŒป, type systems & language dev ๐Ÿช„, energy policy ๐Ÿ”Œ, gamedev ๐Ÿ•น๏ธ, ecology ๐ŸŒฑ. Born at 364 ppm ๐ŸŒ.

The future is not synthesised in Silicon Valley, it is forged by us all โœŠ

This profile is from a federated server and may be incomplete. Browse more on the original instance.

jsbarretto, to random
@jsbarretto@social.coop avatar

A few days ago I suddenly had a desire to port Super Mario 64 to the Gameboy Advance.

I quickly realised that a straight port was going to be impossible given that the GBA:

  • Is about an order of magnitude slower than the N64
  • Lacks a GPU or any sort of hardware parallelism (you get about 10 cycles per pixel, per frame to rasterise everything in software, and that's it)
  • Has no hardware support for floating point maths

So, I guess I'm rewriting the whole thing from scratch.

video/mp4

jsbarretto,
@jsbarretto@social.coop avatar
jsbarretto,
@jsbarretto@social.coop avatar

I have implemented collision detection and resolution with the geometry mesh including wall and floor sliding...

...all without a single division operation (they're slow).

I spent ages trying to fix a mystery unsolid floor bug only to realise that the triangle frustum check was overflowing internally. Fixed-point maths sucks, makes me realise how painless and elegant floating point is in comparison.

jsbarretto,
@jsbarretto@social.coop avatar

Are there any 3D modelling gurus that feel like taking a stab at an ultra low-poly Mario? I'm abysmal with Blender. Here's my attempt at simplifying the existing model, down to 172 polygons. Ideally, I'd like to get below 100.

jsbarretto,
@jsbarretto@social.coop avatar

Texture mapping, mipmaps, and transparency support for today. Oh, and the game can now switch between stages.

I'm surprised by how performant these ended up being. Texture mapping roughly doubles the cost of the rasteriser inner loop but nothing else, mipmapping is basically free, and transparency support - after a lot of prodding - compiles down to a single assembly instruction in the inner loop.

That said, none of them are free so the game is gradually slowing down despite my best efforts.

A zoomed out view of Peach's castle with mipmapping enabled. Because of this, the textures in the scene are less noisy and the shape of the castle is clearer and easier on the eye (less visual noise).
A close up screenshot in front of the castle showing textured walls, a semi-transparent fence, and shaded textures.

jsbarretto,
@jsbarretto@social.coop avatar

Here's a video of it all in action (minus mipmapping, I got that working less than an hour ago): https://youtu.be/K0ye--qxt-w

gsuberland, to random
@gsuberland@chaos.social avatar

I keep finding ridiculously long hairs growing out of my eyebrows and at this rate I'm going to end up looking like the Archbishop of Canterbury

jsbarretto,
@jsbarretto@social.coop avatar

@gsuberland Cherish them, in time you'll recognise them as the true refugees of the scalp that they are

nixCraft, to linux
@nixCraft@mastodon.social avatar
jsbarretto,
@jsbarretto@social.coop avatar

@nixCraft The problem with "simple interfaces" like text is that you end up needing to implement unique parsing and error handling code in basically every tool to properly deal with the unstructured interface that it's forced to accept, and now suddenly each tool is not so simple any longer.

jsbarretto, to random
@jsbarretto@social.coop avatar

NOT HAPPY

jsbarretto, to random
@jsbarretto@social.coop avatar

I feel like the introduction of snap/flatpak has seriously degraded the Linux desktop experience. Yes, I understand the on-paper advantages: but it's been several years now and I'm still constantly dealing with tiny papercuts, weird containerisation bugs, and not knowing which of the many different package managers I should use to install a piece of software.

jsbarretto,
@jsbarretto@social.coop avatar

A few months ago I got an old Thinkpad up and running again to use on my commute. It's got a pretty tiny SSD on it so to save on disk space I decided I'd install a distro that leans into system-wide packages instead of containers.

I've been very careful to only install things from system repositories (with a few minor exceptions for things I've installed from source).

A few months later and things are going great. I spend much less time fucking around trying to make things work. It's blissful.

jsbarretto,
@jsbarretto@social.coop avatar

This little laptop is really a joy to work with now. It's incredibly stable, the DE and apps have a really small footprint, and all of the software I have installed just works.

jsbarretto,
@jsbarretto@social.coop avatar

On my main machine, on which I have several containerised apps, I've hit the following containerisation issues:

  • Firefox demanding to be made the default browser every few weeks (it already is)

  • Gamepad inputs not being passes to apps seemingly at random (not permissions-related)

  • Some apps being unable to start a Vulkan context

  • Dark/light theme not applying for some apps

  • Never knowing where to find config files for any given app

  • CSD occasionally not working for some apps

jsbarretto,
@jsbarretto@social.coop avatar

@RL_Dane It seems interesting at first glance, but honestly, I don't feel like I'm personally very interested in containerising my life. Maybe there are folks for whom it brings a lot of utility, but in my case I'm in the habit of just not installing software I don't trust: so the convenience of installing things system-wide will usually win every time. If I have something accessible on the network, then I'll usually just use a dedicated docker instance for that.

jsbarretto, to random
@jsbarretto@social.coop avatar

It's weird that typing unusual characters like ฯ€, ฮผ, โˆš, and โˆ† is substantially easier on my phone, a device with an apparently lower bandwidth / more primitive input system, than my actual desktop computer. That feels like a failure, on some level.

0xSim, to random
@0xSim@hachyderm.io avatar

Oh...

jsbarretto,
@jsbarretto@social.coop avatar

@0xSim that's a funny place to stash dru---

oh. oh no

janriemer, to rust

Currently in the process of rewriting my from v4.2 to v1.0.0-alpha.6 ๐Ÿค“

It is a lot of fun so far, but I have to say these type signatures are wild!๐Ÿ˜„

I'm still struggling with it far more than I'd like, but I guess it is just a matter of time until intuition kicks in and it will become more and more natural.

Exciting project ahead!๐Ÿ™‚

I'm even able to parse string literals with escape sequences - something I haven't even achieved with nom!

jsbarretto,
@jsbarretto@social.coop avatar

@janriemer Nice! If you ever find the type signatures confusing, remember that you can use .boxed() pretty much anywhere to massively simplify things: https://docs.rs/chumsky/1.0.0-alpha.6/chumsky/guide/_00_getting_started/index.html#advice

Also, the examples in the docs are quite numerous and should be fairly helpful. The crate examples show you how to grow everything into a more non-trivial design.

jsbarretto,
@jsbarretto@social.coop avatar

@janriemer I would recommend against checking equality for errors. Chumsky doesn't have stable guarantees around exactly how it goes about constructing an error, so future versions may change the exact output a little. Usually, .has_errors() is the best thing to use in tests.

jsbarretto,
@jsbarretto@social.coop avatar

@janriemer Recursion couldn't be easier!

let a = recursive(|a| /* definition of a */);

Make sure you don't end up with accidental left recursion though. Check out the docs for the new pratt parser combinator if you want a really neat way to do complex expression parsing.

jsbarretto,
@jsbarretto@social.coop avatar

@janriemer So... Yes, memoized does exist, and does allow the parsing of left-recursive grammars. However, it does come with some overhead: if you can rewrite your grammar to be right-recursive, you'll almost certainly be happier in the long run (this goes for pretty much any top-down approach to parsing out there FWIW).

I'd be interested to know what the right-recursive section of your grammar looks like: the pratt parser can almost certainly handle it, whatever it is.

jsbarretto,
@jsbarretto@social.coop avatar

@janriemer Both of these cases can definitely be handled by a pratt parser! The first cases (&& and ||) are just regular binary expressions. The second case (method calls) is just a postfix unary expression, but where the 'operator' is .method(<expr>). Remember that 'operator' doesn't need to be just a single token, it just needs to be 'self-delimiting' (i.e: outside the precedence hierarchy)!

jsbarretto, to random
@jsbarretto@social.coop avatar

"I'll just spend my Sunday evening painting the bathroom door, half-hour job, easy peasy"

I'm 4 hours in and I've somehow found myself under the bath, with sealant everywhere, caked in dust and old bath water, wondering whether I'm going to be able to get a shower tomorrow morning.

jsbarretto,
@jsbarretto@social.coop avatar

Also, the previous owner of the house has left exposed, live wires here? Under a BATH?! With the only thing standing between live and neutral being a poorly tied knot? Christ on a bike

jsbarretto, to random
@jsbarretto@social.coop avatar

My city is soon to run a pilot scheme that's going to make many roads, particularly in residential areas, access-only for motor vehicles.

It's a great piece of policy, but sadly it's riled up the usual conspiracy theorists complaining about '15-minute cities' and 'CCTV cameras' (there are no such plans).

I've noticed a lot of them putting up stickers with disinformation about the scheme so I've decided I'm fighting back with my own more colourful and (hopefully) eye-catching design.

jsbarretto,
@jsbarretto@social.coop avatar

(I am not very good at Inkscape, sorry. Ah well: amateurism makes it seem more local and relatable, I guess)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • provamag3
  • kavyap
  • DreamBathrooms
  • everett
  • magazineikmin
  • InstantRegret
  • ngwrru68w68
  • Youngstown
  • Durango
  • slotface
  • rosin
  • GTA5RPClips
  • tester
  • PowerRangers
  • anitta
  • thenastyranch
  • mdbf
  • osvaldo12
  • ethstaker
  • vwfavf
  • cubers
  • normalnudes
  • tacticalgear
  • khanakhh
  • cisconetworking
  • modclub
  • Leos
  • megavids
  • All magazines