ASM: draw_tile conversion
This commit is contained in:
parent
ff4bd68c0b
commit
ffea5013d0
|
@ -5,10 +5,48 @@
|
|||
case on
|
||||
longa on
|
||||
longi on
|
||||
|
||||
|
||||
Dummy3 start ASMCODE
|
||||
end
|
||||
|
||||
*
|
||||
* void draw_tile(U8 tileNumber)
|
||||
*
|
||||
draw_tile start ASM_CODE
|
||||
iTileNo equ 5
|
||||
|
||||
phb
|
||||
lda iTileNo,s
|
||||
ora |draw_tilesBank
|
||||
asl A
|
||||
tax
|
||||
|
||||
lda |fb
|
||||
tay
|
||||
adc #4
|
||||
sta |fb
|
||||
|
||||
lda 3,s
|
||||
sta iTileNo,s
|
||||
lda 1,s
|
||||
sta iTileNo-2,s
|
||||
|
||||
lda #$0101
|
||||
sta 1,s
|
||||
plb
|
||||
plb
|
||||
TILEBANK3 entry
|
||||
lda >$880005,x
|
||||
sta >TILEBANK4+1
|
||||
TILEBANK4 entry
|
||||
jsl >$880000
|
||||
|
||||
plb
|
||||
rtl
|
||||
*-------------------------------------------------------------------------------
|
||||
end
|
||||
|
||||
|
||||
*
|
||||
* void DrawTile(short offset, short tileNo)
|
||||
*
|
||||
|
@ -63,6 +101,8 @@ iBank equ 4
|
|||
lda iBank,s
|
||||
sta >TILEBANK+3
|
||||
sta >TILEBANK2+3
|
||||
sta >TILEBANK3+3
|
||||
sta >TILEBANK4+3
|
||||
rep #$30
|
||||
lda 2,s
|
||||
sta iBank,s
|
||||
|
|
|
@ -29,7 +29,7 @@ extern U8 *draw_tllst;
|
|||
#ifdef GFXPC
|
||||
extern U16 draw_filter;
|
||||
#endif
|
||||
extern U8 draw_tilesBank;
|
||||
extern U16 draw_tilesBank;
|
||||
extern rect_t draw_STATUSRECT;
|
||||
extern rect_t draw_SCREENRECT;
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ extern U8 map_frow;
|
|||
/*
|
||||
* tiles offset
|
||||
*/
|
||||
extern U8 map_tilesBank;
|
||||
extern U16 map_tilesBank;
|
||||
|
||||
extern void map_expand(void);
|
||||
extern void map_init(void);
|
||||
|
|
|
@ -186,7 +186,7 @@ extern volatile unsigned long* tick;
|
|||
|
||||
// GS Rendering Stuff
|
||||
extern void SetTileBank(short bank);
|
||||
extern void DrawTile(int offset, int tileNo);
|
||||
extern void DrawTile(int offset, U16 tileNo);
|
||||
extern void SetSpriteBanks(short b0, short b1, short b2, short b3);
|
||||
extern void DrawSprite(int offset, int SpriteNo);
|
||||
|
||||
|
|
|
@ -64,7 +64,11 @@ devtools_run(void)
|
|||
draw_setfb(64, 30 + i * 0x0a);
|
||||
draw_tile((i<10?0x30:'A'-10) + i);
|
||||
}
|
||||
#ifdef GFXGS
|
||||
draw_tilesBank = pos << 8;
|
||||
#else
|
||||
draw_tilesBank = pos;
|
||||
#endif
|
||||
for (i = 0; i < 0x10; i++)
|
||||
for (j = 0; j < 0x10; j++) {
|
||||
draw_setfb(80 + j * 0x0a, 30 + i * 0x0a);
|
||||
|
@ -172,7 +176,11 @@ devtools_run(void)
|
|||
draw_setfb(4, 4);
|
||||
draw_tilesBank = 0;
|
||||
draw_tilesListImm(s);
|
||||
#ifdef GFXGS
|
||||
draw_tilesBank = pos2<<8;
|
||||
#else
|
||||
draw_tilesBank = pos2;
|
||||
#endif
|
||||
for (l = 0; l < 8; l++)
|
||||
for (k = 0; k < 4; k++)
|
||||
for (i = 0; i < 4; i++)
|
||||
|
|
|
@ -88,7 +88,7 @@ U8 *draw_tllst; /* pointer to tiles list */
|
|||
#ifdef GFXPC
|
||||
U16 draw_filter; /* CGA colors filter */
|
||||
#endif
|
||||
U8 draw_tilesBank; /* tile number offset */
|
||||
U16 draw_tilesBank; /* tile number offset */
|
||||
rect_t draw_STATUSRECT = {
|
||||
DRAW_STATUS_SCORE_X, DRAW_STATUS_Y,
|
||||
DRAW_STATUS_LIVES_X + 6 * 8 - DRAW_STATUS_SCORE_X, 8,
|
||||
|
@ -100,7 +100,7 @@ rect_t draw_SCREENRECT = { 0, 0, 320, SYSVID_HEIGHT, NULL };
|
|||
/*
|
||||
* private vars
|
||||
*/
|
||||
static U8 *fb; /* frame buffer pointer */
|
||||
U8 *fb; /* frame buffer pointer */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -234,13 +234,14 @@ draw_tilesSubList()
|
|||
* draw_filter: CGA colors filter
|
||||
* fb: CHANGED (see above)
|
||||
*/
|
||||
#ifndef GFXGS
|
||||
void
|
||||
draw_tile(U8 tileNumber)
|
||||
{
|
||||
#ifdef GFXGS
|
||||
//$$JGA TODO convert to ASM
|
||||
|
||||
int tileNo = (((int)draw_tilesBank)*256)+tileNumber;
|
||||
U16 tileNo = draw_tilesBank | tileNumber;
|
||||
|
||||
//printf("fb=%04x tileNo=%04x\n", (int)fb, tileNo);
|
||||
//sys_sleep(1000); // Wait 1 second
|
||||
|
@ -289,6 +290,7 @@ draw_tile(U8 tileNumber)
|
|||
fb += 8; /* next tile */
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Draw a sprite
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
U8 map_map[0x2C][0x20];
|
||||
U8 map_eflg[0x100];
|
||||
U8 map_frow;
|
||||
U8 map_tilesBank;
|
||||
U16 map_tilesBank;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -105,8 +105,11 @@ map_init(void)
|
|||
draw_filter = 0xffff;
|
||||
map_tilesBank = (map_submaps[game_submap].page == 1) ? 3 : 2;
|
||||
#endif
|
||||
#if defined(GFXST) || defined(GFXGS)
|
||||
#ifdef GFXST
|
||||
map_tilesBank = (map_submaps[game_submap].page == 1) ? 2 : 1;
|
||||
#endif
|
||||
#ifdef GFXGS
|
||||
map_tilesBank = (map_submaps[game_submap].page == 1) ? 0x200 : 0x100;
|
||||
#endif
|
||||
map_eflg_expand((map_submaps[game_submap].page == 1) ? 0x10 : 0x00);
|
||||
map_expand();
|
||||
|
|
|
@ -80,7 +80,7 @@ U32
|
|||
sys_gettime(void)
|
||||
{
|
||||
#ifdef IIGS
|
||||
return tick[0] * 16;
|
||||
return tick[0] << 4;
|
||||
#else
|
||||
static U32 ticks_base = 0;
|
||||
U32 ticks;
|
||||
|
@ -102,7 +102,7 @@ sys_sleep(int s)
|
|||
{
|
||||
#ifdef IIGS
|
||||
// on GS we're going to work in ms, also we don't sleep, we just wait
|
||||
while (s > 0)
|
||||
while (s > 8)
|
||||
{
|
||||
sysvid_wait_vblank();
|
||||
s -= 16; // About 1/60th of a second
|
||||
|
|
Loading…
Reference in New Issue