This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - thepenguin77
Pages: 1 ... 94 95 [96] 97 98 ... 108
1426
« on: August 03, 2010, 06:06:45 pm »
BrandonW and I have both recently patched problems that TI has had since their first OS. Brandon fixed the If glitch and I just fixed the ERR:VERSION with groups.
If TI is so accurate, why didn't they fix these simple problems after 50+ revisions.
1427
« on: August 03, 2010, 12:19:20 pm »
Yes, calls can be conditional. They can also use all the conditions not just z nz c nc. Like m for negative or p for positive.
To compare two 16 bit numbers, use:
or a sbc hl, de add hl, de
This affects the flags the exact same way that cp hl, de would if it were a real command.
Also, you only need one inc hl after you write a variable to memory. That's because A is one byte, ld (hl), a stores one byte, so you only need to increase one byte. If you have a bigger number to store, you have to split it into bytes. So DE is stored E then D.
1428
« on: August 03, 2010, 12:04:40 pm »
Here is the fix for 2.43.
While we're on the topic of protecting groups, I also added in two more programs. For 2.43 and 2.53 respectively, these stop the OS from deleting all your groups during press to test. It has always bothered me that it disables all your programs, and then deletes all your groups.
As far as these patches go, they are all undo-able. When you run them, a menu pops up with a fix and unfix option.
1429
« on: August 02, 2010, 11:54:29 pm »
I have found one source of the problem. When the OS makes the group, it stores the start page and address in a temporary memory location. It then loads them in the OS specified page and address spot. The only problem is that the routine it calls to setup the group header, happens to also use the temporary memory location. So what happens is that the page gets first put by the main program, then increased by the header program, and finally the main program grabs it and raises it again! These ERR:VERSION groups actually start at the beginning of one page, and restart at the beginning of the next. What worries me is that the best way to fix the problem was actually to NOP 15 bytes. Not only that, TI went through and optimized this section for 2.53. That means they looked at it, saw nothing wrong, and continued on. But that's only half the problem! After I patched it up to make the groups, it can't read them. The group was definitely created successfully because GrpTool can read it. Plus it was readable after it got relocated on a garbage collect. TI just doesn't want us to use groups. So, wait. How did you trigger this error?
I GC'd to erase all memory. Then I filled the first flash page up until it only had 3 bytes left. (Flash isn't truly erased until GC it is just marked dirty). Then I made a group. What makes groups different than programs and the other variable types though? Because I'm pretty sure those can have headers on the page boundary.
What makes them different is that they have very specific code that creates and reads them! The ERR:VERSION groups function normally anywhere else, unless they corrupted the next page. Now I'm off to find part two of this horrible group handling. Edit: Found the second one, it only occurs if the group starts <4 bytes from the end of a page. TI almost did it right, they checked for page crosses, it's just that they assumed that it wouldn't change pages. Edit 2: For those that want to jump the gun, I finished the patch for 2.53. Tomorrow I'll have to make one for 2.43, maybe the 83+ and SE too if I can find some roms. It won't run on anything but, 2.53. Don't run it if you know your batteries are low and especially don't pull a battery. I was even nice enough to make it so that it won't say ROM failed in the self test.
1430
« on: August 02, 2010, 03:58:19 pm »
I was reading the topic about backing up your groups, when I just went, duh, I know what is happening. After a little abuse to my calculator's flash, I managed to pull my own ERR:VERSION. It's actually very simple if you know what you are doing.
Flash is made of sectors, each sector is 65,536 bytes long. Then each sector is split into 4 pages of 16,384 each. When you archive stuff, it is stuck where ever there is room while trying to be efficient. This means that data is allowed to run over one page onto the next, (not a sector boundary though). The only problem is that it is rather annoying to see if the data crosses a page boundary. Normally this is not a problem as TI checks to see if the data crosses the boundary. But if the 9 byte header which has to be processed byte by byte crosses a boundary, ERR:VERSION. This is TI's way of saying since the chance of this happening is only 3*9/65535 = .04%, we just won't bother with it.
Pretty soon I'll be looking to see how this can be patched, I'd imagine it's not too hard, but I'll see what I can do.
Here is the proof of concept screen shot.
Edit: Whoa, the problem is a lot worse than I thought, that was a completely blank group that it made. It has a flash header, but no data, just FF's.
1431
« on: August 02, 2010, 02:55:25 pm »
Sorry about that, _memClear is in my mind as _clearMem, I don't know why I always mix them up. As long as you give it an HL that is not in front of your program, and a bc that is >=2 it won't crash.
As for accessing them, I'll draw a picture.
Here is ram before. prgmA | prgmB | MirageOS appvar | prgmDESTROY | etc....
When you call make appVar, the OS makes a hole in the programs for yours to go, so: prgmA | prgmB | 500 + 2 byte hole | MirageOS appvar | prgmDESTROY | etc.... ^ Then when you call chkFindSym on it, it will tell you that yes, your appVar exists, and that you can find it's start in DE. DE is now pointing to that line in front of the hole. The first thing you have to do is skip two byte, these two byte are how big of a hole was created. Now you have 500 bytes to do whatever you want with.
To access it, you have to do it through hl or de. ld (appVar), hl won't work because at assembly time, the assembler doesn't know where the appVar is going to be. It's location can even change within your program if you make another appVar. You then have two options:
If you have just a little bit of data to store, you can do this:
ld hl, name rst 20h bcall(_chkFindSym) inc de inc de ex de, hl
ld (hl), a inc hl ld (hl), b inc hl ld (hl), c inc hl ld de, (score) ld (hl), e inc hl ld (hl), d
You can see how this would get ugly if say you needed to store 500 bytes. The other option is to set up your memory usage to accommodate the final saving. Here is how you could do that:
dataStart equ appBackUpScreen
enemyBuf equ dataStart ;256 bulletBuf equ enemyBuf+256 ;256 score equ bulletBuf+256 ;2 lives equ score+2 ;1 reload equ lives+1 ;1
dataEnd equ reload+1 ;1
ld hl, name rst 20h bcall(_chkFindSym) inc de inc de ld hl, dataStart ld bc, dataEnd-dataStart ldir
This method is good if you need to store buffers and such. Then to access them, just do it in reverse. For the first example, just switch (hl) with the other register and it will pull data out instead. For the last one, ex de, hl and you will be copying to your data area from the appVar.
1432
« on: August 01, 2010, 12:45:42 pm »
I've found you actually don't have to fill it with 0's. While it makes your code look pretty and makes it more logical, you only really need one 0. Basically the rst would grab your name and whatever was after it, but it doesn't matter because you already stopped it with 0.
1433
« on: August 01, 2010, 12:38:47 pm »
_player that is all correct except the type is 15h.
@Jerros, here is a nice routine to get you to the start of the appVar. It will create it if it doesn't exist, and it will unarchive it if it's archived.
getAppVar: ld hl, appVarName rst 20h ;move9ToOp1 bcall(_chkFindSym) jr nc, found ld hl, size push hl bcall(_createAppVar) inc de ;skip size bytes inc de ex de, hl pop bc bcall(_clearMem) ;fills hl with bc 0's jr getAppVar found: ld a, b or a jr z, inRam bcall(_arc_unarc) jr getAppVar inRam: inc de inc de ret
appVarName: .db appVarObj, "appVar", 0, 0 ; 15h
Just be sure to archive it when you program quits.
Edit: The appVar is just like regular ram, you can use it however you see fit. Just be sure that you use it the same way consistently. Like, don't save the first byte as highscore, and then read the first byte as achievements.
1434
« on: July 31, 2010, 02:31:00 pm »
There were some problems. First, that 60%, came from my compressor not working. It actually does more like 20%. And second, the 20khz that it had to run at was too low of a frequency. My program does the voltage control by turning the link port on and off once per sample. One side of the delay is bigger than the other which means that a note about 10% lower than the frequency is played. This means that you are listening to music and the mosquito sound at the same time.
So I just went back to my old replace 78-88 with 1-15. It works nicely. I sent another song to my calc and had it run at 22700hz and it sounds basically like a cheap mp3 player.
Once I get my c++ program so it can take .wav files, I'll have to post it all. But currently it takes quite a bit of doing to get the song to convert.
@DJ, I don't see how I can do lower sound quality, I guess I could let it be 7 bit or 6 bit, but then there wouldn't be any compression. Also, the song has to be the only thing running, you wouldn't be able to play a game in the background. But if stalls are ok, then it would work.
1435
« on: July 31, 2010, 02:15:17 pm »
I've never modded games per se. But I have used cheat engine to screw with them. On the old Destination Saturn for DOS, I think I gave myself unlimited lives and ammo and such.
I also have this demo program that only runs for 20 minutes and then it closes. So every time I run it, I go into memory and change the dec to inc. That way my time counts upwards.
1436
« on: July 30, 2010, 11:17:13 am »
He needed an assembly routine to make groups. But he forgot to give the group a name...
And so group $#%^!& was made. The calculator didn't like that.
1437
« on: July 30, 2010, 11:14:37 am »
If rst 20h is move9ToOp1, then there's not problem there, it's just copying memory.
I'm more worried about executing the name. Just because you write .db data, doesn't mean that the calculator knows that it's data. Most of the letter ($40) commands are safe, just ld a, b type stuff. But the numbers would be dangerous. 0 ($30) and 8 ($38) are jr's, 1 and 3 modify sp, 2 i modify's a random byte, and 4, 5, and 6 modify (hl).
But as long as there are no numbers in the name, that will work perfectly.
1438
« on: July 30, 2010, 10:17:53 am »
Oh wait, nvm. My wabbitemu doesn't have page 7A. Weird. A full mem reset fixed the problem.
This must be the equivalent of what I did to ACagliano the other day...
1439
« on: July 30, 2010, 12:57:32 am »
DJ, you are saying have the assembly program run the exact same code that the basic one does and come up with the same result?
It might be remotely possible, but it would take a ridiculous amount of time. Plus the assembly is usually longer. Mine is really two separate programs in one. Only the first 4 bytes are used by both.
1440
« on: July 30, 2010, 12:50:12 am »
Made the program.
Deleting #: calculator crashes when you type something and press enter Deleting !: calculator crashes when you go to the homescreen
Archiving ! or #: calculator deletes flash page 7A (part of OS) and calculator becomes unusable.
Pages: 1 ... 94 95 [96] 97 98 ... 108
|