So if you've got cast coming out of the basement does it continue up through the bathroom and through the roof? Somewhere it's gotta go through the roof ? You could be closer to code than you think with connections within a specific distance to the stack/vent. Although "S" traps can be converted to "P" traps and as well a air admittance valve added without too much trouble.
Old school whole house traps are a city typical thing and can actually be a problem with use of newer systems. They actually cause a new trap to not work correctly by what becomes double trapping. No matter what wrench you use