Re: Where to find current VRAM layout?
Posted: Sun Mar 24, 2024 7:02 pm
Commander X16 Community Forums
https://cx16forum.com/forum/
Sadly not, its limited in code. Would be fun though, opens up the last 1600 bytes.
Yazwho wrote: ↑Sun Mar 24, 2024 4:33 pmThe cache doesn't work with VERAs registers ($1:F9C0+), only 'normal' VRAM.hstubbs3 wrote: ↑Sun Mar 24, 2024 1:27 pm Using the 32-bit cache??
The issue I hit into was... I staged sprite attributes at $1:F600 ... and then in V-sync interrupt switch on the FX stuff, read starting at $1:F600 into cache... do cache writes starting at $1:FC00 ... and never see the sprites on-screen...
~14/60th of a second to blit a full screen at _what_ resolution and with any sort of loop unrolling or other optimizations??ahenry3068 wrote: ↑Sun Mar 24, 2024 1:03 pmI haven't had a chance to implement it yet but I was planning on caching the sprite image data in Banked Ram and copying from there to VRAM. A jiffie is around 130000 cycles I believe it's very close to 1/60th of a Second. In assembly you can get the "Jiffie" count by calling RDTIM. In BASIC it's available in the system variable TI. The count returns Jiffies since system start. (Any heavy disc I/O and anytime you do SEI/CLI blocks will affect the accuracy of this.) The routines I indicated above are in System ROM and easily called from assembly.hstubbs3 wrote: ↑Sun Mar 24, 2024 12:55 pmahenry3068 wrote: ↑Sun Mar 24, 2024 8:48 am
Just a suggestion: I'm looking at copying Sprites around myself. Take a look at memory_copy ($FEE7)
On the Graphics layer side I have also found GRAPH_draw_image ($FF38)useful (It's basically bit_blt or Put_Image).
The current GRAPH_draw_image is not "BANK Aware" thus when blitting from BRAM you are limited to 8192 bytes (Practical limit a 90x90 or 100 x 81 image). That's still a bigger image than a 64 x 64 Sprite. In the Newest ROM build MooingLemur has extended the routine to be "BANK Aware" So it can blit up to a full Screen 320x240 image. It takes about 14 Jiffies to Blit a Full Screen Image to the Graphics Layer if it is preloaded in Banked RAM. With a 100x75 image I'm blitting >15 fps. https://cx16forum.com/forum/viewtopic.php?t=7191
At the risk of Blatant self promotion. GRAPH_draw_image is used in HANGMAN when showing the Body Parts I'm loading from BitMap. It's also used in the 'FLAWLESS VICTORY" Animation. I don't use any Sprites in HANGMAN at all.I actually don't have a lot of familiarity with BASIC for this system... or Prog8... or even C ... or anything higher-level... than assembler..Like there are proficient developers in the community,
how many clock cycles is a "jiffy" ?
my intention was copying VRAM to VRAM using the 32-bit cache, as what I am copying is sprite graphics that are already in VRAM ...