This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's
z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.
Z80 & 68k Assembly =>
z80 & ez80 Assembly
Author |
Message |
|
poopslayer78
Newbie
Joined: 10 Sep 2009 Posts: 28
|
Posted: 08 Oct 2009 04:59:17 pm Post subject: |
|
|
I was wondering if there was a simple way to get games written as asm programs to work from within Mirage OS. |
|
Back to top |
|
|
thepenguin77
Advanced Newbie
Joined: 17 Jul 2009 Posts: 72
|
Posted: 08 Oct 2009 05:33:43 pm Post subject: |
|
|
You would have to get the source and then recompile it with a mirage header. Besides that there isn't really an easy way. |
|
Back to top |
|
|
poopslayer78
Newbie
Joined: 10 Sep 2009 Posts: 28
|
Posted: 08 Oct 2009 06:20:27 pm Post subject: |
|
|
all the asm files are my own, so source is no problem. So does this mean that i wont have to change any of the actual CODE within the program? just the headers? Will TASM still compile files with mirage headers? and what exactly are the headers for mirage? |
|
Back to top |
|
|
FloppusMaximus
Advanced Member
Joined: 22 Aug 2008 Posts: 472
|
Posted: 08 Oct 2009 07:20:41 pm Post subject: |
|
|
You mean that the program is currently an 'Asm('-type program?
There are a few things you might need to do differently to adapt it for MirageOS (or any other shell.)
- Do not use GetKey.
- Do not use statVars, textShadow, or cmdShadow for temporary storage. There are lots of other areas you can use instead, such as appData, tempSwapArea, saveSScreen, and appBackUpScreen.
- If you modify your own code or data, changes get written back automatically (which may make your life easier or harder, depending on the circumstances.) Don't try to look up the original program's VAT entry.
- If you use any system routines that have the potential to throw errors (particularly floating-point math or variable manipulation routines) you absolutely must use an error handler.
- And of course, keep in mind the 8k limit: MirageOS will allow you to run programs larger than 8k, but if you have any code placed above C000h, it will crash. |
|
Back to top |
|
|
poopslayer78
Newbie
Joined: 10 Sep 2009 Posts: 28
|
Posted: 09 Oct 2009 11:25:31 am Post subject: |
|
|
First of all, yes, they are Asm( programs
I will need to use some sort of function to get the current keycode. Is the one described in Learn z80 in 28 days ok? Im pretty sure it only uses IN and OUT to get a key input and send it to a register. |
|
Back to top |
|
|
DrDnar
Member
Joined: 28 Aug 2009 Posts: 116
|
Posted: 09 Oct 2009 01:03:39 pm Post subject: |
|
|
I didn't know you can't use GetKey, but GetCSC still works. The offical MirageOS information is here. If you're trying to get other games written by other people to work in Mirage, be careful, as they may have had reasons for not running them game in a shell. For example, the game might use RAM areas that Mirage needs for itself. For the most part, making a new game work in Mirage is mostly a matter adding a bunch of .dbs that form the header. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 09 Oct 2009 03:27:39 pm Post subject: |
|
|
Once you've decided to use MirageOS, one thing you can do is start taking advantage of the library routines it provides. For instance, you don't have to do the port-reading for direct input yourself, you can call the library routine "directin" instead (or, of course, just use _GetCSC for your key-reading needs). The sprite routines are especially useful.
You don't have to do any of this -- just edit the header and make sure you avoid the trouble spots, and you're good -- but it makes your program shorter and potentially faster.
Last edited by Guest on 09 Oct 2009 03:28:35 pm; edited 1 time in total |
|
Back to top |
|
|
poopslayer78
Newbie
Joined: 10 Sep 2009 Posts: 28
|
Posted: 11 Oct 2009 02:34:51 pm Post subject: |
|
|
ok, ill give that a try |
|
Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page