A small Apple I emulator (was: Another 6502 emulator...)
Debugged mine a bit more and it's now a basic and small Apple I emulator. Thanks for the help with debugging the interrupt flag!
The next trick is to get it running on an LPC1343 board... [Apple] 1-chip anybody? (initially USB serial, and then when I have access to my TV again I'll wire up an NTSC interface - with SPI it shouldn't eat up too much CPU even...)
The next trick is to get it running on an LPC1343 board... [Apple] 1-chip anybody? (initially USB serial, and then when I have access to my TV again I'll wire up an NTSC interface - with SPI it shouldn't eat up too much CPU even...)
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
(initially USB serial, and then when I have access to my TV again I'll wire up an NTSC interface - with SPI it shouldn't eat up too much CPU even...)
What I don't understand is how the Apple I's video output worked. From what I can see, they used a 40-bit by 6 recirculating shift register to house one line of text on the screen. This means that the CPU would have to reload the shift register every 8 scan-lines to get a full 40x25 display. Yet, no interrupts for the purposes of synchronization exist (per the Replica 1 details, at least), and as far as I can see, the sole interface to the display hardware is a 7-bit parallel port.
What am I missing? I just don't see how it's possible without racing the electron beam.
What am I missing? I just don't see how it's possible without racing the electron beam.
- GARTHWILSON
- Forum Moderator
- Posts: 8775
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Quote:
I think he means to use SPI as the video interface, where MOSI is used (through a resistor network) to drive the NTSC analog signal.
apple1 video hardware
kc5tja wrote:
What I don't understand is how the Apple I's video output worked. From what I can see, they used a 40-bit by 6 recirculating shift register to house one line of text on the screen. This means that the CPU would have to reload the shift register every 8 scan-lines to get a full 40x25 display. Yet, no interrupts for the purposes of synchronization exist (per the Replica 1 details, at least), and as far as I can see, the sole interface to the display hardware is a 7-bit parallel port.
What am I missing? I just don't see how it's possible without racing the electron beam.
What am I missing? I just don't see how it's possible without racing the electron beam.
Here's the circuit, found on page 10 (or a supplementary page) in the apple 1 manual:
6502.org wrote:
RD1 to RD7 are inputs, from the B port of the PIA. The 8th bit of the B port is an input, connected to DA, which is the inverse of the PIA's CB2, used to ensure a written character has been accepted into the shift register before the next one is presented. Component D2 is the character generation ROM, with 6 bits of address input, either from 6 of the 2504 shift registers or from the B port.
I haven't yet digested this!
Cheers
Ed
GARTHWILSON wrote:
Quote:
I think he means to use SPI as the video interface, where MOSI is used (through a resistor network) to drive the NTSC analog signal.
Re: apple1 video hardware
BigEd wrote:
Looks like the shift registers are 1k long
See http://www.applefritter.com/node/8752
Last edited by kc5tja on Sun Jan 02, 2011 9:58 am, edited 1 time in total.
Arlet wrote:
The easiest way to digest the video circuitry may be to instantiate all the components in a HDL, and run it on a simulator.
Plus, you can then put it in an FPGA and try it out.
Plus, you can then put it in an FPGA and try it out.
Re: apple1 video hardware
kc5tja wrote:
BigEd wrote:
Looks like the shift registers are 1k long
See http://www.applefritter.com/node/8752
Quote:
These Signetics 2500 Series 1024-bit multiplexed dynamic shift registers consist of enhancement mode P-channel MOS devices integrated on a single monolithic
Quote:
This assumes you know what all the components actually do. I was completely unaware that the 2504 was a 1024-bit shift register, which was my missing piece of the puzzle.
ETA: There's a .zip file with the datasheets of the 2504, 2513 and 2519 on the sb-projects download link: http://www.sbprojects.com/projects/apple1/download.htm
Re: A small Apple I emulator (was: Another 6502 emulator...)
happycube wrote:
I've been working on a logic-based emulator - with gcc -Os it compiles into less than 4K (not counting 'shell'), which means it'll be a good choice for running on an AVR or ARM Corrtex. In theory one could make a one-chip Apple I with this on a very cheap LPC 111x.
EDIT: I haven't commented it enough yet to make sense, but it's now an Apple I emulator and can run at least basic BASIC programs. The stripped -Os i386 a.out (including basic and woz mon) is ~14K.
Check it out here: http://code.google.com/p/chadslab/sourc ... nk%2Fm6502 (2-clause BSD licensed)
What I really want to do is make a tight Verilog version and see if I can make something smaller than even Arlet's core (EDIT: I doubt I can make one that's worth the effort, but I might look into optimizing Arlet's...)
EDIT: I haven't commented it enough yet to make sense, but it's now an Apple I emulator and can run at least basic BASIC programs. The stripped -Os i386 a.out (including basic and woz mon) is ~14K.
Check it out here: http://code.google.com/p/chadslab/sourc ... nk%2Fm6502 (2-clause BSD licensed)
What I really want to do is make a tight Verilog version and see if I can make something smaller than even Arlet's core (EDIT: I doubt I can make one that's worth the effort, but I might look into optimizing Arlet's...)
Code: Select all
E000R
E000: 4C
>10 FOR I=0 TO 100
10 FOR I=0 TO 100
>20 PRINT I
20 PRINT I
>30 NEXT I
30 NEXT I
>LIST
LIST
10 FOR I=0 TO 100
20 PRINT I
30 NEXT I
>RUN
RUN
0
*** >32767 ERR
STOPPED AT 30
BTW, the emulator was cross-compiled for ARM and ran on an x86 Linux box using qemu-arm (today we got so many MIPS to waste