Go Down

Topic: Apple 1 emulator (Read 1 time) previous topic - next topic

magicaros

Fix for Terminal endline handling,

in file a1.ino replace
Code: [Select]
 
void serout(uint8_t val) {
    //Serial.print(val, HEX);
    //Serial.println();
    Serial.write(val);
  }

by
Code: [Select]
 
void serout(uint8_t val) {
    if (val == 13) {
      Serial.println();
      }
    else {
      Serial.write(val);
      }
  }

magicaros

though i'll publish it here too, cause i have already posted about it on 6502.org

I've been toying around the code and implemented an MMU, as there is no Cassette interface a C000 and no real need for it i bumped the RAM straight to CFFF the memory map is designed like thsi:

0000-0FFF base 4K RAM
1000-8FFF 32K or 16K bank 1 & 2
9000-CFFF 16K bank area (3*16K RAM bank, 1*16K ROM bank with EHBASIC ) switch register at D020
D000-DFFF PIA I/O area, the MMU is implemented here at D020 & D021
E000-EFFF either BASIC 1 or ASM 1 as peter version but switch at runtime with D021 no need to ground any pin
F000-FFFF HIGH ROM area, APPLE 2 monitor & Apple 2 mini assembler 256 bytes lower than in the Apple 2
                                         & WOZ monitor at FF00

demo video on youtube: https://www.youtube.com/watch?v=3Av-LckoaRs

magicaros

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]
D020: 04
9000R

press C for coldstart
press enter ehbasic should detect the 36K ram by itself
then type in
Code: [Select]

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]

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

Go Up