Previous 15994 Revisions Next

r10093 Tuesday 18th January, 2011 at 20:27:19 UTC by Wilbert Pol
[CFX9850] Added some small things.
[src/mess/drivers]cfx9850.c

src/mess/drivers/cfx9850.c
r10092r10093
22
33    Driver for Casio CFX-9850
44
5To operate:
6The unit is switched off by default, you have to switch it on by pressing 'Q'.
7
8Debugging information:
9First make sure system is initialized (g 10b3).
10At cs=23, ip=d1a4,d1af,d1ba,d1c5,d1d0,d1db,d1ea,d1f9,d208,d217,d226,d235,d244
11are routines which fill display ram with patterns.
12
513***************************************************************************/
614
715#include "emu.h"
r10092r10093
2836//  AM_RANGE( 0x110000, 0x11ffff ) /* some memory mapped i/o? */
2937   AM_RANGE( 0x200000, 0x27ffff ) AM_ROM AM_REGION( "bios", 0 )
3038   AM_RANGE( 0x400000, 0x40ffff ) AM_RAM
31   AM_RANGE( 0x600000, 0x601fff ) AM_MIRROR(0xe000) AM_RAM AM_BASE_MEMBER( cfx9850_state, display_ram )
39   AM_RANGE( 0x600000, 0x601fff ) AM_MIRROR(0xf800) AM_RAM AM_BASE_MEMBER( cfx9850_state, display_ram )
3240//  AM_RANGE( 0xe10000, 0xe1ffff ) /* some memory mapped i/o? */
3341ADDRESS_MAP_END
3442
r10092r10093
175183INPUT_PORTS_END
176184
177185
186static PALETTE_INIT( cfx9850 )
187{
188   palette_set_color_rgb( machine, 0, 0xff, 0xff, 0xff );
189   palette_set_color_rgb( machine, 1, 0x00, 0x00, 0xff );
190   palette_set_color_rgb( machine, 2, 0x00, 0xff, 0x00 );
191   palette_set_color_rgb( machine, 3, 0xff, 0x00, 0x00 );
192}
193
194
195static VIDEO_UPDATE( cfx9850 )
196{
197   cfx9850_state *state = screen->machine->driver_data<cfx9850_state>();
198   UINT16 offset = 0;
199
200   for ( int i = 0; i < 16; i++ )
201   {
202      int x = 120 - i * 8;
203
204      for ( int j = 0; j < 64; j++ )
205      {
206         UINT8 data1 = state->display_ram[ offset ];
207         UINT8 data2 = state->display_ram[ offset + 0x400 ];
208
209         for ( int b = 0; b < 8; b++ )
210         {
211            *BITMAP_ADDR16(bitmap, 63-j, x+b) = ( data1 & 0x80 ) ? ( data2 & 0x80 ? 3 : 2 ) : ( data2 & 0x80 ? 1 : 0 );
212            data1 <<= 1;
213            data2 <<= 1;
214         }
215
216         offset++;
217      }
218   }
219
220   return 0;
221}
222
223
178224static MACHINE_CONFIG_START( cfx9850, cfx9850_state )
179225
180226   MCFG_CPU_ADD( "maincpu", HCD62121, 4300000 )   /* 4.3 MHz */
r10092r10093
188234   MCFG_SCREEN_VISIBLE_AREA( 0, 127, 0, 63 )
189235   MCFG_DEFAULT_LAYOUT(layout_lcd)
190236
237   MCFG_VIDEO_UPDATE( cfx9850 )
238
191239   /* TODO: It uses a color display, but I'm being lazy here. 3 colour lcd */
192   MCFG_PALETTE_LENGTH( 2 )
193   MCFG_PALETTE_INIT(black_and_white)
240   MCFG_PALETTE_LENGTH( 4 )
241   MCFG_PALETTE_INIT( cfx9850 )
194242
195243MACHINE_CONFIG_END
196244

Previous 15994 Revisions Next


© 1998-2018 The MESS Team