Simulating the most external plasma region of a tokamak, the scrape-off layer (SOL), is of crucial importance in the way towards a fusion reactor as heat load on the vessel wall, impurity generation, and overall plasma confinement, all depend on the plasma dynamics in this region. In the last few years a numerical code, GBS, has been developed for solving the drift-reduced Braginskii equations, and describe turbulence in the tokamak SOL. In the present work, we re-formulate these equations in a general form that enables to treat diverted configuration with X-point. This is obtained by relaxing the requirement of using a coordinate system that follows the magnetic field lines. Within this alternative coordinate system, the drift-reduced Braginskii equations are then solved by using an high order numerical scheme. We show initial simulations carried out with GBS that describe well the expected field aligned turbulence structures.