@foone@digipres.club avatar

foone

@foone@digipres.club

Hardware / software necromancer, collector of Weird Stuff, maker of Death Generators. (she/they🏳️‍⚧️)

Dieses Profil is von einem föderierten Server und möglicherweise unvollständig. Auf der Original-Instanz anzeigen

foone , an Random Englisch
@foone@digipres.club avatar

I just realized I KINDA wrote a language where parsing file A requires also parsing every other file in the directory, and parsing those files might require parsing file A first.

foone OP ,
@foone@digipres.club avatar

now the question is: do I change the language spec, or do I make it still do this but have a two-pass parser?

foone OP ,
@foone@digipres.club avatar

basically the way I defined the VGA Flag Language:

https://wiki.foone.org/w/VGA_Flag_Language

doesn't fully make sense, and it's because of includes

foone OP ,
@foone@digipres.club avatar

includes are by name. to get the name(s) out of a file, you need to parse it. but you also need to resolve the includes to parse it.

foone OP ,
@foone@digipres.club avatar

so basically if you ask to parse flags/foo.flg you also have to parse flags/*.flg, which includes flags/foo.flg

foone OP ,
@foone@digipres.club avatar

easily solution: modify language definition so that include takes a relative pathname instead. if a user makes an infinite loop, that's their problem, not mine.

foone OP ,
@foone@digipres.club avatar

hard solution:
2-pass parser. pass1 parses out only the names and doesn't follow includes. this is used to build a map of names->filenames.
pass 2 can then finish parsing the file and thus resolve the includes

foone OP ,
@foone@digipres.club avatar

the only problem is that it's a little non-intuitive.
if you have foo.flg, bar.flg, baz.flg, and qux.flg, and foo.flg does "include bar", it's weird that the compiler has to open baz.flg and qux.flg

foone , an Random Englisch
@foone@digipres.club avatar

you ever have one of those normal days when you need to run a regex on the binary data of a GBA rom?

foone OP ,
@foone@digipres.club avatar

don't worry, it all makes sense:

It's a Avatar: The Last Airbender GBA rom.

foone OP ,
@foone@digipres.club avatar

@endrift yeah. I'm using it right now! that frame inspector is handy handy

foone OP ,
@foone@digipres.club avatar

amazingly: it worked fine. I now have zero problems.

foone OP ,
@foone@digipres.club avatar

@Canageek eh. grep doesn't deal well with binary files. So I needed my own tool, even if it's just like 3 lines of python

foone OP ,
@foone@digipres.club avatar

@quixoticgeek nah. I'm non-binary, so I don't need to worry about powers of 2

foone , an Random Englisch
@foone@digipres.club avatar

my favorite thing is hacking a game and then going and looking on the company's mobygames page to see what else they did around the same time and then grepping that ROM to see if it is the same engine... and it is.

foone OP ,
@foone@digipres.club avatar
  • Avatar: The Last Airbender (2006, GBA)
  • Avatar: The Last Airbender: The Burning Earth (2007, GBA)
  • Nickelodeon's Barnyard (2006, GBA)
  • Nicktoons: Battle for Volcano Island

all run on the same engine.

EDIT: I missed the Nicktoons one

foone OP ,
@foone@digipres.club avatar

I asked someone with a fullset of GBA roms to run some greps and they found three more:

  • The Legend of Spyro: A New Beginning
  • Ty the Tasmanian Tiger 2: Bush Rescue
  • Ty the Tasmanian Tiger 3: Night of the Quinkan
foone , an Random Englisch
@foone@digipres.club avatar

Imagine an alternate universe where USB instead used NEMA L21 twist lock plugs

foone OP ,
@foone@digipres.club avatar

@mav USB-C PD gives you 20 amps at 5v, that's pretty close!

  • Alle
  • Abonniert
  • Moderiert
  • Favoriten
  • random
  • haupteingang
  • Alle Magazine