Fig-Forth

Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: Fig-Forth

Post by Mark »

Phillipe,
Thanks for posting your Elector Jr. files. They are interesting!

I'm looking at the 6845 VDU implementation. The character generator ROM on the Elector Jr. Page here seems to use an 8x16 cell character. Is the ess522.bin the one you are using with your system? I've been looking at the initialization table in PMV_OS65_modifs_Phil.ASM for the 6845 and haven't quite figured out how the 6845 knows how to address the character generator ROM using 12 of the 16 rows available unless your chrgen is 8x8 for most of the modes your listed. What video mode do you usually use? 80x24?

Which brings up a question for bxdanny, any idea what chargen ROM was used for SEB-3? Maybe I can ask Bill to dump it if it is still around?

So looking more closely at what the listed Elector Jr. patch "Tableau 2" does, it turns out the call for loading the missing sector happens at $2214 - that patch asks this to be JSR $2E79, however this is only correct for OS65D3.3 which has multiple sectors on track 6 and loads additional data besides track 0 & 1. For OS65D3.2 and earlier it is JSR $2761 (head unload) which is what the original FigForth disk had on it. Replacing that on your VDU disk should eliminate the ERR #9. (Attached) For more info on the OS65D See the OS65D_Dissasembly on the manuals page.

My attempts to splice the FigForth software onto OSI C4P OS65D as an experiment crashes just after the FigForth 1.0 message, so I'm not sure it will run on your system without some other changes... (or it could just be something I missed).

Oh, and yes Hexdos does use it's own track format but fortunately still encoded as 8E1 bytes on the disk so it can still be dumped with Ed's Raw Dump Utility or it's successors! Thanks for the correction.

Cheers!
-Mark
Attachments
OS65D_3.3_FigForth_VDUfix2.zip
Removed erroneous load of unavailable sectors
(16.27 KiB) Downloaded 106 times
wawa.voun
Posts: 49
Joined: Sun Nov 22, 2020 5:59 pm

Re: Fig-Forth

Post by wawa.voun »

Hi Mark,

The character generator eprom binary and source is herejoined. Yes it should be the same that on Hans Otten website (ESS522).

I confirm that video mode I use is 80x24. I have not try other modes.

I dont really understand your question about this character generator usage. Character rows are always fully displayed no ?
The character generator is addressed by the ascii code stored in the video memory.
In any mode all dot rows are used, it is just the number of character per line which change into the 6845 parameters.
If I remember correctly the vertical space between lines is also stored into the character generator (by empty lines). So the dot lines per character could be between 8 (then no space between lines) up to 16. This is choose by the 6845 vertical timing.

There is an special document about 6845 programming also joined (sorry in french but for sure you can find it somewhere in english).

I will test this floppy image this evening.

Regards.
Philippe
Attachments
Elektor_76_p66-68 - Carte VDU - programmation du 6845.pdf
(3.09 MiB) Downloaded 104 times
Char_Gen_Junior_VDU.zip
(5.28 KiB) Downloaded 100 times
Last edited by wawa.voun on Tue Nov 29, 2022 10:30 am, edited 1 time in total.
bxdanny
Posts: 336
Joined: Thu Apr 16, 2015 2:27 pm
Location: Bronx, NY USA

Re: Fig-Forth

Post by bxdanny »

The SEB-3 used the standard OSI 8x8 character generator. In fact, I had the driver do EOR #1 on the character code if it was in the range $7C to $7E, because OSI got the wrong symbol in the wrong slot over there, and also replace $60 with a symbol other than another blank space. (There was no grave accent available, I used a rectangular box which happened to be $1B, coincidentally the code for ESCape.)

OS-65D 3.2 for the C4P did actually load a track 6, sector 2 from code in the $2E79 area. It was a partial replacement for the keyboard-scanning routine at $FD00, which did not lock up if joystick button was pressed, and also returned with $00 if no key was pressed. That loaded to $3180. I call it partial because at some point, it jumped into the middle of OSI's $FDxx code, meaning systems with replacement ROMs like CEGMON could not boot that version of 65D without modification. (But 65D 3.1 didn't have that, so it would boot, as of course would 3.3.)

--Danny
No current OSI hardware
Former programmer for Dwo Quong Fok Lok Sow and Orion Software Associates
Former owner of C1P MF (original version) and C2-8P DF (502-based)
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: Fig-Forth

Post by Mark »

Philippe,
Thanks for posting the Char gen ROM. If you look at the source it says "Each character has 16 bytes in the ROM, though only the top 12 are normally used." So the VDU Is using a 4K ROM that has 8x16 pixels for each displayed character. The 6845 is programmed to use only the 1st 12 rows of the character. The OSI uses an 8x8 pixel character set, all 256 characters fit in a 2K ROM. From the source you provided earlier, there are some video sizes that use 12 raster rows of height and some that use 8 (Register R9). I'm just trying to understand how that all fits with the chargen ROM. I guess it could be how it's set up in hardware, I'll have to look at an actual schematic in more detail.

Danny, thanks for the info on the OS65D variants. It's an area I'm just starting to explore. It seems OSI kept most addresses from older versions and just sliced in jumps or patches without relocations to make later versions. At least old programs that relied on particular addresses would continue to work. I still need to explore the BASIC relinker that allows V3.2 programs to load at V3.3 addresses etc. I know it happens, I've just never looked at the code and how that affects machine code programs.

Cheers,
-Mark
wawa.voun
Posts: 49
Joined: Sun Nov 22, 2020 5:59 pm

Re: Fig-Forth

Post by wawa.voun »

Hi,

I just give a try to the last disk image and I also got a "Fig-Forth 1.0" prompt then the system hang.
So video look to work !

It is probably some routines and addresses inside Forth itself that does not fit Junior hardware...

Regards.
Philippe
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: Fig-Forth

Post by Mark »

I think the problem is that the output routines were patched, but the input routines were not. Perhaps there were some additional changes for "A301" + in the Elector notes?

There is an I/O table at $2301 that contains the addresses of the handlers -1.

Code: Select all

The default I/O table at $2301 or $0104 in the 65D image
L2301	.WORD S24F6-1	;In from ACIA		BASIC device #1  change to Jr. Serial IN .WORD $FE1A
L2303	.WORD S252B-1	;In polled keyboard 	#2               change to Jr. Serial IN   .WORD $FE1A
L2305	.WORD $2517	;In from UART		#3
L2307	.WORD $2385	;In NULL		#4
L2309	.WORD $2388	;In Memory		#5
L230B	.WORD $23A0	;In Disk #1		#6
L230D	.WORD $23EF	;In Disk #2		#7
L230F	.WORD $24AF	;In CA10X ACIA		#8
		
L2311	.WORD L24CD-1	;OUT ACIA		Basic device #1 change to Jr. Serial Out .WORD $FEA2
L2313	.WORD L2599-1	;Out video		#2              change to Jr. Video Out .WORD $FEFF
L2315	.WORD $250C	;Out UART		#3
L2317	.WORD $249E	;Out LPT		#4
L2319	.WORD $238F	;Out memory		#5
L231B	.WORD $23B1	;Out disk #1		#6
L231D	.WORD $2402	;Out disk #2		#7
L231F	.WORD $24BC	;Out CA10X ACIA		#8
L2321	.BYTE $10		;input distributor
L2322	.BYTE $00		;output distributor	 - change to 02 to see boot msg on VDU 

Based on the Junior_OS65D_3.3_Tutorial5.65D disk posted online, I've changed the Input vectors to the Junior's Serial Input routine, and also turned on the default output distributor at $2322.
I did not set the "serial output 1" and "Centronics output 1" indicated in the "Mod 2" image as I could not verify they were correct based on the ROM images and memory map you posted. It's easy enough to change in the .65D file later if you need to.


This is what you should see after booting and pressing <Enter>

*DOS JUNIOR COMPUTER V2.0*

COPYRIGHT BY ELEKTOR
FIG-FORTH 1.0
OK


Good Luck!
-Mark
Attachments
OS65D_3.3_FigForth_VDUfixJR.zip
OSI C1P OS65D+Figforth modified for Elector Jr. I/O
(16.27 KiB) Downloaded 105 times
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: Fig-Forth

Post by Mark »

Actually I forgot to set the default I/O device to "2" in the previous image.

At offset $0028 in the .65D file change 01 to 02 to make input from JR serial, and output to VDU. 01 makes it input from serial & output to serial.
(I'll attach it below.)
-Mark
Attachments
OS65D_3.3_FigForth_VDUfixJR1.zip
Change default I/O to devices #2
(16.27 KiB) Downloaded 103 times
wawa.voun
Posts: 49
Joined: Sun Nov 22, 2020 5:59 pm

Re: Fig-Forth

Post by wawa.voun »

Hi Mark,

Thanks again for you help.
I will give a try to your image this weekend.

Regards.
Philippe
wawa.voun
Posts: 49
Joined: Sun Nov 22, 2020 5:59 pm

Re: Fig-Forth

Post by wawa.voun »

Hi Mark,

I just give a try and I got nothing from this image... no Junior prompt nor Forth prompt !

As you can see in another post I have build a FPU board for this Junior and now I hope to use it in some high level language.
Forth seems to be the best choice because it is basically expandable with new instructions.

This is why it is 'important' for me to try to get this image working. Is there anything I can do to help you to solve the problem ?

Regards.
Philippe

PS : I forgot to mention that Mod1 and Mod2 should be applied after the modifications give in the first message of this thread. We can call it Mod0 !
So :
- Mod0 adapt OS65D 3.3 tut 5 to work on a Junior via serial port (in and out)
- Mod1 and 2 adapt the already modified image for serial operation to VDU usage (in via serial port and out to VDU routines)

There is no change in input routines because in both case the keyboard is connected to the serial port.
Mark
Posts: 297
Joined: Tue Sep 16, 2008 6:04 am
Location: Madison, WI
Contact:

Re: Fig-Forth

Post by Mark »

I'm terribly sorry, I see I made a mistake in the last images, offset $0117 should be EF not EE. This is the video output routine ($F000-1) aka device #2. (I use a ROM at $EFxx to simulate the Elector Jr. mods, and missed changing this one back before posting.)

"Mod 2" sets OS65D output device table at $2311. #1 is $FF00 (VDU) originally serial out, #2 is $FF00 (VDU), #3 $FEA3 (6532 serial), #4 is $F3E2 (Centronics)
Mod1 sets the default input and output device to #1 as well as calling some Elector initialization ROM routines.
"Mod0" removes a $F700 PIA write and polling of $DE00 to determine CPU speed, the other changes are replaced with "Mod1"

By default there doesn't seem to be any modification of the input device table posted. It would still point to the original OS65D routines which use an ACIA at $FF00.

Junior_OS65D_3.3_Tutorial5.65D uses FE1A(+1) as the serial input routine which matches the ROM code you posted so I used that for input in this image.

Anyway, maybe this one will work?
FigForth replaces BASIC so if you end up at the A* prompt, you can reload with 'BA' command. This disk doesn't use OS65D3.3, it seems to be an earlier version, but I'm not sure which one.

This is what the mods look like

Code: Select all

2200 A9 01    LDA #$01
2202 8D 5E 26 STA $265E
2205 20 BC 26 JSR $26BC ;seek track 1
2208 A9 2A    LDA #$2A
220A 85 FF    STA $FF
220C 20 54 27 JSR $2754
220F 86 FE    STX $FE
2211 20 67 29 JSR $2967 ;load track 1 @ $2A00
2214 20 61 27 JSR $2761 ;unload head
2217 A0 BF    LDY #$BF  ;look for top of RAM
2219 20 EC 22 JSR $22EC
221C F0 03    BEQ $2221
221E 88       DEY
221F D0 F8    BNE $2219
2221 8C 00 23 STY $2300 ;store top of RAM page
2224 A2 01    LDX #$02  ;default I/O device#
2226 8E C6 2A STX $2AC6
2229 4C 41 22 JMP $2241
222C EA       NOP
222D EA       NOP
222E EA       NOP
222F EA       NOP
2230 EA       NOP
2231 EA       NOP
2232 EA       NOP
2233 EA       NOP
2234 EA       NOP
2235 EA       NOP
2236 EA       NOP
2237 EA       NOP
2238 EA       NOP
2239 EA       NOP
223A EA       NOP
223B EA       NOP
223C EA       NOP
223D EA       NOP
223E EA       NOP
223F EA       NOP
2240 EA       NOP
2241 A9 00    LDA #$00
2243 8D F7 EF STA $EFF7
2246 8D D2 EF STA $EFD2
2249 20 35 F4 JSR $F435 ;*MOVE THE CRT FILE FROM ROM TO RAM*
224C 20 30 F3 JSR $F330 ;*MASTER RESET OF THE MEMORY MAPPED VDU*
224F 20 61 27 JSR $2761 ;unload head
2252 20 73 2D JSR $2D73 ;print message following
2255          .BYTE $D,$A,$A,'*DOS JUNIOR COMPUTER  V2.0*'
2272          .BYTE $D,$A,$A,'COPYRIGHT BY ELEKTOR',0
228B A9 2E    LDA #$2E
228D 8D 7C FA STA $FA7C
2290 A9 FF    LDA #$FF
2292 8D 7D FA STA $FA7D  ;SET BREAK address
2295 A9 00    LDA #$00
2297 8D 7A FA STA $FA7A
229A A9 FC    LDA #$FC
229C 8D 7B FA STA $FA7B ;Set NMI address
229F 4C E6 2A JMP $2AE6 ; execute BA command

2300 ;(top of RAM storage location)
     ;lo hi
2301 1A FE           ;In from serial    device #1
     1A FE           ;In from serial    #2
     85 23           ;In NULL           #3
     85 23           ;In NULL           #4
     88 23           ;In Memory         #5
     A0 23           ;In Disk #1        #6
     EF 23           ;In Disk #2        #7
     AF 24           ;In CA10X ACIA     #8

2311 A2 FE           ;OUT serial        device #1
     FF EF           ;Out VDU           #2
     A2 FE           ;Out serial        #3
     E1 F3           ;Out Centronics    #4
     8F 23           ;Out memory        #5
     B1 23           ;Out disk #1       #6
     02 24           ;Out disk #2       #7
     BC 24           ;Out CA10X ACIA    #8
Attachments
OS65D_3.3_FigForth_VDUfixJR3.zip
fix VDU address
(16.27 KiB) Downloaded 98 times
Post Reply