mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
modernized s3c24xx (nw)
This commit is contained in:
parent
e427dcc9b5
commit
09cf6f06ff
@ -11,7 +11,6 @@
|
||||
#include "cpu/arm7/arm7core.h"
|
||||
#include "machine/s3c2400.h"
|
||||
#include "sound/dac.h"
|
||||
#include "devlegcy.h"
|
||||
|
||||
#define VERBOSE_LEVEL ( 0 )
|
||||
|
||||
@ -29,56 +28,44 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level,
|
||||
}
|
||||
|
||||
#define DEVICE_S3C2400
|
||||
#define S3C24_CLASS_NAME s3c2400_device
|
||||
#include "machine/s3c24xx.inc"
|
||||
#undef DEVICE_S3C2400
|
||||
|
||||
UINT32 s3c2400_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return s3c24xx_video_update( this, screen, bitmap, cliprect);
|
||||
}
|
||||
|
||||
DEVICE_START( s3c2400 )
|
||||
{
|
||||
address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
|
||||
DEVICE_START_CALL(s3c24xx);
|
||||
space.install_legacy_readwrite_handler( *device, 0x14000000, 0x1400003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14200000, 0x1420005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14400000, 0x14400017, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14600000, 0x1460001b, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14600020, 0x1460003b, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14600040, 0x1460005b, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14600060, 0x1460007b, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14800000, 0x14800017, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14a00000, 0x14a003ff, FUNC(s3c2400_lcd_r), FUNC(s3c24xx_lcd_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x14a00400, 0x14a007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15000000, 0x1500002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15004000, 0x1500402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15100000, 0x15100043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15200140, 0x152001fb, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15300000, 0x1530000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15400000, 0x1540000f, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15508000, 0x15508013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15600000, 0x1560005b, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15700040, 0x1570008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15800000, 0x15800007, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15900000, 0x15900017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x15a00000, 0x15a0003f, FUNC(s3c24xx_mmc_r), FUNC(s3c24xx_mmc_w));
|
||||
|
||||
s3c24xx_video_start( device, device->machine());
|
||||
return s3c24xx_video_update(screen, bitmap, cliprect);
|
||||
}
|
||||
|
||||
const device_type S3C2400 = &device_creator<s3c2400_device>;
|
||||
|
||||
s3c2400_device::s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, S3C2400, "Samsung S3C2400", tag, owner, clock, "s3c2400", __FILE__),
|
||||
m_palette(*this)
|
||||
m_palette(*this),
|
||||
m_cpu(*this, ":maincpu")
|
||||
{
|
||||
m_token = global_alloc_clear(s3c24xx_t);
|
||||
memset(&m_memcon, 0, sizeof(m_memcon));
|
||||
memset(&m_usbhost, 0, sizeof(m_usbhost));
|
||||
memset(&m_irq, 0, sizeof(m_irq));
|
||||
memset(m_dma, 0, sizeof(m_dma));
|
||||
memset(&m_clkpow, 0, sizeof(m_clkpow));
|
||||
memset(&m_lcd, 0, sizeof(m_lcd));
|
||||
memset(&m_lcdpal, 0, sizeof(m_lcdpal));
|
||||
memset(m_uart, 0, sizeof(m_uart));
|
||||
memset(&m_pwm, 0, sizeof(m_pwm));
|
||||
memset(&m_usbdev, 0, sizeof(m_usbdev));
|
||||
memset(&m_wdt, 0, sizeof(m_wdt));
|
||||
memset(&m_iic, 0, sizeof(m_iic));
|
||||
memset(&m_iis, 0, sizeof(m_iis));
|
||||
memset(&m_gpio, 0, sizeof(m_gpio));
|
||||
memset(&m_rtc, 0, sizeof(m_rtc));
|
||||
memset(&m_adc, 0, sizeof(m_adc));
|
||||
memset(m_spi, 0, sizeof(m_spi));
|
||||
memset(&m_mmc, 0, sizeof(m_mmc));
|
||||
}
|
||||
|
||||
s3c2400_device::~s3c2400_device()
|
||||
{
|
||||
global_free(m_token);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -99,6 +86,10 @@ void s3c2400_device::static_set_palette_tag(device_t &device, const char *tag)
|
||||
|
||||
void s3c2400_device::device_config_complete()
|
||||
{
|
||||
// inherit a copy of the static data
|
||||
const s3c2400_interface *intf = reinterpret_cast<const s3c2400_interface *>(static_config());
|
||||
if (intf != NULL)
|
||||
*static_cast<s3c2400_interface *>(this) = *intf;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -107,9 +98,33 @@ void s3c2400_device::device_config_complete()
|
||||
|
||||
void s3c2400_device::device_start()
|
||||
{
|
||||
s3c24xx_t *s3c24xx = get_token(this);
|
||||
s3c24xx->m_palette = m_palette;
|
||||
DEVICE_START_NAME( s3c2400 )(this);
|
||||
s3c24xx_device_start();
|
||||
|
||||
address_space &space = m_cpu->memory().space( AS_PROGRAM);
|
||||
space.install_readwrite_handler(0x14000000, 0x1400003b, read32_delegate(FUNC(s3c2400_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_memcon_w), this));
|
||||
space.install_readwrite_handler(0x14200000, 0x1420005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_usb_host_w), this));
|
||||
space.install_readwrite_handler(0x14400000, 0x14400017, read32_delegate(FUNC(s3c2400_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_irq_w), this));
|
||||
space.install_readwrite_handler(0x14600000, 0x1460001b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_0_w), this));
|
||||
space.install_readwrite_handler(0x14600020, 0x1460003b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_1_w), this));
|
||||
space.install_readwrite_handler(0x14600040, 0x1460005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_2_w), this));
|
||||
space.install_readwrite_handler(0x14600060, 0x1460007b, read32_delegate(FUNC(s3c2400_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_dma_3_w), this));
|
||||
space.install_readwrite_handler(0x14800000, 0x14800017, read32_delegate(FUNC(s3c2400_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_clkpow_w), this));
|
||||
space.install_readwrite_handler(0x14a00000, 0x14a003ff, read32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_w), this));
|
||||
space.install_readwrite_handler(0x14a00400, 0x14a007ff, read32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_lcd_palette_w), this));
|
||||
space.install_readwrite_handler(0x15000000, 0x1500002b, read32_delegate(FUNC(s3c2400_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_uart_0_w), this));
|
||||
space.install_readwrite_handler(0x15004000, 0x1500402b, read32_delegate(FUNC(s3c2400_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_uart_1_w), this));
|
||||
space.install_readwrite_handler(0x15100000, 0x15100043, read32_delegate(FUNC(s3c2400_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_pwm_w), this));
|
||||
space.install_readwrite_handler(0x15200140, 0x152001fb, read32_delegate(FUNC(s3c2400_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_usb_device_w), this));
|
||||
space.install_readwrite_handler(0x15300000, 0x1530000b, read32_delegate(FUNC(s3c2400_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_wdt_w), this));
|
||||
space.install_readwrite_handler(0x15400000, 0x1540000f, read32_delegate(FUNC(s3c2400_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_iic_w), this));
|
||||
space.install_readwrite_handler(0x15508000, 0x15508013, read32_delegate(FUNC(s3c2400_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_iis_w), this));
|
||||
space.install_readwrite_handler(0x15600000, 0x1560005b, read32_delegate(FUNC(s3c2400_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_gpio_w), this));
|
||||
space.install_readwrite_handler(0x15700040, 0x1570008b, read32_delegate(FUNC(s3c2400_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_rtc_w), this));
|
||||
space.install_readwrite_handler(0x15800000, 0x15800007, read32_delegate(FUNC(s3c2400_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_adc_w), this));
|
||||
space.install_readwrite_handler(0x15900000, 0x15900017, read32_delegate(FUNC(s3c2400_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_spi_0_w), this));
|
||||
space.install_readwrite_handler(0x15a00000, 0x15a0003f, read32_delegate(FUNC(s3c2400_device::s3c24xx_mmc_r), this), write32_delegate(FUNC(s3c2400_device::s3c24xx_mmc_w), this));
|
||||
|
||||
s3c24xx_video_start();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -118,10 +133,10 @@ void s3c2400_device::device_start()
|
||||
|
||||
void s3c2400_device::device_reset()
|
||||
{
|
||||
DEVICE_RESET_NAME( s3c24xx )(this);
|
||||
s3c24xx_device_reset();
|
||||
}
|
||||
|
||||
void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data)
|
||||
void s3c2400_device::s3c2400_uart_fifo_w(int uart, UINT8 data)
|
||||
{
|
||||
s3c24xx_uart_fifo_w( device, uart, data);
|
||||
s3c24xx_uart_fifo_w(uart, data);
|
||||
}
|
||||
|
@ -33,32 +33,6 @@ enum
|
||||
S3C2400_GPIO_PORT_G
|
||||
};
|
||||
|
||||
class s3c2400_device : public device_t
|
||||
{
|
||||
public:
|
||||
s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~s3c2400_device();
|
||||
|
||||
// static configuration
|
||||
static void static_set_palette_tag(device_t &device, const char *tag);
|
||||
|
||||
// access to legacy token
|
||||
struct s3c24xx_t *token() const { assert(m_token != NULL); return m_token; }
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
private:
|
||||
// internal state
|
||||
struct s3c24xx_t *m_token;
|
||||
required_device<palette_device> m_palette;
|
||||
public:
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
};
|
||||
|
||||
extern const device_type S3C2400;
|
||||
|
||||
/*******************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
*******************************************************************************/
|
||||
@ -99,20 +73,14 @@ struct s3c2400_interface_lcd
|
||||
|
||||
struct s3c2400_interface
|
||||
{
|
||||
s3c2400_interface_core core;
|
||||
s3c2400_interface_gpio gpio;
|
||||
s3c2400_interface_i2c i2c;
|
||||
s3c2400_interface_adc adc;
|
||||
s3c2400_interface_i2s i2s;
|
||||
s3c2400_interface_lcd lcd;
|
||||
s3c2400_interface_core m_iface_core;
|
||||
s3c2400_interface_gpio m_iface_gpio;
|
||||
s3c2400_interface_i2c m_iface_i2c;
|
||||
s3c2400_interface_adc m_iface_adc;
|
||||
s3c2400_interface_i2s m_iface_i2s;
|
||||
s3c2400_interface_lcd m_iface_lcd;
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
PROTOTYPES
|
||||
*******************************************************************************/
|
||||
|
||||
void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data);
|
||||
|
||||
/*******************************************************************************
|
||||
MACROS & CONSTANTS
|
||||
*******************************************************************************/
|
||||
@ -401,363 +369,546 @@ void s3c2400_uart_fifo_w( device_t *device, int uart, UINT8 data);
|
||||
#define S3C24XX_DMA_COUNT 4
|
||||
#define S3C24XX_SPI_COUNT 1
|
||||
|
||||
/*******************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
*******************************************************************************/
|
||||
|
||||
struct s3c24xx_memcon_regs_t
|
||||
class s3c2400_device : public device_t,
|
||||
public s3c2400_interface
|
||||
{
|
||||
UINT32 data[0x34/4];
|
||||
public:
|
||||
s3c2400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
~s3c2400_device();
|
||||
|
||||
// static configuration
|
||||
static void static_set_palette_tag(device_t &device, const char *tag);
|
||||
|
||||
// access to legacy token
|
||||
struct s3c24xx_t *token() const { assert(m_token != NULL); return m_token; }
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
virtual void device_reset();
|
||||
private:
|
||||
// internal state
|
||||
struct s3c24xx_t *m_token;
|
||||
required_device<palette_device> m_palette;
|
||||
public:
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void s3c24xx_reset();
|
||||
inline int iface_core_pin_r(int pin);
|
||||
void s3c24xx_lcd_reset();
|
||||
rgb_t s3c24xx_get_color_tft_16(UINT16 data);
|
||||
rgb_t s3c24xx_get_color_stn_12(UINT16 data);
|
||||
rgb_t s3c24xx_get_color_stn_08( UINT8 data);
|
||||
rgb_t s3c24xx_get_color_stn_01(UINT8 data);
|
||||
rgb_t s3c24xx_get_color_stn_02(UINT8 data);
|
||||
rgb_t s3c24xx_get_color_stn_04(UINT8 data);
|
||||
rgb_t s3c24xx_get_color_tpal();
|
||||
void s3c24xx_lcd_dma_reload();
|
||||
void s3c24xx_lcd_dma_init();
|
||||
UINT32 s3c24xx_lcd_dma_read();
|
||||
UINT32 s3c24xx_lcd_dma_read_bits(int count);
|
||||
void s3c24xx_lcd_render_tpal();
|
||||
void s3c24xx_lcd_render_stn_01();
|
||||
void s3c24xx_lcd_render_stn_02();
|
||||
void s3c24xx_lcd_render_stn_04();
|
||||
void s3c24xx_lcd_render_stn_08();
|
||||
void s3c24xx_lcd_render_stn_12_p();
|
||||
void s3c24xx_lcd_render_stn_12_u(); // not tested
|
||||
void s3c24xx_lcd_render_tft_01();
|
||||
void s3c24xx_lcd_render_tft_02();
|
||||
void s3c24xx_lcd_render_tft_04();
|
||||
void s3c24xx_lcd_render_tft_08();
|
||||
void s3c24xx_lcd_render_tft_16();
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_lcd_timer_exp );
|
||||
void s3c24xx_video_start();
|
||||
void bitmap_blend( bitmap_rgb32 &bitmap_dst, bitmap_rgb32 &bitmap_src_1, bitmap_rgb32 &bitmap_src_2);
|
||||
UINT32 s3c24xx_video_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
READ32_MEMBER( s3c24xx_lcd_r );
|
||||
int s3c24xx_lcd_configure_tft();
|
||||
int s3c24xx_lcd_configure_stn();
|
||||
int s3c24xx_lcd_configure();
|
||||
void s3c24xx_lcd_start();
|
||||
void s3c24xx_lcd_stop();
|
||||
void s3c24xx_lcd_recalc();
|
||||
WRITE32_MEMBER( s3c24xx_lcd_w );
|
||||
READ32_MEMBER( s3c24xx_lcd_palette_r );
|
||||
WRITE32_MEMBER( s3c24xx_lcd_palette_w );
|
||||
void s3c24xx_clkpow_reset();
|
||||
UINT32 s3c24xx_get_fclk();
|
||||
UINT32 s3c24xx_get_hclk();
|
||||
UINT32 s3c24xx_get_pclk();
|
||||
READ32_MEMBER( s3c24xx_clkpow_r );
|
||||
WRITE32_MEMBER( s3c24xx_clkpow_w );
|
||||
void s3c24xx_irq_reset();
|
||||
void s3c24xx_check_pending_irq();
|
||||
void s3c24xx_request_irq(UINT32 int_type);
|
||||
READ32_MEMBER( s3c24xx_irq_r );
|
||||
WRITE32_MEMBER( s3c24xx_irq_w );
|
||||
void s3c24xx_pwm_reset();
|
||||
UINT16 s3c24xx_pwm_calc_observation(int ch);
|
||||
READ32_MEMBER( s3c24xx_pwm_r );
|
||||
void s3c24xx_pwm_start(int timer);
|
||||
void s3c24xx_pwm_stop(int timer);
|
||||
void s3c24xx_pwm_recalc(int timer);
|
||||
WRITE32_MEMBER( s3c24xx_pwm_w );
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_pwm_timer_exp );
|
||||
void s3c24xx_dma_reset();
|
||||
void s3c24xx_dma_reload(int ch);
|
||||
void s3c24xx_dma_trigger(int ch);
|
||||
void s3c24xx_dma_request_iis();
|
||||
void s3c24xx_dma_request_pwm();
|
||||
void s3c24xx_dma_start(int ch);
|
||||
void s3c24xx_dma_stop(int ch);
|
||||
void s3c24xx_dma_recalc(int ch);
|
||||
UINT32 s3c24xx_dma_r(UINT32 ch, UINT32 offset);
|
||||
void s3c24xx_dma_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask);
|
||||
READ32_MEMBER( s3c24xx_dma_0_r );
|
||||
READ32_MEMBER( s3c24xx_dma_1_r );
|
||||
READ32_MEMBER( s3c24xx_dma_2_r );
|
||||
READ32_MEMBER( s3c24xx_dma_3_r );
|
||||
WRITE32_MEMBER( s3c24xx_dma_0_w );
|
||||
WRITE32_MEMBER( s3c24xx_dma_1_w );
|
||||
WRITE32_MEMBER( s3c24xx_dma_2_w );
|
||||
WRITE32_MEMBER( s3c24xx_dma_3_w );
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_dma_timer_exp );
|
||||
void s3c24xx_gpio_reset();
|
||||
inline UINT32 iface_gpio_port_r(int port, UINT32 mask);
|
||||
inline void iface_gpio_port_w(int port, UINT32 mask, UINT32 data);
|
||||
UINT16 s3c24xx_gpio_get_mask( UINT32 con, int val);
|
||||
READ32_MEMBER( s3c24xx_gpio_r );
|
||||
WRITE32_MEMBER( s3c24xx_gpio_w );
|
||||
void s3c24xx_memcon_reset();
|
||||
READ32_MEMBER( s3c24xx_memcon_r );
|
||||
WRITE32_MEMBER( s3c24xx_memcon_w );
|
||||
void s3c24xx_usb_host_reset();
|
||||
READ32_MEMBER( s3c24xx_usb_host_r );
|
||||
WRITE32_MEMBER( s3c24xx_usb_host_w );
|
||||
void s3c24xx_uart_reset();
|
||||
UINT32 s3c24xx_uart_r(UINT32 ch, UINT32 offset);
|
||||
void s3c24xx_uart_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask);
|
||||
READ32_MEMBER( s3c24xx_uart_0_r );
|
||||
READ32_MEMBER( s3c24xx_uart_1_r );
|
||||
WRITE32_MEMBER( s3c24xx_uart_0_w );
|
||||
WRITE32_MEMBER( s3c24xx_uart_1_w );
|
||||
void s3c24xx_uart_fifo_w(int uart, UINT8 data);
|
||||
void s3c24xx_usb_device_reset();
|
||||
READ32_MEMBER( s3c24xx_usb_device_r );
|
||||
WRITE32_MEMBER( s3c24xx_usb_device_w );
|
||||
void s3c24xx_wdt_reset();
|
||||
UINT16 s3c24xx_wdt_calc_current_count();
|
||||
READ32_MEMBER( s3c24xx_wdt_r );
|
||||
void s3c24xx_wdt_start();
|
||||
void s3c24xx_wdt_stop();
|
||||
void s3c24xx_wdt_recalc();
|
||||
WRITE32_MEMBER( s3c24xx_wdt_w );
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_wdt_timer_exp );
|
||||
void s3c24xx_iic_reset();
|
||||
inline void iface_i2c_scl_w( int state);
|
||||
inline void iface_i2c_sda_w(int state);
|
||||
inline int iface_i2c_sda_r();
|
||||
void i2c_send_start();
|
||||
void i2c_send_stop();
|
||||
UINT8 i2c_receive_byte(int ack);
|
||||
int i2c_send_byte(UINT8 data);
|
||||
void iic_start();
|
||||
void iic_stop();
|
||||
void iic_resume();
|
||||
READ32_MEMBER( s3c24xx_iic_r );
|
||||
WRITE32_MEMBER( s3c24xx_iic_w );
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_iic_timer_exp );
|
||||
void s3c24xx_iis_reset();
|
||||
inline void iface_i2s_data_w(int ch, UINT16 data);
|
||||
void s3c24xx_iis_start();
|
||||
void s3c24xx_iis_stop();
|
||||
void s3c24xx_iis_recalc();
|
||||
READ32_MEMBER( s3c24xx_iis_r );
|
||||
WRITE32_MEMBER( s3c24xx_iis_w );
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_iis_timer_exp );
|
||||
void s3c24xx_rtc_reset();
|
||||
READ32_MEMBER( s3c24xx_rtc_r );
|
||||
void s3c24xx_rtc_recalc();
|
||||
WRITE32_MEMBER( s3c24xx_rtc_w );
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_rtc_timer_tick_count_exp );
|
||||
void s3c24xx_rtc_update();
|
||||
void s3c24xx_rtc_check_alarm();
|
||||
TIMER_CALLBACK_MEMBER( s3c24xx_rtc_timer_update_exp );
|
||||
void s3c24xx_adc_reset();
|
||||
UINT32 iface_adc_data_r(int ch);
|
||||
READ32_MEMBER( s3c24xx_adc_r );
|
||||
void s3c24xx_adc_start();
|
||||
WRITE32_MEMBER( s3c24xx_adc_w );
|
||||
void s3c24xx_spi_reset();
|
||||
UINT32 s3c24xx_spi_r(UINT32 ch, UINT32 offset);
|
||||
void s3c24xx_spi_w(UINT32 ch, UINT32 offset, UINT32 data, UINT32 mem_mask);
|
||||
READ32_MEMBER( s3c24xx_spi_0_r );
|
||||
WRITE32_MEMBER( s3c24xx_spi_0_w );
|
||||
void s3c24xx_mmc_reset();
|
||||
READ32_MEMBER( s3c24xx_mmc_r );
|
||||
WRITE32_MEMBER( s3c24xx_mmc_w );
|
||||
void s3c24xx_device_reset();
|
||||
void s3c24xx_device_start();
|
||||
|
||||
|
||||
void s3c2400_uart_fifo_w(int uart, UINT8 data);
|
||||
|
||||
/*******************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
*******************************************************************************/
|
||||
|
||||
struct s3c24xx_memcon_regs_t
|
||||
{
|
||||
UINT32 data[0x34/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_usbhost_regs_t
|
||||
{
|
||||
UINT32 data[0x5C/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_irq_regs_t
|
||||
{
|
||||
UINT32 srcpnd;
|
||||
UINT32 intmod;
|
||||
UINT32 intmsk;
|
||||
UINT32 priority;
|
||||
UINT32 intpnd;
|
||||
UINT32 intoffset;
|
||||
};
|
||||
|
||||
struct s3c24xx_dma_regs_t
|
||||
{
|
||||
UINT32 disrc;
|
||||
UINT32 didst;
|
||||
UINT32 dcon;
|
||||
UINT32 dstat;
|
||||
UINT32 dcsrc;
|
||||
UINT32 dcdst;
|
||||
UINT32 dmasktrig;
|
||||
};
|
||||
|
||||
struct s3c24xx_clkpow_regs_t
|
||||
{
|
||||
UINT32 locktime;
|
||||
UINT32 mpllcon;
|
||||
UINT32 upllcon;
|
||||
UINT32 clkcon;
|
||||
UINT32 clkslow;
|
||||
UINT32 clkdivn;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcd_regs_t
|
||||
{
|
||||
UINT32 lcdcon1;
|
||||
UINT32 lcdcon2;
|
||||
UINT32 lcdcon3;
|
||||
UINT32 lcdcon4;
|
||||
UINT32 lcdcon5;
|
||||
UINT32 lcdsaddr1;
|
||||
UINT32 lcdsaddr2;
|
||||
UINT32 lcdsaddr3;
|
||||
UINT32 redlut;
|
||||
UINT32 greenlut;
|
||||
UINT32 bluelut;
|
||||
UINT32 reserved[8];
|
||||
UINT32 dithmode;
|
||||
UINT32 tpal;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcdpal_regs_t
|
||||
{
|
||||
UINT32 data[0x400/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_uart_regs_t
|
||||
{
|
||||
UINT32 ulcon;
|
||||
UINT32 ucon;
|
||||
UINT32 ufcon;
|
||||
UINT32 umcon;
|
||||
UINT32 utrstat;
|
||||
UINT32 uerstat;
|
||||
UINT32 ufstat;
|
||||
UINT32 umstat;
|
||||
UINT32 utxh;
|
||||
UINT32 urxh;
|
||||
UINT32 ubrdiv;
|
||||
};
|
||||
|
||||
struct s3c24xx_pwm_regs_t
|
||||
{
|
||||
UINT32 tcfg0;
|
||||
UINT32 tcfg1;
|
||||
UINT32 tcon;
|
||||
UINT32 tcntb0;
|
||||
UINT32 tcmpb0;
|
||||
UINT32 tcnto0;
|
||||
UINT32 tcntb1;
|
||||
UINT32 tcmpb1;
|
||||
UINT32 tcnto1;
|
||||
UINT32 tcntb2;
|
||||
UINT32 tcmpb2;
|
||||
UINT32 tcnto2;
|
||||
UINT32 tcntb3;
|
||||
UINT32 tcmpb3;
|
||||
UINT32 tcnto3;
|
||||
UINT32 tcntb4;
|
||||
UINT32 tcnto4;
|
||||
};
|
||||
|
||||
struct s3c24xx_usbdev_regs_t
|
||||
{
|
||||
UINT32 data[0xBC/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_wdt_regs_t
|
||||
{
|
||||
UINT32 wtcon;
|
||||
UINT32 wtdat;
|
||||
UINT32 wtcnt;
|
||||
};
|
||||
|
||||
struct s3c24xx_iic_regs_t
|
||||
{
|
||||
UINT32 iiccon;
|
||||
UINT32 iicstat;
|
||||
UINT32 iicadd;
|
||||
UINT32 iicds;
|
||||
};
|
||||
|
||||
struct s3c24xx_iis_regs_t
|
||||
{
|
||||
UINT32 iiscon;
|
||||
UINT32 iismod;
|
||||
UINT32 iispsr;
|
||||
UINT32 iisfcon;
|
||||
UINT32 iisfifo;
|
||||
};
|
||||
|
||||
struct s3c24xx_gpio_regs_t
|
||||
{
|
||||
UINT32 gpacon;
|
||||
UINT32 gpadat;
|
||||
UINT32 gpbcon;
|
||||
UINT32 gpbdat;
|
||||
UINT32 gpbup;
|
||||
UINT32 gpccon;
|
||||
UINT32 gpcdat;
|
||||
UINT32 gpcup;
|
||||
UINT32 gpdcon;
|
||||
UINT32 gpddat;
|
||||
UINT32 gpdup;
|
||||
UINT32 gpecon;
|
||||
UINT32 gpedat;
|
||||
UINT32 gpeup;
|
||||
UINT32 gpfcon;
|
||||
UINT32 gpfdat;
|
||||
UINT32 gpfup;
|
||||
UINT32 gpgcon;
|
||||
UINT32 gpgdat;
|
||||
UINT32 gpgup;
|
||||
UINT32 opencr;
|
||||
UINT32 misccr;
|
||||
UINT32 extint;
|
||||
};
|
||||
|
||||
struct s3c24xx_rtc_regs_t
|
||||
{
|
||||
UINT32 rtccon;
|
||||
UINT32 ticnt;
|
||||
UINT32 reserved[2];
|
||||
UINT32 rtcalm;
|
||||
UINT32 almsec;
|
||||
UINT32 almmin;
|
||||
UINT32 almhour;
|
||||
UINT32 almday;
|
||||
UINT32 almmon;
|
||||
UINT32 almyear;
|
||||
UINT32 rtcrst;
|
||||
UINT32 bcdsec;
|
||||
UINT32 bcdmin;
|
||||
UINT32 bcdhour;
|
||||
UINT32 bcdday;
|
||||
UINT32 bcddow;
|
||||
UINT32 bcdmon;
|
||||
UINT32 bcdyear;
|
||||
};
|
||||
|
||||
struct s3c24xx_adc_regs_t
|
||||
{
|
||||
UINT32 adccon;
|
||||
UINT32 adcdat;
|
||||
};
|
||||
|
||||
struct s3c24xx_spi_regs_t
|
||||
{
|
||||
UINT32 spcon;
|
||||
UINT32 spsta;
|
||||
UINT32 sppin;
|
||||
UINT32 sppre;
|
||||
UINT32 sptdat;
|
||||
UINT32 sprdat;
|
||||
};
|
||||
|
||||
struct s3c24xx_mmc_regs_t
|
||||
{
|
||||
UINT32 data[0x40/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_memcon_t
|
||||
{
|
||||
s3c24xx_memcon_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_usbhost_t
|
||||
{
|
||||
s3c24xx_usbhost_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_irq_t
|
||||
{
|
||||
s3c24xx_irq_regs_t regs;
|
||||
int line_irq, line_fiq;
|
||||
};
|
||||
|
||||
struct s3c24xx_dma_t
|
||||
{
|
||||
s3c24xx_dma_regs_t regs;
|
||||
emu_timer *timer;
|
||||
};
|
||||
|
||||
struct s3c24xx_clkpow_t
|
||||
{
|
||||
s3c24xx_clkpow_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcd_t
|
||||
{
|
||||
s3c24xx_lcd_regs_t regs;
|
||||
emu_timer *timer;
|
||||
bitmap_rgb32 *bitmap[2];
|
||||
UINT32 vramaddr_cur;
|
||||
UINT32 vramaddr_max;
|
||||
UINT32 offsize;
|
||||
UINT32 pagewidth_cur;
|
||||
UINT32 pagewidth_max;
|
||||
UINT32 bppmode;
|
||||
UINT32 bswp, hwswp;
|
||||
int vpos, hpos;
|
||||
double framerate;
|
||||
UINT32 tpal;
|
||||
UINT32 hpos_min, hpos_max, vpos_min, vpos_max;
|
||||
UINT32 dma_data, dma_bits;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcdpal_t
|
||||
{
|
||||
s3c24xx_lcdpal_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_uart_t
|
||||
{
|
||||
s3c24xx_uart_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_pwm_t
|
||||
{
|
||||
s3c24xx_pwm_regs_t regs;
|
||||
emu_timer *timer[5];
|
||||
UINT32 cnt[5];
|
||||
UINT32 cmp[5];
|
||||
UINT32 freq[5];
|
||||
};
|
||||
|
||||
struct s3c24xx_usbdev_t
|
||||
{
|
||||
s3c24xx_usbdev_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_wdt_t
|
||||
{
|
||||
s3c24xx_wdt_regs_t regs;
|
||||
emu_timer *timer;
|
||||
};
|
||||
|
||||
struct s3c24xx_iic_t
|
||||
{
|
||||
s3c24xx_iic_regs_t regs;
|
||||
emu_timer *timer;
|
||||
int count;
|
||||
};
|
||||
|
||||
struct s3c24xx_iis_t
|
||||
{
|
||||
s3c24xx_iis_regs_t regs;
|
||||
emu_timer *timer;
|
||||
UINT16 fifo[16/2];
|
||||
int fifo_index;
|
||||
};
|
||||
|
||||
struct s3c24xx_gpio_t
|
||||
{
|
||||
s3c24xx_gpio_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_rtc_t
|
||||
{
|
||||
s3c24xx_rtc_regs_t regs;
|
||||
emu_timer *timer_tick_count;
|
||||
emu_timer *timer_update;
|
||||
};
|
||||
|
||||
struct s3c24xx_adc_t
|
||||
{
|
||||
s3c24xx_adc_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_spi_t
|
||||
{
|
||||
s3c24xx_spi_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_mmc_t
|
||||
{
|
||||
s3c24xx_mmc_regs_t regs;
|
||||
};
|
||||
|
||||
|
||||
s3c24xx_memcon_t m_memcon;
|
||||
s3c24xx_usbhost_t m_usbhost;
|
||||
s3c24xx_irq_t m_irq;
|
||||
s3c24xx_dma_t m_dma[S3C24XX_DMA_COUNT];
|
||||
s3c24xx_clkpow_t m_clkpow;
|
||||
s3c24xx_lcd_t m_lcd;
|
||||
s3c24xx_lcdpal_t m_lcdpal;
|
||||
s3c24xx_uart_t m_uart[S3C24XX_UART_COUNT];
|
||||
s3c24xx_pwm_t m_pwm;
|
||||
s3c24xx_usbdev_t m_usbdev;
|
||||
s3c24xx_wdt_t m_wdt;
|
||||
s3c24xx_iic_t m_iic;
|
||||
s3c24xx_iis_t m_iis;
|
||||
s3c24xx_gpio_t m_gpio;
|
||||
s3c24xx_rtc_t m_rtc;
|
||||
s3c24xx_adc_t m_adc;
|
||||
s3c24xx_spi_t m_spi[S3C24XX_SPI_COUNT];
|
||||
s3c24xx_mmc_t m_mmc;
|
||||
required_device<device_t> m_cpu;
|
||||
devcb_resolved_read32 m_pin_r;
|
||||
devcb_resolved_write32 m_pin_w;
|
||||
devcb_resolved_read32 m_port_r;
|
||||
devcb_resolved_write32 m_port_w;
|
||||
devcb_resolved_write_line m_scl_w;
|
||||
devcb_resolved_read_line m_sda_r;
|
||||
devcb_resolved_write_line m_sda_w;
|
||||
devcb_resolved_read32 m_adc_data_r;
|
||||
devcb_resolved_write16 m_i2s_data_w;
|
||||
devcb_resolved_write8 m_command_w;
|
||||
devcb_resolved_write8 m_address_w;
|
||||
devcb_resolved_read8 m_nand_data_r;
|
||||
devcb_resolved_write8 m_nand_data_w;
|
||||
|
||||
};
|
||||
|
||||
struct s3c24xx_usbhost_regs_t
|
||||
{
|
||||
UINT32 data[0x5C/4];
|
||||
};
|
||||
extern const device_type S3C2400;
|
||||
|
||||
struct s3c24xx_irq_regs_t
|
||||
{
|
||||
UINT32 srcpnd;
|
||||
UINT32 intmod;
|
||||
UINT32 intmsk;
|
||||
UINT32 priority;
|
||||
UINT32 intpnd;
|
||||
UINT32 intoffset;
|
||||
};
|
||||
|
||||
struct s3c24xx_dma_regs_t
|
||||
{
|
||||
UINT32 disrc;
|
||||
UINT32 didst;
|
||||
UINT32 dcon;
|
||||
UINT32 dstat;
|
||||
UINT32 dcsrc;
|
||||
UINT32 dcdst;
|
||||
UINT32 dmasktrig;
|
||||
};
|
||||
|
||||
struct s3c24xx_clkpow_regs_t
|
||||
{
|
||||
UINT32 locktime;
|
||||
UINT32 mpllcon;
|
||||
UINT32 upllcon;
|
||||
UINT32 clkcon;
|
||||
UINT32 clkslow;
|
||||
UINT32 clkdivn;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcd_regs_t
|
||||
{
|
||||
UINT32 lcdcon1;
|
||||
UINT32 lcdcon2;
|
||||
UINT32 lcdcon3;
|
||||
UINT32 lcdcon4;
|
||||
UINT32 lcdcon5;
|
||||
UINT32 lcdsaddr1;
|
||||
UINT32 lcdsaddr2;
|
||||
UINT32 lcdsaddr3;
|
||||
UINT32 redlut;
|
||||
UINT32 greenlut;
|
||||
UINT32 bluelut;
|
||||
UINT32 reserved[8];
|
||||
UINT32 dithmode;
|
||||
UINT32 tpal;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcdpal_regs_t
|
||||
{
|
||||
UINT32 data[0x400/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_uart_regs_t
|
||||
{
|
||||
UINT32 ulcon;
|
||||
UINT32 ucon;
|
||||
UINT32 ufcon;
|
||||
UINT32 umcon;
|
||||
UINT32 utrstat;
|
||||
UINT32 uerstat;
|
||||
UINT32 ufstat;
|
||||
UINT32 umstat;
|
||||
UINT32 utxh;
|
||||
UINT32 urxh;
|
||||
UINT32 ubrdiv;
|
||||
};
|
||||
|
||||
struct s3c24xx_pwm_regs_t
|
||||
{
|
||||
UINT32 tcfg0;
|
||||
UINT32 tcfg1;
|
||||
UINT32 tcon;
|
||||
UINT32 tcntb0;
|
||||
UINT32 tcmpb0;
|
||||
UINT32 tcnto0;
|
||||
UINT32 tcntb1;
|
||||
UINT32 tcmpb1;
|
||||
UINT32 tcnto1;
|
||||
UINT32 tcntb2;
|
||||
UINT32 tcmpb2;
|
||||
UINT32 tcnto2;
|
||||
UINT32 tcntb3;
|
||||
UINT32 tcmpb3;
|
||||
UINT32 tcnto3;
|
||||
UINT32 tcntb4;
|
||||
UINT32 tcnto4;
|
||||
};
|
||||
|
||||
struct s3c24xx_usbdev_regs_t
|
||||
{
|
||||
UINT32 data[0xBC/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_wdt_regs_t
|
||||
{
|
||||
UINT32 wtcon;
|
||||
UINT32 wtdat;
|
||||
UINT32 wtcnt;
|
||||
};
|
||||
|
||||
struct s3c24xx_iic_regs_t
|
||||
{
|
||||
UINT32 iiccon;
|
||||
UINT32 iicstat;
|
||||
UINT32 iicadd;
|
||||
UINT32 iicds;
|
||||
};
|
||||
|
||||
struct s3c24xx_iis_regs_t
|
||||
{
|
||||
UINT32 iiscon;
|
||||
UINT32 iismod;
|
||||
UINT32 iispsr;
|
||||
UINT32 iisfcon;
|
||||
UINT32 iisfifo;
|
||||
};
|
||||
|
||||
struct s3c24xx_gpio_regs_t
|
||||
{
|
||||
UINT32 gpacon;
|
||||
UINT32 gpadat;
|
||||
UINT32 gpbcon;
|
||||
UINT32 gpbdat;
|
||||
UINT32 gpbup;
|
||||
UINT32 gpccon;
|
||||
UINT32 gpcdat;
|
||||
UINT32 gpcup;
|
||||
UINT32 gpdcon;
|
||||
UINT32 gpddat;
|
||||
UINT32 gpdup;
|
||||
UINT32 gpecon;
|
||||
UINT32 gpedat;
|
||||
UINT32 gpeup;
|
||||
UINT32 gpfcon;
|
||||
UINT32 gpfdat;
|
||||
UINT32 gpfup;
|
||||
UINT32 gpgcon;
|
||||
UINT32 gpgdat;
|
||||
UINT32 gpgup;
|
||||
UINT32 opencr;
|
||||
UINT32 misccr;
|
||||
UINT32 extint;
|
||||
};
|
||||
|
||||
struct s3c24xx_rtc_regs_t
|
||||
{
|
||||
UINT32 rtccon;
|
||||
UINT32 ticnt;
|
||||
UINT32 reserved[2];
|
||||
UINT32 rtcalm;
|
||||
UINT32 almsec;
|
||||
UINT32 almmin;
|
||||
UINT32 almhour;
|
||||
UINT32 almday;
|
||||
UINT32 almmon;
|
||||
UINT32 almyear;
|
||||
UINT32 rtcrst;
|
||||
UINT32 bcdsec;
|
||||
UINT32 bcdmin;
|
||||
UINT32 bcdhour;
|
||||
UINT32 bcdday;
|
||||
UINT32 bcddow;
|
||||
UINT32 bcdmon;
|
||||
UINT32 bcdyear;
|
||||
};
|
||||
|
||||
struct s3c24xx_adc_regs_t
|
||||
{
|
||||
UINT32 adccon;
|
||||
UINT32 adcdat;
|
||||
};
|
||||
|
||||
struct s3c24xx_spi_regs_t
|
||||
{
|
||||
UINT32 spcon;
|
||||
UINT32 spsta;
|
||||
UINT32 sppin;
|
||||
UINT32 sppre;
|
||||
UINT32 sptdat;
|
||||
UINT32 sprdat;
|
||||
};
|
||||
|
||||
struct s3c24xx_mmc_regs_t
|
||||
{
|
||||
UINT32 data[0x40/4];
|
||||
};
|
||||
|
||||
struct s3c24xx_memcon_t
|
||||
{
|
||||
s3c24xx_memcon_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_usbhost_t
|
||||
{
|
||||
s3c24xx_usbhost_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_irq_t
|
||||
{
|
||||
s3c24xx_irq_regs_t regs;
|
||||
int line_irq, line_fiq;
|
||||
};
|
||||
|
||||
struct s3c24xx_dma_t
|
||||
{
|
||||
s3c24xx_dma_regs_t regs;
|
||||
emu_timer *timer;
|
||||
};
|
||||
|
||||
struct s3c24xx_clkpow_t
|
||||
{
|
||||
s3c24xx_clkpow_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcd_t
|
||||
{
|
||||
s3c24xx_lcd_regs_t regs;
|
||||
emu_timer *timer;
|
||||
bitmap_rgb32 *bitmap[2];
|
||||
UINT32 vramaddr_cur;
|
||||
UINT32 vramaddr_max;
|
||||
UINT32 offsize;
|
||||
UINT32 pagewidth_cur;
|
||||
UINT32 pagewidth_max;
|
||||
UINT32 bppmode;
|
||||
UINT32 bswp, hwswp;
|
||||
int vpos, hpos;
|
||||
double framerate;
|
||||
UINT32 tpal;
|
||||
UINT32 hpos_min, hpos_max, vpos_min, vpos_max;
|
||||
UINT32 dma_data, dma_bits;
|
||||
};
|
||||
|
||||
struct s3c24xx_lcdpal_t
|
||||
{
|
||||
s3c24xx_lcdpal_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_uart_t
|
||||
{
|
||||
s3c24xx_uart_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_pwm_t
|
||||
{
|
||||
s3c24xx_pwm_regs_t regs;
|
||||
emu_timer *timer[5];
|
||||
UINT32 cnt[5];
|
||||
UINT32 cmp[5];
|
||||
UINT32 freq[5];
|
||||
};
|
||||
|
||||
struct s3c24xx_usbdev_t
|
||||
{
|
||||
s3c24xx_usbdev_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_wdt_t
|
||||
{
|
||||
s3c24xx_wdt_regs_t regs;
|
||||
emu_timer *timer;
|
||||
};
|
||||
|
||||
struct s3c24xx_iic_t
|
||||
{
|
||||
s3c24xx_iic_regs_t regs;
|
||||
emu_timer *timer;
|
||||
int count;
|
||||
};
|
||||
|
||||
struct s3c24xx_iis_t
|
||||
{
|
||||
s3c24xx_iis_regs_t regs;
|
||||
emu_timer *timer;
|
||||
UINT16 fifo[16/2];
|
||||
int fifo_index;
|
||||
};
|
||||
|
||||
struct s3c24xx_gpio_t
|
||||
{
|
||||
s3c24xx_gpio_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_rtc_t
|
||||
{
|
||||
s3c24xx_rtc_regs_t regs;
|
||||
emu_timer *timer_tick_count;
|
||||
emu_timer *timer_update;
|
||||
};
|
||||
|
||||
struct s3c24xx_adc_t
|
||||
{
|
||||
s3c24xx_adc_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_spi_t
|
||||
{
|
||||
s3c24xx_spi_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_mmc_t
|
||||
{
|
||||
s3c24xx_mmc_regs_t regs;
|
||||
};
|
||||
|
||||
struct s3c24xx_t
|
||||
{
|
||||
const s3c2400_interface *iface;
|
||||
s3c24xx_memcon_t memcon;
|
||||
s3c24xx_usbhost_t usbhost;
|
||||
s3c24xx_irq_t irq;
|
||||
s3c24xx_dma_t dma[S3C24XX_DMA_COUNT];
|
||||
s3c24xx_clkpow_t clkpow;
|
||||
s3c24xx_lcd_t lcd;
|
||||
s3c24xx_lcdpal_t lcdpal;
|
||||
s3c24xx_uart_t uart[S3C24XX_UART_COUNT];
|
||||
s3c24xx_pwm_t pwm;
|
||||
s3c24xx_usbdev_t usbdev;
|
||||
s3c24xx_wdt_t wdt;
|
||||
s3c24xx_iic_t iic;
|
||||
s3c24xx_iis_t iis;
|
||||
s3c24xx_gpio_t gpio;
|
||||
s3c24xx_rtc_t rtc;
|
||||
s3c24xx_adc_t adc;
|
||||
s3c24xx_spi_t spi[S3C24XX_SPI_COUNT];
|
||||
s3c24xx_mmc_t mmc;
|
||||
device_t *m_cpu;
|
||||
devcb_resolved_read32 pin_r;
|
||||
devcb_resolved_write32 pin_w;
|
||||
devcb_resolved_read32 port_r;
|
||||
devcb_resolved_write32 port_w;
|
||||
devcb_resolved_write_line scl_w;
|
||||
devcb_resolved_read_line sda_r;
|
||||
devcb_resolved_write_line sda_w;
|
||||
devcb_resolved_read32 adc_data_r;
|
||||
devcb_resolved_write16 i2s_data_w;
|
||||
devcb_resolved_write8 command_w;
|
||||
devcb_resolved_write8 address_w;
|
||||
devcb_resolved_read8 nand_data_r;
|
||||
devcb_resolved_write8 nand_data_w;
|
||||
palette_device *m_palette;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "cpu/arm7/arm7core.h"
|
||||
#include "machine/s3c2410.h"
|
||||
#include "sound/dac.h"
|
||||
#include "devlegcy.h"
|
||||
|
||||
#define VERBOSE_LEVEL ( 0 )
|
||||
|
||||
@ -29,59 +28,46 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level,
|
||||
}
|
||||
|
||||
#define DEVICE_S3C2410
|
||||
#define S3C24_CLASS_NAME s3c2410_device
|
||||
#include "machine/s3c24xx.inc"
|
||||
#undef DEVICE_S3C2410
|
||||
|
||||
UINT32 s3c2410_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return s3c24xx_video_update( this, screen, bitmap, cliprect);
|
||||
}
|
||||
|
||||
DEVICE_START( s3c2410 )
|
||||
{
|
||||
address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
|
||||
DEVICE_START_CALL(s3c24xx);
|
||||
space.install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b000000, 0x4b000023, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b000040, 0x4b000063, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b000080, 0x4b0000a3, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b0000c0, 0x4b0000e3, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4c000000, 0x4c000017, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4d000000, 0x4d000063, FUNC(s3c2410_lcd_r), FUNC(s3c24xx_lcd_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4d000400, 0x4d0007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4e000000, 0x4e000017, FUNC(s3c24xx_nand_r), FUNC(s3c24xx_nand_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x50000000, 0x5000002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x50004000, 0x5000402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x50008000, 0x5000802b, FUNC(s3c24xx_uart_2_r), FUNC(s3c24xx_uart_2_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x51000000, 0x51000043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x52000140, 0x5200026f, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x53000000, 0x5300000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x54000000, 0x5400000f, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x55000000, 0x55000013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x56000000, 0x560000bf, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x57000040, 0x5700008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x58000000, 0x58000013, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
|
||||
|
||||
s3c24xx_video_start( device, device->machine());
|
||||
return s3c24xx_video_update(screen, bitmap, cliprect);
|
||||
}
|
||||
|
||||
const device_type S3C2410 = &device_creator<s3c2410_device>;
|
||||
|
||||
s3c2410_device::s3c2410_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, S3C2410, "Samsung S3C2410", tag, owner, clock, "s3c2410", __FILE__),
|
||||
m_palette(*this)
|
||||
m_palette(*this),
|
||||
m_cpu(*this, ":maincpu")
|
||||
{
|
||||
m_token = global_alloc_clear(s3c24xx_t);
|
||||
memset(m_steppingstone, 0, sizeof(m_steppingstone));
|
||||
memset(&m_memcon, 0, sizeof(m_memcon));
|
||||
memset(&m_usbhost, 0, sizeof(m_usbhost));
|
||||
memset(&m_irq, 0, sizeof(m_irq));
|
||||
memset(m_dma, 0, sizeof(m_dma));
|
||||
memset(&m_clkpow, 0, sizeof(m_clkpow));
|
||||
memset(&m_lcd, 0, sizeof(m_lcd));
|
||||
memset(&m_lcdpal, 0, sizeof(m_lcdpal));
|
||||
memset(&m_nand, 0, sizeof(m_nand));
|
||||
memset(m_uart, 0, sizeof(m_uart));
|
||||
memset(&m_pwm, 0, sizeof(m_pwm));
|
||||
memset(&m_usbdev, 0, sizeof(m_usbdev));
|
||||
memset(&m_wdt, 0, sizeof(m_wdt));
|
||||
memset(&m_iic, 0, sizeof(m_iic));
|
||||
memset(&m_iis, 0, sizeof(m_iis));
|
||||
memset(&m_gpio, 0, sizeof(m_gpio));
|
||||
memset(&m_rtc, 0, sizeof(m_rtc));
|
||||
memset(&m_adc, 0, sizeof(m_adc));
|
||||
memset(m_spi, 0, sizeof(m_spi));
|
||||
memset(&m_sdi, 0, sizeof(m_sdi));
|
||||
}
|
||||
|
||||
s3c2410_device::~s3c2410_device()
|
||||
{
|
||||
global_free(m_token);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -102,6 +88,10 @@ void s3c2410_device::static_set_palette_tag(device_t &device, const char *tag)
|
||||
|
||||
void s3c2410_device::device_config_complete()
|
||||
{
|
||||
// inherit a copy of the static data
|
||||
const s3c2410_interface *intf = reinterpret_cast<const s3c2410_interface *>(static_config());
|
||||
if (intf != NULL)
|
||||
*static_cast<s3c2410_interface *>(this) = *intf;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -110,9 +100,36 @@ void s3c2410_device::device_config_complete()
|
||||
|
||||
void s3c2410_device::device_start()
|
||||
{
|
||||
s3c24xx_t *s3c24xx = get_token(this);
|
||||
s3c24xx->m_palette = m_palette;
|
||||
DEVICE_START_NAME( s3c2410 )(this);
|
||||
s3c24xx_device_start();
|
||||
|
||||
address_space &space = m_cpu->memory().space( AS_PROGRAM);
|
||||
space.install_readwrite_handler( 0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2410_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_memcon_w), this));
|
||||
space.install_readwrite_handler( 0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2410_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_usb_host_w), this));
|
||||
space.install_readwrite_handler( 0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2410_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_irq_w), this));
|
||||
space.install_readwrite_handler( 0x4b000000, 0x4b000023, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_0_w), this));
|
||||
space.install_readwrite_handler( 0x4b000040, 0x4b000063, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_1_w), this));
|
||||
space.install_readwrite_handler( 0x4b000080, 0x4b0000a3, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_2_w), this));
|
||||
space.install_readwrite_handler( 0x4b0000c0, 0x4b0000e3, read32_delegate(FUNC(s3c2410_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_dma_3_w), this));
|
||||
space.install_readwrite_handler( 0x4c000000, 0x4c000017, read32_delegate(FUNC(s3c2410_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_clkpow_w), this));
|
||||
space.install_readwrite_handler( 0x4d000000, 0x4d000063, read32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_w), this));
|
||||
space.install_readwrite_handler( 0x4d000400, 0x4d0007ff, read32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_lcd_palette_w), this));
|
||||
space.install_readwrite_handler( 0x4e000000, 0x4e000017, read32_delegate(FUNC(s3c2410_device::s3c24xx_nand_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_nand_w), this));
|
||||
space.install_readwrite_handler( 0x50000000, 0x5000002b, read32_delegate(FUNC(s3c2410_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_uart_0_w), this));
|
||||
space.install_readwrite_handler( 0x50004000, 0x5000402b, read32_delegate(FUNC(s3c2410_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_uart_1_w), this));
|
||||
space.install_readwrite_handler( 0x50008000, 0x5000802b, read32_delegate(FUNC(s3c2410_device::s3c24xx_uart_2_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_uart_2_w), this));
|
||||
space.install_readwrite_handler( 0x51000000, 0x51000043, read32_delegate(FUNC(s3c2410_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_pwm_w), this));
|
||||
space.install_readwrite_handler( 0x52000140, 0x5200026f, read32_delegate(FUNC(s3c2410_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_usb_device_w), this));
|
||||
space.install_readwrite_handler( 0x53000000, 0x5300000b, read32_delegate(FUNC(s3c2410_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_wdt_w), this));
|
||||
space.install_readwrite_handler( 0x54000000, 0x5400000f, read32_delegate(FUNC(s3c2410_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_iic_w), this));
|
||||
space.install_readwrite_handler( 0x55000000, 0x55000013, read32_delegate(FUNC(s3c2410_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_iis_w), this));
|
||||
space.install_readwrite_handler( 0x56000000, 0x560000bf, read32_delegate(FUNC(s3c2410_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_gpio_w), this));
|
||||
space.install_readwrite_handler( 0x57000040, 0x5700008b, read32_delegate(FUNC(s3c2410_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_rtc_w), this));
|
||||
space.install_readwrite_handler( 0x58000000, 0x58000013, read32_delegate(FUNC(s3c2410_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_adc_w), this));
|
||||
space.install_readwrite_handler( 0x59000000, 0x59000017, read32_delegate(FUNC(s3c2410_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_spi_0_w), this));
|
||||
space.install_readwrite_handler( 0x59000020, 0x59000037, read32_delegate(FUNC(s3c2410_device::s3c24xx_spi_1_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_spi_1_w), this));
|
||||
space.install_readwrite_handler( 0x5a000000, 0x5a000043, read32_delegate(FUNC(s3c2410_device::s3c24xx_sdi_r), this), write32_delegate(FUNC(s3c2410_device::s3c24xx_sdi_w), this));
|
||||
|
||||
s3c24xx_video_start();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -121,31 +138,31 @@ void s3c2410_device::device_start()
|
||||
|
||||
void s3c2410_device::device_reset()
|
||||
{
|
||||
DEVICE_RESET_NAME( s3c24xx )(this);
|
||||
s3c24xx_device_reset();
|
||||
}
|
||||
|
||||
void s3c2410_uart_fifo_w( device_t *device, int uart, UINT8 data)
|
||||
void s3c2410_device::s3c2410_uart_fifo_w( int uart, UINT8 data)
|
||||
{
|
||||
s3c24xx_uart_fifo_w( device, uart, data);
|
||||
s3c24xx_uart_fifo_w( uart, data);
|
||||
}
|
||||
|
||||
void s3c2410_touch_screen( device_t *device, int state)
|
||||
void s3c2410_device::s3c2410_touch_screen( int state)
|
||||
{
|
||||
s3c24xx_touch_screen( device, state);
|
||||
s3c24xx_touch_screen(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( s3c2410_device::frnb_w )
|
||||
{
|
||||
s3c24xx_pin_frnb_w(this, state);
|
||||
s3c24xx_pin_frnb_w(state);
|
||||
}
|
||||
|
||||
void s3c2410_nand_calculate_mecc( UINT8 *data, UINT32 size, UINT8 *mecc)
|
||||
void s3c2410_device::s3c2410_nand_calculate_mecc( UINT8 *data, UINT32 size, UINT8 *mecc)
|
||||
{
|
||||
mecc[0] = mecc[1] = mecc[2] = mecc[3] = 0xFF;
|
||||
for (int i = 0; i < size; i++) nand_update_mecc( mecc, i, data[i]);
|
||||
}
|
||||
|
||||
void s3c2410_request_eint( device_t *device, UINT32 number)
|
||||
void s3c2410_device::s3c2410_request_eint(UINT32 number)
|
||||
{
|
||||
s3c24xx_request_eint( device, number);
|
||||
s3c24xx_request_eint(number);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,6 @@
|
||||
#include "cpu/arm7/arm7core.h"
|
||||
#include "machine/s3c2440.h"
|
||||
#include "sound/dac.h"
|
||||
#include "devlegcy.h"
|
||||
|
||||
#define VERBOSE_LEVEL ( 0 )
|
||||
|
||||
@ -29,61 +28,48 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level,
|
||||
}
|
||||
|
||||
#define DEVICE_S3C2440
|
||||
#define S3C24_CLASS_NAME s3c2440_device
|
||||
#include "machine/s3c24xx.inc"
|
||||
#undef DEVICE_S3C2440
|
||||
|
||||
UINT32 s3c2440_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
return s3c24xx_video_update( this, screen, bitmap, cliprect);
|
||||
}
|
||||
|
||||
DEVICE_START( s3c2440 )
|
||||
{
|
||||
address_space &space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
|
||||
space.install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b000000, 0x4b000023, FUNC(s3c24xx_dma_0_r), FUNC(s3c24xx_dma_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b000040, 0x4b000063, FUNC(s3c24xx_dma_1_r), FUNC(s3c24xx_dma_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b000080, 0x4b0000a3, FUNC(s3c24xx_dma_2_r), FUNC(s3c24xx_dma_2_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4b0000c0, 0x4b0000e3, FUNC(s3c24xx_dma_3_r), FUNC(s3c24xx_dma_3_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4c000000, 0x4c00001b, FUNC(s3c24xx_clkpow_r), FUNC(s3c24xx_clkpow_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4d000000, 0x4d000063, FUNC(s3c2440_lcd_r), FUNC(s3c24xx_lcd_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4d000400, 0x4d0007ff, FUNC(s3c24xx_lcd_palette_r), FUNC(s3c24xx_lcd_palette_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4e000000, 0x4e00003f, FUNC(s3c24xx_nand_r), FUNC(s3c24xx_nand_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x4f000000, 0x4f0000a3, FUNC(s3c24xx_cam_r), FUNC(s3c24xx_cam_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x50000000, 0x5000002b, FUNC(s3c24xx_uart_0_r), FUNC(s3c24xx_uart_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x50004000, 0x5000402b, FUNC(s3c24xx_uart_1_r), FUNC(s3c24xx_uart_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x50008000, 0x5000802b, FUNC(s3c24xx_uart_2_r), FUNC(s3c24xx_uart_2_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x51000000, 0x51000043, FUNC(s3c24xx_pwm_r), FUNC(s3c24xx_pwm_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x52000140, 0x5200026f, FUNC(s3c24xx_usb_device_r), FUNC(s3c24xx_usb_device_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x53000000, 0x5300000b, FUNC(s3c24xx_wdt_r), FUNC(s3c24xx_wdt_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x54000000, 0x54000013, FUNC(s3c24xx_iic_r), FUNC(s3c24xx_iic_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x55000000, 0x55000013, FUNC(s3c24xx_iis_r), FUNC(s3c24xx_iis_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x56000000, 0x560000df, FUNC(s3c24xx_gpio_r), FUNC(s3c24xx_gpio_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x57000040, 0x5700008b, FUNC(s3c24xx_rtc_r), FUNC(s3c24xx_rtc_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x58000000, 0x58000017, FUNC(s3c24xx_adc_r), FUNC(s3c24xx_adc_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x59000000, 0x59000017, FUNC(s3c24xx_spi_0_r), FUNC(s3c24xx_spi_0_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x59000020, 0x59000037, FUNC(s3c24xx_spi_1_r), FUNC(s3c24xx_spi_1_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x5a000000, 0x5a000043, FUNC(s3c24xx_sdi_r), FUNC(s3c24xx_sdi_w));
|
||||
space.install_legacy_readwrite_handler( *device, 0x5b000000, 0x5b00001f, FUNC(s3c24xx_ac97_r), FUNC(s3c24xx_ac97_w));
|
||||
DEVICE_START_CALL(s3c24xx);
|
||||
|
||||
s3c24xx_video_start( device, device->machine());
|
||||
return s3c24xx_video_update( screen, bitmap, cliprect);
|
||||
}
|
||||
|
||||
const device_type S3C2440 = &device_creator<s3c2440_device>;
|
||||
|
||||
s3c2440_device::s3c2440_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, S3C2440, "Samsung S3C2440", tag, owner, clock, "s3c2440", __FILE__),
|
||||
m_palette(*this)
|
||||
m_palette(*this),
|
||||
m_cpu(*this, ":maincpu")
|
||||
{
|
||||
m_token = global_alloc_clear(s3c24xx_t);
|
||||
memset(m_steppingstone, 0, sizeof(m_steppingstone));
|
||||
memset(&m_memcon, 0, sizeof(m_memcon));
|
||||
memset(&m_usbhost, 0, sizeof(m_usbhost));
|
||||
memset(&m_irq, 0, sizeof(m_irq));
|
||||
memset(m_dma, 0, sizeof(m_dma));
|
||||
memset(&m_clkpow, 0, sizeof(m_clkpow));
|
||||
memset(&m_lcd, 0, sizeof(m_lcd));
|
||||
memset(&m_lcdpal, 0, sizeof(m_lcdpal));
|
||||
memset(&m_nand, 0, sizeof(m_nand));
|
||||
memset(&m_cam, 0, sizeof(m_cam));
|
||||
memset(m_uart, 0, sizeof(m_uart));
|
||||
memset(&m_pwm, 0, sizeof(m_pwm));
|
||||
memset(&m_usbdev, 0, sizeof(m_usbdev));
|
||||
memset(&m_wdt, 0, sizeof(m_wdt));
|
||||
memset(&m_iic, 0, sizeof(m_iic));
|
||||
memset(&m_iis, 0, sizeof(m_iis));
|
||||
memset(&m_gpio, 0, sizeof(m_gpio));
|
||||
memset(&m_rtc, 0, sizeof(m_rtc));
|
||||
memset(&m_adc, 0, sizeof(m_adc));
|
||||
memset(m_spi, 0, sizeof(m_spi));
|
||||
memset(&m_sdi, 0, sizeof(m_sdi));
|
||||
memset(&m_ac97, 0, sizeof(m_ac97));
|
||||
}
|
||||
|
||||
s3c2440_device::~s3c2440_device()
|
||||
{
|
||||
global_free(m_token);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -105,6 +91,10 @@ void s3c2440_device::static_set_palette_tag(device_t &device, const char *tag)
|
||||
|
||||
void s3c2440_device::device_config_complete()
|
||||
{
|
||||
// inherit a copy of the static data
|
||||
const s3c2440_interface *intf = reinterpret_cast<const s3c2440_interface *>(static_config());
|
||||
if (intf != NULL)
|
||||
*static_cast<s3c2440_interface *>(this) = *intf;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -113,9 +103,38 @@ void s3c2440_device::device_config_complete()
|
||||
|
||||
void s3c2440_device::device_start()
|
||||
{
|
||||
s3c24xx_t *s3c24xx = get_token(this);
|
||||
s3c24xx->m_palette = m_palette;
|
||||
DEVICE_START_NAME( s3c2440 )(this);
|
||||
address_space &space = m_cpu->memory().space( AS_PROGRAM);
|
||||
space.install_readwrite_handler(0x48000000, 0x4800003b, read32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_memcon_w), this));
|
||||
space.install_readwrite_handler(0x49000000, 0x4900005b, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_host_w), this));
|
||||
space.install_readwrite_handler(0x4a000000, 0x4a00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_irq_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_irq_w), this));
|
||||
space.install_readwrite_handler(0x4b000000, 0x4b000023, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_0_w), this));
|
||||
space.install_readwrite_handler(0x4b000040, 0x4b000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_1_w), this));
|
||||
space.install_readwrite_handler(0x4b000080, 0x4b0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_2_w), this));
|
||||
space.install_readwrite_handler(0x4b0000c0, 0x4b0000e3, read32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_dma_3_w), this));
|
||||
space.install_readwrite_handler(0x4c000000, 0x4c00001b, read32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_clkpow_w), this));
|
||||
space.install_readwrite_handler(0x4d000000, 0x4d000063, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_w), this));
|
||||
space.install_readwrite_handler(0x4d000400, 0x4d0007ff, read32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_lcd_palette_w), this));
|
||||
space.install_readwrite_handler(0x4e000000, 0x4e00003f, read32_delegate(FUNC(s3c2440_device::s3c24xx_nand_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_nand_w), this));
|
||||
space.install_readwrite_handler(0x4f000000, 0x4f0000a3, read32_delegate(FUNC(s3c2440_device::s3c24xx_cam_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_cam_w), this));
|
||||
space.install_readwrite_handler(0x50000000, 0x5000002b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_0_w), this));
|
||||
space.install_readwrite_handler(0x50004000, 0x5000402b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_1_w), this));
|
||||
space.install_readwrite_handler(0x50008000, 0x5000802b, read32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_uart_2_w), this));
|
||||
space.install_readwrite_handler(0x51000000, 0x51000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_pwm_w), this));
|
||||
space.install_readwrite_handler(0x52000140, 0x5200026f, read32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_usb_device_w), this));
|
||||
space.install_readwrite_handler(0x53000000, 0x5300000b, read32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_wdt_w), this));
|
||||
space.install_readwrite_handler(0x54000000, 0x54000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iic_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iic_w), this));
|
||||
space.install_readwrite_handler(0x55000000, 0x55000013, read32_delegate(FUNC(s3c2440_device::s3c24xx_iis_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_iis_w), this));
|
||||
space.install_readwrite_handler(0x56000000, 0x560000df, read32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_gpio_w), this));
|
||||
space.install_readwrite_handler(0x57000040, 0x5700008b, read32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_rtc_w), this));
|
||||
space.install_readwrite_handler(0x58000000, 0x58000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_adc_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_adc_w), this));
|
||||
space.install_readwrite_handler(0x59000000, 0x59000017, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_0_w), this));
|
||||
space.install_readwrite_handler(0x59000020, 0x59000037, read32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_spi_1_w), this));
|
||||
space.install_readwrite_handler(0x5a000000, 0x5a000043, read32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_sdi_w), this));
|
||||
space.install_readwrite_handler(0x5b000000, 0x5b00001f, read32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_r), this), write32_delegate(FUNC(s3c2440_device::s3c24xx_ac97_w), this));
|
||||
|
||||
s3c24xx_device_start();
|
||||
|
||||
s3c24xx_video_start();
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -124,31 +143,31 @@ void s3c2440_device::device_start()
|
||||
|
||||
void s3c2440_device::device_reset()
|
||||
{
|
||||
DEVICE_RESET_NAME( s3c24xx )(this);
|
||||
s3c24xx_device_reset();
|
||||
}
|
||||
|
||||
|
||||
void s3c2440_uart_fifo_w( device_t *device, int uart, UINT8 data)
|
||||
void s3c2440_device::s3c2440_uart_fifo_w(int uart, UINT8 data)
|
||||
{
|
||||
s3c24xx_uart_fifo_w( device, uart, data);
|
||||
s3c24xx_uart_fifo_w( uart, data);
|
||||
}
|
||||
|
||||
void s3c2440_touch_screen( device_t *device, int state)
|
||||
void s3c2440_device::s3c2440_touch_screen(int state)
|
||||
{
|
||||
s3c24xx_touch_screen( device, state);
|
||||
s3c24xx_touch_screen( state);
|
||||
}
|
||||
|
||||
void s3c2440_request_irq( device_t *device, UINT32 int_type)
|
||||
void s3c2440_device::s3c2440_request_irq(UINT32 int_type)
|
||||
{
|
||||
s3c24xx_request_irq( device, int_type);
|
||||
s3c24xx_request_irq( int_type);
|
||||
}
|
||||
|
||||
void s3c2440_request_eint( device_t *device, UINT32 number)
|
||||
void s3c2440_device::s3c2440_request_eint(UINT32 number)
|
||||
{
|
||||
s3c24xx_request_eint( device, number);
|
||||
s3c24xx_request_eint( number);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( s3c2440_device::frnb_w )
|
||||
{
|
||||
s3c24xx_pin_frnb_w(this, state);
|
||||
s3c24xx_pin_frnb_w(state);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -344,7 +344,7 @@ READ8_MEMBER(ghosteo_state::s3c2410_nand_data_r )
|
||||
if ((nand.byte_addr >= 0x200) && (nand.byte_addr < 0x204))
|
||||
{
|
||||
UINT8 mecc[4];
|
||||
s3c2410_nand_calculate_mecc( m_flash + nand.page_addr * 0x200, 0x200, mecc);
|
||||
m_s3c2410->s3c2410_nand_calculate_mecc( m_flash + nand.page_addr * 0x200, 0x200, mecc);
|
||||
data = mecc[nand.byte_addr-0x200];
|
||||
}
|
||||
else
|
||||
@ -579,7 +579,7 @@ static const s3c2410_interface bballoon_s3c2410_intf =
|
||||
|
||||
READ32_MEMBER(ghosteo_state::bballoon_speedup_r)
|
||||
{
|
||||
UINT32 ret = s3c2410_lcd_r(m_s3c2410, space, offset+0x10/4, mem_mask);
|
||||
UINT32 ret = m_s3c2410->s3c24xx_lcd_r(space, offset+0x10/4, mem_mask);
|
||||
|
||||
|
||||
int pc = space.device().safe_pc();
|
||||
|
@ -45,12 +45,13 @@ class gizmondo_state : public driver_device
|
||||
public:
|
||||
gizmondo_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag) ,
|
||||
m_s3c2440(*this, "s3c2440"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gf4500(*this, "gf4500")
|
||||
{ }
|
||||
|
||||
UINT32 m_port[9];
|
||||
device_t *m_s3c2440;
|
||||
required_device<s3c2440_device> m_s3c2440;
|
||||
DECLARE_DRIVER_INIT(gizmondo);
|
||||
virtual void machine_start();
|
||||
virtual void machine_reset();
|
||||
@ -129,8 +130,8 @@ WRITE32_MEMBER(gizmondo_state::s3c2440_gpio_port_w)
|
||||
|
||||
INPUT_CHANGED_MEMBER(gizmondo_state::port_changed)
|
||||
{
|
||||
s3c2440_request_eint( m_s3c2440, 4);
|
||||
//s3c2440_request_irq( device, S3C2440_INT_EINT1);
|
||||
m_s3c2440->s3c2440_request_eint( 4);
|
||||
//m_s3c2440->s3c2440_request_irq( S3C2440_INT_EINT1);
|
||||
}
|
||||
|
||||
#if 0
|
||||
@ -147,7 +148,6 @@ QUICKLOAD_LOAD_MEMBER( gizmondo_state, gizmondo )
|
||||
|
||||
void gizmondo_state::machine_start()
|
||||
{
|
||||
m_s3c2440 = machine().device( "s3c2440");
|
||||
m_port[S3C2440_GPIO_PORT_B] = 0x055E;
|
||||
m_port[S3C2440_GPIO_PORT_C] = 0x5F20;
|
||||
m_port[S3C2440_GPIO_PORT_D] = 0x4F60;
|
||||
|
@ -24,11 +24,12 @@ class hp49gp_state : public driver_device
|
||||
public:
|
||||
hp49gp_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_s3c2410(*this, "s3c2410"),
|
||||
m_steppingstone(*this, "steppingstone"),
|
||||
m_maincpu(*this, "maincpu") { }
|
||||
|
||||
UINT32 m_port[9];
|
||||
device_t *m_s3c2410;
|
||||
required_device<s3c2410_device> m_s3c2410;
|
||||
required_shared_ptr<UINT32> m_steppingstone;
|
||||
lcd_spi_t m_lcd_spi;
|
||||
DECLARE_DRIVER_INIT(hp49gp);
|
||||
@ -238,14 +239,13 @@ WRITE32_MEMBER(hp49gp_state::s3c2410_gpio_port_w)
|
||||
|
||||
INPUT_CHANGED_MEMBER(hp49gp_state::port_changed)
|
||||
{
|
||||
s3c2410_request_eint( m_s3c2410, (FPTR)param + 8);
|
||||
m_s3c2410->s3c2410_request_eint( (FPTR)param + 8);
|
||||
}
|
||||
|
||||
// ...
|
||||
|
||||
void hp49gp_state::machine_start()
|
||||
{
|
||||
m_s3c2410 = machine().device( "s3c2410");
|
||||
}
|
||||
|
||||
void hp49gp_state::machine_reset()
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
m_peny(*this, "PENY") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<device_t> m_s3c2440;
|
||||
required_device<s3c2440_device> m_s3c2440;
|
||||
required_device<nand_device> m_nand;
|
||||
required_device<dac_device> m_dac1;
|
||||
required_device<dac_device> m_dac2;
|
||||
@ -175,7 +175,7 @@ READ32_MEMBER(mini2440_state::s3c2440_adc_data_r )
|
||||
|
||||
INPUT_CHANGED_MEMBER(mini2440_state::mini2440_input_changed)
|
||||
{
|
||||
s3c2440_touch_screen( m_s3c2440, (newval & 0x01) ? 1 : 0);
|
||||
m_s3c2440->s3c2440_touch_screen( (newval & 0x01) ? 1 : 0);
|
||||
}
|
||||
|
||||
// ...
|
||||
|
@ -76,12 +76,13 @@ class palmz22_state : public driver_device
|
||||
public:
|
||||
palmz22_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu")
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_s3c2410(*this, "s3c2410")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
||||
device_t *m_s3c2410;
|
||||
required_device<s3c2410_device> m_s3c2410;
|
||||
nand_device *m_nand;
|
||||
|
||||
UINT32 m_port[8];
|
||||
@ -236,11 +237,11 @@ INPUT_CHANGED_MEMBER(palmz22_state::palmz22_input_changed)
|
||||
{
|
||||
if (param == 0)
|
||||
{
|
||||
s3c2410_touch_screen( m_s3c2410, (newval & 0x01) ? 1 : 0);
|
||||
m_s3c2410->s3c2410_touch_screen( (newval & 0x01) ? 1 : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
s3c2410_request_eint( m_s3c2410, (FPTR)param - 1);
|
||||
m_s3c2410->s3c2410_request_eint( (FPTR)param - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,7 +249,6 @@ INPUT_CHANGED_MEMBER(palmz22_state::palmz22_input_changed)
|
||||
|
||||
void palmz22_state::machine_start()
|
||||
{
|
||||
m_s3c2410 = machine().device( "s3c2410");
|
||||
m_nand = machine().device<nand_device>("nand");
|
||||
m_nand->set_data_ptr( memregion("nand")->base());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user