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 - Jerros
Pages: 1 ... 6 7 [8] 9 10
106
« on: July 12, 2010, 05:45:30 am »
I've figured that exiting an APP by simply using "ret" causes ram resets, so after some searching I fount that the prober way to exit an APP is by using the instruction :
bjump _JforceCmdNoChaR
However, when I try to compile it, my assembler (AppDev) gives the following error message:
"Macro expects args but none found"
What's the deal with this? Am I using the wrong command? or what arguments am I supposed to use? If any more information is needed, just ask. Hope someone can help me out here!
107
« on: July 03, 2010, 04:28:34 am »
Thanks, I'll look into that site. The problem with writing my own would be my total lack of knowledge, I don't know WHY 90% of my script works, I just know what variables to change do what I want . : )
108
« on: June 30, 2010, 05:31:13 am »
Actually, if you want to take the lazy way out which may or may not be easier in this case, just copy your data to ram first and then you can use your handy dandy bcalls with the ram location. If you have enough room, you can just copy all that data there at the beginning and then you're all set. If not, then you can dynamically copy the text/sprites to the ram only when you need them.
Smart :O But I think copying the whole deal at the start would'nt work, since I turned it into an APP because of the 8kB limit, and the programm might get much larger even. I guess the 8kB limit is still an issue when you just copy the lot at the start, so you're second solution sounds nice to me. This might be asking for a bit too much, but can you provide me with an example scrip that, lets say, displays the "Hello World!" message in small font on a specific location? That way things will get more concrete to me, or maybe you can tell me how to "dynamically copy the text/sprites to the ram only when you need them". (with a small script please!) I'm sorry if I'm being very demanding here, after all I'm pretty much asking fr33 st00f here on a forum... Thanks alot!
109
« on: June 30, 2010, 04:13:55 am »
You can't use bcalls for text/sprites in an app. You have to write your own routines, or store all text in RAM.
Ok... How? Got an example for text or sprites? Isn't there a piece of script someone has made before to easely display messages/sprites in APPs? I'm not really experienced enough yet to fully know how to, so any help woult be apreciated. If anyone has a helpfull pece of script, I don't per-se need to know HOW and WHY it works, as long as it works. ;P Anyway, thanks. I'll look into some documentation about how to show text/sprites in APPs.
110
« on: June 29, 2010, 12:51:50 pm »
Thanks for your reply! But have you equated xpos, ypos and clip_mask to a location on safe ram?
Probably not... How do I do this? I'm actually quite a newby with ASM, so don't be afraid to explain "too much". If you want to ease some coding it is easier to use: appsafePutS: ld a,(hl) inc hl or a ret z b_call _PutC jr appPutS
ld hl,string call appsafePutS
than relocating the string to ram every time.
Uhm... Can you use this in an easy example for me please? Like, lets say I want the "Hello World!" message displayed at a specific location. How would I do that youre way? Thanks for the help! It's REALLY appreciated.
111
« on: June 29, 2010, 10:39:40 am »
I've recently converted my programm into an APP, and everything works fine, exept Sprites and Text. For the text I've used numerious routines, but none seem to work, they all display random junk. This is what I've tried so far:
LD HL, $1C04 ; Location of where to display Text LD (CurRow), HL LD HL, SomeText LD DE, OP1 LD BC, 5 ; Lengt + the "0" in the end LDIR LD HL, OP1 b_call _PutS
SomeText: .DB "Text", 0 ;The above didn't work. ;Neither does this:
LD HL, $1C04 ; Location again. LD (PenCol), HL LD HL, SomeText b_call _VPutS
SomeText: .DB "Text", 0
Both won't work in an App, when I just compile it with TASM, the secont script does work normally, and shows small text at the desired location.
I have a similar problem with showing sprites. When compiling normally, there's nothing wrong, and everything shows as it's supposed to. But as soon as it's an APP, the spriter appear in the upper left corner, and somewhat scrambled. My sprite script:
LD A, 38 ; X position to display LD (xpos), A LD A, 54 ; Y position do display LD (ypos), A LD B, 10 ; Length of sprite (in Y direction) LD DE, (ypos) LD IX, Sprite ; The sprite CALL ClipSprXOR
ClipSprXOR: ; The actual spriting (from the asm-in-28-days, workt perfectly, but not in APPs appearantly) LD A, %11111111 LD (clip_mask), A LD A, E OR A JP M, ClipTop SUB 64 RET NC NEG CP B JR NC, VertClipDone LD B, A JR VertClipDone ClipTop: LD A, B NEG SUB E RET NC PUSH AF ADD A, B LD E, 0 LD B, E LD C, A ADD IX, BC POP AF NEG LD B, A VertClipDone: LD C, 0 LD A, D CP -7 JR NC, ClipLeft CP 96 RET NC CP 89 JR C, HorizClipDone ClipRight: AND 7 LD C, A LD A, %11111111 FindRightMask: ADD A, A DEC C JR NZ, FindRightMask LD (clip_mask), A LD A, D JR HorizClipDone ClipLeft: AND 7 LD C, A LD A, %11111111 FindLeftMask: ADD A, A DEC C JR NZ, FindLeftMask CPL LD (clip_mask), A LD A, D ADD A, 96 LD C, 12 HorizClipDone: LD H, 0 LD D, H LD L, E ADD HL, HL ADD HL, DE ADD HL, HL ADD HL, HL LD E, A SRL E SRL E SRL E ADD HL, DE LD DE, PlotSScreen ADD HL, DE LD D, 0 LD E, C SBC HL, DE AND 7 JR Z, _Aligned LD C, A LD DE, 11 _RowLoop: PUSH BC LD B, C LD A, (clip_mask) AND (IX) LD C, 0 _ShiftLoop: SRL A RR C DJNZ _ShiftLoop XOR (HL) LD (HL), A INC HL LD A, C XOR (HL) LD (HL), A ADD HL, DE INC IX POP BC DJNZ _RowLoop RET _Aligned: LD DE, 12 _PutLoop: LD A, (IX) XOR (HL) LD (HL), A INC IX ADD HL, DE DJNZ _PutLoop RET
Sprite: ; Some random Sprite .DB %11111111 .DB %00011000 .DB %00001100 .DB %11111111 .DB %00010000 .DB %00010000 .DB %11110000 .DB %00111100 .DB %00001110 .DB %00000011
Nothing is working, which is frustrating because it did all work before it was turned into an APP, and the programm is nearly completed >.< Thanks in advance for any help!
112
« on: May 28, 2010, 04:00:58 am »
LD BC, ______ ; _____ is the length of your string in characters, INCLUDING the zero at the end
I'll try, but you mean I load the number in BC that contains the number of characters +1? So "Hello World!" would be LD BC, 13 ? I'll try and see, as for the sprites it might be a self-modifieing code, like Quigibo said. Unfortunately I can't touch the PC with the programming tools right now, but I'll try all suggestions later. Thanks.
113
« on: May 27, 2010, 06:39:33 am »
Hmm... It's annoying that my programm is nearly completed, but that things aren't workigng now because it's an App... I shall try your suggestions, but otherwise I might need to PM my whole program (its VERY easy, since I'm a newby programmer) to someone, I bet you can see whats wrong in a quick glance. I'm not asking anyone to fully "scan" my programm, but if someone wants to take quick peek to see wahts worng, tell me and I PM you the script. For now I'll just try then things you've suggested.
Thanks ALOt for your help people!
114
« on: May 26, 2010, 04:01:15 am »
Replaced all the "b_call_PutS" with "call app_PutS" and included the small routine, but it's still messed up. It does show the text now, though its in large font, and no where near where I want it. Also, I can't applie it to sprites I'm probably doing something wrong, but what's the normal way to display sprites/small text in an app where I want when I want? Works when I use TASM to assemble and run it, but in an app its all still random junk on the screen, QQ.
115
« on: May 25, 2010, 02:58:48 am »
Instead of using: bcall _PutS use: call app_PutS and include the calcmaniac84 routine in the source code, of course.
I'll try, thanks alot. Oh, where can I find that source code of calcmaniac? Been googling without result so far... Meh, I'll keep searching.
116
« on: May 24, 2010, 11:38:29 am »
Well, your app page is mapped in at addresses $4000-$7fff. When you do a Bcall, the OS page with the routine is temporarily put there, so the data pointed to by HL will no longer be your text. That's why it works if you read your text data and display each character manually, since the OS will not be trying to read data from your APP.
I start to get it... Though I still don't understand how your posted code can help. What do I do in order to show sprited/text the right way? I don't know what to do with the code you gave me, sorry :C
117
« on: May 24, 2010, 11:17:55 am »
When you do a Bcall, the address you are giving on your app page will be pointing to random OS data instead. What most APP developers do is write their own _PutS routine like this:
LĂttle more info please, what it all does? :O I'm a very newby programmer, so some more concrete info would be appreciated. I do understany WHY the lot is messed up, thanx, though I still dont understand how to fix it. And wha tyou said about the B_calls, does that count for ALL B_calls? Because most, like b_call _RunIndicOff and b_call _GrBufClr seem to work fine... Thanks anyway.
118
« on: May 24, 2010, 10:52:38 am »
I've finally created an App, but when I run it, all sprites/text in the screen is messed up. Everything does work, it reacts correctly to buttons pressed, but whenever I use a sprite or do something like :
LD HL, $0006 LD (CurRow), HL LD HL, Sometext b_call _PutS
the screen fills with random stuff. The program doesn't crash, I can still switch between menus by pressing the correct buttons (I made the priogram, so I can navigate blind in it), but like said, text shown as above and sprites dont work.
The programm worked fine before being turned into an App, and most sprites seem to show in the upper left corner of the screen, instead of twhere they're supposed to be.
I've used AppDev to compile the .z80 into an app. Has anyone encountered the same problem? How to fix this? As said befire, when I normally compile it, it works perfectly fine. I'm exeeding the 8kB limit though, so that's why I'm turining it into an App. If I need to include more info, just ask and I'll post it.
Some random info that might/might not be related to the problem: My header:
#INCLUDE "DWEDIT.INC" #IFDEF APP .org $4000
#IFNDEF NOAPPHEADER ;This is the application header definition area required for all apps. .db 080h,0Fh ;Field: Program length .db 00h,00h,00h,00h ;Length=0 (N/A for unsigned apps) .db 080h,012h ;Field: Program type #ifdef TI73 .db 01h, 02h ;type=Shareware, TI-73 #else .db 01h,04h ;Type= Shareware, TI-83Plus #endif .db 080h,021h ;Field: App ID .db 01h ;Id = 1 .db 080h,031h ;Field: App Build .db 01h ;Build = 1 .db 080h,048h ;Field: App Name .db "CalcHero" .db 080h,081h ;Field: App Pages .db 1 .db 080h,090h ;No default splash screen .db 03h,026h ,09h,04h, 04h,06fh,01bh,80h ;Field: Date stamp- 5/12/1999 .db 02h,0dh,040h ;Dummy encrypted TI date stamp signature .db 0a1h ,06bh ,099h ,0f6h ,059h ,0bch ,067h .db 0f5h ,085h ,09ch ,09h ,06ch ,0fh ,0b4h ,03h ,09bh ,0c9h .db 03h ,032h ,02ch ,0e0h ,03h ,020h ,0e3h ,02ch ,0f4h ,02dh .db 073h ,0b4h ,027h ,0c4h ,0a0h ,072h ,054h ,0b9h ,0eah ,07ch .db 03bh ,0aah ,016h ,0f6h ,077h ,083h ,07ah ,0eeh ,01ah ,0d4h .db 042h ,04ch ,06bh ,08bh ,013h ,01fh ,0bbh ,093h ,08bh ,0fch .db 019h ,01ch ,03ch ,0ech ,04dh ,0e5h ,075h .db 80h,7Fh ;Field: Program Image length .db 0,0,0,0 ;Length=0, N/A .db 0,0,0,0 ;Reserved .db 0,0,0,0 ;Reserved .db 0,0,0,0 ;Reserved .db 0,0,0,0 ;Reserved #ENDIF #ENDIF
Oh, and I use this to put a sprite on the screen:
LD A, 46 ; Random number LD (ypos), A LD A, 27 ; another Random number LD (xpos), A LD B, 18 ; Length of sprite in Y direction LD DE, (ypos) LD IX, Sprite ; Label of the sprite CALL Showsprite
Showsprite: ; Show Sprite (XOR) CALL ClipSprXOR b_call _GrBufCpy ret ClipSprXOR: ; Show Sprite XOR LD A, %11111111 LD (clip_mask), A LD A, E OR A JP M, ClipTop SUB 64 RET NC NEG CP B JR NC, VertClipDone LD B, A JR VertClipDone ClipTop: LD A, B NEG SUB E RET NC PUSH AF ADD A, B LD E, 0 LD B, E LD C, A ADD IX, BC POP AF NEG LD B, A VertClipDone: LD C, 0 LD A, D CP -7 JR NC, ClipLeft CP 96 RET NC CP 89 JR C, HorizClipDone ClipRight: AND 7 LD C, A LD A, %11111111 FindRightMask: ADD A, A DEC C JR NZ, FindRightMask LD (clip_mask), A LD A, D JR HorizClipDone ClipLeft: AND 7 LD C, A LD A, %11111111 FindLeftMask: ADD A, A DEC C JR NZ, FindLeftMask CPL LD (clip_mask), A LD A, D ADD A, 96 LD C, 12 HorizClipDone: LD H, 0 LD D, H LD L, E ADD HL, HL ADD HL, DE ADD HL, HL ADD HL, HL LD E, A SRL E SRL E SRL E ADD HL, DE LD DE, PlotSScreen ADD HL, DE LD D, 0 LD E, C SBC HL, DE AND 7 JR Z, _Aligned LD C, A LD DE, 11 _RowLoop: PUSH BC LD B, C LD A, (clip_mask) AND (IX) LD C, 0 _ShiftLoop: SRL A RR C DJNZ _ShiftLoop XOR (HL) LD (HL), A INC HL LD A, C XOR (HL) LD (HL), A ADD HL, DE INC IX POP BC DJNZ _RowLoop RET _Aligned: LD DE, 12 _PutLoop: LD A, (IX) XOR (HL) LD (HL), A INC IX ADD HL, DE DJNZ _PutLoop RET
119
« on: May 20, 2010, 02:56:14 am »
You also need a special header for the app.
Google failed me on this one :c Where do I find the appropriate header for an App?Thanks Quigibo for the PM ;P
120
« on: May 19, 2010, 03:53:12 am »
You're my new God, Quigibo... Though when I click you're file, I get the following:
---copying file *myProgName*.z80---- Unable to find the given Pad (<-- not exactly what it says, sorry, my error is in Dutch, and I can't translate it well) ---assembling *MyProgName*.z80---- Unable to find the given Pad (same error as above)
Could be something with the header, what exactly do you mean with *You also need a special header for the app.* How should the header look like?
Pages: 1 ... 6 7 [8] 9 10
|