Files
ARMSX1/psx/dev/input.c
moonpower 70c94aec21 Fix dead PBP support and the stop-vs-launch crash chains
PBP: the frontend's IsDiscPath never accepted .pbp (kind=none, 'Invalid launch
request.'), pbp_read_sector returned 0-on-success against the TS_* convention,
and the reader indexed image blocks with the core's 150-based disc LBA. Tracks
now live in absolute LBA space like cue/chd, reads return real TS types, the
subchannel polarity matches chd, and zipped PBPs rank as launch candidates.

Crash chains from the Samsung tombstone: device create()s are calloc'd so a
failed psx_init no longer makes psx_destroy free garbage; psx_disc_create and
the raw-disc malloc are NULL-checked; queue_destroy tolerates NULL; a shutdown
requested between runs is dropped at run() entry instead of killing the next
session on frame 1; its SDL_QUIT push is gated on a live loop (the event-queue
mutex may be destroyed between sessions) and a stale queued quit is flushed
before the loop starts.

Also: disc-probe gate links again (psx/perf.c was missing from its sources).
2026-08-05 21:04:08 +02:00

42 lines
1.1 KiB
C

#ifndef PAD_H
#define PAD_H
#include "input.h"
#include <string.h>
#include <stdlib.h>
psx_input_t* psx_input_create(void) {
return (psx_input_t*)calloc(1, sizeof(psx_input_t));
}
void psx_input_init(psx_input_t* input) {
memset(input, 0, sizeof(psx_input_t));
}
void psx_input_set_write_func(psx_input_t* input, psx_input_write_t write_func) {
input->write_func = write_func;
}
void psx_input_set_read_func(psx_input_t* input, psx_input_read_t read_func) {
input->read_func = read_func;
}
void psx_input_set_on_button_press_func(psx_input_t* input, psx_input_on_button_press_t on_button_press_func) {
input->on_button_press_func = on_button_press_func;
}
void psx_input_set_on_button_release_func(psx_input_t* input, psx_input_on_button_release_t on_button_release_func) {
input->on_button_release_func = on_button_release_func;
}
void psx_input_set_on_analog_change_func(psx_input_t* input, psx_input_on_analog_change_t on_analog_change_func) {
input->on_analog_change_func = on_analog_change_func;
}
void psx_input_destroy(psx_input_t* input) {
free(input->udata);
free(input);
}
#endif