Is the copy-from-archive thing there too?
Nope, I'm working those features into the beta I will be releasing in the near future of the beta after that. I've got it working for BASIC programs but haven't implemented it for all the various flavors of ASM programs yet.
Sorry I didn't work on the cursor sprite thing today. I was very busy. I can probably finish it tomorrow night.
Cool, thanks for the update. Take your time; whenever you've got it, I'll pop it into its slot.
As promised I finished debugging and it looks good. It's up to you, Kerm, to fit this into DCS, but I can help and explain any part of my code as needed. Also, there may have been a few optimizations (or more than a few...I've been busy) that have slipped by, but I'm confident that it does the job.

It comes in under the 700-800 byte range at 646 bytes with the stupid MOS header and the masked sprite routine. The size of the program without them is about 100 bytes less (which is what it will take up in DCS) w00t!

Before I give you the code, here is a screenie:


Pretty sweet, right?

Well, to sum up what it does:

-x2 zoom for easier sprite making
-Toggles between 3 states with 2nd (white opaque, black opaque, and white transluscent)
-Dispays white opaque as white, black opaque as black, and white transluscent as grey (that's right, greyscale!)
-User presses enter to return from the routine
-Outputs a 16 byte masked sprite (with mask first) at AppBackUpScreen
-Only uses 20 bytes of AppBackUpScreen (Your welcome, Kerm)

And without further ado:


Code:
;Author: Patrick Stetter
;Program: DCS Mouse Creator
;Date 7/9/06

#include   "ti83plus.inc"
#include   "mirage.inc"

MouseMask   .equ   AppBackUpScreen
Mouse      .equ   AppBackUpScreen+8
X         .equ   AppBackUpScreen+16
Y         .equ   AppBackUpScreen+17
GStimer      .equ   AppBackUpScreen+18
Blinktmr   .equ   AppBackUpScreen+19

   .org   $9d93
   .db   $BB,$6D
   ret
   .db   1
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   %00000000,%00000000
   .db   "Mouse Creator",0
   
   
   xor a
   ld (X),a
   ld (Y),a
   ld (GStimer),a
   ld hl,MouseMask
   ld (hl),0
   push hl
   pop de
   inc de
   ld bc,15
   ldir
   call displayOuterEdge
   
mainLoop:
   ld hl,GStimer
   inc (hl)
   inc hl
   inc (hl)
   call displayGrid
   call displayCursor
   call fastcopy
   bcall(_getcsc)
   cp skup
   jr nz,notMoveUp
   ld a,(Y)
   or a
   jr z,mainLoop
   dec a
   ld b,1
   jp CursorMove
notMoveUp:
   cp skdown
   jr nz,notMoveDown
   ld a,(Y)
   cp 7
   jr z,mainLoop
   inc a
   ld b,1
   jp CursorMove
notMoveDown:
   cp skright
   jr nz,notMoveRight
   ld a,(X)
   cp 7
   jr z,mainLoop
   inc a
   ld b,0
   jp CursorMove
notMoveRight:
   cp skleft
   jr nz,notMoveLeft
   ld a,(X)
   or a
   jr z,mainLoop
   dec a
   ld b,0
   jp CursorMove
notMoveLeft:
   cp sk2nd
   jp nz,notChangePixel
   
;Calls
   
   
modPixelStatus:
;White Opaque, Black Opaque, White Trans
;If White Opaque:
;-Change Mouse

;If Black Opaque
;-Change Mouse
;-Change MouseMask

;If White Trans
;-Change MouseMask
   ld a,(Y)
   ld hl,Mouse
   ld e,a
   ld d,0
   add hl,de
   ld a,(X)
   ld b,a
   ld a,7
   sub b
   inc a
   ld b,a
   ld a,(hl)
getPixelLoop:
   srl a
   djnz getPixelLoop
   jr c,pixelIsBlack
   ld a,(Y)
   ld hl,MouseMask
   ld e,a
   ;d = 0
   add hl,de
   ld a,(X)
   ld b,a
   ld a,7
   sub b
   inc a
   ld b,a
   ld a,(hl)
getPixelLoop2:
   srl a
   djnz getPixelLoop2
   jr c,pixelIsTransparent
;White Opaque
   ld a,(Y)
   ld hl,Mouse
   ld e,a
   ;d = 0
   add hl,de
   ld a,(X)
   or a
   jr z,skippixelOpaqueLoop
   ld b,a
   ld a,%10000000
pixelOpaqueLoop:
   srl a
   djnz pixelOpaqueLoop
skippixelOpaqueLoopBack:
   xor (hl)
   ld (hl),a
   jp mainLoop
skippixelOpaqueLoop:
   ld a,%10000000
   jr skippixelOpaqueLoopBack
pixelIsBlack:
;Black Opaque
   ld a,(X)
   or a
   jr z,skippixelBlackLoop
   ld b,a
   ld a,%10000000
pixelBlackLoop:
   srl a
   djnz pixelBlackLoop
skippixelBlackLoopBack:
   xor (hl)
   ld (hl),a
   ld a,(Y)
   ld hl,MouseMask
   ld e,a
   ;d = 0
   add hl,de
   ld a,(X)
   or a
   jr z,skippixelBlackLoop2
   ld b,a
   ld a,%10000000
pixelBlackLoop2:
   srl a
   djnz pixelBlackLoop2
skippixelBlackLoop2Back:
   xor (hl)
   ld (hl),a
   jp mainLoop
skippixelBlackLoop:
   ld a,%10000000
   jr skippixelBlackLoopBack
skippixelBlackLoop2:
   ld a,%10000000
   jr skippixelBlackLoop2Back
pixelIsTransparent:
   ld a,(X)
   or a
   jr z,skippixelTransLoop
   ld b,a
   ld a,%10000000
pixelTransLoop:
   srl a
   djnz pixelTransLoop
skippixelTransLoopBack:
   xor (hl)
   ld (hl),a
   jp mainLoop   
skippixelTransLoop:
   ld a,%10000000
   jr skippixelTransLoopBack
   
   
notChangePixel:
   cp skenter
   ret z
   jp mainLoop
   
   
displayOuterEdge:
;displays 4 black lines surrounding our grid.
   ld hl,39*256+23   ;(23,39)   (23,56)
   push hl         ;-------------
   ld d,56         ;|           |
   ld e,l         ;|           |
   push de         ;|           |
   ld a,1         ;|           |
   call fastline   ;-------------
   pop de         ;(40,39)   (40,56)
   ld hl,56*256+40
   push hl
   ld a,1
   call fastline   ;doesn't say what's destroyed.  Assume all.
   pop hl
   ld de,39*256+40
   push de
   ld a,1
   call fastline
   pop de
   pop hl
   ld a,1
   call fastline
   ret
   
   
displayGrid:
;Displays the current state of pixels
   ld b,8
   ld hl,Mouse-1
   ld e,22
GridOuterLoop:
   push bc
   inc hl
   ld a,38            ;2 less than what it will display first at
   inc e
   inc e
   ld b,%10000000
GridInnerLoop:
   push bc
   push hl
   push de
   push af
   ld a,(hl)
   and b
   jr z,GridDisplayBlank
GridBlack:
   pop af
   pop de
   inc a
   inc a
   push de
   push af
   ld l,e
   ld b,2
   ld ix,Block
   call iPutSpriteMask
   jr DisplayGridJoin
GridDisplayBlank:
   ld de,8
   or a
   sbc hl,de
   ld a,(hl)
   and b
   jr nz,GridDisplayGrey
GridDisplayBlank2:
   pop af
   pop de
   inc a
   inc a
   push de
   push af
   ld l,e
   ld b,2
   ld ix,Blank
   call iPutSpriteMask
DisplayGridJoin:
   pop af
   pop de
   pop hl
   pop bc
   srl b
   jr nz,GridInnerLoop
   pop bc
   djnz GridOuterLoop
   ret
GridDisplayGrey:
   ld a,(GStimer)
   srl a
   jr c,GridDisplayBlank2
   jr GridBlack
Block:
   .db %00111111
   .db %00111111
Blank:
   .db %00111111
   .db %00111111
Dummy:
   .db 0,0,0,0,      ;4 bytes of crap
BlockMask:
   .db %11000000
   .db %11000000
BlankMask:
   .db %00000000
   .db %00000000
   
   
displayCursor:
;flashes cursor at X,Y
   ld a,(Blinktmr)
   cp 20
   jr nc,CursorBlinkOff
CursorOn:
   ld ix,Block
displayCursorBack:
   ld a,(Y)
   add a,a
   add a,24
   ld l,a
   ld a,(X)
   add a,a
   add a,40
   ld b,2
   call iPutSpriteMask
   ret
CursorBlinkOff:
   cp 40
   call nc,resetBlinktmr
CursorOff:
   ld ix,Blank
   jr displayCursorBack
resetBlinktmr:
   xor a
   ld (Blinktmr),a
   ret
   
   
CursorMove:
;Makes it blank at last spot
;Makes it solid at next spot
;b = 0 lr, b = 1 ud
   push af
   push bc
   xor a
   ld (Blinktmr),a
   call CursorOff
   pop bc
   ld a,b
   or a
   jr z,CursorMoveLeftRight
   pop af
   ld (Y),a
   call CursorOn
   jp mainLoop
CursorMoveLeftRight:
   pop af
   ld (X),a
   call CursorOn
   jp mainLoop
   

   
   
   
; Ion Extended Routines by Joe Wingbermuehle and Kerm Martian

;Inputs: Exactly the same as iPutSprite, but with 16 bytes at ix.

iPutSpriteMask:
   ld   e,l
   ld   h,$00
   ld   d,h
   add   hl,de
   add   hl,de
   add   hl,hl
   add   hl,hl
   ld   e,a
   and   $07
   ld   c,a
   srl   e
   srl   e
   srl   e
   add   hl,de
   ld   de,gbuf
   add   hl,de
iPutSpriteLoop1Mask:
   ld   d,(ix)
   ld   e,$FF
   ld   a,c
   or   a
   jr   z,iPutSpriteSkip1Mask
iPutSpriteLoop2Mask:
   srl   d
   rr   e
   set 7,d
   dec   a
   jr   nz,iPutSpriteLoop2Mask
iPutSpriteSkip1Mask:
   ld   a,(hl)
   and   d
   ld   (hl),a
   inc   hl
   ld   a,(hl)
   and   e
   ld   (hl),a
   push ix
   dec hl
   ld de,8
   add ix,de
iPutSpriteLoop1AND:
   ld   d,(ix)
   ld   e,$00
   ld   a,c
   or   a
   jr   z,iPutSpriteSkip1AND
iPutSpriteLoop2AND:
   srl   d
   rr   e
   dec   a
   jr   nz,iPutSpriteLoop2AND
iPutSpriteSkip1AND:
   ld   a,(hl)
   xor   d
   ld   (hl),a
   inc   hl
   ld   a,(hl)
   xor   e
   ld   (hl),a

   pop ix
   ld   de,$0B
   add   hl,de
   inc   ix
   djnz   iPutSpriteLoop1Mask
   ret

   
   
.end
end


Kerm, if you would prefer to have me ftp the code or send it to you some other way, just say so.

Comments?
When is the next BETA going to be out? Just curious.
Confused ...Hello...Kerm...Do you approve of it? Smile
Didn't you see my response in SAX? I think it's uber1337. Nicely done, and I'm very impressed. i'll be integrating it tomorrow probably.
Oh, I thought you were going to make a post in the topic, and just forgot.

Do I get my name in the credits or something, now? That'd be sweet Cool
lol, if I get my name in as a beta tester, I would hope you would get yours in as an assistant programmer... Smile
Of course you get your name in the credits! Smile

----------------------
Watch the alpha cursor closely at the beginning and end of this clip:

this is coming along nicely. Still planning to have done be New Years Eve, or has that date been pushed up a little?
Still planning for New Years' Eve to save disappointment if I can't finish early. Here's a new screenie for everyone:

KermMartian wrote:
Still planning for New Years' Eve to save disappointment if I can't finish early. Here's a new screenie for everyone:



Custom mouse! Very Happy
Indeedy. I have posted a separate topic about it to try to get this part of the topic back ontopic. Smile (Did I say topic enough in that sentence? Topic topic topic I wonder topic what the topic of the topic might topic be). Razz

Next I will be releasing a beta, so that should come today or early tomorrow.
Well, I've been meaning to do this for a while, but I finally got around to respacing the icons on the desktop, the work of about 4 minutes tops. Check it out below; what do you think, better or worse?

KermMartian wrote:
Well, I've been meaning to do this for a while, but I finally got around to respacing the icons on the desktop, the work of about 4 minutes tops. Check it out below; what do you think, better or worse?



Interesting, but aren't those icons bigger? If so, maybe include and option to change the icons per page between 6 and 12.
No, those are still start 16x16 icons. Fitting 12 would not be pratical unless I create a list view, since 8x8 icons are not part of the current paradigm.
KermMartian wrote:
No, those are still start 16x16 icons. Fitting 12 would not be pratical unless I create a list view, since 8x8 icons are not part of the current paradigm.


Ok, hmmm... I seem to remember something about 12 icons per page...
Shock That I had done it, or that I planned to do it? At no point in time have I planned a 12-item view, and I certainly never built such a system...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3, 4, 5, 6  Next
» View previous topic :: View next topic  
Page 5 of 6
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement