James Fogle, who wrote “Drugstore Cowboy,” an autobiographical crime novel that led to an acclaimed 1989 film starring Matt Dillon, died Thursday of probable malignant mesothelioma at a prison in Monroe, Wash., about 30 miles from Seattle. He was 75.A judge had sentenced him to almost 16 years in prison for holding up a pharmacy in a Seattle suburb in 2010, the last in a string of crimes that put him behind bars for most of his adult life. The ailing Fogle was emaciated and connected to several medical machines in the last week of his life, close friend Daniel Yost told the Seattle Times in a phone interview from Los Angeles. He was barely able to breathe, but his sharp wit and creative drive were ever-present as he pushed Yost, one of his final visitors, to get another of his novels, the autobiographical “Doing It All,” onto the bigscreen, the Times reported. “It’s amazing he was still writing,” Yost, who met Fogle while working as a journalist in Portland in the 1970s, told the Times. “He said he never killed anybody.” Fogle had already spent much of his life in prison when he wrote “Drugstore Cowboy,” based on his experiences in a band of addicts who roamed the Pacific Northwest robbing pharmacies to feed their addictions. Filmmaker Gus Van Sant turned the novel into the acclaimed 1989 film. Fogle only had a sixth-grade education but started writing his stories more than 40 years ago, the Times reported. Yost said Fogle occupied his time during lengthy prison lockups by writing unpublished novels and screenplays. He wrote his only published novel, “Drugstore Cowboy,” in six weeks while serving a 20-year prison term for a pharmacy robbery in southwest Washington. Van Sant and Yost wrote the screenplay.