I found a file at a retropie page that, at least as I understand, suggest a configuration example for dreamcast.
[PLAYSTATION(R)3 Controller]
button.0=Btn_Z
button.1=Btn_C
button.2=Btn_D
button.3=Btn_Start
button.4=DPad_Up
button.5=DPad_Right
button.6=DPad_Down
button.7=DPad_Left
button.8=Axis_LT
button.9=Axis_RT
button.10=DPad2_Left
button.11=DPad2_Right
button.12=Btn_Y
button.13=Btn_B
button.14=Btn_A
button.15=Btn_X
button.16=Quit
axis.0=Axis_X
axis.1=Axis_Y
If mapping is not working correctly try changing controller name for:
[Sony PLAYSTATION(R)3 Controller]
For Wireless PS3 Controller use:
[PLAYSTATION(R)3 Controller (xx:xx:xx:xx:xx:xx)]
Replace xx:xx:xx:xx:xx:xx with your own controller mac address
Do you think it will help? How I found the mac address, if necessary?