merthsoft wrote:
What's in "Useful_Routines_.inc"?
You can't just include every useful routine and expect the assembler to remove the ones you don't use, if that's what you're doing. Things like the DCS include file, even though they reference hundreds of helper routines, don't actually include those routines; Doors CS itself has them.
It can't be that, its just ~30 bytes.
aeTIos wrote:
It can't be that, its just ~30 bytes.
Are you sure? What does it contain? Also, do you have any extra .org statements?
I'm sure, this is the file:

Code:


KgrpArrows    .equ   %11111110
KgrpFunc    .equ   %10111111
KgrpEnt    .equ   %11111101
KgrpNeg    .equ   %11111011
KgrpDot    .equ   %11110111
KgrpZero    .equ   %11101111
KgrpOn       .equ   %11011111


draw_to_buff:
   set   bufferOnly, (iy + plotFlag3)
   set   textWrite, (iy + sGrFlags)
   ret

diag_off:
   B_CALL(_RunIndicOff)
   res   donePrgm, (iy + kbdFlags)
   ret

Set_15_mHz:
   ld   a, 1
   out   (20h), a
   ret

Set_6_mHz:
   ld   a, 0
   out   (20h), a
   ret

iputspritemask:
;inputs: A:X L:Y B:Height sprite
; IX: b-byte mask IX+B:b-byte sprite
;Output: Sprite copied to graph buffer
   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+0)
   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+0)
   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

That can't be it imo.


Edit: also, even if I comment it out it is still 39.5 kB\
Edit2: Problem fixed with a ret at the end.
Oh, I think I know an additional problem. Always always end your main program with:


Code:
.end
END
Is that a brass command?
aeTIos wrote:
Is that a brass command?
TASM started it, Brass understands it too. Those last two lines are both necessary to punch TASM in the face hard enough that it understands the file is actually ending (and not crash) whereas Brass recognizes both of them separately and will also get the message. I think I asked this about ten times already and forgot the answer; you're using the DCS SDK, right?
Yes Smile I do.
Off-topic, why does TASM need both of them?
aeTIos, excellent. So anyway, is your program working properly now? Keep those ASM questions coming!

Deep Thought: TASM ignores the very last line in a file, so proper form is to end a file with a blank line. However, that's relatively hard to remember to do, or to spot if you've forgotten it. Therefore, the ".end" is for TASM to actually read, and the "END" is to form an extra line for TASM to ignore, but which you'll remember to add because you knew you had to have two lines with ends on them.
Uhm, my ASM is on hold until further notice cuz I participate in the Axe programming contest on Omnimaga. if I get any questions 'bout ASM, I'll ask them, of course.
aeTIos wrote:
Uhm, my ASM is on hold until further notice cuz I participate in the Axe programming contest on Omnimaga. if I get any questions 'bout ASM, I'll ask them, of course.
Sounds good. I'll take the high road and wish you luck in this contest, about which I had not heard.
The announcement is here: http://ourl.ca/11030
thanks for the 'good luck', I'll need it!
Oh my, it's already been a whole year since I last posted here Shock
Also, I have some issues with my code and I can't figure out what's causing this.
My code: [mimas code]

Code:
ORG userMem-2
DB $BB,$6D
[standard dcs header here]
start:
ld a,1
ld (safeRAM1),a
ld a,9
ld (safeRAM1+1),a
ld a,34
ld (safeRAM1+2),a
loop:
ld ix,ball
ld a,(saferam1+1)
ld l,a
ld a,(saferam1)
ld b,4
call isprite
ld ix, pad
ld a,(saferam1+2)
ld l,54
ld b, 3
call isprite
call ifastcopy
;; I think somewhere in the following part is teh error
ld a,$FE
out ($01),a
in a,($01)
bit 1,a
jp nz,aa1
ld a, (saferam1+2)
cp 0
jp z, aa1
dec a
aa1:
ld a,$FE
out ($01),a
in a,($01)
bit 2,a
jp nz,aa2
ld a,(saferam1+2)
cp 88
jp z,aa2
inc a
aa2:
ld a,$FC
out ($01),a
in a,($01)
bit 6,a
ret z
jp loop

;;ball and pad are both just sprites which are displayed nice.

Anyone see any error here?
Please be more specific. "issue" means that we have to spend a long time staring at your code, while "blah blah happens when dit dah should happen instead" saves everyone time.
Oh sorry. My issue is, the direct input for [clear] works nicely, while the input for [left] and [right] doesnt work.
Edit: so I guess the error is somewhere in my code after the checking for left/right, where I check if the x position of the paddle is between 0 and 88.
try adding two nops inbetween each of your in and outs. the keyboard requires a small delay between reading the inputs or you get garbage data
I use Getkey and GetCSC. I prefer it because it is cleaner code. example:

Code:

bcall getcsc
cp skLeft
JR Z, Left
... etc
hmm. Will try that, geek.
[tries]
still doesnt work :\
direct input will be better to learn in the long run for if he learns interupts and stuff. as they break with them.
  
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, 7, 8  Next
» View previous topic :: View next topic  
Page 7 of 8
» 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