Show Posts

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 ... 4 5 [6] 7 8 ... 10
76
ASM / Re: Multi-Page Apps, what's the difference?
« on: August 23, 2010, 10:22:19 am »
I've kinda figured alot out by now, though my assembler wants the specific offset for the labels I jump to, which I really wouldn't know:
Code: [Select]
JumpToLabelPage2 = $ - $4000
  .dw $4000                                 ; <-- if its the first line of  page2, it'd be this. How do I know the offset of labels  ?
  .db 1                                        ;  further down the programm?

;And mods, I didn't put the big empty space down here?
Also, these^ things work fine if I just put these^ kind of jump things anywhere in the programm.
Why put 'em on top and JP to your ProgStart?

77
ASM / Re: Multi-Page Apps, what's the difference?
« on: August 23, 2010, 02:15:23 am »
Hm... How is the assembly source structured and what assembler are you using? That can influence how labels are handled.
I'm using "AppDev".
It needs 2 seperate .z80 files for 2-paged apps, one named "Name" and the other "Name2".

I've kinda figured alot out by now, though my asseblrer wants the specific offset for the labels I jump to, which I really wouldn't know:
Code: [Select]
JumpToLabelPage2 = $ - $4000
  .dw $4000                                 ; <-- if its the first line of the page, it'd be this. How do I know the offset of labels further down the programm?
  .db 1

;Why is there big empty space down here? Mods?
So... how do I know the offsets of the labels in the programm?
And ehh, I can have lables with the same name on page1 and page2 right?

78
ASM / Re: Multi-Page Apps, what's the difference?
« on: August 22, 2010, 10:11:10 am »
Got 1 problem now it seems:
When I compile it, I get an error message on this line:
Code: [Select]
LabelOnPage2_Jump .equ ($-$4000)/3 ; LabelOnPage2_Jump is the nickname for LabelOnPage2
    .dw LabelOnPage2 ; Name of the label on the other page
    .db 1 ; 0=page1   and   1=page2   right?
on the second line, my compiler tells me "Label not found: <LabelOnPage2>"

At the very beginning of the programm, after the header and between all other #defines and .equ's theres:
Code: [Select]
LabelOnPage2_Jump .equ 1*3
I don't know if the 1*3 is correct though, page 2 looks like this:
Code: [Select]
nop
nop
LabelOnPage2:
...rest of things
Also, how do I keep track of the location of the labels on the second page?
The first label is easy, I assume that line 1 = byte 1, so adding 2 nop's made the label be at byte 3.
But how do I keep track of labels further down in the programm?

Thank you!

EDIT: Ok, I realize now that I have a duplicate label, since I have both:
Code: [Select]
LabelOnPage2_Jump .equ 1*3
and
Code: [Select]
LabelOnPage2_Jump .equ ($-$4000)/3 ; LabelOnPage2_Jump is the nickname for LabelOnPage2
    .dw LabelOnPage2 ; Name of the label on the other page
    .db 1 ; 0=page1   and   1=page2   right?
Fixed that by only using the secon thing (the 3-lines one), but the problem is still that it gives the "Label not found" message I described earlier.

79
ASM / Re: Multi-Page Apps, what's the difference?
« on: August 17, 2010, 11:45:25 am »
Thanks, I think I get it.
I'll try and see.
Unfortunately, I dont ahve acces to my stuff right now, but I'll edit this, cuz I do still ahev a question or two ^_^
Anyway, thanks alot!

EDIT:

"After your application header, use a "jp" statement to jump to where your program begins."  
Huh? there's just my header, and then, after a long list of #define and "a .equ b" there's just
Code: [Select]
b_call _RunIndicOff
        b_call _GrBufClr
        rest of lines
So where would I do that JP statement?
Doesn't seem necessary either...

Suppose you have a label on your second page called Access_Sprite_Data, and you need to call it from your first page.  Remember, your first page is called page 0, and your second page is called page 1. 

The data to tell the calculator about this label should be typed in after your JP statement.  However, make sure that this page data starts on a byte that is a multiple of 3--and I would not be the best person to help you with that.  If it does not start on a byte that is a multiple of 3, add some .db 0 statements until the data is.  We're going to pretend that the data starts on byte 132, which is a multiple of 3.
How do I check if the byte's on a multiple of 3?
Also, what exactly should be on a multiple of 3?
The label I'm jumping to?
Or the command "JP"?

Thanks again!

80
ASM / Re: Multi-Page Apps, what's the difference?
« on: August 17, 2010, 11:20:39 am »
How do I decide what data goes on what page, and when it switches pages?
And what data will get lost when switching?
More importantly, how to switch?
Is the only way to interacts between page by an appVar or the AppBackupScreen bytes?
And what do i need to change in my header in order to get it working again?

Really a load of ??? here, and that Developpers guide doesn't help me much at all, I'm still a rookie programmer...

81
ASM / Multi-Page Apps, what's the difference?
« on: August 17, 2010, 08:59:27 am »
So my game is getting to big for 1 page, (my compiler sais my header is invalid, though when I remove the last lines of code I've written, I can just compile it like always, so I guess it's getting too big), but simply changing the "2" in the header doesn't seem to work  :) :
Code: [Select]
#INCLUDE "DWEDIT.INC"
.org $4000
.db $80,$0F ;Field: Program length
.db $00,$00,$00,$00 ;Length=0 (N/A for unsigned apps)
.db $80,$12 ;Field: Program type
.db $01,$04 ;Type= Shareware, TI-83Plus
.db $80,$21 ;Field: App ID
.db $01 ;Id = 1
.db $80,$31 ;Field: App Build
.db $01 ;Build = 1
.db $80,$48 ;Field: App Name
.db "MyNameXX" ;Name must be 8 characters
.db $80,$81 ;Field: App Pages
.db $02 ;App Pages = 2                               <-------------- Simply changing this won't do.
.db $80,$90 ;No default splash screen
.db $03,$26,$09,$04,$04,$6f,$1b,$80 ;Field: Date stamp- 5/12/1999
.db $02,$0d,$40 ;Dummy encrypted TI date stamp signature
.db $a1,$6b,$99,$f6,$59,$bc,$67
.db $f5,$85,$9c,$09,$6c,$0f,$b4,$03,$9b,$c9
.db $03,$32,$2c,$e0,$03,$20,$e3,$2c,$f4,$2d
.db $73,$b4,$27,$c4,$a0,$72,$54,$b9,$ea,$7c
.db $3b,$aa,$16,$f6,$77,$83,$7a,$ee,$1a,$d4
.db $42,$4c,$6b,$8b,$13,$1f,$bb,$93,$8b,$fc
.db $19,$1c,$3c,$ec,$4d,$e5,$75
.db $80,$7F ;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

So My questions are:
What do I need to change in order to make my header "valid" again?
What's the key difference between having a singe-page App, or multi-paged ones?
How is this going to affect my programming?
What do I need to keep track of with multiple pages?
Is it importand that some things are on the same page? Or can I just randomly do as I please? (probably not :-[)

A lot of questions, but if anyone can share any wisedom it would be great@

82
ASM / Re: How do you know when your App is getting too big for 1 page?
« on: August 17, 2010, 08:49:47 am »
News-flash:
My compiler just said my header is "invalid". (while I havent touched the header in months)
I guess I just hit the limit.
I don't hope adding another page will be alot of work though...

83
ASM / Re: How do you know when your App is getting too big for 1 page?
« on: August 17, 2010, 04:17:06 am »
Okay, I'll check it with your tips, thanks.
The programm is currently ~6000 lines, but I guess that what Quigibo said is right, my compiler will probably error if I'm exeeding the limit.
Thanks all.

84
ASM / How do you know when your App is getting too big for 1 page?
« on: August 16, 2010, 10:51:10 am »
So I've been working on an App, making it larger each day, but now I get the feeling random bugs pop up out of nowhere.
It's kind of similar to what happened when my programm breached the 8kB limit and had to be turned into an App.
Thus the next step would be to add another page to the App, although I dont know wether that's needed or not.
Any way to check that?

85
ASM / Re: Any trick to make sprites move faster?
« on: August 10, 2010, 11:11:04 am »
Doing this now:
Code: [Select]
LD A, (slowfactor)        ; lets me change the delay during the routine. Loading 255 will be the slowest
LD B, A                       ; speed, while loading 0 will be the fastest.
lowerspeed1:
CALL lowerspeed
djnz lowerspeed1
--------------------------------
              rest of the loop in my programm
             -------------------------------------
lowerspeed:
LD A, 8              ; Found out that with 255 in (slowfactor), doing 8 loops here gives me the slowest speed
decreasespeed:                        ; I want, so that I have the largest "area" to fine tune in.
LD DE, 65535      ; <-- The dummie instruction
DEC A
cp 0
JR NZ, decreasespeed
ret

86
ASM / Re: Any trick to make sprites move faster?
« on: August 10, 2010, 10:57:50 am »
Nops can slow it down a bit.

I'vebeen through the forum, and Quigibo stated somewhere that you shouldn't use NOP's for that.
I dont remember why, but I'll just be a good boy and listen to him! ^_^

87
ASM / Re: Any trick to make sprites move faster?
« on: August 10, 2010, 03:18:42 am »
Actually, it looks like you're double buffering instead of clearing the screen.  You can do that too with a few modifications.

I'm just overwriting the graphbuffer to "clear" the screen, since I don't want the screen to be cleared, but just the sprites.
And thanks, I'll look into that link you gave me.

EDIT:
Woot!
Using the routine in the link you gave me, the sprites now schwoosh at light-speed!
You're incredible man, I ask for a trick to speed things up, and 5 minutes later you give me the PERFECT answer.

1 Thing now though, how do I DECREASE the speed now?  ;D
It's a bit TOO fast.
Will a simple Loop do?
Code: [Select]
  LD   B, *number to slow things down with*
Loop:
   LD   A, 1    ; Some random dummy instruction
   djnz   Loop

Will this work in slowing things down to desired speed?

EVEN MORE EDIT:
I should try things before asking questions here.
Looping works and allows me to adjust the rate at which it's slowed.
I use a slightly different loop than I posted above though.
Thanks Quigibo, you rule!

88
ASM / Any trick to make sprites move faster?
« on: August 10, 2010, 02:44:05 am »
I'm using the below routine to scroll sprites down my screen, and it's not that they scroll very slow, but just not quite as fast as I want to.
Are there any ways/tricks to let 'em scroll faster? Besides the obvious optimizing (since that will probably only lower the ammount of time by a few nanoseconds  :-\).
Code: [Select]
moveallspritesdown1pixel:
PUSH BC
    LD     HL, emptyscreen                 ; A picture with the game-screen, but then empty, without any sprites , so it basically overwrites the screen
    LD     DE, PlotSScreen+(0*12)       ; so that I can draw the sprites again.
    LD     BC, 64*12
    LDIR
LD A, (Yspr1)
CP 64 ; checks if the sprite is out of the screen, and doesn't move the sprite down if so.
JR Z, DownSpr2
DownSpr1:
LD A, (xspr1)
LD (xpos), A
LD A, (yspr1)
INC A
LD (ypos), A
LD (yspr1), A
CALL loadthesprite
DownSpr2:
LD A, (Yspr2)
CP 64
JR Z, DownSpr3
LD A, (xspr2)
LD (xpos), A
LD A, (yspr2)
INC A
LD (ypos), A
LD (yspr2), A
CALL loadthesprite
DownSpr3:
LD A, (Yspr3)
CP 64
JR Z, DownSpr4
LD A, (xspr3)
LD (xpos), A
LD A, (yspr3)
INC A
LD (ypos), A
LD (yspr3), A
CALL loadthesprite
DownSpr4:
ect ect ect untill 16 sprites are moved down.


------ Check Key routine here

------ big routine here that checks the location of all the sprites, and acts accordingly
------ routine here that shows 2 more sprites
------ big routine here that shows 4 more sprites

        b_call _GrBufCpy
POP BC
DEC B
JP NZ, moveallspritesdown1pixel

The sprites that scroll down are 8x8 in size.

Of course I could just move the sprites down 2 pixels each loop, but I'm afraid that will look ugly and not smooth anymore, and it might feel unresponsive when playing the game.
Any tricks? Or are my options limited to optimizing?
And what's faster: loading an empty picture on the screen, and then draw ~20 sprites, or using XOR to remove the sprites, then draw them again on their new location?

Thanks!

89
ASM / Re: My final border: How to create/work with AppVars?
« on: August 05, 2010, 02:26:10 am »
Uhm... another stupid question, but how do I use that to check wether one 16-bit number is larger than another?
With the "cp  HL" routine you gave me, it's only possible to check wether the numbers match or not.
How would I do a jump only if, lets say, DE holds a bigger number than HL?

EDIT:
Figured that'd be done with:
Code: [Select]
or a
sbc hl, de
add hl, de
             JR        "condition", "Label-DE-is-Bigger"
.....
code DE-and-HL-were-equal-or-HL-was-Bigger
.....
Not sure which condition to use yet, but I'll try some.

90
ASM / Re: My final border: How to create/work with AppVars?
« on: August 04, 2010, 09:38:00 am »
Code: [Select]
or a
sbc hl, de
add hl, de

What should "a" be in the "or    a" line?
Or is that completely irrelevant and are those 3 lines just an equivalent of "cp    HL"?

Pages: 1 ... 4 5 [6] 7 8 ... 10