home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1997 / ARCHIVE_97.iso / discs / mag_discs / volume_08 / issue_06 / risc_os / Emulate65 < prev    next >
Text File  |  1988-10-04  |  9KB  |  165 lines

  1. This is a brief guide on the 6502 emulators for RISC OS/Archimedes.
  2.  
  3.   There are at present three types of 6502 emulator for RISC OS; all are
  4. relocatable modules. Depending on an assmebly time option, they can each be
  5. made in two variants - ones which claim the emulated 6502 space as part of
  6. their module workspace and those which use application space at &8000 upwards
  7. for the emulated 6502 space.
  8.  
  9. (i) 65Tube (used to be known as 65Arthur)
  10.  
  11.   Emulates a 6502 second processor environment,
  12. so that calls to WrCh,OSByte etc. are in general not trapped locally, but
  13. are passed to the Host machine, in this case RISC OS. Two 6502 code
  14. images are strapped onto the end of the ARM code at assembly time - a Tube
  15. OS lookalike that traps a few OSBytes (a la real second processor TOS) etc.
  16. but passes most calls on to the ARM code via unused single byte 6502 opcodes
  17. (typically &x3), and a copy of HIBASIC 4.31, which is copied into RAM
  18. whenever *basic is executed in emulated code. It executes code as if the
  19. 6502 processor were being clocked at about 1.36 MHz (deduced from BASIC
  20. benchmark programs).
  21.  
  22.   This emulator can be used to run many 6502 language ROM images; often enhancing the
  23. facilities provided by these packages - for instance View and ViewSheet can
  24. be used in the RISC OS 132 column modes, and due to the speed of WrCh being greater than on the BBC micro
  25. their screen update is actually much faster than when running on the old BBC.
  26.  
  27.   Double ROM systems such as Acornsoft Logo and ISO-Pascal which use sideways ROM OSByte calls to page
  28. each other across the Tube do not work.
  29. MASM (part of the 6502 Development package)
  30. does not work as no hardware trapping is done, so that peeking/poking Tube hardware does not work; also
  31. there is not I/O processor to communicate with!
  32.  
  33.   Star commands are passed to RISC OS OS_CLI, and you can use whatever filing system you want.
  34.  
  35.   Use *EmulateTube to start the emulator.
  36.   Use *Quit to exit the emulator.
  37.  
  38. Deviant versions of the above can be made containing any language ROM, for instance View.
  39.  
  40.  
  41. (ii) 65Turbo
  42.  
  43.   Emulates an extended (Turbo) 6502 second processor environment, similar to
  44. 65Tube, but understands the difference between normal and Turbo 6502 code if
  45. they have a standard image header (normally associated with sideways ROM
  46. code, but it's actually more general). Normal 6502 code images have type bytes of
  47. the form 2_x1xx0010 (ProcType = 2_000)for a language or 2_01100000 for BASIC
  48. (special case), whereas Turbo code has type bytes of the form 2_x1xx0011
  49. (ProcType = 2_001).
  50. A Turbo second processor has nothing to do with the Master Turbo, which is just a faster
  51. 6502 second processor; it is in fact a 256 KByte 6502 second processor which
  52. uses page 03 as extra indirection bytes, so that indirect and indirect,Y
  53. opcodes take an extra cycle to fetch a byte from &0301 + zp_offset to yield
  54. a 24-bit address, of which only the bottom 18 bits is used. The extra memory
  55. cannot be accessed using any other addressing modes than these two.
  56. When not executing code with a Turbo type byte, it behaves just like a normal 64K Byte second processor.
  57.  
  58.  This emulator is useful for running TurMasm and TurMasm816 which are needed
  59. to build BBC OS'es, 6502 emulator code, File Server code, Communicator code etc.
  60. Due to the extra address fetch involved in all xxxI and xxxIY opcodes, it is about 1.5%
  61. slower than the standard emulator on typical BASIC programs. However, it is
  62. probably of little interest to outside punters, as Turbo processors
  63. never really got outside of Acorn.
  64.  
  65.   Use *EmulateTurbo to start the emulator.
  66.   Use *Quit to exit the emulator.
  67.  
  68. Deviant versions of the above can be made containing any language ROM, for instance TurMasm.
  69.  
  70.  
  71.  (iii) 65Host
  72.  
  73.   Emulates a BBC Model B running OS 1.20 - it does NOT emulate B+, Master 128 or anything else.
  74. It supports paged sideways ROMs, as well as direct screen access.
  75. This emulator is slightly slower (don't know quite how much yet) than 65Tube as it has to trap accesses to
  76. hardware devices and various other memory locations.
  77.  
  78.   It can be used in conjunction with ROM podules; on initialisation it enumerates rom:@ looking for files
  79. of type &BBC ('BBC ROM') and stores these filenames in a table for later use. An image of BASIC 2 is
  80. made available in socket 12 by default.
  81.  
  82.   This emulator actually uses 128K of memory as it fills areas of the 64K address space which are to be
  83. trapped with a trap byte and those trapped areas that correspond to memory and not other hardware devices have
  84. their real contents stored at 64K + memory address.
  85. A trap byte of &FB was chosen as it is less likely to be loaded than most other data bytes.
  86.  
  87. Accesses to some OSByte variables are trapped in order to access the real RISC OS OS_Byte variables
  88. instead of a local copy.
  89.  
  90. Writes to screen memory &xx00..&7FFF are trapped in order to update the displayed screen, converting the BBC
  91. style byte into Archimedes style bytes. The Archimedes screen is accessed directly for speed.
  92.  
  93. FRED (FCxx) and JIM (FDxx) devices:
  94.  
  95.   1MHz bus accesses are trapped and issue OS_Byte calls which are processed by
  96. the BBC I/O Podule software if that podule is present, otherwise reads return &FF, writes ignored.
  97.  
  98. SHEILA (FExx) devices:
  99.  
  100. 6845 CRTC      R0-R7 not implemented. Uses RISC OS VDU 23,0,r,v| to do other functions.
  101.                reads from R16,17 (light pen position) return &00.
  102. 6850 ACIA      not implemented: reads return &00, writes ignored.
  103. Serial ULA     reads return &FE, no cassette relay to turn on or off when writing to it. Can set Tx/Rx baud rates.
  104. Video  ULA     screen cleared on MODE change. Can't set cursor width.
  105. Econet ID      reads the Econet station number from CMOS RAM as if set by Molex links on BBC board.
  106. Econet IntOn   not implemented: reads return &FE.
  107. 74LS161 ROMSEL writes to this copy the corresponding sideways ROM image from cache into &8000..&BFFF. If no ROM
  108.                occupying socket then &8000..&800F is written to the ROM number to indicate socket uniqueness
  109.                (speeds up initialisation) and invalid ROM (no (C) string).
  110.                reads return current value (unlike real BBC, but like Master 128).
  111. 6522 VIAA      reads from most registers echo current value. reads from IRB depend on I/O Podule to
  112.                provide ADVAL for FIRE button state. Handles slow I/O bus accesses for BBC keyboard scanning.
  113. 6522 VIAB      depends on I/O Podule to provide SHEILA handling, otherwise writes ignored, reads return &00.
  114. 8271 FDC       not implemented; reads return &FE, writes ignored.
  115. 6854 ADLC      not implemented: reads return &FE, writes ignored.
  116. u7002 ADC      depends on I/O Podule to provide SHEILA handling, otherwise writes ignored, reads return &00.
  117. Tube ULA       not implemented: reads return &FE, writes ignored.
  118.  
  119. Two RISC OS MODE changes are done for each real BBC MODE change due to the way BBC OS 1.20 programs the Video ULA
  120. Flashing colours are not done properly.
  121. Keyboard emulation not quite up to par: can't do OSByte &7A, &79 -ve etc.
  122. MODE 3,6 hardware scroll wrong.
  123.  
  124.  
  125. The emulator provides several star commands:
  126.  
  127. *ListROMs gives a list of all the sideways ROMs that the emulator knows about, and whether they are cached or
  128. not.
  129.  
  130. *SwapROMs <ROM number> <ROM number> swaps the pointers to the specified cached objects (may be empty)
  131.  
  132. *CacheROM <ROM number> [<filename>] with no filename argument ensures that the current linked name is cached.
  133. Otherwise it loads the specified BBC ROM file (must be 16K long) into store for use when the emulator is run.
  134.  
  135. *LinkROM <ROM number> [<filename>] with no filename argument frees the store used for that ROM socket. Otherwise
  136. it takes a copy of the name to cache when the emulator is run.
  137.  
  138. *EmulateBBC starts up the emulator, first cacheing any linked files.
  139.  
  140. A BBC ROM file is needed in order to access any filing systems; this is the ARFS file. *CacheROM 0 ARFS is used to load this
  141. for use - this command must be executed before entering the emulator!
  142.  
  143. NB. Once the emulator is running, star commands do not get passed out to the RISC OS OS_CLI handler as the screen must not be
  144. corrupted.
  145.  
  146. Use *Quit to exit the emulator.
  147.  
  148.  
  149.  
  150.  
  151.  
  152. Where do I get it all from ?
  153. ----------------------------
  154. 65Tube is available on net#arf(49.254):$.a500.rm.65Tube
  155. 65TubeView             net#arf(49.254):$.a500.rm.65TubeView
  156. 65Turbo                net#arf(49.254):$.a500.rm.65Turbo
  157. 65TurboMasm            net#arf(49.254):$.a500.rm.TurboMasm
  158. 65Host                 net#arf(49.254):$.a500.rm.65Host
  159. ARFS                   net#arf(49.254):$.a500.arfs
  160.  
  161. You can log on as Guest to access any of the above files.
  162.  
  163.  
  164. Stuart
  165.