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 - FloppusMaximus
Pages: 1 ... 10 11 [12] 13 14 ... 20
166
« on: December 11, 2010, 11:05:51 pm »
I've been mulling this over for the past couple weeks. I think it should just barely be possible to play 8-bit, monophonic audio at 44.1 kHz, if the USB drive is fast enough at responding to commands. (Hopefully it should be, seeing as these devices are designed to work at high speed, but I'm not sure. It would be interesting to know how long the 84+'s USB controller waits to retry after receiving a NAK.) This is, however, going to be a very difficult program to write: even though I know all the pieces, and more-or-less how they'll fit together, I expect it'll take a couple of months even to get to the point of being able to test it. So don't expect this to be finished right away.
167
« on: December 11, 2010, 10:30:39 pm »
No, only when it's transferred to another calculator (it's checked at the receiving end, that is.)
168
« on: December 11, 2010, 10:19:58 pm »
Seems like a fine asm question to me.
Apps are stored in Flash, and execute from Flash, just like the OS. Flash is divided into 16384-byte "pages"; any page can be mapped to the Z80 address space starting at 4000h, simply by writing the page number to port 6. So basically, all the OS needs to do to run an app is to write the appropriate value to port 6, and jump to the start of the app's code. The app is never copied into RAM - there's no free RAM you could use for that purpose.
In order for this to work, the app needs to be stored at the start of a page, which is why every app effectively takes up a multiple of 16k bytes. Being stored in Flash also means the app can't modify itself (well, that and the fact that they need to be digitally signed.)
169
« on: December 09, 2010, 09:20:38 pm »
I think they have, but I don't expect they'll ever take those bits of code out. And even if they did - even if they released new OSes tomorrow that did away with all the old protection mechanisms - I'd still say it's worthwhile to remain compatible with the older OSes. I mean, personally, I'm still using 2.30 on my 84+, and given the state of the newer OSes, I don't plan on upgrading that in the forseeable future. I think both my 83+es are running 1.19 now, but I kept 1.14 for a very long time, for the sake of program compatibility. I'm sure I'm not the only one.
170
« on: December 07, 2010, 11:52:46 pm »
By the way, I should mention that I found some stupid bugs in the Axe app compiling that I'm in the process of fixing, it should make them finally signable on-calc without needing to flash a sector in the next version.
That's good to hear. By the way, I believe that you can simply end the app with the bytes 02 2D 40, and stop there, leaving the rest of the page blank. (I originally thought it might be necessary to include the "f" value - the extra 1-2 bytes that come after the signature proper - but this seems not to be the case.) You can still send the unsigned app to a PC, or at least you can using TiLP - somebody should probably check that TI-Connect doesn't have a problem with it. I'm not sure if I would want to merge application signing into the Parser, but I would definitely like to include it in the tools section of the Axe suite with your permission once I get it working. It's free software. All I ask is that you include the source code for the tool, or link to it. Also, I really don't want to mess with the certificate page. But if I understand correctly, couldn't that issue be averted by sending the app to the computer/another calculator and then sending it back? It seems like there would have to be some kind of mechanism to prevent that or the whole trial-run business would be pointless. I can understand your hesitation. In this case, I'm pretty confident that the example code I gave will do the right thing, or at least won't break anything too badly. Otherwise I wouldn't recommend it. I don't really know much about how the limited-trial system is supposed to work; I've never seen an app that used it.
171
« on: December 07, 2010, 01:51:33 am »
Okee, I think I'll give it a try. Meanwhile, I just had a brilliant idea with an interrupt, if only I could manage it in my head. It will be my first interrupt \(^_^)/
Sounds scary. I'm still amazed at how you can program the way you do. Good luck!
172
« on: December 07, 2010, 01:46:15 am »
I'm not sure. It looks like it would subtract 4000h from that value, so it would look for a jump address in RAM between 8000 and BFFF. That might not work on all OS versions, though.
173
« on: December 07, 2010, 01:32:46 am »
Well, first off, for normal system B_CALLs, between 4000 and 7FFF, the B_CALL handler first looks on page 1B (or 3B or 7B, depending on the model), where there's a table of all the system routine addresses and page numbers. So for instance, if you do a B_CALL GetKey (4972h), it looks at the 3 bytes stored at address 4972 on page 1B - in OS 1.19, that's 8B 49 06, i.e., address 498B on page 6. The OS then pushes your original page number on the stack, as well as the address of a handler routine (on page zero). It then loads page 6 in the 4000h bank and jumps to 498B. When the GetKey routine returns, it returns to the handler, which pops the original page number off the stack, restores that value to port 6, and returns to your program.
Boot B_CALLs are provided by the boot code, not the OS. They work exactly the same way, except that you use an "address" between 8000 and BFFF; the B_CALL handler subtracts 4000h from that value, then looks up the address to call on page 1F (instead of 1B.)
And finally we have application B_CALLs, like I mentioned above. In this case, you use an "address" between 0000 and 3FFF; the B_CALL handler adds 4000h to that value, and looks up the address to call on the first ("base") page of whatever application is currently loaded in port 6. In this case, the page number listed in the table is relative to that base page (so if your app is stored on pages 15 and 14, a value of 00 in the table corresponds to page 15, and 01 corresponds to page 14.)
(B_JUMP does the same thing as B_CALL, except that it doesn't save the original page number or push the extra handler on the stack. You almost never want to B_JUMP to a system routine, but you may sometimes want to B_JUMP to routines within your app.)
174
« on: December 07, 2010, 01:04:18 am »
So, I've never made a multi page APP before... Would it be that I could make a code like this:
This heads both pages
<<Header>> 1803 This skips the next 3 bytes DB06 This changes the flash page to whatever was in a C9 This is executed on the next page, pops the value into PC and picks up the code from there
Continuing code to some part on the next page:
DB06 This gets the current flash page in a 3C This increase a 21**** This is the address to jump to on the next page E5 This pushes HL C38240 This jumps to 2 bytes after the header
Yes, that will work, I think. In other words, you use the routine at 4082 (which is present at the same address on both pages) to switch from one page to the other. The 84+ boot code uses a similar technique. Another option is to use application B_CALLs and B_JUMPs. You can make a table of addresses and page numbers on the first (or "base") page of your app, and then use a B_CALL instruction to call those routines from anywhere in your app. For instance, if you have a routine at address 4567 on the second page, and you write the bytes 674501 at address 4083 on the first page, then (from either page) you can call that routine using a B_CALL 0083h (EF8300), or jump to it using a B_JUMP 0083h (CD50008300). This is much slower than the method you're suggesting, but also takes less space.
175
« on: December 07, 2010, 12:53:04 am »
So if I have an app, could I read in the page I'm running on, then swap it into bank 2 and jump to bank 2, where I then swap in the RAM? Probably tough to pull off in Axe, but I have a few ideas.
That would work in assembly language - as you say, it might be tricky in Axe - but you'd want to be sure interrupts are disabled. Like I said before, the OS doesn't like it if you change port 7, and that includes the system interrupt service routine. And remember that stuff like the screen buffers and A-Z variables are all stored in that area as well. Another option, with the same caveats, would be to simply leave your app mapped in the 4000-7FFF slot, and temporarily map whichever RAM page you're interested in in the 8000-BFFF slot.
176
« on: December 07, 2010, 12:29:08 am »
Right.
If you want to write an app that does this, it becomes much more complicated.
Oh, and you should also add a check at the start of your program, to be sure you're running on an SE/84+.
177
« on: December 07, 2010, 12:25:30 am »
Yes, it's okay, and thank you That gives me C000 and up as free RAM, correct?
No, that's port 6, which controls the 4000-7FFF area. And if you want to use the area from 4000h to 4080h, you should also add a B_CALL FillBasePageTable (that's EF1150) to clean up when you're done.
178
« on: December 07, 2010, 12:17:44 am »
I guess you would do something like "in a,(6) / push af / ld a, 83h / out (6),a" (Asm(DB06F53E83D306)) to set the mapping, and "pop af / out (6),a" (Asm(F1D306)) to restore it. (Is it OK to use pushes and pops in inline assembly like that?)
179
« on: December 07, 2010, 12:14:13 am »
No, of course it doesn't. We were talking about what to do if you get into the situation where you cannot install an OS. Which implies that your OS has been partially or completely erased somehow.
180
« on: December 06, 2010, 11:59:09 pm »
If you were ever in a situation where you needed to use that technique, some or all of the OS would not be present.
This is getting way off topic...
Pages: 1 ... 10 11 [12] 13 14 ... 20
|