]> git.lizzy.rs Git - plan9front.git/blob - sys/src/games/blit/mmap
vt: but not too fast :-)
[plan9front.git] / sys / src / games / blit / mmap
1 - main CPU is a MC68000 running at 8 MHz.
2     the exact clock speed is most likely one of: 7.9872, 7.68 or 7.3728 MHz (to divide to 19200 baud)
3 - display is 800x1024, refreshed at 30 Hz (60 Hz interlaced).
4     it simply displays the 100K framebuffer from the address given in register 030.
5 - the host is connected through a UART running at 19200 baud.
6 - the keyboard is connected through a UART running at an unknown baudrate.
7 - the mouse is connected through some unknown circuitry.
8
9 memory map
10
11 start           end             purpose
12 0x00000         0x00008         see register 050 below
13 0x00008         0x40000         RAM (256K)
14 0x40000         ???             ROM (24K ?) (not known if mirrored)
15 0x60000         ???             memory mapped I/O
16
17 mmio addresses (in *octal*):
18
19 0000    16-bit  mouse y
20 0002    16-bit  mouse x
21
22 0011    8-bit   terminal UART status/control (MC 6850 ACIA)
23 0013    8-bit   terminal UART data
24         the software uses 2 stop bits, no parity, 8 bits; clock divided by 16
25
26 0021    8-bit   mouse buttons
27                         bit 0: rmb
28                         bit 1: mmb
29                         bit 2: lmb
30                         reading clears the mouse interrupt
31
32 0025    8-bit   second copy of 0021 (?)
33 0027    8-bit   ???
34                 only the ROM binaries contain references to 0025, 0027 in buttons.c.
35                 the corresponding source code appears to have been deleted.
36                 possibly some older variant of the button hardware?
37
38 0030    16-bit  start address of framebuffer divided by 4 (800*1024/8 = 100K bytes)
39 0040    16-bit  status/control register of display
40                         bit 0: invert display
41                         with this bit set 0 bits are white and 1 bits are black (most software does this).
42
43 0050    16-bit  writing different values makes 0-8 either mapped to 0x40000 or error out (details unclear)
44                 resets so that they map to the reset vector at 0x40000.
45
46 0056    8-bit   some kind of sound-making device (standard programmable timer + piezoelectric speaker?)
47 0156            referenced by demo pacman.
48 0256
49         
50 0060    8-bit   keyboard status/control register (MC 6850 ACIA)
51         the software uses 2 stop bits, no parity, 8 bits; clock divided by 16
52 0062    8-bit   keyboard data register
53
54 0070    16-bit? acknowledge vblank interrupt; software writes 0
55
56 tx to the keyboard sets the 7 lights and can also ring the bell.
57 could deduce the order of lights from diag.c.
58 writing 2 is used to sound the bell.
59
60 irq lines; using the 68k autovectoring
61
62 vector 1 (0x64) is vblank
63 vector 2 (0x68) is keyboard
64 vector 4 (0x70) is mouse buttons
65 vector 5 (0x74) is uart
66
67 MC 6850 bits:
68 +0 (r)  status register
69         bit 0: receive buffer full
70         bit 1: transmit buffer empty
71         bit 2: data carrier detected (inverted)
72         bit 3: clear-to-send (inverted)
73         bit 4: framing error
74         bit 5: receiver overrun
75         bit 6: parity error
76         bit 7: irq active
77 +0 (w)  control register
78         bit 1-0: clock divider
79                 00: /1
80                 01: /16
81                 10: /64
82                 11: master reset
83         bit 4-2: parity and stop bits (see datasheet)
84         bit 6-5:
85                 RTS/ is high only if these bits are 10
86                 TX interrupts are enabled only if these bits are 01
87                 break is transmitted continuously if these bits are 11
88         bit 7: RX interrupt enabled