Skip to content

For the ALL opcodes, increase cycles if page swap #17

@santanor

Description

@santanor

There are some OPcodes that will take one cycle more if during its execution they have to swap a memory page. As an example, reading a word from 0xFF will cause it to swap since it will read one byte from 0xFF and the next one from 0x100.

We need to figure out a good way of detecting when this has happened without duplicating tons of code.
i.e. should we have a function on memory.h/c named has_page_swapped that returns 1 or 0 if the page has swapped since the last read/write? I don't know. Is there a better way? Let's focus mainly on clarity and avoid dupplicate code.

All of the opcodes that need this functionality are marked with a TODO on cpu.c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions