Omnimaga

Calculator Community => Discontinued => Major Community Projects => KnightOS => Topic started by: SirCmpwn on August 26, 2010, 07:12:40 pm

Title: Needed Routines
Post by: SirCmpwn on August 26, 2010, 07:12:40 pm
Hello,
The following is a list of routines that KnightOS needs in the near future, but that have already been done and optimized several times:

===Drawing===
*Line (Black and white lines)
*Rectangles (Black and white outlines, filled and unfilled)
===I/O===
*Linking routines via the I/O port

I have a line drawing routine, but it is only in black.

Please post your routines if you have them, and thanks!  Anyone who posts routines that end up in the OS will get an official thanks in the final version of KnightOS.
More routines will be added to this list as the need arises.
Title: Re: Needed Routines
Post by: matthias1992 on November 17, 2010, 02:30:16 pm
*bump*

I am sure Quigibo can give you his line routine for axe...as well as his rectangle routines (I assume he does not use any TIOS System routines?)

Linking is a different thing...I might actually look that up...
Title: Re: Needed Routines
Post by: ztrumpet on November 17, 2010, 05:32:26 pm
This game http://www.ticalc.org/archives/files/fileinfo/423/42355.html  (It finally got featured!!!) has a wonderful linking routine in its source.  Plus it's made by Quigibo, so you could probably get permission to use it. ;D
Title: Re: Needed Routines
Post by: SirCmpwn on November 18, 2010, 08:17:40 pm
Thanks, I have a line routine now, and I'll check out that link routine.
Title: Re: Needed Routines
Post by: jnesselr on January 23, 2011, 06:08:34 pm
*bump*

Are there any other routines that we need to plan for/work on?
Title: Re: Needed Routines
Post by: Xeda112358 on January 23, 2011, 06:10:30 pm
OhOhOhOhOhOhOhOh
I have 12 rectangle routines that work better than the OS versions and are safer/more reliable!!!!!!
Do you want them?!!
They are in BatLib!!
You can see the screen shots!
Title: Re: Needed Routines
Post by: DJ Omnimaga on January 24, 2011, 02:40:31 am
I think he will probably want them in z80 form rather than hex, though. :P
Title: Re: Needed Routines
Post by: Xeda112358 on January 24, 2011, 09:28:55 am
:P That's what Assemblex is for :D Gotta hand it to Scout, Assemblex is really going to be useful for me. I'll obviously go through the code to make sure everything is alright and all the proper notes/labels are there.
Title: Re: Needed Routines
Post by: Munchor on January 24, 2011, 09:35:22 am
:P That's what Assemblex is for :D Gotta hand it to Scout, Assemblex is really going to be useful for me. I'll obviously go through the code to make sure everything is alright and all the proper notes/labels are there.

It's basically a disassembler+Hex Editor. There are several disassemblers and even more hex editors.

It has some extra neat tools, but it's basically a Hex Editor+Disassembler.

Hum, what exactly is the line routine for Sir? Graphs?
Title: Re: Needed Routines
Post by: Binder News on January 27, 2011, 03:01:29 pm
You can get the source for the routines Quigibo uses in Axe in the download.
Title: Re: Needed Routines
Post by: Xeda112358 on January 27, 2011, 04:42:59 pm
This is my own routine and a screen shot of it in action. It is about 683 bytes (not that I counted >_>):
This is the code Assemblex spit out:
Spoiler For Spoiler:
push af
push bc
ld b,0
push bc
push de
push de
ld hl,34540
ld (hl),0
ld de,34541
ld bc,24
ldir
pop de
ld a,e
rrca
rrca
rrca
and 15
ld h,0
ld l,a
ld a,e
and 7
push af
ld b,a
ld a,255
jr z,$04
srl a
djnz $FC
ld de,34540
add hl,de
ld (hl),a
pop af
cpl
and 7
inc a
ld b,a
pop af
sub b
bit 7,a
jr z,$0F
and 7
or a
jr z,$06
ld b,a
xor a
scf
rra
djnz $FC
and (hl)
ld (hl),a
jr $15
inc hl
cp 8
jr c, $06
ld (hl),255
sub 8
jr $F5
or a
jr z,$06
ld b,a
xor a
scf
rra
djnz $FC
ld (hl),a
pop hl
add hl,hl
add hl,hl
ld b,h
ld c,l
add hl,hl
add hl,bc
ld bc,($84B6)
or (hl)
add a,h
add hl,bc
push hl
push de
ld hl,34539
ld de,34551
inc de
inc hl
ld a,(hl)
or a
jr z,$FA
srl a
xor (hl)
ld (de),a
inc hl
ld a,(hl)
dec hl
or a
jr nz,$09
ld a,(hl)
srl a
add a,(hl)
cpl
and (hl)
ld (de),a
jr $11
inc de
inc hl
ld a,l
cp 248
jr z,$04
ld a,(hl)
or a
jr nz,$F5
dec de
dec hl
ld a,(hl)
add a,a
xor (hl)
ld (de),a
pop de
pop hl
pop bc
pop af
or a
jr nz,$11
ld c,12
ld de,34540
ld a,(de)
cpl
and (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
djnz $F0
ret
dec a
jr nz,$10
ld c,12
ld de,34540
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
ret
dec a
jr nz,$10
ld c,12
ld de,34540
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
ret
dec a
jr nz,$24
ld c,12
ld de,34540
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$0F
ld c,12
ld de,34552
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
inc b
jr $DC
dec a
jr nz,$26
ld c,12
ld de,34540
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
dec b
ret z
dec b
jr z,$10
ld c,12
ld de,34552
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
djnz $F0
inc b
jr $DA
dec a
jr nz,$24
ld c,12
ld de,34540
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$0F
ld c,12
ld de,34552
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
inc b
jr $DC
dec a
jr nz,$34
ld c,12
ld de,34540
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$1F
push hl
ld c,12
ld de,34540
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
pop hl
ld c,12
ld de,34552
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $E1
inc b
jr $CC
dec a
jr nz,$33
ld c,12
ld de,34540
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$1E
push hl
ld c,12
ld de,34540
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
pop hl
ld c,12
ld de,34552
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $E2
inc b
jr $CD
dec a
jr nz,$34
ld c,12
ld de,34540
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
dec b
ret z
dec b
jr z,$1E
push hl
ld c,12
ld de,34540
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
pop hl
ld c,12
ld de,34552
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $E2
inc b
jr $CC
dec a
jr nz,$35
ld c,12
ld de,34540
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
dec b
ret z
dec b
jr z,$1F
push hl
ld c,12
ld de,34540
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
pop hl
ld c,12
ld de,34552
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
djnz $E1
inc b
jr $CB
dec a
jr nz,$37
dec b
ret z
di
push hl
exx
ld bc,12
pop hl
add hl,bc
exx
ld c,12
ld de,34540
push de
exx
pop de
exx
ld a,(de)
cpl
and (hl)
exx
ld b,a
ld a,(de)
and (hl)
or b
inc de
inc hl
exx
ld (hl),a
inc de
inc hl
dec c
jr nz,$EF
djnz $E4
ld c,12
ld de,34540
ld a,(de)
cpl
and (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
ei
ret
dec a
jr nz,$40
di
push bc
ld de,12
add hl,de
djnz $FD
dec hl
push hl
exx
ld de,65524
pop hl
add hl,de
exx
pop bc
dec b
ret z
ld c,12
ld de,34551
push de
exx
pop de
exx
ld a,(de)
cpl
and (hl)
exx
ld b,a
ld a,(de)
and (hl)
or b
dec de
dec hl
exx
ld (hl),a
dec de
dec hl
dec c
jr nz,$EF
djnz $E4
ld c,12
ld de,34551
ld a,(de)
cpl
and (hl)
ld (hl),a
dec de
dec hl
dec c
jr nz,$F7
ei
ret
dec a
jr nz,$03
000000C9         ;This is just a place holder for future commands
This is the hex:
Spoiler For Spoiler:
F5C50600C5D5D521EC86360011ED86011800EDB0D17B0F0F0FE60F26006F7BE607F5473EFF2804CB3F10FC11EC861977F12FE6073C47F190CB7F280FE607B7280647AF371F10FCA677181523FE08380636FFD60818F5B7280647AF371F10FC77E12929444D2909ED4BB68409E5D521EB8611F78613237EB728FACB3FAE12237E2BB720097ECB3F862FA612181113237DFEF828047EB720F51B2B7E87AE12D1E1C1F1B72011
0E0C11EC861A2FA67713230D20F710F0C93D2010
0E0C11EC861AB67713230D20F810F1C93D2010
0E0C11EC861AAE7713230D20F810F1C93D2024
0E0C11EC861AB67713230D20F805C805280F0E0C11F8861AB67713230D20F810F10418DC3D2026
0E0C11EC861AA6AE7713230D20F705C80528100E0C11F8861AA6AE7713230D20F710F00418DA3D2024
0E0C11EC861AAE7713230D20F805C805280F0E0C11F8861AAE7713230D20F810F10418DC3D2034
0E0C11EC861AB67713230D20F805C805281FE50E0C11EC861AA6AE7713230D20F7E10E0C11F8861AB67713230D20F810E10418CC3D2033
0E0C11EC861AB67713230D20F805C805281EE50E0C11EC861AAE7713230D20F8E10E0C11F8861AB67713230D20F810E20418CD3D2034
0E0C11EC861AA6AE7713230D20F705C805281EE50E0C11EC861AB67713230D20F8E10E0C11F8861AAE7713230D20F810E20418CC3D2035
0E0C11EC861AA6AE7713230D20F705C805281FE50E0C11EC861AAE7713230D20F8E10E0C11F8861AA6AE7713230D20F710E10418CB3D2037
05C8F3E5D9010C00E109D90E0C11EC86D5D9D1D91A2FA6D9471AA6B01323D97713230D20EF10E40E0C11EC861A2FA67713230D20F7FBC93D2040
F3C5110C001910FD2BE5D911F4FFE119D9C105C80E0C11F786D5D9D1D91A2FA6D9471AA6B01B2BD9771B2B0D20EF10E40E0C11F7861A2FA6771B2B0D20F7FBC93D2003
000000C9
(http://www.omnimaga.org/index.php?action=dlattach;topic=5383.0;attach=5406;image)

Also, Sir, if you are interested in a math function...
(http://www.omnimaga.org/index.php?action=dlattach;topic=5383.0;attach=5601;image)
Title: Re: Needed Routines
Post by: DJ Omnimaga on January 27, 2011, 04:47:38 pm
Could you explain what the first screenshot does? Does it draws the rectangle or does it draw fast graphs?

Also on an off-topic note I wonder where did SirCmpwn go? He didn't login on the forums since last weekend and he did not e-mail me or anything else saying he got grounded more or something. O.O
Title: Re: Needed Routines
Post by: Xeda112358 on January 27, 2011, 04:51:26 pm
Oh, sorry. The first screen shot is of the rectangle routines, the second one is a routine to show the 248-bit division routine.
Title: Re: Needed Routines
Post by: ztrumpet on January 27, 2011, 05:47:36 pm
248-bit division routine.
O.O
Wow, Zeda's using big numbers...

Edit:  Okay, how do you do division with that many bites?  Can I have Pseudo-code? :D
Title: Re: Needed Routines
Post by: Xeda112358 on January 27, 2011, 05:56:13 pm
I have no clue what pseudo code is, but really it is just doing a multiprecision divide of a variable length number by an 8-bit number, so it isn't really that complex...
MP_Divide_E
Spoiler For Spoiler:
;0600E5092B7907070757AF41B7CB162B10FB1709BB380293341520EFE141577EB720040D2310F87A0600C9
ld b,0
push hl
add hl,bc
dec hl
ld a,c
rlca
rlca
rlca
ld d,a
xor a
ld b,c
or a
rl (hl)
dec hl
djnz $FB
rla
add hl,bc
cp e
jr c, $02
sub e
inc (hl)
dec d
jr nz,$EF
pop hl
ld b,c
ld d,a
ld a,(hl)
or a
jr nz,$04
dec c
inc hl
djnz $F8
ld a,d
ld b,0
ret
I hope it disassembled correctly...
Title: Re: Needed Routines
Post by: ztrumpet on January 27, 2011, 06:00:12 pm
Ah, well pseudo-code is just the algorithm explained as words.  For instance:

Pseudo-code for eating a sandwich:
1.) Get out bread, meat, cheese, and condiments
2.) Layer appropriately
3.) Eat :)
Title: Re: Needed Routines
Post by: Xeda112358 on January 27, 2011, 06:05:52 pm
Oh, okay... lemme see... Divide MP number by E:
Get pointer to multi precision number
Get length in bytes of said number
Zero out A
Multiply this value by 8 for the number of bits
Use a multi precision shifting routine to shift the bits left
Do a 17 on A (erm, shift left while carrying in the carry)
compare a to E
If A is greater than or equal, subtract E and set the last bit (by adding 1) to the multi-precision number

The result is that the old mp number contains the results of a division by E.

It is like long dividing... in binary...
Title: Re: Needed Routines
Post by: DJ Omnimaga on January 27, 2011, 09:37:15 pm
Thanks for the info. Aren't 31 bytes numbers a bit large, though? O.o
Title: Re: Needed Routines
Post by: Xeda112358 on January 27, 2011, 09:40:12 pm
yep ^-^ Which is what makes it useful to people like me who like to work with large numbers :D I plan to make some math functions available for BatLib that deal with much larger numbers. Maybe I'll add some symbolic, but I doubt it :P
Title: Re: Needed Routines
Post by: jnesselr on January 27, 2011, 10:04:28 pm
Big Integers would be awesome.  As in integers that fill up as much room as mem can hold.
Title: Re: Needed Routines
Post by: Xeda112358 on January 27, 2011, 11:13:31 pm
Yep :D I can tweak the routine a little to handle numbers much larger than 248-bits... I think it would add about 14 bytes to the code (because ED43**** and ED4B**** are four bytes and some push/pop things could be removed).
Title: Re: Needed Routines
Post by: SirCmpwn on January 29, 2011, 01:39:13 pm
Hi,
I did disappear due to the extreme escalation of problems at home.  I'll pop in occasionally as often as I can, but it won't be often.  I'm still managing some work on tiDE, though.
Xeda, I'd love to use those routines!  They would be especially useful.
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 02:15:42 pm
Okay, I hid them in the spoilers in these posts:
Rectangles:
http://ourl.ca/6825/168393 (http://ourl.ca/6825/168393)
MP_Div_E:
http://ourl.ca/6825/168438 (http://ourl.ca/6825/168438)

And the documentation is somewhere in this PDF :D
Title: Re: Needed Routines
Post by: Deep Toaster on January 29, 2011, 02:18:38 pm
Just a tip: Try not to put [code] tags in spoilers. In some browsers (like Chrome) it shows up really, really small.
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 02:20:07 pm
Sorry, I just like fixed width stuff. I'll remove them, though.
Title: Re: Needed Routines
Post by: Deep Toaster on January 29, 2011, 02:26:53 pm
You can use [tt][/tt] for fixed-width without code blocks :)
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 02:27:53 pm
Oh, thanks! I know I saw that somewhere, but I couldn't remember what the code thing was.
Title: Re: Needed Routines
Post by: SirCmpwn on January 29, 2011, 03:33:40 pm
Thanks, where does the screen buffer fit into that routine?
(By the way, if you'd be willing to share any more routines, I'd love it :D)
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 03:36:27 pm
Ah, let me check which version of that routine I uploaded. One used a pointer stored in a temporary RAM address and the other just used plotSScreen. I forgot Scout's tool converted to decimal, not hex. Oh, and I'm working on more ideas :D
Title: Re: Needed Routines
Post by: SirCmpwn on January 29, 2011, 03:38:02 pm
The one using plotSScreen would be nice.
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 03:39:20 pm
Okay, no problem. The modified version was made just to draw to other buffers.
Title: Re: Needed Routines
Post by: SirCmpwn on January 29, 2011, 03:40:54 pm
I guess that the ideal routine would accept a register as a pointer to a buffer, but that's probably too much ;)
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 03:43:50 pm
Hmm, It uses temp RAM, too, which might be a problem (fixable) in Knight OS, but yes, I could add a snippet of code to let HL be a pointer to the buffer. HL would immediately be copied to temp RAM, but it would be much easier to work with, you're right.
Title: Re: Needed Routines
Post by: SirCmpwn on January 29, 2011, 03:45:57 pm
How much temp RAM?  The structure of KnightOS makes it difficult to use RAM.  I might be willing to set aside a small amount just for this routine, though.
Title: Re: Needed Routines
Post by: Xeda112358 on January 29, 2011, 03:54:10 pm
Spoiler For Spoiler:
;HL is now the pointer to the buffer
;
;PatternRAM is 24 bytes of RAM used to draw the patterns used
;BufferPointer is 2 bytes to store the pointer for the buffer
;Both are obviously short term storage and can be reused immediately
;
ld (BufferPointer),hl
push af
push bc
ld b,0
push bc
push de
push de
ld hl,PatternRAM
ld (hl),0
ld de,PatternRAM+1
ld bc,24
ldir
pop de
ld a,e
rrca
rrca
rrca
and 15
ld h,0
ld l,a
ld a,e
and 7
push af
ld b,a
ld a,255
jr z,$04
srl a
djnz $FC
ld de,PatternRAM
add hl,de
ld (hl),a
pop af
cpl
and 7
inc a
ld b,a
pop af
sub b
bit 7,a
jr z,$0F
and 7
or a
jr z,$06
ld b,a
xor a
scf
rra
djnz $FC
and (hl)
ld (hl),a
jr $15
inc hl
cp 8
jr c, $06
ld (hl),255
sub 8
jr $F5
or a
jr z,$06
ld b,a
xor a
scf
rra
djnz $FC
ld (hl),a
pop hl
add hl,hl
add hl,hl
ld b,h
ld c,l
add hl,hl
add hl,bc
ld bc,(BufferPointer)
or (hl)
add a,h
add hl,bc
push hl
push de
ld hl,PatternRAM-1
ld de,PatternRAM+11
inc de
inc hl
ld a,(hl)
or a
jr z,$FA
srl a
xor (hl)
ld (de),a
inc hl
ld a,(hl)
dec hl
or a
jr nz,$09
ld a,(hl)
srl a
add a,(hl)
cpl
and (hl)
ld (de),a
jr $11
inc de
inc hl
ld a,l
cp 248
jr z,$04
ld a,(hl)
or a
jr nz,$F5
dec de
dec hl
ld a,(hl)
add a,a
xor (hl)
ld (de),a
pop de
pop hl
pop bc
pop af
or a
jr nz,$11
ld c,12
ld de,PatternRAM
ld a,(de)
cpl
and (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
djnz $F0
ret
dec a
jr nz,$10
ld c,12
ld de,PatternRAM
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
ret
dec a
jr nz,$10
ld c,12
ld de,PatternRAM
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
ret
dec a
jr nz,$24
ld c,12
ld de,PatternRAM
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$0F
ld c,12
ld de,PatternRAM+12
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
inc b
jr $DC
dec a
jr nz,$26
ld c,12
ld de,PatternRAM
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
dec b
ret z
dec b
jr z,$10
ld c,12
ld de,PatternRAM+12
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
djnz $F0
inc b
jr $DA
dec a
jr nz,$24
ld c,12
ld de,PatternRAM
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$0F
ld c,12
ld de,PatternRAM+12
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $F1
inc b
jr $DC
dec a
jr nz,$34
ld c,12
ld de,PatternRAM
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$1F
push hl
ld c,12
ld de,PatternRAM
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
pop hl
ld c,12
ld de,PatternRAM+12
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $E1
inc b
jr $CC
dec a
jr nz,$33
ld c,12
ld de,PatternRAM
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
dec b
ret z
dec b
jr z,$1E
push hl
ld c,12
ld de,PatternRAM
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
pop hl
ld c,12
ld de,PatternRAM+12
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $E2
inc b
jr $CD
dec a
jr nz,$34
ld c,12
ld de,PatternRAM
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
dec b
ret z
dec b
jr z,$1E
push hl
ld c,12
ld de,PatternRAM
ld a,(de)
or (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
pop hl
ld c,12
ld de,PatternRAM+12
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
djnz $E2
inc b
jr $CC
dec a
jr nz,$35
ld c,12
ld de,PatternRAM
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
dec b
ret z
dec b
jr z,$1F
push hl
ld c,12
ld de,PatternRAM
ld a,(de)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F8
pop hl
ld c,12
ld de,PatternRAM+12
ld a,(de)
and (hl)
xor (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
djnz $E1
inc b
jr $CB
dec a
jr nz,$37
dec b
ret z
di
push hl
exx
ld bc,12
pop hl
add hl,bc
exx
ld c,12
ld de,PatternRAM
push de
exx
pop de
exx
ld a,(de)
cpl
and (hl)
exx
ld b,a
ld a,(de)
and (hl)
or b
inc de
inc hl
exx
ld (hl),a
inc de
inc hl
dec c
jr nz,$EF
djnz $E4
ld c,12
ld de,PatternRAM
ld a,(de)
cpl
and (hl)
ld (hl),a
inc de
inc hl
dec c
jr nz,$F7
ei
ret
dec a
jr nz,$40
di
push bc
ld de,12
add hl,de
djnz $FD
dec hl
push hl
exx
ld de,65524
pop hl
add hl,de
exx
pop bc
dec b
ret z
ld c,12
ld de,PatternRAM+11
push de
exx
pop de
exx
ld a,(de)
cpl
and (hl)
exx
ld b,a
ld a,(de)
and (hl)
or b
dec de
dec hl
exx
ld (hl),a
dec de
dec hl
dec c
jr nz,$EF
djnz $E4
ld c,12
ld de,PatternRAM+11
ld a,(de)
cpl
and (hl)
ld (hl),a
dec de
dec hl
dec c
jr nz,$F7
ei
ret
dec a
jr nz,$03
nop
nop
nop
nop
ret
Title: Re: Needed Routines
Post by: DJ Omnimaga on January 29, 2011, 04:02:31 pm
Sorry to hear about parents Sir. I'm glad you can still manage to get online though and that your projects are intact.
Title: Re: Needed Routines
Post by: SirCmpwn on January 29, 2011, 05:04:51 pm
I think I can spare 26 bytes.
Sorry to hear about parents Sir. I'm glad you can still manage to get online though and that your projects are intact.
The projects are fine, but there will be several days between visits here.
Title: Re: Needed Routines
Post by: DJ Omnimaga on January 31, 2011, 01:45:35 pm
Ok I see. I hope they won't get spaced by like a month or two eventually X.x
Title: Re: Needed Routines
Post by: SirCmpwn on January 31, 2011, 09:13:41 pm
I've actually been quite lucky, three days in a row :D
Title: Re: Needed Routines
Post by: jnesselr on January 31, 2011, 09:17:53 pm
Can we put Xeda's code in a spoiler or something? It's long.

And I'm glad you can get some time to join us SirCmpwn.
Title: Re: Needed Routines
Post by: Xeda112358 on January 31, 2011, 09:20:10 pm
Sure, I guess that is okay :P