# HG changeset patch # User Michael Pavone # Date 1549349516 28800 # Node ID 3dbfb4524ad27a02d5c45bb46902bf4678a557a5 # Parent 28ab56ff8cea12f149fe8901ca9dfca84002a427 Implemented RLD/RRD in new Z80 core diff -r 28ab56ff8cea -r 3dbfb4524ad2 z80.cpu --- a/z80.cpu Mon Feb 04 22:20:51 2019 -0800 +++ b/z80.cpu Mon Feb 04 22:51:56 2019 -0800 @@ -2226,4 +2226,39 @@ fd OOOOOOOO fd_normal dispatch O + +ed 01101111 rld + local tmp 8 + local tmp2 8 + z80_fetch_hl + cycles 4 + + lsr scratch1 4 tmp + + lsl scratch1 4 scratch1 + + and 0xF a tmp2 + or tmp2 scratch1 scratch1 + + and 0xF0 a a + or tmp a a + update_flags SZYH0XPN0 + z80_store_hl + +ed 01100111 rrd + local tmp 8 + local tmp2 8 + z80_fetch_hl + cycles 4 + + and 0xF scratch1 tmp + lsr scratch1 4 scratch1 + + lsl a 4 tmp2 + or tmp2 scratch1 scratch1 + + and 0xF0 a a + or tmp a a + update_flags SZYH0XPN0 + z80_store_hl \ No newline at end of file