RIP to BT Garner of MindRec.com... BT passed away early 2023 from health problems. He was one of the top PCE homebrew developers and founder of the OG Turbo List, then PCECP.com. Condolences to family and friends.
IMG
IMG
Main Menu

a faster _satb_update routine

Started by touko, 05/07/2015, 03:15 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

touko

Hi guy, i post my optimised _satb_update routine .

As it use self modifying code ,it must be used for CD projects only .
#asm
_satb_update:
; // Use TIA, but BLiT 32 words at a time (64 bytes)
; // Because interrupt must not deferred too much
; // 8 sprites at a time

stw #_satb , .vram_tia_satb + 1    ; // Source

       ; // Set VRAM destination address
st0 #0
st1 #$00
st2 #$7F

       ; // Enable VDC write mode 
st0 #2

ldx #8

  .vram_tia_satb:
tia $0000 , $0002 , $40
addw        #$40 , .vram_tia_satb + 1
dex
bne .vram_tia_satb
 
rts
#endasm

i can post a rom version if someone is interested .

Debvgger_


Debvgger_

I would like to take a peek at the ROM version if you want to post it, too :-)

touko

#3
Quote from: Debvgger_ on 05/07/2015, 05:41 PMI would like to take a peek at the ROM version if you want to post it, too :-)
Ok no problem ;-)

#asm
_satb_update:
; // Use TIA, but BLiT 32 words at a time (64 bytes)
; // Because interrupt must not deferred too much
; // 8 sprites at a time

; // set source,destination and size for executing tia in RAM
stw #_satb , _ram_hdwr_tia_src    ; // Source
stw #$0002 , _ram_hdwr_tia_dest ; // Destination
stw #$40 , _ram_hdwr_tia_size ; // Size

    ; // Set VRAM destination address
st0 #0
st1 #$00
st2 #$7F

    ; // Enable VDC write mode 
st0 #2

ldx #8

  .vram_tia_satb:
jsr _ram_hdwr_tia
addw #$40 , _ram_hdwr_tia_src
dex
bne .vram_tia_satb
 
rts
#endasm

All _ram_hdwr_tia variables are already declared in huc (in library.asm)

elmer

Ahhhhhh .... It always warms my heart to see self-modifying code!  :)

Debvgger_

elmer: Me too; as I always say, damn caches  :lol:

touko

LOL, CPU's cache is the evil  :evil: