Previous 15994 Revisions Next

r2905 Friday 27th June, 2008 at 08:53:04 UTC by Miodrag Milanović
[RADIO86] Moved Mikrosha/Apogee/Partner things to common Radio86 machine/video code
[src/mess]mess.mak
[src/mess/drivers]apogee.c mikrosha.c partner.c
[src/mess/formats]rk_cas.c
[src/mess/includes]apogee.h mikrosha.h partner.h radio86.h
[src/mess/machine]apogee.c mikrosha.c partner.c radio86.c
[src/mess/video]apogee.c mikrosha.c partner.c radio86.c

src/mess/video/partner.c
r2904r2905
1/***************************************************************************
2
3        Partner driver by Miodrag Milanovic
4
5        09/06/2008 Preliminary driver.
6
7****************************************************************************/
8
9
10#include "driver.h"
11#include "video/i8275.h"
12#include "includes/partner.h"
13
14I8275_DISPLAY_PIXELS(partner_display_pixels)
15{
16   int i;
17   bitmap_t *bitmap = tmpbitmap;
18   UINT8 *charmap = memory_region(device->machine, REGION_GFX1) + 0x400 * (gpa * 2 + hlgt);
19   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
20   if (vsp) {
21      pixels = 0;
22   }
23   if (lten) {
24      pixels = 0xff;
25   }
26   if (rvv) {
27      pixels ^= 0xff;
28   }
29   for(i=0;i<6;i++) {
30      *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1;
31   }
32}
33
34VIDEO_UPDATE( partner )
35{
36   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, I8275, "i8275");
37   i8275_update( devconf, bitmap, cliprect);
38   VIDEO_UPDATE_CALL ( generic_bitmapped );
39   return 0;
40}
41
42static const rgb_t partner_palette[3] = {
43   MAKE_RGB(0x00, 0x00, 0x00), // black
44   MAKE_RGB(0xa0, 0xa0, 0xa0), // white
45   MAKE_RGB(0xff, 0xff, 0xff)   // highlight
46};
47
48PALETTE_INIT( partner )
49{
50   palette_set_colors(machine, 0, partner_palette, ARRAY_LENGTH(partner_palette));
51}
52
src/mess/video/mikrosha.c
r2904r2905
1/***************************************************************************
2
3        Mikrosha video driver by Miodrag Milanovic
4
5        06/03/2008 Preliminary driver.
6
7****************************************************************************/
8
9
10#include "driver.h"
11#include "video/i8275.h"
12#include "includes/mikrosha.h"
13
14UINT8 mikrosha_font_page;
15
16I8275_DISPLAY_PIXELS(mikrosha_display_pixels)
17{
18   int i;
19   bitmap_t *bitmap = tmpbitmap;
20   UINT8 *charmap = memory_region(device->machine, REGION_GFX1) + (mikrosha_font_page & 1) * 0x400;
21   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
22   if (vsp) {
23      pixels = 0;
24   }
25   if (lten) {
26      pixels = 0xff;
27   }
28   if (rvv) {
29      pixels ^= 0xff;
30   }
31   for(i=0;i<6;i++) {
32      *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0;
33   }
34}
35
36VIDEO_UPDATE( mikrosha )
37{
38   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, I8275, "i8275");
39   i8275_update( devconf, bitmap, cliprect);
40   VIDEO_UPDATE_CALL ( generic_bitmapped );
41   return 0;
42}
43
44static const rgb_t mikrosha_palette[3] = {
45   MAKE_RGB(0x00, 0x00, 0x00), // black
46   MAKE_RGB(0xa0, 0xa0, 0xa0), // white
47   MAKE_RGB(0xff, 0xff, 0xff)   // highlight
48};
49
50PALETTE_INIT( mikrosha )
51{
52   palette_set_colors(machine, 0, mikrosha_palette, ARRAY_LENGTH(mikrosha_palette));
53}
54
src/mess/video/apogee.c
r2904r2905
1/***************************************************************************
2
3        Apogee BK-01 driver by Miodrag Milanovic
4
5        05/06/2008 Preliminary driver.
6
7****************************************************************************/
8
9
10#include "driver.h"
11#include "video/i8275.h"
12#include "includes/apogee.h"
13
14I8275_DISPLAY_PIXELS(apogee_display_pixels)
15{
16   int i;
17   bitmap_t *bitmap = tmpbitmap;
18   UINT8 *charmap = memory_region(device->machine, REGION_GFX1) + (gpa & 1) * 0x400;
19   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
20   if (vsp) {
21      pixels = 0;
22   }
23   if (lten) {
24      pixels = 0xff;
25   }
26   if (rvv) {
27      pixels ^= 0xff;
28   }
29   for(i=0;i<6;i++) {
30      *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0;
31   }
32}
33
34VIDEO_UPDATE( apogee )
35{
36   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, I8275, "i8275");
37   i8275_update( devconf, bitmap, cliprect);
38   VIDEO_UPDATE_CALL ( generic_bitmapped );
39   return 0;
40}
41
42static const rgb_t apogee_palette[3] = {
43   MAKE_RGB(0x00, 0x00, 0x00), // black
44   MAKE_RGB(0xa0, 0xa0, 0xa0), // white
45   MAKE_RGB(0xff, 0xff, 0xff)   // highlight
46};
47
48PALETTE_INIT( apogee )
49{
50   palette_set_colors(machine, 0, apogee_palette, ARRAY_LENGTH(apogee_palette));
51}
52
src/mess/video/radio86.c
r2904r2905
3131   }
3232}
3333
34UINT8 mikrosha_font_page;
35
36I8275_DISPLAY_PIXELS(mikrosha_display_pixels)
37{
38   int i;
39   bitmap_t *bitmap = tmpbitmap;
40   UINT8 *charmap = memory_region(device->machine, REGION_GFX1) + (mikrosha_font_page & 1) * 0x400;
41   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
42   if (vsp) {
43      pixels = 0;
44   }
45   if (lten) {
46      pixels = 0xff;
47   }
48   if (rvv) {
49      pixels ^= 0xff;
50   }
51   for(i=0;i<6;i++) {
52      *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0;
53   }
54}
55
56I8275_DISPLAY_PIXELS(apogee_display_pixels)
57{
58   int i;
59   bitmap_t *bitmap = tmpbitmap;
60   UINT8 *charmap = memory_region(device->machine, REGION_GFX1) + (gpa & 1) * 0x400;
61   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
62   if (vsp) {
63      pixels = 0;
64   }
65   if (lten) {
66      pixels = 0xff;
67   }
68   if (rvv) {
69      pixels ^= 0xff;
70   }
71   for(i=0;i<6;i++) {
72      *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1 ? (hlgt ? 2 : 1) : 0;
73   }
74}
75
76I8275_DISPLAY_PIXELS(partner_display_pixels)
77{
78   int i;
79   bitmap_t *bitmap = tmpbitmap;
80   UINT8 *charmap = memory_region(device->machine, REGION_GFX1) + 0x400 * (gpa * 2 + hlgt);
81   UINT8 pixels = charmap[(linecount & 7) + (charcode << 3)] ^ 0xff;
82   if (vsp) {
83      pixels = 0;
84   }
85   if (lten) {
86      pixels = 0xff;
87   }
88   if (rvv) {
89      pixels ^= 0xff;
90   }
91   for(i=0;i<6;i++) {
92      *BITMAP_ADDR16(bitmap, y, x + i) = (pixels >> (5-i)) & 1;
93   }
94}
95
3496VIDEO_UPDATE( radio86 )
3597{
3698   device_config   *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, I8275, "i8275");
src/mess/includes/mikrosha.h
r2904r2905
1/*****************************************************************************
2 *
3 * includes/mikrosha.h
4 *
5 ****************************************************************************/
6
7#ifndef MIKROSHA_H_
8#define MIKROSHA_H_
9
10#include "machine/8255ppi.h"
11#include "machine/8257dma.h"
12#include "video/i8275.h"
13
14/*----------- defined in machine/mikrosha.c -----------*/
15
16extern DRIVER_INIT( mikrosha );
17extern MACHINE_RESET( mikrosha );
18
19extern const ppi8255_interface mikrosha_ppi8255_interface_1;
20extern const ppi8255_interface mikrosha_ppi8255_interface_2;
21extern const i8275_interface mikrosha_i8275_interface;
22extern const dma8257_interface mikrosha_dma;
23
24/*----------- defined in video/mikrosha.c -----------*/
25
26extern I8275_DISPLAY_PIXELS(mikrosha_display_pixels);
27extern UINT8 mikrosha_font_page;
28extern VIDEO_UPDATE( mikrosha );
29extern PALETTE_INIT( mikrosha );
30
31
32#endif /* MIKROSHA_H_ */
src/mess/includes/apogee.h
r2904r2905
1/*****************************************************************************
2 *
3 * includes/apogee.h
4 *
5 ****************************************************************************/
6
7#ifndef APOGEE_H_
8#define APOGEE_H_
9
10#include "machine/8255ppi.h"
11#include "machine/8257dma.h"
12#include "video/i8275.h"
13
14/*----------- defined in machine/apogee.c -----------*/
15
16extern DRIVER_INIT( apogee );
17extern MACHINE_RESET( apogee );
18
19extern const ppi8255_interface apogee_ppi8255_interface_1;
20extern const i8275_interface apogee_i8275_interface;
21extern const dma8257_interface apogee_dma;
22
23/*----------- defined in video/apogee.c -----------*/
24
25extern I8275_DISPLAY_PIXELS(apogee_display_pixels);
26
27extern VIDEO_UPDATE( apogee );
28extern PALETTE_INIT( apogee );
29
30
31#endif /* APOGEE_H_ */
src/mess/includes/radio86.h
r2904r2905
1818
1919extern const ppi8255_interface radio86_ppi8255_interface_1;
2020extern const ppi8255_interface radio86_ppi8255_interface_2;
21
22extern const ppi8255_interface mikrosha_ppi8255_interface_1;
23extern const ppi8255_interface mikrosha_ppi8255_interface_2;
24
2125extern const i8275_interface radio86_i8275_interface;
26extern const i8275_interface partner_i8275_interface;
27extern const i8275_interface mikrosha_i8275_interface;
28extern const i8275_interface apogee_i8275_interface;
29
2230extern WRITE8_HANDLER ( radio86_pagesel );
31
2332extern const dma8257_interface radio86_dma;
2433
34extern UINT8 radio86_tape_value;
35
2536/*----------- defined in video/radio86.c -----------*/
37extern UINT8 mikrosha_font_page;
2638
2739extern I8275_DISPLAY_PIXELS(radio86_display_pixels);
40extern I8275_DISPLAY_PIXELS(partner_display_pixels);
41extern I8275_DISPLAY_PIXELS(mikrosha_display_pixels);
42extern I8275_DISPLAY_PIXELS(apogee_display_pixels);
2843
2944extern VIDEO_UPDATE( radio86 );
3045extern PALETTE_INIT( radio86 );
3146
32
3347#endif /* radio86_H_ */
src/mess/includes/partner.h
r2904r2905
99
1010#include "machine/8255ppi.h"
1111#include "machine/8257dma.h"
12#include "video/i8275.h"
1312
1413/*----------- defined in machine/partner.c -----------*/
1514
1615extern DRIVER_INIT( partner );
1716extern MACHINE_RESET( partner );
1817
19extern const ppi8255_interface partner_ppi8255_interface_1;
20extern const i8275_interface partner_i8275_interface;
21extern const dma8257_interface partner_dma;
22
2318extern WRITE8_HANDLER (partner_mem_page_w );
2419extern WRITE8_HANDLER (partner_win_memory_page_w);
25
26/*----------- defined in video/partner.c -----------*/
27
28extern I8275_DISPLAY_PIXELS(partner_display_pixels);
29
30extern VIDEO_UPDATE( partner );
31extern PALETTE_INIT( partner );
32
33
3420#endif /* partner_H_ */
src/mess/machine/mikrosha.c
r2904r2905
1/***************************************************************************
2
3        Mikrosha machine driver by Miodrag Milanovic
4
5        06/03/2008 Preliminary driver.
6
7****************************************************************************/
8
9
10#include "driver.h"
11#include "cpu/i8085/i8085.h"
12#include "devices/cassette.h"
13#include "machine/8255ppi.h"
14#include "machine/8257dma.h"
15#include "video/i8275.h"
16#include "includes/mikrosha.h"
17
18static int mikrosha_keyboard_mask;
19
20
21/* Driver initialization */
22DRIVER_INIT(mikrosha)
23{
24   /* set initialy ROM to be visible on first bank */
25   UINT8 *RAM = memory_region(machine, REGION_CPU1);
26   memset(RAM,0x0000,0x1000); // make frist page empty by default
27     memory_configure_bank(1, 1, 2, RAM, 0x0000);
28   memory_configure_bank(1, 0, 2, RAM, 0xf800);
29}
30
31static READ8_HANDLER (mikrosha_8255_porta_r2 )
32{
33   UINT8 key = 0xff;
34   if ((mikrosha_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
35   if ((mikrosha_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
36   if ((mikrosha_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
37   if ((mikrosha_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
38   if ((mikrosha_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
39   if ((mikrosha_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
40   if ((mikrosha_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
41   if ((mikrosha_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
42   return key;
43}
44
45static READ8_HANDLER (mikrosha_8255_portc_r2 )
46{
47   double level = cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0));
48   UINT8 dat = input_port_read(machine,"LINE8");
49   if (level <  0) {
50      dat ^= 0x10;
51    }
52   return dat;
53}
54
55static WRITE8_HANDLER (mikrosha_8255_portb_w2 )
56{
57   mikrosha_keyboard_mask = data ^ 0xff;
58}
59
60const ppi8255_interface mikrosha_ppi8255_interface_1 =
61{
62   mikrosha_8255_porta_r2,
63   NULL,
64   mikrosha_8255_portc_r2,
65   NULL,
66   mikrosha_8255_portb_w2,
67   NULL,
68};
69
70static WRITE8_HANDLER (mikrosha_8255_font_page_w )
71{
72   mikrosha_font_page = (data  > 7) & 1;
73}
74
75const ppi8255_interface mikrosha_ppi8255_interface_2 =
76{
77   NULL,
78   NULL,
79   NULL,
80   NULL,   
81   mikrosha_8255_font_page_w,
82   NULL
83};
84
85static I8275_DMA_REQUEST(mikrosha_video_dma_request) {
86   const device_config *dma8257 = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, "dma8257");
87   dma8257_drq_w(dma8257, 2, state);
88}
89
90const i8275_interface mikrosha_i8275_interface = {
91   "main",
92   6,
93   0,
94   mikrosha_video_dma_request,
95   NULL,
96   mikrosha_display_pixels
97};
98
99static READ8_HANDLER( mikrosha_dma_read_byte )
100{
101   UINT8 result;
102   cpuintrf_push_context(0);
103   result = program_read_byte(offset);
104   cpuintrf_pop_context();
105   return result;
106}
107
108static WRITE8_HANDLER( mikrosha_write_video )
109{
110   i8275_dack_set_data((device_config*)device_list_find_by_tag( machine->config->devicelist, I8275, "i8275" ),data);
111}
112
113const dma8257_interface mikrosha_dma =
114{
115   0,
116   XTAL_16MHz / 9,
117
118   mikrosha_dma_read_byte,
119   0,
120
121   { 0, 0, 0, 0 },
122   { 0, 0, mikrosha_write_video, 0 },
123   { 0, 0, 0, 0 }
124};
125
126static TIMER_CALLBACK( mikrosha_reset )
127{
128   memory_set_bank(1, 0);
129}
130
131MACHINE_RESET( mikrosha )
132{
133   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, mikrosha_reset);
134   memory_set_bank(1, 1);
135
136   mikrosha_keyboard_mask = 0;
137}
src/mess/machine/apogee.c
r2904r2905
1/***************************************************************************
2
3        Apogee BK-01 driver by Miodrag Milanovic
4
5        05/06/2008 Preliminary driver.
6
7****************************************************************************/
8
9
10#include "driver.h"
11#include "cpu/i8085/i8085.h"
12#include "devices/cassette.h"
13#include "machine/8255ppi.h"
14#include "machine/8257dma.h"
15#include "video/i8275.h"
16#include "includes/apogee.h"
17
18static int apogee_keyboard_mask;
19
20
21/* Driver initialization */
22DRIVER_INIT(apogee)
23{
24   /* set initialy ROM to be visible on first bank */
25   UINT8 *RAM = memory_region(machine, REGION_CPU1);
26   memset(RAM,0x0000,0x1000); // make frist page empty by default
27     memory_configure_bank(1, 1, 2, RAM, 0x0000);
28   memory_configure_bank(1, 0, 2, RAM, 0xf800);
29}
30
31static READ8_HANDLER (apogee_8255_portb_r2 )
32{
33   UINT8 key = 0xff;
34   if ((apogee_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
35   if ((apogee_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
36   if ((apogee_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
37   if ((apogee_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
38   if ((apogee_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
39   if ((apogee_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
40   if ((apogee_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
41   if ((apogee_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
42   return key;
43}
44
45static READ8_HANDLER (apogee_8255_portc_r2 )
46{
47   double level = cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0));
48   UINT8 dat = input_port_read(machine,"LINE8");
49   if (level <  0) {
50      dat ^= 0x10;
51    }
52   return dat;
53}
54
55static WRITE8_HANDLER (apogee_8255_porta_w2 )
56{
57   apogee_keyboard_mask = data ^ 0xff;
58}
59
60const ppi8255_interface apogee_ppi8255_interface_1 =
61{
62   NULL,
63   apogee_8255_portb_r2,
64   apogee_8255_portc_r2,
65   apogee_8255_porta_w2,
66   NULL,
67   NULL,
68};
69
70static I8275_DMA_REQUEST(apogee_video_dma_request) {
71   const device_config *dma8257 = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, "dma8257");
72   dma8257_drq_w(dma8257, 2, state);
73}
74
75const i8275_interface apogee_i8275_interface = {
76   "main",
77   6,
78   0,
79   apogee_video_dma_request,
80   NULL,
81   apogee_display_pixels
82};
83
84static READ8_HANDLER( apogee_dma_read_byte )
85{
86   UINT8 result;
87   cpuintrf_push_context(0);
88   result = program_read_byte(offset);
89   cpuintrf_pop_context();
90   return result;
91}
92
93static WRITE8_HANDLER( apogee_write_video )
94{
95   i8275_dack_set_data((device_config*)device_list_find_by_tag( machine->config->devicelist, I8275, "i8275" ),data);
96}
97
98const dma8257_interface apogee_dma =
99{
100   0,
101   XTAL_16MHz / 9,
102
103   apogee_dma_read_byte,
104   0,
105
106   { 0, 0, 0, 0 },
107   { 0, 0, apogee_write_video, 0 },
108   { 0, 0, 0, 0 }
109};
110
111static TIMER_CALLBACK( apogee_reset )
112{
113   memory_set_bank(1, 0);
114}
115
116MACHINE_RESET( apogee )
117{
118   timer_set(ATTOTIME_IN_USEC(1), NULL, 0, apogee_reset);
119   memory_set_bank(1, 1);
120
121   apogee_keyboard_mask = 0;
122}
src/mess/machine/radio86.c
r2904r2905
1616#include "includes/radio86.h"
1717
1818static int radio86_keyboard_mask;
19UINT8 radio86_tape_value;
1920
2021static UINT8 radio_ram_disk[0x10000];
2122
r2904r2905
2930   memory_configure_bank(1, 0, 2, RAM, 0xf800);
3031   
3132   memset(radio_ram_disk,0,0x10000);
33   radio86_tape_value = 0x10;
3234}
3335
3436static READ8_HANDLER (radio86_8255_portb_r2 )
r2904r2905
5052   double level = cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0));                                               
5153   UINT8 dat = input_port_read(machine,"LINE8");
5254   if (level <  0) {
53      dat ^= 0x10;
55      dat ^= radio86_tape_value;
5456    }   
5557   return dat;   
5658}
r2904r2905
7072   NULL,
7173};
7274
75const ppi8255_interface mikrosha_ppi8255_interface_1 =
76{
77   radio86_8255_portb_r2,
78   NULL,
79   radio86_8255_portc_r2,
80   NULL,
81   radio86_8255_porta_w2,
82   NULL,
83};
84
85
7386static I8275_DMA_REQUEST(radio86_video_dma_request) {
74   const device_config *dma8257 = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, "dma8257");
87   const device_config *dma8257 = device_list_find_by_tag(device->machine->config->devicelist, DMA8257, "dma8257");
7588   dma8257_drq_w(dma8257, 2, state);
7689}
7790
78const i8275_interface radio86_i8275_interface = {
79   "main",
80   6,
81   0,
82   radio86_video_dma_request,
83   NULL,
84   radio86_display_pixels
85};
86
8791static READ8_HANDLER(radio86_dma_read_byte)
8892{
8993   UINT8 result;
r2904r2905
120124
121125MACHINE_RESET( radio86 )
122126{
123   timer_set(ATTOTIME_IN_USEC(1000), NULL, 0, radio86_reset);
127   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, radio86_reset);
124128   memory_set_bank(1, 1);
125129
126130   radio86_keyboard_mask = 0;
r2904r2905
162166   radio86_romdisk_portb_w,
163167   radio86_romdisk_portc_w
164168};
169
170static WRITE8_HANDLER (mikrosha_8255_font_page_w )
171{
172   mikrosha_font_page = (data  > 7) & 1;
173}
174
175const ppi8255_interface mikrosha_ppi8255_interface_2 =
176{
177   NULL,
178   NULL,
179   NULL,
180   NULL,   
181   mikrosha_8255_font_page_w,
182   NULL
183};
184
185const i8275_interface radio86_i8275_interface = {
186   "main",
187   6,
188   0,
189   radio86_video_dma_request,
190   NULL,
191   radio86_display_pixels
192};
193
194const i8275_interface mikrosha_i8275_interface = {
195   "main",
196   6,
197   0,
198   radio86_video_dma_request,
199   NULL,
200   mikrosha_display_pixels
201};
202
203const i8275_interface apogee_i8275_interface = {
204   "main",
205   6,
206   0,
207   radio86_video_dma_request,
208   NULL,
209   apogee_display_pixels
210};
211
212const i8275_interface partner_i8275_interface = {
213   "main",
214   6,
215   1,
216   radio86_video_dma_request,
217   NULL,
218   partner_display_pixels
219};
src/mess/machine/partner.c
r2904r2905
1313#include "machine/8255ppi.h"
1414#include "machine/8257dma.h"
1515#include "video/i8275.h"
16#include "includes/radio86.h"
1617#include "includes/partner.h"
1718
18static int partner_keyboard_mask;
19
2019static UINT8 partner_mem_page;
2120static UINT8 partner_win_mem_page;
2221
r2904r2905
2423DRIVER_INIT(partner)
2524{
2625   memset(mess_ram,0,64*1024);
26   radio86_tape_value = 0x80;
2727}
2828
29static READ8_HANDLER (partner_8255_portb_r2 )
30{
31   UINT8 key = 0xff;
32   if ((partner_keyboard_mask & 0x01)!=0) { key &= input_port_read(machine,"LINE0"); }
33   if ((partner_keyboard_mask & 0x02)!=0) { key &= input_port_read(machine,"LINE1"); }
34   if ((partner_keyboard_mask & 0x04)!=0) { key &= input_port_read(machine,"LINE2"); }
35   if ((partner_keyboard_mask & 0x08)!=0) { key &= input_port_read(machine,"LINE3"); }
36   if ((partner_keyboard_mask & 0x10)!=0) { key &= input_port_read(machine,"LINE4"); }
37   if ((partner_keyboard_mask & 0x20)!=0) { key &= input_port_read(machine,"LINE5"); }
38   if ((partner_keyboard_mask & 0x40)!=0) { key &= input_port_read(machine,"LINE6"); }
39   if ((partner_keyboard_mask & 0x80)!=0) { key &= input_port_read(machine,"LINE7"); }
40   return key;
41}
4229
43static READ8_HANDLER (partner_8255_portc_r2 )
44{
45   double level = cassette_input(image_from_devtype_and_index(IO_CASSETTE, 0));
46   UINT8 dat = input_port_read(machine,"LINE8");
47   if (level <  0) {
48      dat ^= 0x80;
49    }
50   return dat;
51}
52
53static WRITE8_HANDLER (partner_8255_porta_w2 )
54{
55   partner_keyboard_mask = data ^ 0xff;
56}
57
58const ppi8255_interface partner_ppi8255_interface_1 =
59{
60   NULL,
61   partner_8255_portb_r2,
62   partner_8255_portc_r2,
63   partner_8255_porta_w2,
64   NULL,
65   NULL,
66};
67
68
69static I8275_DMA_REQUEST(partner_video_dma_request) {
70   const device_config *dma8257 = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, "dma8257");
71   dma8257_drq_w(dma8257, 2, state);
72}
73
74const i8275_interface partner_i8275_interface = {
75   "main",
76   6,
77   1,
78   partner_video_dma_request,
79   NULL,
80   partner_display_pixels
81};
82
83static READ8_HANDLER( partner_dma_read_byte )
84{
85   UINT8 result;
86   cpuintrf_push_context(0);
87   result = program_read_byte(offset);
88   cpuintrf_pop_context();
89   return result;
90}
91
92static WRITE8_HANDLER( partner_write_video )
93{
94   i8275_dack_set_data((device_config*)device_list_find_by_tag( machine->config->devicelist, I8275, "i8275" ),data);
95}
96
97const dma8257_interface partner_dma =
98{
99   0,
100   XTAL_16MHz / 9,
101
102   partner_dma_read_byte,
103   0,
104
105   { 0, 0, 0, 0 },
106   { 0, 0, partner_write_video, 0 },
107   { 0, 0, 0, 0 }
108};
109
11030static void partner_bank_switch(running_machine *machine)
11131{
11232   memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x07ff, 0, 0, SMH_BANK1);
r2904r2905
268188
269189MACHINE_RESET( partner )
270190{
271   partner_keyboard_mask = 0;
272191   partner_mem_page = 0;
273192   partner_bank_switch(machine);
274193}
src/mess/mess.mak
r2904r2905
12611261   $(MESS_MACHINE)/radio86.o \
12621262   $(MESS_VIDEO)/radio86.o \
12631263   $(MESS_DRIVERS)/apogee.o \
1264   $(MESS_MACHINE)/apogee.o \
1265   $(MESS_VIDEO)/apogee.o \
12661264   $(MESS_DRIVERS)/partner.o \
12671265   $(MESS_MACHINE)/partner.o \
1268   $(MESS_VIDEO)/partner.o \
12691266   $(MESS_DRIVERS)/mikrosha.o \
1270   $(MESS_MACHINE)/mikrosha.o \
1271   $(MESS_VIDEO)/mikrosha.o \
12721267   $(MESS_VIDEO)/i8275.o \
12731268
12741269$(MESSOBJ)/comx.a:            \
src/mess/formats/rk_cas.c
r2904r2905
267267};
268268
269269static const struct CassetteFormat gam_cassette_format = {
270   "gam,g16",
270   "gam,g16,pki",
271271   gam_cassette_identify,
272272   gam_cassette_load,
273273   NULL
src/mess/drivers/partner.c
r2904r2905
1414#include "video/i8275.h"
1515#include "devices/cassette.h"
1616#include "formats/rk_cas.h"
17#include "includes/radio86.h"
1718#include "includes/partner.h"
1819
1920/* Address maps */
r2904r2905
127128    MDRV_MACHINE_RESET( partner )
128129
129130   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
130   MDRV_DEVICE_CONFIG( partner_ppi8255_interface_1 )
131   MDRV_DEVICE_CONFIG( radio86_ppi8255_interface_1 )
131132
132133   MDRV_DEVICE_ADD( "i8275", I8275 )
133134   MDRV_DEVICE_CONFIG(partner_i8275_interface)
r2904r2905
139140   MDRV_SCREEN_SIZE(78*6, 30*10)
140141   MDRV_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
141142   MDRV_PALETTE_LENGTH(3)
142   MDRV_PALETTE_INIT(partner)
143   MDRV_PALETTE_INIT(radio86)
143144
144145   MDRV_VIDEO_START(generic_bitmapped)
145   MDRV_VIDEO_UPDATE(partner)
146   MDRV_VIDEO_UPDATE(radio86)
146147
147148   MDRV_SPEAKER_STANDARD_MONO("mono")
148149   MDRV_SOUND_ADD(WAVE, 0)
149150   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
150151
151152   MDRV_DEVICE_ADD("dma8257", DMA8257)
152   MDRV_DEVICE_CONFIG(partner_dma)
153   MDRV_DEVICE_CONFIG(radio86_dma)
153154MACHINE_DRIVER_END
154155
155156static void partner_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
src/mess/drivers/mikrosha.c
r2904r2905
1414#include "video/i8275.h"
1515#include "devices/cassette.h"
1616#include "formats/rk_cas.h"
17#include "includes/mikrosha.h"
17#include "includes/radio86.h"
1818
1919/* Address maps */
2020static ADDRESS_MAP_START(mikrosha_mem, ADDRESS_SPACE_PROGRAM, 8)
r2904r2905
2424    AM_RANGE( 0xc800, 0xc803 ) AM_DEVREADWRITE(PPI8255, "ppi8255_2", ppi8255_r, ppi8255_w) AM_MIRROR(0x07fc)
2525    AM_RANGE( 0xd000, 0xd001 ) AM_DEVREADWRITE(I8275, "i8275", i8275_r, i8275_w) AM_MIRROR(0x07fe) // video
2626    //AM_RANGE( 0xd800, 0xd603 ) AM_MIRROR(0x07fc) // Timer
27   AM_RANGE( 0xdb00, 0xdbff ) AM_DEVWRITE(DMA8257, "dma8257", dma8257_w)    // DMA
27   AM_RANGE( 0xf800, 0xffff ) AM_DEVWRITE(DMA8257, "dma8257", dma8257_w)    // DMA
2828    AM_RANGE( 0xf800, 0xffff ) AM_ROM  // System ROM
2929ADDRESS_MAP_END
3030
r2904r2905
118118    /* basic machine hardware */
119119    MDRV_CPU_ADD(8080, XTAL_16MHz / 9)
120120    MDRV_CPU_PROGRAM_MAP(mikrosha_mem, 0)
121    MDRV_MACHINE_RESET( mikrosha )
121    MDRV_MACHINE_RESET( radio86 )
122122
123123   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
124124   MDRV_DEVICE_CONFIG( mikrosha_ppi8255_interface_1 )
r2904r2905
136136   MDRV_SCREEN_SIZE(78*6, 30*10)
137137   MDRV_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
138138   MDRV_PALETTE_LENGTH(3)
139   MDRV_PALETTE_INIT(mikrosha)
139   MDRV_PALETTE_INIT(radio86)
140140
141141   MDRV_VIDEO_START(generic_bitmapped)
142   MDRV_VIDEO_UPDATE(mikrosha)
142   MDRV_VIDEO_UPDATE(radio86)
143143
144144   MDRV_SPEAKER_STANDARD_MONO("mono")
145145   MDRV_SOUND_ADD(WAVE, 0)
146146   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
147147
148148   MDRV_DEVICE_ADD("dma8257", DMA8257)
149   MDRV_DEVICE_CONFIG(mikrosha_dma)
149   MDRV_DEVICE_CONFIG(radio86_dma)
150150MACHINE_DRIVER_END
151151
152152static void mikrosha_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
r2904r2905
178178/* Driver */
179179
180180/*    YEAR  NAME      PARENT  COMPAT    MACHINE     INPUT       INIT        CONFIG      COMPANY     FULLNAME        FLAGS */
181COMP( 1987, mikrosha, radio86,0,       mikrosha,    mikrosha,   mikrosha,   mikrosha,     "Lianozovo Electromechanical Factory",       "Mikrosha",      0)
181COMP( 1987, mikrosha, radio86,0,       mikrosha,    mikrosha,   radio86,   mikrosha,     "Lianozovo Electromechanical Factory",       "Mikrosha",      0)
src/mess/drivers/apogee.c
r2904r2905
1414#include "video/i8275.h"
1515#include "devices/cassette.h"
1616#include "formats/rk_cas.h"
17#include "includes/apogee.h"
17#include "includes/radio86.h"
1818
1919/* Address maps */
2020static ADDRESS_MAP_START(apogee_mem, ADDRESS_SPACE_PROGRAM, 8)
r2904r2905
118118    /* basic machine hardware */
119119    MDRV_CPU_ADD(8080, XTAL_16MHz / 9)
120120    MDRV_CPU_PROGRAM_MAP(apogee_mem, 0)
121    MDRV_MACHINE_RESET( apogee )
121    MDRV_MACHINE_RESET( radio86 )
122122
123123   MDRV_DEVICE_ADD( "ppi8255_1", PPI8255 )
124   MDRV_DEVICE_CONFIG( apogee_ppi8255_interface_1 )
124   MDRV_DEVICE_CONFIG( radio86_ppi8255_interface_1 )
125125
126126   //MDRV_DEVICE_ADD( "ppi8255_2", PPI8255 )
127127   //MDRV_DEVICE_CONFIG( apogee_ppi8255_interface_2 )
r2904r2905
136136   MDRV_SCREEN_SIZE(78*6, 30*10)
137137   MDRV_SCREEN_VISIBLE_AREA(0, 78*6-1, 0, 30*10-1)
138138   MDRV_PALETTE_LENGTH(3)
139   MDRV_PALETTE_INIT(apogee)
139   MDRV_PALETTE_INIT(radio86)
140140
141141   MDRV_VIDEO_START(generic_bitmapped)
142   MDRV_VIDEO_UPDATE(apogee)
142   MDRV_VIDEO_UPDATE(radio86)
143143
144144   MDRV_SPEAKER_STANDARD_MONO("mono")
145145   MDRV_SOUND_ADD(WAVE, 0)
146146   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
147147
148148   MDRV_DEVICE_ADD("dma8257", DMA8257)
149   MDRV_DEVICE_CONFIG(apogee_dma)
149   MDRV_DEVICE_CONFIG(radio86_dma)
150150MACHINE_DRIVER_END
151151
152152static void apogee_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
r2904r2905
178178/* Driver */
179179
180180/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT   INIT    CONFIG COMPANY   FULLNAME       FLAGS */
181COMP( 1989, apogee, radio86,0,        apogee,    apogee,apogee, apogee,  "Zavod BRA",    "Apogee BK-01",   0)
181COMP( 1989, apogee, radio86,0,        apogee,    apogee,radio86, apogee,  "Zavod BRA",    "Apogee BK-01",   0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team