Previous 15994 Revisions Next

r11889 Friday 10th June, 2011 at 01:48:53 UTC by Angelo Salese
WIP work on VDP1 / CEF bit, allows Fatal Fury 3 to boot up to the character screen (dies at the gameplay due of a weird framebuffer access)
[src/mame/drivers]saturn.c
[src/mame/includes]stv.h
[src/mame/video]stvvdp1.c

src/mame/includes/stv.h
r11888r11889
9696
9797#define MASTER_CLOCK_352 57272800
9898#define MASTER_CLOCK_320 53748200
99#define CEF_1   state->m_vdp1_regs[0x010/4]|=0x00020000
100#define CEF_0   state->m_vdp1_regs[0x010/4]&=~0x00020000
99101
100102DRIVER_INIT ( stv );
101103
src/mame/video/stvvdp1.c
r11888r11889
154154#define STV_VDP1_EDSR ((state->m_vdp1_regs[0x010/4] >> 16)&0x0000ffff)
155155#define STV_VDP1_CEF  (STV_VDP1_EDSR & 2)
156156#define STV_VDP1_BEF  (STV_VDP1_EDSR & 1)
157#define CEF_1   state->m_vdp1_regs[0x010/4]|=0x00020000
158#define CEF_0   state->m_vdp1_regs[0x010/4]&=~0x00020000
159157/**/
160158
161159
r11888r11889
347345   if ( STV_VDP1_TVM & 1 )
348346   {
349347      /* 8-bit mode */
348      printf("%08x %02x\n",offset,data);
350349   }
351350   else
352351   {
r11888r11889
370369   if ( STV_VDP1_TVM & 1 )
371370   {
372371      /* 8-bit mode */
372      printf("%08x\n",offset);
373373   }
374374   else
375375   {
r11888r11889
17681768   stv_clear_gouraud_shading();
17691769
17701770   /*Set CEF bit to 0*/
1771   CEF_0;
1771   //CEF_0;
17721772
17731773   while (spritecount<10000) // if its drawn this many sprites something is probably wrong or sega were crazy ;-)
17741774   {
r11888r11889
19781978
19791979   end:
19801980   /*set CEF to 1*/
1981   CEF_1;
1981   //CEF_1;
19821982
19831983   /* not here! this is done every frame drawn even if the cpu isn't running eg in the debugger */
19841984//  if(!(stv_scu[40] & 0x2000)) /*Sprite draw end irq*/
src/mame/drivers/saturn.c
r11888r11889
25782578
25792579SCU register[36] is the timer zero compare register.
25802580SCU register[40] is for IRQ masking.
2581
2582TODO:
2583- VDP1 timing and CEF emulation isn't accurate at all.
25812584*/
25822585
25832586
r11888r11889
25982601   //popmessage("%08x %d %08x %08x",state->m_scu_regs[40] ^ 0xffffffff,max_y,state->m_scu_regs[36],state->m_scu_regs[38]);
25992602
26002603   if(scanline == 0*y_step)
2604   {
26012605      device_set_input_line_and_vector(state->m_maincpu, 0xe, (stv_irq.vblank_out) ? HOLD_LINE : CLEAR_LINE , 0x41);
2606      CEF_0;
2607   }
26022608   else if(scanline == vblank_line*y_step)
2609   {
26032610      device_set_input_line_and_vector(state->m_maincpu, 0xf, (stv_irq.vblank_in) ? HOLD_LINE : CLEAR_LINE , 0x40);
2611      device_set_input_line_and_vector(state->m_maincpu, 0x2, (stv_irq.vdp1_end) ? HOLD_LINE : CLEAR_LINE, 0x4d);
2612      CEF_1;
2613   }
26042614   else if((scanline % y_step) == 0 && scanline < vblank_line*y_step)
26052615      device_set_input_line_and_vector(state->m_maincpu, 0xd, (stv_irq.hblank_in) ? HOLD_LINE : CLEAR_LINE, 0x42);
26062616
r11888r11889
26112621   if(scanline == (state->m_scu_regs[36] & 0x3ff)*y_step)
26122622      device_set_input_line_and_vector(state->m_maincpu, 0xc, (stv_irq.timer_0) ? HOLD_LINE : CLEAR_LINE, 0x43 );
26132623
2614   if(scanline == 64) //TODO: emulate the timing of this
2615      device_set_input_line_and_vector(state->m_maincpu, 0x2, (stv_irq.vdp1_end) ? HOLD_LINE : CLEAR_LINE, 0x4d);
26162624}
26172625
26182626static READ32_HANDLER( saturn_cart_dram0_r )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team