| The United-TI Forum is Read-Only. | |
| Goto page 1, 2 Next |
| 05 Apr 2012 11:53:19 am by Sven.Thomas0 | ||
| The two offending lines are:
LD (pos), H LD H, (pos) Those are invalid commands :/ You can only load HL and A directly to a memory address, unfortunately. So what you could do is "LD A, H \ LD (pos),A" and "LD A,(pos) \ LD H,A" respectively. I hope that helps! Also, a trick I learned with notepad is the doing Ctrl+G well let me go to a line. This helps a lot in debugging |
||
| 05 Apr 2012 01:01:38 pm by jammasterz | ||||
| Eh, that feels bad, really really bad.
Feel free to test it out and tell me what you think
|
||||
| 05 Apr 2012 01:32:00 pm by Sven.Thomas0 | ||||||
Hmm, I had a few issues. I changed these #define statements:
To this (this is the proper syntax):
This is because you are assigning a constant to a variable as opposed to a function (macro). Also, you will notice that I had to change lA to lA_ and that is because that is already defined in the ti83plus include. I don't have time right now to debug (I have a project to go work on), but I could give it a go later |
||||||
| 06 Apr 2012 11:04:17 am by jammasterz | ||
| What? | ||
| 06 Apr 2012 11:08:07 am by jammasterz | ||
| If you mean that im too lazy to debug it myself, youre wrong. I just posted it to show people what ive made so far and how terribly wrong it is, not to make them do my work for me. Right now im just too frustrated to look at the code again. | ||
| 06 Apr 2012 02:31:51 pm by Sven.Thomas0 | ||
| Usually if it says an interest of 143040, it is a spam bot x.x Also, you said "tell me what you think," so I thought you wanted people to test it and see if they could help remove errors :[ Sorry if I sounded like I was saying you cannot :(
EDIT: And apparently the part of my post that said "Also, the program seemed frozen and wasn't doing anything" was cut out :/ That is what I meant when I said I didn't have time to debug and I was in a hurry to get to my group on time so we could plan a presentation :[ I just wanted to see if I could step through your code to see what was going on. |
||
| 07 Apr 2012 02:17:38 pm by jammasterz | ||||
| I absolutely didnt find it offending And actually i did something Now i have a little question. If i want the program to display ' ', '-' and '>' do i just do like this?
or do i have to save them as some kind of special tokens or ascii codes? |
||||
| 07 Apr 2012 03:43:46 pm by Sven.Thomas0 | ||||
The .db statements should be good for most common chars, but the TI-83+ ASCII has a few differences from normal ASCII, so you might need to watch out for that. Also, since you are only displaying 1 char, it might be more beneficial to display them as chars instead of strings
If you don't want the cursor to advance, you can use _PutMap instead |
||||
| 07 Apr 2012 04:41:13 pm by jammasterz | ||
| Thanks! Didnt think about it |
||
| 07 Apr 2012 06:28:09 pm by Sven.Thomas0 | ||
| I know I came across something that made sense to me about the little-endian thing, but I have forgotten. I think it was when I was working on some multiprecision math things. However, I think it is more to do with the actual processor design (it probably made it faster/smaller). | ||
| 08 Apr 2012 09:54:18 am by jammasterz | ||||
| I play quite a lot with processor design and layout, and i donw think its a problem. Think about it, there is no speed nor compacity loss when getting a wire to a diffrent place( those places should be right next to eachother). Ill google it I've got one more problem. I have edited the bulletmovement routine and it says that there is no such instruction as:
Im certain because i checked it in documenatation, and its says, SUB A, reg8 where reg can be E. EDIT: Wow so this is why! http://www.noveltheory.com/TechPapers/endian.asp I didnt think about it this way, espetially that we dont look at raw memory, but process it and load to some adresses. It would only be usefull if there was a way to load 2 bytes of memry to a 16 bit register that does NOT cosist of 2 smaller ones, which would make that the number would still be correct. On z80 however, there are no such registers, which means little endian just makes our life much more difficult |
||||
| 08 Apr 2012 10:35:05 am by Sven.Thomas0 | ||
| Haha, this one is always one that causes issues. With ADD, we can do either 8-bit or 16-bit, so you need to specify ADD A,reg8 or ADD HL,reg16. Many assembler carry the same syntax to SUB, even though it is only 8-bit. However, most omit the "A," part to save some memory and speed as it isn't needed (there is no SUB HL,reg16 though many would love it).
Pretty much, just do SUB E. I wish assemblers would be consistent, but you won't know which syntax a z80 assembler will use until you try it and either get an error or get an OK x.x |
||
| 08 Apr 2012 12:00:48 pm by jammasterz | ||
| Okay, the code has been updated. Now im begging for help because its beyond me. The GetBulletDisp routine is in my understanding incorrect( should switch CurRow and CurCol), but its fine for the calculator. The rest is an exact translation of my ti-basic code, but of course it doesnt work. If there is only one bullet everything is almost ok, but when the bullet reaches Y=15 the ship disappears if its located above the bullet. I said almost allright because the bullets should move by themselves, not by any keypress. Then where there are more than one bullet it starts freaking out. Whats interesting is that when you 2nd quit, and try to do something the the operating system is broken without any reason. Could you please tell me where i made a mistake? If you want to see the working ti-basic code look at topic names starwars. | ||
| 08 Apr 2012 01:32:52 pm by Sven.Thomas0 | ||||
| Okay, I'll check it out. I used to have routines like this fail in the past and it would take me forever to figure out why x.x
EDIT: One thing that will make it not work is using bcall(_GetKey) instead of bcall(_GetCSC). _GetKey waits until you press a key, whereas _GetCSC does not. Also, the keycodes are different for the two, unfortunately, so you will have to change those around. EDIT2: Hmm, I wrote up some code and it is working, now, but some parts are crazy. It currently looks like what it does below. Also, in doing this, I found a mistake in a well known/used .inc file x.x bcall(4744h) is one of the getkey bcalls that I like to use often.
I may or may not have broken it, too :/ |
||||
| 10 Apr 2012 01:04:49 am by jammasterz | ||
| I really love the small things and hacks that you do that make the code super fast. But unfortunately i can not accept this code. Please don't get me wrong, im not trying to be rude or something, but i want to write the code myself. It's my fault that i didn't say what i really want. What i ment is if someone could show the parts of code that are wrong or suspicious. I hope you understand. | ||
| 10 Apr 2012 06:57:13 am by Sven.Thomas0 | ||
| Yeah, it's no problem 55 instead of kQuit 28 instead of k8 26 instead of k2 19 instead of k6 Then it will shoot very fast (I thought it wasn't working until I watched very closely and saw it shoot out), so you might need some delay. Also, I think your routine for adding bullets/removing bullets might be broken :/ I hope that helps! |
||
| 10 Apr 2012 08:45:06 am by jammasterz | ||
| Yeah, i solved it. I dont need to remember the codes, the are included in the inc file, for example 6 = Sk6. I also implemented a counter that counts to 255 before it jumps in the loop that moves the bullets(i think it will be slower on a calculator, but its not a problem to change the value). The problem is that if you shoot 4 times(not at the same time), it crashes. Somehow it manages to jump ot of the program and just go foward until meeting some invalid instruction. Also i noticed that after the 4th shot everything from adress FFFF to the code of program(not exactly, just go back and you will see it) is overwritten with the bullet coords. There is a problem with the Is15 routine, but i cant find it. I updated the code. | ||
| 12 Apr 2012 02:30:34 am by jammasterz | ||
| Okay, there must be something wrong with the debugger, because i've spent the last 2 days trying to find that bug and it just doesn't exist. There is no way that a value of any register gets over 987F, but still it somehow manages to overwrite. | ||
| 12 Apr 2012 05:18:40 am by Sven.Thomas0 | ||||
Hmm, just took a more detailed look:
Also, instead of INC A \ LD (HL),A, you can do INC (HL) and you don't even need the CP 0. When you do INC or DEC on an 8-bit register, if it reaches zero, the z flag is set, otherwise it is nz. |
||||
| The United TI Forum is Read-Only. | |
| Goto page 1, 2 Next | |
[Switch to Desktop view]
© Copyright 2000-2013 Cemetech & Kerm Martian :: Mobile Design by Alex "comicIDIOT" Glanville
Problems? Issues? Or Suggestions? There's a thread for that!
© Copyright 2000-2013 Cemetech & Kerm Martian :: Mobile Design by Alex "comicIDIOT" Glanville
Problems? Issues? Or Suggestions? There's a thread for that!
