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 ... 49 50 [51] 52 53 ... 153
751
« on: October 29, 2012, 05:00:49 am »
If prod({19,12}>abs(L1-{46,43EDIT: Or was the point not to produce optimized code? If so, nevermind me.
752
« on: October 25, 2012, 07:42:44 pm »
What screenshots are you talking about? As far as I know any screenshots of it hanging around are real, although the grayscale/overall screen quality might not be accurate because of emulator settings. And generally if the game is zoomed in 100% it looks fairly good and runs decently close to original speed. Of course the drawback then is that you can't see a large portion of the real image.
753
« on: October 25, 2012, 07:14:41 pm »
What you're experiencing is no bug, that's just what happens when you try to emulate a device with a 4MHz processor and decent 2D graphics hardware on a device with only a marginally faster processor, (virtually) no graphics hardware, and a smaller screen that requires downscaling to make (most of) the original image fit. In contrast to that, a gameboy emulator running on your computer has a processor that is thousands of times faster, powerful graphics hardware, and no downscaling necessary.
754
« on: October 15, 2012, 02:31:37 pm »
Hmm, I guess I'll either have to think of some tricky find-and-replace way of doing this or suck it up and use the 27-branch conditional. The reason why I wanted this was to let the user input a function of arbitrary variables, which is then searched for any variables and the user is prompted for their values. To then evaluate the function (or a transformation of the function), I need some way of actually assigning those values to the variables.
755
« on: October 15, 2012, 11:14:20 am »
Is it possible to store a value to an arbitrary real number variable? I tried expr("1"+Str0+"A") as a test (where Str0 contains a store arrow), but it throws an error. I suspect it may not be possible, but if you can think of any hackish way to do it, that would be great. I don't want to have to resort to a 27-branch conditional.
756
« on: October 04, 2012, 02:34:29 pm »
here is what I get with Wabbitemu set at 68 Hz and 5 shades with this program That counts, I'm impressed.
I have to comment though, I don't think it works that well on the majority of calculators. Basically this method is the same as your method thepenguin77, except it uses the 560/512Hz first hardware timer interrupt instead of a 10922Hz crystal timer interrupt. Tuning this is about 20x rougher, so it's really just luck if one tuning setting looks close to perfect. For instance, this is about what pure dark gray looks like at the best tuning setting on the luckier of my two calculators: Change the tuning setting by just one in either direction and I get something that looks approximately like this:
757
« on: September 27, 2012, 02:37:43 pm »
RAM usage while compiling isn't a huge issue, since I'm sure with some changes to Axe, applications could be written straight to flash. The issue is how the app will actually run in the calculator's memory layout, which is split into four 16KB banks as follows: - Bank 0, 0000-3FFF: ROM 0 (OS core)
- Bank 1, 4000-7FFF: swappable ROM (applications run here)
- Bank 2, 8000-BFFF: RAM 1 (all of static RAM, some user RAM)
- Bank 3, C000-FFFF: RAM 0 (some user RAM, VAT, stack, and other things)
For all intents and purposes, bank 1 is the only memory bank applications can occupy, which gives the 16KB limit. Multi-page apps allow you to have more than one 16KB page, but the issue is then that only a part of the application can be mapped into memory at one time. You then have to have special handling for calls, jumps, or memory reads that gap pages of your application. Assembly developers who make multi-page apps can intelligently decide where to put routines and data such that the amount of page swapping needed is minimal, and they can create custom routines to operate on off-page data. However, performing this analysis on arbitrary Axe code and knowing when page swaps are necessary is a much tougher challenge. But I assure you that methods of tackling this tough challenge are on the back burner, so it might come to fruition some day.
758
« on: September 21, 2012, 12:28:26 pm »
Come on now, I bet you can make this pretty fast without using assembly. I'm always interested to see powerful things done in Axe. But feel free to reach out for optimization assistance too, I would imagine something like this could be challenging to optimize.
759
« on: September 20, 2012, 11:12:10 pm »
squidgetx never fails to make awesome-looking stuff. But I'd certainly like to see how fast you could get that by trying to turbocharge it to maximum Axe capabilities.
760
« on: September 12, 2012, 08:52:41 am »
What the title says would be nice. I always struggle to make my IRC bot's output look proper in OmnomIRC because of a lack of support for some IRC control characters. Here is what I've noticed omnomIRC is still missing, listed in order of decreasing importance to me: - [0x0F] Strip: any alterations applied by previous control characters are removed
- White background color
- More accurate colors
- [0x02] Bold: Is a toggle
- [0x1F] Underline: Is a toggle
- [0x1D] Italic: Is a toggle
- [0x16] Reverse: Acts like color 0,01 except it's actually a toggle that overrides, but does not cancel, color
761
« on: September 04, 2012, 06:44:04 pm »
This is the effect of neither the OS nor Axe properly handling lists and matrices when creating arbitrary variables. Lists and matrices don't have the normal 2-byte size header that programs and appvars do; lists have a 2-byte header with the number of 9-byte elements, and matrices have two 1-byte entries for number of elements in each dimension. However, the arbitrary variable creation B_CALL doesn't handle lists or matrices in any special way, so the OS only allocates as many bytes as the size argument you pass to it and writes that value to the variable header. So GetCalc("L1",10) would cause the OS to allocate 10 bytes in RAM (+2 bytes for the header) and write $000A to the header. However, after it's created, if the OS subsequently looks at it, it will think it's a list with 10 elements, and thus much larger. Deleting this will result in deleting more memory than was allocated, causing your crash.
A special case for lists and matrices could be added to Axe, but I think that would add too much size for such rarely-created variable types. You can correct it manually yourself fairly easily though, like this:
!If GetCalc("L₂",N*9)→L .Error End N→{L-2}ʳ
Or, optimized: EDIT: calc84maniac says this may be unsafe, so for the costs of 2 bytes, perhaps just skip it.
!If N→{GetCalc("L₂",N*9)→L-2}ʳ+1 .Error End
762
« on: September 04, 2012, 01:24:03 pm »
The issue is here: WinButtons: db %00100000 dw 0 dw 0 dw exitAx1
Firstly, it never works well to put data in a section designated for a command, because Axe may see certain bytes and think that they are REP_NEXT or OFS_NEXT macro identifiers. But the larger problem here is that Axe doesn't know to replace exitAx1, and I can't think of a way to make it replace it. However, we can always copy it in at run-time! dw $C0DE
; Alert( ; Displays a modal msg box with custom text
dw AlertEnd+6 ; I use REP_NEXT twice and OFS_NEXT twice **CHANGED** db %00001000 ; only for DoorsCS db $BB,$1B ; normalpdf( db 1 ; subroutine **CHANGED** db 1 ; 1 arg
rorg 0 push hl inc hl inc hl inc hl call sub_Length ex de,hl push de call OpenGUIStack
REP_NEXT ; db $7F rorg $-1 ld hl,sub_Axiom2 ; **CHANGED** ld de,WinButtons-SmallWin ld a,GUIRSmallWin call PushGUIStack ; **CHANGED**
REP_NEXT ; db $7F rorg $-1 ld hl,exitAx1 REP_NEXT(5+WinButtons-SmallWin) ; db $40 db 5+WinButtons-SmallWin rorg $-2 ld (sub_Axiom2),hl REP_NEXT(WinButtons-SmallWin) ; db $40 db WinButtons-SmallWin rorg $-2 ld hl,sub_Axiom2 ld de,AlertEnd-WinButtons ld a,GUIRWinButtons call PushGUIStack pop de pop hl inc de inc de inc de ld a,GUIRText call PushGUIStack
ld hl,0 call GUIMouse ret
exitAx1: call ResetAppPage ret
AlertEnd:
;** CHANGED **
dw DataEnd db %00001000 dw 0 db %00010000 db 0
rorg 0 SmallWin: db 7,7 db $E0,$B0,$90,$90,$F0 db " ",0
WinButtons: db %00100000 dw 0 dw 0 dw 0 ; **CHANGED**, although it doesn't really matter
DataEnd:
dw 0 ; AXM_END
; token hook dw $03E0 ; hnormalpdf db 6 db "Alert("
763
« on: September 04, 2012, 11:53:07 am »
Lbl DIFF1 0→A→B→C→S→T→R→U→D→I→θ→G→{L1}→{L2}
storing something into a Ram location pointed to and will return the address of that location, not the value.
You're basically doing that - which is not what you want:
0→{L1} L1→{L2}
Only applies if the pointer is not a constant! L2 is a constant, so that part of his code is fine. then, the elses here make absolutely no sense to me:
:If K=15 :Goto DIE:End :If K=33 :0→L:Else:End :If K=34 :1→L:Else:End :If K=26 :2→L:Else:End :If K=16 :3→L:Else:End You could also use a LUT and the inData( Command.
Also, I think you want 18, not 16, for the "3" key. Use + instead of "or" and * instead of "and" in when doing conditionals, those are bitwise operations.
If {L1+(θ*4)}=(X+1) or ({L1+(θ*4)}=(X-2)) or ({L1+(θ*4)}=X) or ({L1+(θ*4)}=(X-1)) or ({L1+(θ*4)}=(X+2)) In a long chain of or's like this, substituting them for +'s is a good optimization. But if you have any and's, I would stick with the bitwise logic operators and not substitute them for arithmetic operators. In any case I wouldn't substitute and with *, because multiplication is not a native operation on the z80 and takes much longer than bitwise and. What is a LUT and what does inData do?
LUT stands for Look-up-table. It is basically just a constant array with values. You can get each value by accessing the data with an index. That is usually a lot faster than having a calculation for it.
Example:
{0,1,4,9,16,25,36,49,64,81,100,121,144,169,196,225}→GBD1 ; a LUT with the squares of 0-15 ... instead of a calculation like A²→B you can use the LUT: {A+GBD1}→B
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( Data( is really the ∆List( token) You can use an LUT also the other way round. Axe provides the function inData() for that.
inData(BYTE,PTR) Searches for BYTE in the zero-terminated data. If found, it returns the position it was found in (starting at 1). If not found, 0 is returned. Zero-terminated means, that the last value of the LUT has to be 0 respectively the first 0 in the LUT is considered as the end.
Say, at the beginning of the code we have a LUT with our keys, ending with 0:
{33,34,26,16,0}→GBD1 at the point where we need the data, we use inData().
If inData(K,GBD1)→F ; if the key is one of the weapon selectors F-1→L ; take this value (1-4) and subtract 1 (then we have 0-3) and store it in L. End
optimized to save a variable:
If inData(K,GBD1) -1→L ; that is the subtraction minus sign, same as above. It subtracts from the last evaluated expression, which is "inData" End
There's currently a bit of an issue with this code that may be solved in the next version of Axe. The issue is that, if K happens to be 0, inData(K,GDB1) will return the position of the terminating zero in GDB1 which is 5, instead of the expected value of 0 for no match. Until then, the best fix for this is to add one to all the key values in GDB1 (and remember that the "3" key is 18, not 16) and do inData(K+1,GDB1). Also, list syntax! But otherwise good job helping out MGOS, it's always nice to see people willing to help others transition to Axe.
764
« on: August 30, 2012, 10:30:03 pm »
You are checking in the appvar section of the memory management menu, correct? And you are sure that you are using the actual "appv" token (2nd + 8), not just spelling it out?
765
« on: August 30, 2012, 02:43:54 pm »
A few notes about the locking program: - Since it looks like you're just using appvTEMP for 4 bytes of temporary storage, you don't really need an appvar for it at all. You could read the password the user enters into any 4-byte section of static RAM, like L1. To clarify a little bit, "static RAM" is RAM that is always allocated for certain things. Many static RAM location do no hold essential data during assembly program execution, so you can use them as temporary storage without having to request dynamically-allocated storage in user memory.
- Get rid of the two DelVar commands that you have at the end of the program. In Axe, the A-theta variables are assigned to a section of static RAM, so there's no need to delete them when your program ends because they aren't real variables that consume user memory. Also, DelVar expects the argument passed to it to be a string containing the name of the variable to be deleted, not an actual variable token. I wouldn't be surprised if this is what's causing the RAM clear.
Pages: 1 ... 49 50 [51] 52 53 ... 153
|