Scaled text without any lost cartridge/screen data? At last we have it, and to that I say:
Everything you need to start scaling your text is in tab 0 of this cart. If you don't feel like looking at the cart, just copy-paste these fully-commented, fully-optimized routines you see here:
function mcpy(dest,src) --because poke4() is so --relatively fast, it actually --outperforms memcpy(). the --print_big() function abuses --this very much. for i=0,319,4 do poke4(dest+i,peek4(src+i)) end end function print_big(text,x,y,col,factor) --set aside the palette values --of black and "col" for later --somewhere in user ram poke(0x4580,peek(0x5f00+col)) poke2(0x4581,peek2(0x5f00)) --oh yeah, same with camera poke4(0x4583,peek4(0x5f28)) --and fillp poke2(0x4587,peek2(0x5f31)) poke(0x4589,peek(0x5f33)) --set "col" color to "col" --& "col" transparency to off poke(0x5f00+col,col) --if "col" is black, then we --will instead draw black text --on a dark blue background. --so if "col" is black, then --dark blue is transparent and --black is not transparent. --but if "col" is not black, --vice versa. poke2(0x5f00,col==0 and 0x1100 or 0x0110) --copy the first 5 scanlines --of the spritesheet to yet --another place in user ram mcpy(0x4440,0x0) --copy the first 5 scanlines --of the screen to that part --of the spritesheet we just --backed up mcpy(0x0,0x6000) --print the text normally over --the background of the right --color (black or dark blue) camera() fillp(0) rectfill(0,0,127,4,(16-peek(0x5f00))*0x0.1) print(text,0,0,col) --copy the first 5 scanlines --of this text to still --another place in user ram mcpy(0x4300,0x6000) --copy the spritesheet screen --backup back to the screen mcpy(0x6000,0x0) --now the screen is intact. --copy the text to the first 5 --scanlines of the spritesheet mcpy(0x0,0x4300) --display the text at the --desired scale camera(peek2(0x4583),peek2(0x4585)) sspr(0,0,128,5,x,y,128*factor,5*factor) --copy the userram spritesheet --backup back to the sheet mcpy(0x0,0x4440) --restore our backups of the --previous palette values poke(0x5f00+col,peek(0x4580)) poke2(0x5f00,peek2(0x4581)) fillp(peek2(0x4587)+peek(0x4589)*0x.8) end |
[Please log in to post a comment]