src/mess/drivers/mes.c
| r9611 | r9612 | |
| 9 | 9 | #include "emu.h" |
| 10 | 10 | #include "cpu/z80/z80.h" |
| 11 | 11 | |
| 12 | static const UINT8 *FNT; |
| 13 | static const UINT8 *videoram; |
| 14 | |
| 12 | 15 | static ADDRESS_MAP_START(mes_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 13 | 16 | ADDRESS_MAP_UNMAP_HIGH |
| 14 | 17 | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 15 | | AM_RANGE(0x1000, 0xffff) AM_RAM |
| 18 | AM_RANGE(0x1000, 0xffff) AM_RAM AM_REGION("maincpu", 0x1000) |
| 16 | 19 | ADDRESS_MAP_END |
| 17 | 20 | |
| 18 | 21 | static ADDRESS_MAP_START( mes_io, ADDRESS_SPACE_IO, 8 ) |
| r9611 | r9612 | |
| 20 | 23 | ADDRESS_MAP_END |
| 21 | 24 | |
| 22 | 25 | /* Input ports */ |
| 23 | | INPUT_PORTS_START( mes ) |
| 26 | static INPUT_PORTS_START( mes ) |
| 24 | 27 | INPUT_PORTS_END |
| 25 | 28 | |
| 26 | 29 | static MACHINE_RESET(mes) |
| r9611 | r9612 | |
| 29 | 32 | |
| 30 | 33 | static VIDEO_START( mes ) |
| 31 | 34 | { |
| 35 | FNT = memory_region(machine, "chargen"); |
| 36 | videoram = memory_region(machine, "maincpu")+0xf000; |
| 32 | 37 | } |
| 33 | 38 | |
| 39 | /* This system appears to have 2 screens. Not implemented. |
| 40 | Also the screen dimensions are a guess. */ |
| 34 | 41 | static VIDEO_UPDATE( mes ) |
| 35 | | { |
| 42 | { //static UINT8 framecnt=0; |
| 43 | UINT8 y,ra,chr,gfx; |
| 44 | UINT16 sy=0,ma=0,x,xx; |
| 45 | |
| 46 | //framecnt++; |
| 47 | |
| 48 | for (y = 0; y < 25; y++) |
| 49 | { |
| 50 | for (ra = 0; ra < 10; ra++) |
| 51 | { |
| 52 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 53 | |
| 54 | xx = ma; |
| 55 | for (x = ma; x < ma + 80; x++) |
| 56 | { |
| 57 | gfx = 0; |
| 58 | if (ra < 9) |
| 59 | { |
| 60 | chr = videoram[xx++]; |
| 61 | |
| 62 | // /* Take care of flashing characters */ |
| 63 | // if ((chr < 0x80) && (framecnt & 0x08)) |
| 64 | // chr |= 0x80; |
| 65 | |
| 66 | if (chr & 0x80) // ignore attribute bytes |
| 67 | x--; |
| 68 | else |
| 69 | { |
| 70 | gfx = FNT[(chr<<4) | ra ]; |
| 71 | |
| 72 | /* Display a scanline of a character */ |
| 73 | *p++ = ( gfx & 0x80 ) ? 1 : 0; |
| 74 | *p++ = ( gfx & 0x40 ) ? 1 : 0; |
| 75 | *p++ = ( gfx & 0x20 ) ? 1 : 0; |
| 76 | *p++ = ( gfx & 0x10 ) ? 1 : 0; |
| 77 | *p++ = ( gfx & 0x08 ) ? 1 : 0; |
| 78 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 79 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 80 | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | ma+=80; |
| 86 | } |
| 36 | 87 | return 0; |
| 37 | 88 | } |
| 38 | 89 | |
| r9611 | r9612 | |
| 49 | 100 | MDRV_SCREEN_REFRESH_RATE(60) |
| 50 | 101 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 51 | 102 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 52 | | MDRV_SCREEN_SIZE(256, 192) /* border size not accurate */ |
| 53 | | MDRV_SCREEN_VISIBLE_AREA(0, 256 - 1, 0, 192 - 1) |
| 103 | MDRV_SCREEN_SIZE(640, 250) |
| 104 | MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 249) |
| 54 | 105 | |
| 55 | 106 | MDRV_PALETTE_LENGTH(2) |
| 56 | 107 | MDRV_PALETTE_INIT(black_and_white) |
| r9611 | r9612 | |
| 66 | 117 | ROM_LOAD( "mescpu.bin", 0x0000, 0x1000, CRC(b6d90cf4) SHA1(19e608af5bdaabb00a134e1106b151b00e2a0b04)) |
| 67 | 118 | ROM_REGION( 0x10000, "xebec", ROMREGION_ERASEFF ) |
| 68 | 119 | ROM_LOAD( "mesxebec.bin", 0x0000, 0x2000, CRC(061b7212) SHA1(c5d600116fb7563c69ebd909eb9613269b2ada0f)) |
| 120 | |
| 121 | /* character generator not dumped, using the one from 'c10' for now */ |
| 122 | ROM_REGION( 0x2000, "chargen", 0 ) |
| 123 | ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf)) |
| 69 | 124 | ROM_END |
| 70 | 125 | |
| 71 | 126 | /* Driver */ |