Previous 15994 Revisions Next

r15582 Thursday 12th July, 2012 at 21:13:20 UTC by Sandro Ronco
geniusiq: documented a bit the memory map and added preliminary video. (nw)
[src/mess/drivers]geniusiq.c

src/mess/drivers/geniusiq.c
r15581r15582
2727 
2828#include "emu.h"
2929#include "cpu/m68000/m68000.h"
30#include "machine/intelfsh.h"
3031 
3132#define MACHINE_RESET_MEMBER(name) void name::machine_reset()
3233 
r15581r15582
3536public:
3637   geniusiq_state(const machine_config &mconfig, device_type type, const char *tag)
3738      : driver_device(mconfig, type, tag),
38   m_maincpu(*this, "maincpu")
39      m_maincpu(*this, "maincpu"),
40      m_flash(*this, "flash"),
41      m_vram(*this, "vram")
3942   { }
4043 
4144   required_device<cpu_device> m_maincpu;
45   required_device<intelfsh8_device> m_flash;
46   required_shared_ptr<UINT16>   m_vram;
4247   virtual void machine_reset();
48   virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
49   DECLARE_READ8_MEMBER(flash_r);
50   DECLARE_WRITE8_MEMBER(flash_w);
51 
52   DECLARE_READ16_MEMBER(unk_r) { return machine().rand(); }
4353};
4454 
55 
56UINT32 geniusiq_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
57{
58   for (int y=0; y<256; y++)
59      for (int x=0; x<256; x+=2)
60      {
61         UINT16 data = m_vram[(y*256 + x)>>1];
62 
63         bitmap.pix16(y, x) = (data>>8) & 0xff;
64         bitmap.pix16(y, x + 1) = data & 0xff;
65      }
66 
67   return 0;
68}
69 
70READ8_MEMBER(geniusiq_state::flash_r)
71{
72   return m_flash->read(offset);
73}
74 
75WRITE8_MEMBER(geniusiq_state::flash_w)
76{
77   m_flash->write(offset, data);
78}
79 
4580static ADDRESS_MAP_START(geniusiq_mem, AS_PROGRAM, 16, geniusiq_state)
4681   ADDRESS_MAP_UNMAP_HIGH
4782   AM_RANGE(0x000000, 0x1FFFFF) AM_ROM
4883   AM_RANGE(0x200000, 0x23FFFF) AM_RAM
84   AM_RANGE(0x300000, 0x30FFFF) AM_RAM      AM_SHARE("vram")
85   AM_RANGE(0x310000, 0x312FFF) AM_RAM
86   AM_RANGE(0x400000, 0x41ffff) AM_READWRITE8(flash_r, flash_w, 0x00ff)
87   //AM_RANGE(0x600300, 0x600301)                      // read during IRQ 4 (mouse ??)
88   //AM_RANGE(0x600500, 0x60050f)                      // read during IRQ 5 (keyboard ??)
89   AM_RANGE(0x601008, 0x601009) AM_READ(unk_r)         // unknown, read at start and expect that bit 2 changes several times before continue
4990   // 0x600000 : some memory mapped hardware
5091   // Somewhere : internal flash
5192   // Somewhere : cartridge port
5293ADDRESS_MAP_END
5394 
5495 
96static INPUT_CHANGED( trigger_irq )
97{
98   cputag_set_input_line(field.machine(), "maincpu", (int)(FPTR)param, newval ? HOLD_LINE : CLEAR_LINE);
99}
100 
55101/* Input ports */
56102static INPUT_PORTS_START( geniusiq )
103   PORT_START( "DEBUG" )   // for debug purposes, to be removed in the end
104   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_1 ) PORT_NAME( "IRQ 1" ) PORT_CHANGED( trigger_irq, 1 )
105   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_2 ) PORT_NAME( "IRQ 2" ) PORT_CHANGED( trigger_irq, 2 )
106   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_3 ) PORT_NAME( "IRQ 3" ) PORT_CHANGED( trigger_irq, 3 )
107   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_4 ) PORT_NAME( "IRQ 4" ) PORT_CHANGED( trigger_irq, 4 )
108   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_5 ) PORT_NAME( "IRQ 5" ) PORT_CHANGED( trigger_irq, 5 )
109   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_6 ) PORT_NAME( "IRQ 6" ) PORT_CHANGED( trigger_irq, 6 )
110   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_7 ) PORT_NAME( "IRQ 7" ) PORT_CHANGED( trigger_irq, 7 )
57111INPUT_PORTS_END
58112 
59113 
r15581r15582
65119   /* basic machine hardware */
66120   MCFG_CPU_ADD("maincpu", M68000, 16000000) // The main crystal is at 32MHz, not sure whats the CPU freq
67121   MCFG_CPU_PROGRAM_MAP(geniusiq_mem)
122 
123   /* video hardware */
124   MCFG_SCREEN_ADD("screen", RASTER)
125   MCFG_SCREEN_REFRESH_RATE(50)
126   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
127   MCFG_SCREEN_SIZE(256, 256)
128   MCFG_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
129   MCFG_SCREEN_UPDATE_DRIVER( geniusiq_state, screen_update )
130   MCFG_PALETTE_LENGTH(256)
131 
132   /* internal flash */
133   MCFG_AMD_29F040_ADD("flash")   // should be AM29f010
68134MACHINE_CONFIG_END
69135 
70136/* ROM definition */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team