Previous 199869 Revisions Next

r17662 Wednesday 5th September, 2012 at 18:16:30 UTC by Sandro Ronco
(MESS) geniusiq: fixed missing text. (nw)
[src/mess/drivers]geniusiq.c

trunk/src/mess/drivers/geniusiq.c
r17661r17662
1818    ???????? Cartridge port
1919
2020TODO:
21    - Mostly everything besides CPU, RAM and ROM
21    - Mouse input
22    - Sound
23    - German keyboard layout
24    - Cartridge
25    - Dump the MCU and rewrites everything using low-level emulation
2226    - Check with different countries ROMs
2327
2428Not very much is known about this computer released in 1997.
r17661r17662
116120   DECLARE_READ16_MEMBER(input_r);
117121   DECLARE_WRITE16_MEMBER(mouse_pos_w);
118122   DECLARE_INPUT_CHANGED_MEMBER(send_input);
123   DECLARE_WRITE16_MEMBER(gfx_base_w);
124   DECLARE_WRITE16_MEMBER(gfx_dest_w);
125   DECLARE_WRITE16_MEMBER(gfx_color_w);
126   DECLARE_WRITE16_MEMBER(gfx_idx_w);
119127
120128   DECLARE_READ16_MEMBER(unk0_r) { return 0; }
121129   DECLARE_READ16_MEMBER(unk_r) { return machine().rand(); }
122130
131private:
132   UINT16      m_gfx_y;
133   UINT16      m_gfx_x;
134   UINT32      m_gfx_base;
135   UINT8      m_gfx_color[2];
123136   UINT16      m_mouse_posx;
124137   UINT16      m_mouse_posy;
125138   struct
r17661r17662
211224   }
212225}
213226
227WRITE16_MEMBER(geniusiq_state::gfx_color_w)
228{
229   m_gfx_color[offset & 1] = data & 0x0f;
230}
231
232WRITE16_MEMBER(geniusiq_state::gfx_dest_w)
233{
234   if (offset)
235      m_gfx_y = data;
236   else
237      m_gfx_x = data;
238}
239
240WRITE16_MEMBER(geniusiq_state::gfx_base_w)
241{
242   if (offset)
243      m_gfx_base = (m_gfx_base & 0xffff0000) | (data<<0);
244   else
245      m_gfx_base = (m_gfx_base & 0x0000ffff) | (data<<16);
246}
247
248WRITE16_MEMBER(geniusiq_state::gfx_idx_w)
249{
250   UINT16 *gfx = ((UINT16 *)(*memregion("maincpu"))) + ((m_gfx_base + data*32)>>1);
251
252   // first 16 bits are used to define the character size
253   UINT8 gfx_heigh = (gfx[0]>>0) & 0xff;
254   UINT8 gfx_width = (gfx[0]>>8) & 0xff;
255
256   for(int y=0; y<gfx_heigh; y++)
257      for(int x=0; x<gfx_width; x++)
258      {
259         UINT16 src = gfx[y + 1];
260         UINT32 dst = (m_gfx_y + y)*512 + (m_gfx_x + x);
261         UINT8 pen = m_gfx_color[BIT(src,15-x)];
262         int bit_pos = (3 - (dst & 3)) << 2;
263
264         m_vram[dst>>2] = (m_vram[dst>>2] & ~(0x0f << bit_pos)) | (pen << bit_pos);
265      }
266}
267
214268READ16_MEMBER( geniusiq_state::input_r )
215269{
216270   /*
r17661r17662
263317   AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x0e0000) AM_READWRITE8(flash_r, flash_w, 0x00ff)
264318   AM_RANGE(0x600300, 0x600301) AM_READ(input_r)
265319   //AM_RANGE(0x600500, 0x60050f)                      // read during IRQ 5
320   //AM_RANGE(0x600600, 0x600605)                      // sound ??
321   AM_RANGE(0x600606, 0x600609) AM_WRITE(gfx_base_w)
322   AM_RANGE(0x60060a, 0x60060b) AM_WRITE(gfx_idx_w)
323   //AM_RANGE(0x600802, 0x600803)                      // cartridge state
266324   AM_RANGE(0x600918, 0x600919) AM_READ(unk0_r)        // loop at start if bit 0 is set
267325   AM_RANGE(0x601008, 0x601009) AM_READ(unk_r)         // unknown, read at start and expect that bit 2 changes several times before continue
268326   AM_RANGE(0x601010, 0x601011) AM_READ(unk0_r)      // loop at start if bit 1 is set
327   AM_RANGE(0x601018, 0x60101b) AM_WRITE(gfx_dest_w)
328   AM_RANGE(0x60101c, 0x60101f) AM_WRITE(gfx_color_w)
269329   AM_RANGE(0x601060, 0x601063) AM_WRITE(mouse_pos_w)
270330   AM_RANGE(0x601100, 0x6011ff) AM_RAM      AM_SHARE("mouse_gfx")   // mouse cursor gfx (12x16)
331   //AM_RANGE(0xa00000, 0xa?????)                      // cartridge ??
271332   // 0x600000 : some memory mapped hardware
272   // Somewhere : cartridge port
273333ADDRESS_MAP_END
274334
275335
r17661r17662
281341/* Input ports */
282342static INPUT_PORTS_START( geniusiq )
283343   PORT_START( "IN0" )
344   PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD )      //  PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x00 )
284345   PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD )      //  PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x01 )
285346   PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD )      //  PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x02 )
286347   PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_LSHIFT )   PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x03 )
r17661r17662
437498MACHINE_RESET_MEMBER( geniusiq_state )
438499{
439500   m_keyboard.head = m_keyboard.tail = 0;
501
502   m_gfx_y = 0;
503   m_gfx_x = 0;
504   m_gfx_base = 0;
505   m_gfx_color[0] = m_gfx_color[1] = 0;
506   m_mouse_posx = 0;
507   m_mouse_posy = 0;
440508}
441509
442510static MACHINE_CONFIG_START( geniusiq, geniusiq_state )
443511   /* basic machine hardware */
444   MCFG_CPU_ADD("maincpu", M68000, 16000000) // The main crystal is at 32MHz, not sure whats the CPU freq
512   MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2) // The main crystal is at 32MHz, not sure whats the CPU freq
445513   MCFG_CPU_PROGRAM_MAP(geniusiq_mem)
446514   MCFG_CPU_VBLANK_INT("screen", irq6_line_hold)
447515

Previous 199869 Revisions Next


© 1997-2024 The MAME Team