Jump to content
IGNORED

Trying to make Atari RU-fonted


Recommended Posts

Hello friends!

 

I wrote a little demo of installing russian font into Atari.

It's a little TSR which protects TSR program itself with bumping up LOMEM and charset with bumpimg down HIMEM.

My problem is in unability to reinitialize access to charset after /RESET/.
/RESET/ sets CHBAS to $E0 and then I can not access my $BC (RUpage) clearly.

I think that I must insert some additional re-initialisation part into TSR.
But I can not realize what part.

Program itself now saves only LOMEM and HIMEM.
I can see saved font with monitor!

I can see right value in MEMTOP and if I change CHBAS to my $BC I lost my screen.

Please advice me.
ez

Link to comment
Share on other sites

It seems that reset is whipping out your charset from $BC when it reopens graphics mode 0.

 

If RESET is not resetting MEMTOP, I remember a bug that clears more than required bytes at the open of graphics mode 0, which usually doesn't matter as normally there is ROM there, and this time it's your charset. Test this by moving MEMTOP a couple of pages down.

 

I can recall a program that saved the last 1k or 2k ending at $BFFF into the RAM under OS ROM, and restored it every time reset key was pressed, just because reset always wiped out that portion of the program when the screen was reopened. Your TSR could do the same thing.

 

I hope this helps.

  • Like 2
Link to comment
Share on other sites

Hi, there, Victor :)

¡muchas Gracias!

 

The problem is solved now. Thank You!

 

I droped the idea of protecting font with tsr at all.

 

I decided to protect font from soft reset with APPMHI and it works!

Just placed font 4 pages below display-list (formerly aligned to page bondary) and set APPMHI one byte higher then end of font.

 

And the main problem of soft reset still stay intact...

It resets all data to system values and I lose access to even intact font.

This makes me to reinit all my settings and it's not my Zen.

 

Anyway the problem solved.

 

Best wishes from Moscow!

ez

Link to comment
Share on other sites

The problem with memory management is that Doses, language carts or executables can and probably will mess with your work.

 

MEMLO is generally modified by Dos at the end of successful boot, it'll usually be bumped to allow for the DOS and buffers resident in low Ram. The consideration for modifying this with a program is that you need to cater for whatever memory Dos would want to use which can be tricky as every Dos is different and most can differ depending on how many drives and file buffers are enabled.

 

MEMTOP is maintained by the OS, it will be set when a screen or editor is opened and should point to 1 byte before start of the Display List.

 

RAMSIZ represents the page address of the first non-contiguos Ram address, established at cold and warmstart by the OS then copied to RAMTOP shortly after. Best not modified, use as a reference showing how much contiguous Ram is available starting from location $0000.

 

RAMTOP represents the end +1 of screen memory. When reserving Ram above the screen for graphics or other, RAMSIZ should be used as the starting figure then RAMTOP altered immediately before re-opening the screen in order to relocate it. The reason to not use RAMTOP as initial reference is that it can cause storage creep (loss) in subsequent program runs if no warmstart occurs between runs.

 

APPMHI represents the highest address used by the application. It's used to protect programs and variables/workspace from inadvertantly being wiped by a screen open operation. The 400/800 OS has a bug where if this is set too high the screen won't open and the machine can be rendered unusable after a warmstart.

Edited by Rybags
  • Like 1
Link to comment
Share on other sites

Hi, there, Rybags!

 

At first, thank you for reply.

 

As you can imagine I tryed to make standalone tsr initialisation routine which has deal with memory management only.

tsr part and font part are to be protected after initialisation.

 

YES! At first, I protected too little memory and have seen Ramtop Dragon. :)

Then after protecting 2k of memory I've seen this strange behavior of Soft RESET, when after each reset I'm needed to reinitialize font even if it was not corrupted by T-rex.

 

I can understand that now when my font is protected from Atari???!!! by using APPMHI it's still unprotected from my own programming.

 

But I'm not a programmer and never shell become.

 

If you want to hear Russian (why not?) and seeing session try this:

 

 

Good luck, friend!!!

ez

  • Like 1
Link to comment
Share on other sites

This picture shows another Atari dedicated bellevue.

 

Atari itself has her own SONY PVM monitor, 576k memory module with Stereo COVOX connected to loudspeakers,

IDEPlus 2.0 hard drive with SDX 4.48 onboard, XF551 floppy, Lotharek's SIO2SD, Steven's SIO2PC and her own

dedicated host PC - Surface Pro 3 (from the right side) with docking station (video output goes to left big screen).

 

Everynight dream of "My Honey" is external VBXE...

May be The!Cart too...

 

CU :)

 

 

post-20208-0-97428000-1489731947_thumb.jpg

Link to comment
Share on other sites

  • 4 weeks later...

Hello, Rybags!

After your kind explanation of Soft-RESET process in another post,
I've successfully rewrite this routine in classic manner. :)

There were tons of detailed font routines written in BASIC,
but my personal problem was in the fact that BASIC itself carefully works on it's memory layout.

Particularly this fact means that in assembly I needed to restore some data in TSR part.
Once you've said that highest 1k is wiped by RESET anyway,

I just protected this poor 1k and 1k for font in hi memory, then let GR0 reset screen data, and ...

put new MEMTOP data cooked by system into runtime var, for moving var->MEMTOP every reset. :)
This fact was permanently hidden by BASIC which treat his memory itself.

Now program works in standard Atari manner.

; Sample program
; rudos.com
        .ou rudos.com
; ====================
; Included LIBS
        .in syseq.mae
        .in macro.mae
; Program Constants
select  =   $05
none    =   $07
red     =   $22
blu     =   $82
cslen   =   $0400
; --------------------

; > > > >  Protected ZONE Start > > > >
        .or $1900
        jmp start
; --------------------
; Program Variables
protlo  .ds 2
prothi  .ds 2
oldcon  .ds 1
rupage  .ds 1
enpage  .ds 1
csadr   .ds 2
; -------------------
; Set VBI as Immedate
setvbi
        lda #$06
        ldx #>vbi
        ldy #<vbi
        jsr SETVBV
        rts
; -------------------
; Set Environment
setenv
        lda COLOR4
        cmp #blu
        bne setblu
setred
        mib red COLOR4
        mab rupage CHBAS
        jmp skip
setblu
        mib blu COLOR4
        mab enpage CHBAS
skip
        rts
; -------------------
; Set NoRESET
dummy                     ; Fake addr
tsr     jsr dummy         ; to be DOSINI
        maw protlo MEMLO  ; bump up
        maw prothi MEMTOP ; bump dn
        jsr setvbi        ; reinit VBI
        jsr setenv        ; reinit env
        rts
; --------------------
; Read CONSOL in VBI
vbi
        lda CONSOL
        tax        ; X=CONSOL
        ldy oldcon ; Y=oldcon
;
        tya        ; A=oldcon
        cmp #none
        bne exit
chkcon
        txa
        cmp #none
        beq exit
        txa
        cmp #select
        bne exit
        jsr setenv
exit
        stx oldcon
        jmp SYSVBV
; < < < < Protected ZONE Finish < < < <
finish  =   *



;This part may be deleted after running only once!

; ====================
; Initialization
start   .or $2000
init
        miw finish protlo
        maw protlo MEMLO ; Protect Runtime
;
        lda RAMTOP
; reserve 8 pgs: 4-for font and 4 for safety
        sec
        sbc #$08
; --------------------
; 1. Declare new RAMTOP
        sta RAMTOP
; --------------------
; 2. Call GR mode immediately
        ofs 6
        bfa sname
        lda GRMODE
        jsr setgr
; --------------------
; init prothi
        maw MEMTOP prothi
; --------------------
; Init csadr
        lda RAMTOP
        sta csadr+1 ; MSB
        lda #$00
        sta csadr
; --------------------
; 4. Load font
        jsr gtfname
        jsr ldfile
; --------------------
; 5. Declare it to ANTIC
        lda csadr+1
        sta CHBAS
; --------------------
; Init font pages
        mib $e0 enpage
        mab 1+csadr rupage ; MSB
        mib red COLOR4
;
        mib none oldcon
        jsr setvbi
;
; Set TSR data
        maw DOSINI 1+tsr   ; save DOSINI into tsr jump
        miw tsr DOSINI     ; set DOSINI as tsr
        maw protlo MEMLO   ; fill MEMLO as protlo
;
        rts                ; Return to DOS
; ====================
; Init DATA
sname   .by "S:",EOL
prompt  .by CLR,"ENTER D:FONTNAME.FNT TO LOAD...",EOL
cr      .by EOL
buflen  =   40
fname   .ds buflen
; ====================
; Useful Subroutines
setgr
        pha ; Mode
        jsr close
        pla
        tay        ; Y=Opt (AUX1)
        and #16+32 ; TXTWIN+NoClear
        eor #16    ; flip TXTWIN
        ora #OPUPD ; Open rw
        jmp open
; --------------------
gtfname
; PRINT prompt to screen
        ofs 0
        bfa prompt
        bfl buflen
        jsr print
; Filename INPUT to buffer
        ofs 0
        bfa fname
        bfl buflen
        jsr input
        rts
; --------------------
ldfile
; CLOSE 1
        ofs 1
        jsr close
; OPEN 1 OREAD 0 fname
        ofs 1
        bfa fname
        lda #OREAD        ; Mode
        ldy #$00          ; Option
        jsr open
        chk iferr
; BGET 1 <adr> <len>
        ofs 1
        maw csadr BFADR,x
        bfl cslen
        jsr getby
        chk iferr
; CLOSE 1
iferr
        ofs 1
        jsr close
        rts
; ====================
; Included SUBS
        .in iolib.mae
; --------------------
; Setup Run Address
        .or RUNAD
        .wo start
; --------------------
        .en
; >>> End Of File <<< ;

RUDOS.atr
Best wishes from Moscow.

Zhenya.
(It's shortname from Eugene.)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...