Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Updating some tile rows

Reply to topic
Author Message
  • Joined: 28 Jan 2017
  • Posts: 556
  • Location: Málaga, Spain
Reply with quote
Updating some tile rows
Post 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!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3794
  • Location: Stockholm, Sweden
Reply with quote
Post 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 :)
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!