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

Pages: 1 ... 5 6 [7] 8 9 ... 14
91
I believe this is now the smallest axiom ever. :D

The token for this axiom is Zoom Out. It returns what arrow keys are currently pressed. As an added bonus, opposite keys cancel each other out. For example, if both the left and right keys are pressed, then this axiom will return that neither key is pressed. This is useful if pressing a key results in a lot of computation, and pressing opposite keys results in nothing happening.

(In the following example, e is the euler e.)
Code: [Select]
#Axiom(SpeedKey)
Zoom Out→A
If Ae7
.down key pressed
End
If Ae6
.left key pressed
End
If Ae5
.right key pressed
End
If Ae4
.up key pressed
End

This axiom can also be used to easily check for 8 directions.
Code: [Select]
#Axiom(SpeedKey)
Zoom Out→A
If A=1
.south
ElseIf A=2
.west
ElseIf A=3
.south west
ElseIf A=4
.east
ElseIf A=5
.south east
ElseIf A=8
.north
ElseIf A=10
.north west
ElseIf A=12
.north east
End

92
TI Z80 / Re: TinyCraft [Axe]
« on: January 22, 2012, 10:50:23 pm »
Bump.

Any progress on this, now that there is a map generator and fresh new tiles ?

  • Fixed mountains. :)
  • Random starting location. :D
  • Collisions. ;D

93
ASM / Re: Multiplication!
« on: January 22, 2012, 05:46:29 pm »
An example may help:

         11001100 = a
       × 10010110 = b
       ----------
         00000000
        11001100
       11001100
      00000000
     11001100
    00000000
   00000000
+ 00000000
-----------------
  111011110001000

So as you can see, in binary, for each bit you add either 0 or a (shifted by some amount), depending on the corresponding bit in b.
The way this is usually done is:
    1. shift the running total left one bit
    2. check the msb of b
    3. if set, add a to the running total
    4. shift b left one bit
    5. repeat steps 1-4 for each bit in b
    6. the answer is the current running total

94
TI Z80 / Re: TinyCraft [Axe]
« on: January 20, 2012, 12:58:41 am »
*yay* new tiles!



*yay* source code!

95
TI Z80 / Re: TinyCraft [Axe]
« on: January 17, 2012, 03:32:35 pm »
You can do them whenever you have the time, it's not like there is a deadline or anything :) (Unless someone else wants to do them of course).

96
TI Z80 / Re: TinyCraft [Axe]
« on: January 17, 2012, 02:35:18 pm »
I'm sorry, but I can't find any sprites that address the second issue I mentioned (6 or so different coloring schemes so that you can tell the difference between grass, sand, rock, dirt, hole, and water). If you did so somewhere, please let me know where they are. ???

Edit: Also, I can't find the different stages of growing anywhere.

97
TI Z80 / Re: TinyCraft [Axe]
« on: January 17, 2012, 02:18:22 pm »
So have we decided on 8x8 or 16x16 tiles yet? If we are going to use 8x8, someone needs to convert the 16x16 tiles from the game to 8x8, otherwise, we could probably use the same tiles as the game. Either way, we do need to decide on what shades of grey to use for tiles that look similar but are colored differently.

98
TI Z80 / Re: TinyCraft [Axe]
« on: January 17, 2012, 12:31:06 pm »
@saintrunner, the problem is that as far as I can tell, you were just given the sprite sheet from the original game to convert. Normally this would have been fine, except that in the original game, the sprites are converted from greyscale to color on the fly, and some of the greyscale sprites are reused by using different colors, therefore creating an entirely new tiles that need to be differentiated from each other.  Also, some of the tile sprites from the original game are created from multiple parts of the sprite sheet, and doing this would probably take too long on the calculator, so it would be better to just make separate tiles for each tile type in game.

@kindermoumoute the reason I haven't posted the source yet is because there are currently some memory issues with my code and it is currently hacked together just to create that screenshot. When I have more stable code I will be sure to post it.

99
TI Z80 / Re: TinyCraft [Axe]
« on: January 17, 2012, 12:40:22 am »
I quickly threw together some tile sprites so that I could show my progress so far. (meaning I don't expect them to be used or anything)


100
Math and Science / Re: Calculating Trajectories
« on: January 16, 2012, 09:55:47 am »
I am going to assume that angle, speed, and vertical position are fixed, and horizontal position is variable.

zᵢ is initial height (meters),
(x, y, z) is the target position (meters),
Vᵢ is the initial velocity of the cannonball (meters per second),
ω is the angular velocity (radians per second),
θ is the angle relative to the positive x axis that the cannon is turned to, to face the target (radians),
and φ is the angle above the ground the cannon is raised to, arbitrarily (radians).

First do the z direction:
Vᵢ sin φ is the initial z velocity.
S ω Vᵢ - 9.8 m/s is the acceleration in the z direction.
Since Δd = Vᵢt + ½at²,
z - zᵢ = (Vᵢ sin φ) t + ½ (S ω Vᵢ - 9.8) t², or
½ (S ω Vᵢ - 9.8) t² + (Vᵢ sin φ) t - (z - zᵢ) = 0.
Using the quadratic formula to solve for t should give you two time values.
Which one you use depends on whether you want to hit the target on the way up or on the way down.

Once you know at what time the projectile will have the same z coordinate as the target, you can calculate how far in the x and y directions it will travel in that amount of time.
Vᵢ cos φ cos θ is the initial x velocity,
Vᵢ cos φ sin θ is the initial y velocity.
Since Δd = Vt,
Δx = (Vᵢ cos φ cos θ) t
Δy = (Vᵢ cos φ sin θ) t

So the cannon should be at (x - Δx, y - Δy, zᵢ).

101
TI Z80 / Re: TinyCraft [Axe]
« on: January 14, 2012, 06:40:07 pm »
I have been working on porting the map generation algorithm from the original game to axe, so I guess I should post here. >.>

Anyway, so far I have implemented enough of the algorithm to be able to generate island shapes, so I made a screenie of my progress so far. :D

102
ASM / Re: about hooks..
« on: January 13, 2012, 09:06:37 am »
Code: [Select]
ORG  userMem-2
 DB   $BB,$6D
Start:
 IM   1
 BCALL DelRes
 LD   HL,TokenHook
 LD   DE,statVars
 LD   BC,TokenHookEnd-TokenHook
 LDIR
 LD   A,1
 LD   HL,statVars
 BCALL $4F99
 RET
;
TokenHook:
 RORG statVars
 DB   $83
 LD   A,B
 OR   A
 RET  NZ
 PUSH HL
 LD   HL,TokenTable
;LD   B,0
TokenSearchLoop:
 LD   A,E
 CP   (HL)
 INC  HL
 JR   Z,ChkByte2
NotTokenMatch:
 INC  HL
 LD   C,(HL)
 INC  C
 ADD  HL,BC
 LD   A,(HL)
 INC  A
 JR   NZ,TokenSearchLoop
 POP  HL
 RET
ChkByte2:
 LD   A,D
 CP   (HL)
 JR   NZ,NotTokenMatch
 POP  BC
 RET
TokenTable:
 DW   $06
 DB   8
 DB   "lFactor"
 DB   5
 DW   $0C
 DB   7
 DB   "WriteM"
 DB   $C1
 DW   $10
 DB   6
 DB   "ReadW("
 DW   $20
 DB   6
 DB   "ReadB("
 DW   $28
 DB   7
 DB   "Insert("
 DW   $36
 DB   7
 DB   "ClrPart"
 DW   $38
 DB   7
 DB   "RunPart"
 DW   $3A
 DB   8
 DB   "AddPart("
 DW   $3C
 DB   9
 DB   "PartType("
 DW   $44
 DB   5
 DB   "Misc("
 DW   $58
 DB   1
 DB   $5F
 DW   $BE
 DB   5
 DB   "call "
 DW   $0138
 DB   5
 DB   "Rect("
 DW   $013C
 DB   5
 DB   "Tile("
 DW   $013E
 DB   7
 DB   "Sprite("
 DW   $0140
 DB   8
 DB   "TileMap("
 DW   $0148
 DB   9
 DB   "Contrast("
 DW   $014E
 DB   9
 DB   "ShiftBuf("
 DW   $0162
 DB   7
 DB   "WriteB("
 DW   $0170
 DB   4
 DB   "Inv("
 DW   $0172
 DB   7
 DB   "WriteW("
 DW   $01A6
 DB   4
 DB   "For "
 DW   $01B4
 DB   7
 DB   "GetInc("
 DW   $01BC
 DB   7
 DB   "SetBuf "
 DW   $01C0
 DB   8
 DB   "SetFont "
 DW   $01CE
 DB   8
 DB   "MakeVar("
 DW   $01D0
 DB   8
 DB   "FindVar("
 DB   $FF
 RORG LPC
TokenHookEnd:

103
ASM / Re: about hooks..
« on: January 13, 2012, 04:50:48 am »
Here is a simple single token replacement hook that appears to work, to get you started. (Mimas syntax)
Code: [Select]
ORG  userMem-2
 DB   $BB,$6D
Start:
 LD   HL,TokenHook
 LD   DE,smallEditRAM
 LD   BC,TokenHookEnd-TokenHook
 LDIR
 LD   A,1
 LD   HL,smallEditRAM
 BCALL $4F99
 RET
;
TokenHook:
 RORG smallEditRAM
 DB   $83
 PUSH HL
 LD   HL,$0180
 OR   A
 SBC  HL,DE
 POP  HL
 RET  NZ
 LD   HL,Lambda
 RET
Lambda:
 DB   1,2,$C2,'('
 RORG LPC
TokenHookEnd:

104
Axe / Re: Axe Q&A
« on: January 07, 2012, 10:24:50 am »
If two calculators were connected via linkport and both running Axe programs, and 1 calculator wrote 1 into the Port, and the other wrote a 2 into the port, what would each calculator read the port as?
0

I know the result can be determined by some sort of binary combination of the two numbers but I can't remember which.
(A or B) xor 3 or equivalently 3-(A or B)

105
The Axe Parser Project / Re: MIDI To Axe Music Converter
« on: January 06, 2012, 04:30:44 am »
Oh yeah, I'll try installing it again.  I wish it weren't so complicated, but I have to build it from source in order for it to compile statically.  :(  Maybe I can just find all the DLLs and include those, but I have no idea which ones I would need.

Another option is that I could just rewrite it in Java using swing, that might be easiest, but it will take some time.

Usually, all you need are
  • QtCore4.dll
  • QtGui4.dll
  • mingwm10.dll
  • libgcc_s_dw2-1.dll[/s
in the same folder as the executable. IIRC, they can all be found in the Qt SDK installation.

Edit: Actually, for your program you need:
  • QtCore4.dll
  • QtGui4.dll
  • QtSvg4.dll
  • QtXml4.dll
And they should be located in Qt\bin.

Pages: 1 ... 5 6 [7] 8 9 ... 14