This is my Dreamcast stuff. My major reference for this stuff is Marcus Comstedt's extremely useful and helpful stuff from http://mc.pp.se/dc/. (He has been very kind and helpful to me throughout this exercise; I might have been able to do this without any assitance from him beyond tatest itself, but at the very least it would have taken substantially longer.) My first goal here was to get his tatest program, which is written in C, translated to assembly and running. I've now managed that and am moving on to other things, such as figuring out how to use aspects of the 3D hardware that tatest _doesn't_ use. This stuff is available (at this writing) via git clone from git://sparkle.rodents-montreal.org/Mouse/dreamcast. At the moment it's not available any other way without manual assitance; based on the level of interest I've seen on NetBSD's port-dreamcast list, it seems unlikely anyone will care, but if anyone does, I can arrange access, either as a one-shot or more generally. There are multiple things here. The list at this writing follows after my signature. /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML mouse@rodents-montreal.org / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B .gitignore git overhead. 16-to-24.c Program to convert 16bpp iamge data to 24bpp. This program is very experimental. 3d.s Playing around with the 3D hardware. Makefile Makefile for building the assembler. Doesn't build anything else; in particular, doesn't run the assembler on any of the various .s files. all-instructions.s List of all 61217 opcodes the SH supports (as far as I know). This is less than 64K because some bit patterns don't correspond to instructions; it is more than the number of valid bit patterns, because bit patterns that are valid but with different semantics under multiple conditions are listed multiple times (for example, 0xffe6 is "fmov.s @(r0,r14),fr15" if fpscr.sz is clear, but "fmov @(r0,r14),xd14" if it's set). buildbin Script to automate the process of assembling a .s file and converting the result to a .bin to burn to a CD-R. This refers to executables in a directory outside this tree, so it probably will not be much use to you directly. cdcode-.s Former version of cdcode.s. Human reference only - doesn't even assemble under the current assembler. cdcode.s The code I've burnt to a CD-R and generally boot my DC from. This is basically a "ROM monitor" except it runs from RAM. It's substantially more capable than Marcus's serial upload slave. cdtest1.s through cdtest8.s Various programs of possible historical interest which I test-booted from CD while developing what is now cdcode.s. controller.txt maple.txt pvr.txt Text documentation distilled from Marcus's webpages, mostly by just stripping out HTML uglification. ta-intro.txt A copy of http://www.ludd.luth.se/~jlo/dc/ta-intro.txt, saved here for my reference. (Simply using the Web version is not suitable, because Web browsers are poor-to-bad as text reading tools, because I'm not always on the net when I'm working on this stuff, and because versions of things kept off my machines have a nasty habit of disappearing.) dumprom.c A program to be run, stdin and stdout connected to the serial line to cdcode, to dump out the DC's ROM. It writes the result to "rom.dump". expand-opcode.c Takes instruction summaries with opcode substitutions such as cmp/eq rM,rN ; 0011nnnnmmmm0000 and expands them into multiple lines like cmp/eq r0,r0 ; 0011000000000000 cmp/eq r0,r1 ; 0011000100000000 ... cmp/eq r15,r15 ; 0011111111110000 find-conflicts.c Takes instructions formatted as in all-instructions.s and looks for cases where a single bit pattern has multiple interpretations. This was designed to help find typos in my transcription of the documentation PDFs into a usable form. font.s A peecee 8x8 console font, converted to .byte directives. lcd.s Speaks to a controller in port A with a VMU in slot 1, moving a single dot on the VMU's display to match the controller's joystick position. main.c parse-action.h parse-fsm.h parse.fsm My Dreamcast assembler. This is mostly just a Super-H assembler at present, but I have plans to teach it about the VMU and possibly ARM instruction sets so I can use it to write code for the corresponding hardware. You will need at least three other tools to build this. The first is gcc. I don't write in C; I write in gcc (actually, gcc with an extension; see below). Some OSes, including most of the open-source ones, come with gcc; it's available for almost everything. The second is fsm, which converts parse.fsm (a finite state machine written in a language loosely patterned after VMS's LIB$TPARSE facility) to C code. This you can get by git clone of git://sparkle.rodents-montreal.org/fsm or by anonymous FTP from ftp.rodents-montreal.org:/mouseware/local-src/fsm/. The third is lcs-cvt. I actually write in a somewhat extended dialect of gcc: gcc plus what I call labeled control structure ("LCS"). On my systems, LCS is in the compiler. (I'll be happy to send my patches to gcc to add LCS to anyone interested.) But, for the sake of portability to people who don't care to hack up their gccs, I have a conversion program (lcs-cvt) which runs over preprocessor output, coverting LCS to semantically equivalent but substantially less human-friendly constructs. You can get this by anonymous FTP from ftp.rodents-montreal.org:/mouseware/local-src/lcs-cvt/; you would use it as in gcc -E -o foo.i main.c lcs-cvt foo.i gcc -c -o main.o foo.i (with, of course, whatever options and paths are aoppropriate for your environment). If your system does not have funopen() (which mostly means, if you don't have a Torek stdio - Linux is perhaps the commonest case), you will need a workalike. If you can't find anything of the sort, you will have a substantial coding effort on your hands, because some important parts of the assembler depend on it fairly critically. Most Linux versions have fopencookie; while it cannot be used as directly as it might appear, because the signature for the seek function doesn't match, it is close enough that a naïve wrapper works for the uses I make of it. You can find the wrapper I use at ftp.rodents-montreal.org:/mouseware/local-src/liblinuxcompat/. maple-bits.s Register addresses and bit definitions and such for the maple bus interface hardware. This is included from the maple-using programs. maple.s A first, rudimentary, program to interact with maple-bus peripherals. This just prints the state retrieved from the controller, as fast as it can (usually the serial line is the limiting factor). This is useful to see how that state changes as you manipulate the controller. notes Some notes on the Super-H instruction set, including page numbers in the programmer's reference PDF. o-to-s Takes an S-record file as produced by my assembler and converts it to .byte directives in a .text segment for NetBSD cross-compilation tools. regs-BSC.s regs-CCN.s regs-CPG.s regs-CPU.s regs-DMAC.s regs-INTC.s regs-Px.s regs-RTC.s regs-SCI.s regs-SCIF.s regs-TMU.s regs-UBC.s regs-UDI.s Assembler definitions related to various pieces of the hardware. These will generally be included by code using the relevant hardware. regs.s Simple file which includes all the regs-*.s files. rom.dis rom.dump Dump and disassembler file for the ROMs in my DC. (The disassembler file is not very useful unless you have my disassembler; to discuss that here would be going too far afield. See ftp.rodents-montreal.org:/mouse/disas/ if you're interested in it.) send-s.c Program to run on the host, conencted to the serial line to the DC, to send an S-record file such as produced by my assembler to the DC. srtest1.s An early serial-line test program. Of historical interest only at this point. ta-cmds.s Registers and bit definitions of interest to code using the TA. tatest.s My conversion of Marcus's tatest program to assembly. test.s A file used to test the assembler itself. In most revisions, this contains test code for whatever the latest feature added to the assembler is. (This is not a proper test suite.) trig-series.c A host program to see how the power series for sin(x) and cos(x) behave numerically. This dates from a time when I was unaware of the fsca instruction and was doing sines and cosines on the DC by table lookup, using the power series to compute the tables. trig.s A DC program to compare the power series for sin(x) with the DC's fsca instruction. Prints out 2K lines, each of which contains: power-series value fsca value difference between the previous two XOR of the bit patterns for the first two values