-->
[83+ xLIB] Scrolling Past the Screen in xLIB
-->
-->
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
-->
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
TI-BASIC
»
[83+ xLIB] Scrolling Past the Screen in xLIB
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [83+ xLIB] Scrolling Past the Screen in xLIB (Read 5135 times)
0 Members and 1 Guest are viewing this topic.
Demon
Guest
[83+ xLIB] Scrolling Past the Screen in xLIB
«
on:
July 31, 2006, 03:24:00 pm »
What is a very fast way to scroll through a tilemap in xLIB when your cursor hits the edge of the screen?
I - Cursor size.
N - Where to start drawing tilemap - horiz.
O - Where to start drawign tilemap - vert.
L - cursor's horiz. coord (byte).
M - cursor's vert. coord (byte).
c1-->
CODE
ec1...
8:prgmPTMH
Repeat Ans
real(8
End
Ans->K
8:prgmPTMH
prgmPTMK
...c2
ec2
prgmPTMHc1
-->
CODE
ec1real(12,Ans,LB,MB,B-1+LB,B-1+MBc2
ec2
prgmPTMKc1
-->
CODE
ec1If K<5:Then
L+(K=3)-(K=2)->L
M+(K=1)-(K=4)->M
If L<0:Then
1->L
N-1->N
prgmPTMU
End
If L>10:Then
1->L
N+1->N
prgmPTMU
End
If M<0:Then
1->M
O-1->O
prgmPTMU
End
If M<8:Then
8->M
O+1->O
prgmPTMU
End
Endc2
ec2
prgmPTMHc1
-->
CODE
ec1real(2,1,N,O,L,M,0,J6,0,J4,Q,0,16/J
c2
ec2
Logged
Zeromus
Guest
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #1 on:
August 01, 2006, 03:15:00 am »
That may be a possiblity. When I was doing T14 (nonGS) I was going to use 256 sprites (-54125+255) and I just made my sprite editor scroll down when the cursor hit the edge (to the next pic)
Logged
Demon
Guest
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #2 on:
August 01, 2006, 12:14:00 pm »
Well I optimized it a bunch last night. But I think it could be better...
B - Sprite size (8 or 16)
C - Sprite size - max bytes (2 for 8x8, 1 for 16x16)
H and V - Cursor coordinates.
I and J - The dimensions of the tilemap matrix.
L and M - Where to start drawing the tilemap from the matrix.
Q - The initial picture to get sprites from.
prgmPTMH - Deleted; now using PSE's hilite sub:
c1-->
CODE
ec1real(12,Ans,HB,VB,B+HB-1,B+VB-1c2
ec2
prgmPTMH
c1
-->
CODE
ec1If K<5:Then
H+(K=3)-(K=2->H
V+(K=1)-(K=4->V
(H>C6-1)-(H<->Y
If Ans:Then
(C6-1)(Ans=1->H
L+Y
Ans(Ans>=0)-(C6+Ans)I->L
prgmAPTMU:End
(V>C3-1)-(V<->Y
If Ans:Then
(C4-1)(Ans=1->V
M+Y
Ans(Ans>0)-(C4+Ans>J->M
prgmAPTMU:End
End
...c2
ec2
prgmAPTMU
c1
-->
CODE
ec1real(2,1,L,M,I,J,0,C6,0,C4,Q,0,16/Cc2
ec2
Logged
kalan_vod
LV11
Super Veteran (Next: 3000)
Posts: 2715
Rating: +10/-0
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #3 on:
August 01, 2006, 04:44:00 pm »
You could do that, or if you wanted you could input which pic at the start of the program.
Logged
DJ Omnimaga
A Dream of Magic Everywhere
CoT Emeritus
LV15
Omnimagician (Next: --)
Posts: 55943
Rating: +3154/-232
CodeWalrus founder & retired Omnimaga founder
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #4 on:
August 02, 2006, 03:49:00 am »
change
Ans(Ans>=0)-(C6+Ans)I->L
to
Ans(Ans>=0)-I(C6+Ans->L
save one more byte ^^
Logged
threefingeredguy
Guest
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #5 on:
August 02, 2006, 10:07:00 am »
-IC6-IAns+.5(Ans+abs(Ans->L
Not smaller, but it may be faster.
Logged
kalan_vod
LV11
Super Veteran (Next: 3000)
Posts: 2715
Rating: +10/-0
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #6 on:
August 02, 2006, 02:56:00 pm »
QuoteBegin-threefingeredguy+Aug 2 2006, 04:07 PM-->
QUOTE
(threefingeredguy @ Aug 2 2006, 04:07 PM)
-IC6-IAns+.5(Ans+abs(Ans->L
Not smaller, but it may be faster.
Seems like it is over complicating things a bit.
Logged
DJ Omnimaga
A Dream of Magic Everywhere
CoT Emeritus
LV15
Omnimagician (Next: --)
Posts: 55943
Rating: +3154/-232
CodeWalrus founder & retired Omnimaga founder
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #7 on:
August 02, 2006, 02:59:00 pm »
no clue, but i think he want it optimised for speed anyway, make sure he get what it means tho >.>
Logged
kalan_vod
LV11
Super Veteran (Next: 3000)
Posts: 2715
Rating: +10/-0
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #8 on:
August 02, 2006, 03:07:00 pm »
I think TFGs would be slower.
Logged
DJ Omnimaga
A Dream of Magic Everywhere
CoT Emeritus
LV15
Omnimagician (Next: --)
Posts: 55943
Rating: +3154/-232
CodeWalrus founder & retired Omnimaga founder
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #9 on:
August 02, 2006, 03:16:00 pm »
aah I c, I dont know all optiomising tricks >.< *
xlibman
Logged
Dragon__lance
Guest
[83+ xLIB] Scrolling Past the Screen in xLIB
«
Reply #10 on:
August 03, 2006, 05:58:00 am »
yeah,for sure, TFG's is slower,i tested on the calc. /w xlibman's optimisations,it runs at 19 ticks,compared to 22 ticks
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
TI-BASIC
»
[83+ xLIB] Scrolling Past the Screen in xLIB
\n\t\t\t\t\t\t\t\t\t
<' + '/div>\n\t\t\t\t\t\t\t\t\t
%body%<' + '/textarea>
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
Max characters: 20000; characters remaining:
...<' + '/span><' + '/span>
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t<' + '/div>\n\t\t\t\t\t\t\t\t<' + '/div>', sTemplateSubjectEdit: '
', sTemplateBodyNormal: '%body%', sTemplateSubjectNormal: '
%subject%<' + '/a>', sTemplateTopSubject: 'Topic: %subject% (Read 5135 times)', sErrorBorderStyle: '1px solid red' }); aJumpTo[aJumpTo.length] = new JumpTo({ sContainerId: "display_jump_to", sJumpToTemplate: "
Jump to:<" + "/label> %dropdown_list%", iCurBoardId: 70, iCurBoardChildLevel: 1, sCurBoardName: "TI-BASIC", sBoardChildLevelIndicator: "==", sBoardPrefix: "=> ", sCatSeparator: "-----------------------------", sCatPrefix: "", sGoButtonLabel: "go" }); aIconLists[aIconLists.length] = new IconList({ sBackReference: "aIconLists[" + aIconLists.length + "]", sIconIdPrefix: "msg_icon_", sScriptUrl: smf_scripturl, bShowModify: true, iBoardId: 70, iTopicId: 1500, sSessionId: "089d6f7a2343dcfe96bb5e0ab0a64cd8", sSessionVar: "c7f5e28", sLabelIconList: "Message Icon", sBoxBackground: "transparent", sBoxBackgroundHover: "#ffffff", iBoxBorderWidthHover: 1, sBoxBorderColorHover: "#adadad" , sContainerBackground: "#ffffff", sContainerBorder: "1px solid #adadad", sItemBorder: "1px solid #ffffff", sItemBorderHover: "1px dotted gray", sItemBackground: "transparent", sItemBackgroundHover: "#e0e0f0" }); } function tick2() { if (typeof(document.forms.quickModForm) != "undefined") { calcCharLeft2(); setTimeout("tick2()", 1000); } else setTimeout("tick2()", 800); } function message_onkeyup() { if (typeof(document.forms.quickModForm) != "undefined" && typeof(document.forms.quickModForm.message) != "undefined") { document.forms.quickModForm.message.onkeyup = function onkeyup(event) { storeCaret(this); calcCharLeft2(); }; } else setTimeout("message_onkeyup()", 800); } message_onkeyup(); function calcCharLeft2() { var maxLength = 20000; var oldEditor = "", currentEditor = document.forms.quickModForm.message.value; if (!document.getElementById("editorLeft2")) return; if (oldEditor != currentEditor) { oldEditor = currentEditor; if (currentEditor.replace(/\r/, "").length > maxLength) document.forms.quickModForm.message.value = currentEditor.replace(/\r/, "").substring(0, maxLength); currentEditor = document.forms.quickModForm.message.value.replace(/\r/, ""); } setInnerHTML(document.getElementById("editorLeft2"), maxLength - currentEditor.length); } // ]]>-->