📄 tecmosys.c
字号:
case 1: // 16x16 ta &= 0xFFFC; Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+0)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+1)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+2)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+3)<<6],x+8,y+8,MAP); break; case 2: // 32x32 dx = x; dy = y; ta &= 0xFFF0; for(i = 0; i < 4; i ++){ x = dx + spr_off[(i<<1) + 0]; y = dy + spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+0)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+1)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+2)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+3)<<6],x+8,y+8,MAP); ta+=4; } break; case 3: // 64x64 dx = x; dy = y; ta &= 0xFFC0; for(i = 0; i < 16; i ++){ x = dx + spr_off[(i<<1) + 0]; y = dy + spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+0)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+1)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+2)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_Rot(&GFX_SPR[(ta+3)<<6],x+8,y+8,MAP); ta+=4; } break; } break; case 1: switch(RAM[zz+4]&0x03){ case 0: // 8x8 Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[ta<<6],x,y,MAP); break; case 1: // 16x16 ta &= 0xFFFC; Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+0)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+1)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+2)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+3)<<6],x+0,y+8,MAP); break; case 2: // 32x32 dx = x + 16; dy = y; ta &= 0xFFF0; for(i = 0; i < 4; i ++){ x = dx - spr_off[(i<<1) + 0]; y = dy + spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+0)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+1)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+2)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+3)<<6],x+0,y+8,MAP); ta+=4; } break; case 3: // 64x64 dx = x + 48; dy = y; ta &= 0xFFC0; for(i = 0; i < 16; i ++){ x = dx - spr_off[(i<<1) + 0]; y = dy + spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+0)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+1)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+2)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipY_Rot(&GFX_SPR[(ta+3)<<6],x+0,y+8,MAP); ta+=4; } break; } break; case 2: switch(RAM[zz+4]&0x03){ case 0: // 8x8 Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[ta<<6],x,y,MAP); break; case 1: // 16x16 ta &= 0xFFFC; Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+0)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+1)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+2)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+3)<<6],x+8,y+0,MAP); break; case 2: // 32x32 dx = x; dy = y + 16; ta &= 0xFFF0; for(i = 0; i < 4; i ++){ x = dx + spr_off[(i<<1) + 0]; y = dy - spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+0)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+1)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+2)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+3)<<6],x+8,y+0,MAP); ta+=4; } break; case 3: // 64x64 dx = x; dy = y + 48; ta &= 0xFFC0; for(i = 0; i < 16; i ++){ x = dx + spr_off[(i<<1) + 0]; y = - spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+0)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+1)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+2)<<6],x+0,y+0,MAP); Draw8x8_Trans_Mapped_FlipX_Rot(&GFX_SPR[(ta+3)<<6],x+8,y+0,MAP); ta+=4; } break; } break; case 3: switch(RAM[zz+4]&0x03){ case 0: // 8x8 Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[ta<<6],x,y,MAP); break; case 1: // 16x16 ta &= 0xFFFC; Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+0)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+1)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+2)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+3)<<6],x+0,y+0,MAP); break; case 2: // 32x32 dx = x + 16; dy = y + 16; ta &= 0xFFF0; for(i = 0; i < 4; i ++){ x = dx - spr_off[(i<<1) + 0]; y = dy - spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+0)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+1)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+2)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+3)<<6],x+0,y+0,MAP); ta+=4; } break; case 3: // 64x64 dx = x + 48; dy = y + 48; ta &= 0xFFC0; for(i = 0; i < 16; i ++){ x = dx - spr_off[(i<<1) + 0]; y = dy - spr_off[(i<<1) + 1]; Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+0)<<6],x+8,y+8,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+1)<<6],x+0,y+8,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+2)<<6],x+8,y+0,MAP); Draw8x8_Trans_Mapped_FlipXY_Rot(&GFX_SPR[(ta+3)<<6],x+0,y+0,MAP); ta+=4; } break; } break; } } } } }}void DrawTecmoSys(void){ int x,y,ta,zz,zzz,zzzz,x16,y16; UINT8 *MAP,bcol; ClearPaletteMap(); MAP_PALETTE_MAPPED_NEW( 0x20, 16, MAP ); bcol=MAP[0]; /* BG0 */ MAKE_SCROLL_1024x512_2_16( ReadWord(&RAM[0x1A30C]), ReadWord(&RAM[0x1A304])+16 ); START_SCROLL_1024x512_2_16(64,64,256,224); MAP_PALETTE_MAPPED_NEW( (RAM[0x14000+zz]>>4)|0x30, 16, MAP ); MAP[0]=bcol; Draw16x16_Mapped_Rot(&GFX_BG0[(ReadWord(&RAM[0x15000+zz])&0xFFF)<<8],x,y,MAP); END_SCROLL_1024x512_2_16(); /* OBJECT LOW */ draw_tecmo_object(0x84); /* BG1 */ MAKE_SCROLL_1024x512_2_16( ReadWord(&RAM[0x1A20C]), ReadWord(&RAM[0x1A204])+16 ); START_SCROLL_1024x512_2_16(64,64,256,224); ta=ReadWord(&RAM[0x13000+zz])&0xFFF; if(GFX_BG1_SOLID[ta]){ // No pixels; skip MAP_PALETTE_MAPPED_NEW( (RAM[0x12000+zz]>>4)|0x20, 16, MAP ); if(GFX_BG1_SOLID[ta]==1) // Some pixels; trans Draw16x16_Trans_Mapped_Rot(&GFX_BG1[ta<<8],x,y,MAP); else // all pixels; solid Draw16x16_Mapped_Rot(&GFX_BG1[ta<<8],x,y,MAP); } END_SCROLL_1024x512_2_16(); /* OBJECT HIGH */ draw_tecmo_object(0x04); /* FG0 */ MAKE_SCROLL_256x256_2_8( ReadWord(&RAM[0x1A10C]), ReadWord(&RAM[0x1A104])+16 ); START_SCROLL_256x256_2_8(64,64,256,224); ta=ReadWord(&RAM[0x10800+zz])&0x7FF; if(GFX_FG0_SOLID[ta]){ // No pixels; skip MAP_PALETTE_MAPPED_NEW( (RAM[0x10000+zz]>>4)|0x10, 16, MAP ); if(GFX_FG0_SOLID[ta]==1) // Some pixels; trans Draw8x8_Trans_Mapped_Rot(&GFX_FG0[ta<<6],x,y,MAP); else // all pixels; solid Draw8x8_Mapped_Rot(&GFX_FG0[ta<<6],x,y,MAP); } END_SCROLL_256x256_2_8();}/*TECMO 68000 SYSTEM (C)1988-89 TECMO===================================Information compiled by [J3d!]Main CPU......68000Sound CPUs....Z80, YM2203, YM2203Screen........256x22468000 MEMORY MAP================-------+--------+--------------------------Start | End | Description-------+--------+--------------------------000000 | 03FFFF | 68000 ROM060000 | 063FFF | 68000 RAM070000 | 0707FF | FG0 RAM A070800 | 070FFF | FG0 RAM B072000 | 072FFF | BG1 RAM A073000 | 073FFF | BG1 RAM B074000 | 074FFF | BG0 RAM A075000 | 075FFF | BG0 RAM B076000 | 0767FF | SPRITE RAM078000 | 0787FF | COLOUR RAM-------+--------+--------------------------COLOR RAM=========- 64 banks of 16 colours- Format is 12-bit bgr- 1024 colours onscreen from palette of 4096------+------------------------------------Banks | Description------+------------------------------------00-0F | Sprites10-1F | FG0 Plans20-2F | BG1 Plane30-3F | BG0 Plane------+------------------------------------SPRITE RAM==========- 16 bytes/sprite entry- 128 entries- Sprites are infact 8x8, but chained to form 8x8, 16x16, 32x32 and 64x64. 32x32 is most common, followed by 16x16, others are rarely needed, but sometimes used...-----+--------+----------------------------Byte | Bit(s) | Description-----+76543210+---------------------------- 0 |........| <Garbage?> 1 |.......x| Flip Y-Axis 1 |......x.| Flip X-Axis 1 |.....x..| Sprite Enabled 1 |.x......| Sprite:BG0 Priority? 1 |x.......| Sprite:BG1 Priority (0=Sprites Infront) 2 |xxxxxxxx| Sprite Number (high) 3 |xxxxxxxx| Sprite Number (low) 4 |........| <Garbage?> 5 |......xx| Sprite Size (0=8x8; 1=16x16; 2=32x32; 3=64x64) 5 |xxxx....| Palette Bank 6 |xxxxxxxx| Y Pos (high) 7 |xxxxxxxx| Y Pos (low) 8 |xxxxxxxx| X Pos (high) 9 |xxxxxxxx| X Pos (low)10-15|........| <Unused>-----+--------+----------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -