File: main.c - Tab length: 1 2 4 8 - Lines: on off - No wrap: on off

0001: #include <stdio.h>
0002: #include <stdio.h>
0003: #include <stdlib.h>
0004: #include <input.h>
0005: #include <DATlib.h>
0006: #include "externs.h"
0007: #include "sound.h"
0008: 
0009: #define FRONT_START_X 157
0010: #define FRONT_START_Y 0
0011: #define FRONT_MIN_X 8
0012: #define FRONT_MAX_X 624
0013: #define FRONT_MIN_Y 0
0014: #define FRONT_MAX_Y 0
0015: 
0016: #define BACK_MIN_X 8
0017: #define BACK_MAX_X 149
0018: #define BACK_MIN_Y 5
0019: #define BACK_MAX_Y 8
0020: 
0021: int breast_frame=0;
0022: 
0023: int action=0;
0024: int choice=0;
0025: int wherefrom=0;
0026: int miniGame=0;
0027: int controlON=0;
0028: int success=0;
0029: bool button_available;
0030: short curs_x=0;
0031: short curs_y=0;
0032: int frame=0;
0033: int sec=0;
0034: int min=0;
0035: picture testPict;
0036: 
0037: typedef struct bkp_ram_info {
0038:     WORD debug_dips;
0039:     BYTE stuff[254];
0040:     //256 bytes
0041: } bkp_ram_info;
0042: 
0043: bkp_ram_info bkp_data;
0044: 
0045: extern uint _end;
0046: BYTE p1,p2,ps,p1e,p2e;
0047: uint callBackCounter;
0048: 
0049: //fix palettes for text
0050: static const ushort fixPalettes[]= {
0051:     0x8000, 0xefb8, 0x0222, 0x5fa7, 0xde85, 0x2c74, 0x2a52, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0052:     0x8000, 0xebea, 0x0041, 0xa9d8, 0x57c7, 0xf6b5, 0x43a4, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0053:     0x8000, 0x014c, 0x9113, 0xb15e, 0x317f, 0x119f, 0x11af, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0054:     0x8000, 0xeb21, 0x0111, 0xee21, 0x6f31, 0x6f51, 0x6f61, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0055:     0x8000, 0xed31, 0xc311, 0xee51, 0x4f81, 0x4fa1, 0x4fc1, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0056:     0x8000, 0xbad3, 0x0111, 0x09c0, 0xe7b0, 0xc580, 0xe250, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0057:     0x8000, 0xefb8, 0x0111, 0xde96, 0x3c75, 0x2950, 0x4720, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
0058:     0x8000, 0x8444, 0x0111, 0xf555, 0xf666, 0x7777, 0x8888, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000 };
0059:    
0060: #define CLIPPING 5
0061: 
0062: void scrollerInitClipped(scroller *s, scrollerInfo *si, ushort baseSprite, ushort basePalette, short posX, short posY, ushort clipping) {
0063:     ushort i,addr,pos;
0064: 
0065:     scrollerInit(s,si,baseSprite,basePalette,posX,posY);
0066:     addr=VRAM_POSY_ADDR(baseSprite);
0067:     //pos=((YSHIFT-(0-posY))<<7)|(clipping&0x3f);
0068:     pos=VRAM_POSY(-posY,SPR_UNLINK,clipping);
0069:     for(i=0;i<21;i++)
0070:         SC234Put(addr++,pos);
0071: }
0072: 
0073: void scrollerSetPosClipped(scroller *s, short toX, short toY, ushort clipping) {
0074:     ushort i,addr,pos;
0075: 
0076:     if(s->scrlPosY!=toY) {  //Y moved ?
0077:         scrollerSetPos(s,toX,toY);
0078:        
0079:         addr=VRAM_POSY_ADDR(s->baseSprite);
0080:         //pos=((YSHIFT-(0-toY))<<7)|(clipping&0x3f);
0081:         pos=VRAM_POSY(-toY,SPR_UNLINK,clipping);
0082:         for(i=0;i<21;i++)
0083:             SC234Put(addr++,pos);
0084:         //s->scrlPosY=toY;
0085:     } else scrollerSetPos(s,toX,toY);
0086: }
0087: 
0088: void sortSprites(aSprite *list[], int count) {
0089:     //insertion sort
0090:     int x,y;
0091:     aSprite *tmp;
0092:    
0093:     for(x=1;x<count;x++) {
0094:         y=x;
0095:         while(y>0 && (list[y]->posY < list[y-1]->posY)) {
0096:             tmp=list[y];
0097:             list[y]=list[y-1];
0098:             list[y-1]=tmp;
0099:             y--;
0100:         }
0101:     }
0102: }
0103: 
0104: #define POOL_MODE
0105: #define LOTS
0106: 
0107: const char sinTable[]={ 32,34,35,37,38,40,41,43,44,46,47,48,50,51,52,53,
0108:                         55,56,57,58,59,59,60,61,62,62,63,63,63,64,64,64,
0109:                         64,64,64,64,63,63,63,62,62,61,60,59,59,58,57,56,
0110:                         55,53,52,51,50,48,47,46,44,43,41,40,38,37,35,34,
0111:                         32,30,29,27,26,24,23,21,20,18,17,16,14,13,12,11,
0112:                         9,8,7,6,5,5,4,3,2,2,1,1,1,0,0,0,
0113:                         0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,8,
0114:                         9,11,12,13,14,16,17,18,20,21,23,24,26,27,29,30};
0115: 
0116: //misc fix maps
0117: static const ushort fadeData0[15]={0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x03f0,0x0000};
0118: static const ushort fadeData1[15]={0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x03f1,0x0000};
0119: static const ushort fadeData2[15]={0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x03f2,0x0000};
0120: static const ushort fadeData3[15]={0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x03f3,0x0000};
0121: static const ushort fadeData4[15]={0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x03f4,0x0000};
0122: static const ushort fadeData5[15]={0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x03f5,0x0000};
0123: static const ushort fadeData6[15]={0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x03f6,0x0000};
0124: static const ushort fadeData7[15]={0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x03f7,0x0000};
0125: static const ushort fadeData8[15]={0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x03f8,0x0000};
0126: static const ushort fadeData9[15]={0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x03f9,0x0000};
0127: static const ushort fadeDataA[15]={0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x03fa,0x0000};
0128: static const uint fadeData[11]={(uint)fadeData0,(uint)fadeData1,(uint)fadeData2,(uint)fadeData3,(uint)fadeData4,(uint)fadeData5,(uint)fadeData6,(uint)fadeData7,(uint)fadeData8,(uint)fadeData9,(uint)fadeDataA};
0129: static const ushort logo_95[78]={   0x0500,0x0501,0x0502,0x0503,0x0504,0x0505,0x0506,0x0507,0x0508,0x0509,0x050a,0x050b,0x0000,
0130:                                     0x0510,0x0511,0x0512,0x0513,0x0514,0x0515,0x0516,0x0517,0x0518,0x0519,0x051a,0x051b,0x0000,
0131:                                     0x0520,0x0521,0x0522,0x0523,0x0524,0x0525,0x0526,0x0527,0x0528,0x0529,0x052a,0x052b,0x0000,
0132:                                     0x0530,0x0531,0x0532,0x0533,0x0534,0x0535,0x0536,0x0537,0x0538,0x0539,0x053a,0x053b,0x0000,
0133:                                     0x0540,0x0541,0x0542,0x0543,0x0544,0x0545,0x0546,0x0547,0x0548,0x0549,0x054a,0x054b,0x0000,
0134:                                     0x0550,0x0551,0x0552,0x0553,0x0554,0x0555,0x0556,0x0557,0x0558,0x0559,0x055a,0x055b,0x0000 };
0135: static const ushort logo_96[78]={   0x0560,0x0561,0x0562,0x0563,0x0564,0x0565,0x0566,0x0567,0x0568,0x0569,0x056a,0x056b,0x0000,
0136:                                     0x0570,0x0571,0x0572,0x0573,0x0574,0x0575,0x0576,0x0577,0x0578,0x0579,0x057a,0x057b,0x0000,
0137:                                     0x0580,0x0581,0x0582,0x0583,0x0584,0x0585,0x0586,0x0587,0x0588,0x0589,0x058a,0x058b,0x0000,
0138:                                     0x0590,0x0591,0x0592,0x0593,0x0594,0x0595,0x0596,0x0597,0x0598,0x0599,0x059a,0x059b,0x0000,
0139:                                     0x05a0,0x05a1,0x05a2,0x05a3,0x05a4,0x05a5,0x05a6,0x05a7,0x05a8,0x05a9,0x05aa,0x05ab,0x0000,
0140:                                     0x05b0,0x05b1,0x05b2,0x05b3,0x05b4,0x05b5,0x05b6,0x05b7,0x05b8,0x05b9,0x05ba,0x05bb,0x0000 };
0141: static const ushort logo_97[78]={   0x0600,0x0601,0x0602,0x0603,0x0604,0x0605,0x0606,0x0607,0x0608,0x0609,0x060a,0x060b,0x0000,
0142:                                     0x0610,0x0611,0x0612,0x0613,0x0614,0x0615,0x0616,0x0617,0x0618,0x0619,0x061a,0x061b,0x0000,
0143:                                     0x0620,0x0621,0x0622,0x0623,0x0624,0x0625,0x0626,0x0627,0x0628,0x0629,0x062a,0x062b,0x0000,
0144:                                     0x0630,0x0631,0x0632,0x0633,0x0634,0x0635,0x0636,0x0637,0x0638,0x0639,0x063a,0x063b,0x0000,
0145:                                     0x0640,0x0641,0x0642,0x0643,0x0644,0x0645,0x0646,0x0647,0x0648,0x0649,0x064a,0x064b,0x0000,
0146:                                     0x0650,0x0651,0x0652,0x0653,0x0654,0x0655,0x0656,0x0657,0x0658,0x0659,0x065a,0x065b,0x0000 };
0147: static const ushort logo_98[78]={   0x0660,0x0661,0x0662,0x0663,0x0664,0x0665,0x0666,0x0667,0x0668,0x0669,0x066a,0x066b,0x0000,
0148:                                     0x0670,0x0671,0x0672,0x0673,0x0674,0x0675,0x0676,0x0677,0x0678,0x0679,0x067a,0x067b,0x0000,
0149:                                     0x0680,0x0681,0x0682,0x0683,0x0684,0x0685,0x0686,0x0687,0x0688,0x0689,0x068a,0x068b,0x0000,
0150:                                     0x0690,0x0691,0x0692,0x0693,0x0694,0x0695,0x0696,0x0697,0x0698,0x0699,0x069a,0x069b,0x0000,
0151:                                     0x06a0,0x06a1,0x06a2,0x06a3,0x06a4,0x06a5,0x06a6,0x06a7,0x06a8,0x06a9,0x06aa,0x06ab,0x0000,
0152:                                     0x06b0,0x06b1,0x06b2,0x06b3,0x06b4,0x06b5,0x06b6,0x06b7,0x06b8,0x06b9,0x06ba,0x06bb,0x0000 };
0153: 
0154: //#define TIME 120
0155: 
0156: void Control_Sub()
0157: {
0158:     p1=volMEMBYTE(P1_CURRENT);
0159:     ps=volMEMBYTE(PS_CURRENT);
0160:     p1e=volMEMBYTE(P1_EDGE);
0161:    
0162:     if(button_available==true)
0163:     {
0164:         if(miniGame==1)
0165:         {
0166:             controlON=0;
0167:            
0168:             if((p1&JOY_LEFT)&&curs_x>0)
0169:             {
0170:                 curs_x-=2;
0171:                 controlON=1;
0172:             }
0173:             if((p1&JOY_RIGHT)&&curs_x<304)
0174:             {
0175:                 curs_x+=2;
0176:                 controlON=1;
0177:             }
0178:             if((p1&JOY_UP)&&curs_y>0)
0179:             {
0180:                 curs_y-=2;
0181:                 controlON=1;
0182:             }
0183:             if((p1&JOY_DOWN)&&curs_y<192)
0184:             {
0185:                 curs_y+=2;
0186:                 controlON=1;
0187:             }
0188:         }
0189:         else
0190:         {
0191:             if((p1e&JOY_A)||(p1e&JOY_B)||(p1e&JOY_C))
0192:             {
0193:                 clearSprites(22,3);
0194:                 clearFixLayer();
0195:                 action++;
0196:             }
0197:         }
0198:     }
0199: }
0200: 
0201: void avatar(int character, int textheight)
0202: {
0203:     if(character==0)
0204:     {
0205:         pictureInit(&testPict, &Avatar1,22,16,8,176-(textheight*8),FLIP_NONE);
0206:         palJobPut(16, Avatar1.palInfo->count, Avatar1.palInfo->data);
0207:     }
0208:     if(character==1)
0209:     {
0210:         pictureInit(&testPict, &Avatar2,22,16,8,176-(textheight*8),FLIP_NONE);
0211:         palJobPut(16, Avatar2.palInfo->count, Avatar2.palInfo->data);
0212:     }
0213:     if(character==2)
0214:     {
0215:         pictureInit(&testPict, &Avatar3,22,16,8,176-(textheight*8),FLIP_NONE);
0216:         palJobPut(16, Avatar3.palInfo->count, Avatar3.palInfo->data);
0217:     }
0218:     if(character==3)
0219:     {
0220:         pictureInit(&testPict, &Avatar4,22,16,8,176-(textheight*8),FLIP_NONE);
0221:         palJobPut(16, Avatar4.palInfo->count, Avatar4.palInfo->data);
0222:     }
0223:     if(character==4)
0224:     {
0225:         pictureInit(&testPict, &Avatar5,22,16,8,176-(textheight*8),FLIP_NONE);
0226:         palJobPut(16, Avatar5.palInfo->count, Avatar5.palInfo->data);
0227:     }
0228: }
0229: 
0230: void GameOver()
0231: {
0232:     int screenTimer=0;
0233:     button_available=false;
0234:    
0235:     send_sound_command(ADPCM_GAMEOVER);
0236:    
0237:     if(success==0)
0238:     {
0239:         fixPrint(15,15,4,3,"GAME OVER");
0240:     }
0241:     else
0242:     {
0243:         fixPrint(16,15,4,3,"YOU WIN!");
0244:     }
0245:    
0246:     while(1) {
0247:         SCClose();
0248:         waitVBlank();
0249:        
0250:         if(++screenTimer==780)
0251:         {
0252:             screenTimer=0;
0253:             miniGame=0;
0254:             success=0;
0255:             clearSprites(1,21);
0256:             SCClose();
0257:             waitVBlank();
0258:             main();
0259:         }
0260:     }
0261: }
0262: 
0263: void TimerEd()
0264: {
0265:     frame++;
0266:     if(frame==60)
0267:     {
0268:         sec--;
0269:         frame=0;
0270:     }
0271:     if(sec==60)
0272:     {
0273:         min--;
0274:         sec=0;
0275:     }
0276: }
0277: 
0278: void Lose1() {
0279:     scroller sc;
0280:     // short posX=0;
0281:     // short posY=0;
0282:     // ushort *data;
0283:     // ushort flipMode=0;
0284:     button_available=true;
0285:    
0286:     clearFixLayer();
0287:     scrollerInit(&sc,&BkgA,1,23,0,0);
0288:     palJobPut(23, BkgA.palInfo->count, BkgA.palInfo->data);
0289: 
0290:     while(1) {
0291:         SCClose();
0292:         waitVBlank();
0293:         Control_Sub();
0294:            
0295:         if(action==0)
0296:         {
0297:             fixPrint(1,27,4,3,"Unfortunately, she's not here anymore.");
0298:             fixPrint(1,28,4,3,"It's a catastrophe!");
0299:         }
0300:         if(action==1)
0301:         {
0302:             fixPrint(1,27,4,3,"Looks like I'm gonna spend this night");
0303:             fixPrint(1,28,4,3,"all alone.");
0304:         }
0305:         if(action==2)
0306:         {
0307:             fixPrint(1,27,4,3,"The most awful that this incident can");
0308:             fixPrint(1,28,4,3,"destroy my career! Oh, shit...");
0309:         }
0310:         if(action==3)
0311:         {
0312:             GameOver();
0313:         }
0314:        
0315:         //scrollerSetPos(&sc,posX,posY);
0316:     }
0317: }
0318: 
0319: void Lose2() {
0320:     scroller sc;
0321:     // short posX=0;
0322:     // short posY=0;
0323:     // ushort *data;
0324:     // ushort flipMode=0;
0325:     button_available=true;
0326:    
0327:     clearFixLayer();
0328:     scrollerInit(&sc,&BkgA,1,23,0,0);
0329:     palJobPut(23, BkgA.palInfo->count, BkgA.palInfo->data);
0330: 
0331:     while(1) {
0332:         SCClose();
0333:         waitVBlank();
0334:         Control_Sub();
0335:            
0336:         if(action==0)
0337:         {
0338:             fixPrint(1,28,4,3,"It's just a catastrophe!");
0339:         }
0340:         if(action==1)
0341:         {
0342:             fixPrint(1,27,4,3,"Looks like I'm gonna spend this night");
0343:             fixPrint(1,28,4,3,"all alone.");
0344:         }
0345:         if(action==2)
0346:         {
0347:             fixPrint(1,27,4,3,"The most awful that this incident can");
0348:             fixPrint(1,28,4,3,"destroy my career! Oh, shit...");
0349:         }
0350:         if(action==3)
0351:         {
0352:             GameOver();
0353:         }
0354:        
0355:         //scrollerSetPos(&sc,posX,posY);
0356:     }
0357: }
0358: 
0359: void Lose3() {
0360:     scroller sc;
0361:     // short posX=0;
0362:     // short posY=0;
0363:     // ushort *data;
0364:     // ushort flipMode=0;
0365:     button_available=true;
0366:    
0367:     clearFixLayer();
0368:     scrollerInit(&sc,&BkgA,1,23,0,0);
0369:     palJobPut(23, BkgA.palInfo->count, BkgA.palInfo->data);
0370: 
0371:     while(1) {
0372:         SCClose();
0373:         waitVBlank();
0374:         Control_Sub();
0375:            
0376:         if(action==0)
0377:         {
0378:             fixPrint(1,27,4,3,"The chicks go out. I wasn't expecting");
0379:             fixPrint(1,28,4,3,"that.");
0380:         }
0381:         if(action==1)
0382:         {
0383:             fixPrint(1,28,4,3,"To be honest, I'm a bit disappointed.");
0384:         }
0385:         if(action==2)
0386:         {
0387:             fixPrint(1,27,4,3,"Looks like I'm gonna spend another");
0388:             fixPrint(1,28,4,3,"night alone.");
0389:         }
0390:         if(action==3)
0391:         {
0392:             GameOver();
0393:         }
0394:        
0395:         //scrollerSetPos(&sc,posX,posY);
0396:     }
0397: }
0398: 
0399: void Scene6() {
0400:     scroller sc;
0401:     picture Timer;
0402:     picture Cursor;
0403:     aSprite sp1, sp2, sp3, sp4, sp5;
0404:     int score=0;
0405:     int eyes1_frame=0;
0406:     int eyes2_frame=0;
0407:     int lips_frame=0;
0408:     int hand_frame=0;
0409:     // short posX=0;
0410:     // short posY=0;
0411:     // ushort *data;
0412:     // ushort flipMode=0;
0413:     button_available=true;
0414:     curs_x=160;
0415:     curs_y=112;
0416:    
0417:     send_sound_command(ADPCM_JUST_ONE_NIGHT);
0418:    
0419:     clearFixLayer();
0420:     scrollerInit(&sc,&BkgJ,1,89,0,0);
0421:     palJobPut(89, BkgJ.palInfo->count, BkgJ.palInfo->data);
0422: 
0423:     while(1) {
0424:         SCClose();
0425:         waitVBlank();
0426:         Control_Sub();
0427:        
0428:         fixPrintf1(6,3,3,3,"%d:",controlON);
0429:            
0430:         if(action==0)
0431:         {
0432:             fixPrint(1,28,4,3,"Girls haven't wasted their time.");
0433:         }
0434:         if(action==1)
0435:         {
0436:             avatar(1,2);
0437:             fixPrint(1,27,3,3,"Oh, finally you're back! We need your");
0438:             fixPrint(1,28,3,3,"help.");
0439:         }
0440:         if(action==2)
0441:         {
0442:             fixPrint(1,28,4,3,"OK, but what do you want me to do?");
0443:         }
0444:         if(action==3)
0445:         {
0446:             avatar(1,1);
0447:             fixPrint(1,28,3,3,"I want you to warm her up a bit ;)");
0448:         }
0449:         if(action==4)
0450:         {
0451:             fixPrint(1,28,4,3,"I can do relaxing massage for you.");
0452:         }
0453:         if(action==5)
0454:         {
0455:             avatar(3,2);
0456:             fixPrint(1,27,3,3,"Wow! That sounds hot! Now show me why");
0457:             fixPrint(1,28,3,3,"they call you Casanova.");
0458:         }
0459:         if(action==6)
0460:         {
0461:            
0462:            
0463:             if(miniGame==0)
0464:             {
0465:                 frame=0;
0466:                 sec=20;
0467:                
0468:                 pictureInit(&Timer, &Clock,25,23,0,0,FLIP_NONE);
0469:             palJobPut(23, Clock.palInfo->count, Clock.palInfo->data);
0470:             pictureInit(&Cursor, &Cur,56,34,curs_x,curs_y,FLIP_NONE);
0471:             palJobPut(34, Cur.palInfo->count, Cur.palInfo->data);
0472:             aSpriteInit(&sp1,&eyes1_spr,30,35,174,48,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0473:             palJobPut(35,eyes1_spr.palInfo->count,&eyes1_spr.palInfo->data);
0474:             aSpriteInit(&sp2,&eyes2_spr,34,45,128,59,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0475:             palJobPut(45,eyes2_spr.palInfo->count,&eyes2_spr.palInfo->data);
0476:             aSpriteInit(&sp3,&lips_spr,37,52,184,72,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0477:             palJobPut(52,lips_spr.palInfo->count,&lips_spr.palInfo->data);
0478:             aSpriteInit(&sp4,&hand_spr,39,56,96,216,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0479:             palJobPut(56,hand_spr.palInfo->count,&hand_spr.palInfo->data);
0480:             aSpriteInit(&sp5,&breast_spr,44,63,106,104,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0481:             palJobPut(63,breast_spr.palInfo->count,&breast_spr.palInfo->data);
0482:            
0483:                 /*pictureInit(&Timer, &Clock,25,23,0,0,FLIP_NONE);
0484:                 palJobPut(23, Clock.palInfo->count, Clock.palInfo->data);
0485:                 pictureInit(&Cursor, &Cur,29,34,curs_x,curs_y,FLIP_NONE);
0486:                 palJobPut(34, Cur.palInfo->count, Cur.palInfo->data);
0487:                 aSpriteInit(&sp1,&eyes1_spr,30,35,168,32,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0488:                 palJobPut(35,eyes1_spr.palInfo->count,&eyes1_spr.palInfo->data);
0489:                 aSpriteInit(&sp2,&eyes2_spr,34,45,128,48,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0490:                 palJobPut(45,eyes2_spr.palInfo->count,&eyes2_spr.palInfo->data);
0491:                 aSpriteInit(&sp3,&lips_spr,37,52,184,64,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0492:                 palJobPut(52,lips_spr.palInfo->count,&lips_spr.palInfo->data);
0493:                 aSpriteInit(&sp4,&hand_spr,39,56,96,216,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0494:                 palJobPut(56,hand_spr.palInfo->count,&hand_spr.palInfo->data);
0495:                 aSpriteInit(&sp5,&breast_spr,44,63,104,96,0,FLIP_NONE,AS_FLAGS_DEFAULT);
0496:                 palJobPut(63,breast_spr.palInfo->count,&breast_spr.palInfo->data);*/
0497:                
0498:                 miniGame=1;
0499:             }
0500:            
0501:             fixPrintf1(1,5,7,3,"%d:",min);
0502:             fixPrintf1(3,5,7,3,"%d",sec);
0503:            
0504:             pictureSetPos(&Cursor,curs_x,curs_y);
0505:            
0506:             if(miniGame==1)
0507:             {
0508:                
0509:                 if(controlON==1)
0510:                 {
0511:                     if((curs_x>104)&&(curs_y>96))
0512:                     {
0513:                         if((curs_x<208)&&(curs_y>136))
0514:                         {
0515:                             // aSpriteAnimate(&sp5);
0516:                             // if(frame%10==3) boobs();
0517:                            
0518:                             aSpriteSetStep(&sp5, breast_frame);
0519:    
0520:                             if(breast_frame<5) breast_frame++;
0521:                             else breast_frame=0;
0522:    
0523:                             if(frame==55) score++;
0524:                            
0525:                             aSpriteSetStep(&sp1, eyes1_frame);
0526:                             aSpriteSetStep(&sp2, eyes2_frame);
0527:                             aSpriteSetStep(&sp3, lips_frame);
0528:                             aSpriteSetStep(&sp4, hand_frame);
0529:                            
0530:                             aSpriteAnimate(&sp1);
0531:                             aSpriteAnimate(&sp2);
0532:                             aSpriteAnimate(&sp3);
0533:                             aSpriteAnimate(&sp4);
0534:                             aSpriteAnimate(&sp5);
0535:                
0536:                
0537:                         }
0538:                     }
0539:                 }
0540:                
0541:                 if((min==0)&&(sec==0)&&(frame==0))
0542:                 {
0543:                     miniGame=2;
0544:                     clearSprites(25,60);
0545:                     if(score>=21)   choice=0;
0546:                     if(score<=15)   choice=1;
0547:                     if((score>15)&&(score<21))  choice=2;
0548:                     action++;
0549:                 }
0550:             }  
0551:            
0552:         }
0553:        
0554:         if(action==17)
0555:         {
0556:             fixPrint(1,27,4,3,"Girls are pissed off with me. They say");
0557:             fixPrint(1,28,4,3,"that I highly disappointed them.");
0558:         }
0559:         if(action==18)
0560:         {
0561:             action=0;
0562:             Lose3();
0563:         }
0564:        
0565:         if(choice==0)
0566:         {
0567:             if(action==7)
0568:             {
0569:                 fixPrint(1,28,4,3,"I shoudn't have done it that fast.");
0570:             }
0571:             if(action==8)
0572:             {
0573:                 action=17;
0574:             }
0575:         }
0576:         if(choice==1)
0577:         {
0578:             if(action==7)
0579:             {
0580:                 fixPrint(1,28,4,3,"I was doing it too slow.");
0581:             }
0582:             if(action==8)
0583:             {
0584:                 action=17;
0585:             }
0586:         }
0587:         if(choice==2)
0588:         {
0589:             if(action==7)
0590:             {
0591:                 fixPrint(1,28,4,3,"Looks like she liked it!");
0592:             }
0593:             if(action==8)
0594:             {
0595:                 fixPrint(1,27,4,3,"She's ready to spend a whole night");
0596:                 fixPrint(1,28,4,3,"with me!");
0597:             }
0598:             if(action==9)
0599:             {
0600:                 scrollerInit(&sc,&BkgK,1,23,0,0);
0601:                 palJobPut(23, BkgK.palInfo->count, BkgK.palInfo->data);
0602:                
0603:                 fixPrint(1,28,4,3,"Man, that's gonna be epic!");
0604:             }
0605:             if(action==10)
0606:             {
0607:                 avatar(3,1);
0608:                 fixPrint(1,28,3,3,"Come here, Casanova...");
0609:             }
0610:             if(action==11)
0611:             {
0612:                 fixPrint(1,28,4,3,"That's the ticket!");
0613:             }
0614:             if(action==12)
0615:             {
0616:                 avatar(1,2);
0617:                 fixPrint(1,27,3,3,"Come, play with us! There's plenty of");
0618:                 fixPrint(1,28,3,3,"room.");
0619:             }
0620:             if(action==13)
0621:             {
0622:                 fixPrint(1,27,4,3,"I want to show you my gratitude - the");
0623:                 fixPrint(1,28,4,3,"hot chicks just can't wait.");
0624:             }
0625:             if(action==14)
0626:             {
0627:                 fixPrint(1,28,4,3,"I recommend you to play again.");
0628:             }
0629:             if(action==15)
0630:             {
0631:                 fixPrint(1,27,4,3,"Make sure you didn't miss out on");
0632:                 fixPrint(1,28,4,3,"anything interesting!");
0633:             }
0634:             if(action==16)
0635:             {
0636:                 success=1;
0637:                 GameOver();
0638:             }
0639:         }
0640:        
0641:         if(miniGame==1) TimerEd();
0642:        
0643:         //scrollerSetPos(&sc,posX,posY);
0644:     }
0645: }
0646: 
0647: void Home1() {
0648:     scroller sc;
0649:     // short posX=0;
0650:     // short posY=0;
0651:     // ushort *data;
0652:     // ushort flipMode=0;
0653:     button_available=true;
0654:    
0655:     clearFixLayer();
0656:     scrollerInit(&sc,&BkgG,1,23,0,0);
0657:     palJobPut(23, BkgG.palInfo->count, BkgG.palInfo->data);
0658: 
0659:     while(1) {
0660:         SCClose();
0661:         waitVBlank();
0662:         Control_Sub();
0663:        
0664: ////////////Control////////////
0665: //Select Options Action=3
0666:         if(action==3)
0667:         {
0668:             if(p1e&JOY_UP)
0669:             {
0670:                 if(choice==1)   choice--;
0671:             }
0672:             if(p1e&JOY_DOWN)
0673:             {
0674:                 if(choice==0)   choice++;
0675:             }
0676:         }
0677:         //Select Options Action=10
0678:         if(action==10)
0679:         {
0680:             if(p1e&JOY_UP)
0681:             {
0682:                 if(choice==1)   choice--;
0683:             }
0684:             if(p1e&JOY_DOWN)
0685:             {
0686:                 if(choice==0)   choice++;
0687:             }
0688:         }
0689: ////////////Control////////////
0690:            
0691:         if(action==0)
0692:         {
0693:             fixPrint(1,27,4,3,"Girls quickly find a common");
0694:             fixPrint(1,28,4,3,"language...");
0695:         }
0696:         if(action==1)
0697:         {
0698:             avatar(1,1);
0699:             fixPrint(1,28,3,3,"Come closer, honey... Don't be shy.");
0700:         }
0701:         if(action==2)
0702:         {
0703:             fixPrint(1,27,4,3,"I need to create an atmosphere full of");
0704:             fixPrint(1,28,4,3,"love, lust and joy.");
0705:         }
0706:         if(action==3)
0707:         {
0708:             avatar(0,5);
0709:             fixPrint(1,24,4,3,"But how?");
0710:             fixPrint(3,25,choice==0?2:6,3,"LIGHT UP THE CANDLES AND POUR SOME");
0711:             fixPrint(3,26,choice==0?2:6,3,"WINE");
0712:             fixPrint(3,27,choice==1?2:6,3,"TURN OFF THE LIGHTS AND TURN ON SOME");
0713:             fixPrint(3,28,choice==1?2:6,3,"MUSIC");
0714:         }
0715:         if(action==5)
0716:         {
0717:             fixPrint(1,28,4,3,"A joyful melody starts playing.");
0718:         }
0719:         if(action==6)
0720:         {
0721:             avatar(1,2);
0722:             fixPrint(1,27,3,3,"I got an idea... How about going to a");
0723:             fixPrint(1,28,3,3,"club?");
0724:         }
0725:         if(action==7)
0726:         {
0727:             fixPrint(1,27,4,3,"The girl from the park doesn't mind.");
0728:             fixPrint(1,28,4,3,"The model says...");
0729:         }
0730:         if(action==8)
0731:         {
0732:             avatar(1,1);
0733:             fixPrint(1,28,3,3,"Thanks for everything! Bye!");
0734:         }
0735:         if(action==9)
0736:         {
0737:             action=0;
0738:             Lose3();
0739:         }
0740:         if(action==10)
0741:         {
0742:             avatar(0,5);
0743:             fixPrint(1,24,4,3,"But I ran out of wine! Should I leave");
0744:             fixPrint(1,25,4,3,"the girls and go to the local liqueur");
0745:             fixPrint(1,26,4,3,"store?");
0746:             fixPrint(3,27,choice==0?2:6,3,"NO. STAY HOME.");
0747:             fixPrint(3,28,choice==1?2:6,3,"YES. GO TO THE STORE.");
0748:         }
0749:        
0750:         if(choice==0)
0751:         {
0752:             if(action==4)
0753:             {
0754:                 action=10;
0755:                 choice=0;
0756:             }
0757:             if(action==11)
0758:             {
0759:                 fixPrint(1,28,4,3,"The model turns on the radio.");
0760:             }
0761:             if(action==12)
0762:             {
0763:                 action=5;
0764:             }
0765:         }
0766:         if(choice==1)
0767:         {
0768:             if(action==4)
0769:             {
0770:                 fixPrint(1,28,4,3,"I turn on the radio.");
0771:             }
0772:             if(action==11)
0773:             {
0774:                 wherefrom=0;
0775:                 fixPrint(1,28,4,3,"I take my wallet and go out.");
0776:             }
0777:             if(action==12)
0778:             {
0779:                 action=0;
0780:                 Scene5();
0781:             }
0782:         }
0783:        
0784:         //scrollerSetPos(&sc,posX,posY);
0785:     }
0786: }
0787: 
0788: void Home2() {
0789:     scroller sc;
0790:     // short posX=0;
0791:     // short posY=0;
0792:     // ushort *data;
0793:     // ushort flipMode=0;
0794:     button_available=true;
0795:    
0796:     clearFixLayer();
0797:     scrollerInit(&sc,&BkgD,1,23,0,0);
0798:     palJobPut(23, BkgD.palInfo->count, BkgD.palInfo->data);
0799: 
0800:     while(1) {
0801:         SCClose();
0802:         waitVBlank();
0803:         Control_Sub();
0804:            
0805:         if(action==0)
0806:         {
0807:             fixPrint(1,26,4,3,"Unfortunately, the girl from the club");
0808:             fixPrint(1,27,4,3,"changed her mind when you weren't");
0809:             fixPrint(1,28,4,3,"there.");
0810:         }
0811:         if(action==1)
0812:         {
0813:             avatar(2,2);
0814:             fixPrint(1,27,3,3,"Sorry, but I gotta go. I hope you");
0815:             fixPrint(1,28,3,3,"understand...");
0816:         }
0817:         if(action==2)
0818:         {
0819:             fixPrint(1,28,4,3,"The model is disappointed.");
0820:         }
0821:         if(action==3)
0822:         {
0823:             avatar(1,3);
0824:             fixPrint(1,26,4,3,"If she leaves, then I'm gonna go with");
0825:             fixPrint(1,27,4,3,"her. I thought I could count on you,");
0826:             fixPrint(1,28,4,3,"but I was wrong.");
0827:         }
0828:         if(action==4)
0829:         {
0830:             action=0;
0831:             Lose2();
0832:         }
0833:        
0834:         //scrollerSetPos(&sc,posX,posY);
0835:     }
0836: }
0837: 
0838: void Scene5() {
0839:     scroller sc;
0840:     // short posX=0;
0841:     // short posY=0;
0842:     // ushort *data;
0843:     // ushort flipMode=0;
0844:     button_available=true;
0845:    
0846:     clearFixLayer();
0847:     scrollerInit(&sc,&BkgH,1,23,0,0);
0848:     palJobPut(23, BkgH.palInfo->count, BkgH.palInfo->data);
0849: 
0850:     while(1) {
0851:         SCClose();
0852:         waitVBlank();
0853:         Control_Sub();
0854:        
0855: ////////////Control////////////
0856: //Select Options Action=3
0857:         if(action==3)
0858:         {
0859:             if(p1e&JOY_UP)
0860:             {
0861:                 if(choice==1)   choice--;
0862:             }
0863:             if(p1e&JOY_DOWN)
0864:             {
0865:                 if(choice==0)   choice++;
0866:             }
0867:         }
0868: ////////////Control////////////
0869:            
0870:         if(action==0)
0871:         {
0872:             fixPrint(1,26,4,3,"Fortunately, the liqueur store is");
0873:             fixPrint(1,27,4,3,"across the road. I take a bottle and");
0874:             fixPrint(1,28,4,3,"go to the checkout.");
0875:         }
0876:         if(action==1)
0877:         {
0878:             avatar(4,2);
0879:             fixPrint(1,27,3,3,"You sure you don't want anything else,");
0880:             fixPrint(1,28,3,3,"handsome?");
0881:         }
0882:         if(action==2)
0883:         {
0884:             fixPrint(1,27,4,3,"A young, pretty cashier winks at me. I");
0885:             fixPrint(1,28,4,3,"got her...");
0886:         }
0887:         if(action==3)
0888:         {
0889:             avatar(0,3);
0890:             fixPrint(1,26,4,3,"What should I do?");
0891:             fixPrint(3,27,choice==0?2:6,3,"PAY FOR THE WINE AND GO HOME");
0892:             fixPrint(3,28,choice==1?2:6,3,"FLIRT WITH HER");
0893:         }
0894:        
0895:         if(choice==0)
0896:         {
0897:             if(action==4)
0898:             {
0899:                 fixPrint(1,28,4,3,"Going back home.");
0900:             }
0901:             if(action==5)
0902:             {
0903:                 if(wherefrom==1)
0904:                 {
0905:                     action=0;
0906:                     Home2();
0907:                 }
0908:                 if(wherefrom==0)
0909:                 {
0910:                     action=0;
0911:                     Scene6();
0912:                 }
0913:             }
0914:         }
0915:         if(choice==1)
0916:         {
0917:             if(action==4)
0918:             {
0919:                 fixPrint(1,27,4,3,"The cashier grabs my hand and leads me");
0920:                 fixPrint(1,28,4,3,"to the storeroom where...");
0921:             }
0922:             if(action==5)
0923:             {
0924:                 scrollerInit(&sc,&BkgI,1,23,0,0);
0925:                 palJobPut(23, BkgI.palInfo->count, BkgI.palInfo->data);
0926:                
0927:                 fixPrint(1,28,4,3,"... well, you can see for yourself ;)");
0928:             }
0929:             if(action==6)
0930:             {
0931:                 avatar(4,1);
0932:                 fixPrint(1,28,3,3,"I can't believe it!");
0933:             }
0934:             if(action==7)
0935:             {
0936:                 fixPrint(1,27,4,3,"She's quite hot. The girl whispers in");
0937:                 fixPrint(1,28,4,3,"my ear...");
0938:             }
0939:             if(action==8)
0940:             {
0941:                 avatar(4,1);
0942:                 fixPrint(1,28,3,3,"Do you like it, honey?");
0943:             }
0944:             if(action==9)
0945:             {
0946:                 fixPrint(1,28,4,3,"You bet I do!");
0947:             }
0948:             if(action==10)
0949:             {
0950:                 avatar(4,1);
0951:                 fixPrint(1,28,3,3,"You're such a good kisser!");
0952:             }
0953:             if(action==11)
0954:             {
0955:                 fixPrint(1,27,4,3,"I think I'm gonna shop here more");
0956:                 fixPrint(1,28,4,3,"often. ;)");
0957:             }
0958:             if(action==12)
0959:             {
0960:                 fixPrint(1,27,4,3,"Not all of our customers get such a");
0961:                 fixPrint(1,28,4,3,"service.");
0962:             }
0963:             if(action==13)
0964:             {
0965:                 fixPrint(1,27,4,3,"They're simply not as good looking as");
0966:                 fixPrint(1,28,4,3,"me ;)");
0967:             }
0968:             if(action==14)
0969:             {
0970:                 avatar(4,1);
0971:                 fixPrint(1,28,3,3,"Let's go to your place.");
0972:             }
0973:             if(action==15)
0974:             {
0975:                 fixPrint(1,26,4,3,"Wait, oh shit... I completely forgot");
0976:                 fixPrint(1,27,4,3,"about it! The girls are still waiting");
0977:                 fixPrint(1,28,4,3,"for me in my apartment.");
0978:             }
0979:             if(action==16)
0980:             {
0981:                 fixPrint(1,27,4,3,"Gotta hurry up! I hope the model is");
0982:                 fixPrint(1,28,4,3,"still there.");
0983:             }
0984:             if(action==17)
0985:             {
0986:                 action=0;
0987:                 Lose1();
0988:             }
0989:         }
0990:        
0991:         //scrollerSetPos(&sc,posX,posY);
0992:     }
0993: }
0994: 
0995: void Scene4() {
0996:     scroller sc;
0997:     // short posX=0;
0998:     // short posY=0;
0999:     // ushort *data;
1000:     // ushort flipMode=0;
1001:     button_available=true;
1002:    
1003:     clearFixLayer();
1004:     scrollerInit(&sc,&BkgF,1,23,0,0);
1005:     palJobPut(23, BkgF.palInfo->count, BkgF.palInfo->data);
1006: 
1007:     while(1) {
1008:         SCClose();
1009:         waitVBlank();
1010:         Control_Sub();
1011:        
1012: ////////////Control////////////
1013: //Select Options Action=5
1014:         if(action==5)
1015:         {
1016:             if(p1e&JOY_UP)
1017:             {
1018:                 if(choice==1)   choice--;
1019:             }
1020:             if(p1e&JOY_DOWN)
1021:             {
1022:                 if(choice==0)   choice++;
1023:             }
1024:         }
1025: //Select Options Action=7
1026:         if(action==7)
1027:         {
1028:             if(p1e&JOY_UP)
1029:             {
1030:                 if(choice==1)   choice--;
1031:             }
1032:             if(p1e&JOY_DOWN)
1033:             {
1034:                 if(choice==0)   choice++;
1035:             }
1036:         }
1037: ////////////Control////////////
1038:            
1039:         if(action==0)
1040:         {
1041:             fixPrint(1,28,4,3,"I sit down next to a pretty girl.");
1042:         }
1043:         if(action==1)
1044:         {
1045:             avatar(4,1);
1046:             fixPrint(1,28,3,3,"Can I help you?");
1047:         }
1048:         if(action==2)
1049:         {
1050:             fixPrint(1,28,4,3,"I tell her about the model.");
1051:         }
1052:         if(action==3)
1053:         {
1054:             avatar(4,2);
1055:             fixPrint(1,27,3,3,"I would love to meet her... But you");
1056:             fixPrint(1,28,3,3,"have to do something for me.");
1057:         }
1058:         if(action==4)
1059:         {
1060:             fixPrint(1,27,4,3,"She probably means a present or");
1061:             fixPrint(1,28,4,3,"something...");
1062:         }
1063:         if(action==5)
1064:         {
1065:             avatar(0,3);
1066:             fixPrint(1,26,4,3,"What can I offer her?");
1067:             fixPrint(3,27,choice==0?2:6,3,"A FREE PHOTO SHOOT");
1068:             fixPrint(3,28,choice==1?2:6,3,"A DINNER AT A FANCY RESTAURANT");
1069:         }
1070:         if(action==6)
1071:         {
1072:             choice=0;
1073:             action=7;
1074:         }
1075:         if(action==7)
1076:         {
1077:             avatar(4,4);
1078:             fixPrint(1,25,3,3,"How_about_something_more...");
1079:             fixPrint(1,26,3,3,"Impressive?");
1080:             fixPrint(3,27,choice==0?2:6,3,"AN EXOTIC TRIP");
1081:             fixPrint(3,28,choice==1?2:6,3,"MEET A CELEBRITY");
1082:         }
1083:         if(action==9)
1084:         {
1085:             fixPrint(1,26,4,3,"Well, there's nothing else I can do...");
1086:             fixPrint(1,27,4,3,"I call the model and tell her that I");
1087:             fixPrint(1,28,4,3,"can't find a girl for her.");
1088:         }
1089:         if(action==10)
1090:         {
1091:             fixPrint(1,27,4,3,"She's extremely disappointed. Probably");
1092:             fixPrint(1,28,4,3,"doesn't want to work with me anymore.");
1093:         }
1094:         if(action==11)
1095:         {
1096:             fixPrint(1,28,4,3,"What a bummer!");
1097:         }
1098:         if(action==12)
1099:         {
1100:             fixPrint(1,27,4,3,"Looks like I'm gonna spend another");
1101:             fixPrint(1,28,4,3,"night alone.");
1102:         }
1103:         if(action==13)
1104:         {
1105:             fixPrint(1,27,4,3,"And the worst is that it might hurt my");
1106:             fixPrint(1,28,4,3,"reputation! Damn...");
1107:         }
1108:         if(action==14)
1109:         {
1110:             GameOver();
1111:         }
1112:        
1113:         if(choice==0)
1114:         {
1115:             if(action==8)
1116:             {
1117:                 avatar(4,1);
1118:                 fixPrint(1,28,3,3,"No, I'm not interested.");
1119:             }
1120:         }
1121:         if(choice==1)
1122:         {
1123:             if(action==6)
1124:             {
1125:                 avatar(4,2);
1126:                 fixPrint(1,27,3,3,"Sorry, but I don't think you know any");
1127:                 fixPrint(1,28,3,3,"famous people.");
1128:             }
1129:         }
1130:        
1131:         //scrollerSetPos(&sc,posX,posY);
1132:     }
1133: }
1134: 
1135: void Scene3() {
1136:     scroller sc;
1137:     // short posX=0;
1138:     // short posY=0;
1139:     // ushort *data;
1140:     // ushort flipMode=0;
1141:     button_available=true;
1142:    
1143:     clearFixLayer();
1144:     scrollerInit(&sc,&BkgC,1,23,0,0);
1145:     palJobPut(23, BkgC.palInfo->count, BkgC.palInfo->data);
1146: 
1147:     while(1) {
1148:         SCClose();
1149:         waitVBlank();
1150:         Control_Sub();
1151:        
1152: ////////////Control////////////
1153: //Select Options Action=5
1154:         if(action==5)
1155:         {
1156:             if(p1e&JOY_UP)
1157:             {
1158:                 if(choice==1)   choice--;
1159:             }
1160:             if(p1e&JOY_DOWN)
1161:             {
1162:                 if(choice==0)   choice++;
1163:             }
1164:         }
1165: //Select Options Action=10
1166:         if(action==10)
1167:         {
1168:             if(p1e&JOY_UP)
1169:             {
1170:                 if(choice==1)   choice--;
1171:             }
1172:             if(p1e&JOY_DOWN)
1173:             {
1174:                 if(choice==0)   choice++;
1175:             }
1176:         }
1177: //Select Options Action=15
1178:         if(action==15)
1179:         {
1180:             if(p1e&JOY_UP)
1181:             {
1182:                 if(choice==1)   choice--;
1183:             }
1184:             if(p1e&JOY_DOWN)
1185:             {
1186:                 if(choice==0)   choice++;
1187:             }
1188:         }
1189: ////////////Control////////////
1190:            
1191:         if(action==0)
1192:         {
1193:             fixPrint(1,28,4,3,"She catches my eye immediately.");
1194:         }
1195:         if(action==1)
1196:         {
1197:             avatar(2,1);
1198:             fixPrint(1,28,3,3,"Hi! How's it going?");
1199:         }
1200:         if(action==2)
1201:         {
1202:             fixPrint(1,28,4,3,"I explain her the situation.");
1203:         }
1204:         if(action==3)
1205:         {
1206:             fixPrint(1,27,4,3,"She doesn't mind. The girl obviously");
1207:             fixPrint(1,28,4,3,"likes me.");
1208:         }
1209:         if(action==4)
1210:         {
1211:             fixPrint(1,27,4,3,"Should I get to know her better when");
1212:             fixPrint(1,28,4,3,"it's not too late?");
1213:         }
1214:         if(action==5)
1215:         {
1216:             avatar(0,3);
1217:             fixPrint(1,26,4,3,"What do you think?");
1218:             fixPrint(3,27,choice==0?2:6,3,"KEEP GOING TO YOUR PLACE");
1219:             fixPrint(3,28,choice==1?2:6,3,"STAY HERE WITH HER");
1220:         }
1221:         if(action==10)
1222:         {
1223:             avatar(0,6);
1224:             fixPrint(1,23,4,3,"Maybe I can do something to make her");
1225:             fixPrint(1,24,4,3,"feel better?");
1226:             fixPrint(3,25,choice==0?2:6,3,"LIGHT UP THE CANDLES AND POUR HER");
1227:             fixPrint(3,26,choice==0?2:6,3,"SOME WINE");
1228:             fixPrint(3,27,choice==1?2:6,3,"TURN OFF THE LIGHTS AND TURN ON");
1229:             fixPrint(3,28,choice==1?2:6,3,"SOME MUSIC");
1230:         }
1231:         if(action==15)
1232:         {
1233:             avatar(0,5);
1234:             fixPrint(1,24,4,3,"But I ran out of wine! Should I leave");
1235:             fixPrint(1,25,4,3,"the girls and go to the local liqueur");
1236:             fixPrint(1,26,4,3,"store?");
1237:             fixPrint(3,27,choice==0?2:6,3,"NO. STAY HOME.");
1238:             fixPrint(3,28,choice==1?2:6,3,"YES. GO TO THE STORE.");
1239:         }
1240:         if(action==17)
1241:         {
1242:             fixPrint(1,28,4,3,"The model is disappointed.");
1243:         }
1244:         if(action==18)
1245:         {
1246:             avatar(1,3);
1247:             fixPrint(1,26,3,3,"If she leaves, then I'm gonna go with");
1248:             fixPrint(1,27,3,3,"her. I thought I could count on you,");
1249:             fixPrint(1,28,3,3,"but I was wrong.");
1250:         }
1251:         if(action==19)
1252:         {
1253:             action=0;
1254:             Lose2();
1255:         }
1256:         if(action==20)
1257:         {
1258:             fixPrint(1,26,4,3,"Now I realize how much time has");
1259:             fixPrint(1,27,4,3,"passed. I left the poor thing all");
1260:             fixPrint(1,28,4,3,"alone!");
1261:         }
1262:         if(action==21)
1263:         {
1264:             fixPrint(1,27,4,3,"I run back home, hoping she's still");
1265:             fixPrint(1,28,4,3,"there.");
1266:         }
1267:         if(action==22)
1268:         {
1269:             action=0;
1270:             Lose1();
1271:         }
1272:        
1273:         if(choice==0)
1274:         {
1275:             if(action==6)
1276:             {
1277:                 fixPrint(1,28,4,3,"I pay and we go out.");
1278:             }
1279:             if(action==7)
1280:             {
1281:                 scrollerInit(&sc,&BkgD,1,23,0,0);
1282:                 palJobPut(23, BkgD.palInfo->count, BkgD.palInfo->data);
1283:                
1284:                 fixPrint(1,28,4,3,"The model is all horny, ready to play.");
1285:             }
1286:             if(action==8)
1287:             {
1288:                 avatar(1,2);
1289:                 fixPrint(1,27,3,3,"I like your style! Come closer,");
1290:                 fixPrint(1,28,3,3,"baby...");
1291:             }
1292:             if(action==9)
1293:             {
1294:                 fixPrint(1,27,4,3,"The chick from the club is a little");
1295:                 fixPrint(1,28,4,3,"timid.");
1296:             }
1297:             if(action==11)
1298:             {
1299:                 action=15;
1300:                 choice=0;
1301:             }
1302:             if(action==16)
1303:             {
1304:                 fixPrint(1,28,4,3,"''Sorry, I gotta go'', she says.");
1305:             }
1306:         }
1307:         if(choice==1)
1308:         {
1309:             if(action==6)
1310:             {
1311:                 fixPrint(1,27,4,3,"I'm flirting with her. She really does");
1312:                 fixPrint(1,28,4,3,"like me!");
1313:             }
1314:             if(action==7)
1315:             {
1316:                 fixPrint(1,27,4,3,"We talk for a while. I tell her about");
1317:                 fixPrint(1,28,4,3,"my job. She seems interested.");
1318:             }
1319:             if(action==8)
1320:             {      
1321:                 fixPrint(1,28,4,3,"Then she orders her favorite cocktail.");
1322:             }
1323:             if(action==9)
1324:             {
1325:                 action=20;
1326:             }
1327:             if(action==11)
1328:             {
1329:                 fixPrint(1,26,4,3,"It wouldn't change anything. She says");
1330:                 fixPrint(1,27,4,3,"''sorry, but I gotta go. It's too late");
1331:                 fixPrint(1,28,4,3,"now''.");
1332:             }
1333:             if(action==12)
1334:             {
1335:                 action=17;
1336:             }
1337:             if(action==16)
1338:             {  
1339:                 action=23;
1340:                 wherefrom=1;    
1341:                 fixPrint(1,28,4,3,"I take my wallet and go out.");
1342:             }
1343:             if(action==24)
1344:             {
1345:                 action=0;
1346:                 Scene5();
1347:             }
1348:         }
1349:         if(choice==2)
1350:         {
1351:             if(action==15)
1352:             {
1353:                 action=7;
1354:                 choice=0;
1355:             }
1356:         }
1357:        
1358:         //scrollerSetPos(&sc,posX,posY);
1359:     }
1360: }
1361: 
1362: void Scene2() {
1363:     scroller sc;
1364:     // short posX=0;
1365:     // short posY=0;
1366:     // ushort *data;
1367:     // ushort flipMode=0;
1368:     button_available=true;
1369:    
1370:     clearFixLayer();
1371:     scrollerInit(&sc,&BkgE,1,23,0,0);
1372:     palJobPut(23, BkgE.palInfo->count, BkgE.palInfo->data);
1373: 
1374:     while(1) {
1375:         SCClose();
1376:         waitVBlank();
1377:         Control_Sub();
1378:        
1379: ////////////Control////////////
1380: //Select Options Action=5
1381:         if(action==5)
1382:         {
1383:             if(p1e&JOY_UP)
1384:             {
1385:                 if(choice==1)   choice--;
1386:             }
1387:             if(p1e&JOY_DOWN)
1388:             {
1389:                 if(choice==0)   choice++;
1390:             }
1391:         }
1392: //Select Options Action=11
1393:         if(action==11)
1394:         {
1395:             if(p1e&JOY_UP)
1396:             {
1397:                 if(choice==1)   choice--;
1398:             }
1399:             if(p1e&JOY_DOWN)
1400:             {
1401:                 if(choice==0)   choice++;
1402:             }
1403:         }
1404: //Select Options Action=14
1405:         if(action==14)
1406:         {
1407:             if(p1e&JOY_UP)
1408:             {
1409:                 if(choice>=1)   choice--;
1410:             }
1411:             if(p1e&JOY_DOWN)
1412:             {
1413:                 if(choice<2)    choice++;
1414:             }
1415:         }
1416: ////////////Control////////////
1417:            
1418:         if(action==0)
1419:         {
1420:             fixPrint(1,28,4,3,"I come across a sexy gal.");
1421:         }
1422:         if(action==1)
1423:         {
1424:             avatar(3,1);
1425:             fixPrint(1,28,3,3,"Hey! How are you?");
1426:         }
1427:         if(action==2)
1428:         {
1429:             fixPrint(1,28,4,3,"I explain her the situation.");
1430:         }
1431:         if(action==3)
1432:         {
1433:             avatar(3,2);
1434:             fixPrint(1,27,3,3,"OK, I got it... Looks like your friend");
1435:             fixPrint(1,28,3,3,"want to have some fun.");
1436:         }
1437:         if(action==4)
1438:         {
1439:             fixPrint(1,27,4,3,"She thinks for a minute... But, no.");
1440:             fixPrint(1,28,4,3,"She's not interested.");
1441:         }
1442:         if(action==5)
1443:         {
1444:             avatar(0,3);
1445:             fixPrint(1,26,4,3,"What now?");
1446:             fixPrint(3,27,choice==0?2:6,3,"FIND ANOTHER GAL");
1447:             fixPrint(3,28,choice==1?2:6,3,"TRY TO CONVINCE HER");
1448:         }
1449:         if(action==7)
1450:         {
1451:             avatar(3,1);
1452:             fixPrint(1,28,3,3,"Well, if you insist...");
1453:         }
1454:         if(action==8)
1455:         {
1456:             fixPrint(1,28,4,3,"I think my stubbornness turns her on.");
1457:         }
1458:         if(action==9)
1459:         {
1460:             avatar(3,3);
1461:             fixPrint(1,26,3,3,"Honestly, I was just about to go to");
1462:             fixPrint(1,27,3,3,"bed... But why not? It's gonna be fun");
1463:             fixPrint(1,28,3,3,"I guess.");
1464:         }
1465:         if(action==10)
1466:         {
1467:             action=0;
1468:             Home1();
1469:         }
1470:         if(action==11)
1471:         {
1472:             avatar(0,3);
1473:             fixPrint(1,26,4,3,"Where to now?");
1474:             fixPrint(3,27,choice==0?2:6,3,"TO THE CLUB");
1475:             fixPrint(3,28,choice==1?2:6,3,"TO THE CAFE");
1476:         }
1477:         if(action==14)
1478:         {
1479:             avatar(0,5);
1480:             fixPrint(1,24,4,3,"I try, but doesn't work out. Gotta");
1481:             fixPrint(1,25,4,3,"find another girl. But where?");
1482:             fixPrint(3,26,choice==0?2:6,3,"TO THE CLUB");
1483:             fixPrint(3,27,choice==1?2:6,3,"TO THE CAFE");
1484:             fixPrint(3,28,choice==2?2:6,3,"STAY IN THE PARK");
1485:         }
1486:        
1487:         if(choice==0)
1488:         {
1489:             if(action==6)
1490:             {
1491:                 action=11;
1492:             }
1493:             if(action==12)
1494:             {
1495:                 fixPrint(1,28,4,3,"I go there.");
1496:             }
1497:             if(action==13)
1498:             {
1499:                 action=0;
1500:                 Scene3();
1501:             }
1502:             if(action==15)
1503:             {
1504:                 fixPrint(1,28,4,3,"It's not that far. Good.");
1505:             }
1506:             if(action==16)
1507:             {
1508:                 action=0;
1509:                 Scene3();
1510:             }
1511:         }
1512:         if(choice==1)
1513:         {
1514:             if(action==6)
1515:             {
1516:                 action=14;
1517:                 choice=0;
1518:             }
1519:             if(action==12)
1520:             {
1521:                 fixPrint(1,28,4,3,"I go there.");
1522:             }
1523:             if(action==13)
1524:             {      
1525:                 action=0;
1526:                 Scene4();
1527:             }
1528:             if(action==15)
1529:             {
1530:                 fixPrint(1,28,4,3,"It's not that far. Good.");
1531:             }
1532:             if(action==16)
1533:             {
1534:                 action=0;
1535:                 Scene4();
1536:             }
1537:         }
1538:         if(choice==2)
1539:         {
1540:             if(action==15)
1541:             {
1542:                 action=7;
1543:                 choice=0;
1544:             }
1545:         }
1546:        
1547:         //scrollerSetPos(&sc,posX,posY);
1548:     }
1549: }
1550: 
1551: void Scene1() {
1552:     scroller sc;
1553:     // short posX=0;
1554:     // short posY=0;
1555:     // ushort *data;
1556:     // ushort flipMode=0;
1557:     button_available=true;
1558:    
1559:     clearFixLayer();
1560:     scrollerInit(&sc,&BkgB,1,23,0,0);
1561:     palJobPut(23, BkgB.palInfo->count, BkgB.palInfo->data);
1562: 
1563:     while(1) {
1564:         SCClose();
1565:         waitVBlank();
1566:         Control_Sub();
1567:        
1568: ////////////Control////////////
1569: //Select Options Action=2
1570:         if(action==2)
1571:         {
1572:             if(p1e&JOY_UP)
1573:             {
1574:                 if(choice==1)   choice--;
1575:             }
1576:             if(p1e&JOY_DOWN)
1577:             {
1578:                 if(choice==0)   choice++;
1579:             }
1580:         }
1581: //Select Options Action=8
1582:         if(action==8)
1583:         {
1584:             if(p1e&JOY_UP)
1585:             {
1586:                 if(choice==1)   choice--;
1587:             }
1588:             if(p1e&JOY_DOWN)
1589:             {
1590:                 if(choice==0)   choice++;
1591:             }
1592:         }
1593: //Select Options Action=14
1594:         if(action==14)
1595:         {
1596:             if(p1e&JOY_UP)
1597:             {
1598:                 if(choice>=1)   choice--;
1599:             }
1600:             if(p1e&JOY_DOWN)
1601:             {
1602:                 if(choice<2)    choice++;
1603:             }
1604:         }
1605: ////////////Control////////////
1606:            
1607:         if(action==0)
1608:         {
1609:             fixPrint(1,27,4,3,"Jeez! She's even more hot in person");
1610:             fixPrint(1,28,4,3,"than she was in the pictures!");
1611:         }
1612:         if(action==1)
1613:         {
1614:             fixPrint(1,27,4,3,"I wonder if she would go with me on a");
1615:             fixPrint(1,28,4,3,"date...");
1616:         }
1617:         if(action==2)
1618:         {
1619:             avatar(0,3);
1620:             fixPrint(1,26,4,3,"What do you think I should do?");
1621:             fixPrint(3,27,choice==0?2:6,3,"FLIRT WITH HER");
1622:             fixPrint(3,28,choice==1?2:6,3,"CONCENTRATE ON WORK");
1623:         }
1624:         if(action==8)
1625:         {
1626:             avatar(0,4);
1627:             fixPrint(1,25,4,3,"Damn it! Should I ask her to go");
1628:             fixPrint(1,26,4,3,"somewhere chill instead?");
1629:             fixPrint(3,27,choice==0?2:6,3,"DO IT.");
1630:             fixPrint(3,28,choice==1?2:6,3,"NOT NOW. JUST LEAVE HER ALONE.");
1631:         }
1632:         if(action==14)
1633:         {
1634:             avatar(0,4);
1635:             fixPrint(1,25,4,3,"Now where can I find a girl?");
1636:             fixPrint(3,26,choice==0?2:6,3,"GO TO THE PARK");
1637:             fixPrint(3,27,choice==1?2:6,3,"GO TO A CLUB");
1638:             fixPrint(3,28,choice==2?2:6,3,"GO TO A CAFE");
1639:         }
1640:         if(action==15)
1641:         {
1642:             fixPrint(1,28,4,3,"I'm starting right away.");
1643:         }
1644:         if(action==16)
1645:         {
1646:             action=0;
1647:             if(choice==0) Scene2();
1648:             if(choice==1) Scene3();
1649:             if(choice==2) Scene4();
1650:         }
1651:        
1652:         if(choice==0)
1653:         {
1654:             if(action==3)
1655:             {
1656:                 fixPrint(1,27,4,3,"I tell her that she has a gorgeous");
1657:                 fixPrint(1,28,4,3,"body.");
1658:             }
1659:             if(action==4)
1660:             {
1661:                 fixPrint(1,25,4,3,"She seems to ignore my compliment. Of");
1662:                 fixPrint(1,26,4,3,"course she does! She probably hears");
1663:                 fixPrint(1,27,4,3,"those kinds of compliments all the");
1664:                 fixPrint(1,28,4,3,"time.");
1665:             }
1666:             if(action==5)
1667:             {
1668:                 fixPrint(1,27,4,3,"Ok then. Let's just start doing my job");
1669:                 fixPrint(1,28,4,3,"before it gets even worse.");
1670:             }
1671:             if(action==6)
1672:             {
1673:                 choice=1;
1674:                 action=3;
1675:             }
1676:             if(action==9)
1677:             {
1678:                 fixPrint(1,27,4,3,"I smile at her warmly and promise her");
1679:                 fixPrint(1,28,4,3,"a night she'll never forget.");
1680:             }
1681:             if(action==10)
1682:             {
1683:                 avatar(1,2);
1684:                 fixPrint(1,27,3,3,"Excuse me?! Don't you know that I");
1685:                 fixPrint(1,28,3,3,"don't do boys?!");
1686:             }
1687:             if(action==11)
1688:             {
1689:                 fixPrint(1,26,4,3,"Looks like I really pissed her off.");
1690:                 fixPrint(1,27,4,3,"Now there's no chance I'm gonna seduce");
1691:                 fixPrint(1,28,4,3,"her.");
1692:             }
1693:             if(action==12)
1694:             {
1695:                 fixPrint(1,27,4,3,"Bad move, buddy. Such things can ruin");
1696:                 fixPrint(1,28,4,3,"my entire carrier.");
1697:             }
1698:             if(action==13)
1699:             {
1700:                 //clearFixLayer();
1701:                 GameOver();
1702:             }
1703:         }
1704:         if(choice==1)
1705:         {
1706:             if(action==3)
1707:             {
1708:                 fixPrint(1,27,4,3,"I'm setting up the camera and starting");
1709:                 fixPrint(1,28,4,3,"taking pictures.");
1710:             }
1711:             if(action==4)
1712:             {
1713:                 fixPrint(1,26,4,3,"Now everything goes smoothly. Oh boy...");
1714:                 fixPrint(1,27,4,3,"She's such a beauty! And so");
1715:                 fixPrint(1,28,4,3,"professional!");
1716:             }
1717:             if(action==5)
1718:             {      
1719:                 fixPrint(1,27,4,3,"After we're done I ask her what she's");
1720:                 fixPrint(1,28,4,3,"doing tonight.");
1721:             }
1722:             if(action==6)
1723:             {
1724:                 avatar(1,2);
1725:                 fixPrint(1,27,3,3,"I'm looking for something hot ");
1726:                 fixPrint(1,28,3,3,"tonight... If you know what I mean.");
1727:             }
1728:             if(action==7)
1729:             {
1730:                 choice=0;
1731:                 action=8;
1732:             }
1733:             if(action==9)
1734:             {
1735:                 fixPrint(1,26,4,3,"She asks me if I know some hot girls.");
1736:                 fixPrint(1,27,4,3,"Oh my... Who would've thought she was");
1737:                 fixPrint(1,28,4,3,"into chicks?!");
1738:             }
1739:             if(action==10)
1740:             {
1741:                 fixPrint(1,26,4,3,"I'm telling her that she can stay at");
1742:                 fixPrint(1,27,4,3,"my place while I go out and find her");
1743:                 fixPrint(1,28,4,3,"some pretty girl.");
1744:             }
1745:             if(action==11)
1746:             {
1747:                 choice=0;
1748:                 action=14;
1749:             }
1750:         }
1751:        
1752:         //scrollerSetPos(&sc,posX,posY);
1753:     }
1754: }
1755: 
1756: void Scene0() {
1757:     scroller sc;
1758:     // short posX=0;
1759:     // short posY=0;
1760:     // ushort *data;
1761:     // ushort flipMode=0;
1762:     button_available=true;
1763:     choice=0;
1764:     action=0;
1765:    
1766:     clearFixLayer();
1767:     scrollerInit(&sc,&BkgA,1,16,0,0);
1768:     palJobPut(16, BkgA.palInfo->count, BkgA.palInfo->data);
1769: 
1770:     while(1) {
1771:         SCClose();
1772:         waitVBlank();
1773:         Control_Sub();
1774:            
1775:         if(action==0)
1776:         {
1777:             fixPrint(1,27,4,3,"Hi! It's me, Casanova - a natural born");
1778:             fixPrint(1,28,4,3,"pick-up artist!");
1779:         }  
1780:        
1781:         if(action==1)
1782:         {  
1783:             fixPrint(1,27,4,3,"Not so long ago I became a");
1784:             fixPrint(1,28,4,3,"professional photographer.");
1785:         }
1786:        
1787:         if(action==2)
1788:         {
1789:             fixPrint(1,27,4,3,"And today I'm going to have a photo");
1790:             fixPrint(1,28,4,3,"shoot with a famous fashion model.");
1791:         }
1792:        
1793:         if(action==3)
1794:         {
1795:             fixPrint(1,26,4,3,"Well... Looks like I gotta go. It is");
1796:             fixPrint(1,27,4,3,"extremely important and I can't be");    
1797:             fixPrint(1,28,4,3,"late.");
1798:         }
1799:        
1800:         if(action==4)
1801:         {
1802:             clearSprites(1,21);
1803:             SCClose();
1804:             waitVBlank();
1805:             action=0;
1806:             Scene1();
1807:         }
1808:        
1809:         //scrollerSetPos(&sc,posX,posY);
1810:     }
1811: }
1812: 
1813: int main(void) {
1814:     int scrl_x=0;
1815:     int scrl_y=0;
1816:     short showdebug=false;
1817:     scroller frontScroll;
1818:     ushort *data;
1819:     // ushort flipMode=0;
1820:    
1821:     send_sound_command(ADPCM_DR_LOVE);
1822:    
1823:     clearFixLayer();
1824:     initGfx();
1825: 
1826:     palJobPut(0,8,fixPalettes);
1827: 
1828:     //if(setup4P())
1829:     //  fixPrint(2,4,7,3,"4P! :)");
1830:     //else fixPrint(2,4,7,3,"no 4P :(");
1831: 
1832:     backgroundColor(0x7bbb);
1833:     jobMeterSetup(true);
1834: 
1835:     scrollerInit(&frontScroll, &ffbg_b, 1, 16, scrl_x, scrl_y);
1836:     //scrollerInitClipped(&frontScroll, &ffbg_b, 22, 16 + ffbg_a.palInfo->count, x, y, CLIPPING);
1837:     palJobPut(16, ffbg_b.palInfo->count, ffbg_b.palInfo->data);
1838: 
1839:     data=dbgTags.maps[0];
1840:     palJobPut(200,dbgTags.palInfo->count,&dbgTags.palInfo->data);
1841:     SC234Put(VRAM_POSX_ADDR(200),VRAM_POSX(0));
1842:     SC234Put(VRAM_POSY_ADDR(200),VRAM_POSY(224,SPR_UNLINK,0));
1843:     SC234Put(VRAM_SPR_ADDR(200),data[4<<1]);
1844:     SC234Put(VRAM_SPR_ADDR(200)+1,200<<8);
1845:     SC234Put(VRAM_POSX_ADDR(201),VRAM_POSX(0));
1846:     SC234Put(VRAM_POSY_ADDR(201),VRAM_POSY(224,SPR_UNLINK,0));
1847:     SC234Put(VRAM_SPR_ADDR(201),data[40<<1]);
1848:     SC234Put(VRAM_SPR_ADDR(201)+1,200<<8);
1849:     SC234Put(VRAM_POSX_ADDR(202),VRAM_POSX(0));
1850:     SC234Put(VRAM_POSY_ADDR(202),VRAM_POSY(224,SPR_UNLINK,0));
1851:     SC234Put(VRAM_SPR_ADDR(202),data[40<<1]);
1852:     SC234Put(VRAM_SPR_ADDR(202)+1,(200<<8)|FLIP_X);
1853:     SC234Put(VRAM_POSX_ADDR(203),VRAM_POSX(0));
1854:     SC234Put(VRAM_POSY_ADDR(203),VRAM_POSY(224,SPR_UNLINK,0));
1855:     SC234Put(VRAM_SPR_ADDR(203),data[40<<1]);
1856:     SC234Put(VRAM_SPR_ADDR(203)+1,(200<<8)|FLIP_Y);
1857:     SC234Put(VRAM_POSX_ADDR(204),VRAM_POSX(0));
1858:     SC234Put(VRAM_POSY_ADDR(204),VRAM_POSY(224,SPR_UNLINK,0));
1859:     SC234Put(VRAM_SPR_ADDR(204),data[40<<1]);
1860:     SC234Put(VRAM_SPR_ADDR(204)+1,(200<<8)|FLIP_XY);
1861:    
1862:     fixPrint(14,20,4,3,"PRESS START");
1863:    
1864:     while(1) {
1865:         SCClose();
1866:         waitVBlank();
1867: 
1868:         p1=volMEMBYTE(P1_CURRENT);
1869:         p1e=volMEMBYTE(P1_EDGE);
1870:         ps=volMEMBYTE(PS_EDGE);
1871:        
1872:         while((volMEMWORD(0x3c0006)>>7)!=0x120); //wait raster line 16
1873:         jobMeterColor(JOB_BLUE);
1874: 
1875:         /*if((p1&JOY_UP)&&y>=176)   y--;
1876:         if((p1&JOY_DOWN)&&y<=220)   y++;
1877:         if((p1&JOY_LEFT)&&x>=32)
1878:         {
1879:             x--;
1880:             flipMode|=FLIP_X;
1881:             aSpriteSetFlip(&demoSpr,flipMode);
1882:         }
1883:         if((p1&JOY_RIGHT)&&x<=288)
1884:         {
1885:             x++;
1886:             flipMode&=~FLIP_X;
1887:             aSpriteSetFlip(&demoSpr,flipMode);
1888:         }*/
1889:        
1890:         if(ps&P1_START) {
1891:             clearSprites(1, 42);
1892:             SCClose();
1893:             waitVBlank();
1894:             Scene6();
1895:         }
1896:        
1897:         if(p1e&JOY_D) {
1898:             if(showdebug) {
1899:                 //move debug stuff offscreen
1900:                 SC234Put(VRAM_POSY_ADDR(200),VRAM_POSY(224,SPR_UNLINK,0));
1901:                 SC234Put(VRAM_POSY_ADDR(201),VRAM_POSY(224,SPR_UNLINK,0));
1902:                 SC234Put(VRAM_POSY_ADDR(202),VRAM_POSY(224,SPR_UNLINK,0));
1903:                 SC234Put(VRAM_POSY_ADDR(203),VRAM_POSY(224,SPR_UNLINK,0));
1904:                 SC234Put(VRAM_POSY_ADDR(204),VRAM_POSY(224,SPR_UNLINK,0));
1905:                 fixJobPut(0,25,FIX_LINE_WRITE,0,_fixBlankLine);
1906:                 fixJobPut(0,26,FIX_LINE_WRITE,0,_fixBlankLine);
1907:                 fixJobPut(0,27,FIX_LINE_WRITE,0,_fixBlankLine);
1908:                 fixJobPut(0,28,FIX_LINE_WRITE,0,_fixBlankLine);
1909:             }
1910:             showdebug^=1;
1911:         }
1912: 
1913:         //aSprite debug info
1914:         /*if(showdebug) {
1915:             jobMeterColor(JOB_BLACK);
1916:             if(!(demoSpr.flags&AS_FLAG_STRICT_COORDS)) {
1917:                 if(demoSpr.currentFlip&FLIP_X) relX=x-((demoSpr.currentFrame->tileWidth<<4)+demoSpr.currentStep->shiftX)+1;
1918:                     else relX=x+demoSpr.currentStep->shiftX;
1919:                 if(demoSpr.currentFlip&FLIP_Y) relY=y-((demoSpr.currentFrame->tileHeight<<4)+demoSpr.currentStep->shiftY)+1;
1920:                     else relY=y+demoSpr.currentStep->shiftY;
1921:             } else {
1922:                 relX=demoSpr.posX;
1923:                 relY=demoSpr.posY;
1924:             }
1925:             SC234Put(VRAM_POSX_ADDR(200),VRAM_POSX(x-3));
1926:             SC234Put(VRAM_POSY_ADDR(200),VRAM_POSY(y-3,SPR_UNLINK,1));
1927:             SC234Put(VRAM_POSX_ADDR(201),VRAM_POSX(relX));
1928:             SC234Put(VRAM_POSY_ADDR(201),VRAM_POSY(relY,SPR_UNLINK,1));
1929:             SC234Put(VRAM_POSX_ADDR(202),VRAM_POSX(relX+((demoSpr.currentFrame->tileWidth-1)<<4)));
1930:             SC234Put(VRAM_POSY_ADDR(202),VRAM_POSY(relY,SPR_UNLINK,1));
1931:             SC234Put(VRAM_POSX_ADDR(203),VRAM_POSX(relX));
1932:             SC234Put(VRAM_POSY_ADDR(203),VRAM_POSY(relY+((demoSpr.currentFrame->tileHeight-1)<<4),SPR_UNLINK,1));
1933:             SC234Put(VRAM_POSX_ADDR(204),VRAM_POSX(relX+((demoSpr.currentFrame->tileWidth-1)<<4)));
1934:             SC234Put(VRAM_POSY_ADDR(204),VRAM_POSY(relY+((demoSpr.currentFrame->tileHeight-1)<<4),SPR_UNLINK,1));
1935:            
1936:             //debug live update prints = 1 frame ahead. meh.
1937:             jobMeterColor(JOB_GREY);
1938:             fixPrintf1(3,25,2,3,"Anim data: A:%02d S:%02d R:%02d   ",demoSpr.currentAnim,demoSpr.stepNum,demoSpr.repeats);
1939:             fixPrintf1(3,26,2,3,"Step data: Frame:0x%06x",bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].frame);
1940:             fixPrintf1(14,27,2,3,"SX:%04d SY:%04d D:%02d",
1941:                 bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].shiftX,
1942:                 bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].shiftY,
1943:                 bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].duration
1944:             );
1945:             fixPrintf1(2,28,2,3,"Frame data: W:%02d H:%02d TMAP:0x%06x",
1946:                 ((sprFrame*)(bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].frame))->tileWidth,
1947:                 ((sprFrame*)(bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].frame))->tileHeight,
1948:                 ((sprFrame*)(bmary_spr.anims[demoSpr.currentAnim][demoSpr.stepNum].frame))->maps[demoSpr.currentFlip]
1949:             );
1950:         }*/
1951:        
1952:         //scrollerSetPos(&frontScroll, scrl_x, scrl_y);
1953:         //scrollerSetPosClipped(&frontScroll, x, y, CLIPPING);
1954: 
1955:         jobMeterColor(JOB_GREEN);
1956:     }
1957: }