Support for printer configuration

This commit is contained in:
Jasmine Iwanek
2025-01-05 04:29:30 -05:00
parent 2f3cee1806
commit 60d8ea389f
10 changed files with 352 additions and 75 deletions

View File

@@ -17,25 +17,31 @@
#define LPT6_IRQ 5
#endif
typedef struct lpt_device_t {
const char * name;
const char * internal_name;
typedef struct lpt_device_s {
const char *name;
const char *internal_name;
void * (*init)(void *lpt);
void (*close)(void *priv);
void (*write_data)(uint8_t val, void *priv);
void (*write_ctrl)(uint8_t val, void *priv);
void (*autofeed)(uint8_t val,void *priv);
void (*strobe)(uint8_t old, uint8_t val,void *priv);
uint8_t (*read_status)(void *priv);
uint8_t (*read_ctrl)(void *priv);
void (*epp_write_data)(uint8_t is_addr, uint8_t val, void *priv);
void (*epp_request_read)(uint8_t is_addr, void *priv);
void *(*init)(void *lpt);
void (*close)(void *priv);
void (*write_data)(uint8_t val, void *priv);
void (*write_ctrl)(uint8_t val, void *priv);
void (*autofeed)(uint8_t val,void *priv);
void (*strobe)(uint8_t old, uint8_t val,void *priv);
uint8_t (*read_status)(void *priv);
uint8_t (*read_ctrl)(void *priv);
void (*epp_write_data)(uint8_t is_addr, uint8_t val, void *priv);
void (*epp_request_read)(uint8_t is_addr, void *priv);
void * priv;
void *priv;
struct lpt_t *lpt;
//#ifdef EMU_DEVICE_H
// struct device_t *cfgdevice;
//#else
void *cfgdevice;
//#endif
} lpt_device_t;
#ifdef _TIMER_H_
typedef struct lpt_t {
uint8_t enabled;
uint8_t irq;
@@ -70,6 +76,7 @@ typedef struct lpt_t {
pc_timer_t fifo_out_timer;
} lpt_t;
#endif /* _TIMER_H_ */
typedef struct lpt_port_s {
uint8_t enabled;
@@ -85,49 +92,55 @@ typedef enum {
LPT_STATE_WRITE_FIFO
} lpt_state_t;
extern void lpt_write(uint16_t port, uint8_t val, void *priv);
extern void lpt_write(uint16_t port, uint8_t val, void *priv);
extern void lpt_write_to_fifo(void *priv, uint8_t val);
extern void lpt_write_to_fifo(void *priv, uint8_t val);
extern uint8_t lpt_read(uint16_t port, void *priv);
extern uint8_t lpt_read(uint16_t port, void *priv);
extern uint8_t lpt_read_port(lpt_t *dev, uint16_t reg);
extern uint8_t lpt_read_port(lpt_t *dev, uint16_t reg);
extern uint8_t lpt_read_status(lpt_t *dev);
extern void lpt_irq(void *priv, int raise);
extern uint8_t lpt_read_status(lpt_t *dev);
extern void lpt_irq(void *priv, int raise);
extern int lpt_device_get_from_internal_name(const char *s);
extern int lpt_device_get_from_internal_name(const char *str);
extern const char * lpt_device_get_name(int id);
extern const char * lpt_device_get_internal_name(int id);
extern const char *lpt_device_get_name(int id);
extern const char *lpt_device_get_internal_name(int id);
extern const lpt_device_t lpt_dac_device;
extern const lpt_device_t lpt_dac_stereo_device;
#ifdef EMU_DEVICE_H
extern const device_t *lpt_device_getdevice(const int id);
#endif
extern const lpt_device_t dss_device;
extern int lpt_device_has_config(const int id);
extern const lpt_device_t lpt_hasp_savquest_device;
extern const lpt_device_t lpt_dac_device;
extern const lpt_device_t lpt_dac_stereo_device;
extern void lpt_set_ext(lpt_t *dev, uint8_t ext);
extern void lpt_set_ecp(lpt_t *dev, uint8_t ecp);
extern void lpt_set_epp(lpt_t *dev, uint8_t epp);
extern void lpt_set_lv2(lpt_t *dev, uint8_t lv2);
extern void lpt_set_fifo_threshold(lpt_t *dev, int threshold);
extern void lpt_set_cnfga_readout(lpt_t *dev, const uint8_t cnfga_readout);
extern void lpt_port_setup(lpt_t *dev, uint16_t port);
extern void lpt_port_irq(lpt_t *dev, uint8_t irq);
extern void lpt_port_dma(lpt_t *dev, uint8_t dma);
extern void lpt_port_remove(lpt_t *dev);
extern void lpt1_remove_ams(lpt_t *dev);
extern const lpt_device_t dss_device;
extern void lpt_devices_init(void);
extern void lpt_devices_close(void);
extern const lpt_device_t lpt_hasp_savquest_device;
extern void lpt_set_next_inst(int ni);
extern void lpt_set_3bc_used(int is_3bc_used);
extern void lpt_set_ext(lpt_t *dev, uint8_t ext);
extern void lpt_set_ecp(lpt_t *dev, uint8_t ecp);
extern void lpt_set_epp(lpt_t *dev, uint8_t epp);
extern void lpt_set_lv2(lpt_t *dev, uint8_t lv2);
extern void lpt_set_fifo_threshold(lpt_t *dev, int threshold);
extern void lpt_set_cnfga_readout(lpt_t *dev, const uint8_t cnfga_readout);
extern void lpt_port_setup(lpt_t *dev, uint16_t port);
extern void lpt_port_irq(lpt_t *dev, uint8_t irq);
extern void lpt_port_dma(lpt_t *dev, uint8_t dma);
extern void lpt_port_remove(lpt_t *dev);
extern void lpt1_remove_ams(lpt_t *dev);
extern void lpt_standalone_init(void);
extern void lpt_devices_init(void);
extern void lpt_devices_close(void);
extern const device_t lpt_port_device;
extern void lpt_set_next_inst(int ni);
extern void lpt_set_3bc_used(int is_3bc_used);
extern void lpt_standalone_init(void);
extern const device_t lpt_port_device;
#endif /*EMU_LPT_H*/

View File

@@ -2,10 +2,14 @@
#define EMU_PRT_DEVS_H
extern const lpt_device_t lpt_prt_text_device;
extern const device_t prt_text_device;
extern const lpt_device_t lpt_prt_escp_device;
extern const device_t prt_escp_device;
extern const lpt_device_t lpt_prt_ps_device;
extern const device_t prt_ps_device;
#ifdef USE_PCL
extern const lpt_device_t lpt_prt_pcl_device;
extern const device_t prt_pcl_device;
#endif
#endif /*EMU_PRT_DEVS_H*/