src/mess/video/mikro80.c
| r2863 | r2864 | |
| 13 | 13 | UINT8 *mikro80_video_ram; |
| 14 | 14 | UINT8 *mikro80_cursor_ram; |
| 15 | 15 | |
| 16 | | const gfx_layout mikro80_charlayout = |
| 17 | | { |
| 18 | | 8, 8, /* 8x8 characters */ |
| 19 | | 256, /* 256 characters */ |
| 20 | | 1, /* 1 bits per pixel */ |
| 21 | | {0}, /* no bitplanes; 1 bit per pixel */ |
| 22 | | {0, 1, 2, 3, 4, 5, 6, 7}, |
| 23 | | {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8}, |
| 24 | | 8*8 /* size of one char */ |
| 25 | | }; |
| 26 | | |
| 27 | | PALETTE_INIT( mikro80 ) |
| 28 | | { |
| 29 | | palette_set_color(machine,0,RGB_BLACK); /* black */ |
| 30 | | palette_set_color(machine,1,RGB_WHITE); /* white */ |
| 31 | | palette_set_color(machine,2,RGB_WHITE); /* white */ |
| 32 | | palette_set_color(machine,3,RGB_BLACK); /* black */ |
| 33 | | } |
| 34 | | |
| 35 | 16 | VIDEO_START( mikro80 ) |
| 36 | 17 | { |
| 37 | 18 | } |
| 38 | 19 | |
| 39 | 20 | VIDEO_UPDATE( mikro80 ) |
| 40 | 21 | { |
| 41 | | int x,y; |
| 22 | UINT8 *gfx = memory_region(REGION_GFX1); |
| 23 | int x,y,b; |
| 42 | 24 | |
| 43 | | for(y = 0; y < 32; y++ ) |
| 25 | for(y = 0; y < 32*8; y++ ) |
| 44 | 26 | { |
| 45 | 27 | for(x = 0; x < 64; x++ ) |
| 46 | 28 | { |
| 47 | | UINT8 code = mikro80_video_ram [x + y*64 ]; |
| 48 | | UINT8 attr = mikro80_cursor_ram[x+1 + y*64 ] & 0x80 ? 1 : 0; |
| 49 | | drawgfx(bitmap, screen->machine->gfx[0], code, attr, 0,0, x*8,y*8, |
| 50 | | NULL, TRANSPARENCY_NONE, 0); |
| 29 | int addr = x + (y / 8)*64; |
| 30 | UINT8 code = gfx[mikro80_video_ram [addr]*8+ (y % 8)]; |
| 31 | UINT8 attr = mikro80_cursor_ram[addr+1] & 0x80 ? 1 : 0; |
| 32 | for (b = 7; b >= 0; b--) |
| 33 | { |
| 34 | UINT8 col = (code >> b) & 0x01; |
| 35 | *BITMAP_ADDR16(bitmap, y, x*8+(7-b)) = attr ? col ^ 1 : col; |
| 36 | } |
| 51 | 37 | } |
| 52 | 38 | } |
| 53 | 39 | return 0; |
src/mess/video/galaxy.c
| r2863 | r2864 | |
| 12 | 12 | #include "includes/galaxy.h" |
| 13 | 13 | #include "cpu/z80/z80.h" |
| 14 | 14 | |
| 15 | | const gfx_layout galaxy_charlayout = |
| 16 | | { |
| 17 | | 8, 13, /* 8x8 characters */ |
| 18 | | 128, /* 128 characters */ |
| 19 | | 1, /* 1 bits per pixel */ |
| 20 | | {0}, /* no bitplanes; 1 bit per pixel */ |
| 21 | | {7, 6, 5, 4, 3, 2, 1, 0}, |
| 22 | | {0*128*8, 1*128*8, 2*128*8, 3*128*8, |
| 23 | | 4*128*8, 5*128*8, 6*128*8, 7*128*8, |
| 24 | | 8*128*8, 9*128*8, 10*8*128, 11*128*8, 12*128*8}, |
| 25 | | 8 /* each character takes 1 consecutive byte */ |
| 26 | | }; |
| 27 | | |
| 28 | | const unsigned char galaxy_palette[2*3] = |
| 29 | | { |
| 30 | | 0xff, 0xff, 0xff, /* White */ |
| 31 | | 0x00, 0x00, 0x00 /* Black */ |
| 32 | | }; |
| 33 | | |
| 34 | | PALETTE_INIT( galaxy ) |
| 35 | | { |
| 36 | | int i; |
| 37 | | |
| 38 | | for ( i = 0; i < sizeof(galaxy_palette) / 3; i++ ) { |
| 39 | | palette_set_color_rgb(machine, i, galaxy_palette[i*3], galaxy_palette[i*3+1], galaxy_palette[i*3+2]); |
| 40 | | } |
| 41 | | } |
| 42 | | |
| 43 | 15 | UINT32 gal_cnt = 0; |
| 44 | 16 | static UINT8 code = 0; |
| 45 | 17 | static UINT8 first = 0; |
| r2863 | r2864 | |
| 52 | 24 | if (galaxy_interrupts_enabled==TRUE) { |
| 53 | 25 | UINT8 *gfx = memory_region(REGION_GFX1); |
| 54 | 26 | UINT8 dat = (gal_latch_value & 0x3c) >> 2; |
| 55 | | if ((gal_cnt > 48 * 2) && (gal_cnt < 48 * 210)) { // display on screen just first 208 lines |
| 27 | if ((gal_cnt >= 48 * 2) && (gal_cnt < 48 * 210)) { // display on screen just first 208 lines |
| 56 | 28 | UINT8 mode = (gal_latch_value >> 1) & 1; // bit 2 latch represents mode |
| 57 | 29 | UINT16 addr = (cpunum_get_reg(0, Z80_I) << 8) | cpunum_get_reg(0, Z80_R) | ((gal_latch_value & 0x80) ^ 0x80); |
| 58 | 30 | if (mode == 0){ |
| r2863 | r2864 | |
| 61 | 33 | // Due to a fact that on real processor latch value is set at |
| 62 | 34 | // the end of last cycle we need to skip dusplay of double |
| 63 | 35 | // first char in each row |
| 64 | | code = 0xff; |
| 36 | code = 0x00; |
| 65 | 37 | first = 1; |
| 66 | 38 | } else { |
| 67 | 39 | code = program_read_byte(addr) & 0xbf; |
| 68 | 40 | code += (code & 0x80) >> 1; |
| 69 | | code = gfx[(code & 0x7f) +(dat << 7 )]; |
| 41 | code = gfx[(code & 0x7f) +(dat << 7 )] ^ 0xff; |
| 70 | 42 | first = 0; |
| 71 | 43 | } |
| 72 | 44 | y = gal_cnt / 48 - 2; |
| r2863 | r2864 | |
| 87 | 59 | // Due to a fact that on real processor latch value is set at |
| 88 | 60 | // the end of last cycle we need to skip dusplay of 4 times |
| 89 | 61 | // first char in each row |
| 90 | | code = 0xff; |
| 62 | code = 0x00; |
| 91 | 63 | first++; |
| 92 | 64 | } else { |
| 93 | | code = program_read_byte(addr); |
| 65 | code = program_read_byte(addr) ^ 0xff; |
| 94 | 66 | first = 0; |
| 95 | 67 | } |
| 96 | 68 | y = gal_cnt / 48 - 2; |
| r2863 | r2864 | |
| 101 | 73 | start_addr = addr; |
| 102 | 74 | } |
| 103 | 75 | if ((x/8 >=11) && (x/8<44)) { |
| 104 | | code = program_read_byte(start_addr + y * 32 + (gal_cnt % 48)-11); |
| 76 | code = program_read_byte(start_addr + y * 32 + (gal_cnt % 48)-11) ^ 0xff; |
| 105 | 77 | } else { |
| 106 | | code = 0xff; |
| 78 | code = 0x00; |
| 107 | 79 | } |
| 108 | 80 | /* end of hack */ |
| 109 | 81 | |
| r2863 | r2864 | |
| 121 | 93 | } |
| 122 | 94 | } |
| 123 | 95 | |
| 124 | | VIDEO_START ( galaxy ) |
| 125 | | { |
| 126 | | VIDEO_START_CALL ( generic_bitmapped ); |
| 127 | | } |
| 128 | | |
| 129 | 96 | VIDEO_UPDATE( galaxy ) |
| 130 | 97 | { |
| 131 | 98 | timer_adjust_periodic(gal_video_timer, attotime_zero, 0, attotime_never); |
| 132 | 99 | if (galaxy_interrupts_enabled == FALSE) { |
| 133 | 100 | rectangle black_area = {0,384-1,0,208-1}; |
| 134 | | fillbitmap(tmpbitmap, 1, &black_area); |
| 101 | fillbitmap(tmpbitmap, 0, &black_area); |
| 135 | 102 | } |
| 136 | 103 | galaxy_interrupts_enabled = FALSE; |
| 137 | 104 | return VIDEO_UPDATE_CALL ( generic_bitmapped ); |
src/mess/drivers/mikro80.c
| r2863 | r2864 | |
| 14 | 14 | #include "devices/cassette.h" |
| 15 | 15 | #include "formats/rk_cas.h" |
| 16 | 16 | |
| 17 | | |
| 18 | | static GFXDECODE_START( mikro80 ) |
| 19 | | GFXDECODE_ENTRY( REGION_GFX1, 0x0000, mikro80_charlayout, 0, 2 ) |
| 20 | | GFXDECODE_END |
| 21 | | |
| 22 | 17 | /* Address maps */ |
| 23 | 18 | static ADDRESS_MAP_START(mikro80_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 24 | 19 | AM_RANGE( 0x0000, 0x07ff ) AM_RAMBANK(1) // First bank |
| r2863 | r2864 | |
| 137 | 132 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 138 | 133 | MDRV_SCREEN_SIZE(64*8, 32*8) |
| 139 | 134 | MDRV_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1) |
| 140 | | MDRV_PALETTE_LENGTH(4) |
| 141 | | MDRV_PALETTE_INIT(mikro80) |
| 142 | | MDRV_GFXDECODE( mikro80 ) |
| 135 | MDRV_PALETTE_LENGTH(2) |
| 136 | MDRV_PALETTE_INIT(black_and_white) |
| 143 | 137 | |
| 144 | 138 | MDRV_VIDEO_START(mikro80) |
| 145 | 139 | MDRV_VIDEO_UPDATE(mikro80) |
src/mess/drivers/galaxy.c
| r2863 | r2864 | |
| 52 | 52 | AM_RANGE(0xf000, 0xffff) AM_ROM // ROM D |
| 53 | 53 | ADDRESS_MAP_END |
| 54 | 54 | |
| 55 | | static GFXDECODE_START( galaxy ) |
| 56 | | GFXDECODE_ENTRY( REGION_GFX1, 0x0000, galaxy_charlayout, 0, 2 ) |
| 57 | | GFXDECODE_END |
| 58 | | |
| 59 | 55 | /* 2008-05 FP: |
| 60 | 56 | Small note about natural keyboard support. Currently: |
| 61 | 57 | - "List" is mapped to 'ESC' |
| r2863 | r2864 | |
| 170 | 166 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 171 | 167 | MDRV_SCREEN_SIZE(384, 212) |
| 172 | 168 | MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 208-1) |
| 173 | | MDRV_GFXDECODE( galaxy ) |
| 174 | | MDRV_PALETTE_LENGTH(sizeof (galaxy_palette) / 3) |
| 175 | | MDRV_PALETTE_INIT( galaxy ) |
| 169 | MDRV_PALETTE_LENGTH(2) |
| 170 | MDRV_PALETTE_INIT( black_and_white ) |
| 176 | 171 | |
| 177 | 172 | MDRV_VIDEO_START( generic_bitmapped ) |
| 178 | 173 | MDRV_VIDEO_UPDATE( galaxy ) |
| r2863 | r2864 | |
| 200 | 195 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 201 | 196 | MDRV_SCREEN_SIZE(384, 208) |
| 202 | 197 | MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 208-1) |
| 203 | | MDRV_GFXDECODE( galaxy ) |
| 204 | | MDRV_PALETTE_LENGTH(sizeof (galaxy_palette) / 3) |
| 205 | | MDRV_PALETTE_INIT( galaxy ) |
| 198 | MDRV_PALETTE_LENGTH(2) |
| 199 | MDRV_PALETTE_INIT( black_and_white ) |
| 206 | 200 | |
| 207 | 201 | MDRV_VIDEO_START( generic_bitmapped ) |
| 208 | 202 | MDRV_VIDEO_UPDATE( galaxy ) |