0 Members and 2 Guests are viewing this topic.
Yeah that can be a problem indeed, plus we have to not take online tools for granted, since after a while their author might abandon their site and shut it down (like what happened to the Map and Sprite editors by Aichi, because the author decided a Minecraft server would be far more important and useful than these two amazing tools). But of course you can keep it archived and use something like Doors CS to run it directly from archive (or Zstart does that too I think). That way you don't need to manually unarchive/archive your stuff over and over and you save on GarbageCollecting time. Any screenshots of your editor by the way?
Quote from: DJ_O on April 25, 2012, 12:25:37 pmYeah that can be a problem indeed, plus we have to not take online tools for granted, since after a while their author might abandon their site and shut it down (like what happened to the Map and Sprite editors by Aichi, because the author decided a Minecraft server would be far more important and useful than these two amazing tools). But of course you can keep it archived and use something like Doors CS to run it directly from archive (or Zstart does that too I think). That way you don't need to manually unarchive/archive your stuff over and over and you save on GarbageCollecting time. Any screenshots of your editor by the way?Then again, I don't think Cemetech's going to close anytime soon
If you want ideas or coding help, you can check this out It can be optimised a bit, but it uses a keyhook so all you do is press a special key combo and voila, the picture hex is in Ans http://www.ticalc.org/archives/files/fileinfo/427/42778.htmlActually, I think the source to that is wrong, but it might still help >.> The whole program is 72 bytes EDIT: That is over two years old o.o That could really use an update
ld hl,Name rst rMOV9TOOP1 ;Copies 9 bytes at HL to OP1. In otherwords, it copies the name of the program to OP1. bcall(_ChkFindSym) ;Searches for the variable, returns info:;c flag set if the variable was not found;HL points to the VAT entry;DE points to the size bytes of the data;B is the flash page the data is on;C is the length of the name;The lower 5 bits of A is the type of the var. ret c ;quit because it doesn't exist ld a,b ;This is 0 if it is in RAM, otherwise, it is the flashpage number or a ;This is a sneaky trick to check if A is 0. It is smaller and faster than cp 0 ret nz ;quit if it is not zero (meaning it is archived).;If it made it this far, the var exists in RAM. DE points to the size bytes.;I typically use those, so I'll store it to BC: ex de,hl ;swap HL and DE ld c,(hl) ;loads the lower byte into C. you cannot do ld c,(de), this is why I used ex de,hl inc hl ;HL now points to the next byte ld b,(hl) ;B now contains the higher byte of the size. Now BC is the size of the var. inc hl ;HL now points to the start of the program data.;(this is just randomness on my part, feel free to try it. It will destroy all the data in the program, though) ld d,0DoStuffLoop: ld a,d and 00001111% ld d,a inc d add a,'A' ld (hl),a cpi ;Cheap trick. This decrements BC, increments HL, returns PE if BC is not 0. jp pe,DoStuffLoop retName: .db ProgObj,"NAME",0 ;This is the name of the program with PrgObj in front and 0 at the end.
Hmm, do you have the names of these programs, or does the user have to pass an argument telling what program to read/write from?EDIT: Here is some example code for getting the location of a var you have the name of:Code: [Select] ld hl,Name rst rMOV9TOOP1 ;Copies 9 bytes at HL to OP1. In otherwords, it copies the name of the program to OP1. bcall(_ChkFindSym) ;Searches for the variable, returns info:;c flag set if the variable was not found;HL points to the VAT entry;DE points to the size bytes of the data;B is the flash page the data is on;C is the length of the name;The lower 5 bits of A is the type of the var. ret c ;quit because it doesn't exist ld a,b ;This is 0 if it is in RAM, otherwise, it is the flashpage number or a ;This is a sneaky trick to check if A is 0. It is smaller and faster than cp 0 ret nz ;quit if it is not zero (meaning it is archived).;If it made it this far, the var exists in RAM. DE points to the size bytes.;I typically use those, so I'll store it to BC: ex de,hl ;swap HL and DE ld c,(hl) ;loads the lower byte into C. you cannot do ld c,(de), this is why I used ex de,hl inc hl ;HL now points to the next byte ld b,(hl) ;B now contains the higher byte of the size. Now BC is the size of the var. inc hl ;HL now points to the start of the program data.;(this is just randomness on my part, feel free to try it. It will destroy all the data in the program, though) ld d,0DoStuffLoop: ld a,d and 00001111% ld d,a inc d add a,'A' ld (hl),a cpi ;Cheap trick. This decrements BC, increments HL, returns PE if BC is not 0. jp pe,DoStuffLoop retName: .db ProgObj,"NAME",0 ;This is the name of the program with PrgObj in front and 0 at the end.