• zStart - an app that runs on ram clears 5 1
Currently:  

Author Topic: zStart - an app that runs on ram clears  (Read 328441 times)

0 Members and 1 Guest are viewing this topic.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #615 on: December 12, 2011, 10:16:42 pm »
Edit:  Feature Request:
Can you add a screen somewhere that says what is in all of the On + number hooks?  I sometimes am hesitant to use them because I don't want to accidentally think that I'm pushing the wrong thing.  If zStart's out of space you could even make it a standalone program; I'd just find it quite useful.  Thanks!

Yeah, like I said, eventually I'll get that out, it's really not that much trouble.

Oh, thepenguin, earlier today I had a random-ish RAM Clear when trying to edit a program in archive after triggering a regular RAM Clear and then trying to edit an archived program (by pressing a number, if that matters).  I ran zStart after the second RAM clear, toggled zStart Off, then On again, and then tried editing the same program.  That worked just fine.
Not to burst your bubble (bug-ble?) or anything...

So, to clarify. You cleared ram, then when you went to edit a program, it crashed again? If that's true, then...
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #616 on: December 12, 2011, 10:22:25 pm »
Oh, thepenguin, earlier today I had a random-ish RAM Clear when trying to edit a program in archive after triggering a regular RAM Clear and then trying to edit an archived program (by pressing a number, if that matters).  I ran zStart after the second RAM clear, toggled zStart Off, then On again, and then tried editing the same program.  That worked just fine.
Not to burst your bubble (bug-ble?) or anything...

So, to clarify. You cleared ram, then when you went to edit a program, it crashed again? If that's true, then...
Yup.  The first RAM Clear was from 2nd / Mem / Clear RAM, while the second one was not voluntary.  Let me try to reproduce it right now.

Edit:  I can reproduce it on my calc by doing the exact same thing as before.
Edit 2:  It looks like all I have to do to fix it is run zStart - I don't even have to toggle it on/off like I did earlier.
« Last Edit: December 12, 2011, 10:24:42 pm by ztrumpet »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: zStart - an app that runs on ram clears
« Reply #617 on: December 14, 2011, 07:31:50 am »
Back here it is also that sometimes if I want to edit a program that is archived my calc craches. What I do then is clear the ram and some other stuff and then it works all normal.

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

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: zStart - an app that runs on ram clears
« Reply #618 on: December 16, 2011, 03:10:06 pm »
I had a quick question about editing programs in archive.  I assume that what it does is make a copy in RAM and then copy it back if changes were made.  But what happens if there's not enough room in RAM to hold the copy?  Are other programs temporarily archived to make space or will it not let you edit the program?

You mentioned you had an entry point in zStart so Axe errors could be shown in archived programs, but the routine sounds like it could be small enough to just include it in the app since I still have a lot of space.  But I don't know how you're implementing it so maybe I'm wrong or there are other advantages to calling it through zStart that I'm forgetting.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: zStart - an app that runs on ram clears
« Reply #619 on: December 16, 2011, 06:16:48 pm »
Iirc I've gotten an ERR:MEMORY trying to edit an archived program from home (well, I run it from the homescreen and take advantage of the ERR:SYNTAX :P).  Hasn't happened lately tho, either because I keep a lot of ram free or it's been fixed somehow.
Vy'o'us pleorsdti thl'e gjaemue

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #620 on: December 19, 2011, 03:28:09 pm »
(I was gone)

Oh, thepenguin, earlier today I had a random-ish RAM Clear when trying to edit a program in archive after triggering a regular RAM Clear and then trying to edit an archived program (by pressing a number, if that matters).  I ran zStart after the second RAM clear, toggled zStart Off, then On again, and then tried editing the same program.  That worked just fine.
Not to burst your bubble (bug-ble?) or anything...

So, to clarify. You cleared ram, then when you went to edit a program, it crashed again? If that's true, then...
Yup.  The first RAM Clear was from 2nd / Mem / Clear RAM, while the second one was not voluntary.  Let me try to reproduce it right now.

Edit:  I can reproduce it on my calc by doing the exact same thing as before.
Edit 2:  It looks like all I have to do to fix it is run zStart - I don't even have to toggle it on/off like I did earlier.

If you can get me a savestate that crashes, I can fix the glitch in 5 minutes.

I had a quick question about editing programs in archive.  I assume that what it does is make a copy in RAM and then copy it back if changes were made.  But what happens if there's not enough room in RAM to hold the copy?  Are other programs temporarily archived to make space or will it not let you edit the program?

You mentioned you had an entry point in zStart so Axe errors could be shown in archived programs, but the routine sounds like it could be small enough to just include it in the app since I still have a lot of space.  But I don't know how you're implementing it so maybe I'm wrong or there are other advantages to calling it through zStart that I'm forgetting.

If it's oversized, I believe it will Err:Memory since I just use bcall(_createProg).

The code is rather large, but you can probably duplicate some of it with your own code. In any case, here's everything you need to make it work:

Code: [Select]

;############################
editProgram:
ld hl, 0
ld (errOffset), hl
editProgramCustomOffset:
bcall(_chkFindSym)
ret c

ld a, b
or a
jr nz, itIsArchived

ld hl, op1
call getLastLetter
bit 7, (hl)
jr z, doTheEdit
jr setTheHook ;idiot


itIsArchived:
call findStartInRom

bcall(_loadDEIndPaged)
inc hl
call fast_bhl

push hl
ld a, e
or d
ld a, b
push af
push de

ld a, 3
out ($20), a

ld hl, op1
call getLastLetter
set 7, (hl)

call pushOp1
bcall(_chkFindSym)
jr c, notThisFoundz
bcall(_delVarArc)
notThisFoundz:
call popOp1


pop hl
push hl
call pushOp1
bcall(_createProg)
call popOp1
inc de
inc de
pop bc
pop af
pop hl
jr z, zeroSizes
bcall(_flashToRam)
zeroSizes:


setTheHook:
ld hl, appChangeHook
in a, (06)
bcall(_enableAppChangeHook)

doTheEdit:
ld hl, op1
ld de, varType
push hl
bcall(_mov9B)

ld a, 3
ld (menuCurrent), a
ld a, 1
ld ($85DF), a
ld a, kEnter
bcall(_pullDownChk)
bcall(_clrTR)

pop hl
ld de, progToEdit-1
bcall(_mov9B)

push af
ld a, kError
ld (cxCurApp), a
pop af
bcall(_newContext0)
bcall(_mon)

;###########################################
appChangeHook:
add a, e
cp kPrgmEd ;these are all part of editing
ret z
cp kMode
ret z
cp kTblSet
ret z
cp kFormat
ret z

finishEditing:

push af
push bc
push hl

ld a, b

cp $46
jr nz, killAppChangeHook ;this is in case a weird switch happens

ld hl, varType
call getLastLetter
bit 7, (hl)
jr z, killAppChangeHook

ld a, 3
out ($20), a

bcall(_runIndicOn)

ld hl, varType
rst 20h
call pushOP1
ld hl, op1
call getLastLetter
res 7, (hl)
bcall(_chkFindSym)
jr c, cantFindProga ;these things never seem possible until it crashes
bcall(_delVarArc)
cantFindProga:

call popOp1
ld hl, op1
call getLastLetter
ld de, -op1-1+7
add hl, de
push hl
bcall(_chkFindSym) ;if this is gone, we let it crash
pop de
or a
sbc hl, de
res 7, (hl)
ld hl, op1
call getLastLetter
res 7, (hl)
call pushOp1
bcall(_chkFindSym)
bcall(_arc_unarc)
call popOp1 ;this is for ON + STO

killAppChangeHook:
bcall(_disableAppChangeHook)
pop hl
pop bc
pop af
ret

;#######################################
;input: hl = start of op1, or similar

getLastLetter:
push af
push bc

ld bc, 10
xor a
cpir
dec hl
dec hl

pop bc
pop af
ret

;#########################################
pushOP1:
push af
push bc
push de
push hl

ld hl, -12
add hl, sp
ld sp, hl
ex de, hl

ld hl, 12
add hl, sp

ld bc, 10
ldir

ld hl, op1
ld bc, 12
ldir

pop hl
pop de
pop bc
pop af
ret



;##########################################
popOP1:
push af
push bc
push de
push hl

ld hl, 10
add hl, sp
ld de, op1
ld bc, 12
ldir

ld hl, 10+12-1
add hl, sp
ex de, hl

ld hl, 10-1
add hl, sp

ld bc, 10
lddr

inc de
ex de, hl
ld sp, hl

pop hl
pop de
pop bc
pop af
ret

;##################################
;Move to start of data in Rom
;Input: Output of _ChkFindSym
;Output: HL = start
; B = rom page
;Destroys: C DE


FindStartInRom:
ex de, hl

LD de, 9

add hl, de

call fast_bhl

bcall(_LoadCIndPaged)

inc c
ld e, c

add hl, de

call fast_bhl

ret



;########################################
;faster bhl
;only checks for going over

fast_bhl:
ld a, h
res 7, h
set 6, h
cp h
ret z
inc b
ret


Iirc I've gotten an ERR:MEMORY trying to edit an archived program from home (well, I run it from the homescreen and take advantage of the ERR:SYNTAX :P).  Hasn't happened lately tho, either because I keep a lot of ram free or it's been fixed somehow.

If nothing else, I read your post ;D
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #621 on: December 29, 2011, 07:42:24 pm »
I believe I have found two bugs. First, it appears that once zStart has "learned" the proper delay for your LCD, it will send this value to port 29h upon startup whether you want it to or not, as there is no option to control this. Second, it appears that bits 0 and 1 of port 29h are given no special care (either preserved or set) when this LCD delay value is sent. For instance, with my LCD delay value of 32 (20h), zStart resets bits 0 and 1 of port 29h, thus disabling the 6MHz memory delays whether this is desired or not.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #622 on: December 30, 2011, 10:30:00 pm »
I believe I have found two bugs. First, it appears that once zStart has "learned" the proper delay for your LCD, it will send this value to port 29h upon startup whether you want it to or not, as there is no option to control this. Second, it appears that bits 0 and 1 of port 29h are given no special care (either preserved or set) when this LCD delay value is sent. For instance, with my LCD delay value of 32 (20h), zStart resets bits 0 and 1 of port 29h, thus disabling the 6MHz memory delays whether this is desired or not.

Both of those are true.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: zStart - an app that runs on ram clears
« Reply #623 on: January 12, 2012, 02:22:26 pm »
Bug: when editing an archived program, and you trigger the APD by on+stat, upon returning to the homescreen the cursor is always at the top-left.
It doesn't happen with programs in the RAM.
Vy'o'us pleorsdti thl'e gjaemue

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: zStart - an app that runs on ram clears
« Reply #624 on: January 12, 2012, 06:17:35 pm »
Bug: On the catalog, when I try to assign the token "prgm" as a shortcut, it assigns the token "PlotStart" instead, which is strange, because that cant even be found in the catalog.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #625 on: January 12, 2012, 06:18:56 pm »
Bug: when editing an archived program, and you trigger the APD by on+stat, upon returning to the homescreen the cursor is always at the top-left.
It doesn't happen with programs in the RAM.

Now that's a weird bug, duly noted though

Bug: On the catalog, when I try to assign the token "prgm" as a shortcut, it assigns the token "PlotStart" instead, which is strange, because that cant even be found in the catalog.

I bet that's because I improperly handled 1 byte tokens in the catalog.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: zStart - an app that runs on ram clears
« Reply #626 on: January 13, 2012, 09:53:37 am »
Are you still planning to add the ability to insert grammer hooks?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #627 on: January 13, 2012, 10:00:08 am »
I believe he was, he was just waiting for feedback from me to say that I didn't plan to mess any more stuff up XD It is my fault for that :/ I should PM him now...

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: zStart - an app that runs on ram clears
« Reply #628 on: January 13, 2012, 08:34:32 pm »
Feature request: something to reset/re-make the appvar quickly from within the app.

Edit:
Bug: when editing an archived program, and you trigger the APD by on+stat, upon returning to the homescreen the cursor is always at the top-left.
It doesn't happen with programs in the RAM.
*Not only the top.  I just went to the middle after doing enough to get the screen to scroll.
I'm not sure if MP OSes handle the home screen differently...?  Using 2.43 anyway.
« Last Edit: January 15, 2012, 01:06:52 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: zStart - an app that runs on ram clears
« Reply #629 on: January 29, 2012, 07:02:53 pm »
If I don't remember (or get super busy) v1.3.005 is currently pending on ticalc.org. So within the next few days, people will finally stop emailing me.

I remember the reason I held off on this was because the omnicalc ram recovery was acting up again, but, I've been so busy lately, that the fix is not coming anytime soon. So, v1.3.005 it is.

Someone give me a post here when it's updated. Unless of course I beat you to it ;D
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112