MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

alca
MAME Fan
Reged: 06/22/09
Posts: 90
Send PM


capcom system 1 driver
#294702 - 08/28/12 10:11 PM


Hello,

there is a small thing missing in the cps1 video driver.

If adresses written to video registers (base of scroll for
exemple) are not word aligned, it should causes a 68000 adress exception. I have verified this on real hardware.

Ok, not really useful since all games work now.
But really handy to develop homebrews...

regards



Sune
Connected
Reged: 09/21/03
Posts: 5648
Loc: Lagoa Santa, Brasil
Send PM


Re: capcom system 1 driver new [Re: alca]
#294717 - 08/29/12 04:33 AM


> Hello,
>
> there is a small thing missing in the cps1 video driver.
>
> If adresses written to video registers (base of scroll for
> exemple) are not word aligned, it should causes a 68000 adress exception. I have
> verified this on real hardware.
>
> Ok, not really useful since all games work now.
> But really handy to develop homebrews...

What's brewing?

S



AWJ
Reged: 03/08/05
Posts: 936
Loc: Ottawa, Ontario
Send PM


Re: capcom system 1 driver new [Re: alca]
#294722 - 08/29/12 05:40 AM


I'm not surprised that unaligned addresses don't work on hardware, but I am surprised that trying to force external hardware (the graphics chip) to do an unaligned access actually causes an exception on the CPU. I thought the hardware would just ignore the low bit of the address.



Matty_
Part-time troll
Reged: 01/25/08
Posts: 730
Send PM


Re: capcom system 1 driver new [Re: AWJ]
#294737 - 08/29/12 07:57 AM


> I'm not surprised that unaligned addresses don't work on hardware, but I am surprised
> that trying to force external hardware (the graphics chip) to do an unaligned access
> actually causes an exception on the CPU. I thought the hardware would just ignore the
> low bit of the address.

That's standard 68k behaviour - any word or long access on an odd address causes a trap as soon as it finishes the address generation phase of the instruction execution. This changes for '020 and later of course. That's why in debug mode on 68k computers you'd fill newly allocated blocks with an odd value - if you tried to use it as an address for a word or long access you'd get an instant trap.



AWJ
Reged: 03/08/05
Posts: 936
Loc: Ottawa, Ontario
Send PM


Re: capcom system 1 driver new [Re: Matty_]
#294742 - 08/29/12 09:18 AM


Yes, but in this case it's a peripheral doing the unaligned access presumably via DMA, not the CPU.



Matty_
Part-time troll
Reged: 01/25/08
Posts: 730
Send PM


Re: capcom system 1 driver new [Re: AWJ]
#294744 - 08/29/12 09:29 AM


> Yes, but in this case it's a peripheral doing the unaligned access presumably via
> DMA, not the CPU.

Oh, my bad. Sorry.



alca
MAME Fan
Reged: 06/22/09
Posts: 90
Send PM


Re: capcom system 1 driver new [Re: Sune]
#294746 - 08/29/12 09:39 AM


Hello,

Sorry, what I have written is completly wrong.

You cannot define non word aligned adresses since
the base adress for scrolls/palette/etc... is shifted
8 bits to the right when set into the GPU register.

I got the adress exception because I enabled interrupts
too early and some global variables were not initialized.

Sorry for all...


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 150 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1357