6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 17, 2024 3:51 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Apr 18, 2015 11:28 am 
Offline

Joined: Sun Apr 05, 2015 1:17 am
Posts: 6
Location: Belgium
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


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 22, 2015 7:42 am 
Offline

Joined: Sun Apr 05, 2015 1:17 am
Posts: 6
Location: Belgium
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:
File comment: correct one hopefully
big-a1.zip [30.67 KiB]
Downloaded 110 times
Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 29, 2015 7:15 pm 
Offline

Joined: Sun Apr 05, 2015 1:17 am
Posts: 6
Location: Belgium
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:
D020: 04
9000R

press C for coldstart
press enter ehbasic should detect the 36K ram by itself
then type in
Code:
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:
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:
File comment: linux console version
biga1.tar.gz [93.15 KiB]
Downloaded 90 times
File comment: Arduino sources
big-a1.zip [30.88 KiB]
Downloaded 117 times
File comment: log from my terminal software
term.log [1.56 KiB]
Downloaded 90 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: