src/mess/drivers/okean240.c
| r9845 | r9846 | |
| 14 | 14 | public: |
| 15 | 15 | okean240_state(running_machine &machine, const driver_device_config_base &config) |
| 16 | 16 | : driver_device(machine, config) { } |
| 17 | UINT8 *videoram; |
| 17 | 18 | }; |
| 18 | 19 | |
| 20 | |
| 21 | static READ8_HANDLER( okean240_80_r ) { return mame_rand(space->machine); } // so we can start booting |
| 22 | |
| 23 | |
| 19 | 24 | static ADDRESS_MAP_START(okean240_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 20 | 25 | ADDRESS_MAP_UNMAP_HIGH |
| 26 | AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("boot") |
| 27 | AM_RANGE(0x0800, 0x3fff) AM_RAM |
| 28 | AM_RANGE(0x4000, 0x7fff) AM_RAM AM_BASE_MEMBER(okean240_state, videoram) |
| 29 | AM_RANGE(0x8000, 0xbfff) AM_RAM |
| 30 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 21 | 31 | ADDRESS_MAP_END |
| 22 | 32 | |
| 23 | 33 | static ADDRESS_MAP_START( okean240_io , ADDRESS_SPACE_IO, 8) |
| 24 | 34 | ADDRESS_MAP_UNMAP_HIGH |
| 35 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 36 | AM_RANGE(0x80, 0x80) AM_READ(okean240_80_r) |
| 25 | 37 | ADDRESS_MAP_END |
| 26 | 38 | |
| 27 | 39 | /* Input ports */ |
| 28 | | INPUT_PORTS_START( okean240 ) |
| 40 | static INPUT_PORTS_START( okean240 ) |
| 29 | 41 | INPUT_PORTS_END |
| 30 | 42 | |
| 31 | 43 | |
| 44 | /* after the first 6 bytes have been read from ROM, switch the ram back in */ |
| 45 | static TIMER_CALLBACK( okean240_boot ) |
| 46 | { |
| 47 | memory_set_bank(machine, "boot", 0); |
| 48 | } |
| 49 | |
| 32 | 50 | static MACHINE_RESET(okean240) |
| 33 | 51 | { |
| 52 | timer_set(machine, ATTOTIME_IN_USEC(10), NULL, 0, okean240_boot); |
| 53 | memory_set_bank(machine, "boot", 1); |
| 34 | 54 | } |
| 35 | 55 | |
| 56 | DRIVER_INIT( okean240 ) |
| 57 | { |
| 58 | UINT8 *RAM = memory_region(machine, "maincpu"); |
| 59 | memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000], 0xe000); |
| 60 | } |
| 61 | |
| 36 | 62 | static VIDEO_START( okean240 ) |
| 37 | 63 | { |
| 38 | 64 | } |
| 39 | 65 | |
| 66 | // The video appears to be bitmapped, but atm this produces scrolling garbage |
| 40 | 67 | static VIDEO_UPDATE( okean240 ) |
| 41 | 68 | { |
| 42 | | return 0; |
| 69 | okean240_state *state = screen->machine->driver_data<okean240_state>(); |
| 70 | UINT8 gfx; |
| 71 | UINT16 ma=0,x,y; |
| 72 | |
| 73 | for (y = 0; y < 256; y++) |
| 74 | { |
| 75 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 76 | |
| 77 | for (x = ma; x < ma+64; x++) |
| 78 | { |
| 79 | gfx = state->videoram[x]; |
| 80 | |
| 81 | *p++ = ( gfx & 0x80 ) ? 1 : 0; |
| 82 | *p++ = ( gfx & 0x40 ) ? 1 : 0; |
| 83 | *p++ = ( gfx & 0x20 ) ? 1 : 0; |
| 84 | *p++ = ( gfx & 0x10 ) ? 1 : 0; |
| 85 | *p++ = ( gfx & 0x08 ) ? 1 : 0; |
| 86 | *p++ = ( gfx & 0x04 ) ? 1 : 0; |
| 87 | *p++ = ( gfx & 0x02 ) ? 1 : 0; |
| 88 | *p++ = ( gfx & 0x01 ) ? 1 : 0; |
| 89 | } |
| 90 | ma+=64; |
| 91 | } |
| 92 | return 0; |
| 43 | 93 | } |
| 44 | 94 | |
| 95 | /* F4 Character Displayer */ |
| 96 | static const gfx_layout okean240_charlayout = |
| 97 | { |
| 98 | 8, 7, /* 8 x 7 characters */ |
| 99 | 160, /* 160 characters */ |
| 100 | 1, /* 1 bits per pixel */ |
| 101 | { 0 }, /* no bitplanes */ |
| 102 | /* x offsets */ |
| 103 | { 7, 6, 5, 4, 3, 2, 1, 0 }, |
| 104 | /* y offsets */ |
| 105 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8 }, |
| 106 | 8*7 /* every char takes 7 bytes */ |
| 107 | }; |
| 108 | |
| 109 | static GFXDECODE_START( okean240 ) |
| 110 | GFXDECODE_ENTRY( "maincpu", 0xef63, okean240_charlayout, 0, 1 ) |
| 111 | GFXDECODE_END |
| 112 | |
| 45 | 113 | static MACHINE_CONFIG_START( okean240, okean240_state ) |
| 46 | | /* basic machine hardware */ |
| 47 | | MDRV_CPU_ADD("maincpu",I8080, XTAL_12MHz / 6) |
| 48 | | MDRV_CPU_PROGRAM_MAP(okean240_mem) |
| 49 | | MDRV_CPU_IO_MAP(okean240_io) |
| 114 | /* basic machine hardware */ |
| 115 | MDRV_CPU_ADD("maincpu",I8080, XTAL_12MHz / 6) |
| 116 | MDRV_CPU_PROGRAM_MAP(okean240_mem) |
| 117 | MDRV_CPU_IO_MAP(okean240_io) |
| 50 | 118 | |
| 51 | | MDRV_MACHINE_RESET(okean240) |
| 119 | MDRV_MACHINE_RESET(okean240) |
| 52 | 120 | |
| 53 | | /* video hardware */ |
| 54 | | MDRV_SCREEN_ADD("screen", RASTER) |
| 55 | | MDRV_SCREEN_REFRESH_RATE(50) |
| 56 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 57 | | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 58 | | MDRV_SCREEN_SIZE(640, 480) |
| 59 | | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 60 | | MDRV_PALETTE_LENGTH(2) |
| 61 | | MDRV_PALETTE_INIT(black_and_white) |
| 121 | /* video hardware */ |
| 122 | MDRV_SCREEN_ADD("screen", RASTER) |
| 123 | MDRV_SCREEN_REFRESH_RATE(50) |
| 124 | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 125 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 126 | MDRV_SCREEN_SIZE(640, 480) |
| 127 | MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 128 | MDRV_PALETTE_LENGTH(2) |
| 129 | MDRV_PALETTE_INIT(black_and_white) |
| 130 | MDRV_GFXDECODE(okean240) |
| 62 | 131 | |
| 63 | | MDRV_VIDEO_START(okean240) |
| 64 | | MDRV_VIDEO_UPDATE(okean240) |
| 132 | MDRV_VIDEO_START(okean240) |
| 133 | MDRV_VIDEO_UPDATE(okean240) |
| 65 | 134 | MACHINE_CONFIG_END |
| 66 | 135 | |
| 67 | 136 | /* ROM definition */ |
| 68 | 137 | ROM_START( okean240 ) |
| 69 | | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 138 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 70 | 139 | ROM_LOAD( "monitor.bin", 0xe000, 0x2000, CRC(bcac5ca0) SHA1(602ab824704d3d5d07b3787f6227ff903c33c9d5)) |
| 71 | 140 | ROM_LOAD( "cpm80.bin", 0xc000, 0x2000, CRC(b89a7e16) SHA1(b8f937c04f430be18e48f296ed3ef37194171204)) |
| 72 | 141 | ROM_END |
| r9845 | r9846 | |
| 74 | 143 | /* Driver */ |
| 75 | 144 | |
| 76 | 145 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 77 | | COMP( ????, okean240, 0, 0, okean240, okean240, 0, "<unknown>", "Okean-240", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 146 | COMP( ????, okean240, 0, 0, okean240, okean240, okean240, "<unknown>", "Okean-240", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 78 | 147 | |