84K RAM Apple 1 system on an arduino DUE kind of

Topics pertaining to the emulation or simulation of the 65xx microprocessors and their peripheral chips.
Post Reply
magicaros
Posts: 6
Joined: 05 Apr 2015
Location: Belgium

84K RAM Apple 1 system on an arduino DUE kind of

Post by magicaros »

Hey guys, i've been toying around with my new Arduino DUE

my work is based on the work of Mike chambers (http://forum.arduino.cc/index.php?topic=193216.0) and petersieg http://forum.arduino.cc/index.php?topic=291681.15

i've been specificaly enhancing the Apple 1 Emulator of petersieg wich is based on Mike's 6502 emulator.

First of all peterseig Apple 1 Emulator had an terminal end line issue with Putty so i fixed that, then in peter version there is 2 E000-EFFF ROM space (wich normaly is HIGH RAM in apple1 for loading BASIC) one with APPLE 1 BASIC & the other with A1 Assembler from San Bergmans. switch between the two rom is managed by a pin at the start of the arduino in peter work, i wanted to be abble to switch between rom without restarting the arduino and without having to deal with a pin and so i implemented a small mmu banking system in the emulator wich leaded me to thing... hey let's add more RAM, the DUE have 96K SRAM & 512K flash that's plenty to play with...

and here we go memory map:

0000-0FFF 4K Base RAM (that what the original apple 1 had)
1000-8FFF 32K RAM OR 16K BANK 1 & BANK 2
9000-CFFF 16K RAM BANK 1,2 or 3 (ever 3 when bank 1 & 2 are banked in the 32K area allowing to access the 3 16K banks together)
D000-DFFF I/O
E000-EFFF Basic ROM or ASM1 ROM
F000-FFFF Apple 2 monitor & Apple 2 mini assembler (256bytes lower than normaly) & woz monitor packed together

I/O:

Apple 1 PIA D010-D013 (D013 is unused and unneeded we just ignore it for now)
MMU register
D020 RAM bank control values (hex):
00 bank 1 in 16K area
01 bank 2 in 16K area
02 bank 3 in 16K area
03 bank 1 & bank 2 in 32K area & bank 3 in 16K area
D021 ROM bank control values (hex):
00 BASIC 1
01 ASM 1

So what next... well it's a work in progress, i still want to add some way to save & load either in the flash or on a sdcard shield then on the 6502 side there a 1024 bytes gap at F000 before apple 2 monitor start i could use that to implement a menu to select wich monitor/rom you want to use
magicaros
Posts: 6
Joined: 05 Apr 2015
Location: Belgium

Re: 84K RAM Apple 1 system on an arduino DUE kind of

Post by magicaros »

Little update,

D020 now accept value 04 wich put EHBASIC in the 16K AREA

i'm attaching a zip of the arduino sketch to this post so you
so peoples with an Arduino DUE wanting to test it or play around
can.
(edit 04/24)
Sorry Guys posted the wrong zip it won't compile fixing it now by uploading the right file instead...
i also made a video on youtube if you just wanna see it working.
https://www.youtube.com/watch?v=3Av-LckoaRs
Attachments
big-a1.zip
correct one hopefully
(30.67 KiB) Downloaded 147 times
magicaros
Posts: 6
Joined: 05 Apr 2015
Location: Belgium

Re: 84K RAM Apple 1 system on an arduino DUE kind of

Post by magicaros »

YET another UPDATE

the change are as follow

implementation of memroy read & write a byte at a time to the banks without maping them, they still can be mapped with D020 as before

D02A LOWBYTE address (bank relative)
D02B HIGHBYTE address (bank relative)
D02C BANK TO TRANFER TO/FROM
D02D DATA TO/FROM THE BANK
D02E DIRECTION -> FF=WRITE | FE = READ

WRITING FE at DFFF trigger a cpu reset, FF quite the emulator in my linux console version/does nothing on the arduino

EHBASIC example that copy from the EHBASIC ROM BANK to the First 16K RAM bank
to run EHBASIC from it's ROM BANK in woz monitor type

Code: Select all

D020: 04
9000R
press C for coldstart
press enter ehbasic should detect the 36K ram by itself
then type in

Code: Select all

5 PRINT "COPYING 16K BYTE PER BYTE"
6 PRINT "PLEASE WAIT..."
10 FOR HB = 0 TO 64 : FOR LB = 0 TO 255
20 POKE 53290,LB: POKE 53291,HB: POKE 53292,4: POKE 53294,254
25 A = PEEK(53293)
30 POKE 53290,LB: POKE 53291,HB: POKE 53292,0: POKE 53294,255
35 POKE 53293,A
40 NEXT LB
45 PRINT (HB+1)*256;" BYTES"
50 NEXT HB
on the Arduino this is slow ass, the EHBASIC is 10706 Bytes long, you can hit ctrl+C after 10752 BYTES and return to the woz monitor, swiitch the first 16K ram bank back and run EHBASIC again like this

Code: Select all

CALL 65311
D020: 00
9000R
type w for warm start, our copy program should sitll be in the memory in the 36 firsts K; EHBASIC now run from ram bank 1
Attachments
biga1.tar.gz
linux console version
(93.15 KiB) Downloaded 120 times
big-a1.zip
Arduino sources
(30.88 KiB) Downloaded 143 times
term.log
log from my terminal software
(1.56 KiB) Downloaded 121 times
Post Reply