~ubuntu-branches/ubuntu/karmic/xmame/karmic

« back to all changes in this revision

Viewing changes to mess/vidhrdw/atom.c

  • Committer: Bazaar Package Importer
  • Author(s): Bruno Barrera C.
  • Date: 2007-02-16 10:06:54 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20070216100654-iztas2cl47k5j039
Tags: 0.106-2
* Added Italian debconf templates translation. (closes: #382672)
* Added German debconf templates translation. (closes: #396610)
* Added Japanese debconf templates translation. (closes: #400011)
* Added Portuguese debconf templates translation. (closes: #409960)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
******************************************************************************/
6
6
 
 
7
#include "driver.h"
7
8
#include "vidhrdw/generic.h"
8
9
#include "vidhrdw/m6847.h"
9
10
#include "includes/atom.h"
10
11
 
11
 
static void atom_charproc(UINT8 c)
12
 
{
13
 
        m6847_inv_w(0,          (c & 0x80));
14
 
        m6847_as_w(0,           (c & 0x40));
15
 
        m6847_intext_w(0,       (c & 0x40));
 
12
static ATTR_CONST UINT8 atom_get_attributes(UINT8 c)
 
13
{
 
14
        extern UINT8 atom_8255_porta;
 
15
        extern UINT8 atom_8255_portc;
 
16
        UINT8 result = 0x00;
 
17
        if (c & 0x40)                           result |= M6847_AS | M6847_INTEXT;
 
18
        if (c & 0x80)                           result |= M6847_INV;
 
19
        if (atom_8255_porta & 0x80)     result |= M6847_GM2;
 
20
        if (atom_8255_porta & 0x40)     result |= M6847_GM1;
 
21
        if (atom_8255_porta & 0x20)     result |= M6847_GM0;
 
22
        if (atom_8255_porta & 0x10)     result |= M6847_AG;
 
23
        if (atom_8255_portc & 0x08)     result |= M6847_CSS;
 
24
        return result;
 
25
}
 
26
 
 
27
static const UINT8 *atom_get_video_ram(int scanline)
 
28
{
 
29
        return videoram + (scanline / 12) * 0x20;
16
30
}
17
31
 
18
32
VIDEO_START( atom )
19
33
{
20
 
        struct m6847_init_params p;
21
 
 
22
 
        m6847_vh_normalparams(&p);
23
 
        p.version = M6847_VERSION_ORIGINAL_PAL;
24
 
        p.ram = memory_region(REGION_CPU1) + 0x8000;
25
 
        p.ramsize = 0x10000;
26
 
        p.charproc = atom_charproc;
27
 
 
28
 
        if (video_start_m6847(&p))
29
 
                return 1;
30
 
 
31
 
        return (0);
 
34
        m6847_config cfg;
 
35
 
 
36
        memset(&cfg, 0, sizeof(cfg));
 
37
        cfg.type = M6847_VERSION_ORIGINAL_PAL;
 
38
        cfg.get_attributes = atom_get_attributes;
 
39
        cfg.get_video_ram = atom_get_video_ram;
 
40
        m6847_init(&cfg);
 
41
 
 
42
        return 0;
32
43
}
33
44