We observe anomalous modes including Q-switching pulses and mode-locked square-wave pulses generated in a dual-gain-media fiber ring laser based on nonlinear polarization rotation in a semiconductor optical amplifier. We disclose the evolution process between them, and present in detail the temporal and spectra profiles of the output pulses. We find that the width of the square-wave pulse can be varied continuously from 500 ps to 165 ns by increasing the semiconductor optical amplifier (SOA) current or rotating the polarization controllers in the ring. The width of the pulse varies along with the temporal profile and spectrum pattern, then we further analyse its width-energy curve. For the first time to our knowledge, when we change the parameter of the ring laser (polarization controllers or variable optical attenuator), the stationary point of the width-energy curve will be shifted to a different position so that change the tuneable range of the pulse width. In addition, the evolution (no peak power clamping effect) and the features (chair-like pulse profile) of the generated square-wave pulse are different than previous reported square-wave pulses. Thus, the proposed scheme can facilitate further investigations of the characteristics of pulse generation in fiber lasers. Additionally, it can also serve as a multi-functional optical source to generate square-wave and Q-switching pulses for potential applications.