Previous 199869 Revisions Next

r19082 Tuesday 20th November, 2012 at 22:18:42 UTC by Angelo Salese
APC: added Auxiliary Character RAM hook-up
[src/mess/drivers]apc.c

trunk/src/mess/drivers/apc.c
r19081r19082
9696   required_device<upd765a_device> m_fdc;
9797   required_device<am9517a_device> m_dmac;
9898   UINT8 *m_char_rom;
99   UINT8 *m_aux_pcg;
99100
100101   required_shared_ptr<UINT8> m_video_ram_1;
101102   required_shared_ptr<UINT8> m_video_ram_2;
r19081r19082
118119   DECLARE_WRITE8_MEMBER(apc_irq_ack_w);
119120   DECLARE_READ8_MEMBER(apc_rtc_r);
120121   DECLARE_WRITE8_MEMBER(apc_rtc_w);
122//   DECLARE_READ8_MEMBER(aux_pcg_r);
123//   DECLARE_WRITE8_MEMBER(aux_pcg_w);
121124
122125   struct {
123126      UINT8 status; //status
r19081r19082
163166void apc_state::video_start()
164167{
165168   m_char_rom = memregion("gfx")->base();
169   m_aux_pcg = memregion("aux_pcg")->base();
166170}
167171
168172UINT32 apc_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
r19081r19082
203207      UINT8 color;
204208      UINT8 tile,attr,pen;
205209      UINT32 tile_addr;
210      UINT8 tile_sel;
206211
207212//      tile_addr = addr+(x*(state->m_video_ff[WIDTH40_REG]+1));
208213      tile_addr = addr+(x*(1));
209214
210215      tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0x00ff;
216      tile_sel = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0x00ff;
211217      attr = (state->m_video_ram_1[(tile_addr*2 & 0x1fff) | 0x2000] & 0x00ff);
212218
213219      u_line = attr & 0x01;
r19081r19082
232238            if(res_x > 640 || res_y > 494) //TODO
233239               continue;
234240
235//              tile_data = secret ? 0 : (state->m_char_rom[tile*char_size+interlace_on*0x800+yi]);
236241            /*
237             Addr bus:   C BA98 7654 3210
238                         | |||| |\\\ \\\\- character number bits 0-6
239                         | |||| \--------- y' bit 0
240                         | |||\----------- y' bit 1
241                         | ||\------------ y' bit 2
242                         | |\------------- y' bit 3
243                         | \-------------- character number bit 7
244                         \---------------- y' bit 4
242            Addr bus:   C BA98 7654 3210
243                        | |||| |\\\ \\\\- character number bits 0-6
244                        | |||| \--------- y' bit 0
245                        | |||\----------- y' bit 1
246                        | ||\------------ y' bit 2
247                        | |\------------- y' bit 3
248                        | \-------------- character number bit 7
249                        \---------------- y' bit 4
245250
246251            y to y' (assumed; this needs hardware tests since there could be one more 'blank' line between all char rows):
247252            y  =  0 1 2 3 ... 16 17 18
248253            y' = 18 0 1 2 ... 15 16 17
249254
250             Data bus: 76543210 = pixels, in left->01234567->right order
251             */
252            tile_data = (state->m_char_rom[(tile & 0x7f)+((tile & 0x80)<<4)+((yi_trans & 0xf)*0x80)+((yi_trans & 0x10)<<8)]);
255            Data bus: 76543210 = pixels, in left->01234567->right order
256            */
257            if(tile_sel == 0x89)// Aux character RAM select TODO: correct triggering?
258            {
259               if(yi & 0x10)
260                  tile_data = 0;
261               else
262                  tile_data = state->m_aux_pcg[(tile & 0xff)*0x20+yi*2];
263            }
264            else
265               tile_data = state->m_char_rom[(tile & 0x7f)+((tile & 0x80)<<4)+((yi_trans & 0xf)*0x80)+((yi_trans & 0x10)<<8)];
253266
254267            if(reverse) { tile_data^=0xff; }
255268            if(u_line && yi == lr-1) { tile_data = 0xff; }
r19081r19082
459472   AM_RANGE(0x00000, 0x9ffff) AM_RAM
460473   AM_RANGE(0xa0000, 0xa0fff) AM_RAM AM_SHARE("cmos")
461474//   AM_RANGE(0xc0000, 0xcffff) standard character ROM
462   AM_RANGE(0xd8000, 0xdffff) AM_RAM // AUX character RAM
475   AM_RANGE(0xd8000, 0xd9fff) AM_RAM AM_REGION("aux_pcg", 0) // AUX character RAM
463476//   AM_RANGE(0xe0000, 0xeffff) Special Character RAM
464477   AM_RANGE(0xfe000, 0xfffff) AM_ROM AM_REGION("ipl", 0)
465478ADDRESS_MAP_END
r19081r19082
797810   8
798811};
799812
813#if 0
814static const gfx_layout charset_pcg =
815{
816   8, 16,
817   RGN_FRAC(1,1),
818   1,
819   { 0 },
820   { 7, 6, 5, 4, 3, 2, 1, 0 },
821   { STEP16(0,16) },
822   8*32
823};
824#endif
825
800826static GFXDECODE_START( apc )
801827   GFXDECODE_ENTRY( "gfx", 0x0000, charset_8x16, 0, 128 )
802828   GFXDECODE_ENTRY( "gfx", 0x0800, charset_8x16, 0, 128 )
803829   GFXDECODE_ENTRY( "gfx", 0x1000, charset_8x16, 0, 128 )
804830   GFXDECODE_ENTRY( "gfx", 0x1800, charset_8x16, 0, 128 )
831//   GFXDECODE_ENTRY( "aux_pcg", 0x0000, charset_pcg, 0, 128 )
805832GFXDECODE_END
806833
807834
r19081r19082
10491076
10501077   ROM_REGION( 0x2000, "gfx", ROMREGION_ERASE00 )
10511078    ROM_LOAD("pfcu1r.bin",   0x000000, 0x002000, CRC(683efa94) SHA1(43157984a1746b2e448f3236f571011af9a3aa73) )
1079
1080   ROM_REGION( 0x2000, "aux_pcg", ROMREGION_ERASE00 )
10521081ROM_END
10531082
10541083DRIVER_INIT_MEMBER(apc_state,apc)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team