machine_hpcsh.cc Source File

Back to the index.

machine_hpcsh.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2009 Anders Gavare. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * 3. The name of the author may not be used to endorse or promote products
13  * derived from this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  *
28  * COMMENT: Handheld SuperH-based machines
29  */
30 
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <string.h>
34 
35 #include "cpu.h"
36 #include "device.h"
37 #include "devices.h"
38 #include "machine.h"
39 #include "memory.h"
40 #include "misc.h"
41 
43 #include "thirdparty/vripreg.h"
44 
45 
47 {
48 /*
49  char tmpstr[1000];
50  struct hpc_bootinfo hpc_bootinfo;
51  int hpc_platid_flags = 0, hpc_platid_cpu_submodel = 0,
52  hpc_platid_cpu_model = 0, hpc_platid_cpu_series = 0,
53  hpc_platid_cpu_arch = 0,
54  hpc_platid_submodel = 0, hpc_platid_model = 0,
55  hpc_platid_series = 0, hpc_platid_vendor = 0;
56  uint64_t hpc_fb_addr = 0;
57  int hpc_fb_bits = 0, hpc_fb_encoding = 0;
58  int hpc_fb_xsize = 0;
59  int hpc_fb_ysize = 0;
60  int hpc_fb_xsize_mem = 0;
61  int hpc_fb_ysize_mem = 0;
62 
63  memset(&hpc_bootinfo, 0, sizeof(hpc_bootinfo));
64 */
65  machine->machine_name = strdup("HPCsh");
67 
68  if (!machine->x11_md.in_use)
69  fprintf(stderr, "-------------------------------------"
70  "------------------------------------------\n"
71  "\n WARNING! You are emulating a HPCsh without -X."
72  "\n You will miss graphical output!\n\n"
73  "-------------------------------------"
74  "------------------------------------------\n");
75 
76  /* 32 MB in two parts, each included twice (shadowed): */
77  dev_ram_init(machine, 0x0c000000, 0x01000000, DEV_RAM_MIRROR, 0x0);
78  dev_ram_init(machine, 0x0d000000, 0x01000000, DEV_RAM_MIRROR, 0x0);
79  dev_ram_init(machine, 0x0e000000, 0x01000000, DEV_RAM_MIRROR,
80  0x01000000);
81  dev_ram_init(machine, 0x0f000000, 0x01000000, DEV_RAM_MIRROR,
82  0x01000000);
83 
84  dev_fb_init(machine, machine->memory, 0x10000000,
85  VFB_HPC, 640,240, 640,240, 16, machine->machine_name);
86 }
87 
88 
90 {
91  machine->cpu_name = strdup("SH7750");
92 }
93 
94 
96 {
97  /* TODO: Model dependent. */
99 }
100 
101 
103 {
104  MR_DEFAULT(hpcsh, "Handhelp SH (HPCsh)", ARCH_SH, MACHINE_HPCSH);
105 
106  machine_entry_add_alias(me, "hpcsh");
107 
108  machine_entry_add_subtype(me, "Jornada 680",
109  MACHINE_HPCSH_JORNADA680, "jornada680", NULL);
110 
111  machine_entry_add_subtype(me, "Jornada 690",
112  MACHINE_HPCSH_JORNADA690, "jornada690", NULL);
113 
114  me->set_default_ram = machine_default_ram_hpcsh;
115 }
116 
MACHINE_DEFAULT_CPU(hpcsh)
char * cpu_name
Definition: machine.h:133
struct vfb_data * dev_fb_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, int vfb_type, int visible_xsize, int visible_ysize, int xsize, int ysize, int bit_depth, const char *name)
Definition: dev_fb.cc:834
MACHINE_REGISTER(hpcsh)
struct memory * memory
Definition: machine.h:126
#define MACHINE_HPCSH
Definition: machine.h:251
#define MACHINE_HPCSH_JORNADA690
Definition: machine.h:299
int physical_ram_in_mb
Definition: machine.h:147
#define DEV_RAM_MIRROR
Definition: devices.h:365
#define EMUL_LITTLE_ENDIAN
Definition: misc.h:164
void dev_ram_init(struct machine *machine, uint64_t baseaddr, uint64_t length, int mode, uint64_t otheraddress, const char *name)
Definition: dev_ram.cc:134
void machine_entry_add_subtype(struct machine_entry *me, const char *name, int oldstyle_subtype,...)
Definition: machine.cc:717
void machine_entry_add_alias(struct machine_entry *me, const char *name)
Definition: machine.cc:697
MACHINE_SETUP(hpcsh)
#define MACHINE_HPCSH_JORNADA680
Definition: machine.h:298
struct x11_md x11_md
Definition: machine.h:179
Definition: cpu.h:326
#define ARCH_SH
Definition: machine.h:207
int in_use
Definition: machine.h:82
uint8_t byte_order
Definition: cpu.h:347
#define MR_DEFAULT(x, name, arch, type)
Definition: machine.h:370
const char * machine_name
Definition: machine.h:115
MACHINE_DEFAULT_RAM(hpcsh)
#define VFB_HPC
Definition: devices.h:191

Generated on Fri Dec 7 2018 19:52:23 for GXemul by doxygen 1.8.13