Using Greyscale for APPs

Moderator: Duck

User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

OK, I knew this would prolly happen. This is my code...

Code: Select all

#DEFINE APPNAME "PokeTest"
#DEFINE APPPAGES 1
#define TI83P


#include "dwedit.inc"
#include "graylib.inc"


#IFNDEF APP
tTitle:
#ifndef ZES
  .db     "GreyTest",0
#endif
#ENDIF



StartApp:
	call gsEnable			
	call gsGetK
	call gsGetCSC
	call gsDisable



ProgramEnd:
	bjump(_JForceCmdNoChar)

	ret
	



.end
It compiles fine, but when run it just puts the cursor on the APP menu. It seems as though gsEnable is not working. help....

-thegamefreak0134

*EDIT* I should note that I'm running it under the TI flash debugger. Although the greyscale looks messed up on it, it still generally runs programs fine.
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Sorry I read your PM. Really converting to app safe format isn't that hard. If you are using my code than, you must copy the grey lcd copier and the sprite routines to the ram. Make sure that the are addressed to work there. it should all fit in statvars with the interrupt vector table and the interrupt itself. But I see if I can make another release with app friendly define.
Image
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

That's easier said than done. Question: If I alter the functions so that calls within the function are all relative, then I would just need to call the memory address I copied the function to to use it, right?

Or woudn't it? Would I have to alter the greyLCD copier so that the interrupt pointed to the right place?

Not knowing the routines well, I don't know how successful I will be doing this.

BTW, to copy all of this code, I can just use ldir, right?

-thegamefreak0134

*edit* Perhaps jim, your APP friendly defines could do the following:

In gsEnable, copy the LCD routines to RAM before setting the interrupt
For gsPutSprite, copy the routines to RAM and re-define names of functions so that they point to RAM areas.

Also, if you are successfull, make sure to mention which sections of RAM will not be accessible for APPs.

Course, this is an outsider's opinion.
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

I use quite a bit of smc so it unfortanately won't work that easliy as switching to jr. But yes, ldir is all you need.
Image
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

I know it's been several months since a post in this topic, but I am still going to appologize for any impatience coming out of me.

Jim e said something to the effect of maybe releasing an APP-friensly version of the package. Does anyone know if that actually happened?
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

thegamefreak0134 wrote:I know it's been several months since a post in this topic, but I am still going to appologize for any impatience coming out of me.

Jim e said something to the effect of maybe releasing an APP-friensly version of the package. Does anyone know if that actually happened?
You can ask him on his forums if you want, http://www.revsoft.org/phpBB2/
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

It shouldnt be too hard to just relocate the grayscale interrupt routine to a saferam area and run it from there. You just need to make sure that the labels are changed with respect to the saferam area in which you are copying it to.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Actually I have mostly decided not to release RGP on to ticalc in any form. I first started it s a proof of concept thing(like most stuff I do). I later justified turning it into a package because it seemed knowledge of how to work with the hardware, doing grey in general, and creating highly optimised code was at a premium.

But now after several PMs and the posts I've gotten over the months it seems like I got more questions on how to do the most simple things. So I've come to the conclusion making a big package of code that seems to offer a lot of pretty doesn't really help new coders, Rather it impedes on actual production since they set their goals to high. Not everyone is going to pull a tr1p there first game.( even then he had experience)

So in other words, You should try making it app friendly on your own, if you can do that then you are going to be more likely to finish that project.

Sorry.
Image
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

Jim e wrote:But now after several PMs and the posts I've gotten over the months it seems like I got more questions on how to do the most simple things.
Actually, my issues have always been compiling/assembling issues. Mainly trying to get the .inc file to behave with Latenite, or getting SPASM to work by itself. I'm bad at making things work on the comp XD
Image Image Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Good point, Jim. Very good point. You could consider releasing it without providing support though, so people who know what they're doing can use it. Because I think it would be a shame not to release it.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

I agree with Timendus. I think i've got a decent understanding of how your package works, perhaps not all the hardware details though. Leave out contact info? Besides, if someone wants to improve/modify it, they'll be able to do so if they're good enough :D
Image Image Image
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

Jim e wrote:
So in other words, You should try making it app friendly on your own, if you can do that then you are going to be more likely to finish that project.

Sorry.
Gee, thanks. As if my main statement of "I can't do this" wasn't enough. Lol.

I'll give it a shot, but don't expect too much from me. Looks like I may be making the game regular old mono after all...

-gamefreak
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Oh cmon you can do it! Its only a small mod anyway!

Besides, the actual engine design should have too much to do with the grayscale routines. Im you could implement grayscale at a later date once things are more complete.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

If the routines can be split up to fit into areas of safeRam, it should be as simple as wrapping the libraries in a .relocate block, like this:

Code: Select all

 ; This code copies the routines to RAM:
    ld hl,grey_lib
    ld de,safeRam
    ld bc,grey_lib_end - grey_lib
    ldir

    call draw_gs_sprite ; Calls address in RAM


; snip

grey_lib
    .relocate safeRam ; Address of choice

    ; Greyscale lib in here
    ; eg:

    draw_gs_sprite
        ; ...
        ret

    .endrelocate
grey_lib_end
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

:shock: :o :shock:

...I hate you all. You make it look too easy... I was actually going to go home and scream too. :lol:

Will this method work in TASM, or do I have to use BRASS?
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
Post Reply