HackingPheasant (@HackingPheasant) header
HackingPheasant (@HackingPheasant) profile picture

Hacker & Tinker. DMs open. Beginner in C++. He/Him

The Internet
Joined August 2019
Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)Photo by HackingPheasant (@HackingPheasant)
HackingPheasant retweeted
Replying to @JaceCear
Oh, trust me, the time is coming soon to be bustin' out the 'semblies. Even here, a bunch of the crap I'm calling is literally just a tiny macro wrapper around inline ASM. But modern C++ is not all cruft. The truth is that it can do shit at compile-time that C itself cannot dream of... and I need everything I can possibly leverage, ASM to C++. Shit, I'd be in Objective-C++ too right now if I could fit the ObjC runtime. lmfao.
1
1
23
1,239
HackingPheasant retweeted
Writing the most absurdly, meticulously hand-optimized sprite and billboard rendering routine of my life for our #GTA 3 port to the Sega #Dreamcast. This baby gets used by all of GTA3's UIs, fog effects, screen-space effects, and ESPECIALLY the fake bloom-lighting effects you see blurring light sources in the scene... First of all, I bumped the project up from C++17 to GNU++23, because I ain't fucking around here, and I need every dirty tool at my disposal from C and C++. Good, evil, or questionable language features? Don't care. Enabled! Then what you're looking at here is the core routine for blasting sprites through the Dreamcast's fast path. The pvrVertexSubmit() lambda is responsible for translating one of the GTA3 engine's vertex types over to the Dreamcast's vertex type, and it do so by mapping a DC vertex directly into a "store queue" on our SH4 CPU, where we fill the thing in directly. A store queue is a pretty damn interesting feature of the SuperHitachi architecture which allows us to copy data around extremely quickly by writing cache-line sized chunks of data (32-bytes) into it then issuing a cache flush on it to write its contexts extremely quickly through the cache and into some other region of memory... It's the fastest mechanism we have for memory transfers, faster than DMA, and we have two of them. What happens here is that we've preconfigured the store queues' destination addresses to point to the PowerVR GPU's TA (Tile Accelerator), which is the unit that processes incoming vertices, storing them within vertex buffers in VRAM until it is time to draw the scene. pvr_dr_target() here is simply returning a pointer to ONE of the two store queues, then we translate gtaVert to pvrVert within the SQ, and finally do a call to pvr_dr_commit() to blast that fucker directly to the TA... Something to keep in mind is that although we have two SQs, they cannot both be flushed and accessing the memory bus simultaneously, or the SH4 CPU's pipeline will stall while he first store queue finishing flushing. What we do instead is alternate between writing to one while we flush another store queue. This essentially creates an efficient transfer pipeline where we are never stalled waiting for one store queue to finish! This is honestly the Dreamcast's equivalent of the Genesis's fabled "Blast Processing." Now, the rest of the sprite routine is pretty standard crap, just looping over vertices, blasting them through the store queues. I have gone ahead and added C++20's [[likely]] and [[unlikely]] optimization hints on branches and loops, and yes, we have confirmed that they do actually impact performance on the SH4 architecture with GCC14! The loops have also been unrolled to process up to three vertices at a time, prefetching each one into the cache while we're writing the previous one to the store queue... allowing us to easily push a shitton of these sprites. #cplusplus #cpp #gamedev #retrocomputing
17
82
5
793
40,753
I can't believe I'm the one who's scared of taking jobs working in the kernel/ring0 and writing drivers but these 80billion USD-valuation companies can just no-protection rawdog the kernel with the sloppiest practices I've ever seen and it's totally okay. Sweet mercy.
Crowdstrike party time... it looks like the data was uninitialized, but not intentionally. The mismatch in the code run at ring0 was them fucking up validation, and they failed to account in their C++-built interpreter. It accessed data that was "supposed" to be there but wasn't.
9
35
465
16,172
Lmao
This morning, we published the Root Cause Analysis (RCA) detailing the findings, mitigations and technical details of the July 19, 2024, Channel File 291 incident. We apologize unreservedly and will use the lessons learned from this incident to become more resilient and better serve our customers. To any customer still affected, please know we will not rest until all systems are restored. For the executive summary and full RCA, please visit crowdstrike.com/falcon-conte…
43
HackingPheasant retweeted
I need the people to know that olympic silver medalist giorgia villa is sponsored by parmesan cheese and regularly posts pics of herself with giant wheels of cheese
1,421
16,574
5,999
226,618
20,293,064
I very very very rarely watch or read anything more than once.
Are you a ‘watch the same show over and over again’ autistic, or a ‘watch a show once and then consider it completed’ autistic?
26
Replying to @RGBCubed
It's the best title I can have. :D
1
1
11
265
Time for me to put my performance where my mouth is and show everybody how it's done.
Can a generic text encoding library be both versatile and fast? At #P99CONF on Oct. 23-24, @ShepherdsOasis' @__phantomderp will share how to achieve top speed without sacrificing user-friendly APIs. Don't miss this interactive session! ow.ly/RV1J50SHa8h #ScyllaDB #DevTalk
4
14
242
10,979
| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄| | Don't Push To Production On Friday | |_________________| \ (•◡•) / \ / —— | | |_ |_
400
15,629
1,260
74,048
2,970,539
HackingPheasant retweeted
This global outage sounds like I’m finally getting the y2k bug I was promised as a child
34
1,684
86
11,056
1,688,699
The plot thickens.
13
618
26
9,090
258,591
HackingPheasant retweeted
she malloc() on my heap till I oom
26
339
18
3,894
177,269
HackingPheasant retweeted
Replying to @fasterthanlime
IN FAIRNESS it was a pretty novel idea AND they had to preserve backwards compatibility. Obviously in a world with Rust it all feels insane and backwards but at the time they were inventing it from whole cloth. Anyway the answer is C++ is pass-by-clone, use `std::move` to move
1
2
1
112
12,753
For all the people currently freaking out about the Once Human Privacy Policy. The policy states under "Personal Information we receive from you:" that they receive "Name & Contact Details" "Such as first and last name, title, prefix, email address, telephone number, (instant) messaging account, postal address, date of birth, age, gender, country/region, and government-issued ID, such as passport information, as required by applicable laws for age verification and correction of personal information." The general internet has warped this into a demanded requirement and a privacy issue. It's not. These are only sent to the company when required by applicable local laws. This is why it says "Receive from you" and "as required by applicable laws". In some countries government issued ID's are required for live service game access. If you are not in one of these countries you obviously are not asked or required to present those documents. Fearmongering on social media is boring as shit.
250
1,478
101
15,207
1,396,737
HackingPheasant retweeted
We DO NOT throw perfectly good food away in this house. We put leftovers in a Tupperware & let it go bad, THEN throw it out!
678
14,309
894
188,186
5,199,146
HackingPheasant retweeted
crazy that the only one of these companies founded in the City of San Francisco is Saudi Aramco
51
625
109
7,534
974,185
HackingPheasant retweeted
The libarchive e8 vulnerability is actually really cool, but the ZDI advisory doesn't explain why it's so wild lol. For some reason, I know about RAR filters, so let me provide the background. 🧵 1/n
3
172
7
589
116,891