Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 June, 2013, 09:15:48 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 2 3 [4] 5   Go Down
  Print  
Author Topic: ASM Optimized routines -  (Read 5716 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 04:18:57
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3785


Total Post Ratings: +614

View Profile
« Reply #45 on: 03 May, 2012, 03:07:45 »
0

Oh, wow, awesome! I cannot believe I didn't see that, that is a source of some of my other optimisations from the original code o.O
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:30:47
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2738


Total Post Ratings: +376

View Profile
« Reply #46 on: 03 May, 2012, 04:25:44 »
0

Here's a very optimized way to convert a 16-bit signed number into an 8-bit signed number in a with overflow handling (if hl<-128, a=-128; if hl>127, a=127). Two added bonus to being super small and super fast are that it destroys nothing and that you could easily modify it to make the input a 16-bit register other than hl.


1
2
3
4
5
6
7
8
9
10
11
12
13
Signed16To8:
ld a,l
add a,a
sbc a,a
sub h
ld a,l
ret z
ld a,h
add a,a
sbc a,a
xor %01111111
ret

Implied challenge accepted!

1
2
3
4
5
6
7
8
9
10
11
Signed16To8:
ld a,l
add a,a
ld a,h
adc a,l
cp l
ret z
ld a,$7F
ret p
inc a
ret

Edit: Whoops, misteak

Edit2: This routine is a failure, disregard its failtasticness
« Last Edit: 03 May, 2012, 04:32:44 by calc84maniac » Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 04:18:57
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3785


Total Post Ratings: +614

View Profile
« Reply #47 on: 03 July, 2012, 18:13:46 »
0

I created this last night for my next project:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
PseudoRandWord:
;Outputs:
;     BC was the previous pseudorandom number
;     HL is the pseudorandom number
;f(n+1)=(241f(n)+257) mod 65536   ;65536
;181 cycles, add 17 if called
     ld hl,(randSeed)
     ld c,l
     ld b,h
     add hl,hl
     add hl,bc
     add hl,hl
     add hl,bc
     add hl,hl
     add hl,bc
     add hl,hl
     add hl,hl
     add hl,hl
     add hl,hl
     add hl,bc
     inc h
     inc hl
     ld (randSeed),hl
     ret
There are a few other nice features, too. For example, every 16-bit value is hit if you run this 65536 times. Or, if you only read 1 byte (for example, H from the output), it will hit every 8-bit number once if you run this 256 times. Plus, it can be seeded, which has its own uses. This can be modified to be smaller, too, if you know what you are doing, but I just like the numbers 241 and 257. Anyways, it produces some nice results Smiley

P.S.-I used this in a routine called "ShuffleDeck" and it works very well.
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


chickendude
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Female
Last Login: 06 June, 2013, 17:52:22
Date Registered: 06 September, 2008, 11:27:30
Posts: 440

Total Post Ratings: +66

View Profile
« Reply #48 on: 04 July, 2012, 17:19:47 »
0

I don't understand the theory behind that algorithm, but you could save a couple clocks with SMC Wink

And is ShuffleDeck a hint at what your next project might be?
Logged
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 04:18:57
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3785


Total Post Ratings: +614

View Profile
« Reply #49 on: 09 July, 2012, 14:08:46 »
0

Yes, you can use SMC to save at least 6 cycles for RAM programs Smiley 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 Smiley

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 Smiley
« Last Edit: 09 July, 2012, 14:24:53 by Xeda112358 » Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 07:40:10
Date Registered: 02 July, 2009, 06:38:05
Posts: 1699


Total Post Ratings: +499

View Profile
« Reply #50 on: 09 July, 2012, 20:45:26 »
0

Optimized a bit. Smiley The largest optimization was removing end checking, because it's impossible for an application not to have a number of pages field. I also optimized the search loop by rearranging it a bit to remove the unconditional jump.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FindNumPages:
;Inputs:
;     The app base page is loaded in MemBank1
;Outputs:
;     A, (HL) is the number of app pages

     ld hl,4000h
     ld a,81h
     ld c,a
FNPLoop:
     dec a
     cpir
     inc a
     cp (hl)
     jr nz,FNPLoop
     inc l
     ld a,(hl)
     ret
« Last Edit: 09 July, 2012, 20:46:21 by Runer112 » Logged
thepenguin77
z80 Assembly Master
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: 18 June, 2013, 05:33:45
Date Registered: 14 December, 2009, 04:21:52
Location: Purdue
Posts: 1490


Total Post Ratings: +778

View Profile
« Reply #51 on: 09 July, 2012, 20:46:04 »
0

There are actually rare cases where that routine could fail. Of course I would assume it will work 99.9% of apps, if someone changed the order of the header and put the time stamp key in front of the number of pages, it could theoretically contain $80, $81.

But, now that I think about it, this is so rare that it will never happen.
Logged

zStart v1.3.012 6-10-2013  zStart fully works on 83+BE's (except custom font)
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:30:47
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2738


Total Post Ratings: +376

View Profile
« Reply #52 on: 09 July, 2012, 22:54:29 »
0

Isn't that routine searching for $80, $81 anyway?

Edit: Oh, I see what you're saying. The time stamp data could contain $80, $81.
« Last Edit: 10 July, 2012, 00:47:23 by calc84maniac » Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
NanoWar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 18 June, 2013, 12:42:42
Date Registered: 26 February, 2011, 19:52:49
Posts: 110


Total Post Ratings: +8

View Profile
« Reply #53 on: 13 July, 2012, 00:02:41 »
0

Has anybody got a good rectangle function? It should use variable width by pixel, not byte... Here's my ugly code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
rectangle
;inputs: l=Y, a=X, b=height, c=length
;save coords & stuff
h, a
push hl
push bc
call rectangle.calc ;below
pop bc
pop hl
rectangle.display
; inputs: h=X, l=Y, b=height
ld a, h
ld e, l
ld h, $00
ld d, h
add hl, de
add hl, de
add hl, hl
add hl, hl ;l*12
ld e, a
srl e
srl e
srl e ;x/8
add hl, de
ld de, gbuf
add hl, de
rectangle.display.loop:
push bc
push hl
ld a, (hl)
ld c, a
ld a, (rectangle.scanline1) ; somewhere in ram...
xor c
ld (hl), a
inc hl
ld a, (rectangle.scanline2)
or a
jr z, rectangle.display.noloop2
ld b, a
rectangle.display.loop2:
ld a, (hl)
xor $FF
ld (hl), a
inc hl
djnz rectangle.display.loop2
rectangle.display.noloop2:
ld a, (hl)
ld c, a
ld a, (rectangle.scanline3)
xor c
ld (hl), a
pop hl
pop bc
ld de, 12
add hl, de
djnz rectangle.display.loop
ret

rectangle.calc
;inputs:
; a = x
; b = height
; c = length
ld d, a
ld a, $FF
ld (rectangle.scanline1), a
xor a
ld (rectangle.scanline2), a
ld (rectangle.scanline3), a
ld a, d
and 7
ld d, a
or a
jr z, rectangle.skipShift1
ld e, $FF
rectangle.shift1
srl e
dec a
or a
jr nz, rectangle.shift1
ld a, e
ld (rectangle.scanline1), a
rectangle.skipShift1
ld a, d ; a = shift right
ld h, a ; save
add a, c ; a + c
ld b, a ; save b = a + c
and 7 ; /8 Rest?
ld d, a ; Rest
ld a, 8
sub d ; 8 - Rest
ld d, a ; = d
ld e, $FF
rectangle.shift2
sla e
dec a
or a
jr nz, rectangle.shift2
ld a, e
ld (rectangle.scanline3), a
ld a, 16
ld e, h ; a
sub e ; 16 - a
sub d ; -d
srl a
srl a
srl a
ld d, a
;
ld a, c
srl a
srl a
srl a ; /8
sub d
ld d, a
ld a, (rectangle.scanline2)
add a, d
ld (rectangle.scanline2), a
;
ld a, b
and %11111000
or a ; if (shift_right + length)<8, do (rectangle.scanline1 & rectangle.scanline3)
ret nz
ld a, (rectangle.scanline1)
ld d, a
ld a, (rectangle.scanline3)
and d
ld (rectangle.scanline1), a
xor a
ld (rectangle.scanline2), a
ld (rectangle.scanline3), a
ret
How bad is it? Cheesy
« Last Edit: 13 July, 2012, 00:03:54 by NanoWar » Logged
chickendude
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Female
Last Login: 06 June, 2013, 17:52:22
Date Registered: 06 September, 2008, 11:27:30
Posts: 440

Total Post Ratings: +66

View Profile
« Reply #54 on: 15 July, 2012, 09:38:27 »
0

You can check out the MirageOS source, but i think it just draws four lines using their line routine.
Logged
NanoWar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 18 June, 2013, 12:42:42
Date Registered: 26 February, 2011, 19:52:49
Posts: 110


Total Post Ratings: +8

View Profile
« Reply #55 on: 18 July, 2012, 09:59:28 »
0

Oh it should be a filled rect routine Smiley .
« Last Edit: 18 July, 2012, 09:59:47 by NanoWar » Logged
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 08:54:09
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2121


Total Post Ratings: +264

View Profile
« Reply #56 on: 18 July, 2012, 11:00:08 »
0

There is a filled rectangle routine in Axe. I don't know where you can see its source code though.
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
deeph
LV4 Regular (Next: 200)
****
Offline Offline

Gender: Male
Last Login: Yesterday at 23:06:00
Date Registered: 13 September, 2008, 12:04:13
Location: France
Posts: 108

Total Post Ratings: +2

View Profile WWW
« Reply #57 on: 18 July, 2012, 11:49:18 »
0

Here's one I use for one of my project :


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
;=======================================;
; Rectangle Filling Routine Version 1.0 ;
; By Jason Kovacs & The TCPA - 10/11/99 ;
;=======================================;
; Input:  D = Top Left X Coordinate, E = Top Left Y Coordinate
; H = Bottom Right X Coord,  L = Bottom Right Y Coord
; C = Color of Lines (0-White, 1-Black, 2-XORed)
;
; Output: A Rectangle is drawn to the Graph Buffer with its border
;    and everything within it Filled in according to the value in
;    reg C which specifies the Color.
;
; Registers Affected: AF Destroyed; B=0 ; C, DE, HL Preserved.
;    The Index Registers and the Shadow Registers Aren't Used.

Rectangle_Filled:
ld a,l
sub e
inc a
ld b,a
ld a,h
sub d
inc a   
push de

Rect_Fill_Loop:
push af
call V_Line
pop af
inc d
dec a
jr nz, Rect_Fill_Loop
pop de
ret

;=======================================;
; Horizontal and Verticle Line Routines ;
; By Jason Kovacs & The TCPA - 10/11/99 ;
;=======================================;

; For H_Line and V_Line:
;
; Input:  B = Length of Line (Number of Pixels)
; C = Color of Line (0-White, 1-Black, 2-XORed)
; D = X Coordinate Start of the Line
; E = Y Coordinate Start of the Line
;
; Output: Lines are Drawn to the Graph Buffer, and the Starting
;    Byte and Pixel Mask are Automatically determined according
;    to the Input of the Coordinates in DE.
;
; Registers Affected:  All Registers are Preserved Except AF.

V_Line:
push de
push hl
push bc
ld a,d
call Getpix
pop bc
push bc
ld d,c
ld c,a
ld a,d
ld de,12
or a
call z,V_White_Line
dec a
call z,V_Black_Line
dec a
call z,V_XORed_Line
pop bc
pop hl
pop de
ret

V_White_Line:
ld a,c
cpl
ld c,a

V_White_Line_2:
ld a,(hl)
and c
ld (hl),a
add hl,de
djnz V_White_Line_2
xor a
ret

V_Black_Line:
ld a,(hl)
or c
ld (hl),a
add hl,de
djnz V_Black_Line
xor a
ret

V_XORed_Line:
ld a,(hl)
xor c
ld (hl),a
add hl,de
djnz V_XORed_Line
ret

Getpix:
ld d,0
ld h,d
ld l,e
add hl,de
add hl,de
add hl,hl
add hl,hl
ld de,plotsscreen
add hl,de

Getbit:
ld b,0
ld c,a
and %00000111
srl c
srl c
srl c
add hl,bc
ld b,a
inc b
ld a,%00000001

GBLoop:
rrca
djnz GBLoop
ret
Logged
NanoWar
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 18 June, 2013, 12:42:42
Date Registered: 26 February, 2011, 19:52:49
Posts: 110


Total Post Ratings: +8

View Profile
« Reply #58 on: 20 July, 2012, 01:42:36 »
0

Ah cool thanks. This was a bit off topic I guess Smiley
Logged
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 04:18:57
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3785


Total Post Ratings: +614

View Profile
« Reply #59 on: 20 July, 2012, 16:13:55 »
0

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 Smiley 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.)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
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
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Pages: 1 2 3 [4] 5   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.37 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.