Announcing: DIABLO2D:LOD in ASM!

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

dispRLE is a routine that takes RLE copmpressed data from iStudio (or something) and copie it to the graph buffer.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

somehow it shows up as garbage on my screen.
anyway where do i strore the information to where each tile goes? In BASIC I stored it in matricies, so i dunno where to put it here...
Life is getting better.
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

????
it gives me a Z80 eror when i try to run it ???

Code: Select all

.nolist
#include    "ti83plus.inc"
.list
.org    $9D93
.db    t2ByteTok, tAsmCmp
        ld a,5
	ld e,5
	ld b,5
        ldir
        ld IX, (tileData)
	ld bc,768
        ldir
 
         LD     DE, PlotSScreen   ;plot it 
    
tileData:
 ;Tile 0
 .db $48,$B4,$4A,$25,$52,$24,$0A,$04
.end
.end
:?:
Life is getting better.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Well LDIR takes DE as the destination, HL as the source and it loops BC times.

Also i think you need to read up on how the graph buffer is used.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
Guest

Post by Guest »

where?
anyway i totally understand this:
"for (Y=0 to mapheight-1)
for (X=0 to mapwidth-1)
current_tile_value = value_at(map + mapwidth*Y + X)
spriteLocation = current_tilemap_location + 8*current_tile_value
screenX = 8*X
screenY = 8*Y
drawSprite(screenX, screenY, spriteLocation)
next X
next Y"
i even did all of that except drawSprite(screenX, screenY, spriteLocation) :(
i cant find that command anywhere...i can only find plotSScreen ....
Mortal-God
New Member
Posts: 60
Joined: Sun 19 Dec, 2004 10:20 pm
Location: here and there

Post by Mortal-God »

ok here is a short tilemapping tutorial. Feel free to add this to the help section.

First the idea behind tile mapping is that you have an array of data thought of as the tile map. I will discuss linear mapping because, well its easiest. Each value in the tile map refers to a tile to be displayed at that position. To achieve a 2d map with a linear array the map is looped according to the defined width of the map.

now on to some actual code:
say we have a small 5x5 map that we want to draw a big x in
and we are going to use 8x8 sprites, so the actual map is 40x40 pixels

first we need to define the tiles

Tiles:
;blank (0)
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
.db %00000000
;down right diagnal (1)
.db %10000000
.db %01000000
.db %00100000
.db %00010000
.db %00001000
.db %00000100
.db %00000010
.db %00000001
;up right diagnal (2)
.db %00000001
.db %00000010
.db %00000100
.db %00001000
.db %00010000
.db %00100000
.db %01000000
.db %10000000
;crossing diagnals (3)
.db %10000001
.db %01000010
.db %00100100
.db %00011000
.db %00011000
.db %00100100
.db %01000010
.db %10000001

now that we have our tiles defined we can make the map we want

map:
.db 1,0,0,0,2
.db 0,1,0,2,0
.db 0,0,3,0,0
.db 0,2,0,1,0
.db 2,0,0,0,1
;the map was written to look like a matrix to make it easy to decipher. It could be written .db 1,0,0,0,2,0,1,0,2,0...

now all we need is a routine that takes your current position or current screen position, finds the top of the screen and uses the values in the map to draw each tile.

the easiest way to do this routine is to start at the top left of the screen, take that value multiply it by the size of our tile sprites, in this case 8 add it to the position Tiles: and then draw the sprite at that position. move to the next tile in the map until you reach the end then add the width of the map - (the number of tiles in a line - 1). continue until you reach the bottom of the screen.

this means that movement can be determined by:
right - add one to position on the map
left - subtract one
up - subtract width of map
down - add width of map
and any combination holds true to (IE : down left - add width - 1 )

as for a sprite drawing routine, write one, find one (make sure you know what it does though), use ionputsprite/ionlargesprite (requires ion libraries be defined)

And now my "final thought." Many have already said it and so will I, but I shall elaborate a little more, because I think you deserve at least that. This is probably not a good idea for your first ASM game, take it from those who have experience with the language and here is why.
First off personally I tried to take on a really big game for my first ASM project (I started working on a Final Fantasy clone). I thought oh this will be easy all I need is a map routine and a battle engine some level up code, items and magic. Oh and a little dialog. I soon learned that each of these were not the simplest things in the world to prgram and especially not in ASM. It can take multiple lines to run a simple operation and then even more to protect certain variables while you do it. This takes time and know how. I eventually finished the game (with a few bugs still) almost 4 years later. It took so long not because by the end I didn't know ASM but because I constantly had to go back and rewrite my old code because there were simpler ways to do it that could possibly be reused in other parts of the program. The point is that those who have done extensive ASM programming know what it would take to make this program work and it is not an easy task. Feel free to try it if you like but know that even we wouldn't take on this project without lots of time, and even then it might be difficult to do alone, and on top of that to still be learning the language. Don't expect it to be easy or quick. If you do decide to attempt it all I can say is good luck.
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

OK, i understand all that, and i found the part called ion fast copy/ ionputSprite..... an here it crashes the calc :(

Code: Select all

.nolist				
        #include "ion.inc"
.list

#ifdef TI83P
        .org    progstart-2
        .db     $BB,6D
#else
        .org    progstart
#endif
        ret				
        jr      nc,begin			

        .db     "COOOOOOOLLLLLL!!!!!",0		
begin:
	bcall(_clrlcdfull)			
	bcall(_homeup)			
Init:
    ld a,20
    ld (x_pos),a
    ld (y_pos),a
Display:
   bcall(_cleargbuf)
    ld a,(y_pos)
    ld l,a
    ld a,(x_pos)
    ld b,8
    ld ix,ground
    call ionPutSprite
    call ionFastCopy
    ld b,8
    ld a,(y_pos)
    add a, b
    ld (y_pos) , a
    cp 56
    jr z,xInc   
    jr Display
xInc:
    ld a,0
    ld (y_pos),a
    ld b,8
    ld a, (x_pos)
    add a,b
    CP 56
    ret
    jr Display
x_pos:
   .db 0
y_pos:
   .db 0
ground:
 .db %01000000
 .db %10100101
 .db %01001000
 .db %00100100
 .db %01010010
 .db %10100000
 .db %01010110
 .db %00100100

.end
END
Life is getting better.
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

Post by the_unknown_one »

Shadow Phoenix wrote: ld b,8
ld a,(y_pos)
add a, b
ld (y_pos) , a
cp 56
jr z,xInc
jr Display
xInc:
ld a,0
ld (y_pos),a
ld b,8
ld a, (x_pos)
add a,b
CP 56
ret
jr Display
[/code]
I'm not sure if this code is good... but the other code should be.
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

i am proud of myself :)
I SO FIXED IT!!!!!!

Code: Select all

.nolist				
        #include "ion.inc"
.list

#ifdef TI83P
        .org    progstart-2
        .db     $BB,$6D
#else
        .org    progstart
#endif
        ret				
        jr      nc,begin			

        .db     "OMG IT WORKS!!!!!! OMFG!!",0		
begin:
	bcall(_clrlcdfull)			
	bcall(_homeup)			
Init:
    ld a,0
    ld (x_pos),a
    ld (y_pos),a
Display:
  
    ld a,(y_pos)
    ld l,a
    ld a,(x_pos)
    ld b,8
    ld ix,ground
    call ionPutSprite
    call ionFastCopy
   
	ld b,8
	ld a,(y_pos)
	add a, b
	ld (y_pos) , a
	cp 64
	jr z,xInc
	
	jr Display
xInc:
	ld a,0
	ld (y_pos),a
	ld b,8
	ld a, (x_pos)
	add a,b
	ld (x_pos), a
	CP 80
	jr z, quit
	jr Display 
quit:
  bcall(_getKey)
  bcall(_cleargbuf)
  ret
x_pos:
   .db 0
y_pos:
   .db 0
ground:
 .db %01000000
 .db %10100010
 .db %01000101
  .db %00000010
 .db %01000000
 .db %10100100
 .db %01001010
 .db %00000100
.end
END
Life is getting better.
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

good

Post by the_unknown_one »

Nice :) If you need help, just ask ;)
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

well...I wil finish the game in a few monthes or so =D.
I learned how to clear the sprites using just the clear buffer...
I dont get how to Clip 2 Sprites together with "AND"
I understand howto do 8-directions key using "keyval.inc"
I understand how to do grayscale using "CalcGS" and Grayscale Maxcoderz Grayscal packet (THANKS!)
Hovewer, it flickers like MAD i i set the frequenci to 6 =D
I cant get my pictures to work using IStudio...
I also know how to make my person "turn" will get later...
HERE my picture doesnt work....
I riped this off examples, but my PICTURE just doesnt Work!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Code: Select all

;==========================================================
;Header
;==========================================================
        .nolist

#ifdef	VTI
	#define TI83P
#endif
	#include	"keys.inc"
        #include        "ion.inc"
	#include	"keyval.inc"
	#define XORSPRITE

	.list

#ifdef  TI83P
        .org    progstart-2
        .db     $BB,$6D
#else
        .org    progstart
#endif
        ret
        jr      nc,Start
        .db     "Movingbg",0

;==========================================================
; start of program
;==========================================================
Start:	call gsClearbuffer
	call gsEnable
	call gsSetFreq
	call gsClearBuffer	
	call pic1 ; Display pic
	call draws
pic1:

	ld hl,layer1
	ld de,gbuf1
	ld bc,768
	ldir
	ld hl,layer2
	ld de,gbuf2
	ld bc,768
	ldir
	
	call gsCopyBuffer
	call gsGetk ; wait for the key

keyloop:call getDI

	cp skUp
	jp z,k_Up
	cp skRight
	jp z,k_Right
	cp skDown
	jp z,k_Down
	cp skLeft
	jp z,k_Left

	cp skUpRight
	jp z,k_UpRight
	cp skDownRight
	jp z,k_DownRight
	cp skDownLeft
	jp z,k_DownLeft
	cp skUpLeft
	jp z,k_UpLeft

	cp skMode
	jp z,quit

	jp keyloop

k_Up:	call m_Up
	call draws
	jp keyloop

k_Right:call m_Right
	call draws
	jp keyloop

k_Down:	call m_Down
	call draws
	jp keyloop

k_Left:	call m_Left
	call draws
	jp keyloop


k_UpRight:
	call m_Up
	call m_Right
	call draws
	jp keyloop

k_DownRight:
	call m_Down
	call m_Right
	call draws
	jp keyloop

k_DownLeft:
	call m_Down
	call m_Left
	call draws
	jp keyloop

k_UpLeft:
	call m_Up
	call m_Left
	call draws
	jp keyloop

m_Up:	ld a,(PosY)
	cp 1
	ret z
	dec a
	ld (PosY),a
	ret

m_Down:	ld a,(PosY)
	cp 63-8
	ret z
	inc a
	ld (PosY),a
	ret

m_Right:ld a,(PosX)
	cp 94-8
	ret z
	inc a
	ld (PosX),a
	ret

m_Left:	ld a,(PosX)
	cp 1
	ret z
	dec a
	ld (PosX),a
	ret

draws:	call	gsClearbuffer
	ld	de,(PosX)
	ld	a,e
	ld	l,d
	ld	b,8
	ld	ix,sprite
	call	gsPutSprite
	ld	a,0
	ld	(penrow),a
	ld	(pencol),a
	ld	hl,Tnm
	bcall(_vputs)
	call	gsCopyBuffer
	ret

PosX:	.db 48
PosY:	.db 32


Layer1:

 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$01,$00,$07,$80,$02,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$02,$00,$3E,$E0,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$04,$00,$60,$00,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$04,$00,$40,$00,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$08,$01,$80,$00,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$08,$03,$00,$00,$01,$80,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$10,$02,$00,$00,$03,$80,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$30,$06,$00,$00,$03,$80,$00,$00,$00,$00,$00
 .db $00,$00,$00,$60,$00,$30,$04,$00,$00,$03,$C6,$0F,$FE,$49,$00,$00
 .db $00,$00,$00,$30,$10,$20,$04,$00,$00,$0F,$82,$3F,$FE,$90,$00,$00
 .db $00,$00,$00,$E0,$00,$20,$0C,$00,$00,$0E,$23,$3F,$FE,$B0,$00,$00
 .db $00,$00,$00,$60,$08,$20,$0C,$00,$00,$00,$31,$3F,$FD,$20,$00,$00
 .db $00,$00,$00,$E0,$08,$20,$0C,$00,$00,$00,$78,$BF,$FA,$40,$00,$00
 .db $00,$00,$01,$C0,$04,$20,$0C,$00,$00,$00,$EC,$9F,$FA,$81,$00,$00
 .db $00,$00,$00,$C0,$0C,$20,$0C,$00,$00,$00,$C6,$43,$D4,$81,$00,$00
 .db $00,$00,$03,$C0,$0E,$20,$0C,$00,$00,$00,$C3,$F0,$09,$02,$00,$00
 .db $00,$00,$01,$80,$0E,$20,$04,$00,$00,$01,$C0,$80,$52,$80,$00,$00
 .db $00,$00,$07,$C0,$0E,$20,$04,$00,$00,$01,$81,$00,$E4,$84,$00,$00
 .db $00,$00,$03,$00,$0F,$00,$00,$00,$00,$03,$82,$00,$09,$88,$00,$00
 .db $00,$00,$01,$C0,$0F,$00,$00,$00,$00,$03,$04,$00,$13,$90,$00,$00
 .db $00,$00,$00,$1C,$0F,$80,$02,$00,$00,$07,$00,$03,$CF,$A0,$00,$00
 .db $00,$00,$01,$D9,$8F,$80,$00,$00,$00,$0F,$88,$04,$1F,$00,$00,$00
 .db $00,$00,$08,$10,$76,$00,$00,$00,$00,$0C,$30,$07,$FF,$40,$00,$00
 .db $00,$00,$13,$93,$1E,$00,$00,$00,$00,$00,$00,$1F,$FE,$80,$00,$00
 .db $00,$00,$0F,$00,$C0,$30,$00,$00,$00,$01,$87,$0F,$FD,$00,$00,$00
 .db $00,$00,$1E,$A1,$20,$ED,$E5,$2F,$17,$77,$BD,$2F,$FE,$00,$00,$00
 .db $00,$00,$1C,$21,$18,$6D,$E7,$5D,$3B,$52,$C1,$2F,$F8,$00,$00,$00
 .db $00,$00,$79,$40,$0C,$65,$82,$5D,$32,$92,$F7,$2F,$F4,$00,$00,$00
 .db $00,$00,$39,$40,$04,$F5,$A6,$5D,$32,$32,$BA,$3F,$E8,$00,$00,$00
 .db $00,$00,$68,$00,$04,$94,$C6,$65,$17,$76,$B6,$5F,$D0,$00,$00,$00
 .db $00,$00,$40,$00,$04,$00,$05,$00,$00,$00,$00,$FF,$E0,$00,$00,$00
 .db $00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$03,$FF,$B8,$08,$00,$00
 .db $00,$01,$80,$00,$01,$F8,$00,$00,$07,$FF,$8B,$FF,$38,$08,$00,$00
 .db $00,$00,$80,$00,$00,$7C,$00,$00,$79,$FF,$9F,$FE,$70,$18,$40,$00
 .db $00,$00,$00,$00,$00,$7C,$00,$3F,$FF,$F8,$1F,$FE,$E0,$38,$40,$00
 .db $00,$03,$0A,$00,$00,$3E,$00,$00,$FF,$C0,$3F,$FD,$C1,$58,$A0,$08
 .db $00,$00,$0A,$00,$10,$1F,$FF,$83,$FF,$00,$3F,$FA,$3F,$98,$3F,$FC
 .db $00,$00,$00,$00,$00,$1F,$FF,$0F,$FC,$00,$7F,$F4,$FF,$18,$7F,$F0
 .db $00,$00,$04,$00,$00,$0F,$FF,$1F,$F8,$01,$FF,$EF,$E0,$99,$7F,$00
 .db $00,$04,$04,$00,$00,$0F,$FE,$3F,$F0,$01,$FF,$EF,$0B,$19,$F8,$00
 .db $00,$1C,$00,$00,$30,$07,$FE,$7F,$F8,$03,$FF,$C3,$3F,$1A,$80,$00
 .db $00,$0C,$08,$81,$00,$03,$FC,$3F,$FE,$07,$FF,$FF,$FF,$1B,$00,$00
 .db $00,$84,$0F,$0F,$78,$01,$FC,$1F,$FF,$FB,$FF,$FF,$FF,$1E,$00,$00
 .db $00,$84,$0F,$7F,$7C,$01,$FC,$01,$FF,$FB,$FF,$FF,$FF,$1E,$3E,$00
 .db $00,$00,$0F,$78,$7E,$00,$F8,$00,$00,$03,$FF,$FF,$FF,$1F,$F8,$00
 .db $00,$90,$1F,$60,$7F,$00,$78,$00,$00,$03,$FF,$FF,$CF,$1B,$E0,$00
 .db $00,$58,$00,$70,$80,$00,$0E,$00,$00,$04,$FF,$FE,$00,$03,$80,$00
 .db $00,$3F,$FF,$C0,$3F,$FF,$F8,$00,$00,$01,$FF,$FF,$FF,$FC,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

Layer2:

 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$80,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$3F,$E0,$00,$00,$00,$00,$00,$01,$FF,$FF,$86,$00,$00
 .db $00,$00,$00,$7F,$E0,$00,$00,$00,$00,$00,$01,$FF,$FF,$0F,$00,$00
 .db $00,$00,$00,$7F,$F0,$00,$00,$00,$00,$00,$00,$FF,$FF,$0F,$00,$00
 .db $00,$00,$00,$FF,$F0,$00,$00,$00,$00,$00,$00,$FF,$FE,$1F,$00,$00
 .db $00,$00,$00,$FF,$F0,$00,$00,$00,$00,$00,$00,$7F,$FC,$3F,$00,$00
 .db $00,$00,$00,$FF,$F8,$00,$00,$00,$00,$00,$10,$7F,$FC,$7E,$00,$00
 .db $00,$00,$01,$FF,$F0,$00,$00,$00,$00,$00,$38,$3C,$38,$7E,$00,$00
 .db $00,$00,$01,$FF,$F0,$00,$00,$00,$00,$00,$3C,$00,$30,$FC,$00,$00
 .db $00,$00,$03,$FF,$F0,$00,$00,$00,$00,$00,$3F,$00,$21,$FC,$00,$00
 .db $00,$00,$03,$FF,$F0,$00,$00,$00,$00,$00,$7E,$00,$03,$F8,$00,$00
 .db $00,$00,$07,$FF,$F0,$00,$00,$00,$00,$00,$7C,$00,$07,$F0,$00,$00
 .db $00,$00,$06,$3F,$F0,$00,$00,$00,$00,$00,$F8,$00,$0F,$E0,$00,$00
 .db $00,$00,$00,$03,$F0,$00,$00,$00,$00,$00,$F8,$00,$3F,$C0,$00,$00
 .db $00,$00,$00,$00,$70,$00,$00,$00,$00,$00,$70,$03,$FF,$C0,$00,$00
 .db $00,$00,$07,$E0,$08,$00,$00,$00,$00,$00,$00,$0F,$FF,$80,$00,$00
 .db $00,$00,$0F,$E0,$00,$00,$00,$00,$00,$00,$00,$0F,$FF,$00,$00,$00
 .db $00,$00,$1F,$E1,$00,$60,$00,$00,$00,$00,$83,$1F,$FE,$00,$00,$00
 .db $00,$00,$3F,$C0,$C0,$76,$C5,$75,$3B,$33,$CF,$9F,$FC,$00,$00,$00
 .db $00,$00,$3F,$C0,$E0,$F6,$E5,$F7,$37,$BF,$B9,$9F,$FC,$00,$00,$00
 .db $00,$00,$3F,$80,$F0,$FC,$E7,$F7,$37,$3F,$BF,$9F,$F8,$00,$00,$00
 .db $00,$00,$7F,$80,$F8,$FC,$E3,$F7,$37,$FF,$B4,$1F,$F0,$00,$00,$00
 .db $00,$00,$7F,$FF,$F8,$FC,$E3,$77,$33,$3B,$B4,$3F,$E0,$00,$00,$00
 .db $00,$00,$FF,$FF,$F8,$00,$02,$00,$00,$00,$30,$7F,$C0,$00,$00,$00
 .db $00,$00,$FF,$FF,$FC,$00,$00,$00,$00,$00,$00,$FF,$C0,$00,$00,$00
 .db $00,$00,$FF,$FF,$FE,$00,$00,$00,$00,$00,$07,$FF,$C0,$00,$00,$00
 .db $00,$01,$FF,$FF,$FF,$80,$00,$00,$06,$00,$0F,$FF,$80,$00,$00,$00
 .db $00,$01,$FF,$FF,$FF,$80,$00,$00,$00,$00,$1F,$FF,$00,$00,$00,$00
 .db $00,$01,$FC,$00,$1F,$C0,$00,$00,$00,$00,$3F,$FE,$00,$20,$40,$00
 .db $00,$03,$FC,$00,$0F,$E0,$00,$00,$00,$00,$7F,$FC,$00,$60,$C0,$00
 .db $00,$03,$FC,$00,$0F,$E0,$00,$00,$00,$00,$FF,$F8,$00,$E0,$80,$00
 .db $00,$03,$F8,$00,$0F,$F0,$00,$00,$00,$00,$FF,$F0,$03,$E0,$80,$00
 .db $00,$03,$F8,$00,$0F,$F0,$00,$00,$00,$01,$FF,$F0,$07,$E0,$00,$00
 .db $00,$03,$F8,$00,$0F,$F8,$00,$00,$00,$03,$FF,$FC,$FF,$E1,$00,$00
 .db $00,$73,$FF,$00,$FF,$FC,$00,$00,$00,$03,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$73,$FF,$80,$FF,$FE,$00,$00,$00,$07,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$73,$FF,$80,$FF,$FE,$00,$00,$00,$07,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$77,$FF,$80,$FF,$FF,$00,$00,$00,$07,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$67,$FF,$80,$FF,$FF,$80,$00,$00,$07,$FF,$FF,$FF,$E4,$00,$00
 .db $00,$27,$FF,$80,$7F,$FF,$F0,$00,$00,$03,$FF,$FF,$FF,$FC,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

sprite:	
	.db $18,$18,$7E,$BD,$3C,$3C,$66,$A5,$00,$00,$7E,$BD,$3C,$24,$7E,$FF
Tnm:
	.db "Domi Alex",0
	
quit:	call gsDisable
	ret


;==========================================================
; grayscale include file
;==========================================================
; comment these defines in or out to activate/deactivate them

#DEFINE NODOUBLEBUFFER	;when on,routines write directly to screen (faster and smaller)
;#DEFINE 3LEVELGRAY	;makes it 3-level grayscale (a bit faster)
;#DEFINE XORSPRITE	;includes gsPutSprite
;#DEFINE LARGESPRITE	;includes gsLargeSprite
;#DEFINE ALIGNEDSPRITE	;includes gsAlignedsprite
;#DEFINE ALIGNEDMASKEDSPRITE

#include "graylib.inc"
#include "getdi.inc"

.end
END

Life is getting better.
User avatar
Shadow Phoenix
Calc Guru
Posts: 835
Joined: Mon 03 Jan, 2005 7:54 pm
Location: out there. seriosly.

Post by Shadow Phoenix »

O.K.
I have tried to draw different sprites for when he turns left/right/up/down. w it crashes
I store 0,1,2,3 in (wh) depending on where he turns, and i use pops/pushes for saving values.
IT CRASHES :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:

Code: Select all

;==========================================================
;Header
;==========================================================
        .nolist

#ifdef	VTI
	#define TI83P
#endif
	#include	"keys.inc"
        #include        "ion.inc"
	#include	"keyval.inc"
	#define XORSPRITE

	.list

#ifdef  TI83P
        .org    progstart-2
        .db     $BB,$6D
#else
        .org    progstart
#endif
        ret
        jr      nc,Start
        .db     "Movingbg",0

;==========================================================
; start of program
;==========================================================
Start:	call gsClearbuffer
	call gsEnable
	call gsSetFreq
	call gsClearBuffer	
	call pic1
	call draws
pic1:

	ld hl,layer1
	ld de,gbuf1
	ld bc,768
	ldir
	ld hl,layer2
	ld de,gbuf2
	ld bc,768
	ldir
	
	call gsCopyBuffer
	call gsGetk

keyloop:call getDI

	cp skUp
	jp z,k_Up
	cp skRight
	jp z,k_Right
	cp skDown
	jp z,k_Down
	cp skLeft
	jp z,k_Left

	cp skUpRight
	jp z,k_UpRight
	cp skDownRight
	jp z,k_DownRight
	cp skDownLeft
	jp z,k_DownLeft
	cp skUpLeft
	jp z,k_UpLeft

	cp skMode
	jp z,quit

	jp keyloop

k_Up:	
	push bc
	ld bc,3
	ld (wh), bc
	pop bc
	call m_Up
	call draws
	jp keyloop

k_Right:
	push bc
	ld bc,2
	ld (wh), bc
	pop bc
	call m_Right
	call draws
	jp keyloop

k_Down:	
	push bc
	ld bc,0
	ld (wh), bc
	pop bc
	call m_Down
	call draws
	jp keyloop

k_Left:	
	push bc
	ld bc,1
	ld (wh), bc
	pop bc
	call m_Left
	call draws
	jp keyloop


k_UpRight:
	push bc
	ld bc,2
	ld (wh), bc
	pop bc
	call m_Up
	call m_Right
	call draws
	jp keyloop

k_DownRight:
	push bc
	ld bc,2
	ld (wh), bc
	pop bc
	call m_Down
	call m_Right
	call draws
	jp keyloop

k_DownLeft:
	push bc
	ld bc,1
	ld (wh), bc
	pop bc
	call m_Down
	call m_Left
	call draws
	jp keyloop

k_UpLeft:
	push bc
	ld bc,1
	ld (wh), bc
	pop bc
	call m_Up
	call m_Left
	call draws
	jp keyloop

m_Up:	
	ld a,(PosY)
	cp 1
	ret z
	dec a
	ld (PosY),a
	ret

m_Down:	

	ld a,(PosY)
	cp 63-8
	ret z
	inc a
	ld (PosY),a
	ret

m_Right:ld a,(PosX)
	cp 94-8
	ret z
	inc a
	ld (PosX),a
	ret

m_Left:	ld a,(PosX)
	cp 1
	ret z
	dec a
	ld (PosX),a
	ret

draws:	call	gsClearbuffer
	ld	de,(PosX)
	ld	a,e
	ld	l,d
	ld	b,8
	
	push bc 
	push af
	
	
	ld a,(wh)
    	cp 1
	call z, load1

	cp 2
	call z,load2

	cp 3
	call z,load3

	cp 0
	call z,load
	
	pop af
	pop bc
	
	call	gsPutSprite
	ld	a,0
	ld	(penrow),a
	ld	(pencol),a
	ld	hl,Tnm
	bcall(_vputs)
	call	gsCopyBuffer
	ret

load1:
	ld ix, Tileleft
load2:
	ld ix, Tileright
load3:
	ld ix, Tileup
load:
	ld ix,sprite

PosX:	.db 48
PosY:	.db 32

wh:      .db 0
Layer1:

 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$01,$00,$07,$80,$02,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$02,$00,$3E,$E0,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$04,$00,$60,$00,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$04,$00,$40,$00,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$08,$01,$80,$00,$01,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$08,$03,$00,$00,$01,$80,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$10,$02,$00,$00,$03,$80,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$30,$06,$00,$00,$03,$80,$00,$00,$00,$00,$00
 .db $00,$00,$00,$60,$00,$30,$04,$00,$00,$03,$C6,$0F,$FE,$49,$00,$00
 .db $00,$00,$00,$30,$10,$20,$04,$00,$00,$0F,$82,$3F,$FE,$90,$00,$00
 .db $00,$00,$00,$E0,$00,$20,$0C,$00,$00,$0E,$23,$3F,$FE,$B0,$00,$00
 .db $00,$00,$00,$60,$08,$20,$0C,$00,$00,$00,$31,$3F,$FD,$20,$00,$00
 .db $00,$00,$00,$E0,$08,$20,$0C,$00,$00,$00,$78,$BF,$FA,$40,$00,$00
 .db $00,$00,$01,$C0,$04,$20,$0C,$00,$00,$00,$EC,$9F,$FA,$81,$00,$00
 .db $00,$00,$00,$C0,$0C,$20,$0C,$00,$00,$00,$C6,$43,$D4,$81,$00,$00
 .db $00,$00,$03,$C0,$0E,$20,$0C,$00,$00,$00,$C3,$F0,$09,$02,$00,$00
 .db $00,$00,$01,$80,$0E,$20,$04,$00,$00,$01,$C0,$80,$52,$80,$00,$00
 .db $00,$00,$07,$C0,$0E,$20,$04,$00,$00,$01,$81,$00,$E4,$84,$00,$00
 .db $00,$00,$03,$00,$0F,$00,$00,$00,$00,$03,$82,$00,$09,$88,$00,$00
 .db $00,$00,$01,$C0,$0F,$00,$00,$00,$00,$03,$04,$00,$13,$90,$00,$00
 .db $00,$00,$00,$1C,$0F,$80,$02,$00,$00,$07,$00,$03,$CF,$A0,$00,$00
 .db $00,$00,$01,$D9,$8F,$80,$00,$00,$00,$0F,$88,$04,$1F,$00,$00,$00
 .db $00,$00,$08,$10,$76,$00,$00,$00,$00,$0C,$30,$07,$FF,$40,$00,$00
 .db $00,$00,$13,$93,$1E,$00,$00,$00,$00,$00,$00,$1F,$FE,$80,$00,$00
 .db $00,$00,$0F,$00,$C0,$30,$00,$00,$00,$01,$87,$0F,$FD,$00,$00,$00
 .db $00,$00,$1E,$A1,$20,$ED,$E5,$2F,$17,$77,$BD,$2F,$FE,$00,$00,$00
 .db $00,$00,$1C,$21,$18,$6D,$E7,$5D,$3B,$52,$C1,$2F,$F8,$00,$00,$00
 .db $00,$00,$79,$40,$0C,$65,$82,$5D,$32,$92,$F7,$2F,$F4,$00,$00,$00
 .db $00,$00,$39,$40,$04,$F5,$A6,$5D,$32,$32,$BA,$3F,$E8,$00,$00,$00
 .db $00,$00,$68,$00,$04,$94,$C6,$65,$17,$76,$B6,$5F,$D0,$00,$00,$00
 .db $00,$00,$40,$00,$04,$00,$05,$00,$00,$00,$00,$FF,$E0,$00,$00,$00
 .db $00,$00,$00,$00,$02,$00,$00,$00,$00,$00,$03,$FF,$B8,$08,$00,$00
 .db $00,$01,$80,$00,$01,$F8,$00,$00,$07,$FF,$8B,$FF,$38,$08,$00,$00
 .db $00,$00,$80,$00,$00,$7C,$00,$00,$79,$FF,$9F,$FE,$70,$18,$40,$00
 .db $00,$00,$00,$00,$00,$7C,$00,$3F,$FF,$F8,$1F,$FE,$E0,$38,$40,$00
 .db $00,$03,$0A,$00,$00,$3E,$00,$00,$FF,$C0,$3F,$FD,$C1,$58,$A0,$08
 .db $00,$00,$0A,$00,$10,$1F,$FF,$83,$FF,$00,$3F,$FA,$3F,$98,$3F,$FC
 .db $00,$00,$00,$00,$00,$1F,$FF,$0F,$FC,$00,$7F,$F4,$FF,$18,$7F,$F0
 .db $00,$00,$04,$00,$00,$0F,$FF,$1F,$F8,$01,$FF,$EF,$E0,$99,$7F,$00
 .db $00,$04,$04,$00,$00,$0F,$FE,$3F,$F0,$01,$FF,$EF,$0B,$19,$F8,$00
 .db $00,$1C,$00,$00,$30,$07,$FE,$7F,$F8,$03,$FF,$C3,$3F,$1A,$80,$00
 .db $00,$0C,$08,$81,$00,$03,$FC,$3F,$FE,$07,$FF,$FF,$FF,$1B,$00,$00
 .db $00,$84,$0F,$0F,$78,$01,$FC,$1F,$FF,$FB,$FF,$FF,$FF,$1E,$00,$00
 .db $00,$84,$0F,$7F,$7C,$01,$FC,$01,$FF,$FB,$FF,$FF,$FF,$1E,$3E,$00
 .db $00,$00,$0F,$78,$7E,$00,$F8,$00,$00,$03,$FF,$FF,$FF,$1F,$F8,$00
 .db $00,$90,$1F,$60,$7F,$00,$78,$00,$00,$03,$FF,$FF,$CF,$1B,$E0,$00
 .db $00,$58,$00,$70,$80,$00,$0E,$00,$00,$04,$FF,$FE,$00,$03,$80,$00
 .db $00,$3F,$FF,$C0,$3F,$FF,$F8,$00,$00,$01,$FF,$FF,$FF,$FC,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

Layer2:

 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$80,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$3F,$E0,$00,$00,$00,$00,$00,$01,$FF,$FF,$86,$00,$00
 .db $00,$00,$00,$7F,$E0,$00,$00,$00,$00,$00,$01,$FF,$FF,$0F,$00,$00
 .db $00,$00,$00,$7F,$F0,$00,$00,$00,$00,$00,$00,$FF,$FF,$0F,$00,$00
 .db $00,$00,$00,$FF,$F0,$00,$00,$00,$00,$00,$00,$FF,$FE,$1F,$00,$00
 .db $00,$00,$00,$FF,$F0,$00,$00,$00,$00,$00,$00,$7F,$FC,$3F,$00,$00
 .db $00,$00,$00,$FF,$F8,$00,$00,$00,$00,$00,$10,$7F,$FC,$7E,$00,$00
 .db $00,$00,$01,$FF,$F0,$00,$00,$00,$00,$00,$38,$3C,$38,$7E,$00,$00
 .db $00,$00,$01,$FF,$F0,$00,$00,$00,$00,$00,$3C,$00,$30,$FC,$00,$00
 .db $00,$00,$03,$FF,$F0,$00,$00,$00,$00,$00,$3F,$00,$21,$FC,$00,$00
 .db $00,$00,$03,$FF,$F0,$00,$00,$00,$00,$00,$7E,$00,$03,$F8,$00,$00
 .db $00,$00,$07,$FF,$F0,$00,$00,$00,$00,$00,$7C,$00,$07,$F0,$00,$00
 .db $00,$00,$06,$3F,$F0,$00,$00,$00,$00,$00,$F8,$00,$0F,$E0,$00,$00
 .db $00,$00,$00,$03,$F0,$00,$00,$00,$00,$00,$F8,$00,$3F,$C0,$00,$00
 .db $00,$00,$00,$00,$70,$00,$00,$00,$00,$00,$70,$03,$FF,$C0,$00,$00
 .db $00,$00,$07,$E0,$08,$00,$00,$00,$00,$00,$00,$0F,$FF,$80,$00,$00
 .db $00,$00,$0F,$E0,$00,$00,$00,$00,$00,$00,$00,$0F,$FF,$00,$00,$00
 .db $00,$00,$1F,$E1,$00,$60,$00,$00,$00,$00,$83,$1F,$FE,$00,$00,$00
 .db $00,$00,$3F,$C0,$C0,$76,$C5,$75,$3B,$33,$CF,$9F,$FC,$00,$00,$00
 .db $00,$00,$3F,$C0,$E0,$F6,$E5,$F7,$37,$BF,$B9,$9F,$FC,$00,$00,$00
 .db $00,$00,$3F,$80,$F0,$FC,$E7,$F7,$37,$3F,$BF,$9F,$F8,$00,$00,$00
 .db $00,$00,$7F,$80,$F8,$FC,$E3,$F7,$37,$FF,$B4,$1F,$F0,$00,$00,$00
 .db $00,$00,$7F,$FF,$F8,$FC,$E3,$77,$33,$3B,$B4,$3F,$E0,$00,$00,$00
 .db $00,$00,$FF,$FF,$F8,$00,$02,$00,$00,$00,$30,$7F,$C0,$00,$00,$00
 .db $00,$00,$FF,$FF,$FC,$00,$00,$00,$00,$00,$00,$FF,$C0,$00,$00,$00
 .db $00,$00,$FF,$FF,$FE,$00,$00,$00,$00,$00,$07,$FF,$C0,$00,$00,$00
 .db $00,$01,$FF,$FF,$FF,$80,$00,$00,$06,$00,$0F,$FF,$80,$00,$00,$00
 .db $00,$01,$FF,$FF,$FF,$80,$00,$00,$00,$00,$1F,$FF,$00,$00,$00,$00
 .db $00,$01,$FC,$00,$1F,$C0,$00,$00,$00,$00,$3F,$FE,$00,$20,$40,$00
 .db $00,$03,$FC,$00,$0F,$E0,$00,$00,$00,$00,$7F,$FC,$00,$60,$C0,$00
 .db $00,$03,$FC,$00,$0F,$E0,$00,$00,$00,$00,$FF,$F8,$00,$E0,$80,$00
 .db $00,$03,$F8,$00,$0F,$F0,$00,$00,$00,$00,$FF,$F0,$03,$E0,$80,$00
 .db $00,$03,$F8,$00,$0F,$F0,$00,$00,$00,$01,$FF,$F0,$07,$E0,$00,$00
 .db $00,$03,$F8,$00,$0F,$F8,$00,$00,$00,$03,$FF,$FC,$FF,$E1,$00,$00
 .db $00,$73,$FF,$00,$FF,$FC,$00,$00,$00,$03,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$73,$FF,$80,$FF,$FE,$00,$00,$00,$07,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$73,$FF,$80,$FF,$FE,$00,$00,$00,$07,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$77,$FF,$80,$FF,$FF,$00,$00,$00,$07,$FF,$FF,$FF,$E0,$00,$00
 .db $00,$67,$FF,$80,$FF,$FF,$80,$00,$00,$07,$FF,$FF,$FF,$E4,$00,$00
 .db $00,$27,$FF,$80,$7F,$FF,$F0,$00,$00,$03,$FF,$FF,$FF,$FC,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

sprite:	
	.db $18,$18,$7E,$BD,$3C,$3C,$66,$A5,$00,$00,$7E,$BD,$3C,$24,$7E,$FF

Tileleft:
 .db $38,$38,$10,$78,$F8,$38,$18,$78,$00,$00,$10,$38,$38,$38,$18,$78
Tileright:
 .db $1C,$1C,$08,$1E,$1F,$1C,$18,$1E,$00,$00,$08,$1C,$1C,$1C,$18,$1E
Tileup:
 .db $18,$18,$7E,$BD,$3C,$18,$7E,$7E,$3C,$3C,$7E,$BD,$3C,$18,$7E,$7E

Tnm:
	.db "Domi Alex",0
	
quit:	call gsDisable
	ret


;==========================================================
; grayscale include file
;==========================================================
; comment these defines in or out to activate/deactivate them

#DEFINE NODOUBLEBUFFER	;when on,routines write directly to screen (faster and smaller)
;#DEFINE 3LEVELGRAY	;makes it 3-level grayscale (a bit faster)
;#DEFINE XORSPRITE	;includes gsPutSprite
;#DEFINE LARGESPRITE	;includes gsLargeSprite
;#DEFINE ALIGNEDSPRITE	;includes gsAlignedsprite
;#DEFINE ALIGNEDMASKEDSPRITE

#include "graylib.inc"
#include "getdi.inc"

.end
END

Life is getting better.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Erm, i am not currently at home so i dont have much time but your code is kind of confusing. For starters your 'wh' variable should either be a word ... or you should use the acc to store to it, rather than bc. Remember that z80 is little-endian.
Last edited by tr1p1ea on Mon 28 Feb, 2005 12:57 am, edited 1 time in total.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

Is it really necessary to repaste your entire code every time you post? My computer gets a bit overloaded trying to view the topic..
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
Spengo
Calc Master
Posts: 1116
Joined: Sat 15 Jan, 2005 3:56 am
Location: ooga booga land
Contact:

Post by Spengo »

I have an idea. How bout uploading it to your website as a .txt file and just linking it to us?
bananas... o.o
Post Reply