Mercurial > repos > blastem
comparison z80.cpu @ 1725:89ee53a149ea
Miscellaneous small fixes to new Z80 core
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 01 Feb 2019 22:16:56 -0800 |
parents | 9a74c2d05672 |
children | 4f064b575e57 |
comparison
equal
deleted
inserted
replaced
1724:9a74c2d05672 | 1725:89ee53a149ea |
---|---|
99 not chflags invert | 99 not chflags invert |
100 and 0x80 invert invert | 100 and 0x80 invert invert |
101 | 101 |
102 case 3 | 102 case 3 |
103 meta istrue invert | 103 meta istrue invert |
104 and 0x80 invert invert | 104 and 0x80 chflags invert |
105 | 105 |
106 case 4 | 106 case 4 |
107 meta istrue invert | 107 meta istrue invert |
108 lnot pvflag invert | 108 lnot pvflag invert |
109 | 109 |
516 xchg l scratch1 | 516 xchg l scratch1 |
517 cycles 1 | 517 cycles 1 |
518 mov sp scratch2 | 518 mov sp scratch2 |
519 ocall write_8 | 519 ocall write_8 |
520 add 1 sp wz | 520 add 1 sp wz |
521 mov wz scratch2 | 521 mov wz scratch1 |
522 ocall read_8 | 522 ocall read_8 |
523 xchg h scratch1 | 523 xchg h scratch1 |
524 cycles 2 | 524 cycles 2 |
525 mov wz scratch2 | 525 mov wz scratch2 |
526 ocall write_8 | 526 ocall write_8 |
982 mov main.R last_flag_result | 982 mov main.R last_flag_result |
983 cmp main.R a | 983 cmp main.R a |
984 update_flags SZHVN1C | 984 update_flags SZHVN1C |
985 | 985 |
986 dd 10111100 cp_ixh | 986 dd 10111100 cp_ixh |
987 lsr ix 8 last_flag_result | 987 local tmp 8 |
988 lsr ix 8 tmp | |
989 mov tmp last_flag_result | |
988 cmp last_flag_result a | 990 cmp last_flag_result a |
989 update_flags SZHVN1C | 991 update_flags SZHVN1C |
990 | 992 |
991 dd 10111101 cp_ixl | 993 dd 10111101 cp_ixl |
994 local tmp 8 | |
995 mov ix tmp | |
992 mov ix last_flag_result | 996 mov ix last_flag_result |
993 cmp last_flag_result a | 997 cmp tmp a |
994 update_flags SZHVN1C | 998 update_flags SZHVN1C |
995 | 999 |
996 fd 10111100 cp_iyh | 1000 fd 10111100 cp_iyh |
997 lsr iy 8 last_flag_result | 1001 local tmp 8 |
998 cmp last_flag_result a | 1002 lsr iy 8 tmp |
1003 mov tmp last_flag_result | |
1004 cmp tmp a | |
999 update_flags SZHVN1C | 1005 update_flags SZHVN1C |
1000 | 1006 |
1001 fd 10111101 cp_iyl | 1007 fd 10111101 cp_iyl |
1008 local tmp 8 | |
1009 mov iy tmp | |
1002 mov iy last_flag_result | 1010 mov iy last_flag_result |
1003 cmp last_flag_result a | 1011 cmp tmp a |
1004 update_flags SZHVN1C | 1012 update_flags SZHVN1C |
1005 | 1013 |
1006 10111110 cp_hl | 1014 10111110 cp_hl |
1007 z80_fetch_hl | 1015 local tmp 8 |
1016 z80_fetch_hl | |
1017 mov scratch1 tmp | |
1008 mov scratch1 last_flag_result | 1018 mov scratch1 last_flag_result |
1009 cmp scratch1 a | 1019 cmp tmp a |
1010 update_flags SZHVN1C | 1020 update_flags SZHVN1C |
1011 | 1021 |
1012 dd 10111110 cp_ixd | 1022 dd 10111110 cp_ixd |
1023 local tmp 8 | |
1013 z80_fetch_index ix | 1024 z80_fetch_index ix |
1025 mov scratch1 tmp | |
1014 mov scratch1 last_flag_result | 1026 mov scratch1 last_flag_result |
1015 cmp scratch1 a | 1027 cmp tmp a |
1016 update_flags SZHVN1C | 1028 update_flags SZHVN1C |
1017 | 1029 |
1018 fd 10111110 cp_iyd | 1030 fd 10111110 cp_iyd |
1031 local tmp 8 | |
1019 z80_fetch_index iy | 1032 z80_fetch_index iy |
1033 mov scratch1 tmp | |
1020 mov scratch1 last_flag_result | 1034 mov scratch1 last_flag_result |
1021 cmp scratch1 a | 1035 cmp tmp a |
1022 update_flags SZHVN1C | 1036 update_flags SZHVN1C |
1023 | 1037 |
1024 11111110 cp_immed | 1038 11111110 cp_immed |
1039 local tmp 8 | |
1025 z80_fetch_immed | 1040 z80_fetch_immed |
1041 mov scratch1 tmp | |
1026 mov scratch1 last_flag_result | 1042 mov scratch1 last_flag_result |
1027 cmp scratch1 a | 1043 cmp tmp a |
1028 update_flags SZHVN1C | 1044 update_flags SZHVN1C |
1029 | 1045 |
1030 00RRR100 inc_reg | 1046 00RRR100 inc_reg |
1031 add 1 main.R main.R | 1047 add 1 main.R main.R |
1032 update_flags SZYHVXN0 | 1048 update_flags SZYHVXN0 |
1207 | 1223 |
1208 00101111 cpl | 1224 00101111 cpl |
1209 not a a | 1225 not a a |
1210 update_flags YH1XN1 | 1226 update_flags YH1XN1 |
1211 | 1227 |
1212 11101101 neg | 1228 ed 01DDD100 neg |
1213 neg a a | 1229 neg a a |
1214 update_flags SZYHVXN1C | 1230 update_flags SZYHVXN1C |
1215 | 1231 |
1216 00111111 ccf | 1232 00111111 ccf |
1233 local tmp 8 | |
1234 and 0x80 chflags chflags | |
1235 lsr chflags 4 tmp | |
1236 or tmp chflags chflags | |
1217 xor 0x80 chflags chflags | 1237 xor 0x80 chflags chflags |
1218 | 1238 update_flags N0 |
1219 00111111 scf | 1239 |
1220 or 0x80 chflags chflags | 1240 00110111 scf |
1241 update_flags H0N0C1 | |
1221 | 1242 |
1222 00000000 nop | 1243 00000000 nop |
1244 | |
1245 01110110 halt | |
1246 sub 1 pc pc | |
1223 | 1247 |
1224 11110011 di | 1248 11110011 di |
1225 mov 0 iff1 | 1249 mov 0 iff1 |
1226 mov 0 iff2 | 1250 mov 0 iff2 |
1227 #TODO: update interrupt/sync cycle | 1251 #TODO: update interrupt/sync cycle |
1229 11111011 ei | 1253 11111011 ei |
1230 mov 1 iff1 | 1254 mov 1 iff1 |
1231 mov 1 iff2 | 1255 mov 1 iff2 |
1232 #TODO: update interrupt/sync cycle | 1256 #TODO: update interrupt/sync cycle |
1233 | 1257 |
1234 ed 01000110 im0 | 1258 ed 01D00110 im0 |
1235 mov 0 imode | 1259 mov 0 imode |
1236 | 1260 |
1237 ed 01010110 im1 | 1261 ed 01D10110 im1 |
1238 mov 1 imode | 1262 mov 1 imode |
1239 | 1263 |
1240 ed 01011110 im2 | 1264 ed 01D11110 im2 |
1241 mov 2 imode | 1265 mov 2 imode |
1266 | |
1267 ed 01D01110 im3 | |
1268 mov 3 imode | |
1242 | 1269 |
1243 11000011 jp | 1270 11000011 jp |
1244 z80_fetch_immed16 | 1271 z80_fetch_immed16 |
1245 mov wz pc | 1272 mov wz pc |
1246 | 1273 |