This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - thepenguin77
Pages: 1 ... 70 71 [72] 73 74 ... 108
1066
« on: March 08, 2011, 05:36:39 pm »
Nice tutorial. I think I'll move this to the ASM help sub-forum, though, since it's ASM-related. Hopefully it should be helpful for grayscale game programmers. I myself unfortunately didn't mess with grayscale much, as I mostly did TI-BASIC and never went far with Axe. The only grayscale games I made are Reuben Quest series and the RickRoll Tunnels.
Ok, I put it in the Other calculator discussion and news because I thought it might also be useful for Axe. But I don't really know enough about Axe to implement this.
1067
« on: March 07, 2011, 11:58:14 pm »
With my recent work on Chess, people have been asking me how I make my grayscale so perfect. So here is a tutorial! First, a little background, most of it can be read in this topic. A while ago, I made a program that displayed 16 level grayscale pictures. It worked pretty well, but it was clearly not flickerless, it had major scrolling patterns and some spots literally flickered. Then I thought, if I can do 16 with 120 refreshes per frame, why not do 64 level grayscale with 100,000 refreshes per frame. This was accomplished using z-addressing and I put 1 pixels in the first column, 2 in the second, 3 in the third, and so on until the screen was full. Then I scrolled that at 100,000 fps. What I noticed was that at certain frequencies, the images would slow down, stop, then reverse direction and go back into oblivion. After a little bit of playing with it, I figured out that the LCD actually has a refresh rate. And that rate is 60Hz. This little refresh rate is what causes all of the problems with the LCD. Lets say that you quickly change the screen color, if you've used your calculator long enough, you know that there is a diagonal line going up your calculator for a split second while it is clearing. This is caused when you and the LCD driver are updating the screen at the same time. The LCD driver has two parts, and each part works independently of the other. First you have the LCD ram, which is just like regular ram. And then there is the LCD driver which updates the screen 60 times per second, at a speed of about 100 pixels / (1/60 second) from top to bottom. In common practice, the LCD ram is filled one column at a time, starting at the left, and working your way across. This operation takes about 1/120 second. What can happen is that while you are updating the LCD ram, the LCD driver decides that it is going to start displaying the screen. It displays 1 row at a time, and as it falls down the rows, it displays whatever is currently in ram. So you can see that if you are updating the screen while it is reading it, there will be some spots where you as the writer will cross over what the driver is displaying, effectively making the driver display part of two different frames. For your average game, this is no problem, a minor graphical glitch that is only present for about 1/60 second and that only happens about 1 time per second. But grayscale is an entirely different case. This graphical glitch is very obvious because it screws up your careful pixel timing. Instead of ON ON OFF ON ON OFF, sometimes you will have ON OFF ON ON OFF ON, which spread over the whole screen, just looks bad. Also, let's say that you don't know about this whole refresh thing and you update the screen at either 80 fps or 40 fps. At 80 fps, some of your frames are never going to even make it to the LCD, you are updating it so fast that you will update it again before the driver has time to display it. And at 40 fps, some of your frames are displayed twice. After hearing that, I'm sure there are a few of you that could go out and write your own display routines, but there are also those who can't. Here is an example of what we don't want. You can see that the LCD driver and the displayer are not in sync and scan lines are clearly present. (Technically since that is in wabbitemu, I had to do something entirely different to get that effect, but you get the drift.) Now, to get away from this, you have to learn the way of the LCD driver, and try to basically run away from its display line. First off, it displays rows, not columns. So we will obviously have to write a 07 to port (10h), and work horizontally across the screen. This does have some speed drawbacks, but that's just how grayscale goes. Now that that is out of the way, you will notice that your grayscale routine actually looks a lot better, but we're not done yet. The next step is to get in sync with the driver, which is accomplished with the crystal timers. Our goal is around 60 Hz, so the timer that gives us the most flexibility around this range is timer 40h, it runs at 10922.667 Hz. Then you have to apply your multiplier to it 10922/60 = 182, so a counter of 182 will get you 60 Hz. I of course prefer 178 as that is what my calculator is synced to, but to each his own. (The typical range is about 160-180). To put this into code. 40h to (30h), 0 or 2 to (31h), and 178 to (32h). That's it, do that and you will have perfect grayscale. And why did I mention 100 pixels / (1/60 seconds)? That's because you can't perfectly match the frequency of the driver and there will always be a small glitch line. But if you do it right, the line is off screen for 1/3 of the time. Here's an example of implementing what I just talked about. It's commented quite nicely, but I left it up to you to make your own calibration screen (I don't want all the games to look the same )
1068
« on: March 07, 2011, 10:42:09 pm »
I just tried this on my 83+SE and this is the best grayscale I ever seen on this calc.
However, I noticed two problems:
-We cannot cancel a move. If you select a piece, it's over, you can't cancel to select another instead, you're forced to choose a new location where to move it, and if it happens to be blocked, then you're stuck there.
-Quick save brings a blank screen and I have to pull a battery.
That's odd. I can't make either of these bugs happen in DCS or MOS, on an 84+ or an 83+SE. I don't see how CLEAR could possibly fail without other things going terribly wrong, unless I forgot to uncheck some flag again. And for quick save, I blank the screen on purpose because flash writing disables interrupts, and not blanking it would result in ugly scan lines. A blank screen means that it failed in bcall(_arc_unarc). Is your archive excessively full? I didn't add in error handlers around the bcall, (which I will), so that could possibly be the problem. Edit: By the way, once this program is loaded, it doesn't rely on the shell at all, and only relies on Ti-OS for making saved games.
1069
« on: March 07, 2011, 09:42:01 pm »
@Thepenguin77 You are the master of grayscale!
Actually, the grayscale in this one isn't perfect. It's pretty close, but I didn't do it right.
1070
« on: March 07, 2011, 06:01:10 pm »
That flag probably has something to do with USB by where it is located. And it will definitely not void your Nspire warranty.
But since you have Calcsys on your calculator... -BSOD: Send 1F to port (10). Don't do it for more than like 10 seconds. You can kill it with a value of 18, but most likely you'll want to pull a battery. -Game: on the console, type GREENLIGHTGO -Timer: if you have 83+SE or 84+any, 47 to port (30), 1 to port (31), and then any number to port (32) -Flip screen: if you are really lucky, 14-17 to port (10) will flip your screen around -Fast mode: 1-3 to port (20) will make calcsys go really fast on the above calculators -Ultra slow: send 03 to port (00) (debatably frozen) Edit: -Scrolled screen: 40-7F to port (10) -Bad lcd: 0C to port (29), go play mario
1071
« on: March 07, 2011, 05:11:19 pm »
When I first read that, I was like, "Wow, someone really named their program the exact same name as mine." But I never expected to get a news an entire year later. Thanks.
1072
« on: March 06, 2011, 08:43:37 pm »
Wow, I just sent this to my real calculator and the title screen looks like complete crap. It brings out all of the flaws in your LCD. So I will definitely be fixing that.
1073
« on: March 05, 2011, 10:48:39 pm »
Nice. You should write it with 8810 bytes of code. Also, did you fix the icon thing? It seems like it, but I don't have a real calc to test it with atm. Also, could you make it so that the cursor returns to your last moved piece?
The icon thing is fixed. It's because I didn't nop a byte on the extra ram page, and then later assumed it was either 0 or 1. And I just updated the file with the cursor going to the last piece you moved. I had to try to be quick before people downloaded it though because it causes save game incompatabilites.
1074
« on: March 05, 2011, 10:14:25 pm »
Update!! Yay!! Things in this update: -Menu system in place -Drop down menu in game -Saving games via quick save (save as... still in the works) -Ending game to menu and quitting game to shell -Loading games via Load (can handle up to 96 saved files) -Options menu with 2P view option and calibrating grayscale -Mirage picture The menu system is graphically lacking at the moment. So I'm hoping to find or make some cool looking 4-level gray chess pieces to put on the left and right side. And since I'm just a coding tank , there is a very real possibility that this program is going to end up crossing the 8811 boundary seeing as it is about 95% code and it is at 6430 bytes right now. It's also 4437 lines in notepad. I don't really care if I cross the boundary because since this is running on calculators with the extra flash page, there are all kinds of tricks I can pull. But mostly, I think it's just cool to have written 8811 bytes of code. Edit: Redid file for graphmastur.
1075
« on: March 03, 2011, 11:02:06 pm »
Ah, do you know why the set and res are there ?
I do. Those allow getKey to return with On also. They occur around the bcall(_getKey) that waits for a key after does the ram cleared screen.
1076
« on: March 03, 2011, 09:09:18 pm »
I run it in DCS. Also, the DCS icon is blank. Plus, there should be an option to reset grayscale settings, as I want to change them. Just corrupt a byte in the serial id, and restart the program should work.
DCS icon is blank because I was too lazy to make one, (you have to remember the header is the first thing you make), but I'll make one. The option to reset grayscale will be here as soon as I get the options menu running. It seems that whenever the AI gets checked, it always considers moving the king first before anything else, which is bad. I've checkmated it using just pawns that could have been taken by other pieces. I'm sure that will fix itself with more AI updates. I'm not going to quote anything, but the weird cursor was caused by me not nopping a byte on startup that was on the extra ram page, which is why ram clears didn't fix it. (Or flash formats lol) Here's what I've added so far: -AI checks to see if space it's moving to is protected -AI has potential to check a lot of moves, (I made a chess board stack) -Awesome drop down menu! -Fixed cursor glitch -Fixed weird king castling I have a 7 hour car ride on saturday, so I'll probably release a copy after that, or maybe tomorrow.
1077
« on: March 01, 2011, 11:02:53 pm »
stupid AI noob!!! it keeps cheating! Castling does NOT work that way!!! I found a way to beat it anyways. I put it in checkmate and had my queen on same horizontal line so even if it "castled" it wouldn't be safe. when i took out all of my opponents pieces including the king, the game didn't end.
I know he fixed the fake castling, but what happens when you win? I beat him and took every single piece but nothing happened...
I know, I did that on purpose. I figured that for now, it would be better if you could continue playing on the off chance that the game glitches and pulls a false checkmate. Plus, as soon as you get checkmate, you can just quit. Hey, for some reason the cursor was messing up pretty badly. It was some random garbled thing.
OS 2.53 MP. (for integral function, and that's it)
This happens on my friends calculator also. He has 2.43. He said that a lot of other stuff was going horribly wrong too aside from the cursor. Tomorrow, I'm going to completely clear the calculator and see if that fixes it. If not, it must be related to hardware somehow. (Running the program from the homescreen didn't fix it either, so it's not specifically Mirage's fault. And it only uses 1 bcall the entire time, so it shouldn't be OS related either.) Even weirder, the cursor graphic is not the very last thing in the program. All of the text comes after it. And the displaying routine isn't anything out of the ordinary.
1078
« on: March 01, 2011, 06:08:35 pm »
I know many of your previous games used undocumented instructions and didn't run on the normal TI-83+. Is this one compatible with the normal TI-83+?
It's currently not compatible. The reason for the previous ones is not undocumented instructions, that only restricts use on Nspire, it's because of fastmode and crystal timers. Here are the current incompatablilites. -Crystal timers /Nspire /83+BE (perfect grayscale and frame limiting) -Fast mode /83+BE (perfect grayscale and fast thinking, in slow mode it would crawl even just moving the cursor) -Extra ram page /83+BE (grayscale, not 100% necessary at the moment, but requires hacking otherwise) It's vaguely possible I could make this work on an 83+BE, but it would be ugly (figuratively and literally) I finally got this on my calc, and here are my thoughts: -The grayscale is flawless. This is the most impressive to me. Other games that claim to have flickerless grayscale should be ashamed. The grayscale in this is freaking amazing. It makes it look like the screen is built for grayscale. -The AI is good, but it would be nice if I lost occasionally. -The AI is stubborn as hell. I've had three queens on the board against his king, and it has squirmed all over the board before I managed to capture him. -Pass-the-calculator works fine, but link play would be nice.
Overall, I'm extremely impressed.
Thanks, I have researched the LCD driver to make grayscale as perfect as possible, especially if you adjust your frequency right. (There's a topic around here somewhere.) And a better AI is in the works. Is it just me, or does it seem the opponent's king moves more than one space at a time sometimes?
I just fixed that. It was because the CPU didn't tell the piece putting routine what piece it was putting, it just did it manually. Which meant the flags for the rooks moving never got set. The king was actually castling out there.
1079
« on: March 01, 2011, 04:58:27 pm »
Oh, I see. If you want to get hold of the arguments preparsed, then you need to use the mode 0, and go parse them yourself. Using those three variables mentioned on the wikiTi page, you can find the information in ram, do what you want with it, and then let the parser go. What I did for some of my parser hooks was to completely relocate the tokens somewhere else. But I think since I didn't put the pointers back to their proper locations, I broke all basic programs.
1080
« on: March 01, 2011, 04:40:36 pm »
Yep, that shouldn't be too hard. WikiTi will obviously help if you haven't checked it. What I would do is make a null parser hook (i.e. just returns with proper flags), and then breakpoint it in wabbitemu. Then make a basic program that looks like this, dim(L1:dim(L1:5->dim(L1:5->dim(L1. Run the basic program and figure out how the parser handles dim(. It is either going to be a type 1, 2, or 3 type command, or a combo of 2 and 3. After you have the type, figure out what value of BC it passes to the hook. From here you can write your real parser hook which pops the list off the floating point stack and does it's thing.
Pages: 1 ... 70 71 [72] 73 74 ... 108
|