~ubuntu-branches/ubuntu/edgy/tilp/edgy

« back to all changes in this revision

Viewing changes to src/tilp_calcs.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2004-10-31 16:31:08 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20041031163108-ijcnonytcx6avaim
Tags: 6.76-1
* New upstream release.
  + Fixes crash on !i386 due to va_list misuse.
  + Doesn't show the action dbox if the list of identical variables is
    empty (closes: #276047).
* Bumped B-D on newest libti*.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Hey EMACS -*- linux-c -*- */
2
 
/* $Id: tilp_calcs.c 603 2004-04-16 09:58:26Z roms $ */
 
2
/* $Id: tilp_calcs.c 804 2004-10-04 09:06:59Z roms $ */
3
3
 
4
4
/*  tilp - Ti Linking Program
5
5
 *  Copyright (C) 1999-2004  Romain Lievin
57
57
        int err = 0;
58
58
        TicalcType c = 0;
59
59
        ticalc_get_calc(&c);
60
 
        if (options.auto_detect
61
 
            && tifiles_is_flash(options.lp.calc_type) && (options.lp.
62
 
                                                          calc_type !=
63
 
                                                          CALC_V200)) {
 
60
        if (options.auto_detect && 
 
61
                tifiles_is_flash(options.lp.calc_type) && 
 
62
                (options.lp.calc_type != CALC_TI84P) &&
 
63
                (options.lp.calc_type != CALC_TI89T) &&
 
64
                (options.lp.calc_type != CALC_V200)) 
 
65
        {
64
66
                err =
65
67
                    ticalc_flash_isready((TicalcType *) &
66
68
                                         (options.lp.calc_type));
124
126
                break;
125
127
        case CALC_TI73:
126
128
        case CALC_TI83:
127
 
        case CALC_TI83P:
 
129
        case CALC_TI83P:
 
130
        case CALC_TI84P:
128
131
        case CALC_TI92:
129
132
                gif->create_pbar_type3(_("Backup"));
130
133
                break;
131
 
        case CALC_TI89:
 
134
        case CALC_TI89:
 
135
        case CALC_TI89T:
132
136
        case CALC_TI92P:
133
137
        case CALC_V200:
134
138
                gif->create_pbar_type5(_("Backup"), "");
159
163
                break;
160
164
        case CALC_TI73:
161
165
        case CALC_TI83:
162
 
        case CALC_TI83P:
 
166
        case CALC_TI83P:
 
167
        case CALC_TI84P:
163
168
                gif->create_pbar_type3(_("Backup"));
164
169
                break;
165
 
        case CALC_TI89:
 
170
        case CALC_TI89:
 
171
        case CALC_TI89T:
166
172
        case CALC_TI92P:
167
173
        case CALC_V200:
168
174
                gif->create_pbar_type5(_("Backup"), "");
282
288
                } else
283
289
                        return -1;
284
290
                break;
285
 
        case CALC_TI83P:
 
291
        case CALC_TI83P:
 
292
        case CALC_TI84P:
 
293
                ret = gif->msg_box4(_("Information"), _
 
294
                                    ("1: TiLP will automatically transfer the ROM dumping program\n2: but, it will wait for you to manually launch it from the calculator (either by the shell, either by typing 'Asm(DUMPROM)'.\nThanks to Benjamin Moody for the ROM dumper !"));
 
295
                if (ret == BUTTON1)
 
296
                        return do_rom_dump(0);
 
297
 
 
298
                else
 
299
                        return -1;
 
300
                break;
286
301
        case CALC_TI86:
287
302
                ret = gif->msg_box4(_("Information"), _
288
 
                                    ("1: TiLP will automatically transfer the ROM dumping program\n2: but, it will wait for you to manually launch it from the calculator (either by the shell, either by typing 'asm(rom86)'."));
 
303
                                    ("1: TiLP will automatically transfer the ROM dumping program\n2: but, it will wait for you to manually launch it from the calculator (either by the shell, either by typing 'Asm(DUMPROM)'."));
289
304
                if (ret == BUTTON1)
290
305
                        return do_rom_dump(0);
291
306
 
292
307
                else
293
308
                        return -1;
294
309
                break;
295
 
        case CALC_TI89:
 
310
        case CALC_TI89:
 
311
        case CALC_TI89T:
296
312
        case CALC_TI92P:
297
313
        case CALC_V200:
298
314
                return do_rom_dump(0);
349
365
        case CALC_TI73:
350
366
        case CALC_TI82:
351
367
        case CALC_TI83:
352
 
        case CALC_TI83P:
 
368
        case CALC_TI83P:
 
369
        case CALC_TI84P:
353
370
        case CALC_TI85:
354
371
        case CALC_TI92:
355
372
                gif->create_pbar_type3(_("Flash"));
356
373
                break;
357
 
        case CALC_TI89:
 
374
        case CALC_TI89:
 
375
        case CALC_TI89T:
358
376
        case CALC_TI92P:
359
377
        case CALC_V200:
360
378
                gif->create_pbar_type3(_("Flash"));
415
433
                break;
416
434
        }
417
435
        old_timeout = ticable_get_timeout();
418
 
        if(options.lp.calc_type == CALC_TI83P)
 
436
        if((options.lp.calc_type == CALC_TI83P) || (options.lp.calc_type == CALC_TI84P))
419
437
                ticable_set_timeout(300);
420
438
        else
421
439
                ticable_set_timeout(100);
442
460
                return -1;
443
461
        switch (options.lp.calc_type) {
444
462
        case CALC_TI73:
445
 
        case CALC_TI83P:
446
 
        case CALC_TI89:
 
463
        case CALC_TI83P:
 
464
        case CALC_TI84P:
 
465
        case CALC_TI89:
 
466
        case CALC_TI89T:
447
467
        case CALC_TI92P:
448
468
        case CALC_V200:
449
469
                gif->create_pbar_type5(_("Receiving application(s)"), "");
539
559
        info_update.start();
540
560
 
541
561
        /* FLASH upgrade */
542
 
        for (i = 0; i < ptr->data_length; i++) {
 
562
        for (i = 0; i < (int)ptr->data_length; i++) {
543
563
 
544
564
                //info_update.percentage = (float)i/ptr->data_length;
545
565
                //info_update.pbar();
575
595
                if (options.lp.calc_type == CALC_TI83P)
576
596
                        mode |= MODE_SEND_TO_FLASH;
577
597
 
578
 
                else if (options.lp.calc_type == CALC_TI89
 
598
                else if (options.lp.calc_type == CALC_TI89
 
599
                         || options.lp.calc_type == CALC_TI89T
579
600
                         || options.lp.calc_type == CALC_TI92P
580
601
                         || options.lp.calc_type == CALC_V200)
581
602
                        mode |= MODE_BACKUP;
678
699
        switch (options.lp.calc_type) {
679
700
        case CALC_TI73:
680
701
        case CALC_TI83:
681
 
        case CALC_TI83P:
 
702
        case CALC_TI83P:
 
703
        case CALC_TI84P:
682
704
        case CALC_TI86:
683
 
        case CALC_TI89:
 
705
        case CALC_TI89:
 
706
        case CALC_TI89T:
684
707
        case CALC_TI92:
685
708
        case CALC_TI92P:
686
709
        case CALC_V200: