|
Post by cyberyoyo on Sept 26, 2012 13:24:39 GMT -5
Hi, I'm new on these boards first of all a big thank you to Devster and all the hard working sega community you guys are great.
This is my problem: I'm trying to use ASM in Basiegaxorz to display tiles on screen (because the basic commands don't really do what I want to do and I think it might be less tressful in the long term to just use ASM)
here is my code
Palettes newpalette, 0,0,16 Palettes pallete2, 1,0,16 LoadTiles newtiles, 230, 256 testdraw
declare asm function testdraw move.l $C00000, a0 ; VDP DATA port move.l $C00004, a1 ;VDP CTRL port move.w $8F02, (a1) ;Set autoincrement (register 15) to 2 move.l $E000, (a1) ;start of PLANE_B move.w #2000, d1 ; number of bytes move.l $20, d2 ;tile reference $20 = 00000000000100000 = tile 1 @loop: move.w d2, (a0) subq.w #1, d1 bne @loop
end function
'============== GAME DATA ==================== newtiles: datafile t2.bin, BIN
newpalette: DATAINT $0E0E,$0244,$024A,$0224,$0222,$0268,$0000,$006C DATAINT $02AE,$068C,$0ACE,$04AC,$0000,$0000,$0000,$0000
DATAINT $0244,$024A,$0224,$0222,$0268,$0000,$006C,$02AE DATAINT $068C,$0ACE,$04AC,$0000,$0000,$0000,$0000,$0000 pallete2: DATAINT $0E0E,$0000,$0CCC,$0A88,$0AEE,$0644,$0442,$0000 DATAINT $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
I have made the ASM function testdraw that is supposed to fill the screen with tile number 1. The tiles are correctly loaded because I have tested with the basic drawtile command and they are okay.
Unfortunately gthe screen remains blank, What am I doing wrong?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 26, 2012 17:07:18 GMT -5
|
|
|
Post by cyberyoyo on Sept 26, 2012 19:47:09 GMT -5
thanks a bunch, the routine in question should help me get on the right tracks
|
|
|
Post by Mairtrus on Sept 27, 2012 8:11:04 GMT -5
Hello dude, and welcome to the forums!
The problem with your code is in this line:
move.l $E000, (a1) ;start of PLANE_B Unfortunately, is not that easy to set the write address on the VDP, since it's made to be managed with commands. I will not go in detail in this because it's large and boring (you can find more details in the old-but-still-awesome collection of documents called "gen_tech"), but to convert a "write address" into a command you can do this:
move.l $E000,d0 ; start of PLANE_B lsl.l #2,d0 lsr.w #2,d0 swap d0 addi.l #$40000000,d0 move.l d0,4(a6)
|
|
|
Post by cyberyoyo on Sept 27, 2012 14:03:32 GMT -5
ok thanks a lot, I have found a bit more informations on the net and indeed, the VDP is not that easy to use
|
|