Closed dankcushions closed 8 years ago
This is going to be an upstream issue then... and not likely to get fixed at all unless someone decides to take a shot at assembler. Should only will affect the Pi 3.
if it's to do with gcc versions it's not upstream I think?
It's an upstream issue. You can either use the binary or adjust the compiler flags with sudo CFLAGS="whatever" ./retropie_packages.sh etc.
the easiest fix for now is for us to override the RPI3 CFLAGS for this module (if that solves it). which I will do in the meantime (I doubt anyone is going to fix drz80)
(You could also disable the arm assembler optimisations or the arm z80 core in particular - if swp is being emulated via a trap as the stackoverflow says, it could cause overhead - would need to be tested if performance is better or worse)
workaround committed
Totally works! cheers jools :) I raised upstream - maybe there's some bored asm programmers who want to work on ancient mame cores :) https://github.com/libretro/mame2003-libretro/issues/18
This might work...
diff --git a/src/cpu/z80_drz80/drz80.s b/src/cpu/z80_drz80/drz80.s
index 9d41f0d..3c687fe 100644
--- a/src/cpu/z80_drz80/drz80.s
+++ b/src/cpu/z80_drz80/drz80.s
@@ -4082,9 +4082,13 @@ opcode_0_7:
;@EX AF,AF'
opcode_0_8:
add r1,cpucontext,#z80a2
- swp z80a,z80a,[r1]
+ ldr r0,[r1]^M
+ str z80a,[r1]^M
+ mov z80a,r0^M
add r1,cpucontext,#z80f2
- swp z80f,z80f,[r1]
+ ldr r0,[r1]^M
+ str z80f,[r1]^M
+ mov z80f,r0^M
fetch 4
;@ADD HL,BC
opcode_0_9:
@@ -5138,11 +5142,17 @@ opcode_D_8:
;@EXX
opcode_D_9:
add r1,cpucontext,#z80bc2
- swp z80bc,z80bc,[r1]
+ ldr r0,[r1]^M
+ str z80bc,[r1]^M
+ mov z80bc,r0 ^M
add r1,cpucontext,#z80de2
- swp z80de,z80de,[r1]
+ ldr r0,[r1]^M
+ str z80de,[r1]^M
+ mov z80de,r0 ^M
add r1,cpucontext,#z80hl2
- swp z80hl,z80hl,[r1]
+ ldr r0,[r1]^M
+ str z80hl,[r1]^M
+ mov z80hl,r0 ^M
fetch 4
;@JP C,$+3
opcode_D_A:
` @
see http://ctrlv.it/id/4749/4104641947 for the full log
Looks like it's this issue: http://stackoverflow.com/questions/13584091/arm-warning-swpb-use-is-deprecated-for-this-architecture - don't entirely follow the answers, though :)