err I mean how would I set up pointers and such to segments in it i forget.
geekboy1011 wrote:
err I mean how would I set up pointers and such to segments in it i forget.
I think you're asking how to name addresses inside safeRAM areas, correct? I'm trying to find the post where I explained it, which I thought was in either aeTIos' or Calcman's ASM topic, but I can't find it either place. Sad
It's ok I remembered I had cadan's source code which has a nice LARGE file defining a lot of stuff I just referenced that ^_^

(this is the file http://pastebin.com/quTCbiK0 )
Wow, deep from within the land of five-digits posts, here's something that might be relevant:

http://cemetech.net/forum/viewtopic.php?p=14064#14064
Scrap this misplaced comment screwed it all up.........fail



Time to bump again I'm trying to figure out why this is not copying the id of the sending calculator to the ID field as of right now it just leaves it with a bunch of zeros. Am I missing something on how calcnet works? or am I just doing it wrong code wise :/



Code:
; Program Name:  Debug1
; Author:  geekboy1011   
; Version: debug1
; Date:  meh
; Written for Doors CS 7.0 and higher (http://dcs.cemetech.net)

.nolist
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org progstart
   .db $BB,$6D
Init:
   xor d
   ret
   jr Start
   
   .dw Description         ;or .dw $0000 if you don't have a description
   .db $07,$00         ;always this string
   .dw Icon         ;or .dw $0000 if you don't have an icon
   .dw 0000            ;usually .dw $0000 if you don't have or know what an ALE is
Defines:
            ;cn2 buffers
            
            ;$86EC    2 bytes do not use   not for userland user
            myid         = $86EE           ;       5    Current calc's ID (do not modify)
            sendrid   = $86F3    7    5       ;       Receive buffer sender ID   ;person sending data to the calc
            recvbufs  = $86F8    ;       12    2    Receive buffer size word
            rcvbuf      = $86FA          ;       14    256    Receive buffer
            rvcid         = $87FA                   ;       270    5    Send buffer receiver ID  ; away from calc
            sendbufS = $87FF    ;       275    2    Send buffer size word
            sendbuf  = $8801    ;      277    256    Send buffer
            ;$8901    533    14   not for userland use


Start:                             ;main routines
   call cn2_setup
finderStart:
   ld a,(sendbufs+1)
   bit  7,a
   jp nz,Finderstart
   ld bc,5
   ld hl,broadcast
   ld de,rvcid
   ldir
   ld hl,$8001
   ld (sendbufS),hl\
   halt
GetId:               ;wait for id to be recieved
   ld a,(recvbufs+1)
   bit  7,a
   jp nz,PFound
   halt
   jp Finderstart
PFound:
   ld bc,5
   ld de,id
   ld hl,sendrid
   ldir
   bcall(_clrlcdfull)
   jp $

   


   
   
   
   
   
   
   
   
   
   
.db "broadcast"   
broadcast:
 .db %00000000,%00000000,%00000000,%00000000,%00000000
.db "id"
 Id:
 .db %00000000,%00000000,%00000000,%00000000,%00000000
buffer: ;252 bytes
 .db %00111000,%00000000,%00000000,%00000011,%11100000,%00111111
 .db %01111100,%00011100,%00000000,%00000111,%11110000,%00111111
 .db %01111100,%00111110,%00000000,%00000111,%11110000,%00111111
 .db %01111100,%00111110,%00000000,%00000111,%11110000,%00011111
 .db %01111100,%00111110,%00000000,%00000011,%11100000,%00001111
 .db %00111011,%10011100,%00000000,%00011001,%11000011,%10000011
 .db %00000111,%11000000,%00110000,%00111100,%00000111,%11100011
 .db %00000111,%11000000,%01111000,%00111100,%00001111,%11110011
 .db %00111111,%11000000,%01111000,%01111100,%00001111,%11111011
 .db %01111111,%10000000,%00110000,%11111110,%00001111,%11111011
 .db %01111100,%00000000,%00000000,%11111110,%00000111,%11111011
 .db %01111100,%00000000,%00000000,%11111110,%00000011,%11110011
 .db %00111000,%01110000,%00000000,%01111100,%00000001,%11100011
 .db %00000000,%11111000,%00111000,%00111000,%00000011,%11110011
 .db %00000000,%11111000,%01111100,%00000111,%00000111,%11111011
 .db %00000000,%11111000,%11111110,%00001111,%10000111,%11111011
 .db %00000000,%00000000,%11111110,%00011111,%11000111,%11111011
 .db %00000000,%00000000,%11111110,%00011111,%11000011,%11110011
 .db %00000000,%00000000,%01111100,%00011111,%11000001,%11101111
 .db %00001110,%00000000,%00111000,%00001111,%10000000,%00011111
 .db %00011111,%00000000,%00000000,%00000111,%00000000,%00111111
 .db %00111111,%10000000,%00000000,%00000000,%00000000,%00111111
 .db %00111111,%10000000,%00000000,%00000000,%00000000,%00111111
 .db %00111111,%10000000,%00000000,%00000011,%10000000,%00011111
 .db %00011111,%00000000,%00111000,%00000111,%11000000,%00001111
 .db %00001110,%00000000,%01111100,%00001111,%11100000,%00000011
 .db %00000000,%00000000,%11111110,%00001111,%11100000,%00000011
 .db %00000000,%00000000,%11111110,%00001111,%11100000,%00001111
 .db %00000000,%00000000,%11111110,%00000111,%11000000,%00011111
 .db %00000000,%00000000,%01111100,%00000011,%10110111,%00111111
 .db %00000000,%00000000,%00111000,%00000000,%01111111,%10111111
 .db %00000000,%00000000,%00000000,%00000000,%01111111,%11111111
 .db %00000000,%00000000,%00011100,%00000000,%00111111,%11011111
 .db %00000000,%00000000,%00111110,%00000000,%00011111,%11001111
 .db %01110000,%00000000,%01111111,%00000000,%00001111,%10000011
 .db %11111000,%00000000,%01111111,%00000000,%00000111,%00000011
 .db %11111100,%00000000,%01111111,%00000000,%00000000,%00000011
 .db %11111100,%00000000,%00111110,%00000000,%00000000,%00000011
 .db %11111100,%00000000,%00011100,%00000001,%11000000,%00000011
 .db %11111000,%00000000,%00000000,%00000011,%11100000,%00000011
 .db %01110000,%00000000,%00000000,%00000111,%11110000,%00000011
 .db %00000000,%00000000,%00000000,%00000111,%11110000,%00000011
Temp:  ; 262 byte buffer for ldiring into send field
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000,%00000000
 .db %00000000,%00000000,%00000000,%00000000,%00000000


   

   
   
   ;ret
Description:
   .db "Debug1",0   ;can be omitted if .dw Description is .dw 0000 above
Icon:            ;a 16x16 icon (can be omitted if .dw Icon is .dw 0000 above)
   .db %11111111,%11111000
   .db %10000000,%00001100
   .db %10111100,%00001010
   .db %10010010,%00001111
   .db %10010010,%01010001
   .db %10010010,%10101001
   .db %10111100,%01010101
   .db %10000000,%00000001
   .db %10101010,%10101001
   .db %10010101,%01010101
   .db %10101010,%10101001
   .db %10000000,%00000001
   .db %10010101,%01010101
   .db %10101010,%10101001
   .db %10000000,%00000001
   .db %11111111,%11111111

   
   



The largebuffers are not used for anything...yet
Please Pastebin something that large, and get rid of that massive chunk of whitespace; it's distracting me. Very Happy Sorry to be so picayune. Smile
lol its OK I was being lazy when I put that up or I would have gotten rid of every thing irrelevant as well xD

and I like the white space....hides the ugly .db statements in npp Razz
Hey look a less cluttered post any way

http://pastebin.com/f3fvGHXd

I'm wondering if there is a better way to load the broadcast frame in this. every thing is commented ^_^

EDIT: last paste was horridly formatted...this one is a bit better X.x
Oh god, you use spaces instead of tabs. Fie upon thee! Anyway, can you explain what this code is supposed to do? The first thing that jumps out at me is that it sends a one-byte broadcast frame without specifying what the byte is that it's sending.
There is nothing in that 1 Byte as when I wrote this code was not sure if I could send a empty no byte frame

All this code is intended for is to send a broadcast frame out while looking for another calculator doing the same thing

When it finds a companion calculator its address which is what occurs in PFound. just did not copy that over into the pastebin.
Fair enough. And the minimum is one byte; the maximum is 255 bytes in a single frame, for now. I notice that you don't seem to clear out the receive buffer if an incoming frame is found. Is that intentional or no?
In this version it was basically a "lets make calcnet work and be happy" exercise. PFound had some other code in it to show something on the screen and other stuff it was really only for single transmission testing.

ultimitaly my question is though is there a more optimized way to load addresses or is a ldir it?
Nope, ldir is the best way to do it. You can get a little smaller or a little faster, but ldir is a good balance.
*Geekboy pokes runer112 for help with greyscale sprites and stuff yeah!
geekboy1011 wrote:
*Geekboy pokes runer112 for help with greyscale sprites and stuff yeah!
You can poke me too! What do you need, exactly? Concepts? Code?
well runner was so kind to supply me with a 4 level greyscale routine from axe. now me still learning.being stupid. I need some sprite routines and well I really only need 1 and that is a 4 level greyscale masked sprite routine. I have a 3 level one currently ,again from axe, but a 4 level one is really needed for what I have in mind for the project I am working on.

so yeah if you can help...somehow...please do ^_^
after some thinking and more planning turns out all i need is a simple(...right...) 8x8 unaligned masked sprite routine. and the ability to change the buffer it writes to (out of all the routines i have seen this should not be an issue though so ^_^

umm so any one have one. i can barely comprehend alinged sprite routines X.x (thank you for the minimal understanding runer Razz)
Apologies in advance for lack of documentation. It's just like iPutSprite, except the sprite must be twice as many bytes. First b bytes of mask, then b bytes of sprite. Black is transparent, white is opaque.


Code:

imPutSpriteMask:
   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
imPutSpriteLoop1Mask:
   ld   d,(ix)
   ld   e,$FF
   ld   a,c
   or   a
   jr   z,imPutSpriteSkip1Mask
imPutSpriteLoop2Mask:
   srl   d
   rr   e
   set 7,d
   dec   a
   jr   nz,imPutSpriteLoop2Mask
imPutSpriteSkip1Mask:
   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
imPutSpriteLoop1AND:
   ld   d,(ix)
   ld   e,$00
   ld   a,c
   or   a
   jr   z,imPutSpriteSkip1AND
imPutSpriteLoop2AND:
   srl   d
   rr   e
   dec   a
   jr   nz,imPutSpriteLoop2AND
imPutSpriteSkip1AND:
   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   imPutSpriteLoop1Mask
   ret
So its mask then sprite?
geekboy1011 wrote:
So its mask then sprite?
Nice reading skills.
KermMartian wrote:
Apologies in advance for lack of documentation. It's just like iPutSprite, except the sprite must be twice as many bytes. First b bytes of mask, then b bytes of sprite. Black is transparent, white is opaque.
  
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
Page 3 of 3
» 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