Nold has some converter code he’s used with success here you could try:
Fork/Mirror of the "N64 Stick Converter PCB" by Jakob Schäfer - Nold360/n64_stick_converter
github.com
This one uses an ATtiny microcontroller to convert the X/Y axis ADC reads, which then are converted into quadrature pulses similar to what the N64 stick outputs (which is a type of encoder, not a typical potentiometer stick) to be read by the N64 controller. Gman ported very similar code to a PIC microcontroller to do the same task, maybe he will share with you his code. Keep in mind the switch stick ranges are as we know, terrible, so you’ll have to do some scaling in software to get them to feel good