hmm. I need to either start building documentation about which of my 13 current Ghidra installs have which extensions installed, or I need to set up a ghidra build environment and commit to maintaining a One True Ghidra environment with all the extensions
I keep having the problem of "now which one of these has that PSX loader installed in it?"
(the answer was ghidra 10.2.3 if you even care)
ugh. I'm gonna have to find the font for this game, not for the usual reasons (death generators), but because I'm trying to find the code powering a specific screen (The character viewer) but the text from it doesn't show up in a strings search.
because it's not ASCII. ;_;

it might be full-width latin characters. possibly encoded in shift-jis.

sadly ghidra doesn't know how to find that

maybe I can write a program to search for full-width characters in common encodings

Turns out the text IS in ascii, it's just in a datafile and not the executable.

so that doesn't help me

it was a good idea of them to put all the strings in a datafile instead of the executable! really handy for localization.

oh, this game was only ever released in japan? huh

oh I think this game is doing tricksy shit.
I think it's dynamically loading code out of datafiles and launching them. So the main executable is just the loader and archive-parser

why the heck does the PS1 have a "NoFunction" syscall?

I know about NOPs, by why a NOP syscall?

it has been zero days since I crashed an emulator

ahh, fucking MIPS.
How do you get a full 32bit address into a register?

MOV EAX,800771DC ?

NO GET THAT X86 BULLSHIT OUT OF HERE.

lui v0,0x8007
addiu v0,v0,0x6e50
addiu v0,v0,0x404

that's an address encoding that'll put some hair on your chest!

you may notice the math here doesn't make sense. I agree that it doesn't make sense. but it seems to work. Something is very wrong
ahh no it's just a confusing loop.
that address doesn't equal 800771DC, it's 80077254
You gotta love when it turns out a game is just spewing debugging info on the normally invisible serial terminal, so you just need to connect to see it
remember when writing code that parses data formats, always make sure it's a complex mess of dynamic callbacks indexed on magic bytes that you do arithmetic on. never just have a big switch table or a bunch of if-thens.
this won't make your program any better but it will absolutely give headaches to the poor reverse engineers trying to figure out your file formats 21 years later
so I'm trying to figure out the PAC format used inside the APFrs files used by Azumanga Donjyara Daioh and One Piece: Grand Battle! 1/2.
it has at least 11 types of sub-chunks, of which I know SDFC, VH, VB, and SEP are 4 of them.
The other 7? unknown.
@foone Alternately, if you come across a date string you don't recognize, launch all of the nuclear missiles.
@foone I joke about MIPS the rabbit being the only rabbit with delay slots
@Rairii @foone but are they store delays, or jump delays?
@foone this kind of bulllshit is why I've always hated writing assembly for RISC architectures. I mean sure, there's macros in the assembler, but is this really what peak performance is supposed to look like?
@slaeshjag I think part of peak performance is that you may not like what it looks like

@slaeshjag @foone

its a good tradeoff.

full address literals are rare
there's usually a register pointing at some globals area - allowing quick access with 16bit offsets - and if real 32bit addresses were critical you could store them as constants there to load

most addresses that programs deal with are offsets from struct pointers, array offsets etc

RISC is designed to be easier for compilers to deal with.
I did enjoy writing 68000 CISC ASM on the amiga but the focus changes over time

@foone why not just addiu v0,v0,0x71dc?
@thamesynne I have no idea

@foone one idea did occur to me after - if they wanted to be able to patch offsets afterwards, it'd make sense to divide up the initial load from the adding of an offset

but that's all i've got

@foone or more to the point, ori v0,v0,0x71dc (which zero-extends its constant)

@foone joke:

is this a denuvo on switch reference

@foone same. Should probably try to reproduce it and report to @endrift
@charlotte @endrift I don't think she has anything to do with no$psx
@foone @endrift nah but i ran into a crash in mgba earlier. Seems to be a misconfigured build though?
@foone @endrift yeah, seems to be a misconfigured build, can’t reproduce it in the official binary
@charlotte @foone I would like to know how a build can be so misconfigured it crashes. That still sounds like a bug on the surface!
@endrift @foone Actually it probably is a bug somewhere, lemme file a bug report

@endrift @foone oh okay i figured it out. It’s a bug in nixpkgs. It links mgba with lua 5.4 and with vlc (which links with lua 5.2) and while initializing vlc (which it does for some reason?) vlc crashes due to the version mismatch

Not sure why selecting an existing save file inits vlc tbh, that could be a bug on its own

@charlotte @foone ????? mGBA does not depend on libvlc, why is it linking with it?
@endrift @foone Yeah I’m confused too, the derivation also does not link libvlc, maybe qt on kde is fucky?
@charlotte @foone it does look like it's being pulled in by KDE, specifically when pulling in Phonon, KDE's audio framework
@endrift @foone ……Which raises questions still because all other functionality works fine? I recorded a video with sound earlier
@endrift @foone Wait maybe what happens is that the KDE file picker plays a warning sound and that crashes it?
@charlotte @endrift ahh, I misread your post!
yeah I'm sure she'd like to know

@foone Tired: Crashing an emulator by overpowering it

Wired: Crashing an emulator like you crash a party

@textfiles @foone my favourite was crashing an emulator by doing absolutely nothing!

(gameboy emulator, i turned halt on with vblanks turned off, instead relying on the keypad interrupt. this crashed several badly programmed emulators which relied on the vblank interrupt apparantly to refresh the host event loop. i crashed the emulator by putting it in the deep freezer)
@foone make patching easier?
@ellenor2000 @foone in BeOS the is_computer_on() and is_computer_on_fire() were actually used to benchmark the syscall interface…
@mmu_man @foone Here i was treating them as at least ½ serious.
@foone Better than a null pointer?
@foone Does whatever functions as a kernel interrupt the program, or wait until a syscall?
@foone
"Boss do we need any other syscalls?"
"Nope"
"On it!"
@foone GPU command 00h is also a NOP, so my guess is they consistently made zero a no-op so it was easy to test and debug things. being able to quickly "comment out" an interrupt instruction or GPU command by changing the value to zero seems pretty useful.
@foone it does have a side-effect:
@foone
Solely for the sake of having one? Just in case some use-case is found in the future? I've seen curlicues added to code before which served no practical purpose at the time of implementation, but where someone figured, "I bet that later on, we'll probably need this and I'll look indescribably clever."
@foone state machine lookup table. Some states may not need a cleanup function, for example. But the table needs an entry and do_nothing() is way more understandable.
@foone timing for anti-piracy, in case the disk images get trimmed of such (non)ops?
@foone Unrealized plans, perhaps?
@NekoEd could be! maybe they hoped it'd get an international release
@foone I once started a project aimed at doing such t hings efficiently by building a deterministic finite automata.
It, sadly, never got to the point it'll be useful to you.