Author Topic: Finding / listing programs  (Read 22648 times)

0 Members and 1 Guest are viewing this topic.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Finding / listing programs
« Reply #75 on: November 30, 2010, 04:16:09 pm »
by the way qwerty, don't archive # or !. not a good idea. lost my archive by doing that.


Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Finding / listing programs
« Reply #76 on: November 30, 2010, 06:34:47 pm »
I wasn't planning on it, but good to know.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Finding / listing programs
« Reply #77 on: December 01, 2010, 05:01:09 am »
by the way qwerty, don't archive # or !. not a good idea. lost my archive by doing that.
I suspect that this might have been something like that that was involved in Illusiat 2002 incident. Mirage most likely messed up and when I pressed keys it archived one of those x.x.

Hiding them also causes issues, although not as bad as archiving them.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Finding / listing programs
« Reply #78 on: August 31, 2011, 05:20:23 pm »
It would be something very similar to this, I haven't tested it yet.  Maybe I'll test it and then edit this post with an example that uses this.


:.Initialize Vat pointer (using P as pointer)
:Lbl VI
:{E9830}r->P
:Return
:
:.Get Next Entry
:.Returns 1 if End of Vat or 0 otherwise

:Lbl VNX
:P-{P-6}-7->P>={E982E}r
:Return
:
:.Get current entry type
:Lbl VT
:{P}
:Return
:
:.Get Pointer to current entry data
:Lbl VD
:{P-4}rr
:Return
:
:.Get archive status (0 is RAM, non-zero is archive)
:Lbl VA
:{P-5}
:Return
:
:.Get Pointer to current name length
:Lbl VNL
:{P-6}
:Return
:
:.Get Pointer to current entry name (backwards)
:Lbl VN
:P-7
:Return


I'm trying to do these in z80. Is this right so far?

Code: [Select]
GetCurrentNameLength: ;length in a
ld bc, 6
sbc hl, bc
ld a, (hl)
pop hl         ;hl was pushed as the start of the current entry.
ret

GetCurrentName: ;name in AppBackupScreen
ld bc, 6
sbc hl, bc
ld a, (hl)
dec hl
ld de, AppBackupScreen
NameLoop:
ld (de), (hl)
inc de
dec hl
dec a
jr nz, NameLoop
ld (hl), 0
« Last Edit: August 31, 2011, 05:21:30 pm by ACagliano »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Finding / listing programs
« Reply #79 on: August 31, 2011, 07:47:59 pm »
This thread is really out of date.  Axe now comes with the Memkit Axiom (z80 source included, you should check that out) which handles all this stuff for you.

As far as your assembly; ld (de),(hl) is not a real instruction.  You're going to have to use the 'a' register as an intermediate; ld a,(hl) \ ld (de),a which means your loop counter will have to change as well, you can use b for that which gives a you the djnz optimization as well.  But yeah, here's the current routine for copying the name in Memkit:

Code: [Select]
;Input: hl = Pointer to vat entry
;       de = Pointer to string buffer
GetName:
 ld    bc,-6
 add   hl,bc
 ld    b,(hl)
 ex    de,hl
Loop:
 dec   de
 ld    a,(de)
 ld    (hl),a
 inc   hl
 djnz  Loop
 ld    (hl),b
 ret
« Last Edit: August 31, 2011, 07:49:47 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!