READ THE F.A.C.

in #tyrnannoght12 days ago (edited)

federation against claude


just to remind that guy making that face overthere


we dont get to the roots of the 1st love much anymore as theres simply no time left in a chronically fatigued chronic pain day with no options and two slowly disintegrating people in the house who are at an age where you would actually excpect it


always wondered why the FAST was , but now we dug it up, the night was quiet and the mind had some air

The sample from codebase here : https://codebase64.net/doku.php?id=base:introduction_to_raster_irqs

the working code to test : (ACME syntax)

;compile to this filename:

!to "main.prg",cbm

;this creates a basic start
*=$801 ;SYS 2064
!byte $0C,$8,$0A,$00,$9E,$20,$32,$30,$36,$34,$00,$00,$00,$00,$00

this tells the compiler what platform (processor) to compile for, in this case the c64 mos chip, it also tells what filename to output , in this case "main.prg", it tells the compiler where the program is to start in memory (in this case $0801 which is for the c64 the start of the basic "free" zone where your basic programs would live if you wrote one when you turn the computer on using the c64 os) and then the !byte command adds some raw bytes which , when loading the program into memory will show it as a basic program with one line that say "SYS 2064", assuming the first bytes stand for the line number
-
lda $d012

cmp #$00

bne -


im not sure if this is needed on all post-modern hardware or emulators, probably not if you use the inject feature in vice (autostart) but this bit more or less ensures the machine will be in the exact same state before the actual main program executes, so the timing will always start on the same point ... or at least it should, what it does in hw terms is wait for rasterline zero to be reached before continuing. the " - " is a label that will tell the compiler to branch back to that place in memory (set the programcounter ....) which in a monitor will show as "x bytes" not an address if im not mistaken, branches can therefor be no more than a page or half a page ... tho im not sure anymore if you can or cannot use absolute addresses i dont think so (last ones were made with TRSE for ease, its been a while , since lonelyraster and the middlersted game has been sitting on a disk for more than 6 months - that one is a mix of TRSE and acme)

sei ;disable maskable IRQs
lda #$7f
sta $dc0d  ;disable timer interrupts which can be generated by the two CIA chips
sta $dd0d  ;the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
           ;stop it.

lda $dc0d  ;by reading this two registers we negate any pending CIA irqs.
lda $dd0d  ;if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
           ;we don't want that to happen.

lda #$01   ;this is how to tell the VICII to generate a raster interrupt
sta $d01a

lda #$50   ;this is how to tell at which rasterline we want the irq to be triggered
sta $d012

lda #$1b   ;as there are more than 256 rasterlines, the topmost bit of $d011 serves as
sta $d011  ;the 9th bit for the rasterline we want our irq to be triggered.
           ;here we simply set up a character screen, leaving the topmost bit 0.

lda #$35   ;we turn off the BASIC and KERNAL rom here
sta $01    ;the cpu now sees RAM everywhere except at $d000-$e000, where still the registers of
           ;SID/VICII/etc are visible

lda #<irq  ;this is how we set up
sta $fffe  ;the address of our interrupt code
lda #>irq
sta $ffff

cli        ;enable maskable interrupts again

;jmp *      ;we better don't RTS, the ROMS are now switched off, there's no way back to the system

this sets up the machine to disable basic, and free all available ram (some areas are taken by the basic interpreter for instance, this marks them useable for user code , mind that this is a 1980s machine, 8bit bus and cpu with 64kb of memory, of which the GPU (!) the vic chip can only "see" 16 kb at once. It sets off at line $50 (hexadecimal) which shouldnt make much of a difference .. shouldnt , do correct us if we're wrong, right :p

loop

inc $D021

jmp loop

this is some code that keeps the program busy while the interrupts are triggering, each interrupt will trigger at an exact 1/50th of a second which is why its possible to make fx more stable than modern frametime which is variable from machine to machine and even on the same machine it varies, most fps is average time when displayed, a c64 has 50fps (on pal machines) with or without RTX enabled indeed, this is not needed except for the loop to make sure the program counter doesnt advance into the unknown , the void or the code that comes after it which is used for the execution of chunks when an interrupt condition is met, in this case the interrupt condition is set to the arrival at a rasterline (scanline on older televisions and monitors the tv went top down by lines

irq

;Being all kernal irq handlers switched off we have to do more work by ourselves.
;When an interrupt happens the CPU will stop what its doing, store the status and return address
;into the stack, and then jump to the interrupt routine. It will not store other registers, and if
;we destroy the value of A/X/Y in the interrupt routine, then when returning from the interrupt to
;what the CPU was doing will lead to unpredictable results (most probably a crash). So we better
;store those registers, and restore their original value before reentering the code the CPU was
;interrupted running.

;If you won't change the value of a register you are safe to not to store / restore its value.
;However, it's easy to screw up code like that with later modifying it to use another register too
;and forgetting about storing its state.

;The method shown here to store the registers is the most orthodox and most failsafe.

pha        ;store register A in stack
txa                                  
pha        ;store register X in stack
tya
pha        ;store register Y in stack


lda #$ff   ;this is the orthodox and safe way of clearing the interrupt condition of the VICII.
sta $d019  ;if you don't do this the interrupt condition will be present all the time and you end
           ;up having the CPU running the interrupt code all the time, as when it exists the
           ;interrupt, the interrupt request from the VICII will be there again regardless of the
           ;rasterline counter.

           ;it's pretty safe to use inc $d019 (or any other rmw instruction) for brevity, they
           ;will only fail on hardware like c65 or supercpu. c64dtv is ok with this though.

    lda #$7      ;these two lines make the bordercolor yellow
sta $d020

lda #$0      ;these  lines change the irq condition to trigger on a different scanline
sta $d012
lda #<irq2
sta $fffe
lda #>irq2
sta $ffff
pla
tay        ;restore register Y from stack (remember stack is FIFO: First In First Out)
pla
tax        ;restore register X from stack
pla        ;restore register A from stack

rti        ;Return From Interrupt, this will load into the Program Counter register the address
           ;where the CPU was when the interrupt condition arised which will make the CPU continue
           ;the code it was interrupted at also restores the status register of the CPU


this is the chunk that gets called when the interrupt chain is initiallized, the label "irq1" gets recognized by the compiler because its leftmost in the textfile (you can just use notepad or whatever tickles your fancy)
theres plenty of explanation from codebase, this is exactly as stated, except that we added two lines to change the bordercolor and a bit to trigger the next interrupt after this one gets closed

irq2
;pha        ;store register A in stack   ;3 cycles
;txa                                                              ;2 cycles
;pha        ;store register X in stack
;tya
;pha        ;store register Y in stack

sta atemp+1                            ;Absolute : 4 cycles
stx xtemp+1
sty ytemp+1

;lda #$ff                               ;Immediate 2 cycles
;sta $d019                              ;Absolute : 4 cycles

lsr $d019                               ;6 cycles

lda #$8
sta $d020

lda #$70
sta $d012
lda #<irq
sta $fffe
lda #>irq
sta $ffff

;pla                                    ;4 cycles
;tay                                     ;2 cycles
;pla                                    ;4 cycles
;tax                                     ;2 cycles
;pla                                    ;4 cycles

atemp lda #$00 ;Immediate 2 cycles

xtemp ldx #$00 ;Immediate 2 cycles

ytemp ldy #$00 ;Immediate 2 cycles

rti        ;Return From Interrupt, this will load into the Program Counter register the address
           ;where the CPU was when the interrupt condition arised which will make the CPU continue
           ;the code it was interrupted at also restores the status register of the CPU


and this is what we were actually checking : the cycle profit of that fast method as described on codebase (it would be because that thing has been peer reviewed for decades by now

we get the cycle cost of instructions from here :

https://c64os.com/post/6502instructions

the "standard version uses 15 + 16 cycles (cycles are a measure of how much time it takes for something to process .. in short for people who dont do this stuff or programming at all)

the "fast" method uses 12 for storing and 6 for loading so thats 18 which is < 31, almost twice as fast , the lsr method uses the same cycletime but less space as its only 3 bytes in memory while the standard method uses 5 (something you DO wanna count if you only have 64kb)

so now we know what the deal is with these elite narcists and their fort knox is my code attitude

the added beauty is that atemp (the label) +1 holds the value so it gets stored one byte after the opcode that loads it back

why you want to do this is because interrupts get triggered always so whatever is going on in the main loop (the $D021 thing in this case) will be altered every time any interrupt triggers that uses either of the A, X or Y registers

five minutes, GTG, someones calling

okay i think it was almost finished

so its self-modifying code (something THE a.i. has only recently started if we heard that right) which alters the byte that gets loaded back by storing the value it needs to preserve, VERY space and time-efficient ....

thats 40 years of peer-reviewed narcists for ya :p

they DO have their uses (huh huh)

the code works but it doesnt do much except split the border into two colors and make some epilleptic fit in the main screen

its here : https://pastebin.com/0ahHz4gs

if you have a linux partition you can just "sudo apt install acme" for the compiler

(it can do more than one platform i think- its actually a pretty powerful thing with the macros and subsystems and what not, i think kick is more popular, probably because of less options or something, because acme will have lots you dont need for hobby projects)

and then in a terminal type "acme "yournameoftextfile" and it will output main.prg which you can run on a c64 via an sd drive, fujinet meatloaf, kungfu cart or whatever or you can run it in vice and it will work


as we were saying to remind you that

even if no one here's a pro, designer, dev or even simply leet, we are still slightly above average non-idiots who can read, just because we're not interested in being on the scene or speak like amy at the cooler doesnt mean we cant hack a tree without a chainsaw

and if you talk all that jaz

do a jag game in jagstudio

ITS ONLY BASIC :p

... i could have done something but sometimes these things itch and frankly my dear in a chain of 10 or more interrupts this is A LOT of cycle profit ...

( = execution speed / performance )

not really useful for the game as its TBS and nothing is time critical but it looks better too and takes up less space ?

might as well use it

cp_20220316_zeromath.png

we're just damaged lunatics who were powercartridging before most current demogroups started and the machine probably broke down before the scene really kicked off and most of all

in salems lot computers is niet weirken and it gets you nowhere so you should find something real to do

i dont think we'll be doing a course in 65xx hello world assembler but for a small billion in crypto by tomorrow who knows

BEM ?

dont be fooled by appearances .. that 2 meter wide guy isnt necessarily an albanian bouncer, dude

janes ondergrond

is not just a doompatrol metafor and

because we like using AGK for lightweight afternoon tea coding

doesnt mean we cant do zits

thx

NO WE GOT NOTHING TO PROVE, just got curious as to the why is this faster since i didnt see much difference in bytevolume

corrections by people who know are appreciated

"your ldx should be one tab to the right" will be discarded

you used the wrong buzzword and said 'program' will be shot at

we are old people after all ... not as old as woz

but old enough (not as smart as woz either lol)

o dear, looks like the steemit markup clashes with the inline code syntax .... yea well, if the post reaches $4000 like when steemit was $7 a piece we'll clean it up

always with the money ...

well you try having none and see how that works out for yall , no one has answered any of the million belg problems like why in 300 years is there not one bel gates ? why do belgian billionnaires end up in jail (rossem and hauspie) if once every generation one is born and

name me 5 ... okay 3 .... okay ONE belgian company thats known worldwide RIGHT NOW you got five seconds and

... i think you get the point

NO IT WASNT US, IT REALLY IS

het gatste gat in gatland

its not bitter, dearie, its HATE

but indiscriminate geolocational hate

im overtime to cycle gtg

o yea, this might be why folk dont like denuvo, like cancer it injects itself into every cell of your program and there eats 31 cycles instead of 18

and on top of that i think it relies on an online connection to serve hashes

...

no comment

the only question we have to that is why one of the three greats who has done denuvo in hasnt setup an LLM to undo it, i mean, by now everyone but amy knows theres no I to A but its great at that kind of thing

it could fish out your denuvo out of any game after xthousand runs

i bet it could, and replace it with dummy code that gives the "signal received and clear" back

probably would speed up the game after being cracked like that lol

YOUD HAVE FANS ALL OVER THE WORLD !!!

and probably a job offer from the CIA they wouldnt let you refuse shortly after

Coin Marketplace

STEEM 0.06
TRX 0.30
JST 0.055
BTC 74180.35
ETH 2343.17
USDT 1.00
SBD 0.52