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,045
Country
United Kingdom
651_DiscordCanary_8b99.png
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • RedColoredStars @ RedColoredStars:
    Guy doesnt know wtf hes talking about half the time
  • realtimesave @ realtimesave:
    @SylverReZ that reminds me that my friend sells CRTs he gets cheap or free for hundreds of dollars. people are dumb
    +1
  • RedColoredStars @ RedColoredStars:
    And is incredibly annoying.
  • realtimesave @ realtimesave:
    man I just washed my shoes and they look exactly the same as before I washed them :|
  • realtimesave @ realtimesave:
    luckily they didn't fall apart
  • RedColoredStars @ RedColoredStars:
    Some CRTs are very much worth the price
  • RedColoredStars @ RedColoredStars:
    i used to go out to the recycling center every couple weeks and look at the crts and other electronics people would drop off. Usually screens were broken or severely scratched from being tossed around. Did find a good one here and there, but never anything like a 1080i widescreen crt.
  • RedColoredStars @ RedColoredStars:
    Or a good contition 40" Sony Trini that weighs 300 lbs. lol
  • RedColoredStars @ RedColoredStars:
    Literally 300 lbs. lolol
  • BigOnYa @ BigOnYa:
    I have a few of those boat anchors in my basement I tried giving away but no one wanted them, So anyone close to Columbus, Ohio area that wants them, (26", 2x 19") please come get, for free.
  • RedColoredStars @ RedColoredStars:
    Dont know anyone wants those smaller ones. Most are after larger sizes and the kinda top of the line models
  • RedColoredStars @ RedColoredStars:
    Motion handling and input lag on those things destroy plasmas, led, oled
  • realtimesave @ realtimesave:
    I had some really nice CRTs I should've kept
  • realtimesave @ realtimesave:
    now I have all lcd
  • realtimesave @ realtimesave:
    one in particular I regret getting rid of oh well :|
  • realtimesave @ realtimesave:
    the Sonys and stuff I don't care about
  • realtimesave @ realtimesave:
    and used LCD are hard to sell I can imagine.. not worth much
  • realtimesave @ realtimesave:
    @SylverReZ where do u lurk
  • a_username_that_isnt_cool @ a_username_that_isnt_cool:
    Is it piracy if it was released for free? Not in my opinion, but I also think it's not piracy if buying it isn't owning it, and it's not piracy if you can't buy it from the original creators anymore.
  • K3Nv2 @ K3Nv2:
    Free release can have loopholes where they still make money through ads
    +1
  • Xdqwerty @ Xdqwerty:
    sigh
  • Xdqwerty @ Xdqwerty:
    @a_username_that_isnt_cool, could you change your username?
  • Xdqwerty @ Xdqwerty:
    i guess not...
    Xdqwerty @ Xdqwerty: i guess not...