From 5ecc74c4356bcc960b3a13eb0cd61df66b739504 Mon Sep 17 00:00:00 2001 From: goyuken Date: Fri, 31 Jan 2014 22:58:54 +0000 Subject: [PATCH] GB: implement the undefined opcodes. according to sources, they completely lock up the machine; so they are emulated as DI; , which should do the trick? testing needed. thanks to sanqui for pointing this out --- libgambatte/src/cpu.cpp | 25 +++++++++++++++++++++++++ output/dll/libgambatte.dll | Bin 176640 -> 176640 bytes 2 files changed, 25 insertions(+) diff --git a/libgambatte/src/cpu.cpp b/libgambatte/src/cpu.cpp index 711319b7bb..c83f434f8b 100644 --- a/libgambatte/src/cpu.cpp +++ b/libgambatte/src/cpu.cpp @@ -2512,6 +2512,8 @@ void CPU::process(const unsigned long cycles) { break; case 0xD3: /*doesn't exist*/ + skip = true; + memory.di(); break; //call nc,nn (24;12 cycles): @@ -2578,6 +2580,8 @@ void CPU::process(const unsigned long cycles) { break; case 0xDB: /*doesn't exist*/ + skip = true; + memory.di(); break; //call z,nn (24;12 cycles): @@ -2591,6 +2595,11 @@ void CPU::process(const unsigned long cycles) { } break; + case 0xDD: /*doesn't exist*/ + skip = true; + memory.di(); + break; + case 0xDE: { unsigned data; @@ -2626,8 +2635,12 @@ void CPU::process(const unsigned long cycles) { FF_WRITE(0xFF00 | C, A); break; case 0xE3: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xE4: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xE5: push_rr(H, L); @@ -2682,10 +2695,16 @@ void CPU::process(const unsigned long cycles) { break; case 0xEB: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xEC: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xED: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xEE: { @@ -2734,6 +2753,8 @@ void CPU::process(const unsigned long cycles) { break; case 0xF4: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xF5: /*push_rr(A, F); Cycles(16); break;*/ calcHF(HF1, HF2); @@ -2806,8 +2827,12 @@ void CPU::process(const unsigned long cycles) { break; case 0xFC: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xFD: /*doesn't exist*/ + skip = true; + memory.di(); break; case 0xFE: { diff --git a/output/dll/libgambatte.dll b/output/dll/libgambatte.dll index 058c1e64dde6f87536efa35b6211cbab5249c4d6..68495d184db106289ab6e77e45ddfadc60d0fba4 100644 GIT binary patch delta 6564 zcmZu$d3;nww!U@KKtq5u1SB?{P6r4}lFq)6Kp-)MP9XbAfXJ4GWdtIiqLNPR1hdEz zj{EWh1Vp~z8nOq$W))HYRMJvj2DwYA281E%VmlZbh7DG*Ez=}506tGH{?gi zOl!&ZP!uo6(U!D;TH!fysiL?h)a5^=7+`ly0Q5{OG{3Y20}eV1n?Amp`KqGSJ5CQ* z6tu>K-fo8yE|mO|r{_2MURO-T~_At`W_cmWCnE#hH#FfdqT!`{Go;%Ddy zG>Nld42ltZASY;)y0rxS9Wn4ykj*@_XrC>@SNofYoaGZPgI`R1v$~r zsRQ%iKx7Pzi^(-UnyV4Fq8xU)P*^~pa1lHoJ5I#H zQA|g{#n`F#_UxN2YXDzaP_e-2mivzG zSV((EPm&Lc zARpmWihOX9iFD`oLCu$=iD0>Ub|ZB}xP5TMzcQ(a=7WjLL^NqWnD`6{_OUo#Z?DH2 z%||@@pa}A@mP(NiE>cE!ZXeX^GM@;y4Erhy&tACLUb=I8A$bWzxV7dIC-#A33?)2ejMI;y-RNch}2QgIXzxDAu!c_FGy`p*yC!Z8MpkenHw7b$ITAe%;>l|69QRB!9DMDA;ld1q zs?LEQXIRA9T_v6nHi#Xrb5N^Xy~XK2C0cbVpGfd#2{7V zz^;4B#Wfg|93c)vd~%eigEh$!YHkY5PWOj}$s>g?oW;!VVaTjU%`0aqO60KypxLv* zK@;@J6el8@b7XeQ-dQL)0orCS#J;Ps`9O+ogm{V38bs?5O%Z8){~_M{F}jB6|G{N@ zKs*8uq?*Mdcq(-g&3Kr4!MB)x2gA}PiB^cl^cg5go20IpsjUJgXiW=K#Z0)7HkQKX za2T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