/[gxemul]/trunk/src/machines/machine_dreamcast.c
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/machine_dreamcast.c

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

revision 31 by dpavlin, Mon Oct 8 16:20:40 2007 UTC revision 32 by dpavlin, Mon Oct 8 16:20:58 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: machine_dreamcast.c,v 1.3 2006/07/25 21:49:14 debug Exp $   *  $Id: machine_dreamcast.c,v 1.24 2006/11/06 05:32:38 debug Exp $
29     *
30     *  Dreamcast.
31   */   */
32    
33  #include <stdio.h>  #include <stdio.h>
# Line 43  Line 45 
45  MACHINE_SETUP(dreamcast)  MACHINE_SETUP(dreamcast)
46  {  {
47          machine->machine_name = "Dreamcast";          machine->machine_name = "Dreamcast";
48            machine->stable = 1;
49    
50            if (machine->emulated_hz == 0)
51                    machine->emulated_hz = 200000000;
52    
53            /*  50 MHz SH4 PCLOCK:  */
54            machine->cpus[0]->cd.sh.pclock = 50000000;
55    
56            if (!machine->use_x11)
57                    fprintf(stderr, "-------------------------------------"
58                        "------------------------------------------\n"
59                        "\n  WARNING!  You are emulating a Dreamcast without -X."
60                        "\n            You will miss graphical output!\n\n"
61                        "-------------------------------------"
62                        "------------------------------------------\n");
63    
64            /*
65             *  Physical address layout on the Dreamcast, according to a
66             *  combination of sources:  NetBSD sources, KalistOS sources,
67             *  http://www.boob.co.uk/docs/Dreamcast_memory.txt, and
68             *  http://www.ludd.luth.se/~jlo/dc/memory.txt, and possibly some
69             *  others:
70             *
71             *  0x00000000 - 0x001fffff     Boot ROM (2 MB)
72             *  0x00200000 - 0x003fffff     Flash (256 KB)
73             *  0x005f6800 - ...            PVR DMA register
74             *  0x005f6900 - ...            ASIC registers
75             *  0x005f6c00 - ...            Maple registers (controller ports)
76             *  0x005f7400 - ...            ???
77             *  0x005f74e4 - ...            ??? CDROM
78             *  0x005f7800 - ...            G2 DMA registers
79             *  0x005f7c00 - ...            ???
80             *  0x005f8000 - 0x005f9fff     PVR registers (graphics)
81             *  0x00600400 - 0x0060047f     LAN Adapter (MB86967) registers
82             *  0x00700000 - ...            SPU registers (sound)
83             *  0x00702c00 -                Cable select and AICA (?) (*3)
84             *  0x00710000 - 0x00710007     RTC registers
85             *  0x00800000 - 0x009fffff     Sound RAM (2 MB)
86             *  0x01000000 - ...            Parallel port registers
87             *  0x02000000 - ...            CD-ROM port registers
88             *  0x04000000 - 0x047fffff     Video RAM (*)
89             *  0x05000000 - 0x057fffff     Video RAM (8 MB)
90             *  0x0c000000 - 0x0cffffff     RAM (16 MB)
91             *  0x0e000000 - 0x0effffff     Copy of RAM? (*2)
92             *  0x10000000 - ...            Tile accelerator command area
93             *  0x10800000 - ...            Write-only mirror of Video RAM (?)
94             *  0x11000000 - ...            PVR DMA area??
95             *  0x14000000 - ...            G2 (?)  Or Modem/Extension port?
96             *
97             *  (*) = with banks 0 and 1 switched; 64-bit read/write access...
98             *  (*3) = See VOUTC in Linux' drivers/video/pvr2fb.c.
99             */
100    
101            dev_ram_init(machine, 0x00800000, 2 * 1048576, DEV_RAM_RAM, 0);
102    
103            dev_ram_init(machine, 0x0c000000, 16 * 1048576, DEV_RAM_RAM, 0x0);
104    
105            /*  The "luftvarg" 4KB intro uses memory at paddr 0x0ef00000...  */
106            /*  (*2)   (TODO: Make this a _mirror_ of 0x0c000000?)  */
107            dev_ram_init(machine, 0x0e000000, 16 * 1048576, DEV_RAM_RAM, 0);
108    
109            device_add(machine, "pvr");
110            device_add(machine, "mb8696x addr=0x600400 addr_mult=4");
111            device_add(machine, "dreamcast_asic");
112            device_add(machine, "dreamcast_maple");
113            device_add(machine, "dreamcast_rtc");
114    
115          if (!machine->prom_emulation)          if (!machine->prom_emulation)
116                  return;                  return;
117    
118          /*  NetBSD/dreamcast specific register contents:  */          dreamcast_machine_setup(machine);
         /*  TODO  */  
119  }  }
120    
121    
122  MACHINE_DEFAULT_CPU(dreamcast)  MACHINE_DEFAULT_CPU(dreamcast)
123  {  {
124          /*  Hitachi SH4, 200 MHz  */          /*  Hitachi SH4, 200 MHz  */
125          machine->cpu_name = strdup("SH4");          machine->cpu_name = strdup("SH7750");
126  }  }
127    
128    
129  MACHINE_DEFAULT_RAM(dreamcast)  MACHINE_DEFAULT_RAM(dreamcast)
130  {  {
131          machine->physical_ram_in_mb = 16;          /*  Note: This is the size of the boot ROM area, since the
132                Dreamcast's RAM isn't located at physical address zero.  */
133            machine->physical_ram_in_mb = 2;
134  }  }
135    
136    

Legend:
Removed from v.31  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26