In "Murder By Death" Neil Simon presumed to get fresh with several noted fictional detectives. His most amusing target was a hard-boiled dick called Sam Diamond, splendidly impersonated by Peter Falk, whose ridiculous macho masquerade obviously concealed severe sexual and social anxieties.

Simon, Falk, director Robert Moore and several other key collaborators on "Murder By Death" have reunited for "The Cheap Detective," a comparably silly, inconsistent entertainment which opens as a spoof of "The Maltese Falcon," interweaves "Casablanca" and spices the result with parodistic bits from "To Have and Have Not," "The Big Sleep" and even "Chinatown."

Falk stars as another private eye, called Lou Peckinpaugh, a mellower hard-boiled loser.

The setting in movie-studio San Francisco in an equally rheotrical 1939, when America, that Slumbering Giant, has yet to awaken to the Gathering War Clouds in Europe, although the Gestapo seems to have opened branch offices in outposts like Cincinnati. A slick credit sequence paves the way for a fast, delightful getaway, as flatfeet Vic Tayback and Abe Vigoda discover a hotel littered with murder victims, all smiling goofily with bullet holes in their skulls.

On of the victims is the partner of shamus Peckinpaugh, who enters to answer his phone with one hand and cautiously hold a gun on the mouth-piece with the other. You can't be too careful in his profession. Before long peckinpaugh is trying to con the cops, brush off his dead partner's amorous widow (Marsha Mason recalling Gladys George), discover a mysterious objet d'art sought by two devious clients (Madeline Kahn and Dom DeLuise recalling Mary Astor and Peter Lorre), and rekindle a scorched romance with an idealistic bore (Louise Fletcher recalling Ingrid Bergman) who has landed in town with her Nazi-fighting husband (Fernando Lamas recalling Paul Henreid), a former Resistance leader seeking entry to Oakland.

"Murder By Death" spoofed the plot of Agatha Christie's "Ten Little Indians," but at the conclusion Simon's house-of-cards and-every-card-a-joker construction fell apart.

"The Cheap Detective" also ends on a flat note, but its most serious construction problem is a mid-passage sag that lasts for about 15 minutes. Precarious as the whole idea is, it stands up right through an enjoyable variation on the reunion and duelling national anthem scenes at Rick's in "Casablanca," with Nicol Williamson and Scatman Crothers turning up in merry form as the stand-ins for Conrad Veidt's Nazi and Dooley Wilson's Sam.

But when the scene shifts to Peckinpaugh's apartment, where Falk proceeds to amble between leading ladies posted in separate rooms, the movie grinds to a halt. Moore doesn't seem to be able to take up the slack (and take the curse off jokes that misfire) by imposing a snappy playing and editing thythm. This interlude demands the velocity of all those classic bedroom farce situations in which the hero must hide people under the bed and in the closet while frantically juggling assignations.

A subsequent episode with Ann-Margret as a vamp and Sid Casesar as her senile sugar daddy restores some of the lost gaiety and spontaneity, but not enough. You're reminded of how narrow the margin for error is in parody. There's a reason why the best Caesar or Carol Burnett film spoofs were quarter-hour distillatios or the best S.J. Perelman fantasies run only a few pages. If you allow the slightest amount of slack to accumulate in a parody, it's almost impossible to get it out.

One of the more agreeable aspects of "Murder By Death" and "The Cheap Detective" is their recruitment of large, entertaining casts for comic duty. I wish Carol Burnett had been recruited to substitute for Madeline Kahn in the Mary Astor role from "The Maltese Falcon." Something seems to be inhibiting Kahn, who has not been a lucky funny lady this year.

Louise Fletcher is rather pondereous, but perhaps excusably so given the stoogey personality of her character. Marsha Mason is surprisingly perky in a role that gives her no room for sentiment. Stockard Channing, perhaps the unluckiest of the leads in "Grease," looks miraculously fresh and eager here playing Peckinpaugh's loyal secretary, and the movie could use quite a bit more of the ingenuous expectancy she seems to be offering.

Eileen Brennan, so wonderful as Falk's masochistic Girl Friday in "Murder By Death," has less of opportunity as a role designed ti recall Bacall, but she's always expert and her vocalizing on "La Vie en Rose" is a droll highlight. Overripe and irresistible funny, Ann-Margret turns out to be a stimulating adornment, and Caesar demonstrates his genius anew by scoring with the msot economical of pantomine in a role that confines him to a wheelchair.

John Houseman proves a vigorous, underexploited resource in a Sydney Greenstreet impersonation. As the gunsel, Paul Williams makes nice work of a slapstick conceit: Falk orders Williams to slap himself silly, and he does, with ascending comic effect. James Coco was better used in "Murder By Death" as the Hercule Poirot type, but "The Cheap Detective" seems to have just the right proportion of Dom DeLuise.

"The Cheap Detective" is an uneven performance, but still a diverting, winning one.