Eddie Murphy says a difficult divorce helped his performance in the upcoming movie "Dreamgirls."

"It was real emotional," Murphy said Monday on "The Oprah Winfrey Show," where he appeared with Jamie Foxx, Beyonce and other members of the cast.

"So it was really good because I had all that going on and that's going on under your skin; you get on the set and when you're acting ... (it took) me to a different place emotionally," the 45-year-old actor said.

Murphy's divorce from his wife, Nicole, came up as Murphy deflected Foxx's compliment about how Murphy could instantly transform himself into the character of James "Thunder" Early, then revert to "this quiet, docile thing" when the cameras stopped rolling.

"I don't want to make it seem like I was, you know, all Joe Actor ..." Murphy said. "I was going through a big divorce, so between shots I was like, `damn."'

During the hour-long show, Foxx joked that his character, a manager of a female singing group, The Dreamettes, appeared to be ruthless — to everyone but real music executives.

"Everybody thinks Curtis is mean, but all the executives from the studio and the music places called me and said, `Hey, I love the character ..."'

Murphy's wife filed for divorce last year, citing irreconcilable differences. The couple were married in 1993.

The former "Saturday Night Live" star's film credits include the "Beverly Hills Cop," "Nutty Professor" and "Dr. Doolittle" movies.

"Dreamgirls," a DreamWorks/Paramount film, is set for release Dec. 25.