Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

65816 memory emulation #13

Open
dominicbeesley opened this issue Jun 26, 2024 · 5 comments
Open

65816 memory emulation #13

dominicbeesley opened this issue Jun 26, 2024 · 5 comments

Comments

@dominicbeesley
Copy link
Contributor

Does this support memory modelling in 65816 mode?

I'm using the following command:
decode6502 --mem=F0F --cpu=65816 -ahisy

but it doesn't seem to log memory writes nor does it pick up some "deliberate" mistakes where my d,X addressing mode was picking up the wrong byte.

00C01C : 86 03 : STX 03 : 3 : A=??03 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=????
00C01E : E6 03 : INC 03 : 5 : A=??03 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=????
00C020 : A5 03 : LDA 03 : 3 : A=??80 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=????
00C022 : 45 03 : EOR 03 : 3 : A=??00 X=007F Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=1 C=0 E=1 PB=00 DB=?? DP=????
00C024 : 85 05 : STA 05 : 3 : A=??00 X=007F Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=1 C=0 E=1 PB=00 DB=?? DP=????
00C026 : E6 03 : INC 03 : 5 : A=??00 X=007F Y=???? SP=01?? N=1 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=????
00C028 : A2 02 : LDX #2 : 2 : A=??00 X=0002 Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=0 C=0 E=1 PB=00 DB=?? DP=????
00C02A : B5 03 : LDA 03,X : 4 : A=??00 X=0002 Y=???? SP=01?? N=0 V=0 M=1 X=1 D=0 I=1 Z=1 C=0 E=1 PB=00 DB=?? DP=????
0

The Load at C02A is now working correctly but when it wasn't (it was bringing back 81) the registers said A=81 and I'd have expected a prediction fail.

Is it just that the 65816 emulation is not doing the memory modelling. It has been dead useful so far getting simple stuff working but now I'm getting to the more tricksy addressing modes it would be good to have it working. If it's not done for 816 - where should I start, I'm happy to put some effort in to adding it!

D

@hoglet67
Copy link
Owner

hoglet67 commented Jun 26, 2024

It should log writes, as long as it can figure out the effective address.

In your case the STX 03 is not logged because the DP register is unknown, so the effective address is unknown.

If you know the value, you can force it with the --dp= option.

Let me know if this works.

@hoglet67
Copy link
Owner

Oh, and also watch out for the DB register also being unknown, which will affect writes from other addressing modes. This can be forced with --db= option.

@dominicbeesley
Copy link
Contributor Author

dominicbeesley commented Jun 26, 2024 via email

@hoglet67
Copy link
Owner

Good stuff....

BTW, I'm thinking of adding 6800 emulation to the 6502 decoder, as it's so similar architecturally.

@dominicbeesley
Copy link
Contributor Author

dominicbeesley commented Jun 26, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants