- Joined: 28 Jan 2017
- Posts: 556
- Location: Málaga, Spain
|
Updating some tile rows
Posted: Tue Jun 20, 2017 9:37 pm
|
Ummmm.... need update 8 tiles per frame.
But the fact is i only have to update rows 1 and 4 for each tile. Searching an appropiate function i see the minimum unsafe copy function is for a 32 block while i need to update 4 bytes for a row.
Also i see the code for the unsafe copy function calling an outi32 function.
Is there an outi4 function? Is it possible to do this without have to do 8 memcopy32 or 4 memcpy128?
Thanks!
|
- Joined: 05 Sep 2013
- Posts: 3828
- Location: Stockholm, Sweden
|
Posted: Wed Jun 21, 2017 7:56 am
|
you need to update 4 contiguous bytes in VRAM? I would use SMS_VRAMmemcpy_brief() - it is safe and probably fast enough.
if you really need it faster, you can create your unsafe function - you need to modify crt0_sms.s so that it accomodates the new label (OUTI4) too and add this:
void OUTI4(void *src) __z88dk_fastcall;
void UNSAFE_SMS_VRAMmemcpy4 (unsigned int dst, void *src) {
SMS_setAddr(0x4000|dst);
SETVDPDATAPORT;
OUTI4(src);
}
to SMSlib_UNSAFE.c and recompile the library.
Let me know if you need further help :)
|