Giter Site home page Giter Site logo

Comments (3)

floooh avatar floooh commented on June 3, 2024

Hmm ok, I'm currently "mentally tuned out" from emulator coding so I don't quite remember why I coded it that way.

But you're right, this seems to be a bug (it definitely behaves differently than visual6502). Looks like this is a side effect of the code generation which assumes that the abs,X addressing mode works like in regular instructions, which doesn't seem to be the case here.

To my defense, I didn't care much about the undocumented instructions which are marked as "unstable", because I expected that such unstable instructions would never be useful in regular code anyway (different from the "stable" undocumented instructions which might be useful).

from chips.

rofl0r avatar rofl0r commented on June 3, 2024

it definitely behaves differently than visual6502

indeed, it seems in visual6502 Y influences not only the value, but also the location being written to, contrary to all documentation i've encountered.
it appears the page being written to is Y & X & (hibyte(addr)+1).

I didn't care much about the undocumented instructions which are marked as "unstable", because I expected that such unstable instructions would never be useful in regular code anyway

thanks, good to know. i'll let you know i f i figure out the exact algorithm matching the behaviour of visual6502.

from chips.

rofl0r avatar rofl0r commented on June 3, 2024

ok, i figured out the behaviour that makes blargg test 6 pass, as well as being seemingly identical to visual6502 remix. so maybe the behaviour isn't that unstable after all.

my code for shy is

                        u8 data = Y & (op.pb[1]+1);
                        addr = (op.pb[0] + X)&0xff;
                        addr |= data << 8;
                        CPU_WRITE_N(&data, addr, 1);

where op.bp are the bytes immediately following the opcode, so in the above example pb[0] is 0xfe and pb[1] is 2.

from chips.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.