trunk/scripts/target/mame/mess.lua
| r248580 | r248581 | |
| 2332 | 2332 | MAME_DIR .. "src/mess/video/ondra.c", |
| 2333 | 2333 | MAME_DIR .. "src/mess/drivers/pmd85.c", |
| 2334 | 2334 | MAME_DIR .. "src/mess/machine/pmd85.c", |
| 2335 | | MAME_DIR .. "src/mess/video/pmd85.c", |
| 2336 | 2335 | MAME_DIR .. "src/mess/drivers/pmi80.c", |
| 2337 | 2336 | MAME_DIR .. "src/mess/drivers/sapi1.c", |
| 2338 | 2337 | } |
trunk/src/mess/drivers/pmd85.c
| r248580 | r248581 | |
| 182 | 182 | #include "formats/pmd_cas.h" |
| 183 | 183 | #include "machine/ram.h" |
| 184 | 184 | |
| 185 | |
| 186 | //************************************************************************** |
| 187 | // VIDEO EMULATION |
| 188 | //************************************************************************** |
| 189 | |
| 190 | UINT32 pmd85_state::screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 191 | { |
| 192 | for (int y = 0; y < 256; y++) |
| 193 | { |
| 194 | // address of current line in PMD-85 video memory |
| 195 | UINT8 *line = m_ram->pointer() + 0xc000 + 0x40 * y; |
| 196 | |
| 197 | for (int x = 0; x < 288/6; x++) |
| 198 | { |
| 199 | int pen = BIT(line[x], 7) ? 1 : 2; |
| 200 | |
| 201 | bitmap.pix16(y, x * 6 + 0) = BIT(line[x], 0) ? pen : 0; |
| 202 | bitmap.pix16(y, x * 6 + 1) = BIT(line[x], 1) ? pen : 0; |
| 203 | bitmap.pix16(y, x * 6 + 2) = BIT(line[x], 2) ? pen : 0; |
| 204 | bitmap.pix16(y, x * 6 + 3) = BIT(line[x], 3) ? pen : 0; |
| 205 | bitmap.pix16(y, x * 6 + 4) = BIT(line[x], 4) ? pen : 0; |
| 206 | bitmap.pix16(y, x * 6 + 5) = BIT(line[x], 5) ? pen : 0; |
| 207 | } |
| 208 | |
| 209 | } |
| 210 | |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | |
| 185 | 215 | /* I/O ports */ |
| 186 | 216 | |
| 187 | 217 | static ADDRESS_MAP_START( pmd85_io_map, AS_IO, 8, pmd85_state ) |
| r248580 | r248581 | |
| 578 | 608 | MCFG_SCREEN_UPDATE_DRIVER(pmd85_state, screen_update_pmd85) |
| 579 | 609 | MCFG_SCREEN_PALETTE("palette") |
| 580 | 610 | |
| 581 | | MCFG_PALETTE_ADD("palette", sizeof (pmd85_palette) / 3) |
| 582 | | MCFG_PALETTE_INIT_OWNER(pmd85_state, pmd85) |
| 611 | MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") |
| 583 | 612 | |
| 584 | 613 | /* sound hardware */ |
| 585 | 614 | MCFG_SPEAKER_STANDARD_MONO("mono") |
trunk/src/mess/includes/pmd85.h
| r248580 | r248581 | |
| 76 | 76 | DECLARE_DRIVER_INIT(alfa); |
| 77 | 77 | DECLARE_DRIVER_INIT(c2717); |
| 78 | 78 | virtual void machine_reset(); |
| 79 | | virtual void video_start(); |
| 80 | | DECLARE_PALETTE_INIT(pmd85); |
| 81 | 79 | UINT32 screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 82 | 80 | TIMER_CALLBACK_MEMBER(pmd85_cassette_timer_callback); |
| 83 | 81 | DECLARE_WRITE_LINE_MEMBER(write_cas_tx); |
| r248580 | r248581 | |
| 148 | 146 | void mato_update_memory(); |
| 149 | 147 | void c2717_update_memory(); |
| 150 | 148 | void pmd85_common_driver_init(); |
| 151 | | void pmd85_draw_scanline(bitmap_ind16 &bitmap, int pmd85_scanline); |
| 152 | 149 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 153 | 150 | |
| 154 | 151 | int m_cas_tx; |
| 155 | 152 | }; |
| 156 | 153 | |
| 157 | | /*----------- defined in video/pmd85.c -----------*/ |
| 158 | 154 | |
| 159 | | extern const unsigned char pmd85_palette[3*3]; |
| 160 | | |
| 161 | | |
| 162 | 155 | #endif /* PMD85_H_ */ |
trunk/src/mess/video/pmd85.c
| r248580 | r248581 | |
| 1 | | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Krzysztof Strzecha |
| 3 | | /*************************************************************************** |
| 4 | | |
| 5 | | pmd85.c |
| 6 | | |
| 7 | | Functions to emulate the video hardware of PMD-85. |
| 8 | | |
| 9 | | Krzysztof Strzecha |
| 10 | | |
| 11 | | ***************************************************************************/ |
| 12 | | |
| 13 | | #include "emu.h" |
| 14 | | #include "includes/pmd85.h" |
| 15 | | |
| 16 | | const unsigned char pmd85_palette[3*3] = |
| 17 | | { |
| 18 | | 0x00, 0x00, 0x00, |
| 19 | | 0x7f, 0x7f, 0x7f, |
| 20 | | 0xff, 0xff, 0xff |
| 21 | | }; |
| 22 | | |
| 23 | | PALETTE_INIT_MEMBER(pmd85_state, pmd85) |
| 24 | | { |
| 25 | | int i; |
| 26 | | |
| 27 | | for ( i = 0; i < sizeof(pmd85_palette) / 3; i++ ) { |
| 28 | | m_palette->set_pen_color(i, pmd85_palette[i*3], pmd85_palette[i*3+1], pmd85_palette[i*3+2]); |
| 29 | | } |
| 30 | | } |
| 31 | | |
| 32 | | void pmd85_state::video_start() |
| 33 | | { |
| 34 | | } |
| 35 | | |
| 36 | | void pmd85_state::pmd85_draw_scanline(bitmap_ind16 &bitmap, int pmd85_scanline) |
| 37 | | { |
| 38 | | int x, i; |
| 39 | | int pen0, pen1; |
| 40 | | UINT8 data; |
| 41 | | |
| 42 | | /* set up scanline */ |
| 43 | | UINT16 *scanline = &bitmap.pix16(pmd85_scanline); |
| 44 | | |
| 45 | | /* address of current line in PMD-85 video memory */ |
| 46 | | UINT8* pmd85_video_ram_line = m_ram->pointer() + 0xc000 + 0x40*pmd85_scanline; |
| 47 | | |
| 48 | | for (x=0; x<288; x+=6) |
| 49 | | { |
| 50 | | data = pmd85_video_ram_line[x/6]; |
| 51 | | pen0 = 0; |
| 52 | | pen1 = data & 0x80 ? 1 : 2; |
| 53 | | |
| 54 | | for (i=0; i<6; i++) |
| 55 | | scanline[x+i] = (data & (0x01<<i)) ? pen1 : pen0; |
| 56 | | |
| 57 | | } |
| 58 | | } |
| 59 | | |
| 60 | | UINT32 pmd85_state::screen_update_pmd85(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 61 | | { |
| 62 | | int pmd85_scanline; |
| 63 | | |
| 64 | | for (pmd85_scanline=0; pmd85_scanline<256; pmd85_scanline++) |
| 65 | | { |
| 66 | | pmd85_draw_scanline(bitmap, pmd85_scanline); |
| 67 | | } |
| 68 | | return 0; |
| 69 | | } |