Previous 199869 Revisions Next

r17430 Thursday 23rd August, 2012 at 20:20:56 UTC by Angelo Salese
Some other King changes
[src/emu/video]huc6272.c huc6272.h

trunk/src/emu/video/huc6272.c
r17429r17430
1616// device type definition
1717const device_type huc6272 = &device_creator<huc6272_device>;
1818
19static ADDRESS_MAP_START( huc6272_vram, AS_0, 16, huc6272_device )
19static ADDRESS_MAP_START( huc6272_vram, AS_0, 32, huc6272_device )
2020   AM_RANGE(0x000000, 0x0fffff) AM_RAM
2121   AM_RANGE(0x100000, 0x1fffff) AM_RAM
2222ADDRESS_MAP_END
r17429r17430
4040//  read_dword - read a dword at the given address
4141//-------------------------------------------------
4242
43inline UINT32 huc6272_device::read_word(offs_t address)
43inline UINT32 huc6272_device::read_dword(offs_t address)
4444{
45   return space()->read_word(address << 1);
45   return space()->read_dword(address << 2);
4646}
4747
4848
r17429r17430
5050//  write_dword - write a dword at the given address
5151//-------------------------------------------------
5252
53inline void huc6272_device::write_word(offs_t address, UINT32 data)
53inline void huc6272_device::write_dword(offs_t address, UINT32 data)
5454{
55   space()->write_word(address << 1, data);
55   space()->write_dword(address << 2, data);
5656}
5757
5858//**************************************************************************
r17429r17430
6666huc6272_device::huc6272_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6767   : device_t(mconfig, huc6272, "huc6272", tag, owner, clock),
6868     device_memory_interface(mconfig, *this),
69     m_space_config("videoram", ENDIANNESS_LITTLE, 16, 32, 0, NULL, *ADDRESS_MAP_NAME(huc6272_vram))
69     m_space_config("videoram", ENDIANNESS_LITTLE, 32, 32, 0, NULL, *ADDRESS_MAP_NAME(huc6272_vram))
7070{
7171
7272}
r17429r17430
110110   UINT32 res = 0;
111111
112112   if((offset & 1) == 0)
113   {
114      /*
115      xxxx xxxx ---- ---- ---- ---- ---- ---- Sub Channel Buffer
116      ---- ---- x--- ---- ---- ---- ---- ---- SCSI RST flag
117      ---- ---- -x-- ---- ---- ---- ---- ---- SCSI BUSY flag
118      ---- ---- --x- ---- ---- ---- ---- ---- SCSI REQ flag
119      ---- ---- ---x ---- ---- ---- ---- ---- SCSI MSG flag
120      ---- ---- ---- x--- ---- ---- ---- ---- SCSI CD flag
121      ---- ---- ---- -x-- ---- ---- ---- ---- SCSI IO flag
122      ---- ---- ---- --x- ---- ---- ---- ---- SCSI SEL flag
123      ---- ---- ---- ---- -x-- ---- ---- ---- SCSI IRQ pending
124      ---- ---- ---- ---- --x- ---- ---- ---- DMA IRQ pending
125      ---- ---- ---- ---- ---x ---- ---- ---- CD Sub Channel IRQ pending
126      ---- ---- ---- ---- ---- x--- ---- ---- Raster IRQ pending
127      ---- ---- ---- ---- ---- -x-- ---- ---- ADPCM IRQ pending
128      ---- ---- ---- ---- ---- ---- -xxx xxxx register read-back
129      */
113130      res = m_register & 0x7f;
131      res |= (0) << 16;
132   }
114133   else
115134   {
116135      switch(m_register)
r17429r17430
127146            break;
128147
129148         case 0x0e:
130            res = read_word((m_kram_addr_r)|(m_kram_page_r<<18));
149            res = read_dword((m_kram_addr_r)|(m_kram_page_r<<18));
131150            m_kram_addr_r += (m_kram_inc_r & 0x100) ? ((m_kram_inc_r & 0xff) - 0x100) : (m_kram_inc_r & 0xff);
132151            break;
152
153         case 0x0f:
154            res = m_page_setting;
155            break;
133156         //default: printf("%04x\n",m_register);
134157      }
135158   }
r17429r17430
145168   {
146169      switch(m_register)
147170      {
171
172         case 0x09: // DMA addr
173            //printf("%08x DMA ADDR\n",data);
174            break;
175         case 0x0a: // DMA size
176            //printf("%08x DMA SIZE\n",data);
177            break;
178         case 0x0b: // DMA status
179            //printf("%08x DMA STATUS\n",data);
180            break;
148181         /*
149182         ---- ---- ---- ---- ----
150183         */
r17429r17430
161194            break;
162195
163196         case 0x0e: // KRAM write VRAM
164            write_word((m_kram_addr_w)|(m_kram_page_w<<18),data & 0xffff); /* TODO: there are some 32-bits accesses during BIOS? */
197            write_dword((m_kram_addr_w)|(m_kram_page_w<<18),data); /* TODO: there are some 32-bits accesses during BIOS? */
165198            m_kram_addr_w += (m_kram_inc_w & 0x100) ? ((m_kram_inc_w & 0xff) - 0x100) : (m_kram_inc_w & 0xff);
166199            break;
167200
168         //default: printf("%04x %04x\n",m_register,data);
201         /*
202         ---x ---- ---- ---- ADPCM page setting
203         ---- ---x ---- ---- RAINBOW page setting
204         ---- ---- ---x ---- BG page setting
205         ---- ---- ---- ---x SCSI page setting
206         */
207         case 0x0f:
208            m_page_setting = data;
209            break;
210
211         case 0x13:
212            m_micro_prg.addr = data & 0xf;
213            break;
214
215         case 0x14:
216            m_micro_prg.data[m_micro_prg.addr] = data & 0xffff;
217            m_micro_prg.addr++;
218            m_micro_prg.addr &= 0xf;
219            break;
220
221         case 0x15:
222            m_micro_prg.ctrl = data & 1;
223            break;
224
225         //default: printf("%04x %04x %08x\n",m_register,data,mem_mask);
169226      }
170227   }
171228}
trunk/src/emu/video/huc6272.h
r17429r17430
4545   virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const;
4646
4747private:
48   inline UINT32 read_word(offs_t address);
49   inline void write_word(offs_t address, UINT32 data);
48   inline UINT32 read_dword(offs_t address);
49   inline void write_dword(offs_t address, UINT32 data);
5050   UINT8 m_register;
5151   UINT32 m_kram_addr_r, m_kram_addr_w;
5252   UINT16 m_kram_inc_r,m_kram_inc_w;
5353   UINT8 m_kram_page_r,m_kram_page_w;
54   UINT32 m_page_setting;
5455
56   struct{
57      UINT8 addr;
58      UINT8 ctrl;
59      UINT16 data[16];
60   }m_micro_prg;
61
5562   const address_space_config      m_space_config;
5663};
5764

Previous 199869 Revisions Next


© 1997-2024 The MAME Team