ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Community :: Articles :: Z80 Emulation on 68K Calculators
Z80 Emulation on 68K Calculators

Posted on 8 September 1998

The following text was written by Michael Bryan Cook:

I just got a TI-89 the other day and was thinking about the fate of my trusty 83 and 85 when I though of this idea. The 92, 92+, and 89 are all 10mhz 68k processors. The rest of the 8x line (except for the 80) are 6mhz Z80s. So it seems to me that the 68k calcs would be fully capable of running some program to emulate the 80x line so that we could run the ASM games for them. This would not only make an easier way to put programs on multiple calcs because there is no need to program in both Z80 and 68k but also this means even on the just released 89 and the fairly new there would be a HUGE library of games. Because they are 4mhz faster they should be able to handle it and the +500k of mem on the 89 and 92+ would easily allow you to hold a program like this no matter how big and still have space for games. This would be a great idea and I'd love it if one of you TI experts could do this. The screens on the 89 and 92(+) are bigger than any other so this would work too. Now I know that this would be hard but look at what we've done! We've put ASM games on the 'impossible' TI-92 and TI-82, hacked the TI-85, made memory expanders, changed the font on the TI-85, and done so many other things that I don't think that it's fair to say we couldn't do it if we set our mind to it!

  Reply to this item

Re: Article: "Z80 Emulation on 68K Calculators"
Jbrett
(Web Page)

What about the screen size??

Reply to this comment    9 September 1998, 01:59 GMT


Re: Re: Article: "Z80 Emulation on 68K Calculators"
SN

all you would have to do is have the emulator use only a portion of the screen

Reply to this comment    9 September 1998, 17:17 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
JimmyPop

66% more power does NOT mean you have enough speed to emulate. In z80 assembly it takes 1 command to perform 1 action. Emulation, however, has to take extra steps. You have to decide which 68K command to substitute for the foreign Z80 command. That can take a few commands in itself. There are also other issues like screen size. You may need to double up pixels, which take more processing time. Therefore, you need a processor 400-500% faster than the original. Of course, there is the possibility of dynamic or static recompilation, but that is very complex and unlikely on a calculator.

Reply to this comment    9 September 1998, 02:01 GMT

Re: Re: Article: "Z80 Emulation on 68K Calculators"
SN

The ti-89 chip may only have 4 more mhz but it is definatly more than 200% faster then the z80 chip. I think that someone should give it a shot. I would not be quick to say that it is impossible. Heck i remember when everyone said it was impossible to put an assembly shell on the ti-82. It weas also supposed to be impossible to get sound out of the ti-92 link port but luckly there were some people who went ahead and did it anyways, and proved us all wrong. I wouldn't be so quick to try to cut down ideas. Instead we should provide constructive input to help develop these ideas.

Reply to this comment    9 September 1998, 17:31 GMT

Re: Re: Re: Article: "Z80 Emulation on 68K Calculators"
JimmyPop

200% is still not enough for direct emulation! You need to read the z80 command (1 command), search for the equivalent in 68K (4-5 commands), and execute the 68K command (1 command). Thats 6-7 commands to execute on the 68K, a compared to 1 on z80. That means 600% faster, which would definately require an acceled calc. There is, however possibility that a bi-lingual person can write a static recomplier, but that would be quite a task and isnt really considered emulation.

Reply to this comment    10 September 1998, 02:46 GMT

Re: Re: Re: Article: "Z80 Emulation on 68K Calculators"
Anonymous

I would have to agree with this comment. There are so many things that you can do with TI Graphing Calculators that it's astonishing. With enough time and effort, I'm sure something suitable in the way of emulators could come about. Somebody just has to take time out to think of how to do something like this and then try it. You'll never know if it works until you try!

Reply to this comment    8 October 1998, 02:17 GMT

Re: Re: Re: Article: "Z80 Emulation on 68K Calculators"
AuroraBoriales

And i did. Although i failed miserably, I managed to at least make the 68k processor THINK it was a Z80. This screwed my calc up, but until i reset it, it will only use about 3/4 of the screen and display some weird crap on it.
I did manage to write a simple emulator, though.


Reply to this comment    10 July 1999, 17:30 GMT


Re: Re: Re: Article: Z80 Emulation on 68K Calculators
Nathan Ladwig  Account Info
(Web Page)

Holy Crap! You are a genius.

Reply to this comment    6 February 2005, 04:46 GMT


Re: Re: Article: "Z80 Emulation on 68K Calculators"
astrid smith  Account Info

Use a binary lookup table for the instructions (5-10 instructions), use a TIOS window or the upper left portion of the screen for display (10 instructions).
Then it'll be like running an 89 on VTI on a 166MHZ pentium (about 1/3 to 1/4 as fast)

Reply to this comment    31 March 2002, 06:43 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Nathan Ernst

I think that this could be very promising. First, we need someone (or some people) willing (and skillful enough) to work on this project.

For size and speed, this will obviously have to be an ASM project. What I would suggest is a library of general z80 commands that go across all the 8x minus the 89) series of calculators, translating the z80 commands to the 68k equivalent(s). From there, I would suggest having an individual library for each calc that is wanted to be emulated. That way, people could choose which calculators they want to emulate, saving on what could become very valuable space. Of course, there should be an (on calc?) converter to change the 8x calc programs into transferable programs (or strings?), and maybe an assembly program to send/receive programs to 8x calculators.

Reply to this comment    9 September 1998, 02:08 GMT

Re: Article: "Z80 Emulation on 68K Calculators"

Sounds like a great idea! However, as stated previously, it would be rather difficult. Especially when converting processor commands and various screen sizes. Libraries DO sound like the best way to emulate. Better yet, why not try to convert an existing emulator (i.e. ASE)?

Reply to this comment    9 September 1998, 03:51 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Dan

I think that this is a great idea. However, it would have to be a program that ran on the computer. This is because you can not send an 86 game to a 92 or 89 by using the calc to calc cable. This could only be done if you sent the program to the computer (unless it was already on there) then convert it to the 89 asm. I would like to see this done. It is a great idea for any of you who have no ideas what to do.

Reply to this comment    9 September 1998, 03:59 GMT


Re: Re: Article: "Z80 Emulation on 68K Calculators"
david

Now here is something I have wondered about for a while. If you have ever played ZTetris by Jimmy mardell, than you know about the link feature that makes it possible to play against a 92 on an 86, because the protocol is the same. (?) Anyway, what about an ASM program that would use the same link setup as Ztetris to send progs between calc to calc? I have limited experience with cacl to calc progs, so please tell me if this prog is totally stupid or not.

Reply to this comment    8 October 1998, 04:03 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Arioch

I just got my TI-89, my first graphing calculator ever. I feel that everyone should go ahead and do whatever it takes to make games, but forget about emulation, etc. If it will take that long and slow the game down that much, don't even bother! You could probably code the whole game over in the time it takes for you to make an emulator, etc. Anyway, I heard that the TI-89 came with a built-in assembler, so whatever that means, it should help you program better and faster (I think) :P. Anyway, I am just anxious to get some games. All I have so far ...stickman, Icons89, Identity, and TI Point. These programs are not exactly impressive compared to some other games. I can run FF7 for the TI-92 on my TI-89, but only to a certain extent. It cuts off everything but the upper left corner of the screen, and crashes if you try moving. Anyway, please just make some games and post web addresses for all to share :)

-Arioch <M. Pieczynski>

Reply to this comment    9 September 1998, 04:39 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Paul DeLeeuw

I would say that this is , in theory, a good idea. However, there is a problem with speed. As stated before, fully emulating an z80 processor would be doggedly slow. Also, for Rom calls, you would need a ROM of the z80 calc you wanted to emulate. What would be better would be to convert all ROM calls straight to native, optimized code and use this as a library on the 89/92/92+. What would be best is straight conversion of all the z80 code to native code on a computer, which has also been stated before. But, in theory, you could emulate the full calculator, TI-OS and all, impress all you teachers and friends for about a day and, while emulating, be able to do 82/83/85/86->89/92/92+ exchanges.

Reply to this comment    9 September 1998, 04:53 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Sh0gunZ
(Web Page)

It is theoretically possible though very unlikely. The size of the emulator would probably eat up most of the available space. However if a process such as Dynamic Recompilation (Converting the code as is necessary) or Static recompilation (converting the ASM file before execution) could be implimented it is likely that you could play 8X games on a 89/92(+). Such processes though would be extremely hard to duplicate due to processor timings, different registers, etc...

Reply to this comment    9 September 1998, 05:28 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Dark Ryder

Unfortunately, 82-86 programs will probably never be emulated on the 89 or 92+. There are far too many programming problems to overcome, in my opinion:

-Screen size (obviously)
Almost all programs (certainly all the ones I've written) are _very_ dependant on the screen width for any kind of graphics. Particularly on the 85 and 86, with memory-mapped screens, filling a series of, say, 48 bytes with $FF will fill in three lines on the screen. On the 89, that's two and a half.

-Paged ROM (and RAM)
Because the z80 can only access 64k at a time, 8x calcs used a paged ROM system (and RAM, on the 86). Emulation for programs that directly manipulate the pages would be almost impossible.

-Ports (I may be wrong on this one...)
To my knowledge, the 68k doesn't implement anything similar to z80 ports, which are used to access a variety of hardware features (including the screen on the 82 and 83).

-Register width
Many programs make use of the "two's complement" method of handling negative numbers. When converting these numbers to 32 bits, the emulator would be unable to determine if, say, $C000 refers to positive $C000 or negative $4000.

Reply to this comment    9 September 1998, 05:46 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
Kitsune

Effors would be much better spent towards porting and writing new software over emulating old ones. Here's why:

1) The emulation thing just won't work. "Hey," you say, "What about ASE and emulators on the 86?"
They are only covering for the minor differences between the Z-80 calculators, not really emulating at all. The processor is the same, the assembly code for it is essentially unchanged. Trying to pull a similar stunt on a 68k may work, but likely not to anyone's satisfaction. (If you have a video game console emulator on your computer, you know what I mean. "Why is this @#$% 1985 nintendo game so slow on my Pentium 133?")

2) The 92/89 are so much better than the old calcs, why blow your time in emulating the old games when you can have new and hugely better ones? Higher resolution, greyscale, bigger levels, more options, smoother running... What isn't to love? Just give it some time, once the 89s really hit the market, the flood of cool stuff for them will begin.

Reply to this comment    9 September 1998, 06:45 GMT

Don''t emulated, translate!
Nathan Cassano

What we need to do if we want to "emulate" Z80 code is to design a computer program that translates Z80 binaries into M68K binaries. The Z80 and M68K are not complex processors and translator betweem the two would not be impossible. Real time interpative emulation (like what was suggested above) is very slow. Z80 interpative emulation on the M68K would run at about half speed or even less. But if we could translate the binaries and then run them it would most likely run at full speed on the M68K. The translator would have to mix and match op codes between them and switch calculator addressing. Not an easy job but if it was made the 92 and 89 asm archieves could be filled with 82-86 programs. I say do it.

Reply to this comment    9 September 1998, 21:55 GMT


Re: Don''t emulated, translate!
Tyler Smith
(Web Page)

I totally agree with you on this one. I might not know a lot about programing ASM games but I *DO* know that emulation for something like a Z80 would require a more powerful processor than the 68K processor in 89's. But I would like to hear more about this "translator" that has been talked about? If somebody starts making one about how long should it be before we see Z80 games comming out for the 89? Because if it takes to long to actually make one, you might as well just start programming a game for the 89 instead. Once the asm specs are released anyways.

Reply to this comment    12 September 1998, 21:28 GMT

Re: Article: "Z80 Emulation on 68K Calculators"
billybobiv

hey, ya know when you compile a program, it takes the commands you have programed in in assembly and converts them to machine code. The info in the include files tells all the equates to machine code.
Now can someone tell me why it would be difficult to have a type of assember compiler that you take the 86.asm file and compile it as a 68k file.
just write up quick routines to replace any calls to the include files. Not rom calls..we would write routines to replace them that aren't relient upon any rom
basiclly this would be an efficient alternative to looking through yer 86asm file and rewriting it for 68k

Opinions???

Reply to this comment    9 September 1998, 23:29 GMT


Re: Re: Article: Z80 Emulation on 68K Calculators
Nathan Ladwig  Account Info
(Web Page)

You just might be on to something.

Reply to this comment    6 February 2005, 04:47 GMT

1  2  3  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2012, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer