sa1110.cpp: Re-worked to use map() instead of switch/case handlers. [Ryan Holtz] (#11981)

Co-authored-by: Ryan Holtz <TheMogMiner>
This commit is contained in:
MooglyGuy 2024-01-30 01:40:51 +01:00 committed by GitHub
parent b4333f76d4
commit 326b68d7f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 2219 additions and 1527 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,13 +23,13 @@ class sa1110_periphs_device : public device_t, public device_serial_interface
{
public:
template <typename T>
sa1110_periphs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
sa1110_periphs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&cpu_tag)
: sa1110_periphs_device(mconfig, tag, owner, clock)
{
m_maincpu.set_tag(std::forward<T>(cpu_tag));
}
sa1110_periphs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
sa1110_periphs_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
template <typename T> void set_codec_tag(T &&tag) { m_codec.set_tag(std::forward<T>(tag)); }
@ -41,44 +41,19 @@ public:
template <unsigned Line> void gpio_in(int state) { gpio_in(Line, state); }
template <unsigned Line> auto gpio_out() { return m_gpio_out[Line].bind(); }
void ssp_in(uint16_t data) { ssp_rx_fifo_push(data); }
void ssp_in(u16 data) { ssp_rx_fifo_push(data); }
auto ssp_out() { return m_ssp_out.bind(); }
auto uart3_tx_out() { return m_uart3_tx_out.bind(); }
uint32_t udc_r(offs_t offset, uint32_t mem_mask = ~0);
void udc_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t icp_r(offs_t offset, uint32_t mem_mask = ~0);
void icp_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t uart3_r(offs_t offset, uint32_t mem_mask = ~0);
void uart3_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t mcp_r(offs_t offset, uint32_t mem_mask = ~0);
void mcp_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t ssp_r(offs_t offset, uint32_t mem_mask = ~0);
void ssp_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t ostimer_r(offs_t offset, uint32_t mem_mask = ~0);
void ostimer_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t rtc_r(offs_t offset, uint32_t mem_mask = ~0);
void rtc_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t power_r(offs_t offset, uint32_t mem_mask = ~0);
void power_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t reset_r(offs_t offset, uint32_t mem_mask = ~0);
void reset_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t gpio_r(offs_t offset, uint32_t mem_mask = ~0);
void gpio_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t intc_r(offs_t offset, uint32_t mem_mask = ~0);
void intc_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t ppc_r(offs_t offset, uint32_t mem_mask = ~0);
void ppc_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t dma_r(offs_t offset, uint32_t mem_mask = ~0);
void dma_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
void map(address_map &map);
protected:
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
static constexpr uint32_t INTERNAL_OSC = 3686400;
static constexpr u32 INTERNAL_OSC = 3686400;
TIMER_CALLBACK_MEMBER(icp_rx_callback);
TIMER_CALLBACK_MEMBER(icp_tx_callback);
@ -88,10 +63,10 @@ protected:
void icp_uart_set_transmitter_enabled(bool enabled);
void icp_uart_set_receive_irq_enabled(bool enabled);
void icp_uart_set_transmit_irq_enabled(bool enabled);
uint8_t icp_uart_read_receive_fifo();
void icp_uart_write_transmit_fifo(uint8_t data);
uint16_t icp_hssp_read_receive_fifo();
void icp_hssp_write_transmit_fifo(uint8_t data);
u8 icp_uart_read_receive_fifo();
void icp_uart_write_transmit_fifo(u8 data);
u16 icp_hssp_read_receive_fifo();
void icp_hssp_write_transmit_fifo(u8 data);
void icp_uart_set_receiver_idle();
void icp_uart_begin_of_break();
void icp_uart_end_of_break();
@ -99,9 +74,9 @@ protected:
void uart3_irq_callback(int state);
void uart_recalculate_divisor();
void uart_update_eif_status();
void uart_write_receive_fifo(uint16_t data_and_flags);
uint8_t uart_read_receive_fifo();
void uart_write_transmit_fifo(uint8_t data);
void uart_write_receive_fifo(u16 data_and_flags);
u8 uart_read_receive_fifo();
void uart_write_transmit_fifo(u8 data);
void uart_check_rx_fifo_service();
void uart_check_tx_fifo_service();
void uart_set_receiver_idle();
@ -117,23 +92,23 @@ protected:
TIMER_CALLBACK_MEMBER(mcp_telecom_tx_callback);
void mcp_update_sample_rate();
void mcp_set_enabled(bool enabled);
uint16_t mcp_read_audio_fifo();
uint16_t mcp_read_telecom_fifo();
u16 mcp_read_audio_fifo();
u16 mcp_read_telecom_fifo();
attotime mcp_get_audio_frame_rate();
attotime mcp_get_telecom_frame_rate();
void mcp_audio_tx_fifo_push(const uint16_t value);
void mcp_telecom_tx_fifo_push(const uint16_t value);
void mcp_audio_tx_fifo_push(const u16 value);
void mcp_telecom_tx_fifo_push(const u16 value);
void mcp_codec_read(offs_t offset);
void mcp_codec_write(offs_t offset, uint16_t data);
void mcp_codec_write(offs_t offset, u16 data);
TIMER_CALLBACK_MEMBER(ssp_rx_callback);
TIMER_CALLBACK_MEMBER(ssp_tx_callback);
void ssp_update_enable_state();
void ssp_update_rx_level();
void ssp_update_tx_level();
void ssp_rx_fifo_push(const uint16_t data);
void ssp_tx_fifo_push(const uint16_t data);
uint16_t ssp_rx_fifo_pop();
void ssp_rx_fifo_push(const u16 data);
void ssp_tx_fifo_push(const u16 data);
u16 ssp_rx_fifo_pop();
TIMER_CALLBACK_MEMBER(ostimer_tick_cb);
void ostimer_update_count();
@ -141,17 +116,206 @@ protected:
TIMER_CALLBACK_MEMBER(rtc_tick_cb);
void gpio_in(const uint32_t line, const int state);
void gpio_update_interrupts(const uint32_t changed_mask);
void gpio_update_direction(const uint32_t old_gpdr);
void gpio_update_outputs(const uint32_t old_latch, const uint32_t changed);
void gpio_update_alternate_pins(const uint32_t changed_mask);
void gpio_in(const u32 line, const int state);
void gpio_update_interrupts(const u32 changed_mask);
void gpio_update_direction(const u32 old_gpdr);
void gpio_update_outputs(const u32 old_latch, const u32 changed);
void gpio_update_alternate_pins(const u32 changed_mask);
void set_irq_line(uint32_t line, int state);
void set_irq_line(u32 line, int state);
void update_interrupts();
void dma_set_control_bits(int channel, uint32_t bits);
void dma_clear_control_bits(int channel, uint32_t bits);
void dma_set_control_bits(int channel, u32 bits);
void dma_clear_control_bits(int channel, u32 bits);
u32 udc_udccr_r(offs_t offset, u32 mem_mask);
void udc_udccr_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcar_r(offs_t offset, u32 mem_mask);
void udc_udcar_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcomp_r(offs_t offset, u32 mem_mask);
void udc_udcomp_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcimp_r(offs_t offset, u32 mem_mask);
void udc_udcimp_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udccs0_r(offs_t offset, u32 mem_mask);
void udc_udccs0_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udccs1_r(offs_t offset, u32 mem_mask);
void udc_udccs1_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udccs2_r(offs_t offset, u32 mem_mask);
void udc_udccs2_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcd0_r(offs_t offset, u32 mem_mask);
void udc_udcd0_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcwc_r(offs_t offset, u32 mem_mask);
void udc_udcwc_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcdr_r(offs_t offset, u32 mem_mask);
void udc_udcdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 udc_udcsr_r(offs_t offset, u32 mem_mask);
void udc_udcsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utcr0_r(offs_t offset, u32 mem_mask);
void icp_utcr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utcr1_r(offs_t offset, u32 mem_mask);
void icp_utcr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utcr2_r(offs_t offset, u32 mem_mask);
void icp_utcr2_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utcr3_r(offs_t offset, u32 mem_mask);
void icp_utcr3_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utcr4_r(offs_t offset, u32 mem_mask);
void icp_utcr4_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utdr_r(offs_t offset, u32 mem_mask);
void icp_utdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utsr0_r(offs_t offset, u32 mem_mask);
void icp_utsr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_utsr1_r(offs_t offset, u32 mem_mask);
u32 icp_hscr0_r(offs_t offset, u32 mem_mask);
void icp_hscr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_hscr1_r(offs_t offset, u32 mem_mask);
void icp_hscr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_hsdr_r(offs_t offset, u32 mem_mask);
void icp_hsdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_hssr0_r(offs_t offset, u32 mem_mask);
void icp_hssr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 icp_hssr1_r(offs_t offset, u32 mem_mask);
void icp_hssr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utcr0_r(offs_t offset, u32 mem_mask);
void uart3_utcr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utcr1_r(offs_t offset, u32 mem_mask);
void uart3_utcr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utcr2_r(offs_t offset, u32 mem_mask);
void uart3_utcr2_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utcr3_r(offs_t offset, u32 mem_mask);
void uart3_utcr3_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utdr_r(offs_t offset, u32 mem_mask);
void uart3_utdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utsr0_r(offs_t offset, u32 mem_mask);
void uart3_utsr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 uart3_utsr1_r(offs_t offset, u32 mem_mask);
u32 mcp_mccr0_r(offs_t offset, u32 mem_mask);
void mcp_mccr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 mcp_mcdr0_r(offs_t offset, u32 mem_mask);
void mcp_mcdr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 mcp_mcdr1_r(offs_t offset, u32 mem_mask);
void mcp_mcdr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 mcp_mcdr2_r(offs_t offset, u32 mem_mask);
void mcp_mcdr2_w(offs_t offset, u32 data, u32 mem_mask);
u32 mcp_mcsr_r(offs_t offset, u32 mem_mask);
void mcp_mcsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 ssp_sscr0_r(offs_t offset, u32 mem_mask);
void ssp_sscr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 ssp_sscr1_r(offs_t offset, u32 mem_mask);
void ssp_sscr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 ssp_ssdr_r(offs_t offset, u32 mem_mask);
void ssp_ssdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 ssp_sssr_r(offs_t offset, u32 mem_mask);
void ssp_sssr_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_osmr0_r(offs_t offset, u32 mem_mask);
void tmr_osmr0_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_osmr1_r(offs_t offset, u32 mem_mask);
void tmr_osmr1_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_osmr2_r(offs_t offset, u32 mem_mask);
void tmr_osmr2_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_osmr3_r(offs_t offset, u32 mem_mask);
void tmr_osmr3_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_oscr_r(offs_t offset, u32 mem_mask);
void tmr_oscr_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_ossr_r(offs_t offset, u32 mem_mask);
void tmr_ossr_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_ower_r(offs_t offset, u32 mem_mask);
void tmr_ower_w(offs_t offset, u32 data, u32 mem_mask);
u32 tmr_oier_r(offs_t offset, u32 mem_mask);
void tmr_oier_w(offs_t offset, u32 data, u32 mem_mask);
u32 rtc_rtar_r(offs_t offset, u32 mem_mask);
void rtc_rtar_w(offs_t offset, u32 data, u32 mem_mask);
u32 rtc_rcnr_r(offs_t offset, u32 mem_mask);
void rtc_rcnr_w(offs_t offset, u32 data, u32 mem_mask);
u32 rtc_rttr_r(offs_t offset, u32 mem_mask);
void rtc_rttr_w(offs_t offset, u32 data, u32 mem_mask);
u32 rtc_rtsr_r(offs_t offset, u32 mem_mask);
void rtc_rtsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_pmcr_r(offs_t offset, u32 mem_mask);
void pwr_pmcr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_pssr_r(offs_t offset, u32 mem_mask);
void pwr_pssr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_pspr_r(offs_t offset, u32 mem_mask);
void pwr_pspr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_pwer_r(offs_t offset, u32 mem_mask);
void pwr_pwer_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_pcfr_r(offs_t offset, u32 mem_mask);
void pwr_pcfr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_ppcr_r(offs_t offset, u32 mem_mask);
void pwr_ppcr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_pgsr_r(offs_t offset, u32 mem_mask);
void pwr_pgsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 pwr_posr_r(offs_t offset, u32 mem_mask);
void pwr_posr_w(offs_t offset, u32 data, u32 mem_mask);
u32 rst_rsrr_r(offs_t offset, u32 mem_mask);
void rst_rsrr_w(offs_t offset, u32 data, u32 mem_mask);
u32 rst_rcsr_r(offs_t offset, u32 mem_mask);
void rst_rcsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gplr_r(offs_t offset, u32 mem_mask);
void gpio_gplr_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gpdr_r(offs_t offset, u32 mem_mask);
void gpio_gpdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gpsr_r(offs_t offset, u32 mem_mask);
void gpio_gpsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gpcr_r(offs_t offset, u32 mem_mask);
void gpio_gpcr_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_grer_r(offs_t offset, u32 mem_mask);
void gpio_grer_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gfer_r(offs_t offset, u32 mem_mask);
void gpio_gfer_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gedr_r(offs_t offset, u32 mem_mask);
void gpio_gedr_w(offs_t offset, u32 data, u32 mem_mask);
u32 gpio_gafr_r(offs_t offset, u32 mem_mask);
void gpio_gafr_w(offs_t offset, u32 data, u32 mem_mask);
u32 intc_icip_r(offs_t offset, u32 mem_mask);
void intc_icip_w(offs_t offset, u32 data, u32 mem_mask);
u32 intc_icmr_r(offs_t offset, u32 mem_mask);
void intc_icmr_w(offs_t offset, u32 data, u32 mem_mask);
u32 intc_iclr_r(offs_t offset, u32 mem_mask);
void intc_iclr_w(offs_t offset, u32 data, u32 mem_mask);
u32 intc_icfp_r(offs_t offset, u32 mem_mask);
void intc_icfp_w(offs_t offset, u32 data, u32 mem_mask);
u32 intc_icpr_r(offs_t offset, u32 mem_mask);
void intc_icpr_w(offs_t offset, u32 data, u32 mem_mask);
u32 intc_iccr_r(offs_t offset, u32 mem_mask);
void intc_iccr_w(offs_t offset, u32 data, u32 mem_mask);
u32 ppc_ppdr_r(offs_t offset, u32 mem_mask);
void ppc_ppdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 ppc_ppsr_r(offs_t offset, u32 mem_mask);
void ppc_ppsr_w(offs_t offset, u32 data, u32 mem_mask);
u32 ppc_ppar_r(offs_t offset, u32 mem_mask);
void ppc_ppar_w(offs_t offset, u32 data, u32 mem_mask);
u32 ppc_psdr_r(offs_t offset, u32 mem_mask);
void ppc_psdr_w(offs_t offset, u32 data, u32 mem_mask);
u32 ppc_ppfr_r(offs_t offset, u32 mem_mask);
void ppc_ppfr_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_ddar_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_ddar_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dssr_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dssr_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dcsr_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dcsr_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dsr_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dsr_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dbsa_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dbsa_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dbta_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dbta_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dbsb_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dbsb_w(offs_t offset, u32 data, u32 mem_mask);
template <int Channel> u32 dma_dbtb_r(offs_t offset, u32 mem_mask);
template <int Channel> void dma_dbtb_w(offs_t offset, u32 data, u32 mem_mask);
// register offsets
enum
@ -266,7 +430,7 @@ protected:
};
// register contents
enum : uint32_t
enum : u32
{
UDCCR_UDD_BIT = 0,
UDCCR_UDA_BIT = 1,
@ -465,7 +629,7 @@ protected:
};
// interrupt bits
enum : uint32_t
enum : u32
{
INT_GPIO0 = 0,
INT_GPIO1 = 1,
@ -526,193 +690,193 @@ protected:
struct udc_regs
{
uint32_t udccr;
uint32_t udcar;
uint32_t udcomp;
uint32_t udcimp;
uint32_t udccs0;
uint32_t udccs1;
uint32_t udccs2;
uint32_t udcwc;
uint32_t udcsr;
u32 udccr;
u32 udcar;
u32 udcomp;
u32 udcimp;
u32 udccs0;
u32 udccs1;
u32 udccs2;
u32 udcwc;
u32 udcsr;
};
struct uart_regs
{
uint32_t utcr[4];
uint32_t utsr0;
uint32_t utsr1;
u32 utcr[4];
u32 utsr0;
u32 utsr1;
uint16_t rx_fifo[12];
u16 rx_fifo[12];
int rx_fifo_read_idx;
int rx_fifo_write_idx;
int rx_fifo_count;
uint8_t tx_fifo[8];
int tx_fifo_read_idx;
int tx_fifo_write_idx;
int tx_fifo_count;
u8 tx_fifo[8];
int tx_fifo_read_idx;
int tx_fifo_write_idx;
int tx_fifo_count;
bool rx_break_interlock;
bool rx_break_interlock;
};
struct hssp_regs
{
uint32_t hscr0;
uint32_t hscr1;
uint32_t hssr0;
uint32_t hssr1;
u32 hscr0;
u32 hscr1;
u32 hssr0;
u32 hssr1;
uint16_t rx_fifo[8];
int rx_fifo_read_idx;
int rx_fifo_write_idx;
int rx_fifo_count;
u16 rx_fifo[8];
int rx_fifo_read_idx;
int rx_fifo_write_idx;
int rx_fifo_count;
emu_timer *rx_timer;
uint16_t tx_fifo[8];
int tx_fifo_read_idx;
int tx_fifo_write_idx;
int tx_fifo_count;
u16 tx_fifo[8];
int tx_fifo_read_idx;
int tx_fifo_write_idx;
int tx_fifo_count;
emu_timer *tx_timer;
};
struct icp_regs
{
uart_regs uart;
uint32_t utcr4;
uart_regs uart;
u32 utcr4;
emu_timer *uart_rx_timer;
emu_timer *uart_tx_timer;
hssp_regs hssp;
hssp_regs hssp;
};
struct mcp_regs
{
uint32_t mccr0;
uint32_t mccr1;
uint32_t mcdr2;
uint32_t mcsr;
u32 mccr0;
u32 mccr1;
u32 mcdr2;
u32 mcsr;
uint16_t audio_rx_fifo[8];
int audio_rx_fifo_read_idx;
int audio_rx_fifo_write_idx;
int audio_rx_fifo_count;
u16 audio_rx_fifo[8];
int audio_rx_fifo_read_idx;
int audio_rx_fifo_write_idx;
int audio_rx_fifo_count;
uint16_t audio_tx_fifo[8];
int audio_tx_fifo_read_idx;
int audio_tx_fifo_write_idx;
int audio_tx_fifo_count;
u16 audio_tx_fifo[8];
int audio_tx_fifo_read_idx;
int audio_tx_fifo_write_idx;
int audio_tx_fifo_count;
emu_timer *audio_tx_timer;
uint16_t telecom_rx_fifo[8];
int telecom_rx_fifo_read_idx;
int telecom_rx_fifo_write_idx;
int telecom_rx_fifo_count;
u16 telecom_rx_fifo[8];
int telecom_rx_fifo_read_idx;
int telecom_rx_fifo_write_idx;
int telecom_rx_fifo_count;
uint16_t telecom_tx_fifo[8];
int telecom_tx_fifo_read_idx;
int telecom_tx_fifo_write_idx;
int telecom_tx_fifo_count;
u16 telecom_tx_fifo[8];
int telecom_tx_fifo_read_idx;
int telecom_tx_fifo_write_idx;
int telecom_tx_fifo_count;
emu_timer *telecom_tx_timer;
};
struct ssp_regs
{
uint32_t sscr0;
uint32_t sscr1;
uint32_t sssr;
u32 sscr0;
u32 sscr1;
u32 sssr;
uint16_t rx_fifo[8];
int rx_fifo_read_idx;
int rx_fifo_write_idx;
int rx_fifo_count;
u16 rx_fifo[8];
int rx_fifo_read_idx;
int rx_fifo_write_idx;
int rx_fifo_count;
emu_timer *rx_timer;
uint16_t tx_fifo[8];
int tx_fifo_read_idx;
int tx_fifo_write_idx;
int tx_fifo_count;
u16 tx_fifo[8];
int tx_fifo_read_idx;
int tx_fifo_write_idx;
int tx_fifo_count;
emu_timer *tx_timer;
};
struct ostimer_regs
{
uint32_t osmr[4];
uint32_t oscr;
uint32_t ossr;
uint32_t ower;
uint32_t oier;
u32 osmr[4];
u32 oscr;
u32 ossr;
u32 ower;
u32 oier;
emu_timer *timer[4];
attotime last_count_sync;
attotime last_count_sync;
};
struct rtc_regs
{
uint32_t rtar;
uint32_t rcnr;
uint32_t rttr;
uint32_t rtsr;
u32 rtar;
u32 rcnr;
u32 rttr;
u32 rtsr;
emu_timer *tick_timer;
};
struct power_regs
{
uint32_t pmcr;
uint32_t pssr;
uint32_t pspr;
uint32_t pwer;
uint32_t pcfr;
uint32_t ppcr;
uint32_t pgsr;
uint32_t posr;
u32 pmcr;
u32 pssr;
u32 pspr;
u32 pwer;
u32 pcfr;
u32 ppcr;
u32 pgsr;
u32 posr;
};
struct gpio_regs
{
uint32_t gplr;
uint32_t gpdr;
uint32_t grer;
uint32_t gfer;
uint32_t gedr;
uint32_t gafr;
u32 gplr;
u32 gpdr;
u32 grer;
u32 gfer;
u32 gedr;
u32 gafr;
uint32_t any_edge_mask;
u32 any_edge_mask;
uint32_t output_latch;
uint32_t input_latch;
uint32_t alt_output_latch;
uint32_t alt_input_latch;
u32 output_latch;
u32 input_latch;
u32 alt_output_latch;
u32 alt_input_latch;
};
struct intc_regs
{
uint32_t icip;
uint32_t icmr;
uint32_t iclr;
uint32_t iccr;
uint32_t icfp;
uint32_t icpr;
u32 icip;
u32 icmr;
u32 iclr;
u32 iccr;
u32 icfp;
u32 icpr;
};
struct ppc_regs
{
uint32_t ppdr;
uint32_t ppsr_out;
uint32_t ppsr_in;
uint32_t ppsr;
uint32_t ppar;
uint32_t psdr;
uint32_t ppfr;
u32 ppdr;
u32 ppsr_out;
u32 ppsr_in;
u32 ppsr;
u32 ppar;
u32 psdr;
u32 ppfr;
};
struct dma_regs
{
uint32_t ddar;
uint32_t dsr;
uint32_t dbs[2];
uint32_t dbt[2];
u32 ddar;
u32 dsr;
u32 dbs[2];
u32 dbt[2];
};
udc_regs m_udc_regs;
@ -723,12 +887,12 @@ protected:
ostimer_regs m_ostmr_regs;
rtc_regs m_rtc_regs;
power_regs m_power_regs;
uint32_t m_rcsr;
u32 m_rcsr;
gpio_regs m_gpio_regs;
intc_regs m_intc_regs;
ppc_regs m_ppc_regs;
dma_regs m_dma_regs[6];
uint8_t m_dma_active_mask;
u8 m_dma_active_mask;
required_device<sa1110_cpu_device> m_maincpu;
required_device<input_merger_device> m_uart3_irqs;

View File

@ -483,16 +483,12 @@ TIMER_CALLBACK_MEMBER(sa1111_device::audio_tx_dma_callback)
return;
address_space &space = m_maincpu->space(AS_PROGRAM);
uint32_t count;
for (count = 0; count < remaining && count < avail; count++)
{
const uint32_t data = space.read_dword(m_audio_regs.sadta);
LOGMASKED(LOG_AUDIO_DMA, "audio_tx_dma_callback: read data %08x from %08x, pushing to FIFO\n", data, m_audio_regs.sadta);
audio_tx_fifo_push(data);
m_audio_regs.sadta += 4;
}
const uint32_t data = space.read_dword(m_audio_regs.sadta);
LOGMASKED(LOG_AUDIO_DMA, "audio_tx_dma_callback: read data %08x from %08x, pushing to FIFO\n", data, m_audio_regs.sadta);
audio_tx_fifo_push(data);
m_audio_regs.sadta += 4;
m_audio_regs.sadtcc = (remaining - count) << 2;
m_audio_regs.sadtcc = (remaining - 1) << 2;
if (!m_audio_regs.sadtcc)
{
static constexpr uint32_t s_start_masks[2] = { (1 << SADTCS_TDSTA_BIT), (1 << SADTCS_TDSTB_BIT) };
@ -723,7 +719,7 @@ void sa1111_device::audio_tx_fifo_push(uint32_t data)
{
const uint32_t divisor = ((m_sk_regs.skaud & SKAUD_ACD_MASK) >> SKAUD_ACD_BIT) + 1;
const uint32_t pll_clock = clock() * 39;
attotime clock_period = attotime::from_ticks(divisor * 256, pll_clock);
attotime clock_period = attotime::from_ticks(divisor * 96, pll_clock);
m_audio_regs.tx_timer->adjust(clock_period, 0, clock_period);
}
}
@ -1094,13 +1090,13 @@ void sa1111_device::sadtcs_w(offs_t offset, uint32_t data, uint32_t mem_mask)
if (BIT(data, SADTCS_TDBDA_BIT) || BIT(data, SADTCS_TDSTA_BIT))
{
LOGMASKED(LOG_AUDIO_DMA, "%s: sadtcs_w: Clearing done A bit, lowering AUDTXA IRQ\n");
LOGMASKED(LOG_AUDIO_DMA, "%s: sadtcs_w: Clearing done A bit, lowering AUDTXA IRQ\n", machine().describe_context());
m_audio_regs.sadtcs &= ~(1 << SADTCS_TDBDA_BIT);
set_irq_line(INT_AUDTXA, 0);
}
if (BIT(data, SADTCS_TDBDB_BIT) || BIT(data, SADTCS_TDSTB_BIT))
{
LOGMASKED(LOG_AUDIO_DMA, "%s: sadtcs_w: Clearing done B bit, lowering AUDTXB IRQ\n");
LOGMASKED(LOG_AUDIO_DMA, "%s: sadtcs_w: Clearing done B bit, lowering AUDTXB IRQ\n", machine().describe_context());
m_audio_regs.sadtcs &= ~(1 << SADTCS_TDBDB_BIT);
set_irq_line(INT_AUDTXB, 0);
}

View File

@ -47,6 +47,9 @@ void uda1344_device::device_start()
{
m_stream = stream_alloc(0, 2, BASE_FREQUENCY);
m_buffer[0].resize(BUFFER_SIZE);
m_buffer[1].resize(BUFFER_SIZE);
save_item(NAME(m_buffer[0]));
save_item(NAME(m_buffer[1]));
save_item(NAME(m_bufin));
@ -63,9 +66,6 @@ void uda1344_device::device_start()
save_item(NAME(m_power_reg));
save_item(NAME(m_dac_enable));
save_item(NAME(m_adc_enable));
m_buffer[0].resize(BUFFER_SIZE);
m_buffer[1].resize(BUFFER_SIZE);
}
void uda1344_device::device_reset()

View File

@ -4,13 +4,6 @@
HP Jornada PDA skeleton driver
To boot:
- Start MAME with the debugger enabled
- Use the following breakpoint command: bp 13E2C,R3==3 && R1==10
- Close the debugger and allow the machine to run
- When the breakpoint is hit, use the following command: R3=0
- Close the debugger, booting will proceed
***************************************************************************/
#include "emu.h"
@ -57,7 +50,7 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(key_changed);
DECLARE_INPUT_CHANGED_MEMBER(pen_changed);
enum : uint8_t
enum : u8
{
MCU_TXDUMMY = 0x11,
MCU_TXDUMMY2 = 0x88
@ -66,28 +59,85 @@ public:
enum
{
KEY_ON_OFF = 0x7f,
KEY_Q = 0x21,
KEY_W = 0x22,
KEY_E = 0x23,
KEY_R = 0x24,
KEY_T = 0x25,
KEY_Y = 0x26,
KEY_U = 0x27,
KEY_I = 0x28,
KEY_O = 0x29,
KEY_P = 0x2a,
KEY_A = 0x31,
KEY_S = 0x32,
KEY_D = 0x33,
KEY_F = 0x34,
KEY_G = 0x35,
KEY_H = 0x36,
KEY_J = 0x37,
KEY_K = 0x38,
KEY_L = 0x39,
KEY_Z = 0x41,
KEY_X = 0x42,
KEY_C = 0x43,
KEY_V = 0x44,
KEY_B = 0x45,
KEY_N = 0x46,
KEY_M = 0x47,
KEY_0 = 0x1a,
KEY_1 = 0x11,
KEY_2 = 0x12,
KEY_3 = 0x13,
KEY_4 = 0x14,
KEY_5 = 0x15,
KEY_6 = 0x16,
KEY_7 = 0x17,
KEY_8 = 0x18,
KEY_9 = 0x19,
KEY_TAB = 0x51,
KEY_ENTER = 0x4c,
KEY_A = 0x31,
KEY_N = 0x46,
KEY_L = 0x39,
KEY_M = 0x47,
KEY_P = 0x2a,
KEY_C = 0x43,
KEY_B = 0x45,
KEY_ALT = 0x65,
KEY_SPACE = 0x74,
KEY_QL1 = 0x02,
KEY_QL2 = 0x03,
KEY_QL3 = 0x04,
KEY_QL4 = 0x05,
KEY_QL5 = 0x06,
KEY_QL6 = 0x07,
KEY_QL7 = 0x08,
KEY_QL8 = 0x09,
KEY_QL9 = 0x0a,
KEY_QL10 = 0x0b,
KEY_QL11 = 0x0c,
KEY_SLASH = 0x78,
KEY_BACKSLASH = 0x2b,
KEY_MINUS = 0x1b,
KEY_EQUALS = 0x1c,
KEY_COMMA = 0x48,
KEY_PERIOD = 0x49,
KEY_QUOTE = 0x4b,
KEY_COLON = 0x3a,
KEY_ON_OFF = 0x7f,
KEY_WIN = 0x71,
KEY_FN = 0x66,
KEY_BACKSPACE = 0x2c,
KEY_CTRL = 0x72,
KEY_ALT = 0x65,
KEY_LSHIFT = 0x53,
KEY_RSHIFT = 0x5c
KEY_RSHIFT = 0x5c,
KEY_DEL = 0x79,
KEY_SPACE = 0x74,
KEY_TAB = 0x51,
KEY_ESC = 0x01,
KEY_VOL_UP = 0x0e,
KEY_VOL_DOWN = 0x0d,
KEY_PLAY = 0x0f,
KEY_UP = 0x5a,
KEY_DOWN = 0x6a,
KEY_LEFT = 0x69,
KEY_RIGHT = 0x6b,
KEY_ENTER = 0x4c
};
enum
@ -103,13 +153,15 @@ protected:
virtual void machine_reset() override;
virtual void device_reset_after_children() override;
static constexpr uint32_t SA1110_CLOCK = 206000000;
static constexpr u32 SA1110_CLOCK = 206000000;
void main_map(address_map &map);
void cpu_rts_to_mcu(int state);
void mcu_assemble_touch_data();
void mcu_byte_received(uint16_t data);
void eeprom_data_received(uint16_t data);
void mcu_process_byte(u8 value);
void mcu_byte_received(u16 data);
void eeprom_data_received(u16 data);
void eeprom_select(int state);
enum mcu_state : int
@ -126,7 +178,7 @@ protected:
// devices
required_device<cpu_device> m_maincpu;
required_shared_ptr<uint32_t> m_ram;
required_shared_ptr<u32> m_ram;
required_device<sa1110_periphs_device> m_sa_periphs;
required_device<sa1111_device> m_companion;
required_device<sed1356_device> m_epson;
@ -139,39 +191,32 @@ protected:
required_ioport m_pen_button;
// MCU-related members
bool m_cpu_to_mcu_rts;
int m_mcu_state;
uint8_t m_mcu_key_send_idx;
uint8_t m_mcu_key_codes[2][8];
uint8_t m_mcu_key_count[2];
uint8_t m_mcu_key_idx[2];
uint8_t m_mcu_touch_send_idx;
uint8_t m_mcu_touch_data[2][8];
uint8_t m_mcu_touch_count[2];
uint8_t m_mcu_touch_idx[2];
uint8_t m_mcu_battery_data[3];
uint8_t m_mcu_battery_idx;
u8 m_mcu_key_send_idx;
u8 m_mcu_key_codes[2][8];
u8 m_mcu_key_count[2];
u8 m_mcu_key_idx[2];
u8 m_mcu_touch_send_idx;
u8 m_mcu_touch_data[2][8];
u8 m_mcu_touch_count[2];
u8 m_mcu_touch_idx[2];
u8 m_mcu_battery_data[3];
u8 m_mcu_battery_idx;
u8 m_mcu_rx_fifo[8];
u8 m_mcu_rx_count;
};
void jornada_state::main_map(address_map &map)
{
map(0x00000000, 0x01ffffff).rom().region("firmware", 0);
map(0x1a000000, 0x1a000fff).noprw(); // Debug Attachment Region
//map(0x1a000000, 0x1a000fff).noprw(); // Debug Attachment Region
map(0x1a00013c, 0x1a00013f).noprw();
map(0x1a000400, 0x1a000403).noprw();
map(0x40000000, 0x40001fff).m(m_companion, FUNC(sa1111_device::map));
map(0x48000000, 0x481fffff).m(m_epson, FUNC(sed1356_device::map));
map(0x48200000, 0x4827ffff).m(m_epson, FUNC(sed1356_device::vram_map));
map(0x80000000, 0x80000033).rw(m_sa_periphs, FUNC(sa1110_periphs_device::udc_r), FUNC(sa1110_periphs_device::udc_w));
map(0x80030000, 0x8003007b).rw(m_sa_periphs, FUNC(sa1110_periphs_device::icp_r), FUNC(sa1110_periphs_device::icp_w));
map(0x80050000, 0x80050023).rw(m_sa_periphs, FUNC(sa1110_periphs_device::uart3_r), FUNC(sa1110_periphs_device::uart3_w));
map(0x80060000, 0x8006001b).rw(m_sa_periphs, FUNC(sa1110_periphs_device::mcp_r), FUNC(sa1110_periphs_device::mcp_w));
map(0x80070000, 0x80070077).rw(m_sa_periphs, FUNC(sa1110_periphs_device::ssp_r), FUNC(sa1110_periphs_device::ssp_w));
map(0x90000000, 0x9000001f).rw(m_sa_periphs, FUNC(sa1110_periphs_device::ostimer_r), FUNC(sa1110_periphs_device::ostimer_w));
map(0x90010000, 0x9001001f).rw(m_sa_periphs, FUNC(sa1110_periphs_device::rtc_r), FUNC(sa1110_periphs_device::rtc_w));
map(0x90020000, 0x9002001f).rw(m_sa_periphs, FUNC(sa1110_periphs_device::power_r), FUNC(sa1110_periphs_device::power_w));
map(0x90030000, 0x90030007).rw(m_sa_periphs, FUNC(sa1110_periphs_device::reset_r), FUNC(sa1110_periphs_device::reset_w));
map(0x90040000, 0x90040023).rw(m_sa_periphs, FUNC(sa1110_periphs_device::gpio_r), FUNC(sa1110_periphs_device::gpio_w));
map(0x90050000, 0x90050023).rw(m_sa_periphs, FUNC(sa1110_periphs_device::intc_r), FUNC(sa1110_periphs_device::intc_w));
map(0x90060000, 0x90060013).rw(m_sa_periphs, FUNC(sa1110_periphs_device::ppc_r), FUNC(sa1110_periphs_device::ppc_w));
map(0xb0000000, 0xb00000bf).rw(m_sa_periphs, FUNC(sa1110_periphs_device::dma_r), FUNC(sa1110_periphs_device::dma_w));
map(0x80000000, 0xbfffffff).m(m_sa_periphs, FUNC(sa1110_periphs_device::map));
map(0xc0000000, 0xc1ffffff).ram().share("ram");
map(0xe0000000, 0xe0003fff).noprw(); // Cache-Flush Region 0
map(0xe0100000, 0xe01003ff).noprw(); // Cache-Flush Region 1
@ -179,33 +224,52 @@ void jornada_state::main_map(address_map &map)
void jornada_state::device_reset_after_children()
{
driver_device::device_reset_after_children();
m_sa_periphs->gpio_in<4>(0); // Flag as plugged into AC power
m_sa_periphs->gpio_in<9>(1); // Pen input is active-high
m_sa_periphs->gpio_in<9>(1); // Pen input is active-low
m_sa_periphs->gpio_in<26>(0); // Flag as charging
}
void jornada_state::cpu_rts_to_mcu(int state)
{
const bool old = m_cpu_to_mcu_rts;
m_cpu_to_mcu_rts = (bool)state;
if (!old || m_cpu_to_mcu_rts || m_mcu_rx_count == 0)
return;
for (u8 i = 0; i < m_mcu_rx_count; i++)
{
mcu_process_byte(m_mcu_rx_fifo[i]);
}
m_mcu_rx_count = 0;
}
void jornada_state::mcu_assemble_touch_data()
{
const uint16_t pen_x = m_pen_x->read();
const uint16_t pen_y = m_pen_y->read();
const uint8_t touch_recv_idx = 1 - m_mcu_touch_send_idx;
m_mcu_touch_data[touch_recv_idx][0] = (uint8_t)pen_x;
m_mcu_touch_data[touch_recv_idx][1] = (uint8_t)pen_x;
m_mcu_touch_data[touch_recv_idx][2] = (uint8_t)pen_x;
m_mcu_touch_data[touch_recv_idx][3] = (uint8_t)pen_y;
m_mcu_touch_data[touch_recv_idx][4] = (uint8_t)pen_y;
m_mcu_touch_data[touch_recv_idx][5] = (uint8_t)pen_y;
m_mcu_touch_data[touch_recv_idx][6] = (uint8_t)((pen_x >> 8) * 0x15);
m_mcu_touch_data[touch_recv_idx][7] = (uint8_t)((pen_y >> 8) * 0x15);
const u16 pen_x = m_pen_x->read();
const u16 pen_y = m_pen_y->read();
const u16 x0 = pen_x;
const u16 x1 = (pen_x + 1) & 0x3ff;
const u16 x2 = (pen_x - 1) & 0x3ff;
const u16 y0 = pen_y;
const u16 y1 = (pen_y + 1) & 0x3ff;
const u16 y2 = (pen_y - 1) & 0x3ff;
const u8 touch_recv_idx = 1 - m_mcu_touch_send_idx;
m_mcu_touch_data[touch_recv_idx][0] = (u8)x0;
m_mcu_touch_data[touch_recv_idx][1] = (u8)x1;
m_mcu_touch_data[touch_recv_idx][2] = (u8)x2;
m_mcu_touch_data[touch_recv_idx][3] = (u8)y0;
m_mcu_touch_data[touch_recv_idx][4] = (u8)y1;
m_mcu_touch_data[touch_recv_idx][5] = (u8)y2;
m_mcu_touch_data[touch_recv_idx][6] = (u8)(((x0 >> 8) & 0x03) | ((x1 >> 6) & 0xc0) | ((x2 >> 4) & 0x30));
m_mcu_touch_data[touch_recv_idx][7] = (u8)(((y0 >> 8) & 0x03) | ((y1 >> 6) & 0xc0) | ((y2 >> 4) & 0x30));
m_mcu_touch_count[touch_recv_idx] = 8;
}
void jornada_state::mcu_byte_received(uint16_t data)
void jornada_state::mcu_process_byte(u8 value)
{
const uint8_t raw_value = (uint8_t)(data >> 8);
const uint8_t value = bitswap<8>(raw_value, 0, 1, 2, 3, 4, 5, 6, 7);
uint8_t response = MCU_TXDUMMY;
u8 response = MCU_TXDUMMY;
switch (m_mcu_state)
{
case MCU_IDLE:
@ -287,7 +351,6 @@ void jornada_state::mcu_byte_received(uint16_t data)
LOGMASKED(LOG_MCU, "mcu_byte_received in MCU_TOUCH_SEND_DATA: TxDummy, sending touch data %02x and returning to IDLE state\n", response);
m_mcu_state = MCU_IDLE;
m_mcu_touch_idx[m_mcu_touch_send_idx] = 0;
//machine().debug_break();
}
}
else
@ -319,10 +382,29 @@ void jornada_state::mcu_byte_received(uint16_t data)
LOGMASKED(LOG_MCU, "mcu_byte_received in MCU_KBD_SEND_CODES: Unknown (%02x), sending ErrorCode response and returning to IDLE state\n");
response = 0;
}
break;
default:
LOGMASKED(LOG_MCU, "mcu_byte_received in %08x: %02x\n", m_mcu_state, value);
break;
}
response = bitswap<8>(response, 0, 1, 2, 3, 4, 5, 6, 7);
m_sa_periphs->ssp_in((uint16_t)response);
m_sa_periphs->ssp_in((u16)response);
}
void jornada_state::mcu_byte_received(u16 data)
{
const u8 raw_value = (u8)(data >> 8);
const u8 value = bitswap<8>(raw_value, 0, 1, 2, 3, 4, 5, 6, 7);
if (m_mcu_rx_count == 0 && !m_cpu_to_mcu_rts)
{
mcu_process_byte(value);
return;
}
m_mcu_rx_fifo[m_mcu_rx_count++] = value;
}
void jornada_state::eeprom_select(int state)
@ -330,20 +412,20 @@ void jornada_state::eeprom_select(int state)
m_nvram->select_w(!state);
}
void jornada_state::eeprom_data_received(uint16_t data)
void jornada_state::eeprom_data_received(u16 data)
{
const uint8_t response = m_nvram->access((uint8_t)data);
m_companion->ssp_in((uint16_t)response);
const u8 response = m_nvram->access((u8)data);
m_companion->ssp_in((u16)response);
}
INPUT_CHANGED_MEMBER(jornada_state::key_changed)
{
uint8_t scan_code = (uint8_t)param;
u8 scan_code = (u8)param;
m_sa_periphs->gpio_in<0>(1);
m_sa_periphs->gpio_in<0>(0);
const uint8_t key_recv_idx = 1 - m_mcu_key_send_idx;
const u8 key_recv_idx = 1 - m_mcu_key_send_idx;
if (m_mcu_key_count[key_recv_idx] < 8)
{
m_mcu_key_codes[key_recv_idx][m_mcu_key_count[key_recv_idx]] = scan_code | (newval ? 0x00 : 0x80);
@ -359,6 +441,7 @@ INPUT_CHANGED_MEMBER(jornada_state::pen_changed)
case PEN_Y:
if (m_pen_button->read() && m_mcu_state == MCU_IDLE)
{
logerror("Pen move, queueing data\n");
mcu_assemble_touch_data();
m_sa_periphs->gpio_in<9>(1);
m_sa_periphs->gpio_in<9>(0);
@ -367,11 +450,13 @@ INPUT_CHANGED_MEMBER(jornada_state::pen_changed)
case PEN_BUTTON:
if (newval)
{
logerror("PEN_BUTTON, newval set (assembling touch data)\n");
m_sa_periphs->gpio_in<9>(0);
mcu_assemble_touch_data();
}
else
{
logerror("PEN_BUTTON, newval not set\n");
m_sa_periphs->gpio_in<9>(1);
}
break;
@ -380,39 +465,94 @@ INPUT_CHANGED_MEMBER(jornada_state::pen_changed)
static INPUT_PORTS_START( jornada720 )
PORT_START("KBD0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("On/Off") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ON_OFF)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_S)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_K)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_1)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_2)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_1) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_3)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_2) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_4)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_2) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_9)
PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_Q)
PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_W)
PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_E)
PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_R)
PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_T)
PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_Y)
PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_U)
PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_I)
PORT_BIT(0x00000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_O)
PORT_BIT(0x00000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_P)
PORT_BIT(0x00000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_A)
PORT_BIT(0x00000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_S)
PORT_BIT(0x00001000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_D)
PORT_BIT(0x00002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_F)
PORT_BIT(0x00004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_G)
PORT_BIT(0x00008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_H)
PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_J)
PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_K)
PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_L)
PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_Z)
PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_X)
PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_C)
PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_V)
PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_B)
PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_N)
PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_M)
PORT_BIT(0xfc000000, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("KBD1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_TAB)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ENTER)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_A)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_N)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_L)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_M)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_P)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_C)
PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_0)
PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_1)
PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_2)
PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_3)
PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_4)
PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_5)
PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_6)
PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_7)
PORT_BIT(0x00000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_8)
PORT_BIT(0x00000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_9)
PORT_BIT(0x00000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_SLASH)
PORT_BIT(0x00000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\\") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_BACKSLASH)
PORT_BIT(0x00001000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_MINUS)
PORT_BIT(0x00002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_EQUALS)
PORT_BIT(0x00004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_COMMA)
PORT_BIT(0x00008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_PERIOD)
PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\'") PORT_CODE(KEYCODE_QUOTE) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QUOTE)
PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_COLON)
PORT_BIT(0xfffc0000, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("KBD2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_B)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alt") PORT_CODE(KEYCODE_LALT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ALT)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_SPACE)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_BACKSPACE)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_LSHIFT)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_RSHIFT)
PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x00000001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Power") PORT_CODE(KEYCODE_END) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ON_OFF)
PORT_BIT(0x00000002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Windows Key") PORT_CODE(KEYCODE_LALT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_WIN)
PORT_BIT(0x00000004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Fn") PORT_CODE(KEYCODE_RCONTROL) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_FN)
PORT_BIT(0x00000008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_BACKSPACE)
PORT_BIT(0x00000010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_CTRL)
PORT_BIT(0x00000020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Alt") PORT_CODE(KEYCODE_RALT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ALT)
PORT_BIT(0x00000040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_LSHIFT)
PORT_BIT(0x00000080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_RSHIFT)
PORT_BIT(0x00000100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Delete") PORT_CODE(KEYCODE_DEL) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_DEL)
PORT_BIT(0x00000200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_SPACE)
PORT_BIT(0x00000400, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_TAB)
PORT_BIT(0x00000800, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Escape") PORT_CODE(KEYCODE_ESC) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ESC)
PORT_BIT(0x00001000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Volume Up") PORT_CODE(KEYCODE_PGUP) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_VOL_UP)
PORT_BIT(0x00002000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Volume Down") PORT_CODE(KEYCODE_PGDN) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_VOL_DOWN)
PORT_BIT(0x00004000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Play") PORT_CODE(KEYCODE_END) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_PLAY)
PORT_BIT(0x00008000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_UP)
PORT_BIT(0x00010000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_DOWN)
PORT_BIT(0x00020000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_LEFT)
PORT_BIT(0x00040000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_RIGHT)
PORT_BIT(0x00080000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 1") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL1)
PORT_BIT(0x00100000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 2") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL2)
PORT_BIT(0x00200000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 3") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL3)
PORT_BIT(0x00400000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 4") PORT_CODE(KEYCODE_F4) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL4)
PORT_BIT(0x00800000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 5") PORT_CODE(KEYCODE_F5) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL5)
PORT_BIT(0x01000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 6") PORT_CODE(KEYCODE_F6) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL6)
PORT_BIT(0x02000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 7") PORT_CODE(KEYCODE_F7) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL7)
PORT_BIT(0x04000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 8") PORT_CODE(KEYCODE_F8) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL8)
PORT_BIT(0x08000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 9") PORT_CODE(KEYCODE_F9) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL9)
PORT_BIT(0x10000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 10") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL10)
PORT_BIT(0x20000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Quicklaunch 11") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_QL11)
PORT_BIT(0x40000000, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, key_changed, jornada_state::KEY_ENTER)
PORT_BIT(0x80000000, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("PENX")
PORT_BIT(0x3ff, 590, IPT_LIGHTGUN_X) PORT_NAME("Pen X") PORT_MINMAX(270, 910) PORT_SENSITIVITY(50) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, pen_changed, jornada_state::PEN_X)
PORT_BIT(0x3ff, 0x1ff, IPT_LIGHTGUN_X) PORT_NAME("Pen X") PORT_MINMAX(0, 1023) PORT_SENSITIVITY(50) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, pen_changed, jornada_state::PEN_X)
PORT_START("PENY")
PORT_BIT(0x3ff, 500, IPT_LIGHTGUN_Y) PORT_NAME("Pen Y") PORT_MINMAX(180, 820) PORT_SENSITIVITY(50) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, pen_changed, jornada_state::PEN_Y)
PORT_BIT(0x3ff, 0x1ff, IPT_LIGHTGUN_Y) PORT_NAME("Pen Y") PORT_MINMAX(0, 1023) PORT_SENSITIVITY(50) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, pen_changed, jornada_state::PEN_Y)
PORT_START("PENZ")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Pen Touch") PORT_CODE(MOUSECODE_BUTTON1) PORT_CHANGED_MEMBER(DEVICE_SELF, jornada_state, pen_changed, jornada_state::PEN_BUTTON)
@ -421,6 +561,7 @@ INPUT_PORTS_END
void jornada_state::machine_start()
{
save_item(NAME(m_cpu_to_mcu_rts));
save_item(NAME(m_mcu_state));
save_item(NAME(m_mcu_key_send_idx));
save_item(NAME(m_mcu_key_codes));
@ -432,26 +573,34 @@ void jornada_state::machine_start()
save_item(NAME(m_mcu_touch_idx));
save_item(NAME(m_mcu_battery_data));
save_item(NAME(m_mcu_battery_idx));
save_item(NAME(m_mcu_rx_fifo));
save_item(NAME(m_mcu_rx_count));
}
void jornada_state::machine_reset()
{
m_mcu_state = MCU_IDLE;
m_cpu_to_mcu_rts = false;
m_mcu_key_send_idx = 0;
memset(m_mcu_key_codes[0], 0, 8);
memset(m_mcu_key_codes[1], 0, 8);
memset(m_mcu_key_count, 0, 2);
memset(m_mcu_key_idx, 0, 2);
memset(m_mcu_key_codes[0], 0, sizeof(m_mcu_key_codes[0]));
memset(m_mcu_key_codes[1], 0, sizeof(m_mcu_key_codes[1]));
memset(m_mcu_key_count, 0, sizeof(m_mcu_key_count));
memset(m_mcu_key_idx, 0, sizeof(m_mcu_key_idx));
m_mcu_touch_send_idx = 0;
memset(m_mcu_touch_data[0], 0, 8);
memset(m_mcu_touch_data[1], 0, 8);
memset(m_mcu_touch_count, 0, 2);
memset(m_mcu_touch_idx, 0, 2);
memset(m_mcu_touch_data[0], 0, sizeof(m_mcu_touch_data[0]));
memset(m_mcu_touch_data[1], 0, sizeof(m_mcu_touch_data[1]));
memset(m_mcu_touch_count, 0, sizeof(m_mcu_touch_count));
memset(m_mcu_touch_idx, 0, sizeof(m_mcu_touch_idx));
memset(m_mcu_battery_data, 0, 3);
memset(m_mcu_battery_data, 0, sizeof(m_mcu_battery_data));
m_mcu_battery_idx = 0;
memset(m_mcu_rx_fifo, 0, sizeof(m_mcu_rx_fifo));
m_mcu_rx_count = 0;
LOGMASKED(LOG_MCU, "MCU State: %08x\n", m_mcu_state);
}
void jornada_state::jornada720(machine_config &config)
@ -461,6 +610,7 @@ void jornada_state::jornada720(machine_config &config)
SA1110_PERIPHERALS(config, m_sa_periphs, SA1110_CLOCK, m_maincpu);
m_sa_periphs->ssp_out().set(FUNC(jornada_state::mcu_byte_received));
m_sa_periphs->gpio_out<10>().set(FUNC(jornada_state::cpu_rts_to_mcu));
SA1111(config, m_companion, 3.6864_MHz_XTAL, m_maincpu);
m_companion->set_audio_codec_tag(m_codec);

View File

@ -1491,14 +1491,7 @@ void zaurus_sa_state::main_map(address_map &map)
map(0x00000000, 0x00ffffff).rom().region("firmware", 0);
map(0x40000000, 0x40001fff).rw(m_locomo, FUNC(locomo_device::read), FUNC(locomo_device::write));
map(0x40800000, 0x4080002b).rw(m_scoop, FUNC(scoop_device::read), FUNC(scoop_device::write));
map(0x80050000, 0x80050023).rw(m_sa_periphs, FUNC(sa1110_periphs_device::uart3_r), FUNC(sa1110_periphs_device::uart3_w));
map(0x80060000, 0x8006001b).rw(m_sa_periphs, FUNC(sa1110_periphs_device::mcp_r), FUNC(sa1110_periphs_device::mcp_w));
map(0x90000000, 0x9000001f).rw(m_sa_periphs, FUNC(sa1110_periphs_device::ostimer_r), FUNC(sa1110_periphs_device::ostimer_w));
map(0x90010000, 0x9001000f).rw(m_sa_periphs, FUNC(sa1110_periphs_device::rtc_r), FUNC(sa1110_periphs_device::rtc_w));
map(0x90020000, 0x9002001f).rw(m_sa_periphs, FUNC(sa1110_periphs_device::power_r), FUNC(sa1110_periphs_device::power_w));
map(0x90030000, 0x90030007).rw(m_sa_periphs, FUNC(sa1110_periphs_device::reset_r), FUNC(sa1110_periphs_device::reset_w));
map(0x90040000, 0x90040023).rw(m_sa_periphs, FUNC(sa1110_periphs_device::gpio_r), FUNC(sa1110_periphs_device::gpio_w));
map(0x90050000, 0x90050023).rw(m_sa_periphs, FUNC(sa1110_periphs_device::intc_r), FUNC(sa1110_periphs_device::intc_w));
map(0x80000000, 0xbfffffff).m(m_sa_periphs, FUNC(sa1110_periphs_device::map));
map(0xc0000000, 0xc3ffffff).ram().share("ram");
}