Code Monkey home page Code Monkey logo

Comments (5)

camthesaxman avatar camthesaxman commented on May 29, 2024

Some of the code does use a bitfield, but other parts assign the values directly, and using a bitfield won't match. We already have a vBgCnt struct in types.h for this.

from pokeruby.

LIJI32 avatar LIJI32 commented on May 29, 2024

Exactly, which is why they should be defined as unions. It's good to know these are already defined in types.h, so I don't need to redefine them. Additionally, do_boulder_dust also uses the DMA3 registers as structs of 3 u16s:

    REG_DMA3.SAD = (u32) &var_c;
    REG_DMA3.DAD = r1;
    REG_DMA3.CNT = 0x85000400;

from pokeruby.

RevoSucks avatar RevoSucks commented on May 29, 2024

Isnt that just a DmaFill32 ? Please use the macros defined in gba/macros.h

from pokeruby.

LIJI32 avatar LIJI32 commented on May 29, 2024

Turns out it is, thanks!

from pokeruby.

camthesaxman avatar camthesaxman commented on May 29, 2024

Oh, I see what you mean about making it a union. I believe that would match at the cost of being slightly more verbose because of the extra member required. If there's a significant amount of code that accesses it as a bitfield, then the change is probably worth it. If the vast majority of code accesses it as a raw u16, then it might be good to leave it as it is.

from pokeruby.

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.