Author Topic: bm_delete()... what's wrong with it?  (Read 58 times)

nodtveidt

  • Guest
bm_delete()... what's wrong with it?
« on: March 28, 2014, 11:05:27 AM »
Supposedly, there is an error with the bm_delete() library function. I don't know enough about the underlying code to figure out where the issue is, and I have not used it yet so I don't know its symptoms.

Code: [Select]
lib2_bm_delete:
__stw <_ax
  jsr lib2_bm_open
  bcs .out
  stw $8006,<_bx ; ptr to end
  stw <_si,<_di ; setup currptr as dest
  stw <_dx,<_si ; setup nextptr as src
  subw <_dx,<_bx ; #bytes = end-next + 2
  addw #2,<_bx
  subw <_cx,$8006 ; adjust ptr to end
  lda <_bh
  ldx <_bl
  jsr _memcpy.3
  jsr lib2_bm_disable
  stz _bm_error
  clx
  cla
  clc
.out:   rts

EDIT: an old thread on the ME forum sheds some light on the issue:
http://forums.magicengine.com/en/viewtopic.php?t=1744
« Last Edit: March 28, 2014, 11:07:25 AM by The Old Rover »

nodtveidt

  • Guest
Re: bm_delete()... what's wrong with it?
« Reply #1 on: March 28, 2014, 12:11:09 PM »
Code: [Select]
    lda   _nullity
    ldx   _bullets
    inx
    txa
    sbc   _nullity
    jsr   _cheap_funeral
    nop
    rts

:P :lol:

nodtveidt

  • Guest
Re: bm_delete()... what's wrong with it?
« Reply #2 on: March 28, 2014, 01:14:34 PM »
Yeah, I got the joke. :P :lol: BM, bowel movement, flush it down the toilet. :P