Previous 15994 Revisions Next

r1953 Tuesday 11th March, 2008 at 22:49:06 UTC by Wilbert Pol
Removed deprecat.h dependency from video/733_asr.c
[src/mess/drivers]ti990_4.c
[src/mess/video]733_asr.c 733_asr.h

src/mess/video/733_asr.c
r1952r1953
2222
2323#include "driver.h"
2424#include "mslegacy.h"
25#include "deprecat.h"
2625
2726#include "733_asr.h"
2827
r1952r1953
180179   memcpy(dst, fontdata6x8, asrfontdata_size);
181180}
182181
183int asr733_init_term(int unit, void (*int_callback)(int state))
182int asr733_init_term(running_machine *machine, int unit, void (*int_callback)(int state))
184183{
185   asr[unit].bitmap = auto_bitmap_alloc(Machine->screen[0].width, Machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
184   asr[unit].bitmap = auto_bitmap_alloc(machine->screen[0].width, machine->screen[0].height, BITMAP_FORMAT_INDEXED16);
186185
187   fillbitmap(asr[unit].bitmap, Machine->pens[0], &Machine->screen[0].visarea);
186   fillbitmap(asr[unit].bitmap, machine->pens[0], &machine->screen[0].visarea);
188187
189188   asr[unit].int_callback = int_callback;
190189
r1952r1953
218217}
219218
220219/* write a single char on screen */
221static void asr_draw_char(int unit, int character, int x, int y, int color)
220static void asr_draw_char(running_machine *machine, int unit, int character, int x, int y, int color)
222221{
223   drawgfx(asr[unit].bitmap, Machine->gfx[0], character-32, color, 0, 0,
224            x+1, y, &Machine->screen[0].visarea, /*TRANSPARENCY_PEN*/TRANSPARENCY_NONE, 0);
222   drawgfx(asr[unit].bitmap, machine->gfx[0], character-32, color, 0, 0,
223            x+1, y, &machine->screen[0].visarea, /*TRANSPARENCY_PEN*/TRANSPARENCY_NONE, 0);
225224}
226225
227static void asr_linefeed(int unit)
226static void asr_linefeed(running_machine *machine, int unit)
228227{
229228   UINT8 buf[asr_window_width];
230229   int y;
r1952r1953
232231   for (y=asr_window_offset_y; y<asr_window_offset_y+asr_window_height-asr_scroll_step; y++)
233232   {
234233      extract_scanline8(asr[unit].bitmap, asr_window_offset_x, y+asr_scroll_step, asr_window_width, buf);
235      draw_scanline8(asr[unit].bitmap, asr_window_offset_x, y, asr_window_width, buf, Machine->pens, -1);
234      draw_scanline8(asr[unit].bitmap, asr_window_offset_x, y, asr_window_width, buf, machine->pens, -1);
236235   }
237236
238   fillbitmap(asr[unit].bitmap, Machine->pens[0], &asr_scroll_clear_window);
237   fillbitmap(asr[unit].bitmap, machine->pens[0], &asr_scroll_clear_window);
239238}
240239
241static void asr_transmit(int unit, UINT8 data)
240static void asr_transmit(running_machine *machine, int unit, UINT8 data)
242241{
243242   switch (data)
244243   {
r1952r1953
277276
278277   case 0x0A:
279278      /* LF: line feed */
280      asr_linefeed(unit);
279      asr_linefeed(machine, unit);
281280      break;
282281
283282   case 0x0D:
r1952r1953
294293      if (asr[unit].x == 80)
295294      {
296295         asr[unit].x = 0;
297         asr_linefeed(unit);
296         asr_linefeed(machine, unit);
298297      }
299      asr_draw_char(unit, data, asr_window_offset_x+asr[unit].x*8, asr_window_offset_y+asr_window_height-8, 0);
298      asr_draw_char(machine, unit, data, asr_window_offset_x+asr[unit].x*8, asr_window_offset_y+asr_window_height-8, 0);
300299      asr[unit].x++;
301300      break;
302301   }
r1952r1953
364363   14: enable interrupts, 1 to enable interrupts
365364   15: diagnostic mode, 0 for normal mode
366365*/
367void asr733_cru_w(int offset, int data, int unit)
366void asr733_cru_w(running_machine *machine, int offset, int data, int unit)
368367{
369368   switch (offset)
370369   {
r1952r1953
382381      else
383382         asr[unit].xmit_buf &= ~ (1 << offset);
384383      if ((offset == 7) && (asr[unit].mode & AM_dtr_mask) && (asr[unit].mode & AM_rts_mask))   /* right??? */
385         asr_transmit(unit, asr[unit].xmit_buf);
384         asr_transmit(machine, unit, asr[unit].xmit_buf);
386385      break;
387386
388387   case 8:      /* not used */
r1952r1953
420419
421420WRITE8_HANDLER(asr733_0_cru_w)
422421{
423   asr733_cru_w(offset, data, 0);
422   asr733_cru_w(machine, offset, data, 0);
424423}
425424
426425
427426/*
428427   Video refresh
429428*/
430void asr733_refresh(bitmap_t *bitmap, int unit, int x, int y)
429void asr733_refresh(running_machine *machine, bitmap_t *bitmap, int unit, int x, int y)
431430{
432   copybitmap(bitmap, asr[unit].bitmap, 0, 0, x, y, &Machine->screen[0].visarea);
431   copybitmap(bitmap, asr[unit].bitmap, 0, 0, x, y, &machine->screen[0].visarea);
433432}
434433
435434
src/mess/video/733_asr.h
r1952r1953
2424extern PALETTE_INIT ( asr733 ) ;
2525
2626void asr733_init(void);
27int asr733_init_term(int unit, void (*int_callback)(int state));
27int asr733_init_term(running_machine *machine, int unit, void (*int_callback)(int state));
2828
2929void asr733_reset(int unit);
3030
3131int asr733_cru_r(int offset, int unit);
32void asr733_cru_w(int offset, int data, int unit);
32void asr733_cru_w(running_machine *machine, int offset, int data, int unit);
3333
3434 READ8_HANDLER(asr733_0_cru_r);
3535WRITE8_HANDLER(asr733_0_cru_w);
3636
37void asr733_refresh(bitmap_t *bitmap, int unit, int x, int y);
37void asr733_refresh(running_machine *machine, bitmap_t *bitmap, int unit, int x, int y);
3838
3939void asr733_keyboard(int unit);
4040
src/mess/drivers/ti990_4.c
r1952r1953
128128
129129static VIDEO_START( ti990_4 )
130130{
131   asr733_init_term(0, ti990_set_int6);
131   asr733_init_term(machine, 0, ti990_set_int6);
132132}
133133
134134static VIDEO_UPDATE( ti990_4 )
135135{
136   asr733_refresh(bitmap, 0, 0, 0);
136   asr733_refresh(machine, bitmap, 0, 0, 0);
137137   return 0;
138138}
139139

Previous 15994 Revisions Next


© 1998-2018 The MESS Team