Incorrect DMA code in KOS?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
bogglez
Moderator
Moderator
Posts: 578
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Incorrect DMA code in KOS?

Post by bogglez »

I've compared kos/kernel/arch/dreamcast/hardware/pvr/pvr_dma.c to the official SH4 documentation "Hitachi SuperH RISC engine SH7750 Series SH7750, SH7750S
Hardware Manual" (page 436 of 850) and found the code to write to reserved bits, for example in line 113.
Is this code just incorrect or are the bits used in the DC CPU?

Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
MetalliC
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 28
Joined: Wed Apr 23, 2014 3:04 pm
Has thanked: 0
Been thanked: 0

Re: Incorrect DMA code in KOS?

Post by MetalliC »

you mean shdma[DMAC_CHCR2] = 0x12c1; ?
cant see anything wrong here

on side note... not well known fact - HOLLY-chipset based hardware (DC, NAOMI, etc) uses *NOT* SH4 CPU.
but custom designed chip - SH7091 (HD6417091), sadly there no public available docs for it, we only know it have several (but not all) SH-4A SH7780 extended CPU instructions - FSRRA, FSCA, etc

but there can be more differences with 'regular' SH4, so SH7750's hardware manuals is not really trustable source of information about Dreamcast's CPU.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab »

Actually, I'm pretty sure that all of the SH4 line had the fsca and fsrra instructions (source: GCC mailing list post from a SuperH employee).
MetalliC
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 28
Joined: Wed Apr 23, 2014 3:04 pm
Has thanked: 0
Been thanked: 0

Re: Incorrect DMA code in KOS?

Post by MetalliC »

well, I've seen two gaming systems with 'regular' SH7750 - Gaelco's ATV Track and Smashing Drive (2x SH7750 + PVR2 NEON250) and Aristokrat MK6 gambling machines (SH7750 + PVR2 NEON250).
both of them doesn't use FSRAA or FSCA opcodes, so I'm pretty sure 7750 haven't them.

I think you misunderstood that employee message, its more likely he meant this instructions is SH4 because DC's custom SH7091 is part of SH4 line/family, and he have this instructions.
but it doesn't mean 'regular' SH7750 SH4 have them
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab »

That is not what that employee said (and what other replies in the thread have also indicated). He clearly said that the SH4 has those opcodes, and GCC/GNU Assembler fully support using them on SH4 (not just SH4A) targets.

A later reply in the thread also confirms that the entire SH4 line has the opcodes, but that they were only majorly tested on the SH7750 (as a "customer" requested them).
Chilly Willy
DC Developer
DC Developer
Posts: 414
Joined: Thu Aug 20, 2009 11:00 am
Has thanked: 0
Been thanked: 2 times

Re: Incorrect DMA code in KOS?

Post by Chilly Willy »

Does gas support the known DC-SH4 opcodes?
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab »

Chilly Willy wrote:Does gas support the known DC-SH4 opcodes?
Those would be fsrra and fsca. They've been supported in GNU Assembler for a while (about 10 years or so, IIRC).

EDIT: Make that about 12 and a half years (source)...
MetalliC
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 28
Joined: Wed Apr 23, 2014 3:04 pm
Has thanked: 0
Been thanked: 0

Re: Incorrect DMA code in KOS?

Post by MetalliC »

BlueCrab wrote:That is not what that employee said (and what other replies in the thread have also indicated). He clearly said that the SH4 has those opcodes, and GCC/GNU Assembler fully support using them on SH4 (not just SH4A) targets.
it depends on definition of term "SH4"
as far as I know there no some specific "SH4" chip, it is family of MCUs, often very different.
BlueCrab wrote: A later reply in the thread also confirms that the entire SH4 line has the opcodes, but that they were only majorly tested on the SH7750 (as a "customer" requested them).
can you please point this message ? about it was tested (using some 7750 dev board ?)
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5658
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Incorrect DMA code in KOS?

Post by BlueCrab »

MetalliC wrote:
BlueCrab wrote: A later reply in the thread also confirms that the entire SH4 line has the opcodes, but that they were only majorly tested on the SH7750 (as a "customer" requested them).
can you please point this message ? about it was tested (using some 7750 dev board ?)
https://gcc.gnu.org/ml/gcc-patches/2005 ... 01176.html

Note: This is speaking of "internal" testing (i.e, during the actual development process at the company making the CPU -- not on random development boards after the CPU design was finalized and produced).
Post Reply