Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ExecuteCabalFrame(void)
- {
- static int coin_toggle;
- if((RAM[0x5404]&0x07)!=7){
- if(coin_toggle==0){
- coin_toggle=1;
- }
- else{
- RAM[0x5404]|=0x07;
- }
- }
- else{
- coin_toggle=0;
- }
- // Main 68000 (8MHz)
- // -----------------
- cpu_execute_cycles(CPU_68K_0, CPU_FRAME_MHz(12,60)); // M68000 12MHz (60fps)
- cpu_interrupt(CPU_68K_0, 1);
- // Sound Z80 (4MHz)
- // ----------------
- cpu_execute_cycles(CPU_Z80_0, 4000000/60); // Sound Z80
- /*#ifdef RAINE_DEBUG
- print_debug("Z80PC0:%04x\n",z80pc);
- #endif*/
- cpu_interrupt(CPU_Z80_0, 0x38);
- cpu_int_nmi(CPU_Z80_0);
- }
- void DrawCabal(void)
- {
- int x,y,x16,y16;
- int zz,zzzz,ta;
- UINT8 *MAP;
- ClearPaletteMap();
- x16=16;
- y16=16;
- zzzz=0x20;
- zzzz=zzzz&0x3FF;
- for(y=(16+y16);y<(224+32);y+=16){
- zz=zzzz;
- for(x=(16+x16);x<(256+32);x+=16){
- MAP_PALETTE_MAPPED_NEW(
- (ReadWord(&RAM[0x4800+zz])>>12)|0x20, // 0x20 o 0x30 è lo stesso perchè i colori sono uguali
- 16, MAP
- );
- Draw16x16_Mapped_Rot(&GFX[((ReadWord(&RAM[0x4800+zz])&0xFFF)<<8)+0x110000],x,y,MAP);
- zz+=2;
- if((zz&0x1F)==0){zz-=0x20;}
- }
- zzzz+=0x20;
- zzzz=zzzz&0x3FF;
- }
- for(zz=0x3FF8;zz>=0x3800;zz-=8){
- if((RAM[zz+1]&0x01)==1){
- y=16+RAM[zz+0];
- x=(32+ReadWord(&RAM[zz+4]))&0x1FF;
- if((x>16)&&(y>16)&&(x<256+32)&&(y<224+32)){
- ta=ReadWord(&RAM[zz+2])&0xFFF;
- if(ta!=0){
- MAP_PALETTE_MAPPED_NEW(
- (RAM[zz+5]>>3)+0x10,
- 16, MAP
- );
- switch(RAM[zz+5]&0x04){
- case 0x00: Draw16x16_Trans_Mapped_FlipX_Rot(&GFX[(ta<<8)+0x10000],x,y,MAP); break;
- case 0x04: Draw16x16_Trans_Mapped_FlipXY_Rot(&GFX[(ta<<8)+0x10000],x,y,MAP); break;
- }
- }
- }
- }
- }
- zz=0x80;
- for(y=32;y<224+32;y+=8){
- for(x=32;x<256+32;x+=8,zz+=2){
- if((ta=ReadWord(&RAM[0x4000+zz])&0x03FF)!=0){
- MAP = MAP_PALETTE_2BPP(
- Map_12bit_xBGR_Rev_2BPP,
- (ReadWord(&RAM[0x4000+zz])>>10),
- 4
- );
- Draw8x8_Trans_Mapped_Rot(&GFX[ta<<6],x,y,MAP);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement