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
»
ASM
»
ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus) (Read 6571 times)
0 Members and 1 Guest are viewing this topic.
Jerros
LV4
Regular (Next: 200)
Posts: 137
Rating: +9/-0
ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
on:
May 02, 2010, 05:00:20 am »
Title says it all...
I'm making a game in ASM, but I'm really new to programming, and I can't make a proper working piece of scipt that scrolls sprites down the screen.
I'm making a guitar-hero like game, where "O" start at the top of the screen, scroll down at a certain speed, and when the "O" matches an "O" in the bottom of the screen, you must press a certain button.
Requirements are:
- It must be possible to drop down some "O" sprites in a specific order, not just randomly. So I can determine the time between each "O" falling down.
- While the "O" is dropping, the Calc must still respond to a keypress, and execute a script when a button is pressed (to see if you pressed the right button at the right time, and increase/decrease score accordingly).
I hope I've been clear about what i'm trying to do.
If anyone could help me out by giving tips, or making a small script that performs a piece of what I want, it'd be a great help!
Thanks in advance!
Logged
79% of all statistics are made up randomly.
mapar007
LV7
Elite (Next: 700)
Posts: 550
Rating: +28/-5
The Great Mata Mata
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #1 on:
May 02, 2010, 10:02:32 am »
Use the regular putspritexor routine (from the asmin28 tutorial) for the displaying of the O, and increment the y-coordinate of the sprite every time you want it to move down.
(sorry, no time for thinking up examples)
«
Last Edit: May 02, 2010, 10:04:03 am by mapar007
»
Logged
+1/-1 karm for this message
Jerros
LV4
Regular (Next: 200)
Posts: 137
Rating: +9/-0
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #2 on:
May 03, 2010, 05:07:02 am »
Uhu, but you don't have controle while the "redraw-sprite" routine is going on.
So I'd have to increment the y-coordinate, then check for a button, then inc. Y again ect?
The redraw routine would take very long when there are lots of sprites to redraw, and the keypress of the user wouldn't be registerd on the exact time I put a "check keypress" routine between the redraw routines...
And whats the Key command to check if a button is held down, not just pressed?
The whole "perform scripts while a button is pressed down and do something else if not" concept is unfamiliar to me...
More specifically, how to handle multiple sprites???
Also, there's still the problem of how I manage multiple sprites that way...
I want it to be possible to scroll down a number of sprites in a specific order with a varying time interval between them that I can set.
I hope I'm clear (probably not...) and I appreciate your help.
Thank you for your reply!
«
Last Edit: May 03, 2010, 11:32:10 am by Jerros
»
Logged
79% of all statistics are made up randomly.
mapar007
LV7
Elite (Next: 700)
Posts: 550
Rating: +28/-5
The Great Mata Mata
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #3 on:
May 03, 2010, 02:39:03 pm »
Very long? nononono, it's just a few microseconds (or milliseconds for that matter). You don't notice, normally.
Logged
Quigibo
The Executioner
CoT Emeritus
LV11
Super Veteran (Next: 3000)
Posts: 2031
Rating: +1075/-24
I wish real life had a "Save" and "Load" button...
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #4 on:
May 03, 2010, 02:56:18 pm »
Jerros, I don't think you have a clear understanding of how that assembly routine works. First of all, drawing an 8x8 sprite fully clipped onto the buffer literally takes less than a millisecond. You don't actually have to refresh the screen until you have finished drawing all the sprites. Your layout should be something like this:
Loop:
<Draw Sprites>
<Refresh Screen>
<Pause For Timing>
<Handle Key Presses>
<Sprite Movement>
jp Loop
It sounds like you're pretty new to assembly. You might want to start a little slower becasue you're trying to do some complicated things that are going to be very confusing without a lot of experience.
Logged
+3/-0 karm for this message
___Axe_Parser___
Today the calculator, tomorrow the world!
Galandros
LV9
Veteran (Next: 1337)
Posts: 1140
Rating: +42/-10
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #5 on:
May 03, 2010, 03:49:41 pm »
Generally in assembly games the screen buffer is totally cleared, redrawn and copied to LCD each frame.
I agree with Quigibo, that you should review your knowledge of assembly. I suggest to review tutorials (trying one different help) and stop by the IRC channel for a quick question and answer (you have calcmaniac and tr1pe1a, from memory) and forum for more important questions. And do simple experiments with assembly, for example doing a menu routine or other that you think you can do.
Debugging can be frustrating but you learn to avoid a lot of errors.
I needed lots of hours of practise before starting to be a little productive. You are prepared when you can do progress without many errors.
Logged
+2/-0 karm for this message
Hobbing in calculator projects.
Jerros
LV4
Regular (Next: 200)
Posts: 137
Rating: +9/-0
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #6 on:
May 04, 2010, 02:56:23 am »
First of all, thank you for your kind reply.
It's true that I'm quite new to assembly, but I've managed to do quite much in only about 2 months.
As for the routine suggested byQuigibo, I'll try that out, thanks.
I'm very imatience, so I indeed might be rushing into things I dont have a clear understanding of, but I'm a fast learner n_n.
Just one more thing though, you were talking about a "pause for timing" part, but I guess that's just made of some time-consuming commands that don't actually do something, right? (like some NOP's os something... I'll look into that later).
Thank's a lot, I'll see how far I come now!
Logged
79% of all statistics are made up randomly.
DJ Omnimaga
Clacualters are teh gr33t
CoT Emeritus
LV15
Omnimagician (Next: --)
Posts: 55943
Rating: +3154/-232
CodeWalrus founder & retired Omnimaga founder
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #7 on:
May 04, 2010, 03:01:00 am »
I do not know assembly but welcome to Omnimaga and the whole world of calculator programming
And good luck in your learning (and future projects)
Logged
+1/-0 karm for this message
Quigibo
The Executioner
CoT Emeritus
LV11
Super Veteran (Next: 3000)
Posts: 2031
Rating: +1075/-24
I wish real life had a "Save" and "Load" button...
Re: ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
«
Reply #8 on:
May 04, 2010, 03:14:02 am »
Never use NOP. You might as well try to make the timing code as small as possible. If you need medium pauses, use a bunch of HALTs. For precise and very fast pauses, use a few DJNZ $+0 or something like that. Don't worry about this now, focus on the main code first and run some tests, then add in some pause time if the game runs too fast.
I was just like you when I started out. I dove right in and then ran into a bunch of weird problems I could never figure out until I finally learned the inner-workings. For instance, I remember when the same stack being used for both pushing/popping AND for calls really threw me off when I was trying to pass arguments using push and pop.
If you want some useful routines, check out the Axe Parser commands source code. It has all the stuff you were asking about like detecting keys directly, drawing sprites, screen scrolling, and even sound/music out of the linkport (since this is a guitar hero clone). You might even consider using Axe if your goal is just trying to make the game, its a lot easier than assembly, and just as fast. But if the goal is to learn assembly, then try the "Learn Z80 In 28 Days" tutorial, that helped me the most.
Logged
+2/-0 karm for this message
___Axe_Parser___
Today the calculator, tomorrow the world!
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
ASM
»
ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)