
Age of CEmpires I
-
critorAdmin
Niveau 19: CU (Créateur Universel)- Posts: 42390
- Images: 17088
- Joined: 25 Oct 2008, 00:00
- Location: Montpellier
- Gender:
- Calculator(s):→ MyCalcs profile
- YouTube: critor3000
- Twitter: critor2000
- GitHub: critor
Re: Age of CEmpires I
instead of "call cursorimage" at line 29, you could put the entire sub-routine right there , thus no more sp to save because of call's 

-
grosgedVIP++
Niveau 14: CI (Calculateur de l'Infini)- Posts: 770
- Images: 75
- Joined: 14 Sep 2011, 12:29
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Age of CEmpires I
critor wrote::D
This is definitely a quality post


grosged wrote:instead of "call cursorimage" at line 29, you could put the entire sub-routine right there , thus no more sp to save because of call's
Thanks, saved 10K cycles

https://github.com/PeterTillema/Age-Of-CEmpires-I
Age of CEmpires I - In progress!
-
PT_Programmeur
Niveau 13: CU (Calculateur Universel)- Posts: 259
- Joined: 09 Feb 2016, 23:06
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Age of CEmpires I
Well, I've been studying it a bit more...Here's my suggestion :
By the way, I guess that line containing " ld hl, _tile_test \.r2 " won't remain unchanged ?
- Code: Select all
DrawField:
scf
sbc hl, hl
ld (hl), 2
DrawFieldStart:
ld (TempSP2), sp
ld sp,320
exx
ld bc,15 ; that way, the 2 higher bytes of bc'=0
ld iy,(currDrawingBuffer)
add iy,bc
exx
ld a,10 ; a=10
ex af,af
ld a,9 ; a' =9
ld de, 2256 ; = 8*320-10x32+16 = 8x320-9x32-16
ld b, 29
DisplayEachRowLoop:
ex af,af ; alternatively a=10 or 9
ld c,a ; save a into c , in order to restore a from c when loop finished
exx
DisplayRowOfTilesLoop:
ld hl, _tile_test \.r2
AoCEDisplayIsoTile:
; Thanks a lot to TheMachine02 and grosged for help and optimizations!
; Input:
; IY = pointer to output
; HL = pointer to iso sprite
;
lea ix,iy
lea de,ix
ld c,2
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
ld c,2
ldir ; same speed but better choice than ldi\ldi which would put $fffffe value in bc' (then higher bytes of bc' no more =0)
lea iy, iy+32
dec a
jr nz, DisplayRowOfTilesLoop
exx
ld a,c
add iy, de
djnz DisplayEachRowLoop
TempSP2 = $+1
ld sp, 0
ret
DrawFieldEnd:
.echo DrawFieldEnd-DrawFieldStart
By the way, I guess that line containing " ld hl, _tile_test \.r2 " won't remain unchanged ?
-
grosgedVIP++
Niveau 14: CI (Calculateur de l'Infini)- Posts: 770
- Images: 75
- Joined: 14 Sep 2011, 12:29
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Age of CEmpires I
Edges work!!!!!!

Now the optimizing part begin, it's currently 908839 cycles

Now the optimizing part begin, it's currently 908839 cycles

Age of CEmpires I - In progress!
-
PT_Programmeur
Niveau 13: CU (Calculateur Universel)- Posts: 259
- Joined: 09 Feb 2016, 23:06
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Age of CEmpires I
Hey ! already very nice rendering ! Good job, PT_ !
-
grosgedVIP++
Niveau 14: CI (Calculateur de l'Infini)- Posts: 770
- Images: 75
- Joined: 14 Sep 2011, 12:29
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Age of CEmpires I
Got something done.... it should be somehow related to placing resources and trees... 



Age of CEmpires I - In progress!
-
PT_Programmeur
Niveau 13: CU (Calculateur Universel)- Posts: 259
- Joined: 09 Feb 2016, 23:06
- Gender:
- Calculator(s):→ MyCalcs profile
Re: Age of CEmpires I
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.

The green pixels are trees, the black pixels not

Age of CEmpires I - In progress!
-
PT_Programmeur
Niveau 13: CU (Calculateur Universel)- Posts: 259
- Joined: 09 Feb 2016, 23:06
- Gender:
- Calculator(s):→ MyCalcs profile
-
PT_Programmeur
Niveau 13: CU (Calculateur Universel)- Posts: 259
- Joined: 09 Feb 2016, 23:06
- Gender:
- Calculator(s):→ MyCalcs profile
-
PT_Programmeur
Niveau 13: CU (Calculateur Universel)- Posts: 259
- Joined: 09 Feb 2016, 23:06
- Gender:
- Calculator(s):→ MyCalcs profile
Return to Langages alternatifs
Who is online
Users browsing this forum: ClaudeBot [spider] and 7 guests