1081
Other Calculators / Re: TI-Concours - last days to subscribe !
« on: March 06, 2013, 07:46:24 am »
yeah, this should be fun o.o I should also email my BASIC z80 entry later >.>
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. 1081
Other Calculators / Re: TI-Concours - last days to subscribe !« on: March 06, 2013, 07:46:24 am »
yeah, this should be fun o.o I should also email my BASIC z80 entry later >.>
1082
I really like the idea of the conditional codes. It's something i really like about ARM assembly, pretty much any instruction can take conditions. So you can do things like addc r1,r2 or even cmpz r1,r2. You can actually also add shifts, so you can do addc r1,r2,r3 LSL 4, which adds r2 + [r3 shifted to the left 4 bits] and stores the result in r1, but only if the carry flag is set (that's one instruction!)Awesome, that sounds so cool o.o Right now, what does sMask do? I assumed that a sprite wouldn't be processed unless you turned on that sprite's corresponding sMask bit. If i set the sprite delay to 1 and only have one sprite set in the sMask, it'll still process the other 7 sprites before coming back to the one i've enabled?Yes, that is how sMask works. Processing is rather quick if the sprite is not to be drawn, though. Also, a double-buffer might work really well here since with 8 sprites not a lot of the screen should be changing at once:Hehe, I have a double buffer routine ready, but in the current version I just use the horribly slow OS routine _GrBufCpy. The way I plan to implement it should update the screen slightly faster than the code linked to, only because I keep the habit of setting the X coordinate at the beginning of the program (the one that is 0 to 63). Since my routine returns with it being the same, there is no need to keep setting that coordinate. I think your other ideas are also good, in particular updating the LCD after each sprite is drawn will probably cause quite a bit of a slowdown. Waiting until all sprites have been drawn before updating is probably a good idea. I was also wondering if bit-instructions were going to be added ![]() There is one thing that is very lacking with this system and that is pixel testing for collision detection. However, we can use the sprite coordinates to figure out if they collide with each other. EDIT: I started work on rewriting the whole code for the new instruction set. I only have a few more instructions to finish and it is only 472 bytes. I still need to add in two larger pieces of code, though, so I think the size will be around 900 bytes when finished. It should be a bit faster than before, too, and coding should be cleaner. 1083
Hmm, I think I know the problems:
I have an issue with the keypresses and it apparently isn't reading the last key group. I have an issue with the sprite drawing (I forgot to include clipping), so this probably caused any crashes. The reason for why it seems like you aren't moving the sprite is because with a sprite delay of 0, it is actually being interpreted as 256. Essentially, when you press a key like the left key in your code, it is incrementing the X coordinate a bunch of times before the update Without updating the sprite so often, code is executed pretty quickly. I think it averages about 10000 instructions per second. To set up the update timer, try: Code: [Select] ldirc(keyMask,4) The last '1' says to update the next sprite at each instruction. Keep in mind that it cycles through each sprite one at a time, so Sprite0 gets updated every 8th instruction. With a delay of 256, there was time for 2048 instructions to execute and pressing down looped through 4 instructions in your code meaning Y could get incremented 512 times before updating the sprite.To answer your question about making an easier way to make/edit programs, I should have probably mentioned that the code can be in a program or appvar. So if you can get some kind of assembler to compile the code to a program, you can do something like: Code: [Select] "[JADETEST":Asm(prgmJADE And that will execute the program named JADETEST as a JADE program. Use '5' instead of '[' to execute an appvar.Now I have a few propositions for changes to the current instruction set and port setup. After trying to code in this language, it is obviuos that it is rather clunky. So I want to use an idea that Runer suggested that might make the code smaller and faster. Right now, all of the instructions fit in 6 bits, but take up a byte. I could make all of the instruction have flag arguments. For example, you could do something like this: Code: [Select] Loop: And that would be the code to move the coordinates of the sprite, which is 20 bytes compared to 50 bytes.If I do this, then we will free up room for other types of instructions, too. For example, I think an instruction to set, reset, or toggle a flag is useful, as well as these commands: Code: [Select] bits(const,addr) ;will perform bitwise AND logic, but doesn't change (addr), only flags. Useful to see if one of the bits is set. Here is my proposed outline for a new instruction set:Code: [Select] 0 1 2 3 4 5 6 7 8 9 A B C D E F There will then be room for 19 more instructions and possibly 64 more depending on what is done for the last set. As a quick note,these instructions are not included:Code: [Select] resz() resc() These are equivalent to:Code: [Select] togzz() togcc() For example, togzz() will only toggle the z flag if the z flag is set,so it only resets the z flag.Proposed changes to the ports: We need a better way to handle sprites. I have a few ideas:
Implications: When a sprite is drawn, sUpdate gets the corresponding bit set. This means that in order to update the sprite again, you need to reset the bit, essentially acknowledging that it has been drawn. This will allow the programmer to do proper cleanup on the LCD.
Implications: It is faster than updating the LCD every time a sprite is drawn and looks cleaner.
Implications: All the sprites are drawn, so if you need to cleanup the buffer you can without the screen being updated.
So if all of these changes are made, here is an example routine for moving a sprite: Code: [Select] #include "jade.inc"
1084
TI Z80 / Re: [Axiom] AxeJH3D, a(n almost) complete axiom for 3D development !« on: March 03, 2013, 06:49:34 am »
Matrefeytontias: This is amazing o.o It works so smoothly! I had just finally figured out 3D stuff yesterday, so I made a BASIC program, but this is gorgeous o.o I am now looking forward to the upcoming TI-Concours stuff in Axe/Assembly
![]() ![]() 1085
The two LDIRs are different in that one writes to a fixed address (1F.address.size.data) and the other uses a byte in RAM to figure out where to write the data.
And yes, I saw that I had an extra sMethod after I got offline, sorry .__. Your assembly translation is exactly correct, too! The extra 3 after the LCD update thingy is something I forgot to document and that is the frequency for updating the sprites. 3 means it updates a sprite every three instructions, so this can really slow down code as you might imagine. As a note, this doesn't update all of the sprites at once, only one sprite at a time. It also updates the LCD when each sprite is drawn, so I should probably change that to update only after all the sprites are scanned. Also, looking at your code, I like your naming syntax better for cpc, ldc, and ldirc. It makes more sense. I was actually worried that cpc() would not work, so I am glad that it does! For the .inc file, that is lovely! Any ideas on a good port 34h? Also, saveSScreen is typically 86ECh, but it will work on 9872h, too. Another thing that I realised is that savestates can be 128 bytes or 256 bytes, depending on the RAM being used. 1086
That looks awesome and is definitely pretty close to what I was talking about. I was more going for what genetic algorithms are, I think. So basically, the computer tries out different types of code to achieve a task and the 'organisms' interact with each other using their 'genetic' code. With the idea that the best suited for the task will survive, you should eventually get a fairly well coded routine for your task. I think this process has been proposed for creating quantum algorithms.
Also, finally some content! I haven't added in any of the ports, so you cannot exit Jade yet and you cannot see what is going on with the sprites, but the instructions appear to be working. There could be issues I haven't caught yet, but the source code is below. It is currently pretty ugly and not very optimised, but I will worry about that later. If you use the code from the previous routine, it will do what it is supposed to do, too. (Set up the keymask port and spritemask port and then set up the first two sets of sprite ports, then enter an infinite loop). As a note, I haven't documented the hex codes for all of the jumps and calls yet. Spoiler For Source: Spoiler For Jade.inc: Spoiler For Instruction Set: Currently the program is 522 bytes, but I still need to add in a decent sprite routine (I will probably use some heavy SMC). Yay, the ports have been added ![]() Also, the hex is compressed using BatLib, so if you want to give it a try, you will need to use BatLib or some other method of compressing the code. 1087
Haha, that does sound like something he would do o.o It is like a complicated cellular automata. Actually, if I do figure out something that works, I might have to use this for a talk that I should be giving about the subject.
As an update, I am about to run the code through ORG to see how many mistakes I have made with it. If no mistakes have been made, then I have completed the assembly version emulating the instruction set and I will need to add in ports (which should be rather trivial). 1088
Ooh, maybe I will have time today to continue with the assembly version. It actually reads the code in compressed hex form and parses it that way, so if I do not make an editor, it might be a pain to program. Another neat application of this project that I thought about was to create a different CPU and port system with only 256 bytes to work with in all and an even more simple instruction set. Because it cannot damage the calculator, you can fill the code with random data and see what happens. The ports could be for returning how close the nearest pixel is in a given direction and for incrementing an X and Y coordinate. Because it is 256 bytes, you can fit a good number of CPUs in RAM and you can make them all run in parallel and see if they interact on screen. We could set some conditions for survival, death, and procreation, and see if they create anything semi-intelligent
![]() 1089
I have begun the process of converting this to assembly now, so once it is complete, I will be able to have a copy of it on my computer (and so I can upload it here). I currently have all of the jumps and calls emulated and now I just have the math operations to finish and the others random things. For an example of the code that I wrote (in hex on my calc) that was emulated:
Code: [Select] 3020 ;jrf 32 ;jumps over the next 32 bytes
1090
TI Z80 / Re: Slova progress« on: February 27, 2013, 07:35:34 am »
Yes, that is normal and for the reason chickendude gave. Basically, it is considered a hidden variable. I like the idea of changing the case of the letters. It is a good way of making a unique name
![]() 1091
Other Calculators / Re: TI-Concours - last days to subscribe !« on: February 26, 2013, 09:03:53 pm »
I believe you will be given what type of program to create at the start of each section.
1092
Grammer / Re: Grammer 3-Concepts, ideas, requests« on: February 26, 2013, 08:33:18 pm »
It is kind of like a newline, but not really. You can use a colon in conditions for If, While, and Repeat, among other things. A colon just separates chunks of math.
1093
The simple answer is that it makes things so much easier to handle, you get a ton of variety in commands, and there are a lot less instructions. For example, you can use 32 bytes of RAM as variables and perform all math operations on any combination of variables using the same instructions.
1094
Grammer / Re: Grammer 3-Concepts, ideas, requests« on: February 26, 2013, 05:41:57 pm »
Yes, RecallPic has those abilities, currently and that will definitely be still around for Grammer 3. I might have separate tokens like xorSprite(), though.
EDIT: @Sorunome: Grammer 3 has a variable type for sprites, so definitely. Also, I like the idea of having static pointers and about the logic, I should do that for sure. Maybe I will have bitand, bitor, and bitxor instead. Currently, you no longer need to use + or *, as long as your tests produce a 1 or 0. For example, this works as you would expect it: Code: [Select] If A=3: and B=7 You just need a colon between tests.
1095
TI Z80 / Re: Random Maze Generation (Grammer)« on: February 26, 2013, 05:39:52 pm »
Earlier I tried making the sprite grayscale, but it was pretty laggy when the screen scrolled. I know how to fix it, but it would be a bit of a pain to implement it
![]() |
|