Previous 15994 Revisions Next

r8554 Tuesday 20th July, 2010 at 22:19:33 UTC by Angelo Salese
[SMC-777]: Got to the insert disk check message
[src/mess/drivers]smc777.c

src/mess/drivers/smc777.c
r8553r8554
11/***************************************************************************
2   
3        Sony SMC-777
42
5      13/07/2010 Skeleton driver.
3    SMC-777 (c) 1983 Sony
64
5    preliminary driver by Angelo Salese
6
7    TODO:
8    - no documentation, the entire driver is just a bunch of educated
9      guesses ...
10    - video emulation is just hacked up together to show something simple,
11      dunno yet how it really works.
12
713****************************************************************************/
814
915#include "emu.h"
1016#include "cpu/z80/z80.h"
17#include "sound/sn76496.h"
18#include "video/mc6845.h"
1119
20static UINT16 cursor_addr;
21
22static VIDEO_START( smc777 )
23{
24}
25
26static VIDEO_UPDATE( smc777 )
27{
28   int x,y,count;
29   static UINT8 *vram = memory_region(screen->machine, "vram");
30//   static UINT8 *attr = memory_region(screen->machine, "attr");
31
32   count = 0x0000;
33
34   for(y=0;y<25;y++)
35   {
36      for(x=0;x<40;x++)
37      {
38         int tile = vram[count] | 0x80;
39//         int color = attr[count];
40
41         drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
42
43         if(((cursor_addr) == count) && screen->machine->primary_screen->frame_number() & 0x10) // draw cursor
44            drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],0x107,0,0,0,x*8,y*8,0);
45
46
47         count+=2;
48      }
49   }
50
51    return 0;
52}
53
54static READ8_HANDLER( test_r )
55{
56   return mame_rand(space->machine);
57}
58
59static WRITE8_HANDLER( smc777_6845_w )
60{
61   static int addr_latch;
62
63   if(offset == 0)
64   {
65      addr_latch = data;
66      mc6845_address_w(devtag_get_device(space->machine, "crtc"), 0,data);
67   }
68   else
69   {
70      /* FIXME: this should be inside the MC6845 core! */
71      if(addr_latch == 0x0e)
72         cursor_addr = ((data<<8) & 0x3f00) | (cursor_addr & 0xff);
73      else if(addr_latch == 0x0f)
74         cursor_addr = (cursor_addr & 0x3f00) | (data & 0xff);
75
76      mc6845_register_w(devtag_get_device(space->machine, "crtc"), 0,data);
77   }
78}
79
80static WRITE8_HANDLER( smc777_vram_w )
81{
82   static UINT8 *vram = memory_region(space->machine, "vram");
83
84   vram[cursor_addr] = data;
85}
86
87static WRITE8_HANDLER( smc777_attr_w )
88{
89   static UINT8 *attr = memory_region(space->machine, "attr");
90
91   attr[cursor_addr] = data;
92}
93
1294static ADDRESS_MAP_START(smc777_mem, ADDRESS_SPACE_PROGRAM, 8)
1395   ADDRESS_MAP_UNMAP_HIGH
1496   AM_RANGE(0x0000, 0x3fff) AM_ROM
r8553r8554
1799
18100static ADDRESS_MAP_START( smc777_io , ADDRESS_SPACE_IO, 8)
19101   ADDRESS_MAP_UNMAP_HIGH
102   ADDRESS_MAP_GLOBAL_MASK(0xff)
103   AM_RANGE(0x00, 0x07) AM_WRITE(smc777_vram_w)
104   AM_RANGE(0x08, 0x0f) AM_WRITE(smc777_attr_w)
105   AM_RANGE(0x10, 0x17) AM_WRITENOP //PCG data is written there, in a backwards fashion???
106   AM_RANGE(0x18, 0x19) AM_WRITE(smc777_6845_w)
107   AM_RANGE(0x1b, 0x1b) AM_READ(test_r) //presumably video related
108//   AM_RANGE(0x1c, 0x1c) AM_WRITENOP //???
109//   AM_RANGE(0x30, 0x37) AM_NOP //fdc, wd1793?
110   AM_RANGE(0x53, 0x53) AM_DEVWRITE("sn1", sn76496_w)
111//   AM_RANGE(0x80, 0xff) AM_WRITENOP //cleared with the same backwards fashion as the vram / PCG data, bitmap?
20112ADDRESS_MAP_END
21113
22114/* Input ports */
r8553r8554
24116INPUT_PORTS_END
25117
26118
27static MACHINE_RESET(smc777)
28{   
29}
30
31static VIDEO_START( smc777 )
119static MACHINE_RESET(smc777)
32120{
33121}
34122
35static VIDEO_UPDATE( smc777 )
36{
37    return 0;
38}
39123
40124/* F4 Character Displayer */
41125static const gfx_layout smc777_charlayout =
42126{
43127   8, 8,               /* 8 x 8 characters */
44   320,               /* 320 characters */
128   RGN_FRAC(1,1),               /* 320 characters */
45129   1,               /* 1 bits per pixel */
46130   { 0 },               /* no bitplanes */
47131   /* x offsets */
r8553r8554
52136};
53137
54138static GFXDECODE_START( smc777 )
55   GFXDECODE_ENTRY( "maincpu", 0x0200, smc777_charlayout, 0, 1 )
139   GFXDECODE_ENTRY( "maincpu", 0x0000, smc777_charlayout, 0, 1 )
56140GFXDECODE_END
57141
142static const mc6845_interface mc6845_intf =
143{
144   "screen",   /* screen we are acting on */
145   8,         /* number of pixels per video memory address */
146   NULL,      /* before pixel update callback */
147   NULL,      /* row update callback */
148   NULL,      /* after pixel update callback */
149   DEVCB_NULL,   /* callback for display state changes */
150   DEVCB_NULL,   /* callback for cursor state changes */
151   DEVCB_NULL,   /* HSYNC callback */
152   DEVCB_NULL,   /* VSYNC callback */
153   NULL      /* update address callback */
154};
155
156
58157static MACHINE_DRIVER_START( smc777 )
59158    /* basic machine hardware */
60159    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
61160    MDRV_CPU_PROGRAM_MAP(smc777_mem)
62    MDRV_CPU_IO_MAP(smc777_io)   
161    MDRV_CPU_IO_MAP(smc777_io)
63162
64163    MDRV_MACHINE_RESET(smc777)
65   
164
66165    /* video hardware */
67166    MDRV_SCREEN_ADD("screen", RASTER)
68167    MDRV_SCREEN_REFRESH_RATE(50)
r8553r8554
74173    MDRV_PALETTE_INIT(black_and_white)
75174   MDRV_GFXDECODE(smc777)
76175
176   MDRV_MC6845_ADD("crtc", H46505, XTAL_3_579545MHz/2, mc6845_intf)   /* unknown clock, hand tuned to get ~60 fps */
177
77178    MDRV_VIDEO_START(smc777)
78179    MDRV_VIDEO_UPDATE(smc777)
180
181   MDRV_SPEAKER_STANDARD_MONO("mono")
182
183   MDRV_SOUND_ADD("sn1", SN76489A, 1996800) // unknown clock / divider
184   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
79185MACHINE_DRIVER_END
80186
81187/* ROM definition */
82188ROM_START( smc777 )
83189    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
84190   ROM_LOAD( "smcrom.dat", 0x0000, 0x4000, CRC(b2520d31) SHA1(3c24b742c38bbaac85c0409652ba36e20f4687a1))
191
192    ROM_REGION( 0x2000, "vram", ROMREGION_ERASE00 )
193
194    ROM_REGION( 0x2000, "attr", ROMREGION_ERASE00 )
195
85196ROM_END
86197
87198/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team