The current state of PAL dumping kind of sucks.

I aim to do something about that..

@gloriouscow Last time I read a PAL, I uhhh... desoldered it from the circuit, attached it to an FPGA w/ level shifters, and read it over UART: https://github.com/cr1901/ATD_M117/blob/main/PALdump/bitstream.py#L153-L208

The code has bitrotted sadly^1, and I long tore down the circuit.

1. Although taking a peek, only the simulations look completely out-of-date.

@cr1901 I kind of meant "sucks" in the sense of it's kind of confusing and a bit obtuse, there's a zillion formats for the logic and it's not obvious how to go from dumping a PAL to making a replacement.

Not to disparage any other programmer, the tools that do exist do a good job at what they were made to do.

@gloriouscow Oh, no argument there that it sucks. I've talked with @david_rysk and @Lord_Nightmare a while ago about how to dump registered PALs. Which my code doesn't handle. IIRC, it can be done reasonably automated but I'd have to dig into my IRC log.

I won't touch PAL programming, which is... just a mess. Even finding the documentation sucks, and certainly hasn't gotten better now that search engines are shit. I found them on Google Groups mirror of Usenet and random Tripod/Angelfire sites.

@cr1901 @david_rysk @Lord_Nightmare

So I have some ideas on the registered PAL front, although I have no real idea about practicality, but the idea might be to attempt to visualize the registers based on an educated guess of their logic, and then get some confirmation on whether your guess is invalidated or passes input-fuzzing.

One thing I really wanted is something where you can give names or purposes to the pins.

Since I've traced out the Chameleon motherboard, I should be able to mark these pins with sensible names.

So I will have definitions for both the base PAL types, such as PAL16R4, bus also a PAL instance, such as "DCON" here - the instance definition will map readable names to pins and provide pin type overrides, so if you know an I/O pin is for sure an input or an output there's no need to spend minutes verifying that every time, and if you know a pin is disconnected, there's no reason to update it or read it.