trunk/src/mess/drivers/geniusiq.c
| r17661 | r17662 | |
| 18 | 18 | ???????? Cartridge port |
| 19 | 19 | |
| 20 | 20 | TODO: |
| 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 |
| 22 | 26 | - Check with different countries ROMs |
| 23 | 27 | |
| 24 | 28 | Not very much is known about this computer released in 1997. |
| r17661 | r17662 | |
| 116 | 120 | DECLARE_READ16_MEMBER(input_r); |
| 117 | 121 | DECLARE_WRITE16_MEMBER(mouse_pos_w); |
| 118 | 122 | 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); |
| 119 | 127 | |
| 120 | 128 | DECLARE_READ16_MEMBER(unk0_r) { return 0; } |
| 121 | 129 | DECLARE_READ16_MEMBER(unk_r) { return machine().rand(); } |
| 122 | 130 | |
| 131 | private: |
| 132 | UINT16 m_gfx_y; |
| 133 | UINT16 m_gfx_x; |
| 134 | UINT32 m_gfx_base; |
| 135 | UINT8 m_gfx_color[2]; |
| 123 | 136 | UINT16 m_mouse_posx; |
| 124 | 137 | UINT16 m_mouse_posy; |
| 125 | 138 | struct |
| r17661 | r17662 | |
| 211 | 224 | } |
| 212 | 225 | } |
| 213 | 226 | |
| 227 | WRITE16_MEMBER(geniusiq_state::gfx_color_w) |
| 228 | { |
| 229 | m_gfx_color[offset & 1] = data & 0x0f; |
| 230 | } |
| 231 | |
| 232 | WRITE16_MEMBER(geniusiq_state::gfx_dest_w) |
| 233 | { |
| 234 | if (offset) |
| 235 | m_gfx_y = data; |
| 236 | else |
| 237 | m_gfx_x = data; |
| 238 | } |
| 239 | |
| 240 | WRITE16_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 | |
| 248 | WRITE16_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 | |
| 214 | 268 | READ16_MEMBER( geniusiq_state::input_r ) |
| 215 | 269 | { |
| 216 | 270 | /* |
| r17661 | r17662 | |
| 263 | 317 | AM_RANGE(0x400000, 0x41ffff) AM_MIRROR(0x0e0000) AM_READWRITE8(flash_r, flash_w, 0x00ff) |
| 264 | 318 | AM_RANGE(0x600300, 0x600301) AM_READ(input_r) |
| 265 | 319 | //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 |
| 266 | 324 | AM_RANGE(0x600918, 0x600919) AM_READ(unk0_r) // loop at start if bit 0 is set |
| 267 | 325 | AM_RANGE(0x601008, 0x601009) AM_READ(unk_r) // unknown, read at start and expect that bit 2 changes several times before continue |
| 268 | 326 | 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) |
| 269 | 329 | AM_RANGE(0x601060, 0x601063) AM_WRITE(mouse_pos_w) |
| 270 | 330 | AM_RANGE(0x601100, 0x6011ff) AM_RAM AM_SHARE("mouse_gfx") // mouse cursor gfx (12x16) |
| 331 | //AM_RANGE(0xa00000, 0xa?????) // cartridge ?? |
| 271 | 332 | // 0x600000 : some memory mapped hardware |
| 272 | | // Somewhere : cartridge port |
| 273 | 333 | ADDRESS_MAP_END |
| 274 | 334 | |
| 275 | 335 | |
| r17661 | r17662 | |
| 281 | 341 | /* Input ports */ |
| 282 | 342 | static INPUT_PORTS_START( geniusiq ) |
| 283 | 343 | PORT_START( "IN0" ) |
| 344 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD ) // PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x00 ) |
| 284 | 345 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD ) // PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x01 ) |
| 285 | 346 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD ) // PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x02 ) |
| 286 | 347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE( KEYCODE_LSHIFT ) PORT_CHANGED_MEMBER( DEVICE_SELF, geniusiq_state, send_input, 0x03 ) |
| r17661 | r17662 | |
| 437 | 498 | MACHINE_RESET_MEMBER( geniusiq_state ) |
| 438 | 499 | { |
| 439 | 500 | 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; |
| 440 | 508 | } |
| 441 | 509 | |
| 442 | 510 | static MACHINE_CONFIG_START( geniusiq, geniusiq_state ) |
| 443 | 511 | /* 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 |
| 445 | 513 | MCFG_CPU_PROGRAM_MAP(geniusiq_mem) |
| 446 | 514 | MCFG_CPU_VBLANK_INT("screen", irq6_line_hold) |
| 447 | 515 | |