trunk/src/mess/drivers/modellot.c
| r0 | r19450 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | General Processor Modello T |
| 4 | |
| 5 | 10/12/2012 Skeleton driver. |
| 6 | |
| 7 | ****************************************************************************/ |
| 8 | |
| 9 | #include "emu.h" |
| 10 | #include "cpu/z80/z80.h" |
| 11 | |
| 12 | |
| 13 | class modellot_state : public driver_device |
| 14 | { |
| 15 | public: |
| 16 | modellot_state(const machine_config &mconfig, device_type type, const char *tag) |
| 17 | : driver_device(mconfig, type, tag), |
| 18 | m_maincpu(*this, "maincpu") , |
| 19 | m_video_ram(*this, "video_ram") |
| 20 | { } |
| 21 | |
| 22 | required_device<cpu_device> m_maincpu; |
| 23 | required_shared_ptr<UINT8> m_video_ram; |
| 24 | UINT32 screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 25 | |
| 26 | virtual void machine_reset(); |
| 27 | |
| 28 | DECLARE_READ8_MEMBER(modellot_77); |
| 29 | DECLARE_READ8_MEMBER(modellot_ff); |
| 30 | }; |
| 31 | |
| 32 | static ADDRESS_MAP_START(modellot_mem, AS_PROGRAM, 8, modellot_state) |
| 33 | ADDRESS_MAP_UNMAP_HIGH |
| 34 | AM_RANGE(0x0000, 0xbfff) AM_RAM |
| 35 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("video_ram") |
| 36 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| 37 | ADDRESS_MAP_END |
| 38 | |
| 39 | static ADDRESS_MAP_START(modellot_io, AS_IO, 8, modellot_state) |
| 40 | ADDRESS_MAP_UNMAP_HIGH |
| 41 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 42 | AM_RANGE(0x77, 0x77) AM_READ(modellot_77) |
| 43 | AM_RANGE(0xff, 0xff) AM_READ(modellot_ff) |
| 44 | ADDRESS_MAP_END |
| 45 | |
| 46 | |
| 47 | /* Input ports */ |
| 48 | static INPUT_PORTS_START( modellot ) |
| 49 | INPUT_PORTS_END |
| 50 | |
| 51 | READ8_MEMBER( modellot_state::modellot_77) |
| 52 | { |
| 53 | return 0x04; |
| 54 | } |
| 55 | |
| 56 | READ8_MEMBER( modellot_state::modellot_ff) |
| 57 | { |
| 58 | return 0x00; |
| 59 | } |
| 60 | |
| 61 | void modellot_state::machine_reset() |
| 62 | { |
| 63 | m_maincpu->set_state_int(Z80_PC, 0xe000); |
| 64 | } |
| 65 | |
| 66 | const gfx_layout modellot_charlayout = |
| 67 | { |
| 68 | 8, 16, /* 8x8 characters */ |
| 69 | 128, /* 256 characters */ |
| 70 | 1, /* 1 bits per pixel */ |
| 71 | {0}, /* no bitplanes; 1 bit per pixel */ |
| 72 | {0,1,2,3,4,5,6,7}, |
| 73 | {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8, |
| 74 | 0 * 8+0x200, 1 * 8+0x200, 2 * 8+0x200, 3 * 8+0x200, 4 * 8+0x200, 5 * 8+0x200, 6 * 8+0x200, 7 * 8+0x200}, |
| 75 | 8*16 /* size of one char */ |
| 76 | }; |
| 77 | |
| 78 | static GFXDECODE_START( modellot ) |
| 79 | GFXDECODE_ENTRY( "gfx1", 0x0000, modellot_charlayout, 0, 1 ) |
| 80 | GFXDECODE_END |
| 81 | |
| 82 | |
| 83 | UINT32 modellot_state::screen_update_modellot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 84 | { |
| 85 | int x,y; |
| 86 | |
| 87 | for(y = 0; y < 16; y++ ) |
| 88 | { |
| 89 | for(x = 0; x < 64; x++ ) |
| 90 | { |
| 91 | int code = m_video_ram[15 + x + y*64]; |
| 92 | drawgfx_opaque(bitmap, cliprect, machine().gfx[0], code , 0, 0,0, x*8,y*16); |
| 93 | } |
| 94 | } |
| 95 | return 0; |
| 96 | } |
| 97 | static MACHINE_CONFIG_START( modellot, modellot_state ) |
| 98 | /* basic machine hardware */ |
| 99 | MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 100 | MCFG_CPU_PROGRAM_MAP(modellot_mem) |
| 101 | MCFG_CPU_IO_MAP(modellot_io) |
| 102 | |
| 103 | /* video hardware */ |
| 104 | MCFG_SCREEN_ADD("screen", RASTER) |
| 105 | MCFG_SCREEN_REFRESH_RATE(50) |
| 106 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 107 | MCFG_SCREEN_SIZE(64*8, 16*16) |
| 108 | MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 16*16-1) |
| 109 | MCFG_SCREEN_UPDATE_DRIVER(modellot_state, screen_update_modellot) |
| 110 | |
| 111 | MCFG_GFXDECODE( modellot ) |
| 112 | |
| 113 | MCFG_PALETTE_LENGTH(2) |
| 114 | MCFG_PALETTE_INIT(black_and_white) |
| 115 | MACHINE_CONFIG_END |
| 116 | |
| 117 | /* ROM definition */ |
| 118 | ROM_START( modellot ) |
| 119 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 120 | //ROM_LOAD( "fdc8119.u3", 0x0000, 0x0400, CRC(a8aee944) SHA1(f2cc598ed2e7a1a620e2f3f53c1a573965f6af26)) |
| 121 | ROM_LOAD( "dt49-48.u1", 0xe000, 0x0400, CRC(2441c438) SHA1(832994a4214a744b7e19e5f74000c95ae65e3759)) |
| 122 | ROM_LOAD( "ht20.u2", 0xe400, 0x0400, CRC(497c0495) SHA1(d03beebc4c31284729f6eac3bdf1fbf44adf7fff)) |
| 123 | ROM_REGION( 0x0800, "gfx1", ROMREGION_ERASEFF ) |
| 124 | ROM_LOAD( "gcem1.u3", 0x0000, 0x0400, CRC(e7739268) SHA1(091ef69282abe657d5f38c70a572964f5200a1d5)) |
| 125 | ROM_LOAD( "gcem2.u4", 0x0400, 0x0400, CRC(6614330e) SHA1(880a541fb0ef6f37ac89439f9ea75a313c3e53d6)) |
| 126 | ROM_END |
| 127 | |
| 128 | /* Driver */ |
| 129 | |
| 130 | COMP( 1979, modellot, 0, 0, modellot, modellot, driver_device, 0, "General Processor", "Modello T", GAME_IS_SKELETON) |
| 131 | |