ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/main_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/main_amiga.cpp (file contents):
Revision 1.3 by cebix, 1999-10-19T19:28:15Z vs.
Revision 1.8 by cebix, 2000-07-22T16:00:34Z

# Line 1 | Line 1
1   /*
2   *  main_amiga.cpp - Startup code for AmigaOS
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2000 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 56 | Line 56
56   #include "debug.h"
57  
58  
59 < // Our minimum stack requirement
60 < unsigned long __stack = 0x4000;
59 > // Options for libnix
60 > unsigned long __stack = 0x4000;         // Stack requirement
61 > int __nocommandline = 1;                        // Disable command line parsing
62  
63  
64   // Constants
# Line 90 | Line 91 | struct Library *GadToolsBase = NULL;
91   struct Library *IFFParseBase = NULL;
92   struct Library *AslBase = NULL;
93   struct Library *P96Base = NULL;
94 + struct Library *CyberGfxBase = NULL;
95   struct Library *TimerBase = NULL;
96   struct Library *AHIBase = NULL;
97   struct Library *DiskBase = NULL;
# Line 179 | Line 181 | int main(void)
181                  ErrorAlert(GetString(STR_NO_ASL_LIB_ERR));
182                  QuitEmulator();
183          }
184 +
185 +        // These two can fail (the respective gfx support won't be available, then)
186          P96Base = OpenLibrary((UBYTE *)"Picasso96API.library", 2);
187 +        CyberGfxBase = OpenLibrary((UBYTE *)"cybergraphics.library", 2);
188  
189          // Read preferences
190          PrefsInit();
# Line 342 | Line 347 | void __saveds quit_emulator(void)
347  
348   void QuitEmulator(void)
349   {
350 +        // Stop 60Hz thread
351 +        if (tick_proc) {
352 +                SetSignal(0, SIGF_SINGLE);
353 +                tick_proc_active = false;
354 +                Wait(SIGF_SINGLE);
355 +        }
356 +
357          // Restore stack
358          if (stack_swapped) {
359                  stack_swapped = false;
# Line 355 | Line 367 | void QuitEmulator(void)
367                  FreeSignal(IRQSig);
368          }
369  
358        // Stop 60Hz thread
359        if (tick_proc) {
360                SetSignal(0, SIGF_SINGLE);
361                tick_proc_active = false;
362                Wait(SIGF_SINGLE);
363        }
364
370          // Remove trap handler
371          MainTask->tc_TrapCode = OldTrapHandler;
372  
# Line 397 | Line 402 | void QuitEmulator(void)
402          PrefsExit();
403  
404          // Close libraries
405 +        if (CyberGfxBase)
406 +                CloseLibrary(CyberGfxBase);
407          if (P96Base)
408                  CloseLibrary(P96Base);
409          if (AslBase)
# Line 488 | Line 495 | static __saveds void tick_func(void)
495                  if (++tick_counter > 60) {
496                          tick_counter = 0;
497                          WriteMacInt32(0x20c, TimerDateTime());
498 +                        SetInterruptFlag(INTFLAG_1HZ);
499 +                        TriggerInterrupt();
500                  }
501  
502                  // Trigger 60Hz interrupt
# Line 601 | Line 610 | void __saveds IllInstrHandler(trap_regs
610                  EmulatedSR |= 0x0700;
611  
612                  // Call opcode routine
613 <                EmulOp(*(uint16 *)(r->pc), (M68kRegisters *)r);
613 >                EmulOp(opcode, (M68kRegisters *)r);
614                  r->pc += 2;
615  
616                  // Restore interrupts

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines