0 Members and 4 Guests are viewing this topic.
;portssLSB0 = 00hsMSB0 = 01hsX0 = 02hsY0 = 03hsMethod0 = 04hsLSB1 = 05hsMSB1 = 06hsX1 = 07hsY1 = 08hsMethod1 = 09hsLSB2 = 0AhsMSB2 = 0BhsX2 = 0ChsY2 = 0DhsMethod2 = 0EhsLSB3 = 0FhsMSB3 = 10hsX3 = 11hsY3 = 12hsMethod3 = 13hsLSB4 = 14hsMSB4 = 15hsX4 = 16hsY4 = 17hsMethod4 = 18hsLSB5 = 19hsMSB5 = 1AhsX5 = 1BhsY5 = 1ChsMethod5 = 1DhsLSB6 = 1EhsMSB6 = 1FhsX6 = 20hsY6 = 21hsMethod6 = 22hsLSB7 = 23hsMSB7 = 24hsX7 = 25hsY7 = 26hsMethod7 = 27hkey0 = 28hkey1 = 29hkey2 = 2Ahkey3 = 2Bhkey4 = 2Chkey5 = 2Dhkey6 = 2EhkeyMask = 2FhsMask = 30hstatus = 31h ;bit 7 set means turn the system off, bit 0 = LCD update;RAM =atessaveSScreen = $86ECstackptr = 32hPClow = 33h+saveSScreenPChigh = 34h+saveSScreenstackbase = 80h+saveSScreen_FlashToRam2 = 8054h;flagsc = 64z = 128#define lda(addr1 , addr2) .db 0,addr1,addr2#define adda(addr1 , addr2) .db 1,addr1,addr2#define adca(addr1 , addr2) .db 2,addr1,addr2#define suba(addr1 , addr2) .db 3,addr1,addr2#define sbca(addr1 , addr2) .db 4,addr1,addr2#define xora(addr1 , addr2) .db 5,addr1,addr2#define ora(addr1 , addr2) .db 6,addr1,addr2#define anda(addr1 , addr2) .db 7,addr1,addr2#define cpa(addr1 , addr2) .db 8,addr1,addr2#define inca(addr) .db 9,addr#define rotl(addr) .db 10,addr#define shftl(addr) .db 11,addr#define pusha(addr) .db 12,addr#define pop(addr) .db 13,addr#define inv(addr) .db 14,addr#define ldira(addr,size) .db 15,addr,size#define ldc(addr , const) .db 16,addr,const#define addc(addr , const) .db 17,addr,const#define adcc(addr , const) .db 18,addr,const#define subc(addr , const) .db 19,addr,const#define sbcc(addr , const) .db 20,addr,const#define xorc(addr , const) .db 21,addr,const#define orc(addr , const) .db 22,addr,const#define andc(addr , const) .db 23,addr,const#define cpc(addr , const) .db 24,addr,const#define deca(addr) .db 25,addr#define rotr(addr) .db 26,addr#define shftr(addr) .db 27,addr#define pushc(const) .db 28,const#define ex(addr1,addr2) .db 29,addr1,addr2#define bits(addr,const) .db 30,addr,const#define ldirc(addr,size) .db 31,addr,size#define ret() .db 32#define setz() .db 33#define setc() .db 34#define togz() .db 35#define togc() .db 36#define jp1(Addr) .db 37,Addr#define jp2(Addr) .db 38,Addr#define jrf(offset) .db 39,offset-1-$#define jrfz(offset) .db 39+z,offset-1-$#define jrb(offset) .db 40,1-offset+$#define call1(Addr) .db 41,Addr#define call2(Addr) .db 42,Addr#define callf(offset) .db 43,offset-1-$#define callb(offset) .db 44,1-offset+$#define ldcz(addr1 , const) .db 16+128,addr1,const#define jrbz(offset) .db 40+128,1-offset+$#define incaz(addr) .db 9+128,addr#define decaz(addr) .db 25+128,addr#define retz() .db 32+128;key0jkDown = %11111110jkRight = %11111101jkLeft = %11111011jkUp = %11110111;key1jkClear = %10111111;key6jkGraph = 254jkTrace = 253jkZoom = 251jkWindow = 247jkY = 239jk2nd = 223jkMode = 191jkDel = 127lcdupdatebit = 0spriteupdatebit = 1
"Jade.inc".org $00mapX = 252mapY = 253counter1 = 254counter2 = 255#define BIT ^$FFstart: ldirc(keyMask,2) ;keyMask, spriteMask .db %0100011,%1 ;enable key groups 0 and 1, sprite0 ldirc(sLSB0,5) .dw $100+sprite \ .db 0,0,2 ldirc(mapX,4) .db 0,0,12,2tilemap: orc(status,2) ;tell the status port to draw the sprites addc(sX0,8) deca(counter1) togz() jrbz(tilemap) ldc(counter1,12) ldc(sX0,0) ldc(sY0,8*7) deca(counter2) togz() jrbz(tilemap) ldc(sY0,8*6) loop: orc(status,2) ;tell the status port to draw the sprites orc(status,3) ;tell the status port to update the LCD, then draw the sprites bits(key0,jkDown BIT) incaz(sY0) bits(key0,jkUp BIT) decaz(sY0) bits(key0,jkLeft BIT) incaz(sX0) bits(key0,jkRight BIT) decaz(sX0) cpc(key1,jkClear) ldcz(status,$80) jrb(loop)map:.db 1,1,1,1,1,1,1,1,1,1,1,1.db 1,0,0,0,0,0,0,0,0,0,0,1.db 1,0,0,0,0,0,0,0,0,0,0,1.db 1,0,0,0,0,0,0,0,0,0,0,1.db 1,0,0,0,0,0,0,0,0,0,0,1.db 1,0,0,0,0,0,0,0,0,0,0,1.db 1,0,0,0,0,0,0,0,0,0,0,1.db 1,1,1,1,1,1,1,1,1,1,1,1sprite:.db %11111111.db %11011011.db %10000001.db %10011001.db %10011001.db %10000001.db %11011011.db %11111111
What do you mean draw a string? Just print text? I also tested out AsmDream but i just can't get used to its syntax, i think for now i'm going to stick with the computer
EDIT : Also, what instructions can currently be used with c/z flags? To make defining things easier, we could do something like:lda = 0adda = 1adca = 2;... etc.c = 64z = 128;...#define lda(addr1 , addr2) .db lda,addr1,addr2#define ldac(addr1 , addr2) .db lda+c,addr1,addr2#define ldaz(addr1 , addr2) .db lda+z,addr1,addr2#define adda(addr1 , addr2) .db adda,addr1,addr2#define addac(addr1 , addr2) .db adda+c,addr1,addr2#define addaz(addr1 , addr2) .db adda+z,addr1,addr2#define adca(addr1 , addr2) .db adca,addr1,addr2#define adcac(addr1 , addr2) .db adca+c,addr1,addr2#define adcaz(addr1 , addr2) .db adca+z,addr1,addr2;etc.
EDIT2 : So i've been trying to figure out how to get a simple tilemap working but i can't think of how to do it without registers Here's what i've got so far, a fake tilemap setup:
spriteX = stackbase-1spriteY = stackbase-2tilenum = stackbase-3.org 0 ldc(keyMask,255) ldirc(160,96);tilemap data;drawn by column .db 1,1,1,1,1,1,1,1 .db 1,0,2,2,2,2,0,1 .db 1,0,0,2,2,0,0,1 .db 1,0,0,0,0,0,0,1 .db 1,0,0,0,0,0,0,1 .db 1,0,0,0,0,0,0,1 .db 1,0,0,0,0,0,0,1 .db 1,0,0,0,0,0,0,1 .db 1,0,0,0,0,0,0,1 .db 1,0,0,2,2,0,0,1 .db 1,0,2,2,2,2,0,1 .db 1,1,1,1,1,1,1,1 ldirc(sMSB0,4) .db 1,96,0,2 ldc(sMask,1)TileMap: ldc(sY0,64) subc(sX0,8) jrfc(Start)TileMapLoop: subc(sY0,8) jrbc(TileMap) pop(tilenum) rotl(tilenum) rotl(tilenum) rotl(tilenum) addc(tilenum,tiles) lda(sLSB0,tilenum) orc(status,2) jrb(TileMapLoop)tiles: .db 0,0,0,0,0,0,0,0 .db 3Ch,42h,81h,81h,81h,81h,42h,3Ch .db 3Ch,7Eh,$FF,$FF,$FF,$FF,7Eh,3Ch Start: ldc(stackptr,0) orc(status,1) ldc(status,80h)