/[gxemul]/trunk/src/machines/README
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/machines/README

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 37 by dpavlin, Mon Oct 8 16:19:37 2007 UTC revision 38 by dpavlin, Mon Oct 8 16:21:53 2007 UTC
# Line 1  Line 1 
1  $Id: README,v 1.3 2006/01/01 20:41:25 debug Exp $  $Id: README,v 1.4 2007/04/10 17:03:16 debug Exp $
2    
3  How to add new machine types to GXemul:  How to add new machine types to GXemul:
4  ---------------------------------------  ---------------------------------------
# Line 12  A machine_*.c file may contain more than Line 12  A machine_*.c file may contain more than
12  machine_test.c contains several "bare" and "test" machines), but usually it is  machine_test.c contains several "bare" and "test" machines), but usually it is
13  best to think of these files as containing one machine per file.  best to think of these files as containing one machine per file.
14    
15    The main code parts are:
16    
17            MACHINE_SETUP(my_machine_name)
18            {      
19                    machine->machine_name = "My Machine Name";
20    
21                    ...
22    
23                    /*  add devices and busses here  */
24    
25                    if (!machine->prom_emulation)
26                            return;
27    
28                    /*  add prom emulation stuff here, e.g. register
29                        contents and memory contents at startup  */
30            }
31    
32            MACHINE_DEFAULT_CPU(my_machine_name)
33            {
34                    /*  Replace 5Kc with the name of the CPU in
35                        the machine you are emulating:  */
36                    machine->cpu_name = strdup("5Kc");
37            }
38    
39            MACHINE_DEFAULT_RAM(my_machine_name)
40            {
41                    /*  Set this to the amount of RAM in MB that
42                        the machine mode will use by default, unless
43                        overridden with the -M option:  */
44                    machine->physical_ram_in_mb = 64;
45            }
46    
47            MACHINE_REGISTER(my_machine_name)
48            {
49                    /*  Register the machine name. Change ARCH_MIPS to
50                        the desired architecture, and make sure that
51                        MACHINE_MY_MACHINE is defined in
52                        src/include/machine.h!  */
53                    MR_DEFAULT(my_machine_name, "My Machine Name",
54                        ARCH_MIPS, MACHINE_MY_MACHINE);
55    
56                    me->set_default_ram = machine_default_ram_my_machine_name;
57    
58                    /*  Add an alias. This is what will show up in the
59                        -H list, and is used by the -E option:  */
60                    machine_entry_add_alias(me, "my_machine_name");
61            }
62    

Legend:
Removed from v.37  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.26