Larry Karaszewski and Scott Alexander are the writing team responsible for “Ed Wood,” easily the best fact-based fantasy about a maladroit filmmaker ever made. Now they’ve turned their attention to another less-than-masterful figure from the cinematic past. “Dolemite Is My Name” might not be the equal of Tim Burton’s 1994 classic, but as directed with verve by Craig Brewer, it’s tremendous fun.

It’s also a rip-roaring return to form by Eddie Murphy, who plays Rudy Ray Moore, a would-be standup comic eking out a living at a Los Angeles record store, where his DJ buddy (Snoop Dog) refuses to play the records he made years before while futilely attempting a singing career. He also acts as an MC at the local club where his pal Ben (Craig Robinson) fronts a band.

Rudy’s luck changes when he hears a homeless man (Ron Cephas Jones) spinning yarns about a slick hustler called Dolemite and gets the idea of using the stories to fashion a stage character for himself. It becomes a hit with the club crowd, which leads him to make a party record modeled on those of Redd Foxx. When no established company will touch it, he and his buddies—Ben and Jimmy (Mike Epps)—sell it out of their car trunks. Word of its popularity makes way to the record labels, and soon he has a contract for the LP; a slew of sequels follow.

Rudy’s Dolemite character is also a big success on the black club circuit, and on one leg of a tour he encounters Lady Reed (Da’Vine Joy Randolph), whom he encourages to go onstage too—with surprising success.

One night Rudy and his buddies go out to a movie—Billy Wilder’s 1974 remake of “The Front Page”—and he finds it dismally unfunny. He decides to make a picture for his audience—a blaxploitation flick in the mold of “Shaft” but starring himself as Dolemite. He uses the profits from his records—and a loan from his record company—to finance it.

What follows is a version of the “let’s put on a show” formula. Rudy convinces a socially-conscious playwright (Keegan-Michael Key) to write a script; converts a dilapidated skid row hotel into a combination of soundstage, office space and place to sleep; hires a bunch of white film students captained by a geeky DP (Kodi Smit-McPhee) as a crew; and persuades D’Urville Martin (Wesley Snipes), an actor who’s had bit parts in movies like “Rosemary’s Baby,” to play the part of the villain by letting him direct as well.

The shoot itself is presented as a series of riffs in which Martin winces as Rudy clumsily attempts his character’s kung-fu moves, car chases and romantic scenes, and despite occasional stumbles the picture gets finished. Since Rudy can’t find a distributor, however, he’s back at square one until a radio host (Chris Rock) in Indianapolis suggests that he premiere the flick at a theatre run by his cousin (Barry Shabaka Henley). Rudy uses his last dollar to rent the place for a midnight screening that with savvy promotion turns into a sell-out, the first in a series of “four-wall” showings that leads to a distribution deal with the seventies exploitation-movie specialists at Dimension Pictures. Huge profits, and a sequel, follow.

Like “Ed Wood,” this is an affectionate celebration of a guy with far more enthusiasm than talent (the real “Dolemite” flicks may not be quite as bad as “Plan 9 from Outer Space,” but even seventies audiences laughed as much at them as with them). Still, you to root for his success against all the odds because he and his friends are portrayed as such an agreeably eager lot, having a great time even as they fear it won’t last. Like “Wood,” it ends with a premiere that has everyone reveling in success and celebrity that’s a lovably goofy apotheosis of the American dream

Under Brewer’s direction, the cast seem to be having an equally great time as the people they’re playing. Murphy anchors everything with a razzle-dazzle turn that, despite recent evidence, proves that he hasn’t lost his touch: he might not look much like the real Rudy, but he captures the man’s spirit. Yet he’s generous with his co-stars, permitting Snipes, for instance, who’s also been suffering some career setbacks, to steal several scenes as the preening, classier-than-thou Martin. The technical credits are fine down the line, with a special nod to production designer Clay Griffith and costumer Ruth E, Carter for providing a colorful wallow in ostentatious period detail, cinematographer Eric Steelberg for the crisply colorful images, and editor Billy Fox for keeping the rhythm sprightly.

“Dolemite” is another Karaszewski-Alexander paean to the sheer joy of filmmaking, even when it’s not necessarily attached to ability—though Moore, unlike Wood, laughed all the way to the bank.