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.


Topics - Jerros

Pages: 1 [2]
16
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@

17
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?

18
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!

19
ASM / My final border: How to create/work with AppVars?
« on: August 01, 2010, 08:35:24 am »
So my game is as good as complete, the last thing I must do is to be able to permanently save data.
I've read the AppVar part in Developpers Guide, but I just lack the knowledge to comprehend it all.
My question remains: How do I store simple data (just numbers, that's all) so that it can be recalled the next time someone runs the App?
All I really want is things like:
Code: [Select]
Hi-Score:
         .db       496
Achievements:
         .db       1
Whatever:
         .db       9999
but then to be saved after the programm is exited, and able to recall later on.
Would be perfect if the AppVar gets archived when the programm is closed, but that part shouldn't be hard and I can figure that out myself.

So... anyone has an easy way to save/recall numbers in Apps?

20
ASM / Check for multiple keypress, but just "once", how?
« on: July 25, 2010, 10:37:05 am »
Ok, so I know there are several ways to check the key(s) that is/are being hold down, but as far as I know there's only 1 way to check for multiple keys:
Code: [Select]
    LD  b, 4                         ; whatever many times the loop is executed
loop:
    LD     A, %11111111               ; group
    OUT    (1), A
    IN     A, (1)
    CP     %11101101                   ; whatever key(s) you wanna check for
    JR     Z, Label                          ; if the keys you were checking for were pressed, JP to label
   djnz    loop
Works like a charm, in fact, works a bit TOO well; if I keep the correct button(s) down it jumps to "Label" several times per loop. (or each loop, hard to see)
Now, If you'd use the standart:
Code: [Select]
    LD  b, 4                         ; whatever many times the loop is executed
loop:
    b_call _GetCSC
    CP     sk2nd                 ; whatever key you wanna check for
    JR     Z, Label                          ; if the keys you were checking for were pressed, JP to label
     djnz    loop
instead of the first, then there's just 1 jump to label if you hold the button down, BUT it cant check for multiple keys being pressed or not.

Is there a way to both check for multiple keypresses but only jump once untill you release the buttons and press them down again?
I hope I've made myself clear, its hard for me to explain :O
Thanks in advance!

21
ASM / Sprites in an APP: No SMC, yet no working script :( Why?
« on: July 12, 2010, 09:22:44 am »
I'm using the routine from the asm-in-28 tut, though the sprites display blurry and at the wrong coordinates.
The part of the "ClipSprXOR" label should be OK, since it's just copy/pasted from the tut, and it worked 100% fine before I turned the programm into an APP.
The routine I'm using to display sprites in an APP is:
(used random location and sprite, for exemple's sake)
Code: [Select]
xpos .equ AppBackUpScreen   ; To prevent SMC
ypos .equ xpos+1                 ; Tried +2 and even +9, don't know wether that makes a difference
clip_mask .equ ypos+1                 ; or not, but just to be sure. It didn't work though...

    LD A, 38                    ; X position to display
    LD (xpos), A
    LD A, 54                    ; Y position do display
    LD (ypos), A
    LD B, 9                      ; Length of Sprite in Y direction
    LD      DE, (ypos)
    LD      IX, Sprite                           ; Label of 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

Sprite:
        .DB     %00011000
        .DB     %01111110
        .DB     %01111110
        .DB     %11100111
        .DB     %11100111
        .DB     %01111110
        .DB     %01111110
        .DB     %00011000
        .DB     %00011000

Doesn't work properly.
Where's my mistake?
Or is this just a wrong way of trying to display the sprites?
Thanks for any help!

22
ASM / Exiting an APP: bjump _JforceCmdNoChaR isn't working!?
« 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 :
Code: [Select]
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!

23
ASM / Text and sprites in an APP? Why is my scrip failing?
« 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:

Code: [Select]
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:

Code: [Select]
    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!

24
ASM / APP -- Sprites and text all messed up... why!?
« 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 :
Code: [Select]
    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:
Code: [Select]
#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:
Code: [Select]
    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

25
ASM / Weird "Call" command error, please help! (ASM TI-84+)
« on: May 16, 2010, 09:24:11 am »
There's no reason why my script isnt working:
(Do I have to post what's "inside" the calls? I dont think its relevant...)
Code: [Select]
*some codes*
CALL newsprr1n1 ;Just some stuff, not important I think...
LD B, 6 ;
CALL hidemoveshowncount ;
JP Label ;Gets executed, nothing wrong

;But if I do this:
*some codes*
CALL test123 ;Ram-Reset :C
JP Label ;Doesn't get executed. Ram resets the previous line.

test123:
CALL newsprr1n1 ;The EXACT same stuff!
LD B, 6 ;
CALL hidemoveshowncount ;
ret

What is the matter?
Am I missing something obvious?
Why does the call result in a crash?

MAYBE it has something to do with the fact that my program is over 8kB.
I've read (in the ASM-in-28-Days tutorial) that I should keep programs for the TI 84+ below 8kB, but that's impossible since I'm making a game.
But why shouldnt programms be larger then 8kB?

That might not be related to the errors though, I'm just guessing (and I want to know what's the deal with that 8kB limit).

ANY help at all would be greatly appreciated!

*EDIT*

Okay, I'm quite sure it has something to do with the limit now.
I moved the piece of malfunctioning script from the bottom of my script to the top, and now it's working perfectly fine.
Please explain the WHY, and HOW I fix it?

26
ASM / Whats wrong with my dividing script? ASM TI 83/84+
« on: May 09, 2010, 11:23:32 am »
What I want the next piece of scrip to do is:
-Increase (score) by 1
-Divide (score)/16 (lets just call the result "P")
-I only care about WHOLE numbers, I don't need the remainder.
-Do: 63-P (which will result, lets say: "Q")
-Load Q into (scoreMeter)

Code: [Select]
LD A, (Score)
INC A
LD (Score), A
LD HL, (score)
ADD HL, HL
ADD HL, HL
ADD HL, HL
ADD HL, HL
LD DE, $100
ADD HL, DE
LD A, H
NEG
LD B, 63
ADD A, B
LD (ScoreMeter), A

The idea is that there's a meter to show you you're score.
The value in (scoremeter) will be used as an Y-coordinate for the sprite of the meter.
But the above script doesnt really work (which you of course find obvious n_n).

Any help would be apreciated!
Thank you in advance.

27
I got a bunch of sprites on the screen, and now I want to check wich (if any) match some coordinates set by me.
So, lets say, there are 10 8x8 sprites on the screen, and I want to check if one has Xpos=30 and Ypos=40, plus I want to know which sprite that would be.
Is the code going to look like this?:

(...)
     LD     A, (XposSprite1)
     CP    30
     JP     Z, Sprite1XisTrue
     LD     A, (XposSprite2)
     CP     30
     JP     Z, Sprite2XisTrue
     LD     A, (XposSprite3)
     CP     30
     JP     Z, Sprite3XisTrue
ect.

And then make another for all Y-coordinates.
This doesn't look very efficient, so I wonder if anyone can make a small example of how to do this much better.

Thanks in advance!

28
Title says it all...
I'm making a game in ASM, but I'm really new to programming, and I can't make a proper working piece of scipt that scrolls sprites down the screen.
I'm making a guitar-hero like game, where "O" start at the top of the screen, scroll down at a certain speed, and when the "O" matches an "O" in the bottom of the screen, you must press a certain button.

Requirements are:

- It must be possible to drop down some "O" sprites in a specific order, not just randomly. So I can determine the time between each "O" falling down.
- While the "O" is dropping, the Calc must still respond to a keypress, and execute a script when a button is pressed (to see if you pressed the right button at the right time, and increase/decrease score accordingly).

I hope I've been clear about what i'm trying to do.
If anyone could help me out by giving tips, or making a small script that performs a piece of what I want, it'd be a great help!

Thanks in advance!

Pages: 1 [2]