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

Pages: 1 ... 74 75 [76] 77 78 ... 153
1126
Edited my post for port 3A. It reads as 0F on my calc, so it's different from everybody else's results so far. Although that's not the only thing different about my calculator compared to the other calculators tested so far.

1127
Here's some information from my ancient calculator:

  • 1. TI-84+ SE
  • 2. S-0404
  • 3. ALCDFIX not needed
  • 4. Program version #2 used
  • 5. 128 K RAM: Yes
  • 6. Port 15: 44
  • 7. Port 3A: 0F
  • 8. IDs: 04C4
  • 9. P?: 000000

1128
Axe / Re: Getkey Routine
« on: July 10, 2011, 01:50:22 pm »
actually, i have a question to ask as well. which is more optimised?

Code: [Select]
if getkey(3)
+x->x
end

or
Code: [Select]
if getkey(3)
x++
end

the ++ and -- commands are a bit new, so i'm not sure how to go about using them yet. is there a difference in Inc vs. add in the way these are compiled?

The second one is more optimized, 7 bytes and 38 cycles versus 8 bytes and 47 cycles. And as calc84maniac said, for 16-bit variables V++ is exactly the same as V+1→V.



Back on topic, here's the most optimized code I could produce. It's 90 bytes versus the original code's 142 bytes. It will look a little messy, but that's to be expected of very optimized code. :hyper: Also, when the user presses the left and right keys or up and down keys at the same time, instead of moving in one of the directions, you simply do not move. Hopefully this is an acceptable change. If not, tell me and I'll try to produce some slightly less optimized code that accounts for this. This code also assumes that you haven't reallocated the Axe variables. If you have, change the blank #Realloc() on each of the first two lines to point to that reallocated section.

Code: [Select]
min(getKey(1)#Realloc(38+L₁)+A#Realloc()-getKey(4)sub(CN1)-1,48)→{38+L₁}ʳ
min(getKey(3)#Realloc(36+L₁)+A#Realloc()-getKey(2)sub(CN1)-1,64)→{36+L₁}ʳ

.Correct negative 1
Lbl CN1
ReturnIf +1
+1
Return

1129
TI Z80 / Re: TruVid - 4 level grayscale video with sound
« on: July 09, 2011, 04:23:57 pm »
thepenguin77, how about you release a demo application of about 25 seconds of video, with every 5 seconds using a different dithering method? Wabbitemu is nice, but when testing visuals like this, it often doesn't completely accurately represent what it will look like on a real calculator, mainly regarding blur and actual pixel response time.

But just from the wabbitemu screen captures, I think the Floyd-Steinberg dithering looks the best. It looks the most noisy, but that actually helps to blend colors better together and more accurately represent the original image. Seeing it on a calcuator could change my opinion, though.

1130
The Axe Parser Project / Re: Axe Parser
« on: July 08, 2011, 08:18:34 pm »
Map(λ(r12),L1,100)
I have couple remarks on that :)
First of all, since we will presumably be able to make routines such as Map( ourselves, could you show us the syntax for calling a subroutine by address? (Something like sub(r1, ...)r, perhaps? (Where r1 is any expression))
Secondly, will inlining be supported? (In general, not just for Map() That is, if an anonymous subroutine (or lambda, whatever you want to call them) is passed to a routine and that routine has a call for it exactly once, will the compiler replace the call with the routine itself? Otherwise, your example, among other useful invocations, will be much slower than it should be. ;)

To answer your first question, you'll probably want to call most functions with a label name, like Map(ARGS). However, you will now be able to call arbitrary addresses as well with (ADDRESS)(ARGS); (ADDRESS) is like a stand-in for the name of the function.

To answer your second question, the point of passing anonymous subroutines to functions as pointers is so you can pass any routine's pointer. The compiler will have no idea if a certain routine of yours is only ever going to be called with a pointer to one external function. If you're only going to pass one external function into your function, then you should just incorporate the first inside of the second.

1131
TI Z80 / Re: TruVid - 4 level grayscale video with sound
« on: July 08, 2011, 06:04:41 pm »
Personally, I think the dithered video, although noisy, looks far better than the undithered video. In most cases, I don't see why anyone would be viewing their calculator from less than about a foot away, so the noise from the dithering shouldn't be too prominent. And I'm not really sure if ordered dithering would make things better or worse, though. It would result in less noise, but it might also look strange to apply to a video, as I imagine it would appear as if the objects in the video are actually moving under the dithering, not moving with it.

1132
TI Z80 / Re: TruVid - 4 level grayscale video with sound
« on: July 08, 2011, 12:24:30 pm »
On the sample video, I like the top-left one, Relative - Threshold, best. The ones with dithering, in the right column, continuously show horrible pixel jitter. It would probably look less bad on a real calculator than on the emulator, but some kinds of lighting will reveal the jitter and video quality will suck.

I was a little worried about that myself, but I'd like to see how it looks on a real calculator first. And if it does look too jittery, he can try using positioned dithering instead. That would drastically reduce any jitter, while hopefully still maintaining a decent looking video.

1133
TI Z80 / Re: TruVid - 4 level grayscale video with sound
« on: July 08, 2011, 12:02:57 pm »
I had a feeling dithering would make the whole video look better by making each individual frame look better, and it looks like that might be the case! :)

1134
Axe / Re: Axing your mind
« on: July 06, 2011, 06:55:19 pm »
Change anywhere I said "x squared plus y squared" to "x squared plus y, squared." The comma is important to include I guess.

1135
Axe / Re: Axing your mind
« on: July 06, 2011, 06:23:53 pm »
({{rand+nib{8/cos(SQRT(rand20)+8erandrand)16BITANDsin(->F)}}->{°Θ}r/{EFFFF xor L1))}16BITXOR{->{°C-4}rr°A+{Trand*85+rand^°C}}r}//{rand+L1}2)**{F} and {5max(,)5}

This code is not valid Axe code. You have mismatched parentheses:

Depth: 0123        4     5    6      5          4           5   432  3  2 3           210
        ({{rand+nib{8/cos(SQRT(rand20)+8erandrand)16BITANDsin(->F)}}->{°Θ}r/{EFFFF xor L1))}    continued below...
Depth:          1  2    1     2               10 -1
        16BITXOR{->{°C-4}rr°A+{Trand*85+rand^°C}}r}//{rand+L1}2)**{F} and {5max(,)5}



sqrt(X2+Y2->{{{ºD-I}r}+sin(5}}

  • Calculate (X2+Y)2, save value for later.
  • Load the address of the D variable, and offset this address backwards in memory I bytes.
  • Load the word pointed by the address above.
  • Load the byte pointed to by the word above.
  • Add to this byte Axe's approximation of 127 times the sine of 5 binary degrees, which is 19.
  • Attempt to store the low byte of the previously calculated X2+Y2 to the byte pointed to by the address above. However, in the normal operational mode of the calculator, this address will point to flash so the write will fail.
  • Calculate the square root of the value from 2 lines above, giving a final value of 4 to 16.

Alternatively, as one run-on sentence:

Attempt, but fail because flash is read-only, to store the low byte of x squared plus y, squared to the byte pointed to Axe's approximation of 127 times the sine of 5 binary degrees, which is 19, plus the byte pointed to the word pointed to the address of the D variable offset backwards in memory I bytes, and finally take the square root of the address to which x squared plus y, squared was attempted to be stored, giving a final value of 4 to 16.

1136
The Axe Parser Project / Re: Axe dissasembler
« on: July 06, 2011, 02:50:10 pm »
As far as I know, the only finished and released Mario games were written in z80 assembly, not Axe. So it sounds like you don't want an Axe disassembler, just a regular z80 disassembler.

However, unless the author of a program explicitly tells you that you can use their code in your own project, do not use their code. Even if it's not illegal, more importantly it's just not right.

1137
The Axe Parser Project / Re: Bug Reports
« on: July 04, 2011, 01:53:50 am »
It's not just him, Quigibo. AAAA.8xp does crazy stuff for me when compiled. Not only does it print garbage to the screen and RAM clear, but it even messes up wabbitemu's debugger.

Upon looking at compiled code, you can clearly see that something is going wrong. Here is a snippet of the Axe source code where things start to go wrong:

Code: [Select]
X*{Y₁+13}*9→A
Else
 {Y₁+12}ʳ→A

And here is a breakdown of the assembly:

Code: [Select]
ld hl,(axv_X) ; X

push hl ; *{

ld hl,(axv_Y1) ; Y1

ld de,13 ; +13
add hl,de

ld a,(axv_Y1Page) ; }
call p_ReadArc
ld h,0
ld bc,$67A4 ; Where in the world did this come from? This should be pop de
call p_Mul

ld d,h ; *9
ld e,l
add hl,hl
add hl,hl
add hl,hl
add hl,de

ld (axv_A),hl ; ->A

rrca ; This should be a jp (Else). However, the hex looks familiar:
and h ; A4
ld h,a ; 67

ld hl,(axv_Y1) ; {Y1

ld de,12 ; +12
ld a,$3F ; More mysterious code

and h ; }
ld h,a ; Look familiar?
call p_ReadArc

ld (axv_A),hl ; ->A

1138
Axe / Re: Zeros(36)->{L1}
« on: July 03, 2011, 11:51:54 am »
I know I've been majorly ninja'd and you already have a working solution, but I'll post this anyways. I tried to go a lot more in depth of explaining how objects and data work in Axe, and how to properly manipulate them.



An important thing to remember about Axe is that the only data type it directly operates on is a 16-bit integer. In languages like TI-BASIC, something like :"HELLO" actually makes the last entry that string. However, in Axe, :"HELLO" will make the last entry a pointer to that string, which is stored inside of your program. This is because it cannot fit the whole string into its 16-bit data type, so it instead stores a 16-bit reference that tells where the real string is stored.


This means a few things. Most importantly for you, it means that Zeros(36)→{L₁} isn't actually storing the 36-byte object to {L₁}, it's storing a pointer to the object to {L₁}. And because there is no 2-byte r modifier after the closing brace, it's actually only storing the low byte (8 bits) of the pointer to {L₁}. But this is relatively unimportant, since either 8 or 16 bits of the pointer is not what you want.


Because using to store objects doesn't cut it, we want to use some commands specific to blocks of data. If you wanted to put a block of data at L₁, you would first need to define the data in your program. Then, you can move that data from your program to L₁ using the Copy() command. This is found under MATH ► CPX ► 1. Here is how you would create 36 bytes of zeros in your program and then move them to L₁:

Code: (Data copying method) [Select]
Zeros(36)→GDB0Z      .Add 36 bytes of zeros to the program and store a pointer to it in GDB0Z
Copy(GDB0Z,L₁,36)    .Copy 36 bytes of data starting at GDB0Z to L1


In most circumstances when you want to move data to an external location, the code above is the way to go. However, when you want to fill a location with one value, there's a slightly better way to go: the Fill() command. This is found under LIST ► OPS ► 4.You feed this a pointer and a size, and then it copies the byte pointed to ahead [size] times. Take note that because it copies the already existing byte [size] times, you'll be left with [size]+1 bytes. So as graphmastur posted, you would want to do this:

Code: (Data filling method) [Select]
0→{L₁}         .Give the fill a seed value of 0 to copy forwards
Fill(L₁,35)    .Copy the value pointed to by L₁ (which is 0) ahead for 35 bytes


Finally, the optimized code! :evillaugh: It uses some tricks that I've picked up from extensive experience with Axe and is 2 bytes smaller and a tiny bit faster. You don't need to know these tricks, but after enough practice with Axe you may pick up such tricks on your own.

Code: (Optimized data filling method) [Select]
and 0→{L₁}ʳ    .Give the fill a seed value of 0 to copy forwards
Fill(L₁,35)    .Copy the value pointed to by L₁ (which is 0) ahead for 35 bytes

1139
TI Z80 / Re: Rogue OS
« on: July 03, 2011, 10:19:10 am »
Some of Eeems' routines require that interrupts be off. So he has to back up the on/off status of the interrupts before he can disable them and run his routine, and then he has to re-enable them at the end if they were on. The ld a,i instruction is the primary way to do this, as it affects flags by setting the p/v flag if they are on and resetting it if they are not on. However, due to a hardware bug, if an interrupt activates right as this instruction is reached, the flags will reflect interrupts being off. So unless you do some more robust testing than just relying on the flag output of ld a,i, your interrupts will be mysteriously disabled on rare occasions.

1140
Axe / Re: 3D in Axe?
« on: July 02, 2011, 08:53:11 pm »
Sure, I'm not really doing anything with the engine so you can use it if you like. My only request is that if you use this engine, you credit me for my hard work making it. :)

Pages: 1 ... 74 75 [76] 77 78 ... 153