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 ... 91 92 [93] 94 95 ... 153
1381
The Axe Parser Project / Re: Axiom Requests
« on: March 29, 2011, 05:41:51 pm »
For accurate trig functions you'll pretty much have to turn to a LUT. The only reason sine and cosine routines exist is because they have a limited range and can be somewhat accurately approximated by a quadratic function. And by somewhat accurate, I mean errors reaching 10%. Trying to model just about any other trigonometric function with a simple model would probably result in wild amounts of error, and trying to model them with a more complex model would probably end up being larger than a LUT-based solution anyway. Unless you need a variable argument for your scale factor, it's best to just use a custom pre-computed LUT.

1382
Axe / Re: nib{} question
« on: March 29, 2011, 03:16:00 am »
For big-endian nibble reading:

Code: [Select]
Lbl NIB
Return nib{xor 1}

1383
Axe / Re: Simple Axe Questions
« on: March 29, 2011, 03:12:21 am »
Not easily/efficiently in Axe code. I believe this would do it though. This can also be easily modified to work with buffers besides L6 if you need that.

Code: [Select]
.Example call
63sub(SRL)

.Shift Row Left
Lbl SRL
Asm(140140937DE6C0B4C02C7D87856F292909060C2BCB1610FBC9)

.Shift Row Right
Lbl SRR
Asm(140140937DE6C0B4C07D87856F292909060C2BCB1E10FBC9)

1384
The Axe Parser Project / Re: [Axiom] LCDKit
« on: March 28, 2011, 11:47:00 am »
Hmm... if RAM limits you to only assigning 256 subroutines, then I guess the current limit is okay.

1385
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 28, 2011, 11:41:47 am »
Alright, that makes sense. Thanks. :)

1386
The Axe Parser Project / Re: [Axiom] LCDKit
« on: March 28, 2011, 01:11:23 am »
Fixed a bug I hadn't noticed due to changing a shared routine without realizing it would break a routine that used it. Writing bytes/words directly to the LCD should now work.


EDIT: Just noticed a dumb mistake in commands.txt. Oh well, it's only a naming mistake and isn't too important. It'll make it into the next release, which will probably be soon due to another unexpected bug.

1387
The Axe Parser Project / [Axiom] LCDKit
« on: March 28, 2011, 12:29:41 am »
For the past week or so, I worked on an Axiom that includes a lot of commands for interfacing with the LCD driver. I think I've finished adding just about everything I wanted to and hopefully it has no bugs, so I'll release it. Here are its features:

  • Turn the LCD on or off    ? This one's cool
  • Get the on/off status of the LCD
  • Set the contrast (I just realized as I'm writing this that Axe could already do this, but this command is safer)
  • Get the contrast set by the OS (useful for setting the screen contrast back to normal)    ? Pretty useful
  • Set the screen's z-address (internally shifts the rows of the screen up/down)    ? This one's really cool
  • Apply screen flipping effects (on newer calculators with compatible drivers)
  • Read and write individual bytes/words to and from LCD memory
  • Copy a stream of bytes to or from LCD memory


That's a lot of information to throw at you about what it can do. To give you some ideas of how you could use some of these commands, here would be some useful applications of this Axiom:

  • Turn the screen off for a teacher key or to save power in a waiting state
  • Make contrast effects based around the active (OS-defined) contrast value and then return the contrast to the proper value when done
  • Use z-addressing to apply an earthquake effect without having to worry about shifting the buffer image (or make crazy tunnel games)


Anyway, without further ado I will attach a zip file containing the LCDKit Axiom, its source code (sorry if it's tabbed oddly, I designed it in wabbitcode), a readme, and a command list. The Axiom appvar is fairly small for a library with 31 routines, weighing in at 651 bytes. Note that Axe will NOT add the whole thing to your program, only the routines that you actually use, so don't worry about any unnecessary code bloating.



Changelog
  • 1.0.1 (Mar 28 2011):   Fixed a bug that slipped by, breaking the ?imag() commands
  • 1.0.0 (Mar 28 2011):   Initial release


MAKE SURE YOU DOWNLOAD THE LATEST VERSION, CURRENTLY: LCDKit_1.0.1.zip

1388
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 27, 2011, 06:38:24 pm »
Sorry if I'm pestering you about this, but could you please respond to the first part of my last post? Even if you tell me you purposely left them out for whatever reasons that's completely fine, I just wouldn't want you to have missed suggestions that you might have actually wanted to implement.

1389
Axe / Re: Axe Q&A
« on: March 27, 2011, 06:35:00 pm »
I think he wants conversion the other way around. :P

1390
The Axe Parser Project / Re: Bug Reports
« on: March 27, 2011, 06:33:37 pm »
Or you could use res 7,(iy+28h) after the routine to counteract the effect. If I recall correctly, B_CALL(_getkey) can cause problems if the user shuts off the calculator during it. But then again, they could just use 2nd + MODE for that matter.

1391
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 27, 2011, 06:01:33 pm »
Quigibo, I noticed that you implemented a bunch of my optimizations/bug fixes, which is awesome. Having left a few out is fine, but I'm stuck wondering why you left out a specific few of my suggestions in particular that I thought would be useful. Did you just miss some of these, or did you purposely leave them out?
  • An optimized Exch() routine
  • Turning p_DispStrApp and p_TextStrApp into subroutines
  • Adjusted GetCalc() routines; I see you included one of the three adjusted routines (p_GetArc) probably because it's smaller than the original routine, but this routine includes the adjustment made in the other two routines I suggested and it seems incongruous for only the archived GetCalc() routine to have this fix implemented


And on an unrelated note, could you extend the DispGraph change to DispGraphClrDraw as well? And because I know a bunch of people may not like DispGraph no longer working in 15MHz mode, could you perhaps include a routine like DispGraphNormal that saves the CPU speed setting, puts the CPU in 6MHz mode, calls the normal DispGraph routine, and then restores the CPU speed? Something like this:

Code: [Select]
p_FastCopy6MHz:
.db __FastCopy6MHzEnd-1-$
in a,($02)
rla
in a,($20)
push af
xor a
out ($20),a
call sub_FastCpy
pop af
ret c
out ($20),a
ret
__FastCopy6MHzEnd:

1392
The Axe Parser Project / Re: Bug Reports
« on: March 27, 2011, 06:00:09 pm »
getKeyr has a slight problem, not sure whether or not it's worth fixing. The bit that is set to prevent 2nd + ON from turning off the calculator is still set when the program exits. If the program is simply run from the homescreen, when it returns, 2nd + ON does nothing. Although this effect can be reversed by doing something like opening a menu, it's still a slight problem.

1393
The DispGraphClrDraw routine was unchanged. Although it probably should have been changed, so I'm going to bug Quigibo about that and a few other things. :P

Anyway, here's why you need to make sure you're not running at full speed. These are the results of a simple program that fills L6 to be entirely black and then calls DispGraph. These images aren't actually from wabbitemu because it doesn't account for LCD delay and so this problem isn't present.

6MHz
   
15MHz
Before

   
Before

After

   
After


1394
Updated for Axe 0.5.1. The file is attached to the first post. A very notable change is that, due to much pestering of Quigibo on my part, the DispGraph routine has been majorly changed. This means 2 things:

  • It runs about 40% faster than the old routine! (Yay)
  • IT WILL NOT WORK IN 15MHZ MODE!!! (An acceptable loss)

If your project is designed to run in 15MHz mode, I suggest replacing any instances of DispGraph with sub(DG). You would then want to insert this subroutine into your code:
Code: [Select]
Lbl DG
Normal
DispGraph
Full
Return

1395
The Axe Parser Project / Re: Axiom SDK For Developers
« on: March 27, 2011, 03:22:26 am »
I know, I meant the radians symbol as a suffix to the command and have it execute a different routine

Yes. The fifth byte of every Axiom command header details specifics about how the routine is called. Here is what AxiomSDK.txt says about this byte of the header:

Code: [Select]
;____FIELD 4____
;Description:     Command type
;Size:            1 byte
;Bits:            bit 0 ==> Subroutine instead of inline routine
;                 bit 1 ==> Command requires the r modifier
;                 bit 2 ==> Command requires the rr modifier
;                 bit 3 ==> Additional argument comes before a store token

So if bit 1 of this byte was set, your routine would require one r modifier.

Pages: 1 ... 91 92 [93] 94 95 ... 153