Darren Fresco said one occasion the athlete fired without warning through the sunroof of a moving car following an angry altercation with a policeman who had handled Pistorius' pistol, he said.

Mr Fresco said he asked Pistorius immediately after the sunroof shooting if he was "mad" and the world-famous runner "just laughed" at him.

Pistorius denies shooting the gun in the car, although now two witnesses say that he did.

Mr Fresco's evidence portrayed Pistorius as a reckless hothead who also asked him to take the blame for a gun being fired accidentally under a table in a busy Johannesburg restaurant.

But Mr Fresco's account appeared to be undermined when Pistorius' defence lawyer created doubts over Mr Fresco's recollection of some events.

Mr Fresco responded to a number of questions from Barry Roux on cross-examination by saying he did not remember. He also said he had been following some previous evidence in the case on Twitter, which witnesses should not do.

Pistorius, 27, is on trial for murder for the shooting death of girlfriend Reeva Steenkamp on Valentine's Day last year, but also faces two firearm charges for shooting in public and a third firearm charge for illegal possession of ammunition.

Pistorius, the first double-amputee runner to compete at the Olympics, pleaded not guilty to all four charges against him. He specifically denies that he fired the gun in the car, Mr Roux said.

Pistorius' demeanour in court was drastically different to the vomiting, retching defendant who needed a bucket to throw up in as he heard a pathologist give graphic details of the injuries he inflicted on his girlfriend when he shot her multiple times through a toilet door in his home.

This time, instead of hunched over and heaving, Pistorius mostly sat with his hands in his lap in the Pretoria courtroom and often made notes. He denies murder in Ms Steenkamp's killing saying he shot her by mistake thinking she was a dangerous intruder.

Mr Fresco, who said he was driving the car during the alleged sunroof shooting in late 2012, and a former girlfriend of Pistorius have both testified that the athlete shot his gun out the car.

But their stories did not match in parts. Mr Fresco said Pistorius fired without warning sometime after they were stopped by traffic police and after visiting an unidentified person's house. Samantha Taylor, who said she was dating Pistorius at the time, has said that it happened soon after the altercation with police and after Pistorius and Mr Fresco discussed finding a traffic light to shoot at.

Mr Fresco said the group was pulled over, for the second time that day, and Pistorius was furious with an officer for handling his gun, which he had left on the passenger seat.

"You can't just touch another man's gun," Pistorius said to the officer, according to Mr Fresco. "Now your fingerprints are all over my gun. So if something happens, you're going to be liable for anything that happens."

Later, Pistorius shot out the sunroof, Mr Fresco told the high court in Pretoria.

"Without prior warning, he shot out the sunroof," Mr Fresco said. Mr Fresco said he was driving, Pistorius was in the passenger seat and Ms Taylor in the back.

Mr Fresco said he "instinctively" moved away from where the gun was shot. "I said to him, are you (expletive) mad?" Fresco told the court.

"He just laughed," Mr Fresco recalled. "But it felt as if my ear was already bleeding."

Defence lawyer Mr Roux pointed out that Ms Taylor had a different version.

Mr Roux also questioned Fresco on the incident at a packed Johannesburg restaurant in the posh Melrose Arch district in early 2013 when he handed his gun, a Glock 27 .40-calibre pistol, under the table to Pistorius and it fired. Mr Fresco said Pistorius asked him to take the blame for the incident, which he did, because Pistorius feared bad publicity. It was about a month before Pistorius killed Ms Steenkamp.

Mr Fresco said he had warned Pistorius that the gun was "one-up", meaning it had a bullet in the chamber. "I knew that he had a big love for weapons ... my assumption was that he had competency," Mr Fresco told the court.

Mr Roux asked Mr Fresco when exactly he had warned Pistorius that there was a magazine in the gun and a bullet in the chamber, and when Pistorius had asked him to take the rap. The friend could not pinpoint the precise times.

"Will you agree, Mr. Fresco, you have uncertainty ... about what specifically happened and what was said?" Mr Roux said.

The only time Pistorius appeared uncomfortable was on Tuesday when the pathologist who performed the autopsy on his girlfriend's body finished his evidence.

Professor Gert Saymaan concluded that Ms Steenkamp might have been able to scream during the shots that killed her. Referring, specifically, to the gunshot wound in the arm Ms Steenkamp suffered - one of three main bullet wounds - Prof Saymaan said it would be unusual if a person did not scream after that kind of severe injury.

Pistorius maintains he was the only one to shout and scream on the night of the killing. Prosecutors say Ms Steenkamp screamed during an argument and then during the shots, with witnesses claiming they heard a woman's screams on the night. Prosecutors say Pistorius therefore knew who he was shooting at.

They have hinted that the bullet that hit Ms Steenkamp in the head was one of the last of the four shots, giving her time to yell out.