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.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 22 Dec 2003 09:00:21 pm    Post subject:

My program won't work correctly - I've looked through it 10 times and see no error. It's supposed to use input in Ans as a list {256*row+column,sprite#} to draw a sprite, for a subroutine in a game I wrote. However, it draws only the first sprite regardless of the sprite number. Here is the code:

Code:
.nolist
         #include         "ti83plus.inc"
.list
.org         $9D93
         .db         t2ByteTok, tAsmCmp
         set         GrfSplitOverride,(IY + SGrFlags)
         set         FullScrnDraw,(IY + ApiFlg4)
         b_call(_RclAns)
         ld hl, 0001
         b_call(_GetLToOP1)
         b_call(_ConvOP1)
         push de
         ld hl, 0002
         b_call(_GetLtoOP1)
         b_call(_ConvOP1)
         ld b, a

         ld hl, ShipPic
         djnz NotAntiAir
         ld hl, AntiAirPic
NotAntiAir:
         djnz NotBomb
         ld hl, BombPic
NotBomb:
         djnz NotBuild0
         ld hl, Build0Pic
NotBuild0:
         djnz NotBuild1
         ld hl, Build0Pic
NotBuild1:
         djnz NotBuild2
         ld hl, Build0Pic
NotBuild2:
         djnz NotBuild3
         ld hl, Build0Pic
NotBuild3:
         djnz NotBuild4
         ld hl, Build0Pic
NotBuild4:
         djnz NotBuild5
         ld hl, Build0Pic
NotBuild5:
         djnz NotBuild6
         ld hl, Build0Pic
NotBuild6:
         djnz NotBuild7
         ld hl, Build0Pic
NotBuild7:
         djnz NotBuild8
         ld hl, Build0Pic
NotBuild8:
         djnz NotBuild9
         ld hl, Build0Pic
NotBuild9:
         pop de
         b_call(_DisplayImage)
         ret
ShipPic:
         .db 04,08,%00011000
         .db       %00100100
         .db       %11111111
         .db       %00011000
AntiAirPic:
         .db 04,03,%01000000
         .db       %11100000
         .db       %11100000
         .db       %10100000
BombPic:
         .db 04,04,%01100000
         .db       %11110000
         .db       %11110000
         .db       %01100000
Build0Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build1Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build2Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build3Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build4Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build5Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build6Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build7Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build8Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
Build9Pic:
         .db 08,08,%11111111
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %10000001
         .db       %11111111
.end
.end


Last edited by Guest on 23 Dec 2003 09:32:57 am; edited 1 time in total
Back to top
Adm.Wiggin
aka Tianon


Know-It-All


Joined: 02 Jun 2003
Posts: 1874

Posted: 23 Dec 2003 01:04:42 pm    Post subject:

ok, i read through your source, and found the problem (i think). are you sure that what you are loading into b is the correct sprite number? because, if it isnt, then it will just skip everything regardless...
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 23 Dec 2003 01:10:10 pm    Post subject:

The list I put in is {0,6}
It is supposed to:
set up pointers to Ans in de, hl
load the first element into OP1
convert it to de and a
push de
load the first elem...

I know! I need to do b_call(_RclAns) again because de has changed.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 23 Dec 2003 01:26:27 pm    Post subject:

It works fine except that the AntiAir and Bomb sprites don't work correctly, they show some random pixels across the whole screen. What could the error be now?

Edit: for _DisplayImage, does the width have to be divisible by 8? That would explain it.


Last edited by Guest on 24 Dec 2003 03:49:13 pm; edited 1 time in total
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement