Giter Club home page Giter Club logo

Comments (6)

boblaublaw avatar boblaublaw commented on June 29, 2024

In his talk I believe @lefticus mentions that the leftover registers are assigned some fixed addresses in the zero page which the 6502 will access faster than other RAM.

from 6502-cpp.

Yamakaky avatar Yamakaky commented on June 29, 2024

Oh, right. But how can we be sure that the program doesn't use it?

from 6502-cpp.

lefticus avatar lefticus commented on June 29, 2024

That is correct. I use zero page mapping of x86 registers. The mapping is here: https://github.com/lefticus/x86-to-6502/blob/master/src/main.cpp#L75-L92

I'm relying on two things specifically

  1. I'm targeting the C64, so I know that the ROM/hardware isn't using those locations: http://sta.c64.org/cbm64mem.html
  2. I'm assuming that the entire program executing is the one that was translated from x86

from 6502-cpp.

Yamakaky avatar Yamakaky commented on June 29, 2024

Ok, thank.

from 6502-cpp.

boblaublaw avatar boblaublaw commented on June 29, 2024

How best to implement alternative zero-page mappings? Implement get_register as a function pointer and write multiple implementations? Make new C64 and A2 classes that inherit from a the base 6502 class and implement their own get_register methods?

I'm specifically thinking of targeting Apple II.

http://apple2.org.za/gswv/a2zine/faqs/csa2pfaq.html#017

from 6502-cpp.

lefticus avatar lefticus commented on June 29, 2024

Since this is just a huge experiment anyhow and I have no idea what would be the best answer in the long run - I say go with the function pointer (or std::function, or template Callable thing?) and we'll see how it ends up working out.

from 6502-cpp.

Related Issues (8)

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.