PT_ isn't using convhex correctly, just wanted to throw that out there. *runs away*

Have spasm output a .bin, and *then* compress.
Time for some small updates. Last days I've been busy with optimizing the routine to display all the tiles at the screen. I've decided to add a border around the field, to avoid clipping, and with the help of both grosged and TheMachine, I got it down to like 711751 cycles, which is really good ;D When there are no more optimizations left, I will start with other stuff, such as the edges of the field and scrolling 🙂

Entire code (DrawFieldStart = mpShaData, AoCEDisplayIsoTile = cursorImage):

Code:
DrawField:
   scf
   sbc hl, hl
   ld (hl), 2
; Speed: 722161/721349/711751 cycles
   ld hl, -3
   jp mpShaData
   
DrawFieldStart:
   add hl, sp
   ld (TempSP2 - AoCEDisplayIsoTile + cursorImage), hl
   ld hl, (currDrawingBuffer)
   ld de, 15
   add hl, de
   ld (startingPosition - DrawFieldStart + mpShaData), hl
   ld de, 8*320
   ld b, 29
DisplayEachRowLoop:
   bit 0, b
   exx
startingPosition = $+2
   ld iy, 0
   ld a, 10
   jr nz, DisplayRowOfTilesLoop
   dec a
   lea iy, iy+16
DisplayRowOfTilesLoop:
   ld hl, _tile_test \.r2
   call cursorImage
   lea iy, iy+32
   dec a
   jr nz, DisplayRowOfTilesLoop
   exx
   add hl, de
   ld (startingPosition - DrawFieldStart + mpShaData), hl
   djnz DisplayEachRowLoop
   ret
DrawFieldEnd:
.echo DrawFieldEnd-DrawFieldStart

AoCEDisplayIsoTile:
; Thanks a lot to TheMachine02 and grosged for help and optimizations!
; Input:
;   IY = pointer to output
;   HL = pointer to iso sprite
;
; Bytes: 168 bytes
; Time: 2558 cycles

   lea de, iy
   ld ix, 0
   lea bc, ix+2
   add ix, de
   ld sp, 320
   ldir
   add ix, sp
   lea de, ix-2
   ld c, 6
   ldir
   add ix, sp
   lea de, ix-4
   ld c, 10
   ldir
   add ix, sp
   lea de, ix-6
   ld c, 14
   ldir
   add ix, sp
   lea de, ix-8
   ld c, 18
   ldir
   add ix, sp
   lea de, ix-10
   ld c, 22
   ldir
   add ix, sp
   lea de, ix-12
   ld c, 26
   ldir
   add ix, sp
   lea de, ix-14
   ld c, 30
   ldir
   add ix, sp
   lea de, ix-15
   ld c, 32
   ldir
   add ix, sp
   lea de, ix-14
   ld c, 30
   ldir
   add ix, sp
   lea de, ix-12
   ld c, 26
   ldir
   add ix, sp
   lea de, ix-10
   ld c, 22
   ldir
   add ix, sp
   lea de, ix-8
   ld c, 18
   ldir
   add ix, sp
   lea de, ix-6
   ld c, 14
   ldir
   add ix, sp
   lea de, ix-4
   ld c, 10
   ldir
   add ix, sp
   lea de, ix-2
   ld c, 6
   ldir
   add ix, sp
   lea de, ix
   ldi
   ldi
TempSP2 = $+1
   ld sp, 0
   ret
AoCEDisplayIsoTileEnd:

If you see optimizations, feel free to post it 😛
PT_ wrote:
Time for some small updates. Last days I've been busy with optimizing the routine to display all the tiles at the screen. I've decided to add a border around the field, to avoid clipping, and with the help of both grosged and TheMachine, I got it down to like 711751 cycles, which is really good ;D When there are no more optimizations left, I will start with other stuff, such as the edges of the field and scrolling 🙂

Entire code (DrawFieldStart = mpShaData, AoCEDisplayIsoTile = cursorImage):

Code:
DrawField:
   scf
   sbc hl, hl
   ld (hl), 2
; Speed: 722161/721349/711751 cycles
   ld hl, -3
   jp mpShaData
   
DrawFieldStart:
   add hl, sp
   ld (TempSP2 - AoCEDisplayIsoTile + cursorImage), hl
   ld hl, (currDrawingBuffer)
   ld de, 15
   add hl, de
   ld (startingPosition - DrawFieldStart + mpShaData), hl
   ld de, 8*320
   ld b, 29
DisplayEachRowLoop:
   bit 0, b
   exx
startingPosition = $+2
   ld iy, 0
   ld a, 10
   jr nz, DisplayRowOfTilesLoop
   dec a
   lea iy, iy+16
DisplayRowOfTilesLoop:
   ld hl, _tile_test \.r2
   call cursorImage
   lea iy, iy+32
   dec a
   jr nz, DisplayRowOfTilesLoop
   exx
   add hl, de
   ld (startingPosition - DrawFieldStart + mpShaData), hl
   djnz DisplayEachRowLoop
   ret
DrawFieldEnd:
.echo DrawFieldEnd-DrawFieldStart

AoCEDisplayIsoTile:
; Thanks a lot to TheMachine02 and grosged for help and optimizations!
; Input:
;   IY = pointer to output
;   HL = pointer to iso sprite
;
; Bytes: 168 bytes
; Time: 2558 cycles

   lea de, iy
   ld ix, 0
   lea bc, ix+2
   add ix, de
   ld sp, 320
   ldir
   add ix, sp
   lea de, ix-2
   ld c, 6
   ldir
   add ix, sp
   lea de, ix-4
   ld c, 10
   ldir
   add ix, sp
   lea de, ix-6
   ld c, 14
   ldir
   add ix, sp
   lea de, ix-8
   ld c, 18
   ldir
   add ix, sp
   lea de, ix-10
   ld c, 22
   ldir
   add ix, sp
   lea de, ix-12
   ld c, 26
   ldir
   add ix, sp
   lea de, ix-14
   ld c, 30
   ldir
   add ix, sp
   lea de, ix-15
   ld c, 32
   ldir
   add ix, sp
   lea de, ix-14
   ld c, 30
   ldir
   add ix, sp
   lea de, ix-12
   ld c, 26
   ldir
   add ix, sp
   lea de, ix-10
   ld c, 22
   ldir
   add ix, sp
   lea de, ix-8
   ld c, 18
   ldir
   add ix, sp
   lea de, ix-6
   ld c, 14
   ldir
   add ix, sp
   lea de, ix-4
   ld c, 10
   ldir
   add ix, sp
   lea de, ix-2
   ld c, 6
   ldir
   add ix, sp
   lea de, ix
   ldi
   ldi
TempSP2 = $+1
   ld sp, 0
   ret
AoCEDisplayIsoTileEnd:

If you see optimizations, feel free to post it 😛



Code:
ld hl, (currDrawingBuffer)
ld de, 15
add hl, de

Can be replaced with:

ld iy, (currDrawingBuffer)
lea hl, iy+15

Saves 1 byte, and 4 cycles.

That's all I got.
~21 FPS. Not bad, I'd say.
Got smooth scrolling working! 🙂



It can actually be like 3 or 4 times faster, I disabled it for now to show it 😉
I notice a tiny amount of tearing. Is that just the recording feature, or is there actually tearing?
Edges work!!!!!!



Now the optimizing part begin, it's currently 908839 cycles 🙂
Got something done.... it should be somehow related to placing resources and trees... 😛

Hehehe looks cool whatever it's doing 🙂.
tr1p1ea wrote:
Hehehe looks cool whatever it's doing 🙂.

*calculator violently convulses, causes seizures, crashes, hard bricked, children crying in the distance*

tr1p1ea: KEWL 😯 Shock
Alright, it was supposed to be this:



The green pixels are trees, the black pixels not 😛 The map size will be either 128 or 144, not sure yet.
It is supposed to work correctly 😛

PT_ wrote:
It is supposed to work correctly 😛



That's amazing. Like seriously. 👍 👍 👍 😯

Good job so far; can we have a list of things to-do and things accomplished? This would be extremely ambitious for anyone, but knowing you, you'll get it done, and beyond anyone's expectations!

Good Luck!

EDIT:
PT_ wrote:
Alright, it was supposed to be this:



The green pixels are trees, the black pixels not 😛 The map size will be either 128 or 144, not sure yet.


I vote 128, but (i know it's a clone, but you can take some creative liberties 💡) some of the larger buildings should be *slightly* smaller (I.E. a 64 tile size could be reduced to 48 ), just so that players are OK with the smaller map size.
Finally it works!! 😁

PT_ wrote:
Finally it works!! 😁


What are the 4 tiles in the center for? It looks great!
TREES! MORE TREES! WHO WANTS SOMETHING ELSE THAN TREES???

PT_ wrote:
TREES! MORE TREES! WHO WANTS SOMETHING ELSE THAN TREES???



Me! I want rocks 😛
Nice tree sprites, PT! I really like them. 🙂 That looks incredibly smooth.
PT_ wrote:
TREES! MORE TREES! WHO WANTS SOMETHING ELSE THAN TREES???



BUSHES! CACTI! MORE BUSHES! 😁
Great work on this so far, can't wait to see it finished 🙂
Battlesquid wrote:
BUSHES! CACTI! MORE BUSHES! 😁


Okay 🙂

  
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
» Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
» View previous topic :: View next topic  
Page 3 of 10
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement