The Ctrl + V Game

Enovale

Hey. I exist. Woo
Member
Joined
Jul 12, 2016
Messages
833
Trophies
0
Location
Narnia
XP
946
Country
United States

What the actual fuck

--------------------- MERGED ---------------------------

#include "dma_core.hpp"

#include "../bus.hpp

#include "../gpu/gpu_core.hpp"



static dam::state_t state;



static void update_irq_active_flag() {

auto forced = ((state.dicr >> 15) & 1) != 0;

auto master = ((state.dicr >> 23) & 1) != 0;

auto signal = ((state.dicr >> 16) & (state.dicr >> 24) & 0x7f) != 0;

auto active = forced || (master && signal);



if (active) {

if (!(state.dicr & 0x80000000)) {

bus::irq(3);

}



state.dicr |= 0x80000000

} else {

state.dicr &= ~0x80000000;

}

}



static uint32_t get_channel_index(uint32_t address) {

return (address >> 4) & 7;

}



static uint32_t get_channel_index(uint32_t address) {

return (address >> 2) & 3;

}



uint32_t dma::bus_read(int width, uint32_t address) {

auto channel = get_channel_index(address);

if (channel == 7) {

switch (get_register_index(address)) {

case 0: return state.dpcr;

case 1: return state.dicr;

case 2: return 0x7ffac68b;

case 3: return 0x00fffff7;

}

}

else {

switch (get_register_index(address)) {

case 0: return state.channels[channel].address;

case 1: return state.channels[channel].counter;

case 2: return state.channels[channel].control;

}

}



return 0;

}



void dma::bus_write(int width, uint32_t address, uint32_t data) {

auto channel = get_channel_index(address);

if (channel == 7) {

switch (get_register_index(address)) {

case 0: state.dpcr = data; break;



case 1:

state.dicr &= ( 0xff000000);

state.dicr |= (data & 0x00ff803f);

state.dicr &= ~(data & 0x7f000000);

update_irq_active_flag();

break;



case 2: break;

case 3: break;

}

}

else {

switch (get_register_index(address)) {

case 0: state.channels[channel].address = data & 0x00ffffff; break;

case 1: state.channels[channel].counter = data & 0xffffffff; break;
god both my computer and my phone have code XD
 

Seriel

Doing her best
Member
Joined
Aug 18, 2015
Messages
3,298
Trophies
3
Age
24
Location
UK
XP
6,053
Country
United Kingdom
651_DiscordCanary_8b99.png
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan @ BakerMan:
    guys why the hell is my internet connection so shit rn?
  • SylverReZ @ SylverReZ:
    @BakerMan, If it's so shitty, why don't you clean it up. :tpi:
    +1
  • AncientBoi @ AncientBoi:
    [uploads TP] :D
    +1
  • BigOnYa @ BigOnYa:
    @BakerMan I bet your mom found out you watching those kind of vids on your 3ds again, and put a limit on you.
    +3
  • BakerMan @ BakerMan:
    first of all, i don't watch those kinds of videos, and if i did i'd pull a verbalase 50k but with wizards and wario
    +1
  • BakerMan @ BakerMan:
    second of all, i don't even have a 3ds
  • BigOnYa @ BigOnYa:
    OnlyWizard&WarioFans.com
    +2
  • BakerMan @ BakerMan:
    i just want a wizard to stick his wand (whether literal or figurative is up to interpretation, either way it's either freaky or sus, or both i guess) up my ass
  • BigOnYa @ BigOnYa:
    I'm making Texas sheet cake for first time today, my Nieghbor brought us some few weeks ago and damn that's good, so I got her recipe and gonna try it today.
  • BakerMan @ BakerMan:
    mmm, sounds good
  • BigOnYa @ BigOnYa:
    Its not a brownie, and its not a cake, so what is it- Texas sheet cake.
  • BigOnYa @ BigOnYa:
    I tried making chocolate lava cakes the other day in cupcake pan, what a mess, my lava exploded out of the cakes everywhere while baking, was still ok tho, just no lava inside.
  • BigOnYa @ BigOnYa:
    We had our grandkids over yesterday and I got a small above ground swimming pool I filled for them to play in. Well today I woke to find 3 ducks swimming around in it. Don't mind really but they are annoyingly loud, quack quack. Gotta drain it today. Guess what were having for dinner, lol.
    +1
  • BakerMan @ BakerMan:
    lol
  • AncientBoi @ AncientBoi:
    BBQ'd 🦆
    +1
  • BakerMan @ BakerMan:
    also i'm sorry your molten lava cakes failed
    +2
  • BakerMan @ BakerMan:
    just looked up a pic of texas sheet cake, and it looks delicious
    +1
  • AncientBoi @ AncientBoi:
    🌋 Science Project?
  • BakerMan @ BakerMan:
    i think i might need to try making lava cakes for the 4th of july fr
    +2
  • BigOnYa @ BigOnYa:
    I used butter instead of vegetable oil, and think that's why they squirted out during baking, who knows
  • BakerMan @ BakerMan:
    yeah i think oil is the right call
    +1
  • BakerMan @ BakerMan:
    plus if you're making brownies or lava cakes for people with dairy allergies, you should use oil instead of butter anyway
    +1
    BakerMan @ BakerMan: plus if you're making brownies or lava cakes for people with dairy allergies, you should use oil... +1