#💽Programming Chat v2

1 messages · Page 39 of 1

spare quartz
#

(3d matrix mult is more flat)

rustic vine
spare quartz
# rustic vine

so YOU'RE the person sending me files byte by byte over torrents

#

and making me have 1 byte/second speeds

rustic vine
#

LOL

#

thats evil

spare quartz
#

how unfortunate this mod isnt an emulator

#

just a webview

timid quartz
#

ada most inefficient!!!

spare quartz
#

just regular numerics

#

the one on the right is the ada library with SIMD

timid quartz
spare quartz
timid quartz
#

there's an experimental api in std::simd but also stable simd support for x86 and x86_64 in core::arch

spare quartz
#

"experimental"

#

"core"

#

🥱

timid quartz
#

but the abstrations in std::simd are

spare quartz
#

i know

#

thats why i diffrentiated it

#

its still core

timid quartz
#

invlpg &atp

spare quartz
timid quartz
#

protected mode with cpl 0

spare quartz
#

BOOOOOOOORRING

timid quartz
#

like you'd be running in real mode

#

you're not real!!

spare quartz
#

naw

#

my cpu would say something like

#

flags set [PROTECTED_MODE_ENABLE]

#

cause its that cool..

#

ugghhh intellij froze

timid quartz
#

u dont know what cpl is do you

spare quartz
#

current priveledge level

#

i dunno how to spell the word in the middle

timid quartz
#

privilege

spare quartz
#

but why would you expect me NOT to know what CPL is

timid quartz
#

this is moving out of real mode

spare quartz
#

... do you not know what the initial cpl is after moving out of real

timid quartz
#

but ur not gonna be calling invlpg then

#

cause u dont have vm set up

spare quartz
#

dont need it

timid quartz
#

ok have fun with that

spare quartz
#

no.

timid quartz
#

now ur programs have to worry about where they get loaded into memory

#

if u have 2 programs that wanna get loaded in the same spot whatcha gonna do

spare quartz
#

solution

#

dont

timid quartz
#

ur programs also have to worry about the actual physical ram size

#

whatcha gonna do if ur program can't fit

spare quartz
#

solution

#

dont

#

if your program is that dependent on pages maybe it doesnt deserve to run

#

have you thought about that..

timid quartz
#

maybe if ur os doesnt do its primary job of making convenient abstractions for userspace programs then it doesnt deserve to run

spare quartz
#

nah

timid quartz
#

"nah it doesn't deserve to run"

#

agreed

spare quartz
#

no...!!!

#

i should probably add a read only flag to certain flags

timid quartz
#

I bet that PAGING_ENABLED flag is never gonna get set

spare quartz
#

not at the current stage

timid quartz
#

👎

spare quartz
#

i need proof my os runs first!!

timid quartz
#

paging ❤️

spare quartz
#

ah yes my favorite instruction Approximation to the Reciprocal Square Root of Packed Double PrecisionFloating-Point Values With Less Than 2^-28 Relative Error

spare quartz
#

ew no

timid quartz
spare quartz
#

and i REALLY hope these are never called

timid quartz
#

me when I try to run a vm on your cpu

spare quartz
#

😓

timid quartz
#

ugh that syntax

#
match r {
  0 => todo!("SGDT/VMCALL/VMLAUNCH/VMRESUME/VMXOFF"),
  // ...
}

❤️

spare quartz
#

literally the same thing

timid quartz
#

except better

spare quartz
#

nope

timid quartz
#

u have to type (r)

spare quartz
#

what about doing this

timid quartz
#

ok the nesting sucks but

#

possible

spare quartz
#

also hold this

#
[18:31:29;591/WARN [modloading-worker-0/Processor] flags set 0x0000000000000004 [PARITY_FLAG]
[18:31:29;592/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE5 (  ,  ): 0xAC lodsb al, [si [0x0000000000008D10]]
[18:31:29;594/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE6 (  ,  ): 0xE2 loop 0x00001F05 @ 0x-6
[18:31:29;597/WARN [modloading-worker-0/org.bread_experts_group.breadmod.BreadMod] kotlin.NotImplementedError: An operation is not implemented: ALPHA
timid quartz
#

drops

spare quartz
#

what

timid quartz
#

you said hold it

#

I dropped it

spare quartz
#

you're not a sql database idot.

timid quartz
#

that's what you think

spare quartz
#

also i still need to figure out why memory at 0x100000 isnt being set

timid quartz
#
DROP DATABASE whatever_atp_said;
spare quartz
#
[18:44:27;775/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE6 (  ,  ): 0xE2 loop 0x00000001 @ 0x-6
[18:44:27;775/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AE8 (  ,  ): 0x89 mov [ebp+0x-10 [0x0007FFD4]], eax
[18:44:27;775/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AEB (  ,  ): 0x8B mov eax, [ebp+0x-4 [0x0007FFE0]]
[18:44:27;778/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AEE (  ,  ): 0x3B cmp [ebp+0x08 [0x0007FFEC]], eax
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF1 (  ,  ): 0x72 jb 0x-750A
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF3 (  ,  ): 0x89 mov esp, ebp
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF5 (  ,  ): 0x5D pop ebp [0x0007FFF0]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:0000000000008AF6 (  ,  ): 0xC3 ret 0x000089CC
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089CC (  ,  ): 0x59 pop ecx [0x0000BFC0]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089CD (  ,  ): 0x5E pop esi [0x00100000]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089CE (  ,  ): 0x8B mov edx, [0x00008218]
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089D4 (  ,  ): 0xBF mov edi, 0x00008327
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089D9 (  ,  ): 0xB9 mov ecx, 0x000082D2
[18:44:27;780/WARN [modloading-worker-0/Processor] 0x0000:00000000000089DE (  ,  ): 0xB8 mov eax, 0x000082C6
[18:44:27;781/WARN [modloading-worker-0/Processor] 0x0000:00000000000089E3 (  ,  ): 0xFF jmp esi
[18:44:27;784/WARN [modloading-worker-0/org.bread_experts_group.breadmod.BreadMod] kotlin.NotImplementedError: An operation is not implemented: Unrecognized opcode (0xAB)
#

sighhh

#

whhyyyyy

#

i wish there was a way to dump all teh instructions qemu runs

timid quartz
spare quartz
#

see how its operating on 32-bit regs here without 66 set

#

its in protected mode, and GDT is set earlier before the giant loop by QEMU

#

its just not initializing the memory @ 0x100000 which is where esi is set to return to

timid quartz
#

idk maybe fix it...

spare quartz
#

a breakpoint shows up until the return to esi that the VM is running almost parallel to QEMU

#

(with the only difference being QEMU has CS set to 8 for some reason)

#

ugh thats probably why

#

CS isn't offsetting 0x100000

timid quartz
#

have you tried prefixing it with 0x80

#

so

#

0x80100000

spare quartz
#

im not allowed the modify the code running inside

#

this is QEMU

#

sorry

#

GRUB*

#

lemme just cause loop to crash again

#

see

#

in QEMU this would set CS to 0x8 but in my CPU it doesn't see a segment on ljmp for some reason

#

can we smash this guy with hammers

rustic vine
#

ok I applied 😅

#

wait

#

theres reactions in this channel now??

#

crazy work

#

🙏 the gods that be

rustic vine
# spare quartz

also kinda random thought, but, linalg in java is terrible

spare quartz
spare quartz
#

java

rustic vine
#

don't mc mods have to deal with that?

#

oh fr?

spare quartz
#

no im asking you

rustic vine
#

oh no

#

thats cpp

spare quartz
#

oh

rustic vine
#

I think?

spare quartz
#

in java, at least, for mods, we usually just use JOML

rustic vine
#

I don't use that anyway for linalg

#

I predominantly use Eigen

rustic vine
#

I've only used ejml in Java tbh

spare quartz
#

opengl oriented math lib

rustic vine
#

ah, cool

spare quartz
#

is EJML supposed to be accurate/consistent?

rustic vine
#

I believe so

spare quartz
#

cause JOML might be faster as you dont need either for rendering

rustic vine
#

hm interesting

#

I mean to be completely honest I end up JNI'ing expensive math calls to cpp anyway

#

and by extension to eigen

spare quartz
#

JNI would be too expensive for us

rustic vine
#

really?

#

the first call overheard is significant but subsequent calls are fast

spare quartz
#

mod loading class garbage just makes it a bit of a pain

#

not in terms of speed

rustic vine
#

ok expected

spare quartz
#

just writing

rustic vine
#

oh yea for sure

#

JNI is awesome

#

what

#

awful

#

not awesome

#

LOL

#

I was thinking awful and typed awesome somehow

spare quartz
#

and theres also the fact that like

#

for some awful reason a mod developer who made the backbone of the loader we work on made this new "union file system"

rustic vine
#

you end up with like a million double args to it for each field in each object, cause passing objects through ffi is even worse

timid quartz
spare quartz
#

which just makes loading from fs/jars a really convoluted process

spare quartz
#

i need to find where QEMU does the ljmp though

rustic vine
spare quartz
#

cause the decoder on my end sees no segment

timid quartz
#

it should be grub doing the ljmp

spare quartz
#

it is

rustic vine
#

ljmp longjump?

timid quartz
#

yeah

spare quartz
#

im just saying QEMU is decoding it differently

rustic vine
#

I see

spare quartz
#

causing their CS to be set while mine isnt

rustic vine
#

ohhhhh now I'm getting it

spare quartz
# rustic vine ljmp longjump?

(LJMP is just like a goto, but it sets additional things in the cpu after you set a GDT, for ex. where your code is)

rustic vine
#

ye

#

I just wasn't sure if LJMP was the instruction

#

or like if thats what yall meant

timid quartz
#

and if u havent enabled protected mode before the first ljmp u get sent into real mode

spare quartz
#

well the actual term is

#

Far jump, absolute direct

#

but ljmp is easier

rustic vine
#

oh really

#

I thought it literally stood for long jump

spare quartz
#

jmps all the way down

rustic vine
#

kinda related but do most compilers turn a if, elseif, else chain into a jump table? or does it depend on the code

spare quartz
#

Near jump, relative displacement - just an offset to IP
Far jump, absolute direct - directly sets CS/IP
Far jump, absolute indirect - directly sets IP thru a memory addr/register

timid quartz
spare quartz
timid quartz
#

cause jump tables are way more efficient

rustic vine
#

yea thats what I thought too

#

I wasn't sure if theres any cases where branching is preferred

spare quartz
#

it just depends on the heuristics the compiler does

rustic vine
#

ye ok

timid quartz
spare quartz
#

save us, C register keyword

#

🙏

#

dont let the compilers ignore you

timid quartz
#

(the compilers can still ignore it)

spare quartz
#

:<

rustic vine
#

oh btw #embed is cool I only recently learned about it

timid quartz
#
#include <stdio.h>
int main(void) {
  register int i = 1;
  register int j = 2;
  register int k = i + j;
  printf("%d\n", k);
}
spare quartz
#

the compiler very well might just put them all in a memory address somewhere... :<

rustic vine
#

tl;dr

#include <assert.h>

int main (int, char*[]) {
    static const char sound_signature[] = {
#embed <sdk/jump.wav>
    };
    static_assert((sizeof(sound_signature) / sizeof(*sound_signature)) >= 4,
        "There should be at least 4 elements in this array.");

    // verify PCM WAV resource signature (at run-time)
    assert(sound_signature[0] == 'R');
    assert(sound_signature[1] == 'I');
    assert(sound_signature[2] == 'F');
    assert(sound_signature[3] == 'F');

    return 0;
}```
spare quartz
#

BREAK *0x8235

rustic vine
#

and cpp got it recently too!

#

P1967 #embed was adopted for C++26

timid quartz
spare quartz
rustic vine
#

ok well you can do that but

#

now you can also #embed!

spare quartz
#

???

timid quartz
spare quartz
#

like i dont get it

timid quartz
spare quartz
#

istg if this is another disconnect between Operand Size and Address Size im gonna kill someone

timid quartz
#

oh yeah

#

x86 can have variable-width operands right

spare quartz
#

not in the instructions ive seen so far

#

but a 32-bit mod r/m can reference an SIB byte after it

#

making a one byte r/m into a 2 byte one

#

if that counts

#

and instructions themselves can be coded using a modr/m or the 0x0F prefix

#

0x0FEA /4
0xEA is a group instruction whose behavior depends on if the (reg) part of the modrm after it is /4

rustic vine
#

hi to keep up with my luau reputation

#

math.map was added

#

math.lerp was added

#

👍

spare quartz
#

WHO NERD REACTED Me...

#

DIE..

rustic vine
#

the culprit

spare quartz
spare quartz
#

does it take a list of values and transform them to another list

rustic vine
#

its super nice for converting fixed range floats to shorts or whatever

spare quartz
#

oh yeah we have something like that in kotlin

rustic vine
#

ye

spare quartz
#

super useful sometimes, but ours is applicable to every type

rustic vine
#

welllllllllllll

#

ok objects user

spare quartz
#

:<

rustic vine
#

also I find it hilarious that lua made all these functions callable with strings that get coerced into numbers

#

so now new functions follow that standard too

#

but if you do that you drop like all optimizations

#

lol

timid quartz
rustic vine
timid quartz
#

ok just...make a function

rustic vine
#

now I need it in a diff file

timid quartz
#
inline int map_to_pwm(int val) {
    /**
     *  OldRange = (OldMax - OldMin) = 100 - (-100) = 200
     *  NewRange = (NewMax - NewMin) 255 - 0 = 255
     *
     *  NewValue = (((OldValue - OldMin) * NewRange) / OldRange) + NewMin
     *           = (((val - (-100)) * 255) / 200) + 0
     */
    return std::round((((val - (-100.0)) * 255) / 200));
}
rustic vine
#

yeah ik

#

but now math.map

#

😃

#

and it gets fastcalled

#

yay

#

nvm it don't

#

I lied

#

too many args

spare quartz
#

what thou sigma⁉️

timid quartz
#

my code technically maps a value from one range to another

#

specifically -100 to 100 to 0 to 255

spare quartz
#

do you know how to view the machine code in gdb

timid quartz
#

uh

#

layout src

#

wait no

#

layout asm

spare quartz
#

yeah but thats just asm

#

i need the machine code

timid quartz
#

I don't think u can view the binary

spare quartz
#

worst debugger ever

timid quartz
#

you could uh

#

try dumping the memory in hex

#

x/<integer number of words>w <memory address>

#

@spare quartz

spare quartz
#

bnasck

timid quartz
#

crc check failed

#

nack

spare quartz
#

no i was bleedinmg ..

#

0x82efea66

#

BIOS DISC CPY 0x00000000002C1800 -> 0x00000000002C9800 @ 0x0000000000008000

#

0x82e0

#

ugh thats why

#

i think

timid quartz
#

it even gives the wrong answer 😭

spare quartz
#

are you Cracked

spare quartz
#

the solution

#

lies in the fucking gdt again

timid quartz
#

What’s the solution?

spare quartz
#

i have to go back to how im determining operationMode

#

also modifying this

spare quartz
#

this determines if something is actually in 32/16 bit

#

also 64 bit

#

but we can ignore that

timid quartz
#

128-bit :3

spare quartz
#

not real.

timid quartz
#

You’re right it’s not 16-bit so it’s not real

spare quartz
#

DIE

#

32-bits is also real...

#

but i dont see mainstream media talk about htat..

timid quartz
#

32-bit is imaginary

spare quartz
#

nuh uh

#

instruction prefix 0x66 my beloved

timid quartz
#

TODO("E@#$")

spare quartz
#

i was tired okay

#

"1100"

#

readSegmentDescriptor().flags

spare quartz
#

this should theoretically be it

#

CS is set...

#

still is jumping to nowhere though..

#

For legacy mode, Load byte at address DS:(E)SI into AL. For 64-bit mode load byte at address (R)SI into AL.

spare quartz
#

okay

#

ECX is being set incorrect

#

ah

#

REP STOS isnt updating ECX

proud creek
#

Funny words

timid quartz
#

rep stos

spare quartz
#

F3 AA REP STOS m8 ZO Valid Valid Fill (E)CX bytes at ES:[(E)DI] with AL.

timid quartz
#

lmfao is this code british

#

"oi, REP STOS m8"

#

finally I have uninstalled mysql from my mac 😌

spare quartz
timid quartz
#

and I couldn't work out how to uninstall it

#

but I did

#

port 3306 is free again

spare quartz
#

oooooookay my branches are fucked

timid quartz
#

your git branches

#

or your cpu branches

spare quartz
#

cpu branches

timid quartz
#

oof

spare quartz
#

something in here

rustic vine
#

who uses branches anymore

timid quartz
#

just do the computation and load eip Clueless

rustic vine
#

single commit on main, keep amending it

timid quartz
#

LOL KEEP AMENDING

#

💀

rustic vine
#

😭

spare quartz
#

beats stitching histories when you accidentally push a key 👍

rustic vine
#

its ok guys bitbucket got draft prs recently

#

I promise its good

#

guys use bitbucket its awesome and has no flaws

timid quartz
spare quartz
#

NO 😭

rustic vine
#

how does that tech work btw

spare quartz
#

git reset --soft HEAD~3
git commit -am "my bad guys i fucked up the repo"
git push --force

#

so good

rustic vine
#

I didn't even specify what tech

#

cooked

#

I meant like I've heard how if you push your discord api keys for a bot to gh you'll get an email or a notif about it being public

#

I forgot which party the email/notif comes from

#

was it gh or discord

#

must be discord right

#

how does that work?

spare quartz
#

probably just has a webhook for whenever you add a connection

rustic vine
#

a connection?

timid quartz
#

sigma

spare quartz
#

or something higher up agreed upon at the company-company level

spare quartz
rustic vine
#

oh wait, its through that?

timid quartz
spare quartz
#

i dont get alerted though since the repo i pushed a key on was private

rustic vine
#

wait thats genius

timid quartz
#

LOL

spare quartz
#

thats how i would do it

#

discord might have funny relations with gh though letting them do something more direct

timid quartz
#

it's probably github

rustic vine
timid quartz
#

github probably keeps track of your connection with discord

#

scans your repos for keys

#

and then does soemthign with that

rustic vine
#

but how does it know something is a key?

spare quartz
#

regex

timid quartz
#

keys have a general form to them

spare quartz
#

🧌

timid quartz
#

yeah

rustic vine
#

oh huh

timid quartz
#

discord keys look a certain way

spare quartz
#

or it just scans through the bots you own

timid quartz
#

discord will warn you too if you try to paste somethign that looks like a key

spare quartz
#

wait no

timid quartz
spare quartz
#

discord resets keys no matter who uploads it

#

theres actually a repo dedicated to doing that

rustic vine
#

wha

spare quartz
#

i need to find it

#

some guy operates a repo that scans other git platforms and adds it to a TXT file

timid quartz
#

ok atp so

spare quartz
#

and when discord/gh sees it, causes a reset of the added key

timid quartz
#

I grabbed a key from one of my bots

#

and changed it a bit

#

discord still warned me that it might be a key

#

so it's gotta be regex

spare quartz
#

probably

timid quartz
#

1.G-u_IG.2

#

ok

#

so the regex is a bit more complicated

rustic vine
#

lol

#

"Hey ChatGPT how do I parse html with regex"

spare quartz
#

close one

rustic vine
#

1 revision

#

the bot was too effective nobody ever posted a key

spare quartz
#

clearly a masterful gambit

rustic vine
#

oh really

#

huh

spare quartz
#

no im kididing

rustic vine
#

sorry im uninformed lol

spare quartz
#

i dunno if github would log that as activity though

timid quartz
#

yeah ok

#

I think I cracked the regex

rustic vine
#

reverse engineered it

timid quartz
#

aaaaaaaaaaaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#

this triggers the regex

rustic vine
#

you just sent it?

timid quartz
#

yeah you have to press enter twice

#

try it

rustic vine
#

oh

spare quartz
#

instead of regex

timid quartz
#

real

spare quartz
#

aaaaaaaaaaaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

timid quartz
#

aaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaa

spare quartz
#

thats funny af

timid quartz
#

hm idk

#

lol

rustic vine
#

side topic but honestly discord search is impressive

#

its speedy

#

theres prob papers about search at scale

spare quartz
#

i never really understood how those searches worked tbh

#

i know theres like indexing that windows does for example but not much beyond that

rustic vine
#

yea, but like searching servers with hundreds of millions of messages is still

#

fast?

#

maybe they're cutting corners somewhere but it seems solid

spare quartz
#

72 cb JB rel8 D Valid Valid Jump short if below (CF=1).

#

whhhhhy

rustic vine
spare quartz
#

wait

#

jb 0x-750A

#

call me stupid

#

but i dont think 0x-750A fits in a single byte

rustic vine
#

(it don't)

spare quartz
#

ohhh

#

my disassembler was using a short to represent IP

#

🙏

timid quartz
#

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.a-a_aa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

#

lol

#

it flagged that

rustic vine
#

whats the actual format of keys

#

are the As just random letters

#

numbers also?

spare quartz
#

im pretty sure it encodes your ID, email

rustic vine
#

oh gotcha

spare quartz
#

but not much beyond that

rustic vine
#

thats cool

timid quartz
#

pretty sure the format is alphanumeric

#

minus the - and _ and .

spare quartz
#

those are the delimiters, i guess

timid quartz
#

ur a delimiter.

spare quartz
#

you're a crab

timid quartz
#

#

and im proud

spare quartz
#

🤢

timid quartz
#

ur a corpse

rustic vine
#

whats ada's spirit animal

spare quartz
#

8AF1

timid quartz
#

your mascot is dead

spare quartz
rustic vine
#

is it an airplane

#

oh close enough

spare quartz
#

its a hummingbird

timid quartz
#

great contributions to cs

#

but shes dead

spare quartz
#

kys!!!

rustic vine
#

good contributions all around

spare quartz
#

or earlier

rustic vine
#

HUH

#

cs in the 1800s??

spare quartz
#

yeah shes touted as the first programmer

rustic vine
#

oh wth it was actually 1800s

spare quartz
#

which means WE... have a programmer with 200 years of experience

rustic vine
#

wait they've been coooking for like forever

spare quartz
#

all of your rustlets are babies..

timid quartz
spare quartz
#

no....

spare quartz
#

can you run rust on this...

timid quartz
#

can you run ada on it

spare quartz
#

yes

timid quartz
#

mm

#

I don't think so

spare quartz
#

you know why...

timid quartz
#

why

spare quartz
#

Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852), also known as Ada Lovelace, was an English mathematician and writer chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, the **Analytical Engine. **

#

:3

#

:3

timid quartz
#

ok but

#

that's not running ada

spare quartz
#

yes it is

timid quartz
#

that's ada running it

spare quartz
#

meow

timid quartz
spare quartz
#

okay well

#

i dont see Sir Rust making a computer

#

so we still win

timid quartz
#

Rule #1 of programming

#

Ada always loses

#

Rust beats Ada, Ada beats C, C beats Rust

spare quartz
#

R > A
A > C
C > R
A > C > R && R > A

#

Stop violating logic!!!

timid quartz
#

:3

lavish dove
#

State of the art lmao

spare quartz
#

faulting instruction ... JB

#

reason ... CMP not setting carry

spare quartz
#

decoding optimization

#

as well as disassembler

spare quartz
#

QEMU is such a useful tool

#

also this too

#

nerd...

#

MAN

#

i really need to watch what i repost on twitter

#

i dont want some femboy furry on this guys feed 😭

proud creek
#

Bro what 😭

spare quartz
proud creek
#

!!!

rustic vine
#

working on it

spare quartz
#

liar

rustic vine
#

hey thats why I said working on it

spare quartz
#

we're removing your funding.

rustic vine
#

pray its goated enough

spare quartz
#

thatll be farrrr beyond whatever they're expecting honestly

rustic vine
#

made with vide!

#

and ecr!

spare quartz
#

EXTERNAL LIBRARIES⁉️

#

🪦

rustic vine
#

wait

#

am I gonna get cooked for that

#

lol

spare quartz
#

nah im kidding

rustic vine
spare quartz
#

not true ...

lavish dove
#

imgui in normal computing is complex for some reason

#

"simple" "not bloat" (complex, bloat)

rustic vine
rustic vine
spare quartz
#

lies..

#

yet another instruction format change

#

oops

#

hat could've been bad..

#

totally normal class names im making

#

RegisterMemorySelectorSingleOperandGroupInstruction

#

mrmd sounds like a drug..

#

has science gone too far?

spare quartz
#

i think this is an improvement over

spare quartz
spare quartz
#

the decoder grows stronger everyday.

#

you cant tell me its not beautiful

#

the entire decoding annex is so big

timid quartz
#

(joking)

#

In other news I’ve fucked my NixOS dual-boot on my MacBook by trying to triple-boot with Fedora

#

so uh gotta figure that out tomorrow

spare quartz
#

i THINK this perfectly encodes 0F 22 /r MOV CR0–CR7, r32

spare quartz
lyric mesa
pallid loom
rustic vine
timid quartz
#

Also congrats on physicist

rustic vine
rustic vine
timid quartz
rustic vine
spare quartz
#

002939

timid quartz
#

I’m basically having to reinstall NixOS with grub set from the get-go

#

But triple boot isn’t too bad you just need to set one bootloader that’s capable of finding other OSes, like grub using os-prober

rustic vine
rustic vine
#

oh its a macbook ain't it, no wsl then

#

a vm maybe?

spare quartz
#

bring back bootcamp apple..

timid quartz
rustic vine
#

what are the use cases?

timid quartz
#

I normally run NixOS but I decided to install Fedora because I want to try to program a FPGA with Quartus Prime directly from my laptop rather than having to use another PC

#

And NixOS is weird so I wanna see if its even possible from a “normal” distro

rustic vine
#

install vivado 👍

#

idk what quartus prime is actually

timid quartz
#

I wish but we have to use Quartus Prime for this class

spare quartz
#

i think its just intel vivado

rustic vine
#

oh its intel vivado

#

what class is this

timid quartz
#

Dm

spare quartz
#

this is like the fourth revision of all instructions 💔

#

i dunno how to top this though

spare quartz
#

*org.bread_experts_group.breadmod.client.tool_gun.ToolGunScreen and org.bread_experts_group.breadmod.client.tool_gun.ToolGunScreen$ScreenTabs disagree on InnerClasses attribute *

#

thats a new error..

spare quartz
timid quartz
#

Ok well

#

I basically just wiped NixOS and put Fedora on it instead

#

Kinda gave up on the whole triple boot lol

spare quartz
#

im going to strangle a computer

timid quartz
#

@rustic vine good news, I did not do this to myself in vain

#

Quartus Prime CAN program the FPGA from Fedora

spare quartz
#

hooray

spare quartz
#

RegisterMemoryImmediateOperatingLengthDoubleOperandInstruction...

rustic vine
rustic vine
spare quartz
timid quartz
#

I might try to get Quartus working with usb passthrough

rustic vine
#

suspend? like to sleep/hibernate?

spare quartz
#

this is how that class works

spare quartz
#

god

#

x86 is a big fan of selectors

timid quartz
#

It’s plagued Linux on T2 Macs since Sonoma

spare quartz
#

do they still have the t2 chip (on newer macs)

timid quartz
#

Before M1

spare quartz
#

thats what im wondering

timid quartz
#

Well they don’t make Intel MacBooks anymore

spare quartz
#

the latest mac i've used is from 2016 so

#

what do they use for m1 macs then

timid quartz
#

The M1 has its own stuff idk

spare quartz
#

do they just not have t2 chips

timid quartz
#

I’m not sure

spare quartz
#

oh okay

#

this new instruction format is a lot.. better

#

already back up to 73 opcodes

#

scpsl time

rustic vine
spare quartz
spare quartz
#

3 days for this comment,..

#

comiot*

snow oak
#

@spare quartz

pastel tinsel
spare quartz
rustic vine
spare quartz
#

Okay… but why

rustic vine
spare quartz
#

Ts poisoning

spare quartz
#

This is eerily similar to how a JVM looks

#

Ohhh

#

Cause it’s a WASM implementation

#

good on him for simulating addition/carrying though

#

this is what i do

proud creek
#

Lmao

spare quartz
spare quartz
#

when you accidentally push MS-DOS 6.22 to the BM erpo 😭

spare quartz
#

important instrructino i need to add to mmy os pls ignroe

rustic vine
lavish dove
lavish dove
#

oh its just memcmp

spare quartz
#

yeah

#

repne hooks into the flags it sets to know when to end

lavish dove
#

cool

spare quartz
#

hopefully this lets us actually use BIOS int 0x10

spare quartz
#

IT OWRKS

spare quartz
#

YOOOOOOOOOOOOOOOOOOOO

#

heres it without the speed limiter and with correct keyboard recognization

#

i think its pretty decent

timid quartz
#

Oo cool

#

But…neoforge…..

spare quartz
#

org.bread_experts_group.breadmod.experimental.computer will work virtually anywhere

timid quartz
#

But…..neoforge…..

spare quartz
#

what im saying is

#

you're invited to port it to fabric if you wish

timid quartz
#

But………neoforge…………..

spare quartz
#

this is the only part attached to minecraft rn

#

dirt basic keyboard

timid quartz
#

But…………….neoforge……………………….

spare quartz
#

shut

#

im very happy it got this far with ms-dos though

#

continuing to work with it

lavish dove
lavish dove
spare quartz
#

wdym

lavish dove
#

goddyamn

#

making cpu in minecraft 😭

spare quartz
#

yes 😭 what else could i have possibly beend oing

lavish dove
#

idfk'

spare quartz
#

60% done with the first half..

#

overall the instructions look like they're doing well against QEMU

#

only problem MS-DOS wise is si not being set right due to QEMU having a prepped IVT

lavish dove
#

damn

spare quartz
#

ImmediateSigned8SingleOperandOperatingLengthDependentInstruction

#

these interface names are crazy

wraith scarab
spare quartz
#

holy shit i love being able to seek for memory addresses in this cpu

#

makes undercovering instruction bugs so much easier

wraith scarab
#

wat it would just be full of furry art

wraith scarab
#

bread

rustic vine
full berry
#

do we fw this script so far

rustic vine
full berry
#

i'm relatively new

rustic vine
#

get rid of the warns and prints unless they are for debugging

#

define the function in 1 of the 2 ways

local module = {}

function module.func(args)

end

return module
-- or
local function func(args)

end

return table.freeze({
  func = func
})```
#

everything else actually looks ok

full berry
rustic vine
#

get rid of it

#

simple is good

#

complex bad

full berry
#

alright

#
function module.equip(character: Model)
    local PossibleTool = character:FindFirstChildOfClass("Tool")
    if PossibleTool then
        local config = PossibleTool:FindFirstChildOfClass("Configuration")
        if config then
            local RealTool = PossibleTool
            sounds = { -- i intend on this staying as a global
                core_folder = RealTool:FindFirstChild("Sounds"),
                equip_sfx = RealTool:FindFirstChild("Sounds").Equip,
                reload_sfx = RealTool:FindFirstChild("Sounds").Reload,
            }

            -- debugging goes here now :)

            -- back to the show

            if sounds.equip_sfx then sounds.equip_sfx:Play() end

            print("Gun equipped")
        end
    end
end

like this?

rustic vine
#

lgtm

#

you can make the if config then a guard statement

if config then
  -- code
end
-- can be change into
if not config then
  return
end

-- code```
#

it reduces nesting

#

especially when the code inside is long

#

same with PossibleTool tbh

#

also try to keep consistent casing

#

will come back to help you

full berry
#

alright thanks

#

i will remember this

rustic vine
#

don't use globals

full berry
#

oh ok

rustic vine
#

ye

#

they're bad in quite a few ways

#

I can explain in more detail the motivations for what I've said a little later

spare quartz
#

what if... lua had reflection/introspection...

rustic vine
#

NO!

spare quartz
#

hehehea

full berry
# rustic vine NO!

and one question
where should i store the gun state (ex. is the gun equipped, firing, reloading, etc)

rustic vine
#

a table works

full berry
#

within this module?

rustic vine
#
local gun = {
  equipped = false,
  firing = false,
  reloading = false
}```
#

well

#

depends on how you want to structure your gun

#

you can do oop style if you wanted

full berry
#

ehhh

rustic vine
#

I would obviously advocate for ecs

full berry
#

i'm not that into oop

rustic vine
#

but maybe thats not something you wanna get into (ecs)

rustic vine
#

don't need to bother with any inheritance or anything

rustic vine
#

that stuff is yuck

full berry
#

literally what im trying to do

#

lmfao

spare quartz
rustic vine
#

metatables are kinda yuck too

full berry
#

yeah..

#

i do NOT like metatables

rustic vine
#

WIN

#

ok yea so

#

heres an example of how I setup my "oop" stuff

full berry
#

interesting

#

i'll take a look

#

ok brainwave

#

one sec

#

let me write it down

rustic vine
#

its literally just

local function A()
end

local function B()
end

local function C()
end

return function(args)
  return {
    A = A,
    B = B,
    C = C
  }
end
#

the function I return from the module is the oop "constructor"

full berry
#

what if i make a type called Gun with the properties/available states in there, then i create an object with that type

rustic vine
#

wdym

#

types are just types

full berry
#

like

#

u

#

uh

rustic vine
#

oh yea, at the top of that I declare the type of the "object" yea

#

you don't need to do that unless you want to use the typechecker (I would totally recommend that too)

full berry
#

export type Gun = {
name: string,
ammo: number,
}

#

something like this

rustic vine
#

sure, thats fine

full berry
#

alright

rustic vine
#

methods take a self argument, which isn't anything special, just a convention

#

when you call a function using table:func() it implicitly passes the table you called it with to the first argument

#

so something like circularbuffer:clear() implicitly passes circularbuffer to the clear function

#

you can also always do circularbuffer.clear(circularbuffer)

#

but thats a lot of duplication

#

which is why a:b() exists

spare quartz
rustic vine
#

types don't affect runtime*

#

*they actually do, but you prob don't care

spare quartz
rustic vine
#

optimizations

#

and they can affect varargs and multret behavior (kinda, it can look like they are)

spare quartz
rustic vine
#

no yea ik

#

I was just adding on

#

they don't exist and don't affect it

#

with caveats

spare quartz
#

it better not cause any o0/1 differenecs ... grrr.. .

rustic vine
#

theres no guarantee optimization levels don't affect behavior

#

the whole point of them is to affect behavior

spare quartz
#

yeah but theres an amount of a programs behavior that we expect to remain constant throughout each level

#

and any differences there is evil...

full berry
#
Gun.Handle = PossibleTool.PrimaryPart
            Gun.Name = PossibleTool.Name
            Gun.Ammo = config.Ammo
            Gun.MaxAmmo = config.MaxAmmo
            Gun.IsAutomatic = config.IsAutomatic -- this is 100% not the best way to do it but i'm a bit lazy

do we think this is too, how do i call it, spammy?

#

oh lord the formatting

rustic vine
#
local gun = {
  Handle = PrimaryPart
  -- etc...
}```
full berry
#

thanks

spare quartz
#

oh is Gun the object you're making

#

i thought it was an instance for a sec

rustic vine
#

also the typename

#

fwiw

this is 100% not the best way to do it but i'm a bit lazy
that prob is the best way to do it

#

yes you could maybe do it with a loop

#

but I don't think thats maintainable

#

and not typechecked!

spare quartz
#

only if config gets really big is where i'd say just iterate over config

full berry
#

yeah i was gonna say

#

eventually the config will get bigger

spare quartz
#

you could enforce field semantics with metatables, but only if you really, really care for the safety

full berry
#

meh

#

i dont fw metatables

spare quartz
#

another day another java.util.NoSuchElementException: Key 4 is missing in the map.

full berry
#
local Types = require(Modules.Types)
local Gun: Types.Gun = nil

Gun = {
                Handle = PossibleTool.PrimaryPart,
                Name = PossibleTool.Name,
                Ammo = config.Ammo,
                MaxAmmo = config.MaxAmmo,
                IsAutomatic = config.IsAutomatic,
                Reloading = false
            }

this is just a compiled snippet

rustic vine
#
  1. they're slow
  2. they don't typecheck well
  3. just enforce it with typechecking
spare quartz
rustic vine
#

could've prob done the same with typechecking at compile time

#

not compile, typecheck time?

spare quartz
#

stack/object fields aren't determinable that way by nature

#

since they have to be dynamically read and loaded

rustic vine
full berry
#

true

rustic vine
#

that feels more convenient than having to require a separate file

full berry
#

so in that case, i don't need the export?

rustic vine
#

you prob should?

full berry
#

oh alright

rustic vine
#
export type Gun = {

}

local function shoot()
end

return function()
  return {
    shoot = shoot
  }
end
local gun = require(path.to.gun)

local a_gun: gun.Gun = gun()```
#

lol what

spare quartz
#

nothing im just rambling to myself

rustic vine
#

classic

spare quartz
#

will probably be fine

rustic vine
#

lol I had a bug in my circular buffer impl that I only found yesterday using it

#

it you tried to iter it when it was empty it would iter the full capacity of the buffer and provide N nils

spare quartz
#

thats a strange bug

#

what caused it

rustic vine
#

so its a circular buffer right

spare quartz
#

yeah

rustic vine
#

it tracks head and tail indexes

#

so when its empty

#

head = 1, tail = 1 (indexes start at 1, bruh)

#

when its full,
head = 1, tail = 1

spare quartz
#

ohh

rustic vine
#

yes?

#

ok so, I wasn't checking the size

#

I made a special case for when its full (head = 1, tail = 1)

#

because I can't iterate from 1 to 1

#

the special case was to iterate from head to capacity

#

but I forgot empty is also 1, 1

#

so now I check size == capacity AND 1, 1

#

and now its covered by a test!

spare quartz
#

CAPACITY!!! N!!! CASE!!! TEST!!!

rustic vine
#

true

spare quartz
#

stop writing your progarms to yell at peopel :<

rustic vine
#

lol

full berry
rustic vine
#

I think it looks nice

spare quartz
full berry
#

swapping it between Part and BasePart just gives the same error

spare quartz
#

check if it exists

rustic vine
#

basepart? could not be converted to basepart

full berry
spare quartz
#

or assert it

rustic vine
#

so you have an optional basepart

#

and you expect a non-optional

#

assert that it exists or cast it

full berry
#

yeah bc models don't need a PrimaryPart

rustic vine
#

brah atp like

#

said what I said but faster

#

scammed

spare quartz
#

mwahahaha

rustic vine
#

also u should use rojo and vsc 😈

spare quartz
#

don't listen to this guy he's off his meds

rustic vine
#

I'm mostly promoting vsc and luau-lsp

#

rojo is... just alright

full berry
#

so i should use the assert() function for this?

rustic vine
#

ye

full berry
#

alright

#

and put what inside of it?

spare quartz
#

if you're certain a PrimaryPart should exist on the model

rustic vine
#

assert(model.PrimaryPart, "model must have primary part")

#

something like that

spare quartz
#

assert(condition, reason?)

rustic vine
#

I beat you this time

spare quartz
#

damn

full berry
#

ty yall

#

it went away

spare quartz
#

ughhh i hate floppies

#

can't continue work on ms-dos cause it uses stupid cylinder-head-sector reading

full berry
#

alright, here is the code we made tonight

#

oh wow

#

too long

#

lmfao

spare quartz
#

upload as file

full berry
#

alright

rustic vine
#

oh for the guard statements

#

I don't think you got what I meant