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

Pages: 1 ... 109 110 [111] 112 113 ... 317
1651
ASM / Re: Ok, I'm a noob
« on: August 29, 2012, 12:44:28 pm »
Sorry, I haven't had much time at all to work on this stuff :/

1652
TI 68K / Re: Pokemon TI-89
« on: August 29, 2012, 11:34:50 am »
Wow, I have to download this :D I downloaded an older version a while ago, so I am glad to see the progress!

1653
TI Z80 / Re: EnG
« on: August 14, 2012, 03:01:47 pm »
I have some really neat ideas planned, so I hope the person who requested the program can give an "okay" for me to release stuff. For example, I plan to have the file system support arrays with arbitrary types of data. For example, arrays where some elements are arrays themselves, some elements could be strings, et cetera :D Regardless, I plan to have this supported in a future release of Grammer, if I get around to finishing it.

EDIT: I have been given an okay :) I will edit the first post with the download for those that want to try a release.

1654
TI Z80 / EnG
« on: August 14, 2012, 01:59:33 pm »
A few years ago, I was approached with a program idea. The programmer wanted a few special functions that seemed best fit for an assembly program. I finally got the motivation to really work hard at it and in the past week I totally rewrote it implementing some really cool features.

  • First, BASIC programmers will have access to as many as 10 drawing buffers.
  • There are also a handful of drawing commands that can be done on these buffers
  • None of the buffers use User RAM
  • All calc models have access to at least 3 buffers
  • The TI-83+SE, and all TI-84+ models have access to all 10
  • The models with access to all 10 buffers also have access to all of there extra RAM pages, not normally accessible
  • Strings, sprites, pictures, and other types of data can be backed up to this extra RAM (ranging from almost 9000 bytes to >90 000 bytes of extra RAM)


I am not going to release this program until I have been given the go ahead by the person who made the request, but one important thing that I do want to leave with you all is this:

I have put the Grammer project on hold for a bit. I wanted to try out other projects and ideas before I try to go further. I plan to use much of the code from this program in the next Grammer version. I have a file system, data retrieval, and data storage that works fully with all the available RAM. I plan for the final Grammer OS to give programmers access to everything on their calculators, including their RAM, whether it is 32KB, 48KB, or 128KB.

Also, here is a screenie :)

As a note, the variables STRING0 and STRING1 are stored as strings because of the .1, not because of their names. I could name a string "GUYScheckTh1sOwt.It's a string!" When it returns 1, it means it was stored successfully, when it returns 5, it means the variable already exists.

EDIT:

I was given the okay to release. For those that want to just give it a try, I will upload some info and the program. Since it is still being developed, nothing has been finalised, so syntax will likely change. In other words, don't make any super awesome programs that rely on this version! Playing with it should be enough.

1655
BatLib / Re: BatLib News
« on: August 14, 2012, 01:31:36 pm »
I believe so, judging by the signature.

1656
Math and Science / Re: Sums, Pascal, and Equations for Sets
« on: August 05, 2012, 05:02:48 pm »
necro update >.>

Here is an interpolation program that allows you to supply your own x list and y list. Unfortunately, this requires BatLib to be installed as it uses the number to string function (it makes the program much faster, smaller, and I don't need to use other variables).

Now for some more stuff..

I have been working on some pretty cool math that has lead me to figuring out how to make different interpolation models. For example, I could before model data with a polynomial equation, but now I have an algorithm to do exponential data. Here is an example:

I want:
     f(0)=a
     f(1)=b
     f(2)=c
The formula is scary, but really cool:
     f(x)=cx(x-1)/2bx(2-x)a(x-2)(x-1)/2
Try it, it works :D It was a simple process, too. All I did was say:
     eu(0)=a
     eu(1)=b
     eu(2)=c
Then:
     u(0)=ln(a)
     u(1)=ln(b)
     u(2)=ln(c)
Using the first algorithm that I established:
     ln(a) |                    |
     ln(b) |ln(b)-ln(a)         |
     ln(c) |ln(c)-ln(b)         |ln(c)-2ln(b)+ln(a)
;=======
     ln(a) |3ln(b)-2ln(a)-ln(c) |ln(c)-2ln(b)+ln(a)
     ln(b) |ln(b)-ln(a)         |ln(c)-2ln(b)+ln(a)
     ln(c) |ln(c)-ln(b)         |ln(c)-2ln(b)+ln(a)

Then u(x)=ln(a)+x(3ln(b)-2ln(a)-ln(c))+x(x+1)/2(ln(c)-2ln(b)+ln(a)).
Now we use some logarithm rules to simplify:
     u(x)=ln(a)+ln(b3x)-ln(a2x)-ln(cx)+ln(cx(x+1)/2)-ln(bx(x+1))+ln(ax(x+1)/2).
Now substitute in the u(x):
     f(x)=eln(a)+ln(b3x)-ln(a2x)-ln(cx)+ln(cx(x+1)/2)-ln(bx(x+1))+ln(ax(x+1)/2)
Now we reorganise this to make it easier to apply more rules:
     f(x)=eln(a)+ln(b3x)+ln(cx(x+1)/2)+ln(ax(x+1)/2)-ln(a2x)-ln(cx)-ln(bx(x+1))
     f(x)=eln(a)+ln(b3x)+ln(cx(x+1)/2)+ln(ax(x+1)/2)-(ln(a2x)+ln(cx)+ln(bx(x+1)))
     f(x)=eln(a)+ln(b3x)+ln(cx(x+1)/2)+ln(ax(x+1)/2)/e(ln(a2x)+ln(cx)+ln(bx(x+1)))
Now we use more simplification with logs and exponents of the same base:
     f(x)=(ab3xcx(x+1)/2ax(x+1)/2/(a2xcxbx(x+1))
     f(x)=(b3xcx(x+1)/2ax(x+1)/2+1/(a2xcxbx(x+1))
     f(x)=(b3x-x(x+1)cx(x+1)/2-xax(x+1)/2+1-2x
     f(x)=(b-x(x-2)cx(x-1)/2a(x-1)(x-2)/2
     f(x)=(bx(2-x)cx(x-1)/2a(x-1)(x-2)/2


I also went through a similar process for using sine and cosine, but it had some sign issues :/ (because of how arcsine and arccosine are defined to work as a function). It actually worked for the values I used, but I am pretty sure I put together a data set that failed.

In any event, it might be useful to make a small interpolation suite. It would probably be nice to have a version in BASIC so that folks can study it, but another version in assembly to make a faster and more efficient process.

1657
Grammer / Re: Grammer 2-The APP
« on: August 05, 2012, 04:50:00 pm »
Hehe, yes, it does help :D I have been using it in Samocal.
Also, in reference to your current avatar, Advanced Wars has inspired some of my random programming. (Like when making a tilemap that also checks surrounding tiles to see if it needs to be modified. Think of how high mountains are depending on what is behind it.)

1658
Grammer / Re: Grammer 2-The APP
« on: July 27, 2012, 03:16:16 pm »
I have an incomplete update here. I forgot to add in the header for GroupHook and I cannot fix this from this computer :/ Anyways, I added two more solve( options to back up and restore all pointer vars. I also added in a useful Menu( function :) It is similar to a popup style menu in that it returns the item number selected and lets you place the menu on the screen at a given location. For example:
Code: [Select]
.0:
If Menu(3,3,48,"Header","Item0","Item1","Item2","Exit→A=3
Stop
!If A
Goto Lbl "ITEM0
...

As a note, the 48 is there to specify the width of the menu.
If you guys have any suggestions on how to modify this command, feel free to suggest :) If I can, I think a scrolling menu would be cool :D

1659
TI Z80 / Re: GamePack
« on: July 23, 2012, 04:13:59 pm »
Yes,and imagine what it will be like with sound effects :D
Also, this computer is about to die D:

1660
TI Z80 / GamePack
« on: July 23, 2012, 09:28:45 am »
I don't think I will get to really work on this much, but I figured I could give people ideas and a concept :)
What I want it to be if I finish it:
-A game pack featuring some mini games, such as solitaire, minesweeer, tic-tac-toe, Invasion and tunnel.
-Featuring background music, sound effects

Currently, all I have finished is setting up the board in tic-tac-toe, generating a tunnel, shuffling decks for solitaire and black jack, and displaying cards. Oh, and also the background music :)

Here is what the Readme says so far:
Quote

No games work yet
Background music works :)
Background music slows stuff down :[
Press [ON] to disable background music
Press [ON]+[^] to reenable background music
You need headphones for it to work (or turn on sound in WabbitEmu)
Clear exits places
Select Tic-Tac-Toe to listen to the tic-tac-toe "music"
Go to "Next ->" to see more games
Select Tunnel to watch the tunnel move and listen to music
Select Music Board to listen to some tracks. They are very simple, usually between 4 notes.


Because background music can slow down games a lot, I use short beeps for
actual games. I think it sounds okay, though.

If you want to test it out, here it is. It is an app, by the way
EDIT: Screenie added

1661
BatLib / Re: BatLib
« on: July 20, 2012, 10:17:49 am »
Awesome, thanks :) I might decide to keep this normal name as a way to differentiate it from the old version. I'm still thinking about it...

1662
ASM / Re: ASM Optimized routines
« on: July 20, 2012, 10:13:55 am »
Here is a routine that I started a long time ago (back when I coded only in hex). I have been too lazy to replace the hex code with mnemonics, but it can draw all sorts of rectangle types :) I am sure it can be optimised, but it works:

(note, RectData needs to be 24 bytes of free ram. I typically use data in the op registers or cmdshadow, or something like that.)
Code: [Select]
DrawRectToGraph:
     ld hl,9340h
;===============================================================
DrawRectToBuffer:
DrawRect:
;===============================================================
;Inputs:
;     A is the type of rectangle to draw
;        0 =White
;        1 =Black
;        2 =XOR
;        3 =Black border
;        4 =White border
;        5 =XOR border
;        6 =Black border, white inside
;        7 =Black border, XOR inside
;        8 =White border, black inside
;        9 =White border, XOR inside
;        10=Shift Up
;        11=Shift Down
;
;
;        14=pxlTestRect  (returns the number of on pixels in the rectangular region)
;        15=pxlTestBorder (returns the number of on pixels on the border, good for collision detection)
;     B is the height
;     C is the Y pixel coordinate
;     D is the width in pixels
;     E is is the X pixel coordinate
;===============================================================
     di
     push hl
     pop ix
     ex af,af'
;Check if coords are negative
     ld a,c
     or a
     jp p,$+9
       add a,b
       ret nc
       ret z
       ld b,a
       ld c,0

     ld a,e
     or a
     jp p,$+9
       add a,d
       ret nc
       ret z
       ld d,a
       ld e,0
;Check dimensions
     ld a,b
     or a
     ret z
     jp p,$+6
       neg
       ld b,a
     add a,c
     sub 64
     jr c,$+6
       neg
       add a,b
       ld b,a

     ld a,d
     or a
     ret z
     jp p,$+6
       neg
       ld d,a
     add a,e
     sub 96
     jr c,$+6
       neg
       add a,d
       ld d,a
     ld a,c
     cp 64
     ret nc
     ld a,e
     cp 96
     ret nc
MakePattern:
     push bc
     ld hl,RectData
     ld b,24
     xor a
     ld (hl),a
     inc l
     djnz $-2
     ld hl,RectData
     ld c,RectData+12
     ld a,e
     sub 8
     jr c,$+6
       inc l
       inc c
       jr $-6
     add a,8
     ld e,a
     ld b,a
     inc b
     ld a,d
     add a,e
     ld e,a
     ld a,1
     rrca
     djnz $-1
     ld b,l
     push af
     ld l,c
     or (hl)
     ld (hl),a
     ld l,b
     pop af
     dec a
     scf
     adc a,a
     ld (hl),a
     ld a,e
     sub 8
     jr c,$+10
     jr z,$+10
       inc l
       ld (hl),-1
       inc c
       jr $-10
     add a,8

     ld b,a
     or a
     ld a,1
     jr z,$+5
     rrca
     djnz $-1

     ld b,l
     push af
     ld l,c
     or (hl)
     ld (hl),a
     ld l,b
     pop af
     dec a
     cpl
     and (hl)
     ld (hl),a
     pop bc
     ld a,b
     ld b,0
     ld h,b
     ld l,c
     add hl,hl
     add hl,bc
     add hl,hl
     add hl,hl
     push ix
     pop bc
     add hl,bc
     ld b,a
     ex af,af'
     .db $CB,$67,$28,$10,$D6,$10,$F5,$0E,$18,$11
     .dw RectData
     .db $1A,$2F,$12,$13,$0D,$20,$F9,$F1

     or a
     jr nz,$+13h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$2F,$A6,$77,$13,$23,$0D,$20,$F7,$10,$F0,$C9

     dec a
     jr nz,$+12h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$B6,$77,$13,$23,$0D,$20,$F8,$10,$F1,$C9

     dec a
     jr nz,$+12h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$AE,$77,$13,$23
     .db $0D,$20,$F8,$10,$F1,$C9

     dec a
     jr nz,$+26h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$B6,$77,$13,$23,$0D,$20,$F8,$05,$C8
     .db $05,$28,$0F,$0E,$0C,$11
     .dw RectData+12
     .db $1A,$B6,$77,$13,$23,$0D,$20,$F8,$10,$F1,$04,$18,$DC

     dec a
     jr nz,$+28h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$A6,$AE,$77,$13,$23,$0D,$20,$F7,$05,$C8,$05,$28,$10,$0E,$0C,$11
     .dw RectData+12
     .db $1A,$A6,$AE,$77,$13,$23,$0D,$20,$F7,$10,$F0,$04,$18,$DA

     dec a
     jr nz,$+26h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$AE
     .db $77,$13,$23,$0D,$20,$F8,$05,$C8,$05,$28,$0F,$0E,$0C,$11
     .dw RectData+12
     .db $1A,$AE,$77,$13,$23,$0D,$20,$F8
     .db $10,$F1,$04,$18,$DC

     dec a
     jr nz,$+36h
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$B6,$77,$13,$23,$0D,$20,$F8,$05,$C8,$05
     .db $28,$1F,$E5,$0E,$0C,$11
     .dw RectData
     .db $1A,$A6,$AE,$77,$13,$23,$0D,$20,$F7,$E1,$0E,$0C,$11
     .dw RectData+12
     .db $1A
     .db $B6,$77,$13,$23,$0D,$20,$F8,$10,$E1,$04,$18,$CC

     .db $3D,$20,$33,$0E,$0C,$11
     .dw RectData
     .db $1A,$B6,$77,$13
     .db $23,$0D,$20,$F8,$05,$C8,$05,$28,$1E,$E5,$0E,$0C,$11
     .dw RectData
     .db $1A,$AE,$77,$13,$23,$0D,$20,$F8,$E1
     .db $0E,$0C,$11
     .dw RectData+12
     .db $1A,$B6,$77,$13,$23,$0D,$20,$F8,$10,$E2,$04,$18,$CD,$3D,$20,$34,$0E,$0C,$11
     .dw RectData
     .db $1A,$A6,$AE,$77,$13,$23,$0D,$20,$F7,$05,$C8,$05,$28,$1E,$E5,$0E,$0C,$11
     .dw RectData
     .db $1A,$B6
     .db $77,$13,$23,$0D,$20,$F8,$E1,$0E,$0C,$11
     .dw RectData+12
     .db $1A,$AE,$77,$13,$23,$0D,$20,$F8,$10,$E2,$04,$18
     .db $CC,$3D,$20,$35,$0E,$0C,$11
     .dw RectData
     .db $1A,$A6,$AE,$77,$13,$23,$0D,$20,$F7,$05,$C8,$05,$28,$1F,$E5
     .db $0E,$0C,$11
     .dw RectData
     .db $1A,$AE,$77,$13,$23,$0D,$20,$F8,$E1,$0E,$0C,$11
     .dw RectData+12
     .db $1A,$A6,$AE,$77,$13
     .db $23,$0D,$20,$F7,$10,$E1,$04,$18,$CB,$3D,$20,$37,$05,$C8,$F3,$E5,$D9,$01,$0C,$00,$E1,$09,$D9,$0E
     .db $0C,$11
     .dw RectData
     .db $D5,$D9,$D1,$D9,$1A,$2F,$A6,$D9,$47,$1A,$A6,$B0,$13,$23,$D9,$77,$13,$23,$0D,$20
     .db $EF,$10,$E4,$0E,$0C,$11
     .dw RectData
     .db $1A,$2F,$A6,$77,$13,$23,$0D,$20,$F7,$FB,$C9

     .db $3D,$20,$40,$F3,$C5
     .db $11,$0C,$00,$19,$10,$FD,$2B,$E5,$D9,$11,$F4,$FF,$E1,$19,$D9,$C1,$05,$C8,$0E,$0C,$11
     .dw RectData+11
     .db $D5
     .db $D9,$D1,$D9,$1A,$2F,$A6,$D9,$47,$1A,$A6,$B0,$1B,$2B,$D9,$77,$1B,$2B,$0D,$20,$EF,$10,$E4,$0E,$0C
     .db $11
     .dw RectData+11
     .db $1A,$2F,$A6,$77,$1B,$2B,$0D,$20,$F7,$FB,$C9

     dec a
     ret z
     dec a
     ret z
     exx
     ld de,0
     ld c,8
     exx
PxlTestRect:
     dec a
     jr nz,PxlTestBorder
     ld c,12
     ld de,RectData
PxlTstRectLoop:
       call PxlTestWithMask
       djnz PxlTstRectLoop-5
       exx
;DE contains the number of pixels
       ret
PxlTestBorder:
     dec a
     ret nz
     ld c,12
     ld de,RectData
     call PxlTestWithMask
     dec b
     jr z,PxlTestBorder-4
     dec b
     jr z,PxlTestBrdrEnd
     ld c,12
     ld de,RectData+12
PxlTstBrdrLoop:
       call PxlTestWithMask
       djnz PxlTstBrdrLoop-5
PxlTestBrdrEnd:
     ld de,RectData
     ld c,12
     call PxlTestWithMask
     exx
;DE contains the number of on pixels
       ret
PxlTestWithMask:
     ld a,(de)
     and (hl)
     exx
     ld b,c
     add a,a
     jr nc,$+3
     inc de
     jr z,$+4
     djnz $-6
     exx
     inc de
     inc hl
     dec c
     jr nz,PxlTestWithMask
     ret

1663
BatLib / Re: BatLib
« on: July 09, 2012, 08:21:25 am »
For GroupHook, I tried a technique suggested by Runer that has worked excellently. I am still working on adding better features, but currently, you can:
  • Disable GroupHooks
  • Enable GroupHooks
  • Get which apps are in the GroupHook


Using command 126:
dim(126,#) will return the name of the nth app in the grouphook. (Returns ".DNE" if the number is out of range)
dim(126.1) will disable all grouphooks
dim(126.2) will enable all grouphooks
dim(126.3,#) will enable the nth app in the grouphook
dim(126.4,#) will disable the nth app in the grouphook


Nevermind, I forgot to put the updated one on my flash drive, so 126.3 and 126.4 aren't available. Anyways, GroupHook is now slightly faster and it now uses a GDB var (a hacked one) to store data.

This is not an official update because it is still not finished. However, feel free to take a look :)

1664
ASM / Re: ASM Optimized routines
« on: July 09, 2012, 08:08:46 am »
Yes, you can use SMC to save at least 6 cycles for RAM programs :) My next mini project is an app with some small games (including card games). I don't have my computer with me, but I will post a working sound routine next time I get a chance.

The way it works is that we are using mod 216, so I selected two numbers relatively prime to 65536 (so any odd number, in this case). There are a few other conditions dealing with the Euler phi function, I believe, but I got lucky with the numbers I chose, so I didn't need to look it up. If you check, I chose prime numbers, specifically, because I figured those would give me the best shot.

If you choose the wrong values, you will get cycles of 2n. I am not sure how familiar you are with group theory, but essentially, you will be creating sub groups and the order (size) of a subgroup will always divide the order of the main group. So some values will make cycles of 32768, 16384, and other smaller powers of 2. (gah, there is so much cool theory behind this, but I don't have much time).


EDIT: ooh, here is a useful routine :)
Code: [Select]
FindNumPages:
;Inputs:
;     The app base page is loaded in MemBank1
;Outputs:
;     c flag set if the field was found
;     nc means the app header subfield was not found
;     A is the number of app pages
;     B is 0
;     (HL) is the number of app pages

     ld hl,4000h
     ld bc,128
     ld a,c
     or a
FNPLoop:
     cpir
     ret po
     ret nz
     inc a
     cp (hl)
     jr z,$+5
     dec a
     jr FNPLoop
     inc l
     ld a,(hl)
     scf
     ret
I made that to be a faster alternative to using a bcall :)

1665
BatLib / Re: BatLib
« on: July 03, 2012, 03:56:28 pm »
I probably will not, but if I can, I will try :)

Pages: 1 ... 109 110 [111] 112 113 ... 317