Show Posts

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 - pimathbrainiac

Pages: 1 ... 81 82 [83] 84 85 ... 125
1231
Dangit. I had the theory down, but I didn't know what you just said. Thanks for pointing out my flaws.

1232
Computer Programming / Re: Creating .8xp programs (Axe) in Java
« on: March 26, 2013, 02:47:17 pm »
tokenizer? I don't know what that is...

1233
Computer Programming / Creating .8xp programs (Axe) in Java
« on: March 26, 2013, 12:36:44 pm »
Does anybody know how to do this?

I am trying to make a program that will convert some stuffs to an Axe program, but I don't know how to create .8xp programs in Java.

1234
You know that they'll be run at random, right ?

What do you mean? They'll run the amount of times per second that they should be called.

1235
In the tradition of ThePenguin77 and Hayleia, I am making my grayscale EPIC!!!

So... Wabbit does not like my code :P, but it works on my calc, so hopefully it will work on yours!

Attached is the source (84+), to make it 83+, calculate the values necessary as shown in the tutorial. Speaking of which, here is my explaination/tutorial!:

First: let's start with the interrupt speeds:

Speed // 83+ // 84+
0 // 560 Hz // 512 Hz
2 // 248 Hz // 228 Hz
4 // 170 Hz // 146 Hz
6 // 118 Hz // 108 Hz

With multiple interrupts running at multiple speeds, you can have more data points than just one interrupt!

The problem: how do you make the data points sync up?

Here's how (set up for a basic RPG engine with only one 12*8 tilemap) (please excuse the direct cut-and-paste from graph link):

Code: [Select]
.CC

51.000üE
0.000üF
108.000üJ
0.000üT
0üX
0üY
0üA
0üB

J/*EüF
0.211üK
0.474üI
0.740üL


FnOff

ClrDrawõõ

[010101010101010101010101]üGDB1
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]

[0000000000000000]üPic1
[FFFFFFFFFFFFFFFF]

For(Z,0,11)
For(Á,0,7)
Pt-On((Z*8),(Á*8),(8*{(Á*12)+Z+GDB1})+Pic1)õ
End
End

fnInt(DG,0)
fnInt(DH,6)
fnInt(DI,4)
fnInt(DJ,2)
Pause 200
While 1
If (getKey(54))
E-0.100üE
If (E÷49.000)
65.000üE
End
J/*EüF
0.000üT
Pause 200
End
If (getKey(55))
E+0.100üE
If (Eù66.000)
50.000üE
End
J/*EüF
0.000üT
Pause 200
End
getKey(3)-getKey(2)üA
getKey(1)-getKey(4)üB
FnOff
X+AüX
Y+BüY
ClrDraw
Pt-On((X/2),(Y/2),8+Pic1)
FnOn
EndIf getKey(15)
LnReg õ
Return

Lbl DG
T+KüT
If (TùF)
DispGraphõ
0.000üT
End
Return

Lbl DH
T+1.000üT
If (TùF)
DispGraphõ
0.000üT
End
Return

Lbl DI
T+LüT
If (TùF)
DispGraphõ
0.000üT
End
Return

Lbl DJ
T+IüT
If (TùF)
DispGraphõ
0.000üT
End
Return

Let's run through that code block by block:

Code: [Select]
51.000üE
0.000üF
108.000üJ
0.000üT
0üX
0üY
0üA
0üB

J/*EüF
0.211üK
0.474üI
0.740üL

Variable declarations. Notice how almost everything is an 8.8 fixed point number. Why? Because of the way the interrupts will work. (basically, the 108Hz interrupt is the main one, (1 is added to the counter, T, every time it is called), and K, I, and L are the values added to the counter every time a different interrupt is called). K, I, and L are J/value, where value is the Hz for the other interrupts. J is the Interrupt 6 value. Change these to be what is needed for the 83+ models (round to 3 decimal places) using the calculation I just said. F is the target for the counter, and E is the target framerate.

Code: [Select]
[010101010101010101010101]üGDB1
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]
[010101010101010101010101]

[0000000000000000]üPic1
[FFFFFFFFFFFFFFFF]

Same old stuff for an RPG (tilemap and sprites)

Code: [Select]
For(Z,0,11)
For(Á,0,7)
Pt-On((Z*8),(Á*8),(8*{(Á*12)+Z+GDB1})+Pic1)õ
End
End

Drawing the back buffer once (just as an example, put this in a subroutine if you wish)

Code: [Select]
fnInt(DG,0)
fnInt(DH,6)
fnInt(DI,4)
fnInt(DJ,2)

Setting up the interrupts

Code: [Select]
Pause 200
While 1
If (getKey(54))
E-0.100üE
If (E÷49.000)
65.000üE
End
J/*EüF
0.000üT
Pause 200
End
If (getKey(55))
E+0.100üE
If (Eù66.000)
50.000üE
End
J/*EüF
0.000üT
Pause 200
End
getKey(3)-getKey(2)üA
getKey(1)-getKey(4)üB
FnOff
X+AüX
Y+BüY
ClrDraw
Pt-On((X/2),(Y/2),8+Pic1)
FnOn
EndIf getKey(15)
LnReg õ
Return

The main body of the code. There are adjustments using 2nd and mode (1/10 hz adjustments), and the ability to move a block around the screen.



Now for the interrupts:

Code: [Select]
Lbl DG
T+KüT
If (TùF)
DispGraphõ
0.000üT
End
Return

Lbl DH
T+1.000üT
If (TùF)
DispGraphõ
0.000üT
End
Return

Lbl DI
T+LüT
If (TùF)
DispGraphõ
0.000üT
End
Return

Lbl DJ
T+IüT
If (TùF)
DispGraphõ
0.000üT
End
Return

Here's what they do: They add their respective values to the counter, and then they see if the counter is greater than or equal to the target counter. If so, the the screen is drawn, and the counter is reset



Long story short: The faster interrupts are fractions of the longer interrupt, and they add to the counter smaller amounts for accuracy. Because there are more times the counter is incremented, the frame rate is more accurate.



I hope this helps! And may the grayscale be with you! ;D

1236
TI Z80 / Re: Rockfall: DT's other game for TI-Concours 2013
« on: March 24, 2013, 01:37:01 pm »
Crap! I need to step up my game! My game sucks compared to this!

1237
Axe / Re: [semi-tuto] "beautiful" grayscale without interrupts
« on: March 22, 2013, 03:19:24 pm »
This method does not always hold true because the loop time is almost never constant for games. If you wanted to use this method for picture drawing, sure, but it's not going to work with something more processor-heavy.
Which is why I said pic drawing or turn-based games only... I think I have an idea with the interrupts version though...

1238
Axe / [semi-tuto] "beautiful" grayscale without interrupts
« on: March 22, 2013, 10:07:36 am »
Hayleia recently posted this: http://ourl.ca/17145

It got me thinking: how do I make a "more precise" method for greyscale and I came up with a semi-solution (no interrupts necessary!)



This is a calibration screen. At the end it prints the number to put in A, which is a semi-timer variable.

When I say semi, that means that the ability to do this has completely to do with the time the program takes to run (A is about 12 on my calc, but about 150 or 75 is needed for wabbit in my case.)

This works with 3 and 4 level grayscale, as shown with my screenie.

Without further ado: my code!

Code: [Select]
.AA

12->A
0->C
0->B

[FFFFFFFFFFFFFFFF]->Pic1

ClrDraw(rr)
For(X,0,11)
For(Y,0,7)
Pt-On(X*8,Y*8,Pic1)(r)
End
End

Repeat (getKey(54))
If (getKey)
Pause 250
End
getKey(4)-getKey(1)->B
A+B->A
If (A=0)
255->A
End
If (A=256)
1->A
End
C++
If (C->A)
DispGraph(r)
0->C
End
End
DispGraphClrDraw(rr)
ClrHome
Output(0,0,A>Dec)
Repeat (getKey(15))
End

The "sweet spot" A depends on the calculator and how quickly the program loops in its normal state, as well as how often you need to refresh the screen.

Possible use: pic viewers

Maybe possible use: non-action games (like chess)

Not possible use: action games

I hope this is helpful!

1239
TI Z80 / Re: VVVVVV
« on: March 20, 2013, 03:23:57 pm »
I really like those tiles, and I think I'll implement them today!

1240
TI Z80 / Re: VVVVVV
« on: March 20, 2013, 01:12:34 pm »
Been too busy the past week (TI-Concours). I will soon, though.

1241
News / Re: Overclocking the TI-83+SE / TI-84+/SE Family
« on: March 20, 2013, 12:50:39 pm »
Will you please give us a tutorial for doing this? (Pics, what pins to put the resistors on, etc...)

1242
TI Z80 / Re: Grav-smash
« on: March 19, 2013, 07:06:32 pm »
* pimathbrainiac wants!!!

binary plz!

1243
TI Z80 / Re: GLIB a graphics axe 3d librairy
« on: March 18, 2013, 02:47:06 pm »
Cool!

* pimathbrainiac downloads

1244
Humour and Jokes / Re: 9001 signs you're addicted to calcs and Omni
« on: March 17, 2013, 04:06:17 pm »
4687: You know where you live
4688: You know the city in which epic7 lives
4689: You WILL get the next palindrome

1245
Introduce Yourself! / Re: Hello, from Earth!
« on: March 17, 2013, 02:00:50 pm »
Are you a z80 programmer?

If so, Axe, Basic, or ASM?

Here are some boiled peanuts! (In the same bag, though)

!peanuts

Pages: 1 ... 81 82 [83] 84 85 ... 125