My list of things to do? -Bump this months post amount to over 10 000 -Figure out a bunch of algorithms in assembly for math and drawing -add more drawing functions to BatLib -Add a menu system to BatLib (so that you can use PopUp in BASIC... inspired by my 89t) -Boost UTI up -Answer program requests -Finish my french and math homework -Maintain a 3.5 GPA at least -remember to eat on time -Do my laundry -Clean my room -Go to club meetings -Learn Axe -Work on BASIC ReCode -Go to classe And probably other random things I am missing
Hey all you BASIC programmers out there (and occasional Axer)! I have something that YOU might like. You know those amazing little creatures? Those hex opcodes? Well guess what?! I've got em
Here is a small PDF that I have been working on that has a mild sample of about 40 hex opcodes. If anybody has cool suggestions, lemme know and I'll see what I can conjure up!
Yeah... Originally it was called FontEdit, then I got to command 13 which was for tilemaps and I decided to rename it SpriteLib. Then it got to about command 42 before I changed it to BatLib. It is still centered around graphics and math, but the math part is only starting to make its presence known.
I haven't gotten to say hello! ... Hi! And sorry if it was over on UTI or TIBD... I try to answer questions there :'( But, um, hi! It is quite active here, so you will get stuff answered pretty easily.
"peanuts" is a weird word, so I will refrain from showing off my peanuts.
;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
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.
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
So, again, I have a neat/random program that I want to add to BatLib, now. It was an idea from TIBD for me to make an opcode to copy programs to a string and it was a whole separate idea for me to copy a string to a program. However, this time, the request was to make it copy programs out of archive! So, I got my brain together, planned it out, and now I have this wicked and powerful program... in 123 bytes.
So here are some cool points to keep in mind: -This is not limited to copying programs -It can copy from archive or RAM -It is not limited to copying to programs
The uses of this? : -Copy a picture to an appvar or program to make custom pictures -Copy programs from archive for temp use in games -Storing things to strings to play with
I hope this proves useful to people! Oh, and as always, opcode included