Show Posts
|
|
Pages: 1 ... 3 4 [5] 6 7 ... 20
|
|
61
|
Calculator Community / TI Z80 Calculator Projects / Re: Bounce
|
on: 30 September, 2012, 15:54:24
|
So Rect is 112 bytes larger than pt-on? Wow, that's huge. That means that I can save 112 bytes by using Pt-On for my paddle!
No, it isn't. Rect is 112 bytes large in total. The routines are only added to your program if they occur at least once in the source. So basically using two times Pt-Off will only add one Pt-Off to the program, and every times you need it, the function is called (like a subroutine). You can save bytes by using only one type of routines (e.g. all Pt-Off or all Rect) instead of having different.
|
|
|
|
|
62
|
Calculator Community / ASM Language / Custom vertical line routine crashes
|
on: 30 September, 2012, 12:45:32
|
Writing some program in axe, I needed a fast vertical line routine to substitute this: The routine should draw a vertical, at y=22 centered line expanding E pixels up and down to a total length of E*2+1 in column X. This is my idea: 1 2 3 4 5
| Axe :X:asm(E5) ;push hl :^8:asm(23E5) ;inc hl, push hl (gets the number of rotating cycles needed) :E :asm(The routine) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| Stack: #Rotation cycles, X HL : E
pop bc ; #Rotation cycles , Stack: 1 pop de ; X Stack: 0 srl e ; Div 8 srl e srl e ; DE: X/8 ld a,l ; A: E add hl,hl ; 2E inc hl ; 2E+1 ld b,l ; B: 2E+1, #Lines push bc ; #Lines, #Rotation cycles , Stack: 1 ld b,a ; B: E ld a, 22 ; A: 22 sub b ; A: 22-E ld l,a ; HL: 22-E ld c,l ld b,h ; BC: 22-E MUL 12 add hl,hl ; *2 add hl,bc ; *3 add hl,hl ; *6 add hl,hl ; *12 add hl,de ; HL: (22-E)*12+(X/8) ld de, $9340 ; plotsscreen add hl,de ; HL: Start byte pop bc ; #Lines, #Rotation cycles , Stack: 0 Lineloop: ld d,b ; backup b ld b,c ; #Rotation cycles ld a,(hl) ; A: Byte to modify Sloop1: rla ; rotate djnz Sloop1 scf ; Pixel on ld b,c ; #Rotation cycles Sloop2: rra ; rotate back djnz Sloop2 ld (hl),a ; restore modified byte ld b,d ; Restore b ld de,12 ; DE: 12 add hl,de ; Next line djnz Lineloop ; until #Lines-- = 0 |
I hope somebody can help me finding the error, I'm stuck  Edit: It doesn't crash immediately, it does it when the program returns. The error is before lineloop I think
|
|
|
|
|
67
|
Calculator Community / TI Z80 Calculator Projects / Re: [Axe] Bullet Proof
|
on: 19 September, 2012, 18:17:45
|
I couldn't do much on this, I've been working on another "scientific useful" project for some time now, but nonetheless here is an update:  Added: - Automatic Archive/Unarchive safe file (no big deal, but was missing before)
Changed: - Fixed phantom grenades / grenades exploding much too late / grenades disappearing (occurred when both players throw a grenade the same time)
- Downgraded the machine gun: only 9 shots, fire rate reduced from 200% to 150% (recommended by a friend)
- Reduced grenade timer by 20% (explodes after 80 frames)
Since it isn't an update with changed graphics / major changes on game mechanics, I won't add a screeny. Download:
|
|
|
|
|
72
|
Calculator Community / Axe Language / Re: How to create 4 level greyscale in Axe?
|
on: 05 September, 2012, 21:16:04
|
I meant the "..." also why is it pt-off instead of pt-on?
Yeah, remove the dots (you can add other code in there, like movement) Make sure to initialize X and Y or replace them with constants. Pt-Off is slightly faster than Pt-On (when X is a multiple of 8 ), so that's why I used that for the example. But doesn't really matter. Hex: [FFFFC3C3C3C3FFFF] for front buffer [FF81BDA5A5BD81FF] for back buffer That should be a neat little box with all colors!
|
|
|
|
|
73
|
Calculator Community / Axe Language / Re: How to create 4 level greyscale in Axe?
|
on: 05 September, 2012, 20:36:52
|
Here is a more in-depth how-to: The TI-83 series doesn't support grayscale natively, but axe has some functions to alternate checkerboard patters, but that is so fast (and the screen is blurry too), so that it looks for the human eye like it is gray. Because one buffer can only store data for two colors, you'll need two buffers for 2² = 4 level grayscale. Depending on the pixel combination of both buffers you can get black, dark gray, light gray and white. The easiest way (for me) to remember the combinations is, that the main buffer has a higher "priority" or "level" than the back buffer, so if you change a pixel on the front buffer, it'll cause the result to change more than when you do it on the back buffer. Here are the combinations for 4 level grayscale: Front buffer: Back buffer: Result: | off off white | off on light gray | on off dark gray | on on black |
In order to display a 4-level sprite, you have to create two 8x8 sprites, one for the front buffer, one for the back buffer. With the table above as reference, you can make your 2 sprites out of the one desired gray sprite. To display them, you need two Pt-commands: 1 2 3 4 5 6 7 8 9 10 11 12 13
| [Hex for Front buffer]→Pic1A ; you can use other names for pointers if you want [Hex for Back buffer]→Pic1B ... ClrDrawrr ; clears both buffers at the same time While 1 ... Pt-Off(X,Y,Pic1A) ; X and Y are the coordinates Pt-Off(X,Y,Pic1B)r ... DispGraphClrDrawrr ; for 4 level you need two radian r's ... EndIf getkey(15)
|
For 3 level grayscale you need DispGraph r, for 4-level you need rr. Same when you use the DispGraphClrDraw. Every time the DspGraph rr is passed, the checkerboard pattern is changed. That should be it.
|
|
|
|
|
74
|
Calculator Community / Axe Language / Re: Enemies Freezing after another enemy is shot? (UPDATED)
|
on: 04 September, 2012, 18:33:49
|
Also would the arithmetic logic be a good optimization for speed on a ti84+SE?
For "+" always, but for the multiplying I have to admit that runer's right. Take the bitwise "and" when you compare booleans. Note: "2 and 1" would be true in boolean, but you have to use multiplication because the bitwise "and" would return zero.
|
|
|
|
|
75
|
Calculator Community / Axe Language / Re: Enemies Freezing after another enemy is shot? (UPDATED)
|
on: 04 September, 2012, 18:03:19
|
Only applies if the pointer is not a constant! L2 is a constant, so that part of his code is fine. Whoa, didn't know that!  Remember, the syntax to create a list of data in Axe is different from that in TI-BASIC: Data(0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225)→GBD1
Stupid mistake  And for the "3"-key mistake: I just copied from the source, but you can blame me for not checking it  Thanks runer, you make me always learn new things!
|
|
|
|
|
|