src/mess/drivers/rx78.c
| r8485 | r8486 | |
| 11 | 11 | |
| 12 | 12 | static ADDRESS_MAP_START(rx78_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 13 | 13 | ADDRESS_MAP_UNMAP_HIGH |
| 14 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 15 | AM_RANGE(0x2000, 0xffff) AM_RAM AM_REGION("maincpu", 0x2000) |
| 14 | 16 | ADDRESS_MAP_END |
| 15 | 17 | |
| 16 | 18 | static ADDRESS_MAP_START( rx78_io , ADDRESS_SPACE_IO, 8) |
| r8485 | r8486 | |
| 18 | 20 | ADDRESS_MAP_END |
| 19 | 21 | |
| 20 | 22 | /* Input ports */ |
| 21 | | INPUT_PORTS_START( rx78 ) |
| 23 | static INPUT_PORTS_START( rx78 ) |
| 22 | 24 | INPUT_PORTS_END |
| 23 | 25 | |
| 24 | 26 | |
| r8485 | r8486 | |
| 32 | 34 | |
| 33 | 35 | static VIDEO_UPDATE( rx78 ) |
| 34 | 36 | { |
| 35 | | return 0; |
| 37 | UINT8 y,ra,chr,gfx; |
| 38 | UINT16 sy=0,ma=0xe8be,x; |
| 39 | UINT8 *RAM = memory_region(screen->machine, "maincpu"); |
| 40 | |
| 41 | for (y = 0; y < 23; y++) |
| 42 | { |
| 43 | for (ra = 0; ra < 8; ra++) |
| 44 | { |
| 45 | UINT16 *p = BITMAP_ADDR16(bitmap, sy++, 0); |
| 46 | |
| 47 | for (x = ma; x < ma+30; x++) |
| 48 | { |
| 49 | chr = RAM[x]; |
| 50 | |
| 51 | /* get pattern of pixels for that character scanline */ |
| 52 | gfx = RAM[0x1a27 + (chr<<3) + ra]; |
| 53 | |
| 54 | /* Display a scanline of a character (8 pixels) */ |
| 55 | *p = ( gfx & 0x01 ) ? 1 : 0; p++; |
| 56 | *p = ( gfx & 0x02 ) ? 1 : 0; p++; |
| 57 | *p = ( gfx & 0x04 ) ? 1 : 0; p++; |
| 58 | *p = ( gfx & 0x08 ) ? 1 : 0; p++; |
| 59 | *p = ( gfx & 0x10 ) ? 1 : 0; p++; |
| 60 | *p = ( gfx & 0x20 ) ? 1 : 0; p++; |
| 61 | *p = ( gfx & 0x40 ) ? 1 : 0; p++; |
| 62 | *p = ( gfx & 0x80 ) ? 1 : 0; p++; |
| 63 | } |
| 64 | } |
| 65 | ma+=30; |
| 66 | } |
| 67 | return 0; |
| 36 | 68 | } |
| 37 | 69 | |
| 70 | /* F4 Character Displayer */ |
| 71 | static const gfx_layout rx78_charlayout = |
| 72 | { |
| 73 | 8, 8, /* 8 x 8 characters */ |
| 74 | 187, /* 187 characters */ |
| 75 | 1, /* 1 bits per pixel */ |
| 76 | { 0 }, /* no bitplanes */ |
| 77 | /* x offsets */ |
| 78 | { 7, 6, 5, 4, 3, 2, 1, 0 }, |
| 79 | /* y offsets */ |
| 80 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 81 | 8*8 /* every char takes 8 bytes */ |
| 82 | }; |
| 83 | |
| 84 | static GFXDECODE_START( rx78 ) |
| 85 | GFXDECODE_ENTRY( "maincpu", 0x1a27, rx78_charlayout, 0, 1 ) |
| 86 | GFXDECODE_END |
| 87 | |
| 38 | 88 | static MACHINE_DRIVER_START( rx78 ) |
| 39 | 89 | /* basic machine hardware */ |
| 40 | | MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 90 | MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz) // 4.1mhz |
| 41 | 91 | MDRV_CPU_PROGRAM_MAP(rx78_mem) |
| 42 | 92 | MDRV_CPU_IO_MAP(rx78_io) |
| 43 | 93 | |
| r8485 | r8486 | |
| 48 | 98 | MDRV_SCREEN_REFRESH_RATE(50) |
| 49 | 99 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 50 | 100 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 51 | | MDRV_SCREEN_SIZE(640, 480) |
| 52 | | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 101 | MDRV_SCREEN_SIZE(240, 184) |
| 102 | MDRV_SCREEN_VISIBLE_AREA(0, 240-1, 0, 184-1) |
| 53 | 103 | MDRV_PALETTE_LENGTH(2) |
| 54 | 104 | MDRV_PALETTE_INIT(black_and_white) |
| 105 | MDRV_GFXDECODE(rx78) |
| 55 | 106 | |
| 56 | 107 | MDRV_VIDEO_START(rx78) |
| 57 | 108 | MDRV_VIDEO_UPDATE(rx78) |