summaryrefslogblamecommitdiffstatshomepage
path: root/src/mame/includes/pc1401.h
blob: 11f66eb34b2966f2fec7b3302a6dedab4c5d1754 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                  







                                                                              

                              
 
                    
                                
                          
                   
 
                                                

 
                                         

       




                              
                                                                                      
                                                    
                                            

                                                
 


                        
                    
                             
                           
                                                                                                              








                                                
 
                                              
                                                  
                                                      
                                                  

                                            

                                          
          
                                                                                                       

  
                                
// license:GPL-2.0+
// copyright-holders:Peter Trauner
/*****************************************************************************
 *
 * includes/pc1401.h
 *
 * Pocket Computer 1401
 *
 ****************************************************************************/

#ifndef MAME_INCLUDES_PC1401_H
#define MAME_INCLUDES_PC1401_H

#include "pocketc.h"
#include "cpu/sc61860/sc61860.h"
#include "machine/nvram.h"
#include "emupal.h"

#define CONTRAST (ioport("DSW0")->read() & 0x07)


class pc1401_state : public pocketc_state
{
public:
	enum
	{
		TIMER_POWER_UP
	};

	pc1401_state(const machine_config &mconfig, device_type type, const char *tag)
		: pocketc_state(mconfig, type, tag),
		m_maincpu(*this, "maincpu"),
		m_gfxdecode(*this, "gfxdecode"),
		m_palette(*this, "palette")  { }

	uint8_t m_portc;
	uint8_t m_outa;
	uint8_t m_outb;
	int m_power;
	uint8_t m_reg[0x100];
	void init_pc1401();
	uint32_t screen_update_pc1401(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
	DECLARE_READ_LINE_MEMBER(pc1401_reset);
	DECLARE_READ_LINE_MEMBER(pc1401_brk);
	DECLARE_WRITE8_MEMBER(pc1401_outa);
	DECLARE_WRITE8_MEMBER(pc1401_outb);
	DECLARE_WRITE8_MEMBER(pc1401_outc);
	DECLARE_READ8_MEMBER(pc1401_ina);
	DECLARE_READ8_MEMBER(pc1401_inb);
	DECLARE_READ8_MEMBER(pc1401_lcd_read);
	DECLARE_WRITE8_MEMBER(pc1401_lcd_write);

	virtual void machine_start() override;
	required_device<sc61860_device> m_maincpu;
	required_device<gfxdecode_device> m_gfxdecode;
	required_device<palette_device> m_palette;
	void pc1401(machine_config &config);
	void pc1402(machine_config &config);
	void pc1401_mem(address_map &map);
	void pc1402_mem(address_map &map);
protected:
	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
};

#endif // MAME_INCLUDES_PC1401_H