6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Apr 28, 2024 8:16 pm

All times are UTC




Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Fri Feb 28, 2020 5:44 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
Chromatix wrote:
The [Apple 1] keyboard and display hardware are both interfaced to the CPU bus through a 6820 PIA...
The Apple 1 display is a little weird in that it is essentially a glass TTY; as far as I know it supports only a 6-bit version of ASCII plus carriage-return.

Right; the one control character is CR, which fills spaces to the end of the current line and, if that was the last line on the screen scrolls the screen up a line, filling new the line with spaces. The cursor is then left at the start of the new line.

I have a few more details in the Video section of my Apple 1 documentation, along with a link to a video of a real Apple 1 that confirms the behaviour, and links to a couple of emulators that are consistent with that (and one that is not). As documented there, the character output translation is:
Code:
$00-$1F  Print nothing (excepting $0D)
    $0D  (CR) Moves to the beginning of the next line.
$20-$5F  (space through underbar) prints given char
$60-$7F  (lower-case etc.) prints same as $40-$5F
         ($7F is not treated as a control character)

I have also documented the character ROM details, with links to the data sheet and ROM dumps, and notes on how the dumps differ from the actual ROM contents.

I ended up documenting this carefully because tebl's RC6502-Apple-1-Replica, which uses an Arduino Nano to emulate the keyboard and display over a serial line, doesn't properly emulate the real behaviour.

________________________________
mvk wrote:
Atari 2600 programmers had it easy with their TIA chip. It took care of an entire scan line while their software could do something else.

Well, my understanding is that it's not quite that simple. You have to make sure you're ready to update the TIA registers during the horizontal retrace interval between the end of displaying the current scan line and the start of display of the next, which usually means you're going to trigger the "wait for end of scanline" function at some point before the end and can do nothing during that time. And many games (such as Space Invaders) spent their time during the scan line changing the TIA registers to get more "players" on the screen.

But sure, still easier and more flexible than having to program the CPU to clock the bits out yourself. I look forward to your redesign of the Gigatron to be as advanced as the Atari 2600, albeit more than 40 years late. :-)

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Fri Feb 28, 2020 11:50 pm 
Offline
User avatar

Joined: Tue Mar 21, 2017 6:57 pm
Posts: 81
cjs wrote:
As documented there, the character output translation is:
Code:
$00-$1F  Print nothing (excepting $0D)
    $0D  (CR) Moves to the beginning of the next line.
$20-$5F  (space through underbar) prints given char
$60-$7F  (lower-case etc.) prints same as $40-$5F
         ($7F is not treated as a control character)

I have also documented the character ROM details, with links to the data sheet and ROM dumps, and notes on how the dumps differ from the actual ROM contents.

I ended up documenting this carefully because tebl's RC6502-Apple-1-Replica, which uses an Arduino Nano to emulate the keyboard and display over a serial line, doesn't properly emulate the real behaviour.

I also want to get such details right. I found that this original machine seems to treat a range of chars (presumably 0..$1F) all as CR.

Video: https://youtu.be/4l8i_xOBTPg?t=105

Attachment:
Screenshot 2020-02-29 at 00.47.51.png
Screenshot 2020-02-29 at 00.47.51.png [ 559.22 KiB | Viewed 1138 times ]


It is a bit hard to read, but they're showing a variation of the test program from the Apple-1 User manual (which was broken BTW).

Code:
0000 LDA #0
     TAX
     JSR $FFEF
     INX
     TXA
     JMP $0002


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 6:05 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
mvk wrote:
I also want to get such details right. I found that this original machine seems to treat a range of chars (presumably 0..$1F) all as CR.

Fascinating! That's clearly different from the Apple 1 in the video I referenced in my notes: https://youtu.be/wTgyll6IqJY?t=33 .

Fortunately the Apple-1 Operation Manual includes schematics for the board. I won't claim to understand the video circuitry well (or much at all, really :-P) but I do notice that at the right-hand side there is pretty clearly a set of gates that detects a CR ($0D, 0001101) on the character input lines RD1 through RD7. The output of this goes into an OR gate the other input of which is the AND of a couple of flip-flop outputs that I would bet good money is the end-of-line detection.

So I think I'm going to (somewhat tentatively) assume that the Apple 1 in that video you found is broken. The way to confirm this would be to properly confirm the operation described by the schematic and, ideally, confirm that several other real Apple 1s have the "only CR generates a new line" behaviour.

Regarding that test program (which I use myself), what's broken about it? I see that it could certainly JMP $0003 instead of $0002, but that's an optimization that would make no difference in speed anyway, since the limit there is the wait for the video circuitry to be ready for a new character (done in the $FFEF ECHO routine).

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 7:53 am 
Offline
User avatar

Joined: Tue Mar 21, 2017 6:57 pm
Posts: 81
mvk wrote:
they're showing a variation of the test program from the Apple-1 User manual (which was broken BTW).

cjs wrote:
Regarding that test program (which I use myself), what's broken about it?

In the Apple-1 User Manual it jumps back to the clearing of A:

Attachment:
Screenshot 2020-02-29 at 08.51.56.png
Screenshot 2020-02-29 at 08.51.56.png [ 63.33 KiB | Viewed 1119 times ]


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 8:09 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Indeed, the penultimate byte should be 42 hex, thereby looping to the JSR.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 8:40 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
mvk wrote:
cjs wrote:
Regarding that test program (which I use myself), what's broken about it?
In the Apple-1 User Manual it jumps back to the clearing of A....

Ah. That must be an older version of the manual. I use this one, which doesn't have that error.

Sheesh, get up to date! It's like you're living in the past or something. :-)

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 9:02 am 
Offline
User avatar

Joined: Tue Mar 21, 2017 6:57 pm
Posts: 81
cjs wrote:
I use this one, which doesn't have that error.

I don't spot any improvement from what I posted.

Attachment:
Screenshot 2020-02-29 at 08.51.56.png
Screenshot 2020-02-29 at 08.51.56.png [ 65.31 KiB | Viewed 1110 times ]


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 9:08 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
mvk wrote:
I don't spot any improvement from what I posted.

Ah, we're looking at different programs. The one I was talking about, and the one that is used in both videos linked above, is two pages earlier in the section titled "TEST PROGRAM."
Attachment:
Apple 1 Test Program.png
Apple 1 Test Program.png [ 115.53 KiB | Viewed 1109 times ]

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 29, 2020 1:53 pm 
Offline
User avatar

Joined: Tue Mar 21, 2017 6:57 pm
Posts: 81
cjs wrote:
Ah, we're looking at different programs. The one I was talking about, and the one that is used in both videos linked above, is two pages earlier in the section titled "TEST PROGRAM."

Ah, I'm learning something new every day. I agree that the 2012 video must be an anomaly. Anyway, the lower case chars in the $60-$7F block are now properly squashed as well:

Attachment:
40R.png
40R.png [ 64.59 KiB | Viewed 1101 times ]

May I soon graduate from this platform and qualify for the Apple ][, or VCS 2600.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 24, 2020 4:15 pm 
Offline
User avatar

Joined: Tue Mar 21, 2017 6:57 pm
Posts: 81
I added a usage text when starting the mini-assembler with EEER. This makes the program a tiny bit larger than 1K, stretching from $BE5 to $FFF now.

But the good thing is that now there's a second entry point that skips the usage text. This extra help code and text runs from $BE5 to $CA7. The mini-assembler itself from $CA8 to $FFF. Not a single byte got wasted, and we have two really nice entry points: EEER and ... BEER!

Just perfect.

Attachment:
Usage.png
Usage.png [ 49.53 KiB | Viewed 1045 times ]


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 24, 2020 11:30 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
https://rosettacode.org/wiki/99_Bottles ... 2_Assembly
Code:
0BEE
:A2 63 D0 05 A0 00 20 01 0C A0 21 20 01
:0C CA 10 F3 A2 63 98 48 20 3C 0C 8A F0
:16 A0 AF 38 E9 0A C8 B0 FB 69 3A C0 B0
:F0 06 48 98 20 40 0C 68 A0 29 20 40 0C
:E0 01 D0 01 C8 20 3C 0C 68 C9 20 F0 0B
:48 20 3C 0C 68 A0 20 C9 21 F0 C7 A0 45
:B9 4C 0C C8 48 09 80 29 FF 20 EF FF 68
:10 F1 60 54 41 4B 45 20 4F 4E 45 20 44
:4F 57 4E 20 41 4E 44 20 50 41 53 53 20
:49 54 20 41 52 4F 55 4E 44 2C 8D 4E 4F
:20 4D 4F 52 45 20 42 4F 54 54 4C C5 53
:20 4F 46 20 42 45 45 D2 20 4F 4E 20 54
:48 45 20 57 41 4C CC 2E 8D 47 4F 20 54
:4F 20 54 48 45 20 53 54 4F 52 45 20 41
:4E 44 20 42 55 59 20 53 4F 4D 45 20 4D
:4F 52 45 2C 8D
BEER

[... might not look very tidy in 26 columns though ...]

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Wed May 27, 2020 9:42 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
I was shocked and saddened to read this morning of Marcel's untimely passing. Our world just lost a darn good engineer. My condolences to his family and (I'm sure) many friends.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Thu May 28, 2020 3:25 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3349
Location: Ontario, Canada
Marcel van Kervinck, aka mvk, creator of the Gigatron, was a member of this forum its sibling on Anycpu.org. Forum member monsonite posted a thoughtful In Memorium here.

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 37 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: