home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / compsrcs / apple2 / 24 < prev    next >
Encoding:
Internet Message Format  |  1990-11-26  |  6.0 KB

  1. Path: wuarchive!zaphod.mps.ohio-state.edu!mips!dimacs.rutgers.edu!aramis.rutgers.edu!paul.rutgers.edu!jac
  2. From: jac@paul.rutgers.edu (Jonathan A. Chandross)
  3. Newsgroups: comp.sources.apple2
  4. Subject: v001SRC004:  Apple ][ Simulator Part 1/3 (Koning Version)
  5. Message-ID: <Nov.18.20.58.45.1990.26099@paul.rutgers.edu>
  6. Date: 19 Nov 90 01:58:46 GMT
  7. Organization: Rutgers Univ., New Brunswick, N.J.
  8. Lines: 280
  9. Approved: jac@paul.rutgers.edu
  10.  
  11.  
  12. Submitted-by: None
  13. Posting-number: Volume 1, Source:4
  14. Archive-name: unix/simulator/koning/part01
  15. Architecture: UNIX
  16. Version-number: 1.00
  17.  
  18. This is the first of several Apple ][ simulators that will be posted.
  19. You should get 3 parts: part01, part02, part03
  20.  
  21. As always, packed in AAF format.
  22.  
  23. Enjoy.
  24.  
  25. ******************
  26.  
  27. =Manifest
  28. -6502.c
  29. -Makefile
  30. -README
  31. -README2
  32. -apple.h
  33. -debug.c
  34. -main.c
  35. -mega2.c
  36. =README
  37. -
  38. -Apple ][ Emulator -- (C) 1989 Ben Koning
  39. -                     408/738-1763 (IP: ben@apple.com) (AL: KONING.BEN)
  40. -                     1360 Flicker Way Sunnyvale CA 94087-3407
  41. -                     18 Ortalon Ave Santa Cruz CA 95060
  42. -
  43. -
  44. -This software package is an Apple ][ / Apple ][ Plus emulator for UNIX
  45. -systems.  It emulates a 6502 microprocessor, contains Apple ][ ROM code,
  46. -and emulates a few Apple ][ memory mapped I/O features.
  47. -
  48. -Usage syntax:
  49. -
  50. -    Apple.II [-t] [-m] [-i]
  51. -
  52. -If no parameters are specified, then an Apple ][ Plus (autostart and apple-
  53. -soft) are selected.  Trace (-t) mode causes the state of the processor to be
  54. -printed to the standard error output at the end of each 6502 instruction.
  55. -The Original Monitor (-m) and Integer Basic (-i) options override the default
  56. -ROM configuration.
  57. -
  58. -To exit the simulation, type Control - A.
  59. -
  60. -Currently, the only I/O features supported are Page 1 40-Column text,
  61. -keyboard input, keyboard strobe, and speaker toggle (sends beep to terminal).
  62. -Unimplemented 6502 instructions are executed as NOPs.
  63. -
  64. =README2
  65. -What *YOU* Need to provide
  66. -
  67. -four ROM Files:
  68. -APPLESOFT.ROM   <= $d000 to $f777  ][+ Applesoft Basic ROM
  69. -AUTOSTART.ROM   <= $f800 to $ffff  ][+ autostart monitor ROM
  70. -
  71. -optional:
  72. -INTEGER.ROM     <= $d000 to $f777  Integer Basic ROM
  73. -MONITOR.ROM     <= $f800 to $ffff  Original Monitor ROM
  74. -
  75. -
  76. -PRODOS          <= PRODOS System File
  77. -
  78. -
  79. -how to boot system:
  80. -start up simulator
  81. -
  82. -] CALL 8192
  83. -
  84. -or to boot from slot 7 Drive 2
  85. -
  86. -] CALL -151
  87. -
  88. -*43:F0    or 70 for slot 7 drive 1
  89. -
  90. -*2000G
  91. -
  92. -Debugger commands
  93. -use ctrl-A to enter the debugger
  94. -
  95. -l  load a UNIX binary file into Main Memory
  96. -s  single step with trace
  97. -t  trace execution with debug output to UNIX file
  98. -c  continue execution
  99. -<ret> same as s
  100. -q  quit simulator
  101. -
  102. -debugging technique:
  103. -use in conjunction with dbx
  104. -break into debugger
  105. -step until a LDA $C000 instruction is executed
  106. -break into dbx
  107. -set A = 128 + 'x' where x is the key you want pressed
  108. -continue simulator
  109. -
  110. -how to initialize/format slot 7 drive 2
  111. -
  112. -a) startup simulator and PRODOS
  113. -b) enter debugger with ctrl-A
  114. -c) type l <return> this is the load command
  115. -d) enter name of UNIX file containing binary image of a program like COPY ][+
  116. -e) this will load the binary at $2000
  117. -f) save this to slot 7 disk 1
  118. -g) run it, and tell it to format slot 7 disk 2
  119. -h) this will format a disk with 1024 blocks (change the #define in mega2.c
  120. -   if you want a larger disk)
  121. -
  122. -
  123. -requests  does anyone have a generic disk formatter for a ][+?
  124. -
  125. -please forward any enhancements you may have.
  126. -
  127. -I can be reached at 
  128. -
  129. -nakada@husc4.harvard.edu
  130. -or
  131. -pnakada@oracle.com
  132. -
  133. -
  134. -
  135. -
  136. =Makefile
  137. -#
  138. -#Makefile for Apple ][ Emulator
  139. -#(C) 1989 Ben Koning [556498717 408/738-1763 ben@apple.com]
  140. -#
  141. -
  142. -#Local printing command:
  143. -PRINT = lpr -Psimplex
  144. -
  145. -#Apple.II is split up as follows:
  146. -OBJ = main.o 6502.o mega2.o debug.o
  147. -
  148. -#Make normal version:
  149. -debug: ${OBJ} apple.h
  150. -    cc -g $(OBJ) -lcurses -ltermcap
  151. -lint:
  152. -    lint main.c 6502.c mega2.c debug.c -lcurses -ltermcap
  153. -
  154. -#Make final optimized version:
  155. -final:
  156. -    touch apple.h
  157. -    make debug
  158. -    strip a.out
  159. -    mv a.out Apple.II
  160. -    make clean
  161. -
  162. -#Make profiling version:
  163. -profil:
  164. -    cc -pg main.c 6502.c mega2.c debug.c -lcurses -ltermcap
  165. -
  166. -#Building modules from source:
  167. -main.o: main.c apple.h
  168. -    cc -c  -g main.c
  169. -6502.o: 6502.c apple.h
  170. -    cc -c  -g 6502.c
  171. -mega2.o: mega2.c apple.h
  172. -    cc -c  -g mega2.c
  173. -debug.o: debug.c apple.h
  174. -    cc -c  -g debug.c
  175. -
  176. -#Cleanup of directory:
  177. -clean:
  178. -    rm -f ${OBJ}
  179. -    rm -f file
  180. -    rm -f a.out
  181. -    rm -f core
  182. -
  183. -#Printout without long ROM listings:
  184. -print:
  185. -    rm -f          file
  186. -    touch          file
  187. -    pr README   >> file
  188. -    pr Makefile >> file
  189. -    pr *.h      >> file
  190. -    pr main.c   >> file
  191. -    pr 6502.c   >> file
  192. -    pr mega2.c  >> file
  193. -    $(PRINT)       file
  194. -    rm -f          file
  195. -    wc             *.h *.c
  196. -
  197. -#Printout with long copyrighted ROM listings:
  198. -printall:
  199. -    make print
  200. -
  201. =apple.h
  202. -
  203. -/*
  204. - *apple.h -- Globals' xdefs and equates for system calls for Apple ][ Emulator
  205. - *(C) 1989 Ben Koning [556498717 408/738-1763 ben@apple.com]
  206. - */
  207. -
  208. -
  209. -
  210. -/* Character which ends the emulation: */
  211. -
  212. -#define        MEGAQUITKEY        001        /* Control-A */
  213. -
  214. -
  215. -
  216. -/* XENIX/BSD - Compatible includes: */
  217. -
  218. -#ifndef BUFSIZ
  219. -#include <stdio.h>
  220. -#endif
  221. -
  222. -#ifndef isalpha
  223. -#include <ctype.h>
  224. -#endif
  225. -
  226. -#ifndef CBREAK
  227. -#include <sgtty.h>
  228. -#endif
  229. -
  230. -#ifndef TIOCGETP
  231. -#include <sys/ioctl.h>
  232. -#endif
  233. -
  234. -#ifndef O_NDELAY
  235. -#include <fcntl.h>
  236. -#endif
  237. -
  238. -#define BYTE unsigned char
  239. -#define ADDR int
  240. -
  241. -
  242. -
  243. -/* 6502 Globals: */
  244. -
  245. -extern int A,X,Y,P,S;
  246. -extern ADDR PPC;
  247. -
  248. -
  249. -
  250. -
  251. -
  252. -/* Emulation Globals: */
  253. -
  254. -extern BYTE MMemory[];
  255. -extern BYTE Rom[];
  256. -extern BYTE MRam[];
  257. -extern BYTE MRam1[];
  258. -extern BYTE MRam2[];
  259. -extern BYTE RamRead;
  260. -extern BYTE RamWrite;
  261. -extern BYTE Bank2Enable;
  262. -
  263. -extern BYTE MegaRand;
  264. -extern BYTE MegaLastKey;
  265. -extern BYTE MegaQuitDetect;
  266. -extern int DebugSingle;
  267. -extern int DebugTrace;
  268. -extern ADDR DebugBreak;
  269. -
  270. -
  271. -/* Apple ROM Contents: */
  272. -
  273. -extern BYTE MegaGetMem();
  274. -
  275. -
  276. -/* Termcap stuff: */
  277. -
  278. -
  279. -extern void Debugger();
  280. -extern void MegaShutDown();
  281. -extern void MegaStartUp();
  282. -extern void MegaPutMem();
  283. -
  284. -extern void prodos();
  285. -
  286. -extern void CPUShutDown();
  287. -extern void CPUReset();
  288. -extern void CPUExecute();
  289. -
  290. + END OF ARCHIVE
  291.