Previous 15994 Revisions Next

r15078 Wednesday 2nd May, 2012 at 13:13:33 UTC by Robbbert
Tidyup of Oric driver (not finished yet); fixed uninitialised variable in acia6551 which randomly caused telstrat to crash at start.
[src/emu/machine]6551acia.c
[src/mess/drivers]oric.c
[src/mess/includes]oric.h
[src/mess/machine]oric.c
[src/mess/video]oric.c

src/emu/machine/6551acia.c
r15077r15078
9494void acia6551_device::device_start()
9595{
9696   /* transmit data reg is empty */
97   m_status_register |= (1<<4);
97   m_status_register = (1<<4);
9898   m_timer = machine().scheduler().timer_alloc(FUNC(acia_6551_timer_callback), (void *) this);
9999
100100   transmit_register_reset();
src/mess/machine/oric.c
r15077r15078
1717*********************************************************************/
1818
1919
20#include <stdio.h>
21#include "emu.h"
2220#include "includes/oric.h"
23#include "machine/wd17xx.h"
24#include "machine/6522via.h"
25#include "machine/applefdc.h"
26#include "machine/6551acia.h"
27#include "machine/ctronics.h"
28#include "imagedev/cassette.h"
29#include "sound/ay8910.h"
30#include "imagedev/flopdrv.h"
3121
3222
3323
34static const int enable_logging = 1;
3524
36
3725/* ==0 if oric1 or oric atmos, !=0 if telestrat */
3826
3927/* This does not exist in the real hardware. I have used it to
4028know which sources are interrupting */
41/* bit 2 = telestrat 2nd via interrupt, 1 = microdisc interface,
29/* bit 2 = telestrat 2nd via interrupt,
301 = microdisc interface,
42310 = oric 1st via interrupt */
4332
4433enum
r15077r15078
7059
7160      /* if floppy disc hardware is disabled, do not allow interrupts from it */
7261      if ((input_port_read(machine, "FLOPPY") & 0x07) == ORIC_FLOPPY_INTERFACE_NONE)
73      {
7462         state->m_irqs &=~(1<<1);
75      }
7663   }
7764
7865   /* any irq set? */
79   if ((state->m_irqs & 0x0f)!=0)
80   {
66   if (state->m_irqs & 0x0f)
8167      cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
82   }
8368   else
84   {
8569      cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
86   }
8770}
8871
8972
r15077r15078
10083static void oric_keyboard_sense_refresh(running_machine &machine)
10184{
10285   oric_state *state = machine.driver_data<oric_state>();
103   /* The following assumes that if a 0 is written, it can be used to detect if any key
104    has been pressed.. */
86   /* The following assumes that if a 0 is written, it can be used to detect if any key has been pressed.. */
10587   /* for each bit that is 0, it combines it's pressed state with the pressed state so far */
10688
10789   int i;
r15077r15078
130112
131113   /* clear sense result */
132114   state->m_key_sense_bit = 0;
115
133116   /* any keys pressed on this line? */
134117   if (key_bit!=0)
135118   {
r15077r15078
163146   {
164147      /* if psg is in read register state return reg data */
165148      if (state->m_psg_control==0x01)
166      {
167149         return ay8910_r(space->machine().device("ay8912"), 0);
168      }
169150
170151      /* return high-impedance */
171152      return 0x0ff;
r15077r15078
311292
312293   /* CASSETTE */
313294   /* cassette motor control */
314   if ((state->m_previous_portb_data^data) & (1<<6))
315   {
316      if (data & (1<<6))
317      {
318         //enable_logging = 1;
319      }
320   }
321
322
323      cassette_device_image(device->machine())->change_state(
295   cassette_device_image(device->machine())->change_state(
324296      (data & 0x40) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
325297      CASSETTE_MOTOR_DISABLED);
326298
r15077r15078
353325   state->m_psg_control &=~1;
354326
355327   if (data)
356   {
357328      state->m_psg_control |=1;
358   }
359329
360330   oric_psg_connection_refresh(device->machine());
361331}
r15077r15078
366336   state->m_psg_control &=~2;
367337
368338   if (data)
369   {
370339      state->m_psg_control |=2;
371   }
372340
373341   oric_psg_connection_refresh(device->machine());
374342}
r15077r15078
380348   drvstate->m_irqs &= ~(1<<0);
381349
382350   if (state)
383   {
384      if (enable_logging)
385      {
386         //logerror("oric via1 interrupt\r\n");
387      }
388
389351      drvstate->m_irqs |=(1<<0);
390   }
391352
392353   oric_refresh_ints(device->machine());
393354}
r15077r15078
10761037   /* clear all irqs */
10771038   state->m_irqs = 0;
10781039   state->m_ram_0x0c000 = NULL;
1079
1040   state->m_keyboard_line = 0;
1041   state->m_key_sense_bit = 0;
1042   state->m_keyboard_mask = 0;
1043   state->m_via_port_a_data = 0;
1044   state->m_psg_control = 0;
1045   state->m_previous_portb_data = 0;
1046   state->m_port_3fa_w = 0;
1047   state->m_port_3fb_w = 0;
1048   state->m_wd179x_int_state = 0;
1049   state->m_port_314_r = 0;
1050   state->m_port_318_r = 0;
1051   state->m_port_314_w = 0;
10801052   machine.scheduler().timer_pulse(attotime::from_hz(4800), FUNC(oric_refresh_tape));
10811053}
10821054
r15077r15078
10871059
10881060   state->m_is_telestrat = 0;
10891061
1090   state->m_ram_0x0c000 = auto_alloc_array(machine, char, 16384);
1062   state->m_ram_0x0c000 = auto_alloc_array(machine, UINT8, 16384);
10911063}
10921064
10931065
r15077r15078
11821154      }
11831155      break;
11841156   }
1185   if (enable_logging)
1186   {
1187      if ((offset & 0x0f)!=0x0d)
1188      {
1189         //logerror("via 0 r: %04x %04x\n",offset, (unsigned) cpu_get_reg(machine().device("maincpu"), STATE_GENPC));
1190      }
1191   }
1157
11921158   /* it is repeated */
11931159   return via_0->read(space, offset & 0x0f);
11941160}
r15077r15078
12231189      }
12241190      break;
12251191   }
1226   if (enable_logging)
1227   {
1228      //logerror("via 0 w: %04x %02x %04x\n", offset, data,(unsigned) cpu_get_reg(machine().device("maincpu"), STATE_GENPC));
1229   }
12301192
12311193   via_0->write(space, offset & 0x0f, data);
12321194}
r15077r15078
14261388
14271389   oric_common_init_machine(machine);
14281390
1391   state->m_telestrat_via2_port_a_data = 0;
1392   state->m_telestrat_via2_port_b_data = 0;
14291393   state->m_is_telestrat = 1;
14301394
14311395   /* initialise overlay ram */
14321396   state->m_telestrat_blocks[0].MemType = TELESTRAT_MEM_BLOCK_RAM;
1433   state->m_telestrat_blocks[0].ptr = auto_alloc_array(machine, UINT8, 16384);
1397   state->m_telestrat_blocks[0].ptr = mem+0x020000; //auto_alloc_array(machine, UINT8, 16384);
14341398
14351399   state->m_telestrat_blocks[1].MemType = TELESTRAT_MEM_BLOCK_RAM;
1436   state->m_telestrat_blocks[1].ptr = auto_alloc_array(machine, UINT8, 16384);
1400   state->m_telestrat_blocks[1].ptr = mem+0x024000; //auto_alloc_array(machine, UINT8, 16384);
1401
14371402   state->m_telestrat_blocks[2].MemType = TELESTRAT_MEM_BLOCK_RAM;
1438   state->m_telestrat_blocks[2].ptr = auto_alloc_array(machine, UINT8, 16384);
1403   state->m_telestrat_blocks[2].ptr = mem+0x028000; //auto_alloc_array(machine, UINT8, 16384);
14391404
14401405   /* initialise default cartridge */
14411406   state->m_telestrat_blocks[3].MemType = TELESTRAT_MEM_BLOCK_ROM;
1442   state->m_telestrat_blocks[3].ptr = mem+0x010000;
1407   state->m_telestrat_blocks[3].ptr = mem+0x010000; // telmatic.rom
14431408
14441409   state->m_telestrat_blocks[4].MemType = TELESTRAT_MEM_BLOCK_RAM;
1445   state->m_telestrat_blocks[4].ptr = auto_alloc_array(machine, UINT8, 16384);
1410   state->m_telestrat_blocks[4].ptr = mem+0x02c000; //auto_alloc_array(machine, UINT8, 16384);
14461411
14471412   /* initialise default cartridge */
14481413   state->m_telestrat_blocks[5].MemType = TELESTRAT_MEM_BLOCK_ROM;
1449   state->m_telestrat_blocks[5].ptr = mem+0x014000;
1414   state->m_telestrat_blocks[5].ptr = mem+0x014000;  // teleass.rom
14501415
14511416   /* initialise default cartridge */
14521417   state->m_telestrat_blocks[6].MemType = TELESTRAT_MEM_BLOCK_ROM;
1453   state->m_telestrat_blocks[6].ptr = mem+0x018000;
1418   state->m_telestrat_blocks[6].ptr = mem+0x018000; // hyperbas.rom
14541419
14551420   /* initialise default cartridge */
14561421   state->m_telestrat_blocks[7].MemType = TELESTRAT_MEM_BLOCK_ROM;
1457   state->m_telestrat_blocks[7].ptr = mem+0x01c000;
1422   state->m_telestrat_blocks[7].ptr = mem+0x01c000; // telmon24.rom
14581423
14591424   state->m_telestrat_bank_selection = 7;
14601425   telestrat_refresh_mem(machine);
src/mess/includes/oric.h
r15077r15078
77#ifndef ORIC_H_
88#define ORIC_H_
99
10#include "emu.h"
11#include "cpu/m6502/m6502.h"
12#include "sound/ay8910.h"
13#include "sound/wave.h"
1014#include "machine/6522via.h"
15#include "machine/6551acia.h"
16#include "machine/ctronics.h"
1117#include "machine/wd17xx.h"
18//#include <stdio.h>
19#include "machine/applefdc.h"
20#include "imagedev/flopdrv.h"
21#include "imagedev/cassette.h"
22#include "formats/oric_dsk.h"
23#include "formats/ap2_dsk.h"
24#include "formats/oric_tap.h"
1225
1326enum
1427{
r15077r15078
2336   unsigned char *ptr;
2437} telestrat_mem_block;
2538
39
2640/* current state of the display */
2741/* some attributes persist until they are turned off.
2842This structure holds this persistant information */
2943typedef struct
3044{
3145   /* foreground and background colour used for rendering */
32   /* if flash attribute is set, these two will both be equal
33    to background colour */
34   int active_foreground_colour;
35   int active_background_colour;
46   /* if flash attribute is set, these two will both be equal to background colour */
47   UINT8 active_foreground_colour;
48   UINT8 active_background_colour;
3649   /* current foreground and background colour */
37   int foreground_colour;
38   int background_colour;
39   int mode;
50   UINT8 foreground_colour;
51   UINT8 background_colour;
52   UINT8 mode;
4053   /* text attributes */
41   int text_attributes;
54   UINT8 text_attributes;
4255
43   unsigned long read_addr;
56   offs_t read_addr;
4457
4558   /* current addr to fetch data */
46   unsigned char *char_data;
59   UINT8 *char_data;
4760   /* base of char data */
48   unsigned char *char_base;
61   UINT8 *char_base;
4962
5063   /* if (1<<3), display graphics, if 0, hide graphics */
51   int flash_state;
5264   /* current count */
53   int flash_count;
65   UINT8 flash_count;
5466} oric_vh_state;
5567
5668
r15077r15078
6274        m_ram(*this, "ram") { }
6375
6476   optional_shared_ptr<UINT8> m_ram;
65   int m_is_telestrat;
66   unsigned char m_irqs;
67   char *m_ram_0x0c000;
68   int m_keyboard_line;
69   char m_key_sense_bit;
70   char m_keyboard_mask;
71   unsigned char m_via_port_a_data;
72   char m_psg_control;
73   unsigned char m_previous_portb_data;
74   unsigned char m_port_3fa_w;
75   unsigned char m_port_3fb_w;
76   unsigned char m_wd179x_int_state;
77   unsigned char m_port_314_r;
78   unsigned char m_port_318_r;
79   unsigned char m_port_314_w;
80   unsigned char m_telestrat_bank_selection;
81   unsigned char m_telestrat_via2_port_a_data;
82   unsigned char m_telestrat_via2_port_b_data;
77   bool m_is_telestrat;
78   UINT8 m_irqs;
79   UINT8 *m_ram_0x0c000;
80   UINT8 m_keyboard_line;
81   UINT8 m_key_sense_bit;
82   UINT8 m_keyboard_mask;
83   UINT8 m_via_port_a_data;
84   UINT8 m_psg_control;
85   UINT8 m_previous_portb_data;
86   UINT8 m_port_3fa_w;
87   UINT8 m_port_3fb_w;
88   UINT8 m_wd179x_int_state;
89   UINT8 m_port_314_r;
90   UINT8 m_port_318_r;
91   UINT8 m_port_314_w;
92   UINT8 m_telestrat_bank_selection;
93   UINT8 m_telestrat_via2_port_a_data;
94   UINT8 m_telestrat_via2_port_b_data;
8395   telestrat_mem_block m_telestrat_blocks[8];
8496   oric_vh_state m_vh_state;
8597   DECLARE_WRITE8_MEMBER(oric_psg_porta_write);
src/mess/video/oric.c
r15077r15078
1010
1111***************************************************************************/
1212
13#include "emu.h"
1413#include "includes/oric.h"
1514
16static void oric_vh_update_flash(oric_state *state);
17static void oric_vh_update_attribute(running_machine &machine,int c);
18static void oric_refresh_charset(oric_state *state);
19
20
2115static TIMER_CALLBACK(oric_vh_timer_callback)
2216{
2317   oric_state *state = machine.driver_data<oric_state>();
2418   /* update flash count */
2519   state->m_vh_state.flash_count++;
26   if (state->m_vh_state.flash_count == 16)
27   {
28      state->m_vh_state.flash_count = 0;
29      state->m_vh_state.flash_state ^=(1<<3);
30      oric_vh_update_flash(state);
31   }
3220}
3321
34VIDEO_START( oric )
35{
36   oric_state *state = machine.driver_data<oric_state>();
37   /* initialise flash timer */
38   state->m_vh_state.flash_count = 0;
39   state->m_vh_state.flash_state = 0;
40   machine.scheduler().timer_pulse(attotime::from_hz(50), FUNC(oric_vh_timer_callback));
41   /* mode */
42   oric_vh_update_attribute(machine,(1<<3)|(1<<4));
43}
44
45
4622static void oric_vh_update_flash(oric_state *state)
4723{
4824   /* flash active? */
49   if (state->m_vh_state.text_attributes & (1<<2))
25   if (BIT(state->m_vh_state.text_attributes, 2))
5026   {
5127      /* yes */
5228
5329      /* show or hide text? */
54      if (state->m_vh_state.flash_state)
30      if (BIT(state->m_vh_state.flash_count, 4))
5531      {
5632         /* hide */
5733         /* set foreground and background to be the same */
r15077r15078
7450static void oric_refresh_charset(oric_state *state)
7551{
7652   /* alternate char set? */
77   if ((state->m_vh_state.text_attributes & (1<<0))==0)
53   if (BIT(state->m_vh_state.text_attributes, 0))
7854   {
79      /* no */
80      state->m_vh_state.char_data = state->m_vh_state.char_base;
55      /* yes */
56      state->m_vh_state.char_data = state->m_vh_state.char_base + (128*8);
8157   }
8258   else
8359   {
84      /* yes */
85      state->m_vh_state.char_data = state->m_vh_state.char_base + (128*8);
60      /* no */
61      state->m_vh_state.char_data = state->m_vh_state.char_base;
8662   }
8763}
8864
8965/* update video hardware state depending on the new attribute */
90static void oric_vh_update_attribute(running_machine &machine,int c)
66static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
9167{
9268   oric_state *state = machine.driver_data<oric_state>();
9369   /* attribute */
94   int attribute = c & 0x03f;
70   UINT8 attribute = c & 0x03f;
9571   address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
9672
9773   switch ((attribute>>3) & 0x03)
9874   {
9975      case 0:
10076      {
101         /* set foreground colour */
77         /* set foreground colour 00-07 = black,red,green,yellow,blue,magenta,cyan,white */
10278         state->m_vh_state.foreground_colour = attribute & 0x07;
10379         oric_vh_update_flash(state);
10480      }
r15077r15078
128104         /* set video mode */
129105         state->m_vh_state.mode = attribute & 0x07;
130106
131         /* a different charset base is used depending on the video mode */
132         /* hires takes all the data from 0x0a000 through to about 0x0bf68,
133            so the charset is moved to 0x09800 */
134         /* text mode starts at 0x0bb80 and so the charset is in a different location */
135         if (state->m_vh_state.mode & (1<<2))
107         // a different charset base is used depending on the video mode
108         // hires takes all the data from 0x0a000 through to about 0x0bf68,
109         // so the charset is moved to 0x09800 */
110         // text mode starts at 0x0bb80 and so the charset is in a different location
111         if (BIT(state->m_vh_state.mode, 2))
136112         {
137113            /* set screen memory base and standard charset location for this mode */
138114            state->m_vh_state.read_addr = 0x0a000;
139115            if (state->m_ram)
140               state->m_vh_state.char_base = state->m_ram + (unsigned long)0x09800;
116               state->m_vh_state.char_base = state->m_ram + (offs_t)0x09800;
141117            else
142               state->m_vh_state.char_base = (unsigned char *)space->get_read_ptr(0x09800);
143
144            /* changing the mode also changes the position of the standard charset
145                and alternative charset */
146            oric_refresh_charset(state);
118               state->m_vh_state.char_base = (UINT8 *)space->get_read_ptr(0x09800);
147119         }
148120         else
149121         {
150122            /* set screen memory base and standard charset location for this mode */
151123            state->m_vh_state.read_addr = 0x0bb80;
152124            if (state->m_ram)
153               state->m_vh_state.char_base = state->m_ram + (unsigned long)0x0b400;
125               state->m_vh_state.char_base = state->m_ram + (offs_t)0x0b400;
154126            else
155               state->m_vh_state.char_base = (unsigned char *)space->get_read_ptr(0x0b400);
156
157            /* changing the mode also changes the position of the standard charset
158                and alternative charset */
159            oric_refresh_charset(state);
127               state->m_vh_state.char_base = (UINT8 *)space->get_read_ptr(0x0b400);
160128         }
129         /* changing the mode also changes the position of the standard charset and alternative charset */
130         oric_refresh_charset(state);
161131      }
162132      break;
163133
r15077r15078
169139
170140/* render 6-pixels using foreground and background colours specified */
171141/* used in hires and text mode */
172static void oric_vh_render_6pixels(bitmap_ind16 &bitmap,int x,int y, int fg, int bg,int data, int invert_flag)
142static void oric_vh_render_6pixels(bitmap_ind16 &bitmap, int x, UINT8 y, UINT8 fg, UINT8 bg, UINT8 data, bool invert_flag)
173143{
174   int i;
175   int pens[2];
176   int px;
177
178144   /* invert? */
179145   if (invert_flag)
180146   {
r15077r15078
182148      bg ^=0x07;
183149   }
184150
185   pens[1] = fg;
186   pens[0] = bg;
187
188   px = x;
189   for (i=0; i<6; i++)
190   {
191      int col;
192
193      col = pens[(data>>5) & 0x01];
194      bitmap.pix16(y, px) = col;
195      px++;
196      data = data<<1;
197   }
151   bitmap.pix16(y, x++) = BIT(data, 5) ? fg : bg;
152   bitmap.pix16(y, x++) = BIT(data, 4) ? fg : bg;
153   bitmap.pix16(y, x++) = BIT(data, 3) ? fg : bg;
154   bitmap.pix16(y, x++) = BIT(data, 2) ? fg : bg;
155   bitmap.pix16(y, x++) = BIT(data, 1) ? fg : bg;
156   bitmap.pix16(y, x++) = BIT(data, 0) ? fg : bg;
198157}
199158
200159
r15077r15078
207166SCREEN_UPDATE_IND16( oric )
208167{
209168   oric_state *state = screen.machine().driver_data<oric_state>();
210   unsigned char *RAM;
211   int byte_offset;
212   int y;
213   unsigned long read_addr_base;
214   int hires_active;
169   UINT8 *RAM, y;
170   offs_t byte_offset, read_addr_base;
171   bool hires_active;
215172
216173   RAM = state->m_ram;
217174
r15077r15078
219176   read_addr_base = state->m_vh_state.read_addr;
220177
221178   /* is hires active? */
222   if (state->m_vh_state.mode & (1<<2))
223   {
224      hires_active = 1;
225   }
226   else
227   {
228      hires_active = 0;
229   }
179   hires_active = BIT(state->m_vh_state.mode, 2);
230180
231
232181   for (y = 0; y < 224; y++)
233182   {
234183      int x = 0;
r15077r15078
237186      oric_vh_update_attribute(screen.machine(),7);
238187      /* background colour black */
239188      oric_vh_update_attribute(screen.machine(),(1<<3));
240
241189      oric_vh_update_attribute(screen.machine(),(1<<4));
242190
243191      for (byte_offset=0; byte_offset<40; byte_offset++)
244192      {
245         int c;
246         unsigned long read_addr;
193         UINT8 c;
194         offs_t read_addr;
247195
248196         /* after line 200 all rendering is done in text mode */
249197         if (y<200)
250198         {
251            /* calculate fetch address based on current line and
252                current mode */
199            /* calculate fetch address based on current line and current mode */
253200            if (hires_active)
254201            {
255               read_addr = (unsigned long)read_addr_base + (unsigned long)byte_offset + (unsigned long)(y*40);
202               read_addr = read_addr_base + byte_offset + (offs_t)(y*40);
256203            }
257204            else
258205            {
259               int char_line;
260
261               char_line = (y>>3);
262               read_addr = (unsigned long)read_addr_base + (unsigned long)byte_offset + (unsigned long)(char_line*40);
206               UINT8 char_line = y>>3;
207               read_addr = read_addr_base + byte_offset + (offs_t)(char_line*40);
263208            }
264209         }
265210         else
266211         {
267            int char_line;
268
269            char_line = ((y-200)>>3);
270            read_addr = (unsigned long)read_addr_base + (unsigned long)byte_offset + (unsigned long)(char_line*40);
212            UINT8 char_line = (y-200)>>3;
213            read_addr = read_addr_base + byte_offset + (offs_t)(char_line*40);
271214         }
272215
273216         /* fetch data */
r15077r15078
284227            if (y < 200)
285228            {
286229               /* is hires active? */
287               if (state->m_vh_state.mode & (1 << 2))
288               {
289                  hires_active = 1;
290               }
291               else
292               {
293                  hires_active = 0;
294               }
295
230               hires_active = BIT(state->m_vh_state.mode, 2);
296231               read_addr_base = state->m_vh_state.read_addr;
297232            }
298233         }
r15077r15078
301236            /* hires? */
302237            if (hires_active)
303238            {
304               int pixel_data = c & 0x03f;
239               UINT8 pixel_data = c & 0x03f;
305240               /* plot hires pixels */
306               oric_vh_render_6pixels(bitmap,x,y,state->m_vh_state.active_foreground_colour, state->m_vh_state.active_background_colour, pixel_data,(c & 0x080));
241               oric_vh_render_6pixels(bitmap,x,y,state->m_vh_state.active_foreground_colour, state->m_vh_state.active_background_colour, pixel_data, BIT(c, 7));
307242            }
308243            else
309244            {
310               int char_index;
311               int char_data;
312               int ch_line;
245               UINT8 char_index, char_data, ch_line;
313246
314247               char_index = (c & 0x07f);
315248
316249               ch_line = y & 7;
317250
318251               /* is double height set? */
319               if (state->m_vh_state.text_attributes & (1<<1))
252               if (BIT(state->m_vh_state.text_attributes, 1))
320253               {
321                  /* if char line is even, top half of character is displayed,
322                        if char line is odd, bottom half of character is displayed */
323                  int double_height_flag = ((y>>3) & 0x01);
254               /* if char line is even, top half of character is displayed else bottom half */
255                  UINT8 double_height_flag = BIT(y, 3);
324256
325257                  /* calculate line to fetch */
326258                  ch_line = (ch_line>>1) + (double_height_flag<<2);
r15077r15078
332264               /* draw! */
333265               oric_vh_render_6pixels(bitmap,x,y,
334266                  state->m_vh_state.active_foreground_colour,
335                  state->m_vh_state.active_background_colour, char_data, (c & 0x080));
267                  state->m_vh_state.active_background_colour, char_data, BIT(c, 7));
336268            }
337269
338270         }
339271
340         x=x+6;
272         x+=6;
341273      }
342274
343275      /* after 200 lines have been drawn, force a change of the read address */
r15077r15078
346278      if (y==199)
347279      {
348280         /* mode */
349         read_addr_base = (unsigned long)0x0bf68;
281         read_addr_base = (offs_t)0x0bf68;
350282         hires_active = 0;
351283      }
352284   }
r15077r15078
354286}
355287
356288
289VIDEO_START( oric )
290{
291   oric_state *state = machine.driver_data<oric_state>();
292   // initialise variables
293   state->m_vh_state.active_foreground_colour = 0;
294   state->m_vh_state.active_background_colour = 0;
295   state->m_vh_state.foreground_colour = 0;
296   state->m_vh_state.background_colour = 0;
297   state->m_vh_state.mode = 0;
298   state->m_vh_state.text_attributes = 0;
299   state->m_vh_state.read_addr = 0;
300   state->m_vh_state.char_data = 0;
301   state->m_vh_state.char_base = 0;
302   /* initialise flash timer */
303   state->m_vh_state.flash_count = 0;
304   machine.scheduler().timer_pulse(attotime::from_hz(50), FUNC(oric_vh_timer_callback));
305   /* mode */
306   oric_vh_update_attribute(machine,(1<<3)|(1<<4));
307}
308
src/mess/drivers/oric.c
r15077r15078
1616
1717*********************************************************************/
1818
19#include "emu.h"
20#include "cpu/m6502/m6502.h"
21#include "sound/wave.h"
2219#include "includes/oric.h"
23#include "machine/ctronics.h"
24#include "imagedev/flopdrv.h"
25#include "imagedev/cassette.h"
26#include "formats/oric_dsk.h"
27#include "formats/ap2_dsk.h"
28#include "formats/oric_tap.h"
29#include "sound/ay8910.h"
30#include "machine/6522via.h"
31#include "machine/6551acia.h"
32#include "machine/wd17xx.h"
3320
3421/*
3522    Explanation of memory regions:
r15077r15078
5744
5845
5946static ADDRESS_MAP_START(oric_mem, AS_PROGRAM, 8, oric_state )
60    AM_RANGE( 0x0000, 0xbfff) AM_RAM AM_SHARE("ram")
61    AM_RANGE( 0xc000, 0xdfff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank5")
47   AM_RANGE( 0x0000, 0xbfff) AM_RAM AM_SHARE("ram")
48   AM_RANGE( 0xc000, 0xdfff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank5")
6249   AM_RANGE( 0xe000, 0xf7ff) AM_READ_BANK("bank2") AM_WRITE_BANK("bank6")
6350   AM_RANGE( 0xf800, 0xffff) AM_READ_BANK("bank3") AM_WRITE_BANK("bank7")
6451ADDRESS_MAP_END
r15077r15078
7057   AM_RANGE( 0x0000, 0x02ff) AM_RAM
7158   AM_RANGE( 0x0300, 0x030f) AM_DEVREADWRITE("via6522_0", via6522_device, read, write)
7259   AM_RANGE( 0x0310, 0x031b) AM_READWRITE(oric_microdisc_r, oric_microdisc_w )
73   AM_RANGE( 0x031c, 0x031f) AM_DEVREADWRITE("acia", acia6551_device, read, write)
60   AM_RANGE( 0x031c, 0x031f) AM_DEVREADWRITE("acia", acia6551_device, read, write)
7461   AM_RANGE( 0x0320, 0x032f) AM_DEVREADWRITE("via6522_1", via6522_device, read, write)
7562   AM_RANGE( 0x0400, 0xbfff) AM_RAM
7663   AM_RANGE( 0xc000, 0xffff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2")
r15077r15078
7865
7966
8067static INPUT_PORTS_START(oric)
81    PORT_START("ROW0")
68   PORT_START("ROW0")
8269   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)         PORT_CHAR('3') PORT_CHAR('#')
8370   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X)         PORT_CHAR('x') PORT_CHAR('X')
8471   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)         PORT_CHAR('1') PORT_CHAR('!')
r15077r15078
184171INPUT_PORTS_END
185172
186173static INPUT_PORTS_START(prav8d)
187    PORT_START("ROW0")
174   PORT_START("ROW0")
188175   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)                           PORT_CHAR('3') PORT_CHAR('#')
189176   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("X \xd0\xac") PORT_CODE(KEYCODE_X)         PORT_CHAR('X')
190177   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)                           PORT_CHAR('1') PORT_CHAR('!')
r15077r15078
395382   MCFG_MACHINE_START( oric )
396383   MCFG_MACHINE_RESET( oric )
397384
398    /* video hardware */
385   /* video hardware */
399386   MCFG_SCREEN_ADD("screen", RASTER)
400387   MCFG_SCREEN_REFRESH_RATE(60)
401388   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
r15077r15078
512499ROM_END
513500
514501ROM_START(telstrat)
515   ROM_REGION(0x20000, "maincpu", 0)   /* 0x10000 + (0x04000 * 4) */
502   ROM_REGION(0x30000, "maincpu", 0)   /* 0x10000 + (0x04000 * 4) */
516503   ROM_LOAD ("telmatic.rom", 0x010000, 0x02000, CRC(94358dc6) SHA1(35f92a0477a88f5cf564971125047ffcfa02ec10) )
517504   ROM_LOAD ("teleass.rom",  0x014000, 0x04000, CRC(68b0fde6) SHA1(9e9af51dae3199cccf49ab3f0d47e2b9be4ba97d) )
518505   ROM_LOAD ("hyperbas.rom", 0x018000, 0x04000, CRC(1d96ab50) SHA1(f5f70a0eb59f8cd6c261e179ae78ef906f68ed63) )
r15077r15078
521508
522509ROM_START(prav8d)
523510   ROM_REGION(0x14300, "maincpu", 0)   /* 0x10000 + 0x04000 + 0x00100 + 0x00200 */
524    ROM_LOAD( "pravetzt.rom", 0x10000, 0x4000, CRC(58079502) SHA1(7afc276cb118adff72e4f16698f94bf3b2c64146) )
511   ROM_LOAD( "pravetzt.rom", 0x10000, 0x4000, CRC(58079502) SHA1(7afc276cb118adff72e4f16698f94bf3b2c64146) )
525512   ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) )
526    ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) )
513   ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) )
527514ROM_END
528515
529516ROM_START(prav8dd)
r15077r15078
532519   ROMX_LOAD( "8d.rom",       0x10000, 0x4000, CRC(b48973ef) SHA1(fd47c977fc215a3b577596a7483df53e8a1e9c83), ROM_BIOS(1) )
533520   ROM_SYSTEM_BIOS( 1, "radosoft", "RadoSoft Disk ROM, 1992")
534521   ROMX_LOAD( "pravetzd.rom", 0x10000, 0x4000, CRC(f8d23821) SHA1(f87ad3c5832773b6e0614905552a80c98dc8e2a5), ROM_BIOS(2) )
535    ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) )
536    ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) )
522   ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) )
523   ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) )
537524ROM_END
538525
539526
540527/*    YEAR   NAME       PARENT  COMPAT  MACHINE     INPUT       INIT    COMPANY         FULLNAME */
541COMP( 1983, oric1,     0,      0,      oric,       oric,       0,       "Tangerine",    "Oric 1" , 0)
542COMP( 1984, orica,     oric1,   0,      oric,       orica,       0,       "Tangerine",    "Oric Atmos" , 0)
543COMP( 1985, prav8d,    oric1,   0,      prav8d,     prav8d,     0,      "Pravetz",      "Pravetz 8D", 0)
544COMP( 1989, prav8dd,   oric1,   0,      prav8d,     prav8d,     0,      "Pravetz",      "Pravetz 8D (Disk ROM)", GAME_UNOFFICIAL)
545COMP( 1986, telstrat,  oric1,   0,      telstrat,   telstrat,   0,      "Tangerine",    "Oric Telestrat", GAME_NOT_WORKING )
528COMP( 1983, oric1,      0,      0,      oric,       oric,       0,    "Tangerine",    "Oric 1" , 0)
529COMP( 1984, orica,      oric1,  0,      oric,       orica,      0,    "Tangerine",    "Oric Atmos" , 0)
530COMP( 1985, prav8d,     oric1,  0,      prav8d,     prav8d,     0,    "Pravetz",      "Pravetz 8D", 0)
531COMP( 1989, prav8dd,    oric1,  0,      prav8d,     prav8d,     0,    "Pravetz",      "Pravetz 8D (Disk ROM)", GAME_UNOFFICIAL)
532COMP( 1986, telstrat,   oric1,  0,      telstrat,   telstrat,   0,    "Tangerine",    "Oric Telestrat", GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team