1 diff -ur bsvc-2.1/src/Assemblers/68kasm/codegen.c bsvc-2.1-fixed/src/Assemblers/68kasm/codegen.c
2 --- bsvc-2.1/src/Assemblers/68kasm/codegen.c 1998-11-09 04:39:28.000000000 +0100
3 +++ bsvc-2.1-fixed/src/Assemblers/68kasm/codegen.c 2007-05-30 22:47:40.000000000 +0200
5 case BYTE : printf("Output: Byte %02X put into output stream at location %08X\n", data, loc); break;
6 case WORD : printf("Output: Word %04X put into output stream at location %08X\n", data, loc); break;
7 case LONG : printf("Output: Longword %08X put into output stream at location %08X\n", data, loc); break;
8 - default : printf("OUTPUT: INVALID SIZE CODE!\n"); exit();
9 + default : printf("OUTPUT: INVALID SIZE CODE!\n"); exit(1);
17 - default : printf("INVALID EFFECTIVE ADDRESSING MODE!\n"); exit();
18 + default : printf("INVALID EFFECTIVE ADDRESSING MODE!\n"); exit(1);
21 diff -ur bsvc-2.1/src/Assemblers/68kasm/listing.c bsvc-2.1-fixed/src/Assemblers/68kasm/listing.c
22 --- bsvc-2.1/src/Assemblers/68kasm/listing.c 1998-11-09 04:39:28.000000000 +0100
23 +++ bsvc-2.1-fixed/src/Assemblers/68kasm/listing.c 2007-05-30 22:47:40.000000000 +0200
25 listFile = fopen(name, "w");
27 puts("Can't open listing file");
35 if (ferror(listFile)) {
36 fputs("Error writing to listing file\n", stderr);
43 case LONG : sprintf(listPtr, "%08X ", data);
46 - default : printf("LISTOBJ: INVALID SIZE CODE!\n"); exit();
47 + default : printf("LISTOBJ: INVALID SIZE CODE!\n"); exit(1);
50 diff -ur bsvc-2.1/src/Assemblers/68kasm/main.c bsvc-2.1-fixed/src/Assemblers/68kasm/main.c
51 --- bsvc-2.1/src/Assemblers/68kasm/main.c 1998-11-09 04:39:28.000000000 +0100
52 +++ bsvc-2.1-fixed/src/Assemblers/68kasm/main.c 2007-05-30 22:47:40.000000000 +0200
56 fputs("Couldn't create temporary file\n", stderr);
61 strcpy(fileName, argv[i]);
65 fputs("Input file not found\n", stderr);
70 error = buildCompleteSourceFile(srcFile, fileName, inFile, 1);
77 /* Rewind the in file to the beginning */
79 puts(" -l Produce listing file (infile.lis)");
80 puts(" -n Produce NO object file (infile.h68)");
81 puts(" -a Produce long word absolute addresses only (infile.h68)");
86 diff -ur bsvc-2.1/src/Assemblers/68kasm/object.c bsvc-2.1-fixed/src/Assemblers/68kasm/object.c
87 --- bsvc-2.1/src/Assemblers/68kasm/object.c 1998-11-09 04:39:28.000000000 +0100
88 +++ bsvc-2.1-fixed/src/Assemblers/68kasm/object.c 2007-05-30 22:47:40.000000000 +0200
90 objFile = fopen(name, "w");
92 puts("Can't open object file");
96 /* Output S-record file header */
97 /* fputs("Here comes an S-record...\n", objFile); */
100 checksum += checkValue(data);
102 - default : printf("outputObj: INVALID SIZE CODE!\n"); exit();
103 + default : printf("outputObj: INVALID SIZE CODE!\n"); exit(1);
108 fputs(sRecord, objFile);
109 if (ferror(objFile)) {
110 fputs(objErrorMsg, stderr);
117 fputs("S9030000FC\n", objFile);
118 if (ferror(objFile)) {
119 fputs(objErrorMsg, stderr);
125 diff -ur bsvc-2.1/src/Framework/AddressSpace.hxx bsvc-2.1-fixed/src/Framework/AddressSpace.hxx
126 --- bsvc-2.1/src/Framework/AddressSpace.hxx 1998-11-09 04:39:28.000000000 +0100
127 +++ bsvc-2.1-fixed/src/Framework/AddressSpace.hxx 2007-05-30 22:47:40.000000000 +0200
133 - using namespace std;
135 +using namespace std;
139 diff -ur bsvc-2.1/src/Framework/BasicDevice.hxx bsvc-2.1-fixed/src/Framework/BasicDevice.hxx
140 --- bsvc-2.1/src/Framework/BasicDevice.hxx 1998-11-09 04:39:28.000000000 +0100
141 +++ bsvc-2.1-fixed/src/Framework/BasicDevice.hxx 2007-05-30 22:47:40.000000000 +0200
143 #ifndef BASICDEVICE_HXX
144 #define BASICDEVICE_HXX
150 - using namespace std;
152 +using namespace std;
156 diff -ur bsvc-2.1/src/Framework/BasicDeviceRegistry.hxx bsvc-2.1-fixed/src/Framework/BasicDeviceRegistry.hxx
157 --- bsvc-2.1/src/Framework/BasicDeviceRegistry.hxx 1998-11-09 04:39:28.000000000 +0100
158 +++ bsvc-2.1-fixed/src/Framework/BasicDeviceRegistry.hxx 2007-05-30 22:47:40.000000000 +0200
164 - using namespace std;
166 +using namespace std;
170 diff -ur bsvc-2.1/src/Framework/BreakpointList.hxx bsvc-2.1-fixed/src/Framework/BreakpointList.hxx
171 --- bsvc-2.1/src/Framework/BreakpointList.hxx 1998-11-09 04:39:28.000000000 +0100
172 +++ bsvc-2.1-fixed/src/Framework/BreakpointList.hxx 2007-05-30 22:47:40.000000000 +0200
178 - using namespace std;
180 +using namespace std;
182 class BreakpointList {
184 diff -ur bsvc-2.1/src/Framework/Interface.cxx bsvc-2.1-fixed/src/Framework/Interface.cxx
185 --- bsvc-2.1/src/Framework/Interface.cxx 1998-11-09 04:39:28.000000000 +0100
186 +++ bsvc-2.1-fixed/src/Framework/Interface.cxx 2007-05-30 22:47:40.000000000 +0200
188 #include <sys/types.h>
191 - #include <iostream.h>
192 - #include <strstream.h>
193 + #include <iostream>
194 + #include <strstream>
199 - using namespace std;
201 +using namespace std;
203 #include "Interface.hxx"
204 #include "BasicCPU.hxx"
205 diff -ur bsvc-2.1/src/Framework/Interface.hxx bsvc-2.1-fixed/src/Framework/Interface.hxx
206 --- bsvc-2.1/src/Framework/Interface.hxx 1998-11-09 04:39:28.000000000 +0100
207 +++ bsvc-2.1-fixed/src/Framework/Interface.hxx 2007-05-30 22:47:40.000000000 +0200
209 #ifndef INTERFACE_HXX
210 #define INTERFACE_HXX
213 - #include <iostream>
215 - #include <iostream.h>
220 - using namespace std;
222 +using namespace std;
225 class BasicDeviceRegistry;
226 diff -ur bsvc-2.1/src/Framework/Tools.hxx bsvc-2.1-fixed/src/Framework/Tools.hxx
227 --- bsvc-2.1/src/Framework/Tools.hxx 1998-11-09 04:39:28.000000000 +0100
228 +++ bsvc-2.1-fixed/src/Framework/Tools.hxx 2007-05-30 22:47:40.000000000 +0200
234 - using namespace std;
236 +using namespace std;
238 ///////////////////////////////////////////////////////////////////////////////
239 // Convert the hex string to an unsigned integer
240 diff -ur bsvc-2.1/src/Makefile.common bsvc-2.1-fixed/src/Makefile.common
241 --- bsvc-2.1/src/Makefile.common 1998-11-09 04:39:28.000000000 +0100
242 +++ bsvc-2.1-fixed/src/Makefile.common 2007-05-30 22:48:16.000000000 +0200
244 ###############################################################################
246 ## Base Directory of the BSVC distribution
247 -PROJECT_BASE = /home/bwmott/projects/bsvc/development/bsvc
248 +PROJECT_BASE = /usr/src/bsvc/src/bsvc-2.1
250 ## Directory to install the BSVC system
251 INSTALL_DIR = $(PROJECT_BASE)/bin
252 diff -ur bsvc-2.1/src/Tools/xtermpipe/xtermpipe.cxx bsvc-2.1-fixed/src/Tools/xtermpipe/xtermpipe.cxx
253 --- bsvc-2.1/src/Tools/xtermpipe/xtermpipe.cxx 1998-11-09 04:39:28.000000000 +0100
254 +++ bsvc-2.1-fixed/src/Tools/xtermpipe/xtermpipe.cxx 2007-05-30 22:47:40.000000000 +0200
259 +using namespace std;
261 int WaitForIO(int pipe_id)
265 select(pipe_id + 1, (int*)&readfds, (int*)&writefds, (int*)&exceptfds,
268 - select(pipe_id + 1, &readfds, &writefds, &exceptfds, (void*)0);
269 + select(pipe_id + 1, &readfds, &writefds, &exceptfds, (timeval*)0);
272 if(FD_ISSET(0, &readfds))
280 int read_id, write_id;
282 diff -ur bsvc-2.1/src/sim68000/cpu/Makefile bsvc-2.1-fixed/src/sim68000/cpu/Makefile
283 --- bsvc-2.1/src/sim68000/cpu/Makefile 1998-11-09 04:39:28.000000000 +0100
284 +++ bsvc-2.1-fixed/src/sim68000/cpu/Makefile 2007-05-30 22:47:40.000000000 +0200
286 $(CC) $(INCLUDES) -o instruction instruction.c
288 m68000DecodeTable.hxx: instruction instruction.list
289 - $(PROJECT_BASE)/src/sim68000/cpu/instruction
293 rm -f *.o $(LIBRARY) instruction
294 diff -ur bsvc-2.1/src/sim68000/cpu/exec.cxx bsvc-2.1-fixed/src/sim68000/cpu/exec.cxx
295 --- bsvc-2.1/src/sim68000/cpu/exec.cxx 1998-11-09 04:39:28.000000000 +0100
296 +++ bsvc-2.1-fixed/src/sim68000/cpu/exec.cxx 2007-05-30 22:47:40.000000000 +0200
302 - using namespace std;
304 +using namespace std;
306 -#include "AddressSpace.hxx"
307 +#include "../../Framework/AddressSpace.hxx"
308 #include "m68000.hxx"
309 -#include "Tools.hxx"
310 +#include "../../Framework/Tools.hxx"
312 ///////////////////////////////////////////////////////////////////////////////
313 // Compute the effective address, given the mode and register bits
314 diff -ur bsvc-2.1/src/sim68000/cpu/m68000.cxx bsvc-2.1-fixed/src/sim68000/cpu/m68000.cxx
315 --- bsvc-2.1/src/sim68000/cpu/m68000.cxx 1998-11-09 04:39:28.000000000 +0100
316 +++ bsvc-2.1-fixed/src/sim68000/cpu/m68000.cxx 2007-05-30 22:47:40.000000000 +0200
318 // $Id: m68000.cxx,v 1.1 1996/08/02 14:59:18 bwmott Exp $
319 ///////////////////////////////////////////////////////////////////////////////
321 -#include "Tools.hxx"
322 +#include "../../Framework/Tools.hxx"
323 #include "m68000.hxx"
324 -#include "BasicDevice.hxx"
325 -#include "RegInfo.hxx"
326 -#include "AddressSpace.hxx"
327 +#include "../../Framework/BasicDevice.hxx"
328 +#include "../../Framework/RegInfo.hxx"
329 +#include "../../Framework/AddressSpace.hxx"
331 // Array of information about each register
332 m68000::RegisterData m68000::ourRegisterData[] = {
333 diff -ur bsvc-2.1/src/sim68000/cpu/m68000.hxx bsvc-2.1-fixed/src/sim68000/cpu/m68000.hxx
334 --- bsvc-2.1/src/sim68000/cpu/m68000.hxx 1998-11-09 04:39:28.000000000 +0100
335 +++ bsvc-2.1-fixed/src/sim68000/cpu/m68000.hxx 2007-05-30 22:47:40.000000000 +0200
341 - #include <iostream>
343 - #include <iostream.h>
348 - using namespace std;
350 +using namespace std;
354 -#include "BasicCPU.hxx"
355 +#include "../../Framework/BasicCPU.hxx"
357 // Instruction Size Constants
359 diff -ur bsvc-2.1/src/sim68000/devices/DeviceRegistry.hxx bsvc-2.1-fixed/src/sim68000/devices/DeviceRegistry.hxx
360 --- bsvc-2.1/src/sim68000/devices/DeviceRegistry.hxx 1998-11-09 04:39:28.000000000 +0100
361 +++ bsvc-2.1-fixed/src/sim68000/devices/DeviceRegistry.hxx 2007-05-30 22:47:40.000000000 +0200
363 #ifndef DEVICEREGISTRY_HXX
364 #define DEVICEREGISTRY_HXX
366 -#include "BasicDeviceRegistry.hxx"
367 +#include "../../Framework/BasicDeviceRegistry.hxx"
369 ///////////////////////////////////////////////////////////////////////////////
370 // The DeviceRegistry Class
371 diff -ur bsvc-2.1/src/sim68000/devices/M68681.cxx bsvc-2.1-fixed/src/sim68000/devices/M68681.cxx
372 --- bsvc-2.1/src/sim68000/devices/M68681.cxx 1998-11-09 04:39:28.000000000 +0100
373 +++ bsvc-2.1-fixed/src/sim68000/devices/M68681.cxx 2007-05-30 22:47:40.000000000 +0200
375 // $Id: M68681.cxx,v 1.1 1996/08/02 15:01:10 bwmott Exp $
376 ///////////////////////////////////////////////////////////////////////////////
378 -#include <iostream.h>
379 -#include <strstream.h>
381 +#include <strstream>
384 #include <sys/types.h>
389 -#include "BasicCPU.hxx"
390 +#include "../../Framework/BasicCPU.hxx"
391 #include "M68681.hxx"
394 diff -ur bsvc-2.1/src/sim68000/devices/M68681.hxx bsvc-2.1-fixed/src/sim68000/devices/M68681.hxx
395 --- bsvc-2.1/src/sim68000/devices/M68681.hxx 1998-11-09 04:39:28.000000000 +0100
396 +++ bsvc-2.1-fixed/src/sim68000/devices/M68681.hxx 2007-05-30 22:47:40.000000000 +0200
399 #include <sys/types.h>
401 -#include "BasicDevice.hxx"
402 +using namespace std;
404 +#include "../../Framework/BasicDevice.hxx"
406 class M68681 : public BasicDevice {
408 diff -ur bsvc-2.1/src/sim68000/devices/RAM.cxx bsvc-2.1-fixed/src/sim68000/devices/RAM.cxx
409 --- bsvc-2.1/src/sim68000/devices/RAM.cxx 1998-11-09 04:39:28.000000000 +0100
410 +++ bsvc-2.1-fixed/src/sim68000/devices/RAM.cxx 2007-05-30 22:47:40.000000000 +0200
412 // $Id: RAM.cxx,v 1.1 1996/08/02 15:02:49 bwmott Exp $
413 ///////////////////////////////////////////////////////////////////////////////
416 - #include <iostream>
417 - #include <strstream>
419 - #include <iostream.h>
420 - #include <strstream.h>
424 - using namespace std;
427 +#include <strstream>
429 -#include "Tools.hxx"
430 -#include "BasicCPU.hxx"
431 +using namespace std;
433 +#include "../../Framework/Tools.hxx"
434 +#include "../../Framework/BasicCPU.hxx"
437 ///////////////////////////////////////////////////////////////////////////////
438 diff -ur bsvc-2.1/src/sim68000/devices/RAM.hxx bsvc-2.1-fixed/src/sim68000/devices/RAM.hxx
439 --- bsvc-2.1/src/sim68000/devices/RAM.hxx 1998-11-09 04:39:28.000000000 +0100
440 +++ bsvc-2.1-fixed/src/sim68000/devices/RAM.hxx 2007-05-30 22:47:40.000000000 +0200
446 - using namespace std;
448 +using namespace std;
450 -#include "BasicDevice.hxx"
451 +#include "../../Framework/BasicDevice.hxx"
453 class RAM : public BasicDevice {
455 diff -ur bsvc-2.1/src/sim68000/devices/Timer.cxx bsvc-2.1-fixed/src/sim68000/devices/Timer.cxx
456 --- bsvc-2.1/src/sim68000/devices/Timer.cxx 1998-11-09 04:39:28.000000000 +0100
457 +++ bsvc-2.1-fixed/src/sim68000/devices/Timer.cxx 2007-05-30 22:47:40.000000000 +0200
459 -///////////////////////////////////////////////////////////////////////////////
463 -// This class keeps up with a list of all of the availible devices and
464 -// allocates them. It's dervied from the BasicDeviceRegistry
466 -// FILENAME: Timer.cxx
467 -// DESC: Simulates an timer for the M68000 CPU. Thus giving
468 -// the Simulator the ablility to simulate a timmer intrurpt.
469 -// Programmers can impliment time slicing with this timmer.
471 -// Contains Register and Offsets for the timer.
474 -// OWNER: Xavier Plasencia
476 -// DEPEN: This file requiers the Event hander and the BasicDevice files.
478 -///////////////////////////////////////////////////////////////////////////////
480 -///////////////////////////////////////////////////////////////////////////////
483 - #include <iostream>
484 - #include <strstream>
487 - #include <iostream.h>
488 - #include <strstream.h>
489 - #include <string.h>
493 - using namespace std;
496 -#include "BasicCPU.hxx"
497 -#include "Timer.hxx"
499 -///////////////////////////////////////////////////////////////////////////////
501 -///////////////////////////////////////////////////////////////////////////////
502 -Timer::Timer(const string& args, BasicCPU& cpu)
503 - : BasicDevice("Timer", args, cpu)
505 - istrstream in((char*)args.data(), args.size());
506 - string keyword, equals;
507 - unsigned long base;
511 - // Scan "BaseAddress = nnnn"
512 - // This is important for the CPU to know what address space
513 - // is used by the device.
514 - in >> keyword >> equals >> hex >> base;
515 - if((!in) || (keyword != "BaseAddress") || (equals != "="))
517 - ErrorMessage("Invalid initialization arguments!");
521 - in >> keyword >> equals >> hex >> irq;
522 - if((!in) || (keyword != "IRQ") || (equals != "="))
524 - ErrorMessage("Invalid initialization arguments!");
529 - I've hardcoded the cycles setting to 2000 which should provide the
530 - 125000 ticks per second for the PI/T
532 - unsigned long timer_cycle;
533 - in >> keyword >> equals >> hex >> timer_cycle;
534 - if((!in) || (keyword != "CycleSec") || (equals != "="))
536 - ErrorMessage("Invalid initialization arguments!");
539 - Timer::TIMER_CPU_CYCLE = timer_cycle;
542 - Timer::TIMER_IRQ = irq;
543 - Timer::TIMER_CPU_CYCLE = 2000;
544 - baseAddress = base * cpu.Granularity();
546 - // This is needed to start the whole process. The eventhandler
547 - // will always request an event and test to see if the user has
548 - // enabled the timer it not nothing happens but if so. The
549 - // CPR register is copied to the CNTR and is decremented for every
551 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
556 -///////////////////////////////////////////////////////////////////////////////
557 -// This routine should set myInterruptPending flag and send a request
558 -// to the CPU for an interrupt.
559 -///////////////////////////////////////////////////////////////////////////////
560 -void Timer::InterruptRequest(int level)
562 - // If no interrupt is pending then request one
563 - if(!myInterruptPending)
565 - myInterruptPending = true;
566 - myCPU.InterruptRequest(this, level);
570 -/*___________________________________________________________________________
571 - | FUNCTIONAME: InterruptAcknowledge(int)
572 - | DESC: This routine is called by the CPU when it processes a
573 - | requested interrupt. It should return the vector number associated with
574 - | the interrupt or AUTOVECTOR_INTERRUPT if the device doesn't generate
575 - | vectors. This default routine only does autovector interrupts.
576 - | This function is called by the CPU. The return value is usally the
577 - | memory location of a exemption funcion. How to handel these functions
578 - | one shold refer to a Motorla text book.
580 - | NOTE: Vecotor codes 5 and 7 are the only masks that will make the timer
581 - | do somthing. 5 is a VECTOR and 7 is an AUTOVECTOR. The code
582 - | can be found in any manual.
583 - |___________________________________________________________________________
585 -long Timer::InterruptAcknowledge(int)
587 - unsigned char cTCR = timerValue[TCR];
589 - if(myInterruptPending)
594 - //By returning the address of the vector, the cpu will
595 - //call the vector that is located in the right mem location.
596 - myInterruptPending = false;
597 - return timerValue[TIVR];
601 - myInterruptPending = false;
602 - return AUTOVECTOR_INTERRUPT;
606 - return SPURIOUS_INTERRUPT;
611 - return(SPURIOUS_INTERRUPT);
615 -/*______________________________________________________________
616 - | METHOD: Timer::CheckMapped( unsigned long adress)
617 - | DESC: Check to see if address mapps to device.
618 - |______________________________________________________________
620 -bool Timer::CheckMapped(unsigned long address) const
622 - return ((address >= baseAddress ) &&
623 - (address <= baseAddress+(22*sizeof(char))));
626 -/*______________________________________________________________
627 - | METHOD: Timer::Peek(unsigned long address)
628 - | DESC: Returns a byte from the device's address.
630 - | PEEK is the protocal that is used by the device to
631 - | inform the CPU what the registry settings are.
632 - | The use need not update the memory location for the CPU
633 - | All of this is done by the cpu and thus uses peek to
634 - | read the data that the device is using for the Memory
636 - |______________________________________________________________
638 -unsigned char Timer::Peek(unsigned long address)
640 - switch((address-baseAddress))
643 - return timerValue[TCR];
645 - return timerValue[TIVR];
647 - return timerValue[NULR];
649 - return timerValue[CPRH];
651 - return timerValue[CPRM];
653 - return timerValue[CPRL];
655 - return timerValue[CNTRH];
657 - return timerValue[CNTRM];
659 - return timerValue[CNTRL];
661 - return timerValue[TSR];
663 - return 0; //Error not a valid address.
666 -/*______________________________________________________________
667 - | METHOD: Timer::Poke(unsigned long address, char c)
668 - | DESC: This is the interface to the rest of the World. Here
669 - | the CPU or anyother devece writes to memory and updates the
670 - | device. Poke Changes the value of the registers.
671 - | Notice that there is no way for the user to WRITE to the
672 - | registers CNTR, this is because they are read only.
673 - |______________________________________________________________
675 -void Timer::Poke(unsigned long address, unsigned char c)
677 - switch((address-baseAddress))
683 - timerValue[TIVR]=c;
686 - timerValue[NULR]=c;
689 - timerValue[CPRH]=c;
692 - timerValue[CPRM]=c;
695 - timerValue[CPRL]=c;
703 -/*______________________________________________________________
704 - | METHOD: Timer::Reset()
705 - | DESC: Resets the timer. And Initalizes the Registers.
706 - |______________________________________________________________
710 - // Resets the interupt handler.
711 - myInterruptPending = false;
714 - // Clears the timers.
715 - for(int i=0; i <22; i++)
719 -/*______________________________________________________________
720 - | METHOD: VetcorTimer::EventCallback(long *data, void *ptr)
721 - | DESC: Function that executes when interupt occures.
722 - | DEP FUNC: Requires decCNTR copyCPRtoCNTR.
723 - |______________________________________________________________
725 -void Timer::EventCallback(long data, void *ptr)
727 - unsigned char cTCR = timerValue[TCR];
729 - // Test to see if timer is enabled, if False(0) do nothing.
730 - // but dispatch an event.
733 - // This test to see if the timer has not started a
734 - // count down. If it hasnt, copy the CPR register vaules
735 - // to the CNTR registers.
736 - if(firstTime == true)
742 - // Decriments the CNTR if 0 then call interrupt.
743 - // else dispatch an event.
746 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
750 - // Since the timer is now done, set the first time to ture,
751 - // so the next time the TCR is set to 1 it will copy the
752 - // CPR Register to CNTR.
755 - // Protocal says that the TCR should flip to 0. and that
756 - // TSR bit switches to 1. That is done below.
757 - timerValue[TCR] = (timerValue[TCR] & 0xfe);
758 - timerValue[TSR] = (timerValue[TSR] | 0x01);
760 - // Dispatch an IRQ only if user has set this in the
761 - // TCR register. (5 and 7) are the only valid
763 - if (((cTCR>>5) & 5) || ((cTCR>>5) &7))
765 - InterruptRequest(TIMER_IRQ);
767 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
771 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
775 -/*______________________________________________________________
776 - | METHOD: CopyCPRtoCNTR
777 - | DESC: Copies the register value of CPR to CNTR.
778 - | USED: By funce EventCallback
780 - |______________________________________________________________
782 -void Timer::copyCPRtoCNTR()
784 - timerValue[CNTRH] = timerValue[CPRH];
785 - timerValue[CNTRM] = timerValue[CPRM];
786 - timerValue[CNTRL] = timerValue[CPRL];
789 -/*______________________________________________________________
791 - | DESC: decriments the counter and checks for CNTR==0
792 - | retuns the value of CNTR.
793 - |______________________________________________________________
795 -unsigned int Timer::decCNTR()
800 - // Grab the values of the 24bit register to a value.
802 - temp24 = (unsigned int) timerValue[CNTRH];
803 - decValue = (decValue | ( temp24 << 24));
805 - temp24 = (unsigned int) timerValue[CNTRM];
806 - decValue = (decValue | (temp24 << 16));
808 - decValue = (decValue | timerValue[CNTRL]);
816 - // Put the value back the 24bit register to a value.
817 - // with the decremnt.
818 - timerValue[CNTRH] = ( unsigned char) (decValue >> 24);
819 - timerValue[CNTRM] = ( unsigned char) (decValue >> 16);
820 - timerValue[CNTRL] = ( unsigned char) (decValue );
822 - return (unsigned int) decValue;
825 +///////////////////////////////////////////////////////////////////////////////
829 +// This class keeps up with a list of all of the availible devices and
830 +// allocates them. It's dervied from the BasicDeviceRegistry
832 +// FILENAME: Timer.cxx
833 +// DESC: Simulates an timer for the M68000 CPU. Thus giving
834 +// the Simulator the ablility to simulate a timmer intrurpt.
835 +// Programmers can impliment time slicing with this timmer.
837 +// Contains Register and Offsets for the timer.
840 +// OWNER: Xavier Plasencia
842 +// DEPEN: This file requiers the Event hander and the BasicDevice files.
844 +///////////////////////////////////////////////////////////////////////////////
846 +///////////////////////////////////////////////////////////////////////////////
849 +#include <strstream>
852 +using namespace std;
854 +#include "../../Framework/BasicCPU.hxx"
855 +#include "Timer.hxx"
857 +///////////////////////////////////////////////////////////////////////////////
859 +///////////////////////////////////////////////////////////////////////////////
860 +Timer::Timer(const string& args, BasicCPU& cpu)
861 + : BasicDevice("Timer", args, cpu)
863 + istrstream in((char*)args.data(), args.size());
864 + string keyword, equals;
865 + unsigned long base;
869 + // Scan "BaseAddress = nnnn"
870 + // This is important for the CPU to know what address space
871 + // is used by the device.
872 + in >> keyword >> equals >> hex >> base;
873 + if((!in) || (keyword != "BaseAddress") || (equals != "="))
875 + ErrorMessage("Invalid initialization arguments!");
879 + in >> keyword >> equals >> hex >> irq;
880 + if((!in) || (keyword != "IRQ") || (equals != "="))
882 + ErrorMessage("Invalid initialization arguments!");
887 + I've hardcoded the cycles setting to 2000 which should provide the
888 + 125000 ticks per second for the PI/T
890 + unsigned long timer_cycle;
891 + in >> keyword >> equals >> hex >> timer_cycle;
892 + if((!in) || (keyword != "CycleSec") || (equals != "="))
894 + ErrorMessage("Invalid initialization arguments!");
897 + Timer::TIMER_CPU_CYCLE = timer_cycle;
900 + Timer::TIMER_IRQ = irq;
901 + Timer::TIMER_CPU_CYCLE = 2000;
902 + baseAddress = base * cpu.Granularity();
904 + // This is needed to start the whole process. The eventhandler
905 + // will always request an event and test to see if the user has
906 + // enabled the timer it not nothing happens but if so. The
907 + // CPR register is copied to the CNTR and is decremented for every
909 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
914 +///////////////////////////////////////////////////////////////////////////////
915 +// This routine should set myInterruptPending flag and send a request
916 +// to the CPU for an interrupt.
917 +///////////////////////////////////////////////////////////////////////////////
918 +void Timer::InterruptRequest(int level)
920 + // If no interrupt is pending then request one
921 + if(!myInterruptPending)
923 + myInterruptPending = true;
924 + myCPU.InterruptRequest(this, level);
928 +/*___________________________________________________________________________
929 + | FUNCTIONAME: InterruptAcknowledge(int)
930 + | DESC: This routine is called by the CPU when it processes a
931 + | requested interrupt. It should return the vector number associated with
932 + | the interrupt or AUTOVECTOR_INTERRUPT if the device doesn't generate
933 + | vectors. This default routine only does autovector interrupts.
934 + | This function is called by the CPU. The return value is usally the
935 + | memory location of a exemption funcion. How to handel these functions
936 + | one shold refer to a Motorla text book.
938 + | NOTE: Vecotor codes 5 and 7 are the only masks that will make the timer
939 + | do somthing. 5 is a VECTOR and 7 is an AUTOVECTOR. The code
940 + | can be found in any manual.
941 + |___________________________________________________________________________
943 +long Timer::InterruptAcknowledge(int)
945 + unsigned char cTCR = timerValue[TCR];
947 + if(myInterruptPending)
952 + //By returning the address of the vector, the cpu will
953 + //call the vector that is located in the right mem location.
954 + myInterruptPending = false;
955 + return timerValue[TIVR];
959 + myInterruptPending = false;
960 + return AUTOVECTOR_INTERRUPT;
964 + return SPURIOUS_INTERRUPT;
969 + return(SPURIOUS_INTERRUPT);
973 +/*______________________________________________________________
974 + | METHOD: Timer::CheckMapped( unsigned long adress)
975 + | DESC: Check to see if address mapps to device.
976 + |______________________________________________________________
978 +bool Timer::CheckMapped(unsigned long address) const
980 + return ((address >= baseAddress ) &&
981 + (address <= baseAddress+(22*sizeof(char))));
984 +/*______________________________________________________________
985 + | METHOD: Timer::Peek(unsigned long address)
986 + | DESC: Returns a byte from the device's address.
988 + | PEEK is the protocal that is used by the device to
989 + | inform the CPU what the registry settings are.
990 + | The use need not update the memory location for the CPU
991 + | All of this is done by the cpu and thus uses peek to
992 + | read the data that the device is using for the Memory
994 + |______________________________________________________________
996 +unsigned char Timer::Peek(unsigned long address)
998 + switch((address-baseAddress))
1001 + return timerValue[TCR];
1003 + return timerValue[TIVR];
1005 + return timerValue[NULR];
1007 + return timerValue[CPRH];
1009 + return timerValue[CPRM];
1011 + return timerValue[CPRL];
1013 + return timerValue[CNTRH];
1015 + return timerValue[CNTRM];
1017 + return timerValue[CNTRL];
1019 + return timerValue[TSR];
1021 + return 0; //Error not a valid address.
1024 +/*______________________________________________________________
1025 + | METHOD: Timer::Poke(unsigned long address, char c)
1026 + | DESC: This is the interface to the rest of the World. Here
1027 + | the CPU or anyother devece writes to memory and updates the
1028 + | device. Poke Changes the value of the registers.
1029 + | Notice that there is no way for the user to WRITE to the
1030 + | registers CNTR, this is because they are read only.
1031 + |______________________________________________________________
1033 +void Timer::Poke(unsigned long address, unsigned char c)
1035 + switch((address-baseAddress))
1038 + timerValue[TCR]=c;
1041 + timerValue[TIVR]=c;
1044 + timerValue[NULR]=c;
1047 + timerValue[CPRH]=c;
1050 + timerValue[CPRM]=c;
1053 + timerValue[CPRL]=c;
1056 + timerValue[TSR]=c;
1061 +/*______________________________________________________________
1062 + | METHOD: Timer::Reset()
1063 + | DESC: Resets the timer. And Initalizes the Registers.
1064 + |______________________________________________________________
1066 +void Timer::Reset()
1068 + // Resets the interupt handler.
1069 + myInterruptPending = false;
1072 + // Clears the timers.
1073 + for(int i=0; i <22; i++)
1077 +/*______________________________________________________________
1078 + | METHOD: VetcorTimer::EventCallback(long *data, void *ptr)
1079 + | DESC: Function that executes when interupt occures.
1080 + | DEP FUNC: Requires decCNTR copyCPRtoCNTR.
1081 + |______________________________________________________________
1083 +void Timer::EventCallback(long data, void *ptr)
1085 + unsigned char cTCR = timerValue[TCR];
1087 + // Test to see if timer is enabled, if False(0) do nothing.
1088 + // but dispatch an event.
1091 + // This test to see if the timer has not started a
1092 + // count down. If it hasnt, copy the CPR register vaules
1093 + // to the CNTR registers.
1094 + if(firstTime == true)
1096 + firstTime = false;
1100 + // Decriments the CNTR if 0 then call interrupt.
1101 + // else dispatch an event.
1102 + if(decCNTR() != 0)
1104 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1108 + // Since the timer is now done, set the first time to ture,
1109 + // so the next time the TCR is set to 1 it will copy the
1110 + // CPR Register to CNTR.
1113 + // Protocal says that the TCR should flip to 0. and that
1114 + // TSR bit switches to 1. That is done below.
1115 + timerValue[TCR] = (timerValue[TCR] & 0xfe);
1116 + timerValue[TSR] = (timerValue[TSR] | 0x01);
1118 + // Dispatch an IRQ only if user has set this in the
1119 + // TCR register. (5 and 7) are the only valid
1121 + if (((cTCR>>5) & 5) || ((cTCR>>5) &7))
1123 + InterruptRequest(TIMER_IRQ);
1125 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1129 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1133 +/*______________________________________________________________
1134 + | METHOD: CopyCPRtoCNTR
1135 + | DESC: Copies the register value of CPR to CNTR.
1136 + | USED: By funce EventCallback
1138 + |______________________________________________________________
1140 +void Timer::copyCPRtoCNTR()
1142 + timerValue[CNTRH] = timerValue[CPRH];
1143 + timerValue[CNTRM] = timerValue[CPRM];
1144 + timerValue[CNTRL] = timerValue[CPRL];
1147 +/*______________________________________________________________
1149 + | DESC: decriments the counter and checks for CNTR==0
1150 + | retuns the value of CNTR.
1151 + |______________________________________________________________
1153 +unsigned int Timer::decCNTR()
1158 + // Grab the values of the 24bit register to a value.
1160 + temp24 = (unsigned int) timerValue[CNTRH];
1161 + decValue = (decValue | ( temp24 << 24));
1163 + temp24 = (unsigned int) timerValue[CNTRM];
1164 + decValue = (decValue | (temp24 << 16));
1166 + decValue = (decValue | timerValue[CNTRL]);
1174 + // Put the value back the 24bit register to a value.
1175 + // with the decremnt.
1176 + timerValue[CNTRH] = ( unsigned char) (decValue >> 24);
1177 + timerValue[CNTRM] = ( unsigned char) (decValue >> 16);
1178 + timerValue[CNTRL] = ( unsigned char) (decValue );
1180 + return (unsigned int) decValue;
1183 diff -ur bsvc-2.1/src/sim68000/devices/Timer.hxx bsvc-2.1-fixed/src/sim68000/devices/Timer.hxx
1184 --- bsvc-2.1/src/sim68000/devices/Timer.hxx 1998-11-09 04:39:28.000000000 +0100
1185 +++ bsvc-2.1-fixed/src/sim68000/devices/Timer.hxx 2007-05-30 22:47:40.000000000 +0200
1191 - using namespace std;
1193 +using namespace std;
1195 -#include "BasicDevice.hxx"
1196 +#include "../../Framework/BasicDevice.hxx"
1198 #define AUTOVECTOR_INTERRUPT -1
1199 #define SPURIOUS_INTERRUPT -2
1200 diff -ur bsvc-2.1/src/sim68000/loader/Loader.cxx bsvc-2.1-fixed/src/sim68000/loader/Loader.cxx
1201 --- bsvc-2.1/src/sim68000/loader/Loader.cxx 1998-11-09 04:39:28.000000000 +0100
1202 +++ bsvc-2.1-fixed/src/sim68000/loader/Loader.cxx 2007-05-30 22:47:40.000000000 +0200
1204 // $Id: Loader.cxx,v 1.1 1996/08/06 11:53:58 bwmott Exp $
1205 ///////////////////////////////////////////////////////////////////////////////
1207 -#include "AddressSpace.hxx"
1208 -#include "BasicCPU.hxx"
1209 -#include "Tools.hxx"
1210 +#include "../../Framework/AddressSpace.hxx"
1211 +#include "../../Framework/BasicCPU.hxx"
1212 +#include "../../Framework/Tools.hxx"
1213 #include "Loader.hxx"
1215 ///////////////////////////////////////////////////////////////////////////////
1219 // Open the file for reading
1221 - fstream file(filename, ios::in);
1223 - fstream file(filename, ios::in | ios::nocreate);
1225 + fstream file(filename, ios::in);
1227 // Make sure the file was opened
1229 diff -ur bsvc-2.1/src/sim68000/loader/Loader.hxx bsvc-2.1-fixed/src/sim68000/loader/Loader.hxx
1230 --- bsvc-2.1/src/sim68000/loader/Loader.hxx 1998-11-09 04:39:28.000000000 +0100
1231 +++ bsvc-2.1-fixed/src/sim68000/loader/Loader.hxx 2007-05-30 22:47:40.000000000 +0200
1237 - #include <iostream>
1238 - #include <fstream>
1240 - #include <iostream.h>
1241 - #include <fstream.h>
1243 +#include <iostream>
1247 - using namespace std;
1249 +using namespace std;
1251 -#include "BasicLoader.hxx"
1252 +#include "../../Framework/BasicLoader.hxx"
1254 ///////////////////////////////////////////////////////////////////////////////
1256 diff -ur bsvc-2.1/src/sim68000/main.cxx bsvc-2.1-fixed/src/sim68000/main.cxx
1257 --- bsvc-2.1/src/sim68000/main.cxx 1998-11-09 04:39:28.000000000 +0100
1258 +++ bsvc-2.1-fixed/src/sim68000/main.cxx 2007-05-30 22:47:40.000000000 +0200
1260 // $Id: main.cxx,v 1.1 1996/08/02 14:58:12 bwmott Exp $
1261 ///////////////////////////////////////////////////////////////////////////////
1263 -#include "Interface.hxx"
1264 +#include "../Framework/Interface.hxx"
1265 #include "cpu/m68000.hxx"
1266 #include "devices/DeviceRegistry.hxx"
1267 #include "loader/Loader.hxx"
1272 BasicCPU& processor = *(new m68000);
1273 BasicLoader& loader = *(new Loader(processor));
1274 diff -ur bsvc-2.1/src/sim68360/cpu/Makefile bsvc-2.1-fixed/src/sim68360/cpu/Makefile
1275 --- bsvc-2.1/src/sim68360/cpu/Makefile 1998-11-09 04:39:29.000000000 +0100
1276 +++ bsvc-2.1-fixed/src/sim68360/cpu/Makefile 2007-05-30 22:47:40.000000000 +0200
1278 $(CC) $(INCLUDES) -o instruction instruction.c
1280 cpu32DecodeTable.hxx: instruction instruction.list
1281 - $(PROJECT_BASE)/src/sim68360/cpu/instruction
1285 rm -f *.o $(LIBRARY) instruction
1286 diff -ur bsvc-2.1/src/sim68360/cpu/cpu32.cxx bsvc-2.1-fixed/src/sim68360/cpu/cpu32.cxx
1287 --- bsvc-2.1/src/sim68360/cpu/cpu32.cxx 1998-11-09 04:39:29.000000000 +0100
1288 +++ bsvc-2.1-fixed/src/sim68360/cpu/cpu32.cxx 2007-05-30 22:47:40.000000000 +0200
1290 // $Id: m68000.cxx,v 1.1 1996/08/02 14:59:18 bwmott Exp $
1291 ///////////////////////////////////////////////////////////////////////////////
1293 -#include "Tools.hxx"
1294 +#include "../../Framework/Tools.hxx"
1295 #include "cpu32.hxx"
1296 -#include "BasicDevice.hxx"
1297 -#include "RegInfo.hxx"
1298 -#include "AddressSpace.hxx"
1299 +#include "../../Framework/BasicDevice.hxx"
1300 +#include "../../Framework/RegInfo.hxx"
1301 +#include "../../Framework/AddressSpace.hxx"
1303 // Array of information about each register
1304 cpu32::RegisterData cpu32::ourRegisterData[] = {
1305 diff -ur bsvc-2.1/src/sim68360/cpu/cpu32.hxx bsvc-2.1-fixed/src/sim68360/cpu/cpu32.hxx
1306 --- bsvc-2.1/src/sim68360/cpu/cpu32.hxx 1998-11-09 04:39:29.000000000 +0100
1307 +++ bsvc-2.1-fixed/src/sim68360/cpu/cpu32.hxx 2007-05-30 22:47:40.000000000 +0200
1313 - #include <iostream>
1315 - #include <iostream.h>
1319 - using namespace std;
1321 +#include <iostream>
1323 +using namespace std;
1327 -#include "BasicCPU.hxx"
1328 +#include "../../Framework/BasicCPU.hxx"
1330 // Set Condition Code operation types
1332 diff -ur bsvc-2.1/src/sim68360/cpu/exec.cxx bsvc-2.1-fixed/src/sim68360/cpu/exec.cxx
1333 --- bsvc-2.1/src/sim68360/cpu/exec.cxx 1998-11-09 04:39:29.000000000 +0100
1334 +++ bsvc-2.1-fixed/src/sim68360/cpu/exec.cxx 2007-05-30 22:47:40.000000000 +0200
1340 - using namespace std;
1342 +using namespace std;
1344 -#include "AddressSpace.hxx"
1345 +#include "../../Framework/AddressSpace.hxx"
1346 #include "cpu32.hxx"
1347 -#include "Tools.hxx"
1348 +#include "../../Framework/Tools.hxx"
1350 ///////////////////////////////////////////////////////////////////////////////
1351 // Compute the effective address, given the mode and register bits
1352 diff -ur bsvc-2.1/src/sim68360/devices/DeviceRegistry.cxx bsvc-2.1-fixed/src/sim68360/devices/DeviceRegistry.cxx
1353 --- bsvc-2.1/src/sim68360/devices/DeviceRegistry.cxx 1998-11-09 04:39:29.000000000 +0100
1354 +++ bsvc-2.1-fixed/src/sim68360/devices/DeviceRegistry.cxx 2007-05-30 22:47:40.000000000 +0200
1356 // $Id: DeviceRegistry.cxx,v 1.1 1996/08/02 15:00:34 bwmott Exp $
1357 ///////////////////////////////////////////////////////////////////////////////
1360 - #include <iostream>
1362 - #include <iostream.h>
1364 +#include <iostream>
1367 - using namespace std;
1369 +using namespace std;
1371 #include "DeviceRegistry.hxx"
1373 #include "Timer.hxx"
1376 - #include "Gdbsock.hxx"
1377 - #include "M68681.hxx"
1379 +#include "Gdbsock.hxx"
1380 +#include "M68681.hxx"
1382 ///////////////////////////////////////////////////////////////////////////////
1383 // Array of device information (name, description, tcl script)
1384 diff -ur bsvc-2.1/src/sim68360/devices/DeviceRegistry.hxx bsvc-2.1-fixed/src/sim68360/devices/DeviceRegistry.hxx
1385 --- bsvc-2.1/src/sim68360/devices/DeviceRegistry.hxx 1998-11-09 04:39:29.000000000 +0100
1386 +++ bsvc-2.1-fixed/src/sim68360/devices/DeviceRegistry.hxx 2007-05-30 22:47:40.000000000 +0200
1388 #ifndef DEVICEREGISTRY_HXX
1389 #define DEVICEREGISTRY_HXX
1391 -#include "BasicDeviceRegistry.hxx"
1392 +#include "../../Framework/BasicDeviceRegistry.hxx"
1394 ///////////////////////////////////////////////////////////////////////////////
1395 // The DeviceRegistry Class
1396 diff -ur bsvc-2.1/src/sim68360/devices/Gdbsock.cxx bsvc-2.1-fixed/src/sim68360/devices/Gdbsock.cxx
1397 --- bsvc-2.1/src/sim68360/devices/Gdbsock.cxx 1998-11-09 04:39:29.000000000 +0100
1398 +++ bsvc-2.1-fixed/src/sim68360/devices/Gdbsock.cxx 2007-05-30 22:47:40.000000000 +0200
1401 ///////////////////////////////////////////////////////////////////////////////
1404 -#include <iostream.h>
1405 -#include <strstrea.h>
1407 -#include <iostream.h>
1408 -#include <strstream.h>
1410 +#include <iostream>
1411 +#include <strstream>
1413 #include <sys/time.h>
1414 #include <sys/types.h>
1419 -#include "Tools.hxx"
1420 -#include "BasicCPU.hxx"
1421 +#include "../../Framework/Tools.hxx"
1422 +#include "../../Framework/BasicCPU.hxx"
1423 #include "Gdbsock.hxx"
1425 // The duration of the default select events
1426 diff -ur bsvc-2.1/src/sim68360/devices/Gdbsock.hxx bsvc-2.1-fixed/src/sim68360/devices/Gdbsock.hxx
1427 --- bsvc-2.1/src/sim68360/devices/Gdbsock.hxx 1998-11-09 04:39:29.000000000 +0100
1428 +++ bsvc-2.1-fixed/src/sim68360/devices/Gdbsock.hxx 2007-05-30 22:47:40.000000000 +0200
1433 -#include "BasicDevice.hxx"
1434 +#include "../../Framework/BasicDevice.hxx"
1436 class GdbSocket : public BasicDevice {
1438 diff -ur bsvc-2.1/src/sim68360/devices/M68681.cxx bsvc-2.1-fixed/src/sim68360/devices/M68681.cxx
1439 --- bsvc-2.1/src/sim68360/devices/M68681.cxx 1998-11-09 04:39:29.000000000 +0100
1440 +++ bsvc-2.1-fixed/src/sim68360/devices/M68681.cxx 2007-05-30 22:47:40.000000000 +0200
1442 // $Id: M68681.cxx,v 1.1 1996/08/02 15:01:10 bwmott Exp $
1443 ///////////////////////////////////////////////////////////////////////////////
1445 -#include <iostream.h>
1446 -#include <strstream.h>
1447 +#include <iostream>
1448 +#include <strstream>
1451 #include <sys/types.h>
1456 -#include "BasicCPU.hxx"
1457 +#include "../../Framework/BasicCPU.hxx"
1458 #include "M68681.hxx"
1461 diff -ur bsvc-2.1/src/sim68360/devices/M68681.hxx bsvc-2.1-fixed/src/sim68360/devices/M68681.hxx
1462 --- bsvc-2.1/src/sim68360/devices/M68681.hxx 1998-11-09 04:39:29.000000000 +0100
1463 +++ bsvc-2.1-fixed/src/sim68360/devices/M68681.hxx 2007-05-30 22:47:40.000000000 +0200
1466 #include <sys/types.h>
1468 -#include "BasicDevice.hxx"
1469 +#include "../../Framework/BasicDevice.hxx"
1471 +using namespace std;
1473 class M68681 : public BasicDevice {
1475 diff -ur bsvc-2.1/src/sim68360/devices/RAM.cxx bsvc-2.1-fixed/src/sim68360/devices/RAM.cxx
1476 --- bsvc-2.1/src/sim68360/devices/RAM.cxx 1998-11-09 04:39:29.000000000 +0100
1477 +++ bsvc-2.1-fixed/src/sim68360/devices/RAM.cxx 2007-05-30 22:47:40.000000000 +0200
1479 // $Id: RAM.cxx,v 1.1 1996/08/02 15:02:49 bwmott Exp $
1480 ///////////////////////////////////////////////////////////////////////////////
1483 - #include <iostream>
1484 - #include <strstream>
1486 - #include <iostream.h>
1487 - #include <strstream.h>
1491 - using namespace std;
1493 +#include <iostream>
1494 +#include <strstream>
1496 -#include "Tools.hxx"
1497 -#include "BasicCPU.hxx"
1498 +using namespace std;
1500 +#include "../../Framework/Tools.hxx"
1501 +#include "../../Framework/BasicCPU.hxx"
1504 ///////////////////////////////////////////////////////////////////////////////
1505 diff -ur bsvc-2.1/src/sim68360/devices/RAM.hxx bsvc-2.1-fixed/src/sim68360/devices/RAM.hxx
1506 --- bsvc-2.1/src/sim68360/devices/RAM.hxx 1998-11-09 04:39:29.000000000 +0100
1507 +++ bsvc-2.1-fixed/src/sim68360/devices/RAM.hxx 2007-05-30 22:47:40.000000000 +0200
1513 - using namespace std;
1515 +using namespace std;
1517 -#include "BasicDevice.hxx"
1518 +#include "../../Framework/BasicDevice.hxx"
1520 class RAM : public BasicDevice {
1522 diff -ur bsvc-2.1/src/sim68360/devices/Timer.cxx bsvc-2.1-fixed/src/sim68360/devices/Timer.cxx
1523 --- bsvc-2.1/src/sim68360/devices/Timer.cxx 1998-11-09 04:39:29.000000000 +0100
1524 +++ bsvc-2.1-fixed/src/sim68360/devices/Timer.cxx 2007-05-30 22:47:40.000000000 +0200
1526 -///////////////////////////////////////////////////////////////////////////////
1530 -// This class keeps up with a list of all of the availible devices and
1531 -// allocates them. It's dervied from the BasicDeviceRegistry
1533 -// FILENAME: Timer.cxx
1534 -// DESC: Simulates an timer for the M68000 CPU. Thus giving
1535 -// the Simulator the ablility to simulate a timmer intrurpt.
1536 -// Programmers can impliment time slicing with this timmer.
1538 -// Contains Register and Offsets for the timer.
1541 -// OWNER: Xavier Plasencia
1543 -// DEPEN: This file requiers the Event hander and the BasicDevice files.
1545 -///////////////////////////////////////////////////////////////////////////////
1547 -///////////////////////////////////////////////////////////////////////////////
1550 - #include <iostream>
1551 - #include <strstream>
1552 - #include <cstring>
1554 - #include <iostream.h>
1555 - #include <strstream.h>
1556 - #include <string.h>
1560 - using namespace std;
1563 -#include "BasicCPU.hxx"
1564 -#include "Timer.hxx"
1566 -///////////////////////////////////////////////////////////////////////////////
1568 -///////////////////////////////////////////////////////////////////////////////
1569 -Timer::Timer(const string& args, BasicCPU& cpu)
1570 - : BasicDevice("Timer", args, cpu)
1572 - istrstream in((char*)args.data(), args.size());
1573 - string keyword, equals;
1574 - unsigned long base;
1575 - unsigned long irq;
1578 - // Scan "BaseAddress = nnnn"
1579 - // This is important for the CPU to know what address space
1580 - // is used by the device.
1581 - in >> keyword >> equals >> hex >> base;
1582 - if((!in) || (keyword != "BaseAddress") || (equals != "="))
1584 - ErrorMessage("Invalid initialization arguments!");
1588 - in >> keyword >> equals >> hex >> irq;
1589 - if((!in) || (keyword != "IRQ") || (equals != "="))
1591 - ErrorMessage("Invalid initialization arguments!");
1596 - I've hardcoded the cycles setting to 2000 which should provide the
1597 - 125000 ticks per second for the PI/T
1599 - unsigned long timer_cycle;
1600 - in >> keyword >> equals >> hex >> timer_cycle;
1601 - if((!in) || (keyword != "CycleSec") || (equals != "="))
1603 - ErrorMessage("Invalid initialization arguments!");
1606 - Timer::TIMER_CPU_CYCLE = timer_cycle;
1609 - Timer::TIMER_IRQ = irq;
1610 - Timer::TIMER_CPU_CYCLE = 2000;
1611 - baseAddress = base * cpu.Granularity();
1613 - // This is needed to start the whole process. The eventhandler
1614 - // will always request an event and test to see if the user has
1615 - // enabled the timer it not nothing happens but if so. The
1616 - // CPR register is copied to the CNTR and is decremented for every
1618 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1623 -///////////////////////////////////////////////////////////////////////////////
1624 -// This routine should set myInterruptPending flag and send a request
1625 -// to the CPU for an interrupt.
1626 -///////////////////////////////////////////////////////////////////////////////
1627 -void Timer::InterruptRequest(int level)
1629 - // If no interrupt is pending then request one
1630 - if(!myInterruptPending)
1632 - myInterruptPending = true;
1633 - myCPU.InterruptRequest(this, level);
1637 -/*___________________________________________________________________________
1638 - | FUNCTIONAME: InterruptAcknowledge(int)
1639 - | DESC: This routine is called by the CPU when it processes a
1640 - | requested interrupt. It should return the vector number associated with
1641 - | the interrupt or AUTOVECTOR_INTERRUPT if the device doesn't generate
1642 - | vectors. This default routine only does autovector interrupts.
1643 - | This function is called by the CPU. The return value is usally the
1644 - | memory location of a exemption funcion. How to handel these functions
1645 - | one shold refer to a Motorla text book.
1647 - | NOTE: Vecotor codes 5 and 7 are the only masks that will make the timer
1648 - | do somthing. 5 is a VECTOR and 7 is an AUTOVECTOR. The code
1649 - | can be found in any manual.
1650 - |___________________________________________________________________________
1652 -long Timer::InterruptAcknowledge(int)
1654 - unsigned char cTCR = timerValue[TCR];
1656 - if(myInterruptPending)
1661 - //By returning the address of the vector, the cpu will
1662 - //call the vector that is located in the right mem location.
1663 - myInterruptPending = false;
1664 - return timerValue[TIVR];
1668 - myInterruptPending = false;
1669 - return AUTOVECTOR_INTERRUPT;
1673 - return SPURIOUS_INTERRUPT;
1678 - return(SPURIOUS_INTERRUPT);
1682 -/*______________________________________________________________
1683 - | METHOD: Timer::CheckMapped( unsigned long adress)
1684 - | DESC: Check to see if address mapps to device.
1685 - |______________________________________________________________
1687 -bool Timer::CheckMapped(unsigned long address) const
1689 - return ((address >= baseAddress ) &&
1690 - (address <= baseAddress+(22*sizeof(char))));
1693 -/*______________________________________________________________
1694 - | METHOD: Timer::Peek(unsigned long address)
1695 - | DESC: Returns a byte from the device's address.
1697 - | PEEK is the protocal that is used by the device to
1698 - | inform the CPU what the registry settings are.
1699 - | The use need not update the memory location for the CPU
1700 - | All of this is done by the cpu and thus uses peek to
1701 - | read the data that the device is using for the Memory
1703 - |______________________________________________________________
1705 -unsigned char Timer::Peek(unsigned long address)
1707 - switch((address-baseAddress))
1710 - return timerValue[TCR];
1712 - return timerValue[TIVR];
1714 - return timerValue[NULR];
1716 - return timerValue[CPRH];
1718 - return timerValue[CPRM];
1720 - return timerValue[CPRL];
1722 - return timerValue[CNTRH];
1724 - return timerValue[CNTRM];
1726 - return timerValue[CNTRL];
1728 - return timerValue[TSR];
1730 - return 0; //Error not a valid address.
1733 -/*______________________________________________________________
1734 - | METHOD: Timer::Poke(unsigned long address, char c)
1735 - | DESC: This is the interface to the rest of the World. Here
1736 - | the CPU or anyother devece writes to memory and updates the
1737 - | device. Poke Changes the value of the registers.
1738 - | Notice that there is no way for the user to WRITE to the
1739 - | registers CNTR, this is because they are read only.
1740 - |______________________________________________________________
1742 -void Timer::Poke(unsigned long address, unsigned char c)
1744 - switch((address-baseAddress))
1747 - timerValue[TCR]=c;
1750 - timerValue[TIVR]=c;
1753 - timerValue[NULR]=c;
1756 - timerValue[CPRH]=c;
1759 - timerValue[CPRM]=c;
1762 - timerValue[CPRL]=c;
1765 - timerValue[TSR]=c;
1770 -/*______________________________________________________________
1771 - | METHOD: Timer::Reset()
1772 - | DESC: Resets the timer. And Initalizes the Registers.
1773 - |______________________________________________________________
1775 -void Timer::Reset()
1777 - // Resets the interupt handler.
1778 - myInterruptPending = false;
1781 - // Clears the timers.
1782 - for(int i=0; i <22; i++)
1786 -/*______________________________________________________________
1787 - | METHOD: VetcorTimer::EventCallback(long *data, void *ptr)
1788 - | DESC: Function that executes when interupt occures.
1789 - | DEP FUNC: Requires decCNTR copyCPRtoCNTR.
1790 - |______________________________________________________________
1792 -void Timer::EventCallback(long data, void *ptr)
1794 - unsigned char cTCR = timerValue[TCR];
1796 - // Test to see if timer is enabled, if False(0) do nothing.
1797 - // but dispatch an event.
1800 - // This test to see if the timer has not started a
1801 - // count down. If it hasnt, copy the CPR register vaules
1802 - // to the CNTR registers.
1803 - if(firstTime == true)
1805 - firstTime = false;
1809 - // Decriments the CNTR if 0 then call interrupt.
1810 - // else dispatch an event.
1811 - if(decCNTR() != 0)
1813 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1817 - // Since the timer is now done, set the first time to ture,
1818 - // so the next time the TCR is set to 1 it will copy the
1819 - // CPR Register to CNTR.
1822 - // Protocal says that the TCR should flip to 0. and that
1823 - // TSR bit switches to 1. That is done below.
1824 - timerValue[TCR] = (timerValue[TCR] & 0xfe);
1825 - timerValue[TSR] = (timerValue[TSR] | 0x01);
1827 - // Dispatch an IRQ only if user has set this in the
1828 - // TCR register. (5 and 7) are the only valid
1830 - if (((cTCR>>5) & 5) || ((cTCR>>5) &7))
1832 - InterruptRequest(TIMER_IRQ);
1834 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1838 - (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1842 -/*______________________________________________________________
1843 - | METHOD: CopyCPRtoCNTR
1844 - | DESC: Copies the register value of CPR to CNTR.
1845 - | USED: By funce EventCallback
1847 - |______________________________________________________________
1849 -void Timer::copyCPRtoCNTR()
1851 - timerValue[CNTRH] = timerValue[CPRH];
1852 - timerValue[CNTRM] = timerValue[CPRM];
1853 - timerValue[CNTRL] = timerValue[CPRL];
1856 -/*______________________________________________________________
1858 - | DESC: decriments the counter and checks for CNTR==0
1859 - | retuns the value of CNTR.
1860 - |______________________________________________________________
1862 -unsigned int Timer::decCNTR()
1867 - // Grab the values of the 24bit register to a value.
1869 - temp24 = (unsigned int) timerValue[CNTRH];
1870 - decValue = (decValue | ( temp24 << 24));
1872 - temp24 = (unsigned int) timerValue[CNTRM];
1873 - decValue = (decValue | (temp24 << 16));
1875 - decValue = (decValue | timerValue[CNTRL]);
1883 - // Put the value back the 24bit register to a value.
1884 - // with the decremnt.
1885 - timerValue[CNTRH] = ( unsigned char) (decValue >> 24);
1886 - timerValue[CNTRM] = ( unsigned char) (decValue >> 16);
1887 - timerValue[CNTRL] = ( unsigned char) (decValue );
1889 - return (unsigned int) decValue;
1892 +///////////////////////////////////////////////////////////////////////////////
1896 +// This class keeps up with a list of all of the availible devices and
1897 +// allocates them. It's dervied from the BasicDeviceRegistry
1899 +// FILENAME: Timer.cxx
1900 +// DESC: Simulates an timer for the M68000 CPU. Thus giving
1901 +// the Simulator the ablility to simulate a timmer intrurpt.
1902 +// Programmers can impliment time slicing with this timmer.
1904 +// Contains Register and Offsets for the timer.
1907 +// OWNER: Xavier Plasencia
1909 +// DEPEN: This file requiers the Event hander and the BasicDevice files.
1911 +///////////////////////////////////////////////////////////////////////////////
1913 +///////////////////////////////////////////////////////////////////////////////
1915 +#include <iostream>
1916 +#include <strstream>
1919 +using namespace std;
1921 +#include "../../Framework/BasicCPU.hxx"
1922 +#include "Timer.hxx"
1924 +///////////////////////////////////////////////////////////////////////////////
1926 +///////////////////////////////////////////////////////////////////////////////
1927 +Timer::Timer(const string& args, BasicCPU& cpu)
1928 + : BasicDevice("Timer", args, cpu)
1930 + istrstream in((char*)args.data(), args.size());
1931 + string keyword, equals;
1932 + unsigned long base;
1933 + unsigned long irq;
1936 + // Scan "BaseAddress = nnnn"
1937 + // This is important for the CPU to know what address space
1938 + // is used by the device.
1939 + in >> keyword >> equals >> hex >> base;
1940 + if((!in) || (keyword != "BaseAddress") || (equals != "="))
1942 + ErrorMessage("Invalid initialization arguments!");
1946 + in >> keyword >> equals >> hex >> irq;
1947 + if((!in) || (keyword != "IRQ") || (equals != "="))
1949 + ErrorMessage("Invalid initialization arguments!");
1954 + I've hardcoded the cycles setting to 2000 which should provide the
1955 + 125000 ticks per second for the PI/T
1957 + unsigned long timer_cycle;
1958 + in >> keyword >> equals >> hex >> timer_cycle;
1959 + if((!in) || (keyword != "CycleSec") || (equals != "="))
1961 + ErrorMessage("Invalid initialization arguments!");
1964 + Timer::TIMER_CPU_CYCLE = timer_cycle;
1967 + Timer::TIMER_IRQ = irq;
1968 + Timer::TIMER_CPU_CYCLE = 2000;
1969 + baseAddress = base * cpu.Granularity();
1971 + // This is needed to start the whole process. The eventhandler
1972 + // will always request an event and test to see if the user has
1973 + // enabled the timer it not nothing happens but if so. The
1974 + // CPR register is copied to the CNTR and is decremented for every
1976 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
1981 +///////////////////////////////////////////////////////////////////////////////
1982 +// This routine should set myInterruptPending flag and send a request
1983 +// to the CPU for an interrupt.
1984 +///////////////////////////////////////////////////////////////////////////////
1985 +void Timer::InterruptRequest(int level)
1987 + // If no interrupt is pending then request one
1988 + if(!myInterruptPending)
1990 + myInterruptPending = true;
1991 + myCPU.InterruptRequest(this, level);
1995 +/*___________________________________________________________________________
1996 + | FUNCTIONAME: InterruptAcknowledge(int)
1997 + | DESC: This routine is called by the CPU when it processes a
1998 + | requested interrupt. It should return the vector number associated with
1999 + | the interrupt or AUTOVECTOR_INTERRUPT if the device doesn't generate
2000 + | vectors. This default routine only does autovector interrupts.
2001 + | This function is called by the CPU. The return value is usally the
2002 + | memory location of a exemption funcion. How to handel these functions
2003 + | one shold refer to a Motorla text book.
2005 + | NOTE: Vecotor codes 5 and 7 are the only masks that will make the timer
2006 + | do somthing. 5 is a VECTOR and 7 is an AUTOVECTOR. The code
2007 + | can be found in any manual.
2008 + |___________________________________________________________________________
2010 +long Timer::InterruptAcknowledge(int)
2012 + unsigned char cTCR = timerValue[TCR];
2014 + if(myInterruptPending)
2019 + //By returning the address of the vector, the cpu will
2020 + //call the vector that is located in the right mem location.
2021 + myInterruptPending = false;
2022 + return timerValue[TIVR];
2026 + myInterruptPending = false;
2027 + return AUTOVECTOR_INTERRUPT;
2031 + return SPURIOUS_INTERRUPT;
2036 + return(SPURIOUS_INTERRUPT);
2040 +/*______________________________________________________________
2041 + | METHOD: Timer::CheckMapped( unsigned long adress)
2042 + | DESC: Check to see if address mapps to device.
2043 + |______________________________________________________________
2045 +bool Timer::CheckMapped(unsigned long address) const
2047 + return ((address >= baseAddress ) &&
2048 + (address <= baseAddress+(22*sizeof(char))));
2051 +/*______________________________________________________________
2052 + | METHOD: Timer::Peek(unsigned long address)
2053 + | DESC: Returns a byte from the device's address.
2055 + | PEEK is the protocal that is used by the device to
2056 + | inform the CPU what the registry settings are.
2057 + | The use need not update the memory location for the CPU
2058 + | All of this is done by the cpu and thus uses peek to
2059 + | read the data that the device is using for the Memory
2061 + |______________________________________________________________
2063 +unsigned char Timer::Peek(unsigned long address)
2065 + switch((address-baseAddress))
2068 + return timerValue[TCR];
2070 + return timerValue[TIVR];
2072 + return timerValue[NULR];
2074 + return timerValue[CPRH];
2076 + return timerValue[CPRM];
2078 + return timerValue[CPRL];
2080 + return timerValue[CNTRH];
2082 + return timerValue[CNTRM];
2084 + return timerValue[CNTRL];
2086 + return timerValue[TSR];
2088 + return 0; //Error not a valid address.
2091 +/*______________________________________________________________
2092 + | METHOD: Timer::Poke(unsigned long address, char c)
2093 + | DESC: This is the interface to the rest of the World. Here
2094 + | the CPU or anyother devece writes to memory and updates the
2095 + | device. Poke Changes the value of the registers.
2096 + | Notice that there is no way for the user to WRITE to the
2097 + | registers CNTR, this is because they are read only.
2098 + |______________________________________________________________
2100 +void Timer::Poke(unsigned long address, unsigned char c)
2102 + switch((address-baseAddress))
2105 + timerValue[TCR]=c;
2108 + timerValue[TIVR]=c;
2111 + timerValue[NULR]=c;
2114 + timerValue[CPRH]=c;
2117 + timerValue[CPRM]=c;
2120 + timerValue[CPRL]=c;
2123 + timerValue[TSR]=c;
2128 +/*______________________________________________________________
2129 + | METHOD: Timer::Reset()
2130 + | DESC: Resets the timer. And Initalizes the Registers.
2131 + |______________________________________________________________
2133 +void Timer::Reset()
2135 + // Resets the interupt handler.
2136 + myInterruptPending = false;
2139 + // Clears the timers.
2140 + for(int i=0; i <22; i++)
2144 +/*______________________________________________________________
2145 + | METHOD: VetcorTimer::EventCallback(long *data, void *ptr)
2146 + | DESC: Function that executes when interupt occures.
2147 + | DEP FUNC: Requires decCNTR copyCPRtoCNTR.
2148 + |______________________________________________________________
2150 +void Timer::EventCallback(long data, void *ptr)
2152 + unsigned char cTCR = timerValue[TCR];
2154 + // Test to see if timer is enabled, if False(0) do nothing.
2155 + // but dispatch an event.
2158 + // This test to see if the timer has not started a
2159 + // count down. If it hasnt, copy the CPR register vaules
2160 + // to the CNTR registers.
2161 + if(firstTime == true)
2163 + firstTime = false;
2167 + // Decriments the CNTR if 0 then call interrupt.
2168 + // else dispatch an event.
2169 + if(decCNTR() != 0)
2171 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
2175 + // Since the timer is now done, set the first time to ture,
2176 + // so the next time the TCR is set to 1 it will copy the
2177 + // CPR Register to CNTR.
2180 + // Protocal says that the TCR should flip to 0. and that
2181 + // TSR bit switches to 1. That is done below.
2182 + timerValue[TCR] = (timerValue[TCR] & 0xfe);
2183 + timerValue[TSR] = (timerValue[TSR] | 0x01);
2185 + // Dispatch an IRQ only if user has set this in the
2186 + // TCR register. (5 and 7) are the only valid
2188 + if (((cTCR>>5) & 5) || ((cTCR>>5) &7))
2190 + InterruptRequest(TIMER_IRQ);
2192 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
2196 + (myCPU.eventHandler()).Add(this, TIMER_EVENT, 0, TIMER_CPU_CYCLE);
2200 +/*______________________________________________________________
2201 + | METHOD: CopyCPRtoCNTR
2202 + | DESC: Copies the register value of CPR to CNTR.
2203 + | USED: By funce EventCallback
2205 + |______________________________________________________________
2207 +void Timer::copyCPRtoCNTR()
2209 + timerValue[CNTRH] = timerValue[CPRH];
2210 + timerValue[CNTRM] = timerValue[CPRM];
2211 + timerValue[CNTRL] = timerValue[CPRL];
2214 +/*______________________________________________________________
2216 + | DESC: decriments the counter and checks for CNTR==0
2217 + | retuns the value of CNTR.
2218 + |______________________________________________________________
2220 +unsigned int Timer::decCNTR()
2225 + // Grab the values of the 24bit register to a value.
2227 + temp24 = (unsigned int) timerValue[CNTRH];
2228 + decValue = (decValue | ( temp24 << 24));
2230 + temp24 = (unsigned int) timerValue[CNTRM];
2231 + decValue = (decValue | (temp24 << 16));
2233 + decValue = (decValue | timerValue[CNTRL]);
2241 + // Put the value back the 24bit register to a value.
2242 + // with the decremnt.
2243 + timerValue[CNTRH] = ( unsigned char) (decValue >> 24);
2244 + timerValue[CNTRM] = ( unsigned char) (decValue >> 16);
2245 + timerValue[CNTRL] = ( unsigned char) (decValue );
2247 + return (unsigned int) decValue;
2250 diff -ur bsvc-2.1/src/sim68360/devices/Timer.hxx bsvc-2.1-fixed/src/sim68360/devices/Timer.hxx
2251 --- bsvc-2.1/src/sim68360/devices/Timer.hxx 1998-11-09 04:39:29.000000000 +0100
2252 +++ bsvc-2.1-fixed/src/sim68360/devices/Timer.hxx 2007-05-30 22:47:40.000000000 +0200
2258 - using namespace std;
2260 +using namespace std;
2262 -#include "BasicDevice.hxx"
2263 +#include "../../Framework/BasicDevice.hxx"
2265 #define AUTOVECTOR_INTERRUPT -1
2266 #define SPURIOUS_INTERRUPT -2
2267 diff -ur bsvc-2.1/src/sim68360/loader/Loader.cxx bsvc-2.1-fixed/src/sim68360/loader/Loader.cxx
2268 --- bsvc-2.1/src/sim68360/loader/Loader.cxx 1998-11-09 04:39:29.000000000 +0100
2269 +++ bsvc-2.1-fixed/src/sim68360/loader/Loader.cxx 2007-05-30 22:47:40.000000000 +0200
2271 // $Id: Loader.cxx,v 1.1 1996/08/06 11:53:58 bwmott Exp $
2272 ///////////////////////////////////////////////////////////////////////////////
2274 -#include "AddressSpace.hxx"
2275 -#include "BasicCPU.hxx"
2276 -#include "Tools.hxx"
2277 +#include "../../Framework/AddressSpace.hxx"
2278 +#include "../../Framework/BasicCPU.hxx"
2279 +#include "../../Framework/Tools.hxx"
2280 #include "Loader.hxx"
2282 ///////////////////////////////////////////////////////////////////////////////
2286 // Open the file for reading
2288 - fstream file(filename, ios::in);
2290 - fstream file(filename, ios::in | ios::nocreate);
2292 + fstream file(filename, ios::in);
2294 // Make sure the file was opened
2296 diff -ur bsvc-2.1/src/sim68360/loader/Loader.hxx bsvc-2.1-fixed/src/sim68360/loader/Loader.hxx
2297 --- bsvc-2.1/src/sim68360/loader/Loader.hxx 1998-11-09 04:39:29.000000000 +0100
2298 +++ bsvc-2.1-fixed/src/sim68360/loader/Loader.hxx 2007-05-30 22:47:40.000000000 +0200
2304 - #include <iostream>
2305 - #include <fstream>
2307 - #include <iostream.h>
2308 - #include <fstream.h>
2310 +#include <iostream>
2314 - using namespace std;
2316 +using namespace std;
2318 -#include "BasicLoader.hxx"
2319 +#include "../../Framework/BasicLoader.hxx"
2321 ///////////////////////////////////////////////////////////////////////////////
2323 diff -ur bsvc-2.1/src/sim68360/main.cxx bsvc-2.1-fixed/src/sim68360/main.cxx
2324 --- bsvc-2.1/src/sim68360/main.cxx 1998-11-09 04:39:29.000000000 +0100
2325 +++ bsvc-2.1-fixed/src/sim68360/main.cxx 2007-05-30 22:47:40.000000000 +0200
2327 // $Id: main.cxx,v 1.1 1996/08/02 14:58:12 bwmott Exp $
2328 ///////////////////////////////////////////////////////////////////////////////
2330 -#include "Interface.hxx"
2331 +#include "../Framework/Interface.hxx"
2332 #include "cpu/cpu32.hxx"
2333 #include "devices/DeviceRegistry.hxx"
2334 #include "loader/Loader.hxx"
2339 BasicCPU& processor = *(new cpu32);
2340 BasicLoader& loader = *(new Loader(processor));