Yandamuri, 27, could receive the death penalty in the kidnapping and slaying of 10-month-old Saanvi Venna and her 61-year-old grandmother, Satyavathi Venna, who was visiting from India, at the Marquis Apartments in October 2012.
The case has taken numerous twists, with Yandamuri initially confessing and then saying two men, one named Matt, were the killers.
Deputy District Attorney Samantha Cauffman told the judge that Yandamuri had gambled at the Valley Forge Casino Resort three days after he allegedly killed Satyavathi Venna and before the body of Saanvi was found.
"He was at the blackjack table," Cauffman said.
O'Neill said he would rule later on whether to keep that information out of trial and on whether the death penalty should remain a possibility. He also will hear arguments on a change-of-venue request later.
The hearing then turned again to defense attempts to keep out of the trial statements Yandamuri made to police, including a video-recorded confession in which he explained in detail how he took the baby and killed the grandmother.
During his testimony, Yandamuri said he repeatedly asked to call his pregnant wife after casino representatives and police met him at the casino, but police would not let him. "I want to call my wife and tell her about my situation," he said he told police.
Under questioning from defense attorney Stephen G. Heckman, Montgomery County Detective Paul Bradbury said Yandamuri willingly cooperated with authorities after he and an Upper Merion Township detective met Yandamuri at the casino.
Bradbury said he would have allowed the defendant to call his wife - but Yandamuri didn't ask.
Also in answer to Heckman's questions, the detective said he did not follow up on information Yandamuri gave him about the other men allegedly involved in the crime, suggesting he did not believe the story.
Yandamuri's testimony contradicted most of what Bradbury said, as the detective sat calmly behind the prosecution table.
Yandamuri explained that he let officers take him to the police station on Oct. 25 because people in the casino were watching the scene and "it was [an] embarrassing kind of thing."
He continued to agree to police requests, Yandamuri said, because Bradbury dangled the possibility of seeing his wife and the probability of being convicted at trial if he did not continue to cooperate.
Throughout the proceeding, but especially in the morning, Yandamuri interrupted the prosecutor, his own counsel, and the judge to give his version of events.
Finally, O'Neill told him he would stop proceedings if he needed to talk to his lawyers, but otherwise urged him to refrain from "blurting things out."