Browse Source

added EDITOR_C128_NATIONAL

pull/5/head
Michael Steil 4 years ago
parent
commit
e30d8c5c59
  1. 690
      EDITOR_C128_NATIONAL/declare.src
  2. 298
      EDITOR_C128_NATIONAL/denmark.src
  3. 658
      EDITOR_C128_NATIONAL/ed1.src
  4. 298
      EDITOR_C128_NATIONAL/ed2.src
  5. 301
      EDITOR_C128_NATIONAL/ed3.src
  6. 475
      EDITOR_C128_NATIONAL/ed4.src
  7. 376
      EDITOR_C128_NATIONAL/ed5.src
  8. 437
      EDITOR_C128_NATIONAL/ed6.src
  9. 140
      EDITOR_C128_NATIONAL/ed7.src
  10. 10
      EDITOR_C128_NATIONAL/entries.src
  11. 300
      EDITOR_C128_NATIONAL/finland.src
  12. 302
      EDITOR_C128_NATIONAL/france.src
  13. 323
      EDITOR_C128_NATIONAL/german.src
  14. 296
      EDITOR_C128_NATIONAL/italy.src
  15. 296
      EDITOR_C128_NATIONAL/norway.src
  16. 37
      EDITOR_C128_NATIONAL/patches.src
  17. 976
      EDITOR_C128_NATIONAL/relnotes.src
  18. 179
      EDITOR_C128_NATIONAL/routines.src
  19. 318
      EDITOR_C128_NATIONAL/spain.src
  20. 296
      EDITOR_C128_NATIONAL/swiss.src
  21. 551
      EDITOR_C128_NATIONAL/sysdoc.src
  22. 5
      README.md
  23. 1
      build.sh

690
EDITOR_C128_NATIONAL/declare.src

@ -0,0 +1,690 @@
.page
.subttl C/128 KERNAL & EDITOR DECLARATIONS (05/14/85)
* = $0000
d6510 *=*+1 ;6510 data direction register
r6510 *=*+1 ;6510 data register
bank *=*+1 ;monitor & long call/jump registers
pc_hi *=*+1
pc_lo *=*+1
s_reg *=*+1
a_reg *=*+1
x_reg *=*+1
y_reg *=*+1
stkptr *=*+1
* = $0090 ;kernal/editor allocations start here
status *=*+1 ;i/o operation status byte
stkey *=*+1 ;stop key flag
svxt *=*+1 ;tape temporary
verck *=*+1 ;load or verify flag
c3p0 *=*+1 ;serial buffered char flag
bsour *=*+1 ;char buffer for serial
syno *=*+1 ;cassette sync #
xsav *=*+1 ;temp for basin
ldtnd *=*+1 ;index to logical file
dfltn *=*+1 ;default input device #
dflto *=*+1 ;default output device #
prty *=*+1 ;cassette parity
dpsw *=*+1 ;cassette dipole switch
msgflg *=*+1 ;os message flag
ptr1 ;cassette error pass1
t1 *=*+1 ;temporary 1
ptr2 ;cassette error pass2
t2 *=*+1 ;temporary 2
time *=*+3 ;24 hour clock in 1/60th seconds
r2d2 ;serial bus usage
pcntr *=*+1 ;cassette stuff
bsour1 ;temp used by serial routine
firt *=*+1
count ;temp used by serial routine
cntdn *=*+1 ;cassette sync countdown
bufpt *=*+1 ;cassette buffer pointer
inbit ;rs-232 rcvr input bit storage
shcnl *=*+1 ;cassette short count
bitci ;rs-232 rcvr bit count in
rer *=*+1 ;cassette read error
rinone ;rs-232 rcvr flag for start bit check
rez *=*+1 ;cassete reading zeroes
ridata ;rs-232 rcvr byte buffer
rdflg *=*+1 ;cassette read mode
riprty ;rs-232 rcvr parity storage
shcnh *=*+1 ;cassette short cnt
sal *=*+1
sah *=*+1
eal *=*+1
eah *=*+1
cmp0 *=*+1
temp *=*+1
tape1 *=*+2 ;address of tape buffer
bitts ;rs-232 trns bit count
snsw1 *=*+1
nxtbit ;rs-232 trns next bit to be sent
diff *=*+1
rodata ;rs-232 trns byte buffer
prp *=*+1
fnlen *=*+1 ;length current file n str
la *=*+1 ;current file logical addr
sa *=*+1 ;current file 2nd addr
fa *=*+1 ;current file primary addr
fnadr *=*+2 ;addr current file name str
roprty ;rs-232 trns parity buffer
ochar *=*+1
fsblk *=*+1 ;cassette read block count
drive
mych *=*+1
cas1 *=*+1 ;cassette manual/controlled switch (updated during irq)
track
stal *=*+1
sector
stah *=*+1
memuss ;cassette load temps (2 bytes)
tmp2 *=*+2
data *=*+1 ;tape read/write data
ba *=*+1 ;bank for current load/save/verify operation
fnbank *=*+1 ;bank where current filename is found (at 'fnadr')
ribuf *=*+2 ;rs-232 input buffer pointer
robuf *=*+2 ;rs-232 output buffer pointer
.page
; 40/80 column S C R E E N E D I T O R declarations
;
; GLOBAL screen editor variables
keytab *=*+2 ;keyscan table pointer
imparm *=*+2 ;PRIMM utility string pointer
ndx *=*+1 ;index to keyboard queue
kyndx *=*+1 ;pending function key flag
keyidx *=*+1 ;index into pending function key string
shflag *=*+1 ;keyscan shift key status
sfdx *=*+1 ;keyscan current key index
lstx *=*+1 ;keyscan last key index
crsw *=*+1 ;<cr> input flag
mode *=*+1 ;40/80 column mode flag
graphm *=*+1 ;text/graphic mode flag
charen *=*+1 ;ram/rom vic character character fetch flag (bit-2)
; the following locations are shared by several editor routines
.share
sedsal *=*+2 ;pointers for MOVLIN
sedeal *=*+2 ;
sedt1 *=*+1 ;SAVPOS
sedt2 *=*+1 ;
.unshare
*=.share
keysiz *=*+1 ;programmable key variables
keylen *=*+1 ;
keynum *=*+1 ;
keynxt *=*+1 ;
keybnk *=*+1 ;
keytmp *=*+1 ;
*=.share
bitmsk *=*+1 ;temporary for TAB & line wrap routines
saver *=*+1 ;yet another temporary place to save a register
*=.unshare
.page
; LOCAL screen editor variables (swapped-out when 40/80 MODE changes)
.swapbeg
pnt *=*+2 ;pointer to current line (text)
user *=*+2 ;pointer to current line (attribute)
scbot *=*+1 ;window lower limit
sctop *=*+1 ;window upper limit
sclf *=*+1 ;window left margin
scrt *=*+1 ;window right margin
lsxp *=*+1 ;current input column start
lstp *=*+1 ;current input line start
indx *=*+1 ;current input line end
tblx *=*+1 ;current cursor line
pntr *=*+1 ;current cursor column
lines *=*+1 ;maximum number of screen lines
columns *=*+1 ;maximum number of screen columns
datax *=*+1 ;current character to print
lstchr *=*+1 ;previous character printed (for <esc> test)
color *=*+1 ;current attribute to print (default fgnd color)
tcolor *=*+1 ;saved attribute to print ('insert' & 'delete')
rvs *=*+1 ;reverse mode flag
qtsw *=*+1 ;quote mode flag
insrt *=*+1 ;insert mode flag
insflg *=*+1 ;auto-insert mode flag
locks *=*+1 ;disables <c=><shift>, <ctrl>-S
scroll *=*+1 ;disables screen scroll, line linker
beeper *=*+1 ;disables <ctrl>-G
.swapend
; remaining ZERO PAGE to be reserved for application software
.applications_zp
* = $ff
.basic_reserved_zp
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; PAGE ONE declarations (processor STACK)
;
* = $0100
bad *=*+1 ;tape read errors (this area also used by basic)
; PAGE TWO declarations (input buffer & kernal RAM code)
;
* = $0200
buf *=*+161 ;input buffer (used by basic & monitor)
* = $02a2
fetch *=*+13 ;LDA(-),y from any bank
fetvec = fetch+8
stash *=*+15 ;STA(-),y to any bank
stavec = stash+10
cmpare *=*+15 ;CMP(-),y to any bank
cmpvec = cmpare+10
jsrfar *=*+22 ;JSR xxxx to any bank & return
jmpfar *=*+25 ;JMP xxxx to any bank
; NOTE: basic indirect vectors start at $2fc !!
; ***** ALL UNUSED RAM LOCATIONS BELOW $1300 ARE RESERVED *****
; ***** FOR SYSTEM USE AND MUST NOT BE USED BY APPLICATIONS *****
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; PAGE THREE declarations (indirect vectors, kernal tables, basic RAM code)
* = $02fc ;basic indirect vectors
* = $0314 ;kernal indirect vectors
iirq *=*+2 ;irq
ibrk *=*+2 ;brk
inmi *=*+2 ;nmi
iopen *=*+2 ;
iclose *=*+2 ; conforms to kernal spec 8/19/80
ichkin *=*+2
ickout *=*+2
iclrch *=*+2
ibasin *=*+2
ibsout *=*+2
istop *=*+2
igetin *=*+2
iclall *=*+2
exmon *=*+2 ;monitor command indirect
iload *=*+2
isave *=*+2
;editor indirect vectors
ctlvec *=*+2 ;editor: print 'contrl' indirect
shfvec *=*+2 ;editor: print 'shiftd' indirect
escvec *=*+2 ;editor: print 'escape' indirect
keyvec *=*+2 ;editor: keyscan logic indirect
keychk *=*+2 ;editor: store key indirect
decode *=*+12 ;vectors to keyboard matrix decode tables
* = $34a
keyd *=*+10 ;irq keyboard buffer
tabmap *=*+10 ;bitmap of tab stops
bitabl *=*+4 ;bitmap of line wraps
lat *=*+10 ;logical file numbers
fat *=*+10 ;primary device numbers
sat *=*+10 ;secondary addresses
* = $0380 ;basic ram code here
* = $03f0 ;basic/kernal dma request ram code
do_dma
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; PAGE FOUR & HIGHER declarations (****** beginning of bankable ram ******)
;
* = $0400 ;video matrix #1: vic 40-column text screen
vicscn *=*+1024
* = $0800 ;basic run-time stack (512 bytes)
; ABSOLUTE kernal variables
;
* = $0a00
system_vector *=*+2 ;vector to restart system (usually BASIC warm start)
dejavu *=*+1 ;kernal warm/cold initialization status byte
palnts *=*+1 ;pal/ntsc system flag
init_status *=*+1 ;flags reset vs. nmi status for initialization routines
memstr *=*+2 ;pointer to bottom of available memory in system bank
memsiz *=*+2 ;pointer to top of available memory in system bank
irqtmp *=*+2 ;tape handler preserves irq indirect here
caston *=*+1 ;tod sense during tape operations
kika26 *=*+1 ;tape read temporary
stupid *=*+1 ;tape read d1irq indicator
timout *=*+1 ;fast serial timeout flag
enabl *=*+1 ;rs-232 enables
m51ctr *=*+1 ;rs-232 control register
m51cdr *=*+1 ;rs-232 command register
m51ajb *=*+2 ;rs-232 user baud rate
rsstat *=*+1 ;rs-232 status register
bitnum *=*+1 ;rs-232 number of bits to send
baudof *=*+2 ;rs-232 baud rate full bit time (created by OPEN)
ridbe *=*+1 ;rs-232 input buffer index to end
ridbs *=*+1 ;rs-232 input buffer index to start
rodbs *=*+1 ;rs-232 output buffer index to start
rodbe *=*+1 ;rs-232 output buffer index to end
serial *=*+1 ;fast serial internal/external flag
timer *=*+3 ;decrementing jiffie register
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; GLOBAL ABSOLUTE screen editor declarations
xmax *=*+1 ;keyboard queue maximum size
pause *=*+1 ;<ctrl>-S flag
rptflg *=*+1 ;enable key repeats
kount *=*+1 ;delay between key repeats
delay *=*+1 ;delay before a key starts repeating
lstshf *=*+1 ;delay between <C=><shft> toggles
blnon *=*+1 ;vic cursor mode (blinking, solid)
blnsw *=*+1 ;vic cursor disable
blnct *=*+1 ;vic cursor blink counter
gdbln *=*+1 ;vic cursor character before blink
gdcol *=*+1 ;vic cursor color before blink
curmod *=*+1 ;vdc cursor mode (when enabled)
vm1 *=*+1 ;vic text screen/character base pointer
vm2 *=*+1 ;vic bit-map base pointer
vm3 *=*+1 ;vdc text screen base
vm4 *=*+1 ;vdc attribute base
lintmp *=*+1 ;temporary pointer to last line for LOOP4
sav80a *=*+1 ;temporary for 80-col routines
sav80b *=*+1 ;temporary for 80-col routines
curcol *=*+1 ;vdc cursor color before blink
split *=*+1 ;vic split screen raster value
fnadrx *=*+1 ;save .x during bank operations
palcnt *=*+1 ;counter for pal systems (jiffie adjustment)
speed *=*+1 ;save system speed during tape & serial bus ops
sprites *=*+1 ;save sprite enables during tape & serial bus ops
blanking *=*+1 ;save blanking status during tape ops
hold_off *=*+1 ;flag set by user wanting full control of vic reserved
ldtb1_sa *=*+1 ;high byte of sa of vic screen (use with vm1 to move screen)
clr_ea_lo *=*+1 ;????? 8563 block fill kludge
clr_ea_hi *=*+1 ;????? 8563 block fill kludge
.page
; LOCAL screen editor variable swap area
;
* = $0a40
.swapout ;local variables
* = $0a60
.swapmap ;local tab map & wrap tables
; MONITOR absolute declarations
;
* = $0a80
.monitor_abs
; FUNCTION KEY ROM CARD tables
;
* = $0ac0
curbnk *=*+1 ;current function key rom bank being polled
pat *=*+4 ;physical address table (id's of logged-in cards)
dk_flag *=*+1 ;reserved for foreign screen editors
; ***** ALL UNUSED RAM LOCATIONS BELOW $1300 ARE RESERVED *****
; ***** FOR SYSTEM USE AND MUST NOT BE USED BY APPLICATIONS *****
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
* = $0b00
bufsz =192 ;tape buffer size
tbuffr *=*+bufsz ;cassette buffer
* = $0c00 ;rs-232 input buffer
rs232i
* = $0d00 ;rs-232 output buffer
rs232o
* = $0e00 ;sprite definition area (must be below $1000 !!)
* = $1000 ;programmable function key definitions
pkynum =10 ;number of definable keys (f1-f8, <shft>run, help)
pkybuf *=*+pkynum ;programmable function key lengths table
pkydef *=*+256-pkynum ;programmable function key strings
* = $1100 ;cp/m reset code, basic dos & vsp variables
* = $1200 ;basic absolute variables
* = $1300 ;unallocated absolute ram
.applications_abs
* = $1800 ;reserved for function key software applications
* = $1c00 ;video matrix #2 (1KB, bitmap color, if allocated)
rambot ;basic text starts here (kernal sets 'membot' here)
* = $2000 ;vic bitmap (8KB, if allocated)
* = $4000 ;************** beginning of rom over ram *************
* = $fc80 ;foreign language reserved rom (thru $feff)
.foreign_rom
* = $ff05 ;kernal interrupt ram code here (all ram banks)
* = $ffd0 ;cp/m transfer-processor-control ram code here (first ram bank only)
.cpm_ram_code
* = $fff5 ;'CBM' key goes here in ram1
locker
* = $fffa ;kernal hardware interrupt ram vectors here (all ram banks)
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;//////////////////// I / O D E V I C E M A P S \\\\\\\\\\\\\\\\\\\
vicchr = $d000 ;vic character rom
vicreg = $d000 ;vic registers
sidreg = $d400 ;sid registers
mmu_lo = $d500 ;mmu primary registers
vdc = $d600 ;8563 registers
viccol = $d800 ;vic color nybbles
cia1 = $dc00 ;6526 #1
cia2 = $dd00 ;6526 #2
io1 = $de00 ;expansion i/o slot (reserved)
io2 = $df00 ;expansion i/o slot (reserved: optional DMA ctlr for expansion ram)
mmu_hi = $ff00 ;mmu secondary registers (*** not in i/o block! ***)
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; c/128 memory management unit
; implements c/128, c/64, & cp/m 3.0 modes
;
* = mmu_lo
mmucrl *=*+1 ;configuration register (primary)
pcra *=*+1 ;preconfiguration register a
pcrb *=*+1 ;preconfiguration register b
pcrc *=*+1 ;preconfiguration register c
pcrd *=*+1 ;preconfiguration register d
mmumcr *=*+1 ;mode configuration register
mmurcr *=*+1 ;ram configuration register
mmup0l *=*+1 ;page 0 pointer low
mmup0h *=*+1 ;page 0 pointer high
mmup1l *=*+1 ;page 1 pointer low
mmup1h *=*+1 ;page 1 pointer high
mmuver *=*+1 ;mmu version number (*** prototype: reset latch ***)
* = mmu_hi
mmucr *=*+1 ;configuration register (secondary)
lcra *=*+1 ;load configuration register a
lcrb *=*+1 ;load configuration register b
lcrc *=*+1 ;load configuration register c
lcrd *=*+1 ;load configuration register d
; c/128 80-column video display controller
;
* = vdc
vdcadr *=*+1 ;8563 address register
vdcdat *=*+1 ;8563 data register
vdcscn = $0000 ;8563 80-column screen (2KB)
vdccol = $0800 ;8563 attribute area (2KB)
vdcchr = $2000 ;8563 character ram (4KB: 256 chrs, 8x16)
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; 6526 cia complex interface adapter #1
; keyboard / joystick / paddles / lightpen / fast disk
;
; pra0 : keybd output c0 / joystick #1 direction
; pra1 : keybd output c1 / joystick #1 direction
; pra2 : keybd output c2 / joystick #1 direction / paddle fire button
; pra3 : keybd output c3 / joystick #1 direction / paddle fire button
; pra4 : keybd output c4 / joystick #1 fire button
; pra5 : keybd output c5 /
; pra6 : keybd output c6 / / select port #1 paddles
; pra7 : keybd output c7 / / select port #2 paddles
;
; prb0 : keybd input r0 / joystick #2 direction /
; prb1 : keybd input r1 / joystick #2 direction / paddle fire button
; prb2 : keybd input r2 / joystick #2 direction / paddle fire button
; prb3 : keybd input r3 / joystick #2 direction /
; prb4 : keybd input r4 / joystick #2 fire button
; prb5 : keybd input r5 /
; prb6 : keybd input r6 / timer b: toggle/pulse output
; prb7 : keybd input r7 / timer a: toggle/pulse output
;
; timer 1 & cra : fast disk
; timer 2 & crb : cassette
;
; tod :
; sdr :
; icr :
* = cia1 ;device #1: 6526
colm
d1pra *=*+1 ;keyboard outputs / joystick / paddles / lightpen
rows
d1prb *=*+1 ;keyboard inputs / joystick / paddles
d1ddra *=*+1
d1ddrb *=*+1
d1t1l *=*+1
d1t1h *=*+1
d1t2l *=*+1
d1t2h *=*+1
d1tod1 *=*+1
d1tods *=*+1
d1todm *=*+1
d1todh *=*+1
d1sdr *=*+1
d1icr *=*+1
d1cra *=*+1
d1crb *=*+1
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; 6526 cia complex interface adapter #2
; user port / rs232 / serial bus / vic memory / nmi
;
; pra0 : va14
; pra1 : va15
; pra2 : rs232 DATA output
; pra3 : serial ATN output
; pra4 : serial CLK output
; pra5 : serial DATA output
; pra6 : serial CLK input
; pra7 : serial DATA input
;
; prb0 : user port / rs232 received data
; prb1 : user port / rs232 request to send
; prb2 : user port / rs232 data terminal ready
; prb3 : user port / rs232 ring indicator
; prb4 : user port / rs232 carrier detect
; prb5 : user port
; prb6 : user port / rs232 clear to send
; prb7 : user port / rs232 data set ready
;
; timer 1 & cra : rs232 baud rate
; timer 2 & crb : rs232 bit check
;
; tod :
; sdr :
; icr : nmi (/irq)
* = cia2 ;device #2: 6526
d2pra *=*+1 ;serial bus / rs232 / va14,15
d2prb *=*+1 ;user port / rs232
d2ddra *=*+1
d2ddrb *=*+1
d2t1l *=*+1
d2t1h *=*+1
d2t2l *=*+1
d2t2h *=*+1
d2tod1 *=*+1
d2tods *=*+1
d2todm *=*+1
d2todh *=*+1
d2sdr *=*+1
d2icr *=*+1 ;nmi's
d2cra *=*+1
d2crb *=*+1
timrb = $19 ;6526 crb enable one-shot tb
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; c/128 DMA controller for expansion RAM access (***PRELIMINARY***)
;
; (optional device mapped into IO2 block via system Expansion Port)
;
* = io2
dma_st *=*+1 ;DMA controller status register
dma_cmd *=*+1 ;DMA controller command register
dma_adl *=*+1 ;lsb of internal (c128) address to access
dma_adh *=*+1 ;msb of internal (c128) address to access
dma_lo *=*+1 ;lsb of external expansion ram to access
dma_hi *=*+1 ;msb of external expansion ram to access
dma_bnk *=*+1 ;64K external ram bank
dma_dal *=*+1 ;lsb of byte count
dma_dah *=*+1 ;msb of byte count (block count)
dma_sum *=*+1 ;checksum of last data transfer ????????????
dma_ver *=*+1 ;DMA version & memory limits
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; MISCELLANEOUS KERNAL & EDITOR EQUATES
eot =5 ;end of tape
blf =1 ;basic load file
bdf =2 ;basic data file
plf =3 ;fixed program type
bdfh =4 ;basic data file header
bakcol =11 ;VIC background screen color
forcol =13 ;VIC foreground screen color
bodcol =13 ;VIC screen border color
lf =10 ;line feed
cr =13 ;carriage return
esc =27 ;escape
space =32 ;space
quote =34 ;dbl quote
sysbnk = %00000000 ;mmu configuration: ram0, system roms, i/o
; configurations per 'config' table:
ram0 = 0 ;ram0, no roms, no i/o
ram1 = 1 ;ram1, no roms, no i/o
romram0 = 15 ;ram0, system roms, i/o (corresponds to 'sysbnk')
;.end

298
EDITOR_C128_NATIONAL/denmark.src

@ -0,0 +1,298 @@
.nam C/128 DENMARK NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $07 ;DENMARK p/n 325174-03 04/08/87 F.Bowen
checksum= $ff ;character ROM checksum
chr_sig = $fd02 ;character ROM signature
rom_sig = $9611 ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * **** ***** * * * * * **** * * *
; * * * * ** * ** ** * * * * * * *
; * * * *** * * * * ** * ***** **** *** *
; * * * * * ** * * * * * * * * *
; * **** ***** * * * * * * * * * * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 DENMARK KEYBOARD DRIVER (01/14/86)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl DENMARK NATIONAL KEYBOARD TABLES
nat_mode1 ;unshifted keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11,$33,$57,$41,$34,$5a,$53,$45,$01
.byte $35,$52,$44,$36,$43,$46,$54,$58,$37,$59,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e,$2b,$50,$4c,$2d,$2e,$5b,$5d,$2c
.byte $3a,$2a,$5c,$13,$01,$3b,$5e,$2f,$31,$5f,$04,$32,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_mode2 ;shifted keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b
.byte $91,$23,$d7,$c1,$24,$da,$d3,$c5,$01,$25,$d2,$c4,$26,$c3,$c6,$d4
.byte $d8,$27,$d9,$c7,$28,$c2,$c8,$d5,$d6,$29,$c9,$ca,$40,$cd,$cb,$cf
.byte $ce,$db,$d0,$cc,$3d,$3e,$db,$dd,$3c,$a9,$c0,$dc,$93,$01,$3b,$de
.byte $3f,$21,$5f,$04,$22,$a0,$02,$d1,$83,$84,$38,$35,$18,$32,$34,$37
.byte $31,$1b,$2b,$2d,$0a,$8d,$36,$39,$33,$08,$30,$2e,$91,$11,$9d,$1d
.byte $ff,$ff
nat_mode3 ;C= keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91,$96,$b3,$b0,$97,$ad,$ae
.byte $b1,$01,$98,$b2,$ac,$99,$bc,$bb,$a3,$bd,$9a,$b7,$a5,$9b,$bf,$b4
.byte $b8,$be,$29,$a2,$b5,$40,$a7,$a1,$b9,$aa,$a6,$af,$b6,$dc,$3e,$db
.byte $a4,$3c,$a8,$df,$dc,$93,$01,$3b,$de,$3f,$81,$5f,$04,$95,$a0,$02
.byte $ab,$03,$84,$38,$35,$18,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$8d,$36
.byte $39,$33,$08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ff,$ff,$ff,$ff,$ff ;dead keys (none)
deadp .byte $ff,$ff,$ff,$ff,$ff,$ff ;pointers to 'build' keys
oldead .byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;new key tables
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff,$ff,$ff
nwdead .byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;substitute key tables
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl DENMARK EDITOR CROSS REFERENCE
.end

658
EDITOR_C128_NATIONAL/ed1.src

@ -0,0 +1,658 @@
.page
.subttl ed1 editor initialization & I/O routines (NATIONAL)
;//////////////// E D I T O R J U M P T A B L E \\\\\\\\\\\\\\\\\
jmp cint ;initialize editor & screen
jmp disply ;display character in .a, color in .x
jmp lp2 ;get a key from irq buffer into .a
jmp loop5 ;get a chr from screen line into .a
jmp print ;print character in .a
jmp scrorg ;get size of current window (rows,cols) in .x, .y
jmp nat_scnkey ;scan keyboard subroutine (NATIONAL)
jmp repeat ;repeat key logic & 'ckit2' to store decoded key
jmp plot ;read or set (.c) cursor position in .x, .y
jmp cursor ;move 8563 cursor subroutine
jmp escape ;execute escape function using chr in .a
jmp keyset ;redefine a programmable function key
jmp irq ;irq entry
jmp init80 ;initialize 80-column character set
jmp swapper ;swap editor local variables (40/80 mode change)
jmp window ;set top left or bottom right (.c) of window
.spare .byte $ff,$ff,$ff
.page
length = 40
linz0 = vicscn ;40 column screen lines
linz1 = linz0+length
linz2 = linz1+length
linz3 = linz2+length
linz4 = linz3+length
linz5 = linz4+length
linz6 = linz5+length
linz7 = linz6+length
linz8 = linz7+length
linz9 = linz8+length
linz10 = linz9+length
linz11 = linz10+length
linz12 = linz11+length
linz13 = linz12+length
linz14 = linz13+length
linz15 = linz14+length
linz16 = linz15+length
linz17 = linz16+length
linz18 = linz17+length
linz19 = linz18+length
linz20 = linz19+length
linz21 = linz20+length
linz22 = linz21+length
linz23 = linz22+length
linz24 = linz23+length
.page
ldtb2 ;screen lines low byte table
.byte <linz0
.byte <linz1
.byte <linz2
.byte <linz3
.byte <linz4
.byte <linz5
.byte <linz6
.byte <linz7
.byte <linz8
.byte <linz9
.byte <linz10
.byte <linz11
.byte <linz12
.byte <linz13
.byte <linz14
.byte <linz15
.byte <linz16
.byte <linz17
.byte <linz18
.byte <linz19
.byte <linz20
.byte <linz21
.byte <linz22
.byte <linz23
.byte <linz24
ldtb1 ;screen lines high byte table
.byte >linz0
.byte >linz1
.byte >linz2
.byte >linz3
.byte >linz4
.byte >linz5
.byte >linz6
.byte >linz7
.byte >linz8
.byte >linz9
.byte >linz10
.byte >linz11
.byte >linz12
.byte >linz13
.byte >linz14
.byte >linz15
.byte >linz16
.byte >linz17
.byte >linz18
.byte >linz19
.byte >linz20
.byte >linz21
.byte >linz22
.byte >linz23
.byte >linz24
.page
vectss .word contrl ;print <ctrl> indirect
.word shiftd ;print <shft> indirect
.word escape ;print <esc> indirect
.word keylog ;keyscan logic indirect
.word keyput ;key buffer indirect
vectse
keycod .word mode1 ;decode matrix for normal keys
.word mode2 ;decode matrix for shifted keys (right keycap legends)
.word mode3 ;decode matrix for C= keys (left keycap legends)
.word mode4 ;decode matrix for control keys
.word mode1 ;decode matrix for alt keys (none- default to norm)
.word mode5 ;decode matrix for caps lock
keyend
.page
;////// S C R E E N & E D I T O R I N I T I A L I Z A T I O N \\\\\\
cint lda #$03
ora d2pra ;set vic bank
sta d2pra
lda #$fb
and r6510 ;turn on character rom
ora #$02 ;point vic to text nybble bank
sta r6510
jsr _clrch ;restore default input/output devices
; initialize editor GLOBAL variables
lda #0
jsr nat_init ;patch for NATIONAL keyboard init & SID volume
sta graphm ;set display to full text mode
sta mode ;set display to 40-column vic mode
sta ndx ;clear keyboard queue
sta kyndx ;clear function key index
sta crsw ;clear <cr> flag
sta pause ;clear <ctl>-S flag
sta blnon ;reset vic cursor status
sta charen ;reset vic character fetch to rom
sta vm3 ;8563 text area
lda #$14
sta vm1 ;vic text/character area
lda #$78
sta vm2 ;vic graphic area
lda #>vdccol
sta vm4 ;8563 attribute area
lda ldtb1
sta ldtb1_sa ;default high byte of vic screen lines
lda #10
sta xmax ;set maximum keyboard buffer size
sta blnct ;reset vic cursor blink count
sta blnsw ;start vic cursor blinking
sta delay ;reset delay before a key repeats
lda #4
sta kount ;reset delay between key repeats
jsr taball ;set default tab stops
sta rptflg ;enable key repeats (all keys, .a=$80)
ora mmumcr
sta mmumcr ;enable 40/80 key sense
lda #$60
sta curmod ;reset vdc cursor mode
lda #$d0
sta split ;set split screen division 5 lines up from bottom
.page
; initialize editor LOCAL variables
ldx #localabs-localzp
1$ lda localzp,x
sta .swapbeg,x ;init 40-column vic mode locals
lda localabs,x
sta .swapout,x ;init 80-column 8563 mode locals
dex
bpl 1$
ldx #vectse-vectss-1
3$ lda vectss,x
sta ctlvec,x ;initialize editor indirect vectors
dex
bpl 3$
bit init_status ;skip if nmi or user call
bvs 6$
jsr ascii_din ;NATIONAL: scan ASCII/DIN key & set shflag
lda #0
sta decode+1 ;NATIONAL: force next call to load key decode tables
jsr nat_scnkey ;NATIONAL: download character set per ASCII/DIN key
ldx #pkyend-pkytbl-1
5$ lda pkytbl,x ;initialize programmable key definitions
sta pkybuf,x
dex
bpl 5$
lda #$40 ;flag installation
ora init_status
sta init_status
6$ jsr swapper ;swap in 80-col vars
jsr taball ;initialize 80-col tab stops
jsr sreset ;clear 80-col wrap table
jsr clsr ;clear 80-col text screen
jsr swapper ;swap in 40-col vars
jsr sreset ;clear 40-col wrap table
jsr clsr ;clear 40-col text screen
bit mmumcr ;test 40/80 key & stay in that mode
bmi 10$ ;...branch if 40 (vic) mode (current mode)
jsr swapper ;swap in 80-col mode
10$ rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
clsr ;clear the current screen window
jsr home ;start at top of window
1$ jsr scrset ;point to a line
jsr clrln ;clear the line
cpx scbot ;done if it's the last line in the window
inx
bcc 1$
home ldx sctop ;put the cursor at top left of current window
stx tblx ;move to top of window
stx lsxp ; (for input after home or clear)
stu10 ldy sclf ;////// entry from insert/delete line routines
sty pntr ;move to left side of window
sty lstp
stupt ;////// entry to set pointers to beginning of current line
ldx tblx ;.x now points to beginning of line
scrset lda ldtb2,x ;generate pointers to current screen line
bit mode ; (double table values for 80-col mode)
bpl 10$
asl a
10$ sta pnt ;'pnt' points to screen ram
lda ldtb1,x
and #$03
bit mode
bpl 20$
rol a
ora vm3
bcc 30$ ;always
20$ ora ldtb1_sa
30$ sta pnt+1
scolor lda pnt
sta user ;'user' points to color ram
lda pnt+1
bit mode ; (different base adr for 80-col)
bpl 1$
and #$07
ora vm4
bne 2$
1$ and #$03
ora #>viccol
2$ sta user+1
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;///////////////// E D I T O R I R Q R O U T I N E S \\\\\\\\\\\\\\\\\\
irq
sec
lda vicreg+25 ;is this a vic raster irq?
and #$01
beq 10$ ;...branch if not (just rts with .c=1)
sta vicreg+25 ;clear the raster interrupt bit
lda graphm ;is user controlling vic?
cmp #$ff
10$ beq irqrts ;...branch if so (rts with .c=1)
bit vicreg+17 ;assume 'middle' irq (note .c=0 here)
bmi 20$ ;...branch if not
and #$40 ;make real sure it's a split screen (serial ops may have held irq off)
bne text ;...branch if somewhere in middle of a split screen
20$ sec ;flag 'base' irq
lda graphm ;what will the next frame be?
beq text ;...branch if all text
bit graphm
bvc 30$ ;...branch if not a split screen
lda split
sta vicreg+18 ;split screen: make next irq occur in 'middle' of frame
; set up for a graphic frame
30$ lda r6510
and #$fd ;point vic to graphic (mcm) nybble bank
ora #$04 ;turn off character rom
pha
lda vm2 ;point vic to graphic area
pha
lda vicreg+17 ;turn on bit map mode
and #$7f ; (keep RC8 clear!)
ora #$20
tay
lda vicreg+22 ;turn on/off multicolor mode
bit graphm
bmi 40$
and #$ef ;off
.byte $2c
40$ ora #$10 ;on
tax
bne doit ;always
.page
; set up for a text frame
text lda #$ff ;make next irq occur at 'base' of this or next frame
sta vicreg+18
lda r6510
ora #$02 ;point vic to text nybble bank
and #$fb ;turn on character rom (if enabled)
ora charen
pha
lda vm1 ;point vic to text area
pha
lda vicreg+17 ;turn off bit map mode
and #$5f ; (keep RC8 clear!)
tay
lda vicreg+22 ;turn off multicolor mode
and #$ef
tax
bcs doit ;...branch if at 'base' (not a split screen)
ldx #7
1$ dex
bne 1$ ;delay for clean switchover
nop
nop
tax
; install all precomputed values before vic prefetch of next visible line
doit
pla
sta vicreg+24 ;set vm
pla
sta r6510 ;set charrom + vic nybble bank
sty vicreg+17 ;set bit map mode
stx vicreg+22 ;set muticolor mode
irqrts bcs 10$ ;kludge for 2MHz mode split screen:
lda vicreg+48 ;...in 2MHz mode, RC8=0 always due to faster code
and #$01 ;...and hence skips keyscan, etc.
beq 10$ ;...branch if 1MHz mode
lda graphm
and #$40
beq 10$ ;...branch if not split scren
lda vicreg+17
bpl 10$ ;...branch if raster still not at bottom
sec ;ah-ha! this has to be the 'bottom' irq of a split screen
10$ cli ;allow interruptable keyscan
bcc 20$ ;done if 'middle' irq
jsr nat_scnkey ;do general keyboard scan (NATIONAL)
jsr blink ;blink vic cursor
sec ;tell kernal this was the 60hz irq
20$ rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;/////////////// E D I T O R I N P U T R O U T I N E S \\\\\\\\\\\\\\\\
lp2 ;fetch a character from irq key buffer
ldx kyndx ;check for function key strings first
beq 1$ ;...branch if none
ldy keyidx ;get index to current character in key string
lda pkydef,y ;get the character
dec kyndx ;one less character in string
inc keyidx ;index to next character
cli
clc ;always a good return from keyboard
rts
1$
ldy keyd ;get a key from irq buffer (.x=0 from 'lp2')
2$
lda keyd+1,x ;push down buffer contents
sta keyd,x
inx
cpx ndx
bne 2$
dec ndx ;one less key in buffer
tya ;return character in .a
cli
clc ;always a good return from keyboard
rts
loop4 ;fetch characters & display them until <cr>
jsr print ;print the character in .a
waitky jsr crsron ;enable cursor
1$ lda ndx ;wait here for any buffered keystroke
ora kyndx ; (or function key)
beq 1$
jsr crsrof ;disable cursor
jsr lp2 ;get the key from irq key buffer
cmp #cr ;return key?
bne loop4 ;no- buffer to screen until <cr>
sta crsw ;set flag to pass characters from screen
lda #0
sta qtsw ;clear quote mode
jsr fndend ;find last non-blank character in line
stx lintmp ;save last row id ('indx' = last column)
jsr fistrt ;find beginning row of this line
ldy sclf ;assume first character is at left margin
lda lsxp ;input actually began on this row
bmi 4$ ;...branch if it's on a wrapped line
cmp tblx ;is cursor still on this row?
bcc 4$ ;...branch if it's below this row
ldy lstp ;input actually began in this column
cmp lintmp ;does input begin & end on same row?
bne 2$ ;...branch if not
cpy indx ;does input begin & end in same column?
beq 3$ ;...branch if same
2$ bcs clp2 ;...branch if null input
3$ sta tblx ;start input from this row
4$ sty pntr ;start input from this column
jmp lop5 ;go pass characters
loop5 ;///// entry for kernal 'basin' routine \\\\\
tya
pha ; (save current cursor position)
txa
pha
lda crsw ;pass characters? (ie: input device = screen)
beq waitky ;no- buffer (ie: input device = keyboard)
bpl lop5 ;yes- if there're any to pass
clp2
lda #0 ;clear flag- i/o is finished
sta crsw
lda #cr
ldx #3 ;kludge for OPEN4,4 / CMD4 / LIST delemma
cpx dfltn
beq 1$ ;input is from the screen
cpx dflto
beq 2$ ;output is to the screen
1$ jsr print ;force a <cr>
2$ lda #cr ;pass a return as the last character
bne clp7 ;always
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
lop5
jsr stupt ;set 'pnt' and 'user' to beginning of line
jsr get1ch ;get a screen character
sta datax
and #$3f ;convert chr from screen codes...
asl datax
bit datax
bpl 1$ ;...branch if not alt. character set
ora #$80
1$
bcc 2$ ;...branch if not rvs fld character
ldx qtsw
bne 3$
2$
bvs 3$ ;...branch if not shifted character
ora #$40
3$
jsr qtswc ;...toggle quote mode if quote chr
ldy tblx ;check for last non-blank character
cpy lintmp
bcc 4$ ;...branch if not on last input line
ldy pntr
cpy indx
bcc 4$ ;...branch if not on last input column
ror crsw ;make >0 (.c=1) to fake <cr>: this is the last chr
bmi 5$ ;always
4$
jsr nxtchr ;move 'pntr' to next character
5$
cmp #$de ;a pi ?
bne clp7 ;no
lda #$ff ;translate it to true cbm pi
clp7
sta datax
pla ; (restore cursor position for 'basin')
tax
pla
tay
lda datax ;pass character in .a
clc ;always a good return from screen or keyboard
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
qtswc
cmp #quote ;test for quote character
bne 1$ ;it's not
lda qtsw
eor #$01 ;toggle quote flag
sta qtsw
lda #quote
1$ rts
loop2 ;///////////// 'print' exits here \\\\\\\\\\\\\\
lda datax
sta lstchr ;save in case it's <escape> or <home> for next test
jsr cursor ;move cursor ahead of output
lda insrt
beq 1$
lsr qtsw ;clear quote mode in case quote was hit in insert mode
1$
pla ;restore all registers
tay
pla
tax
pla
clc ;good
rts ;will return to 'loop2'
nxt33 ;various entries from 'print' to output a character
ora #$40
nxt3
ldx rvs ;in rvs mode?
beq nvs ;no
nc3
ora #$80
nvs
ldx insrt ;in insert mode?
beq 1$ ;no
dec insrt ;yes- decrement insert field count
1$
bit insflg ;in auto insert mode?
bpl 2$ ;no
pha ;yes- save the character to insert
jsr insert ;make room for it
ldx #0
stx insrt ;disallow the other insert mode
pla
2$
jsr displc ;display chr & fall thru to 'movchr' (will return to 'loop2')
; cpy #69
; bne movchr
; jsr beep ;ring bell (if enabled) to flag right margin
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; movchr - move to next character position &
; insert blank line if at end of line
; entry: .y = column position
; exit: .c=1 if aborted (scroll disabled)
movchr
cpy scrt
bcc 1$ ;easy if not at end of line
ldx tblx
cpx scbot
bcc 1$ ;...skip if not last line of screen
bit scroll
bmi 3$ ;...abort if scrolling disabled
1$ jsr stupt ;set up 'pnt' and 'user' vectors
jsr nxtchr ;move to next char position
bcc 3$ ;...done if not move to new line
jsr getbit ;check if on a continued line
bcs 2$ ;...skip ahead if not
sec ;in case we abort
bit scroll
bvs 3$
jsr scrdwn ;else insert a blank line
2$ clc ;for clean exit
3$ rts
; skip to next line (wrap to top if scroll disabled)
nxln
ldx tblx
cpx scbot ;of the bottom of window ?
bcc 2$ ;no
bit scroll ;what if scrolling is disabled?
bpl 1$ ;branch if scroll is enabled
lda sctop ;wrap to top
sta tblx
bcs 3$ ;always
1$ jsr scrup ;scroll it all
clc ;indicate scroll ok
2$ inc tblx
3$ jmp stupt ;set pointers to beginning of new line
;.end

298
EDITOR_C128_NATIONAL/ed2.src

@ -0,0 +1,298 @@
.page
.subttl ed2 scroll routines (05/06/85)
;/////////////// S C R O L L R O U T I N E S \\\\\\\\\\\\\\\\\\
scrdwn ;///////// scroll down \\\\\\\\\
ldx lsxp
bmi 1$ ;skip if new line flag already set
cpx tblx
bcc 1$ ;skip if old line is below scroll area
inc lsxp ;else inc start line number
1$
ldx scbot ;scroll down, start bottom
2$
jsr scrset ;set 'pnt' to line
ldy sclf
cpx tblx ;test if at destination line
beq 3$ ;...done if yes
dex ;point to previous line as source
jsr getbt1
inx
jsr putbt1 ;move continuation byte
dex
jsr movlin ;move one line
jmp 2$
3$
jsr clrln ;set line to blanks
jmp setbit ;mark as continuation line
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
scrup ;//////////// scroll up \\\\\\\\\\\\\\\
ldx sctop
1$ inx
jsr getbt1 ;find first non-continued line
bcc scru15
cpx scbot
bcc 1$
ldx sctop
inx
jsr clrbit ;clear to only scroll 1 line
scru15 ;////// entry from 'dline'
dec tblx
bit lsxp
bmi 2$ ;no change if already new line
dec lsxp ;move input up one
2$ ldx sctop
cpx sedt2
bcs 3$
dec sedt2 ;in case doing insert
3$ jsr scr10 ;scroll
ldx sctop
jsr getbt1
php
jsr clrbit ;make sure top line is not continuation
plp
bcc 4$ ;done if top line off
bit scroll ;logical scroll?
bmi scrup ;no - keep scrolling
4$ rts
scr10 jsr scrset
ldy sclf
cpx scbot ;at last line?
bcs 5$ ;yes
inx ;point to next line
jsr getbt1
dex
jsr putbt1 ;move continuation byte
inx
jsr movlin ;move one line
jmp scr10
5$ jsr clrln ;make last line blank
lda #$7f
sta colm
lda rows ;scan keyboard
cmp #$df ;check for slow-scroll key (C=)
bne slorts ;...branch if not
.page
ldy #0
slowmo
nop ;delay
dex
bne slowmo
dey
bne slowmo
slorts
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
movlin ;///// move line in .x to 'pnt' (color to 'user')
bit mode
bmi movl80 ;...branch if 8563 device
lda ldtb2,x
sta sedeal ;set up source pointers
sta sedsal
lda ldtb1,x
and #$03
ora ldtb1_sa
sta sedsal+1
and #$03
ora #>viccol
sta sedeal+1
1$ lda (sedsal),y ;move character byte
sta (pnt),y
lda (sedeal),y ;move color byte
sta (user),y
cpy scrt ;done a whole line?
iny
bcc 1$ ;no
rts
.page
movl80 ;copy 8563 line in current window...
stx sav80a ;save line pointer
sty sav80b ;save colm pointer (left window margin)
ldx #24
jsr vdcin
ora #$80 ;set 'copy' bit
jsr vdcout
jsr getpnt ;setup 8563 destination address to PNT + .Y
ldx sav80a ;calculate absolute source = 2*(line tbls,x) + colm ptr
lda ldtb2,x
asl a
sta sedsal ; (2*(line tbls,x))
lda ldtb1,x
and #$03
rol a
ora vm3
sta sedsal+1
ldx #32
clc
tya ;column pointer
adc sedsal
sta sedsal ;save source lo
lda #0
adc sedsal+1
sta sedsal+1
jsr vdcout ;source hi
inx
lda sedsal
jsr vdcout ;source lo
sec
ldx scrt ;calculate # bytes to move = right margin - colm ptr + 1
inx
txa
sbc sav80b
sta sav80b ;save byte count
ldx #30
jsr vdcout ;copy characters
ldx #32 ;now move attributes...
lda sedsal+1 ;source hi
and #$07
ora vm4 ;make text pointer into an attribute pointer
jsr vdcout
inx
lda sedsal ;source lo
jsr vdcout
jsr getusr ;setup 8563 destination address to USER + .Y
lda sav80b ;byte count
ldx #30
jsr vdcout ;copy attributes
ldx sav80a ;restore .x
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
clrln ;///// enter here to clear entire line in .x
ldy sclf
jsr clrbit ;make sure non-continued line
clrprt ;///// enter here to clear line in .x starting at .y
jsr scrset
bit mode
bmi clrl80 ;...branch if 8563 device
dey
1$
iny
lda #space
sta (pnt),y ;print space
lda color
sta (user),y ;update color ram
cpy scrt
bne 1$
rts
clrl80 ;blank (fill) line in current window...
stx sav80a ;save line pointer
sty sav80b ;save colm pointer
ldx #24
jsr vdcin
and #$7f ;set 'fill' bit
jsr vdcout
ldx #18 ;calculate absolute destination = PNT + colm ptr
clc
tya ;column pointer
adc pnt
pha
sta clr_ea_lo ;????? kludge ????????????????????????????????????????
lda #0
adc pnt+1
sta clr_ea_hi ;????? kludge ????????????????????????????????????????
jsr vdcout ;destination hi
inx
pla
jsr vdcout ;destination lo
lda #space ;character fill data
jsr vdcput
sec
lda scrt ;calculate # bytes to fill = right margin - colm ptr
sbc sav80b
pha ; (save byte count for attribute fill)
beq 10$ ;...branch if done- only one column
tax ;????? save byte count
sec ;????? add: sa + byte count + 1 = ea
adc clr_ea_lo ;?????
sta clr_ea_lo ;?????
lda #0 ;?????
adc clr_ea_hi ;?????
sta clr_ea_hi ;?????
txa ;?????
jsr clr_kludge ;????? do block fill
10$ ldx #18 ;now fill attributes
clc
tya ;column pointer
adc user
pha
lda #0
adc user+1
jsr vdcout ;destination hi
inx
pla
jsr vdcout ;destination lo
lda clr_ea_hi ;????? adjust ea for attribute area
and #$07 ;?????
ora vm4 ;?????
sta clr_ea_hi ;?????
lda color ;color fill data
and #$8f ;strip off rvs, flash & underline attributes
jsr vdcput
pla ;recall byte count
beq 20$ ;...branch if done- only one column
jsr clr_kludge ;send byte count
20$ ldx sav80a ;return registers as we did with 40-col fill
ldy scrt
rts
; The following crap is necessary thanks to our brilliant engineering
; team, creators of the finest semi-functional devices ever made!
clr_kludge_1
lda #1 ;????? byte count for kludge loop
clr_kludge
ldx #30
jsr vdcout ;send byte count (actual fill starts now)
10$ bit vdcadr ;????? wait if 8563 busy
bpl 10$ ;?????
ldx #18 ;?????
jsr vdcin ;????? compare msb's: they should match
cmp clr_ea_hi ;?????
bcc clr_kludge_1 ;????? nope- do again by 1 until they match
ldx #19 ;?????
jsr vdcin ;????? compare lsb's: they should match
cmp clr_ea_lo ;?????
bcc clr_kludge_1 ;????? nope- do again by 1 until they match
rts ;?????
;.end

301
EDITOR_C128_NATIONAL/ed3.src

@ -0,0 +1,301 @@
.page
.subttl ed3 irq keyscan & cursor blink routines (NATIONAL)
;///////////////// K E Y B O A R D S C A N \\\\\\\\\\\\\\\\\\\
scnkey ;scan the keyboard
lda r6510 ;first check is for 'caps lock' key
and #$40
eor #$40 ;invert sense so '1' means key is down
lsr a
lsr a
sta shflag ;initializes shift key status
ldy #88 ;initialize key counter
sty sfdx ;assume no keys (88=index to null ($ff) key in table)
lda #0
sta colm ;raise all key lines
sta vicreg+47
ldx rows ;quick check for any key down in matrix
cpx #$ff
bne 1$ ;...branch if anything depressed
jmp ckit2 ;nothing- skip 'way ahead (restore 'colm' @'ckit2')
1$ tay ;(.a=0->.y) init key counter
lda decode
sta keytab ;assume mode #1 (normal keys)
lda decode+1
sta keytab+1
lda #$ff
sta vicreg+47
rol a ;start with 1st column (.a=$fe)
2$ bit shflag ;msb set means we are scanning extended key lines
bmi 3$ ;...branch if so
sta colm
bpl 4$
3$ sta vicreg+47 ;raise one column
4$ ldx #8 ;scan 8 rows each column
pha ;preserve column output configuration
5$ lda rows ;scan the row
cmp rows ;debounce the keyboard
bne 5$
6$ lsr a ;look for a key down
bcs 9$ ;...branch if not this key
pha ;got one...but preserve remainder
lda (keytab),y ;fetch the character code for this key
cmp #$08 ;check for modifier keys................$01 = shift
beq 7$ ;...branch if 'alt' key $02 = C=
cmp #$05 $04 = control
bcs 8$ ;...branch if not a modifier key $08 = alt
cmp #$03 $10 = caps lock
beq 8$ ;...branch if not a modifier key
7$ ora shflag
sta shflag ;save modifier (merge in into flag byte)
.byte $2c
8$ sty sfdx ;save key number
pla ;recall the rest of the row
9$
iny ;index to next key
dex ;index to next row
bne 6$ ;...branch if still more keys in this row
cpy #89
bcs 10$ ;...branch if finished all keys
pla ;recall column configuration
sec
rol a ;rotate scan to next column
bcs 2$ ;...branch if still more columns
sta colm ;(.a=$ff) drop all lines driving old matrix
rol shflag
sec
ror shflag ;flag we are now scanning extended matrix
rol a ;(.a=$fe)
bne 2$ ;always
10$ asl shflag ;remove temporary flag bit
lsr shflag
pla ;clean up- all done. pass key number in .a and...
lda sfdx ;...fall into 'keylog' to determine how to decode key
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
jmp (keyvec) ;'keylog' indirect
keylog ;evaluate various shift keys & determine lookup table
cmp #87
bne 10$ ;special test for <scroll> key
bit locks
bvs 99$ ;...branch if disabled
lda lstshf
bne 99$ ;...branch if too soon
lda #13 ;<ctrl>-S
eor pause
sta pause ;toggle pause flag
bvc 20$ ;setup slight delay
10$ lda shflag
beq repeat ;...branch if none depressed, 'keytab' already set up
cmp #$10
beq 40$ ;...branch if <caps-lock> only
cmp #$08
beq 50$ ;...branch if <alt> only
and #$07
cmp #3 ;<commodore><shift> combination?
bne 30$ ;...branch if not
lda locks ;got it, but is it locked out?
bmi repeat ;...branch if locked out
lda lstshf ;has there been enough delay since last time?
bne repeat ;...branch if more delay needed
bit mode
bpl 15$ ;...branch if 40-col (vic) mode
lda color
eor #$80 ;toggle case by toggling 8563 attribute ALT bit
sta color ; (note: does not affect characters already displayed-
jmp 20$ ; it does allow all 512 chrs to appear simultaneously.)
15$ lda vm1 ;toggle case by redirecting vic character base register
eor #$02 ; VIC(cb11)
sta vm1 ;change will occur at next display frame
20$ lda #%00001000 ;provide a delay between toggles
sta lstshf ; (reset by 'ckit2' shifting 'lstshf' right)
bne repeat ;always
30$ asl a ;make flag value a table pointer
cmp #8 ;<control> key? (overrides all other modes)
bcc 50$ ;...branch if not down (.a points to correct matrix)
lda #6 ;set table pointer to <ctrl> matrix
ldx sfdx ;check for <ctrl>-S combination (pause output)
cpx #13
bne 50$ ;...branch if not 'S'
bit locks
bvs 50$ ;...branch if locked out
stx pause ;set flag for pause
99$ rts
40$ lda #10 ;set table pointer to <caps-lock> matrix
50$ tax ;.a = table pointer
lda decode,x
sta keytab ;setup vector to that table
lda decode+1,x
sta keytab+1 ;fall thru to 'repeat' handler & 'ckit2'
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
repeat ;handler for key repeats
ldy sfdx ;get key index
lda (keytab),y ;lookup key value from proper table
tax ;save key value for 'ckit2' in .x
cpy lstx ;is the index the same as found during last key scan?
beq 20$ ;...branch if it is
ldy #$10
sty delay ;reset the delay before a key repeats
bne ckit2 ;always
20$ and #$7f ;mask off shift bit
bit rptflg ;are key repeats enabled?
bmi 30$ ;...branch if all keys repeat
bvs scnrts ;...branch if no keys repeat
cmp #$7f
beq ckit2 ;...branch if nothing to repeat (no real key down)
cmp #$14 ;repeat only cursor keys, space bar, and delete key
beq 30$ ;...branch if <inst/del>
cmp #space
beq 30$ ;...branch if <space>
cmp #$1d
beq 30$ ;...branch if <crsr l/r>
cmp #$11
bne scnrts ;...branch if not <crsr u/d>
30$ ldy delay ;repeat this key
beq 40$ ;...branch if key has been down long enough to repeat
dec delay ;else keep counting down
bne scnrts
40$ dec kount
bne scnrts ;...branch if between key repeats
ldy #4
sty kount ;reset between_key_repeats counter
ldy ndx
dey ;got a repeating key- is there room for it in buffer?
bpl scnrts ;...branch if no room (ignore it)
;else fall into 'ckit2' & put key (in .x) into buffer
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ckit2 ;key is in .x
lsr lstshf ;do <cbm><shift> delay (if any)
ldy sfdx ;get index of current key
sty lstx ;update last_key_found value
cpx #$ff ;.x has the key code (from 'repeat')
beq scnrts ;...branch if it's null (nothing down)
lda #0
sta pause ;any key clears the <ctrl>-S pause flag
txa ;decoded key
ldx shflag ;status of special keys
;.a=character, .y=keycode, .x=shift status
jmp nat_keychk ;'keychk' indirect (NATIONAL)
keyput
ldx #9 ;check for function keys, <shift><run>, or <help>
1$ cmp funtab,x ;compare with function key codes
beq dopfky ;...branch if it is a function key
dex
bpl 1$
ldx ndx ;finally put key into the damn buffer!
cpx xmax
bcs scnrts ;...branch if buffer is full (ignore key)
sta keyd,x ;put it in
inx ;one more key in buffer
stx ndx ;update key queue count
scnrts lda #$7f
sta colm ;restore scan to last column (run/stop)
rts
.page
dopfky
jmp dopfky_patch ;-05 FIX (FAB)
; lda pkybuf,x ;find length of function key string
sta kyndx
lda #0 ;find index to start of string
1$ dex
bmi 2$
clc
adc pkybuf,x
bcc 1$ ;always
2$ sta keyidx
rts
funtab
.byte $85,$89,$86,$8a ;f1-f4
.byte $87,$8b,$88,$8c ;f5-f8
.byte $83,$84 ;<shift><run>, <help>
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
blink ;////////// vic cursor blinker \\\\\\\\\\\\\
bit mode
bmi 2$ ;...branch if 8563 mode (hardware cursor)
lda blnsw
bne 2$ ;...branch if cursor not enabled (rts)
dec blnct
bne 2$ ;...branch if not time to blink (rts)
lda blnon
and #$c0
cmp #$c0
beq 2$ ;...branch if solid cursor & 'gdbln' is correct
lda #20 ;reset blink counters
sta blnct
ldy pntr ;get current cursor position
ldx gdcol ;get correct color
lda (pnt),y ;get screen character at cursor
bit blnon
bmi 1$ ;...branch if cursor was on
sta gdbln ;cursor was off, save good character
jsr scolor
lda (user),y ;get screen color at cursor
sta gdcol ;save color
ldx color ;cursor always appears in current fgnd color
lda gdbln ;character under cursor
1$ eor #$80 ;toggle character field bit to 'blink' cursor
jsr displ ;display this character & color & rts
lda blnon
eor #$80
sta blnon ;toggle cursor
2$
rts
;.end

475
EDITOR_C128_NATIONAL/ed4.src

@ -0,0 +1,475 @@
.page
.subttl ed4 print routines (04/06/85)
; ////////////////// P R I N T C H A R A C T E R \\\\\\\\\\\\\\\\\\\\\\
print ;print character in .a on the screen & rts to 'loop2'
sta datax ;save a copy of character to print
pha ;save all registers
txa
pha
tya
pha
10$ lda pause ;is there a pause (<ctrl>-S) in effect?
bne 10$ ;...loop if so (irq key routine must clear it @ckit2)
sta crsw
loop2v = loop2-1
lda #>loop2v ;push 'loop2' onto stack for common return mechanism
pha
lda #<loop2v
pha
ldy pntr ;screen column to print to
lda datax ;character to print
cmp #cr ;is it <cr> or <shift><cr>?
beq prtcr ;...branch if so
cmp #cr+$80
beq prtcr
ldx lstchr ;was previous character an <escape>?
cpx #esc
bne 20$ ;...branch if not
jmp escchr ;yes- go to escape handler & rts to 'loop2'
20$ tax ;sets processor status per current character
bpl 30$ ;...branch if it was not shifted
jmp shfchr ;yes- go process shifted character
30$ cmp #space
bcc ctlchr ;...branch if it was <ctrl> character
40$ cmp #$60 ;convert to cbm screen code
bcc 50$
and #$df ;convert ($60-$7f to $40-$5f)
.byte $2c
50$ and #$3f ;convert ($40-$5f to $00-$1f)
jsr qtswc ;if quote char, toggle quote switch
jmp nxt3 ;put character on screen & do rts to 'loop2'
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
prtcr ;print a <cr><lf>
jsr fndend ;find the end of the current line
inx
jsr clrbit ;set next line as non-continued
ldy sclf ;point to first column of next line
sty pntr
jsr nxln ;set up next line & fall thru to 'togm'
toqm ;reset all editor modes
lda color
and #$cf
sta color ;reset 8563 underline & flash modes
lda #0
sta insrt ;reset insert mode
sta rvs ;reset reverse mode
sta qtsw ;reset quote mode
rts
ctltbs .byte $02,$07,$09,$0a,$0b,$0c,$0e
.byte $0f,$11,$12,$13,$14,$18,$1d
ctltbe ;dispatch table for <ctrl> characters
.word undron-1 ; b ($02) set underline mode (8563)
.word beep-1 ; g ($07) bell
.word tab-1 ; i ($09) tab
.word lfeed-1 ; j ($0a) line feed
.word lock-1 ; k ($0b) lock out <C=><shift>
.word unlock-1 ; l ($0c) unlock <C=><shift>
.word lower-1 ; n ($0e) lower case
.word flshon-1 ; o ($0f) set flash mode (8563)
.word crsrdn-1 ; q ($11) cursor down
.word rvson-1 ; r ($12) set reverse field mode
.word homtst-1 ; s ($13) home cursor
.word delete-1 ; t ($14) delete
.word tabset-1 ; x ($18) toggle tab stop
.word crsrrt-1 ; ] ($1d) cursor right
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
ctlchr jmp (ctlvec) ;'contrl' indirect
contrl ;print a <ctrl> character & rts to 'loop2' always
cmp #esc
beq ctlrts ;...branch if <escape> & ignore
ldx insrt ;if insert or quote mode, show character as rvs field
bne 1$ ;...branch if insert mode
cmp #$14
beq 2$ ;...branch if <delete> to allow them in quote mode
ldx qtsw
beq 2$ ;...branch if not quote mode
1$ ldx #0
stx datax ;squash 'lstchr' (eg: used to detect double <home>'s)
jmp nc3 ;print character in reverse field
2$ ldx #ctltbe-ctltbs-1
3$ cmp ctltbs,x ;test if character is a functional <ctrl> character
beq ctlexe ;...yes- go handle it
dex
bpl 3$
colchk ;////// 'shiftd' exits thru here too
ldx #15 ;test if character is a color
1$ cmp coltab,x
beq 2$ ;...it is
dex
bpl 1$
rts ;an unrecognized character...ignore it, rts to 'loop2'
2$ bit mode
bmi 3$
stx color ;set current foreground color
rts ;to 'loop2'
3$ lda color ;set 8563 color (convert to c64 colors)
and #$f0 ;preserve special attributes
ora coladj,x
sta color
ctlrts rts
ctlexe
txa
asl a ;index into ctrl dispatch table
tax
lda ctltbe+1,x
pha
lda ctltbe,x
pha
rts ;do <ctrl> function, rts to 'loop2'
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
shfchr jmp (shfvec) ;'shiftd' indirect
shiftd ;process shifted keycodes & return to 'loop2'
and #$7f ;mask off msb
cmp #$20 ;immediate function key?
bcc 2$ ;yes
cmp #$7f ;pi?
bne 1$
lda #$5e ;yes- translate it
1$ jmp nxt33 ;print it
2$ ldx qtsw ;if quote mode, show character in rvs field
beq 4$ ;...branch not quote mode
3$ ora #$40 ;make it shifted
jmp nc3 ;make it reversed and print it
4$ cmp #$14 ;<insert>? (must check before 'insrt' flag test!)
bne 5$
jmp insert
5$ ldx insrt ;if insert mode, show character in rvs field
bne 3$ ;...branch if insert mode
cmp #$11 ;<crsr-up>?
beq crsrup
cmp #$1d ;<crsr-lf>?
beq crsrlf
cmp #$0e ;'set upper case'?
beq upper
cmp #$12 ;<rvs-off>?
bne 6$
jmp rvsoff
6$ cmp #$02 ;'disable underline'?
bne 7$
jmp undrof
7$ cmp #$0f ;'disable flash'?
bne 8$
jmp flshof
8$ cmp #$13 ;<clr>?
bne 9$
jmp clsr
9$ ora #$80 ;restore msb
bne colchk ;(always) test for color & rts to 'loop2'
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
crsrrt
jsr nxtchr ;cursor right
bcs crsrw1 ;branch if wrap
rts
crsrdn
jsr nxln ;cursor down
crsrw1 jsr getbit ;a wrapped line?
bcs crsrok
sec
ror lsxp ;flag we left line
crsrok clc
crsrts rts ;return to 'loop2' (except 'crsrlf' call from 'delete')
crsrup
ldx sctop ;cursor up
cpx tblx ;at top of window?
bcs crsrts ;yes...do nothing
crsrw2 jsr crsrw1 ;about to wrap?
dec tblx ;up a line
jmp stupt ;setup pointers & return to 'loop2' (unless 'delete')
crsrlf
jsr bakchr ;cursor left (////// called also by 'delete')
bcs crsrts ;abort if at top left
bne crsrok ;no- exit
inc tblx
bne crsrw2 ;(always) go set flag if needed
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
lower ;set lower character set
bit mode
bmi lower_80 ;...branch if 8563 mode
lda vm1 ;get character base
ora #$02 ;set VIC cb11: (point to lower case)
bne uprts ;always
lower_80
lda color ;set 8563 attribute ALT bit
ora #$80
sta color
rts
upper ;set upper character set
bit mode
bmi upper_80 ;...branch if 8563 mode
lda vm1 ;get character base
and #$fd ;clear VIC cb11: (point to upper case)
uprts sta vm1 ;change will occur at next display frame
rts ;returns to 'loop2'
upper_80
lda color ;clear 8563 attribute ALT bit
and #$7f
sta color
rts
lock
lda #$80 ;lock keyboard in current mode
ora locks ;set lock bit
bmi unlrts ;always
unlock
lda #$7f ;unlock keyboard
and locks ;clear lock bit
unlrts sta locks
rts ;return to loop2
homtst
lda lstchr
cmp #$13 ;is this the 2nd consecutive <home>?
bne 1$ ;no
jsr sreset ;yes...reset window to full screen
1$ jmp home ;home cursor
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
rvsoff
lda #0 ;turn off reverse field mode
.byte $2c
rvson
lda #$80 ;turn on reverse field mode
sta rvs
rts
undron
lda color ;enable underline attribute (has effect on 8563 only)
ora #$20
sta color
rts
undrof
lda color ;disable underline attribute
and #$df
sta color
rts
flshon
lda color ;enable flash attribute (has effect on 8563 only)
ora #$10
sta color
rts
flshof
lda color ;disable flash attribute
and #$ef
sta color
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
insert ;insert one character on screen
jsr savpos ;save column & row position
jsr fndend ;move to last char on the line
cpx sedt2 ;last row equal to starting row?
bne 1$ ;no - skip ahead
cpy sedt1 ;is last position before starting position?
1$
bcc 3$ ;yes - no need to move anything
jsr movchr ;move to next char position
bcs 4$ ;abort if scroll needed but disabled
2$
jsr bakchr
jsr get1ch ;move char forward 1 position
jsr nxtchr
jsr displt
jsr bakchr
ldx tblx
cpx sedt2 ;at original position
bne 2$
cpy sedt1
bne 2$ ;no - loop until we are
jsr blank ;insert a blank
3$
inc insrt ;add one to insert count
bne 4$ ;only count up to 255
dec insrt ; (notice we already did the actual insert though...)
4$
jmp delout ;restore original position
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
delete ;delete one character on screen
jsr crsrlf ;move cursor back one position
jsr savpos ;save column & row position
bcs delout ;abort if at top left corner of window
deloop cpy scrt ;at right margin?
bcc delchr ;no- skip ahead
ldx tblx
inx
jsr getbt1 ;is next line a wrapped line?
bcs delchr ;yes- continue with delete
jsr blank ;no- blank last character
delout
lda sedt1 ;restore column and row position (entry from 'insert')
sta pntr
lda sedt2
sta tblx
jmp stupt ;restore 'pnt', 'user' & rts to 'loop2'
delchr
jsr nxtchr
jsr get1ch ;get next character
jsr bakchr ;move pointers back one position
jsr displt ;display character
jsr nxtchr ;set up for next character
jmp deloop ;loop until end of line
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
tab
ldy pntr ;tab function
1$ iny
cpy scrt ;at rightmost side of window?
bcs 2$ ;yes
jsr tabget ;find next tabstop
beq 1$ ;branch if not there yet
.byte $2c
2$ ldy scrt ;put cursor at right margin
sty pntr
rts
tabset
ldy pntr
jsr tabget ;toggle tabstop at current cursor position
eor bitmsk
sta tabmap,x
rts
tabget ;return <> if column in .y is a tabstop
tya ; .a returns bits, .x index to tabmap
and #$07
tax
lda bits,x
sta bitmsk
tya
lsr a
lsr a
lsr a
tax
lda tabmap,x
bit bitmsk ;set = flag
rts
tabclr
lda #0 ;clear all tab stops
.byte $2c
taball lda #$80 ;set default tab stops
ldx #9
1$ sta tabmap,x
dex
bpl 1$
tabrts rts
.page
beep
bit beeper ;generate 'bell' tone for <ctrl>-G
bmi tabrts ;...branch if disabled
lda #$15
sta sidreg+24 ;set volume control
ldy #$09
ldx #$00
sty sidreg+5 ;set envelope
stx sidreg+6
lda #$30
sta sidreg+1 ;set oscillator frequency
lda #$20
sta sidreg+4 ;set waveform & ungate
lda #$21
sta sidreg+4 ;gate it
rts
lfeed
lda pntr ;move to next logical line but retain current column pointer
pha
jsr fndend ;move to end of current logical line
jsr nxln ;move down one physical line
pla
sta pntr ;restore cursor column pointer
rts
;.end

376
EDITOR_C128_NATIONAL/ed5.src

@ -0,0 +1,376 @@
.page
.subttl ed5 escape handler (05/06/85)
;///////////// E S C A P E F U N C T I O N S \\\\\\\\\\\\\\
; escape sequence handler. entry: character following <escape> in .a
escchr jmp (escvec) ;'escape' indirect
escape cmp #esc
bne 1$ ;...branch if not double <escape>
lsr datax ;...else cancel <escape> sequencer by fucking up lstchr
jmp toqm ;...and exit via 'toqm' to cancel all other modes too
1$ and #$7f
sec
sbc #'@' ;table begins at ascii '@' & ends at 'z'
cmp #27 ;'z'-'@'+1
bcs escrts ;invalid char...ignore it!
asl a ;character is index to dispatch table
tax
lda escvct+1,x ;get address of escape routine, push it, & rts to it
pha
lda escvct,x
pha
escrts rts
escvct .word eeos-1 ;@ erase to end of screen
.word auton-1 ;a auto insert
.word sethtb-1 ;b set bottom
.word autoff-1 ;c cancel auto insert
.word dline-1 ;d delete line
.word crsrnf-1 ;e select non-flashing cursor
.word crsrbl-1 ;f flashing cursor
.word bellon-1 ;g enable bell
.word bellof-1 ;h disable bell
.word iline-1 ;i insert line
.word fndsol-1 ;j move to start of line
.word fndeol-1 ;k move to end of line
.word scrsw0-1 ;l enable scrolling
.word scrsw1-1 ;m disable scrolling
.word dspnml-1 ;n un-reverse 8563 screen
.word toqm-1 ;o cancel insert, quote, reverse, ul & flash modes
.word etstol-1 ;p erase to start of line
.word etol-1 ;q erase to end of line
.word dsprvs-1 ;r reverse 8563 screen
.word crsral-1 ;s 8563 block cursor
.word sethtt-1 ;t set top of page
.word crsrul-1 ;u 8563 underscore cursor
.word suup-1 ;v scroll up
.word sddn-1 ;w scroll down
.word swap-1 ;x switch between 40/80 display modes
.word taball-1 ;y set default tab stops
.word tabclr-1 ;z clear all tab stops
.page
;*****************************
;
; window modes
;
;*****************************
sethtt
clc ;set top of window
.byte $24
sethtb
sec ;set bottom of window
ldx pntr
lda tblx
window bcc sttop ;//////entry from editor jump table here!
stbot
sta scbot
stx scrt
jmp rewrap
sreset ;reset screen to full window
lda lines ;max # of rows
ldx columns ;max # of columns
jsr stbot
lda #0
tax ;fall thru to set top
sttop
sta sctop ;set top of window
stx sclf
rewrap
lda #0 ;make all lines non-continued
ldx #4
1$
sta bitabl-1,x
dex
bne 1$
rts
.page
;*****************************
;
; insert line
;
;*****************************
iline
jsr scrdwn ;insert a blank line
jsr stu10 ;move to start of line
inx
jsr getbt1
php
jsr putbit ;set continuation same as in previous line
plp
bcs 1$ ;skip if was wrapped
sec
ror lsxp ;set flag - new line
1$
rts
;**************************
;
; delete line
;
;**************************
dline
jsr fistrt ;find start of line
lda sctop ;save current of window
pha
lda tblx ;make 1st display line top of window
sta sctop
lda scroll ;make sure logical scroll is off
pha
lda #$80
sta scroll
jsr scru15 ;scroll the top line away
pla
sta scroll
lda sctop ;make old 1st line of this 1 current
sta tblx
pla
sta sctop
sec
ror lsxp ;set flag - new line
jmp stu10 ;make this line the current one
.page
;******************************
;
; erase to end of line
;
;******************************
etol
jsr savpos
1$
jsr clrprt ;blank rest of line
inc tblx ;move to next line
jsr stupt
ldy sclf
jsr getbit ;check if next is wrapped line
bcs 1$ ;yes - blank next line
etout
jmp delout ;exit and restore original position
;*****************************
;
; erase to start of line
;
;*****************************
etstol
jsr savpos
1$
jsr blank ;do a blank
cpy sclf ;done a line?
bne 2$ ;no
jsr getbit ;at top of line
bcc etout ;yes - exit
2$ jsr bakchr ;back up
bcc 1$ ;always
;******************************
;
; erase to end of screen
;
;******************************
eeos
jsr savpos
1$
jsr clrprt ;blank rest of line
inc tblx ;move to next line
jsr stupt
ldy sclf
jsr getbit ;check if next is wrapped line
bcs 1$ ;yes - blank next line
lda tblx
cmp scbot ;check if at end of screen
bcc 1$
beq 1$
jmp delout ;exit and restore original position
.page
;*****************************
;
; scroll up
;
;*****************************
suup
jsr savpos
txa
pha
jsr scrup
pla
sta sedt2
jmp delout
;*****************************
;
; scroll down
;
;*****************************
sddn
jsr savpos
jsr getbit
bcs 1$
sec
ror lsxp ;set flag - left line
1$
lda sctop
sta tblx ;scroll from screen top
jsr scrdwn
jsr clrbit ;make first line non-continued
jmp delout
.page
;********************************
;
; scrolling enable/disable
;
;********************************
scrsw0
lda #0 ;enable scrolling
.byte $2c
scrsw1
lda #$80 ;disable scrolling
sta scroll
rts
;*******************************
;
; auto insert on/off
;
;*******************************
autoff
lda #0
.byte $2c
auton
lda #$ff
sta insflg
rts
.page
;*******************************
;
; cursor modes
;
;*******************************
crsral
bit mode
bpl crsr_c
lda curmod ;8563 solid cursor
and #$e0
jmp crsr_a ;bra
crsrul
bit mode
bpl crsr_c
lda curmod ;8563 underline cursor
and #$e0
ora #$07
bne crsr_a ;bra
crsrnf
bit mode ;select non-blinking cursor
bpl crsr_d
lda curmod ;8563 hardware cursor
and #$1f
crsr_a sta curmod
jmp crsrdo
crsr_d lda blnon ;vic cursor
ora #$40
bne crsr_b ;bra
crsrbl
bit mode ;select blinking cursor
bpl 1$
lda curmod ;8563 hardware cursor
and #$1f
ora #$60
bne crsr_a ;bra
1$ lda blnon ;vic cursor
and #$bf
crsr_b sta blnon
crsr_c rts
.page
;*******************************
;
; bell (ctrl-g) on/off
;
;*******************************
bellon
lda #0
.byte $2c
bellof
lda #$80
sta beeper
rts
dsprvs
ldx #24 ;reverse 8563 display
jsr vdcin
ora #$40
bne dspxxx
dspnml
ldx #24 ;normal 8563 display
jsr vdcin
and #$bf
dspxxx jmp vdcout
fndeol
jsr fndend ;move to last character in line
jmp movchr ;move past it & start a wrapped line if necessary
;.end

437
EDITOR_C128_NATIONAL/ed6.src

@ -0,0 +1,437 @@
.page
.subttl ed6 editor subroutines (08/15/85)
get1ch ;get a character & its color from text screen
ldy pntr ;get char/color index
bit mode
bmi get80 ;...branch if from 8563 screen
lda (user),y ;get the color
sta tcolor
lda (pnt),y ;get the character
rts
get80
jsr getusr ;setup 8563 memory address to attribute
jsr vdcget ;read the attribute
sta tcolor
jsr getpnt ;setup 8563 memory address to character
jsr vdcget ;read the character
rts
.page
; wrap table subroutines
;
getbit
ldx tblx
getbt1
jsr bitpos ;get byte & bit positions
and bitabl,x
cmp #1 ;make carry clear if zero
jmp bitout
; putbit - set bit according to carry
;
putbit
ldx tblx
putbt1
bcs setbit ;go if to mark as wrappped line
; clrbit - clear wrap bit
;
clrbit
jsr bitpos ;get byte & bit positions
eor #$ff ;invert bit position
and bitabl,x ;clear bit
bitsav
sta bitabl,x
bitout
ldx bitmsk
rts
; setbit - set bit to mark as wrapped line
;
setbit
bit scroll ;check for line-link disable
bvs getbt1
jsr bitpos ;get byte & bit position
ora bitabl,x ;set wrap bit
bne bitsav ;always
.page
; bitpos - get byte & bit position of wrap bit
; input - x = row number
; output - x = byte number
; a = bit mask
bitpos
stx bitmsk
txa
and #$07 ;get bit position
tax
lda bits,x ;get bit mask
pha
lda bitmsk
lsr a
lsr a ;shift to get byte position
lsr a
tax
pla
rts
.page
; ****** move to end/start of line
;
fndsol
ldy sclf ;will move to start of line...
sty pntr ;set to leftmost column
; ****** find beginning of line
;
fistrt
jsr getbit ;find start of current line
bcc 1$ ;branch if found
dec tblx ;up a line
bpl fistrt ;always
inc tblx ;whoops went too far
1$ jmp stupt ;set line base adr
; ****** find last non-blank char of line
;
; pntr= column #
; tblx= line #
fndend
inc tblx
jsr getbit ;is this line continued
bcs fndend ;branch if so
dec tblx ;found it - compensate for inc tblx
jsr stupt
ldy scrt ;get right margin
sty pntr ;point to right margin
1$ jsr get1ch
ldx tblx ;restore .x (if 8563 mode, 'get1ch' trashes .x)
cmp #space
bne 3$ ;yes
cpy sclf ;are we at the left margin?
bne 2$ ;no- keep going
jsr getbit ;are we on a wrapped line?
bcc 3$ ;no- get out
2$ jsr bakchr
bcc 1$ ;ok- not at top left
3$ sty indx ;remember this
rts
.page
; ****** move to next char
;
; scroll if enabled, else wrap to top
nxtchr
pha
ldy pntr
cpy scrt ;are we at the right margin?
bcc 1$ ;branch if not
jsr nxln ;point to next line
ldy sclf ;point to first char of 1st line
dey
sec ;set to show moved to new line
1$ iny ;increment char index
sty pntr
pla
rts
; ****** backup one char
;
; wrap up and stop a top left
bakchr
ldy pntr
dey
bmi 1$
cpy sclf ;are we at the left margin
bcs 2$ ;no - past it
1$ ldy sctop
cpy tblx ;are we at top line last character?
bcs 3$ ;leave with carry set
dec tblx ;else backup a line
pha
jsr stupt ;set line base adr
pla
ldy scrt ;move cursor to right side
2$ sty pntr
cpy scrt ;set z-flag if moved to new line
clc ;always clear
3$ rts
; ****** save row & column position
;
savpos
ldy pntr
sty sedt1
ldx tblx
stx sedt2
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; ///////// put a character on the screen \\\\\\\\\\\
;
; enter 'disply' with .a= character, .x= color
blank lda color ;display a blank
and #$8f ; (strip off rvs, underline & flash attributes)
tax
lda #space
.byte $2c
displc ldx color ;use current fgnd color
.byte $2c
displt ldx tcolor ;use saved color
disply tay ;save character to diplay
lda #2
sta blnct ;force a cursor blink
jsr scolor ;setup color pointers
tya ;restore character
ldy pntr ;get cursor position
displ bit mode
bmi disp80 ;...branch if 8563 screen
sta (pnt),y ;put character on screen
txa ;get color
sta (user),y ;put the color on screen
rts
disp80 pha ;save character
txa
pha ;save color
jsr getusr ;setup color byte pointer
pla
jsr vdcput ;put the color on the screen
jsr getpnt ;setup character byte pointer
pla
jmp vdcput ;put the character on the screen & rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; SCRORG returns current window's size (maximum row & column #)
;
; entry: nothing required.
;
; exit: .x = maximum column number (# columns minus 1)
; .y = maximum line number (# lines minus 1)
; .a = maximum screen width (# columns minus 1)
;
scrorg ;return current window size (maximum row & column #)
sec
lda scbot
sbc sctop
tay ;.y = # lines in current window - 1
sec
lda scrt
sbc sclf
tax ;.x = # columns in current window - 1
lda columns ;.a = # columns in current screen - 1
rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
; PLOT reads or sets the cursor position within current window
;
; entry: .c = 1 returns the cursor position (.y=column, .x=line)
; relative to the current window origin (NOT screen origin).
;
; .c = 0 sets the cursor position (.y=column, .x=line) relative
; to the current window origin (NOT screen origin).
;
; exit: .c = 1 error exit. the requested position was outside the
; current window and NO CHANGE has been made (see SCRORG). .
;
; .c = 0 normal exit. the cursor has been moved to the position
; contained in .x & .y relative to window origin.
;
plot
bcs 30$ ;...branch to simply read the current position
txa ;get line position relative to window origin
adc sctop
bcs 15$
cmp scbot
beq 10$ ;...good if within window (position <= scbot)
bcs 15$ ;...branch if error (.c=1)
10$ pha ;save
clc
tya ;get colm position relative to window origin
adc sclf
bcs 14$
cmp scrt
beq 20$ ;...good if within window (position <= scrt)
bcc 20$
14$ pla
15$ rts ;error return (.c=1)
20$ sta pntr ;set column position
sta lstp
pla
sta tblx ;set line position
sta lsxp
jsr stupt ;position cursor there
jsr cursor
30$ lda tblx ;read current line position
sbc sctop
tax ;return cursor line # relative to window top
sec
lda pntr ;read current column position
sbc sclf
tay ;return cursor column # relative to window left
clc ;normal return
rts
.page
;*************************************************************************
;
; KEYSET - redefine a programmable function key
;
; entry: .a= pointer to new string adr (lo,hi,bank)
; .x= key number (1-8)
; .y= length of new string
;
; exit: .c= 0 if good, 1 if no room (no change made)
;
;**************************************************************************
keyset
dex
stx keynum ;save key number (0-7)
sty keysiz ;save string length
sta fetvec ;setup address pointer
tay
ldx $2,y ;get bank
jsr _config ;convert to actual mmu configuration
sta keybnk
ldx #pkynum ;(note: 'help' & <shft/run> strings too)
jsr findky ;find end of all strings
sta keylen ;save offset
ldx keynum
inx
jsr findky ;find end of function key (beginning of next)
sta keynxt ;save offset
ldx keynum
lda keysiz
sec
sbc pkybuf,x ;get new size - old size
beq keyins ;skip if the same
bcc 2$ ;skip if new is shorter
clc
adc keylen ;get new ending offset for all keys
bcs keyerr ;wrapped? error if so...
tax ;get destination address+1
ldy keylen ;get source address+1
1$ cpy keynxt
beq keyins ;done if all following keys have been moved
dey ;expand key area
dex ;move source to destination
lda pkydef,y
sta pkydef,x
bcs 1$
2$ adc keynxt ;get destination offset
tax
ldy keynxt ;get source address
3$ cpy keylen ;contract key area
bcs keyins ;exit if moved all
lda pkydef,y
sta pkydef,x
iny
inx
bcc 3$ ;always
.page
; keyins -- insert new key definition
keyins
ldx keynum ;get key number
jsr findky ;get starting offset
tax
ldy keynum
lda keysiz ;get new size
sta pkybuf,y ;set new size
ldy #0
1$ dec keysiz
bmi keyrts ;exit - end of string
stx keytmp
ldx keybnk
lda fetvec ; (already setup at 'keyset')
sei
jsr fetch ;lda (index),y: move in new key def. from string
cli
ldx keytmp
sta pkydef,x
inx
iny
bne 1$ ;...always
keyrts clc ;good return
keyerr rts
findky
lda #0
clc
1$ dex
bmi 2$
adc pkybuf,x
bcc 1$
2$ rts
;.end

140
EDITOR_C128_NATIONAL/ed7.src

@ -0,0 +1,140 @@
.page
.subttl ed7 tables & data (08/15/85)
coltab .byte $90,$05,$1c,$9f,$9c,$1e,$1f,$9e ;color key codes
.byte $81,$95,$96,$97,$98,$99,$9a,$9b
coladj .byte $00,$0f,$08,$07,$0b,$04,$02,$0d ;convert rgbi to c64 colors
.byte $0a,$0c,$09,$06,$01,$05,$03,$0e
bits .byte $80,$40,$20,$10,$08,$04,$02,$01
localzp .byte $00,$04,$00,$d8,$18,$00,$00,$27 ;local variable init table
.byte $00,$00,$00,$00,$00,$18,$27,$00 ;(vic screen)
.byte $00,$0d,$0d,$00,$00,$00,$00,$00
.byte $00,$00
localabs
.byte $00,$00,$00,$08,$18,$00,$00,$4f ;absolute var init table
.byte $00,$00,$00,$00,$00,$18,$4f,$00 ;(8563 screen)
.byte $00,$07,$07,$00,$00,$00,$00,$00
.byte $00,$00
.page
pkytbl ;pre-programmed function key definitions
.byte pky2-pky1
.byte pky3-pky2
.byte pky4-pky3
.byte pky5-pky4
.byte pky6-pky5
.byte pky7-pky6
.byte pky8-pky7
.byte runtb-pky8
.byte helptb-runtb ;<shift><run> is a non-programmable function key
.byte pkyend-helptb ;<help> is too
pky1 .byte 'GRAPHIC'
pky2 .byte 'DLOAD"'
pky3 .byte 'DIRECTORY',cr
pky4 .byte 'SCNCLR',cr
pky5 .byte 'DSAVE"'
pky6 .byte 'RUN',cr
pky7 .byte 'LIST',cr
pky8 .byte 'MONITOR',cr
runtb .byte $44,$cc,$22,$2a,cr,'RUN',cr ;dL"* <cr> run <cr>
helptb .byte 'HELP',cr
pkyend
.page
.editor_check_mid1
* = $fa80
.editor_check_mid2
mode1 ;normal keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11 ;del ret rt f7 f1 f3 f5 dn
.byte $33,$57,$41,$34,$5a,$53,$45,$01 ; 3 w a 4 z s e shf
.byte $35,$52,$44,$36,$43,$46,$54,$58 ; 5 r d 6 c f t x
.byte $37,$59,$47,$38,$42,$48,$55,$56 ; 7 y g 8 b h u v
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e ; 9 i j 0 m k o n
.byte $2b,$50,$4c,$2d,$2e,$3a,$40,$2c ; + p l - . : @ ,
.byte $5c,$2a,$3b,$13,$01,$3d,$5e,$2f ;lb. * ; hom shf = ^ /
.byte $31,$5f,$04,$32,$20,$02,$51,$03 ; 1 <-- ctl 2 spc C= q stop
.byte $84,$38,$35,$09,$32,$34,$37,$31 ;hlp (8) (5) tab (2) (4) (7) (1)
.byte $1b,$2b,$2d,$0a,$0d,$36,$39,$33 ;esc (+) (-) lf ent (6) (9) (3)
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff ;alt (0) (.) /up /dn /lf /rt scl
.byte $ff
.page
mode2 ;shifted keys (right keycap graphics)
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91 ;ins RTN lft f8 f2 f4 f6 up
.byte $23,$d7,$c1,$24,$da,$d3,$c5,$01 ; # W A $ Z S E shf
.byte $25,$d2,$c4,$26,$c3,$c6,$d4,$d8 ; % R D & C F T X
.byte $27,$d9,$c7,$28,$c2,$c8,$d5,$d6 ; ' Y G ( B H U V
.byte $29,$c9,$ca,$30,$cd,$cb,$cf,$ce ; ) I J 0 M K O N
.byte $db,$d0,$cc,$dd,$3e,$5b,$ba,$3c ;+gr P L -gr > [ @gr <
.byte $a9,$c0,$5d,$93,$01,$3d,$de,$3f ;lbg *gr ] clr shf = pi ?
.byte $21,$5f,$04,$22,$a0,$02,$d1,$83 ; ! <-- ctl " SPC C= Q run
.byte $84,$38,$35,$18,$32,$34,$37,$31 ;hlp (8) (5) TAB (2) (4) (7) (1)
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33 ;esc (+) (-) lf ENT (6) (9) (3)
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff ;alt (0) (.) /up /dn /lf /rt scl
.byte $ff
.page
mode3 ;C= keys (left keycap graphics)
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91 ;ins RTN lft f8 f2 f4 f6 up
.byte $96,$b3,$b0,$97,$ad,$ae,$b1,$01 ;red W A cyn Z S E shf
.byte $98,$b2,$ac,$99,$bc,$bb,$a3,$bd ;pur R D grn C F T X
.byte $9a,$b7,$a5,$9b,$bf,$b4,$b8,$be ;blu Y G yel B H U V
.byte $29,$a2,$b5,$30,$a7,$a1,$b9,$aa ; ) I J 0 M K O N
.byte $a6,$af,$b6,$dc,$3e,$5b,$a4,$3c ;+gr P L -gr > [ @gr <
.byte $a8,$df,$5d,$93,$01,$3d,$de,$3f ;lbg *gr ] clr shf = pi ?
.byte $81,$5f,$04,$95,$a0,$02,$ab,$03 ;blk <-- ctl wht spc C= Q run
.byte $84,$38,$35,$18,$32,$34,$37,$31 ;hlp (8) (5) TAB (2) (4) (7) (1)
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33 ;esc (+) (-) lf ENT (6) (9) (3)
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff ;alt (0) (.) /up /dn /lf /rt scl
.byte $ff
.page
mode4 ;control keys
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; ~ ~ ~ ~ ~ ~ ~ ~
.byte $1c,$17,$01,$9f,$1a,$13,$05,$ff ;red /w /a cyn /z /s /e ~
.byte $9c,$12,$04,$1e,$03,$06,$14,$18 ;pur /r /d grn /c /f /t /x
.byte $1f,$19,$07,$9e,$02,$08,$15,$16 ;yel /y /g yel /b /h /u /v
.byte $12,$09,$0a,$92,$0d,$0b,$0f,$0e ;ron /i /j rof /m /k /o /n
.byte $ff,$10,$0c,$ff,$ff,$1b,$00,$ff ; ~ /p /l ~ ~ /[ /@ ~
.byte $1c,$ff,$1d,$ff,$ff,$1f,$1e,$ff ;/lb ~ /] ~ ~ /= /pi ~
.byte $90,$06,$ff,$05,$ff,$ff,$11,$ff ;blk /<- ~ wht ~ ~ /q ~
.byte $84,$38,$35,$18,$32,$34,$37,$31 ;hlp (8) (5) TAB (2) (4) (7) (1)
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33 ;esc (+) (-) lf ENT (6) (9) (3)
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff ;alt (0) (.) /up /dn /lf /rt scl
.byte $ff
.page
mode5 ;caps lock mode
.byte $14,$0d,$1d,$88,$85,$86,$87,$11 ;del ret rt f7 f1 f3 f5 dn
.byte $33,$d7,$c1,$34,$da,$d3,$c5,$01 ; 3 w a 4 z s e shf
.byte $35,$d2,$c4,$36,$c3,$c6,$d4,$d8 ; 5 r d 6 c f t x
.byte $37,$d9,$c7,$38,$c2,$c8,$d5,$d6 ; 7 y g 8 b h u v
.byte $39,$c9,$ca,$30,$cd,$cb,$cf,$ce ; 9 i j 0 m k o n
.byte $2b,$d0,$cc,$2d,$2e,$3a,$40,$2c ; + p l - . : @ ,
.byte $5c,$2a,$3b,$13,$01,$3d,$5e,$2f ;lb. * ; hom shf = ^ /
.byte $31,$5f,$04,$32,$20,$02,$d1,$03 ; 1 <-- ctl 2 spc C= q stop
.byte $84,$38,$35,$09,$32,$34,$37,$31 ;hlp (8) (5) tab (2) (4) (7) (1)
.byte $1b,$2b,$2d,$0a,$0d,$36,$39,$33 ;esc (+) (-) lf ent (6) (9) (3)
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff ;alt (0) (.) /up /dn /lf /rt scl
.byte $ff
;.end

10
EDITOR_C128_NATIONAL/entries.src

@ -0,0 +1,10 @@
.page
.subttl C/128 KERNAL ENTRIES (12/11/84)
; entry definitions for c/128 KERNAL
_config = $ff6b ;kernal: lookup mmu configuration
_fetch = $ff74 ;kernal: indirect load from any bank
_clrch = $ffcc ;kernal: clear i/o channel & restore default devices
;.end

300
EDITOR_C128_NATIONAL/finland.src

@ -0,0 +1,300 @@
.nam C/128 FINLAND/SWEDEN NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $04 ;FINLAND/SWEDEN p/n 325180-03 04/08/87 F.Bowen
checksum= $08 ;character ROM checksum
chr_sig = $bc5b ;character ROM signature
rom_sig = $b69e ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * ***** *** * * * * * * **** *
; * * * ** * * * * ** * * * *
; * **** * * * * * ***** * * * * * *
; * * * * ** * * * * ** * * *
; * * *** * * ***** * * * * **** *
; * *
; * *** * * ***** **** ***** * * *
; * * * * * * * * ** * *
; * *** * ** * **** * * **** * * * *
; * * ** ** * * * * * ** *
; * **** * * ***** **** ***** * * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 FINLAND/SWEDEN KEYBOARD DRIVER (01/15/86)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl FINLAND/SWEDEN NATIONAL KEYBOARD TABLES
nat_mode1 ;unshifted keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11,$33,$57,$41,$34,$5a,$53,$45,$01
.byte $35,$52,$44,$36,$43,$46,$54,$58,$37,$59,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e,$2d,$50,$4c,$3d,$2e,$5c,$5d,$2c
.byte $3a,$40,$5b,$13,$01,$3b,$5e,$2f,$31,$5f,$04,$32,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_mode2 ;shifted keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b
.byte $91,$23,$d7,$c1,$24,$da,$d3,$c5,$01,$25,$d2,$c4,$26,$c3,$c6,$d4
.byte $d8,$27,$d9,$c7,$28,$c2,$c8,$d5,$d6,$29,$c9,$ca,$30,$cd,$cb,$cf
.byte $ce,$db,$d0,$cc,$dd,$3e,$dc,$dd,$3c,$2a,$c0,$db,$93,$01,$2b,$de
.byte $3f,$21,$5f,$04,$22,$a0,$02,$d1,$83,$84,$38,$35,$18,$32,$34,$37
.byte $31,$1b,$2b,$2d,$0a,$8d,$36,$39,$33,$08,$30,$2e,$91,$11,$9d,$1d
.byte $ff,$ff
nat_mode3 ;C= keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91,$96,$b3,$b0,$97,$ad,$ae
.byte $b1,$01,$98,$b2,$ac,$99,$bc,$bb,$a3,$bd,$9a,$b7,$a5,$9b,$bf,$b4
.byte $b8,$be,$29,$a2,$b5,$30,$a7,$a1,$b9,$aa,$a6,$af,$b6,$dc,$3e,$dc
.byte $a4,$3c,$a8,$df,$db,$93,$01,$2b,$de,$3f,$81,$5f,$04,$95,$a0,$02
.byte $ab,$03,$84,$38,$35,$18,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$8d,$36
.byte $39,$33,$08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ff,$ff,$ff,$ff,$ff ;dead keys (none)
deadp .byte $ff,$ff,$ff,$ff,$ff,$ff ;pointers to 'build' keys
oldead .byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;new key tables
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff,$ff,$ff
nwdead .byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;substitute key tables
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl FINLAND/SWEDEN EDITOR CROSS REFERENCE
.end

302
EDITOR_C128_NATIONAL/france.src

@ -0,0 +1,302 @@
.nam C/128 FRANCE/BELGIUM NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $02 ;FRANCE/BELGIUM p/n 325166-03 04/08/87 F.Bowen
checksum= $11 ;character ROM checksum (same as ITALY)
chr_sig = $03dc ;character ROM signature
rom_sig = $4130 ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * ***** **** * * * *** ***** *
; * * * * * * ** * * * * *
; * **** **** ***** * * * * **** *
; * * * * * * * ** * * * *
; * * * * * * * * *** ***** *
; * *
; * **** ***** * *** *** * * * * *
; * * * * * * * * * ** ** *
; * **** **** * * *** * * * * ** * *
; * * * * * * * * * * * * *
; * **** ***** ***** *** *** *** * * *
; * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 FRANCE/BELGIUM KEYBOARD DRIVER (01/15/86)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl FRANCE/BELGIUM NATIONAL KEYBOARD TABLES
nat_mode1 ;unshifted keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11,$22,$5a,$51,$27,$57,$53,$45,$01
.byte $28,$52,$44,$b0,$43,$46,$54,$58,$b2,$59,$47,$21,$42,$48,$55,$56
.byte $df,$49,$4a,$b1,$2c,$4b,$4f,$4e,$29,$50,$4c,$2d,$3a,$4d,$ae,$3b
.byte $40,$24,$b5,$13,$01,$5e,$2a,$3d,$26,$3c,$04,$bf,$20,$02,$41,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_mode2 ;shifted keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b
.byte $91,$33,$da,$d1,$34,$d7,$d3,$c5,$01,$35,$d2,$c4,$36,$c3,$c6,$d4
.byte $d8,$37,$d9,$c7,$38,$c2,$c8,$d5,$d6,$39,$c9,$ca,$30,$3f,$cb,$cf
.byte $ce,$dd,$d0,$cc,$5f,$2f,$cd,$af,$2e,$23,$5b,$25,$93,$01,$5c,$5d
.byte $2b,$31,$3e,$04,$32,$a0,$02,$c1,$83,$84,$a9,$ab,$18,$a3,$a5,$a8
.byte $a2,$1b,$a1,$2d,$0a,$8d,$a7,$aa,$a4,$08,$a6,$de,$91,$11,$9d,$1d
.byte $ff,$ff
nat_mode3 ;C= keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91,$96,$da,$d1,$97,$d7,$d3
.byte $c5,$01,$98,$d2,$c4,$99,$c3,$c6,$d4,$d8,$9a,$d9,$c7,$9b,$c2,$c8
.byte $d5,$d6,$29,$c9,$ca,$30,$3f,$cb,$cf,$ce,$dd,$d0,$cc,$5f,$2f,$cd
.byte $af,$2e,$23,$5b,$25,$93,$01,$5c,$5d,$2b,$81,$3c,$04,$95,$a0,$02
.byte $c1,$03,$84,$a9,$ab,$18,$a3,$a5,$a8,$a2,$1b,$a1,$2d,$0a,$8d,$a7
.byte $aa,$a4,$08,$a6,$de,$91,$11,$9d,$1d,$ff,$ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ad,$c0,$ae,$af,$00 ;dead keys
deadp .byte $01,$02,$07,$0c,$11,$11 ;pointers to 'build' keys
oldead .byte $45,$41,$45,$49,$4f,$55,$41,$45 ;new key tables
.byte $49,$4f,$55,$41,$45,$49,$4f,$55
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff
nwdead .byte $bf,$b1,$b2,$b3,$b4,$b5,$b6,$b7 ;substitute key tables
.byte $b8,$b9,$ba,$bb,$db,$dc,$bc,$bd
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl FRANCE/BELGIUM EDITOR CROSS REFERENCE
.end

323
EDITOR_C128_NATIONAL/german.src

@ -0,0 +1,323 @@
.nam C/128 GERMAN/AUSTRIAN NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $00 ;GERMANY/AUSTRIA p/n 315078-03 04/08/87 F.Bowen
checksum= $ff ;character ROM checksum
chr_sig = $91f3 ;character ROM signature
rom_sig = $ea3b ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * **** ***** **** * * * * * * * *
; * * * * * ** ** * * ** * * * *
; * * *** *** **** * ** * ***** * * * * *
; * * * * * * * * * * * ** * *
; * **** ***** * * * * * * * * * *
; * *
; * * * * *** ***** **** *** * *
; * * * * * * * * * * * * *
; * ***** * * *** * **** * ***** *
; * * * * * * * * * * * * *
; * * * *** **** * * * *** * * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 GERMAN/AUSTRIAN KEYBOARD DRIVER (05/14/85)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl GERMAN/AUSTRIAN NATIONAL KEYBOARD TABLES
nat_mode1
.byte $14,$0d,$1d,$88,$85,$86,$87,$11 ;unshifted keys
.byte $33,$57,$41,$34,$59,$53,$45,$01
.byte $35,$52,$44,$36,$43,$46,$54,$58
.byte $37,$5a,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e
.byte $be,$50,$4c,$af,$2e,$bc,$bd,$2c
.byte $5b,$2b,$bb,$13,$01,$23,$5d,$2d
.byte $31,$3c,$04,$32,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31
.byte $1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff
.byte $ff
nat_mode2
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91 ;shifted keys
.byte $40,$d7,$c1,$24,$d9,$d3,$c5,$01
.byte $25,$d2,$c4,$26,$c3,$c6,$d4,$d8
.byte $2f,$da,$c7,$28,$c2,$c8,$d5,$d6
.byte $29,$c9,$ca,$3d,$cd,$cb,$cf,$ce
.byte $3f,$d0,$cc,$c0,$3a,$dc,$dd,$3b
.byte $5e,$2a,$db,$93,$01,$27,$5c,$5f
.byte $21,$3e,$04,$22,$a0,$02,$d1,$83
.byte $84,$38,$35,$18,$32,$34,$37,$31
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff
.byte $ff
nat_mode3
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91 ;C= keys
.byte $96,$a7,$a8,$97,$a2,$aa,$a3,$01
.byte $98,$a9,$c4,$99,$c5,$d3,$ce,$a4
.byte $9a,$c2,$df,$9b,$a1,$c9,$d6,$d7
.byte $d1,$c3,$d5,$c1,$cb,$da,$d8,$cd
.byte $ab,$d9,$c8,$bf,$ba,$ca,$b0,$ac
.byte $ad,$a6,$db,$93,$01,$dd,$de,$b9
.byte $81,$b1,$04,$95,$a0,$02,$a5,$03
.byte $84,$38,$35,$18,$32,$34,$37,$31
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff
.byte $ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $af,$c0,$bf,$00,$00 ;dead keys
deadp .byte $01,$03,$07,$0c,$0c,$0c ;pointers to 'build' keys
oldead .byte $45,$c0 ;GERMAN new key table #1
.byte $41,$45,$55,$af ;GERMAN new key table #2
.byte $41,$45,$49,$4f,$55 ;GERMAN new key table #3
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
nwdead .byte $ac,$bf ;GERMAN substitute table #1
.byte $b2,$ae,$b3,$bf ;GERMAN substitute table #2
.byte $b4,$b5,$b6,$b7,$b8 ;GERMAN substitute table #3
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl GERMAN/AUSTRIAN EDITOR CROSS REFERENCE
.end

296
EDITOR_C128_NATIONAL/italy.src

@ -0,0 +1,296 @@
.nam C/128 ITALY NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $06 ;ITALY p/n 325168-03 04/08/87 F.Bowen
checksum= $11 ;character ROM checksum (same as FRANCE)
chr_sig = $03dc ;character ROM signature
rom_sig = $9f44 ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * *** ***** * * * * *
; * * * * * * * * *
; * * * ***** * * *
; * * * * * * * *
; * *** * * * ***** * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 ITALY KEYBOARD DRIVER (01/15/86)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl ITALY NATIONAL KEYBOARD TABLES
nat_mode1 ;unshifted keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11,$22,$5a,$41,$27,$57,$53,$45,$01
.byte $28,$52,$44,$5f,$43,$46,$54,$58,$b2,$59,$47,$26,$42,$48,$55,$56
.byte $df,$49,$4a,$b1,$2c,$4b,$4f,$4e,$29,$50,$4c,$2d,$3a,$4d,$b3,$3b
.byte $40,$24,$b5,$13,$01,$5e,$2a,$b4,$ac,$3c,$04,$bf,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_mode2 ;shifted keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b
.byte $91,$33,$da,$c1,$34,$d7,$d3,$c5,$01,$35,$d2,$c4,$36,$c3,$c6,$d4
.byte $d8,$37,$d9,$c7,$38,$c2,$c8,$d5,$d6,$39,$c9,$ca,$30,$3f,$cb,$cf
.byte $ce,$dd,$d0,$cc,$2b,$2f,$cd,$3d,$2e,$23,$5b,$25,$93,$01,$5c,$5d
.byte $21,$31,$3e,$04,$32,$a0,$02,$d1,$83,$84,$a9,$ab,$18,$a3,$a5,$a8
.byte $a2,$1b,$a1,$2d,$0a,$8d,$a7,$aa,$a4,$08,$a6,$de,$91,$11,$9d,$1d
.byte $ff,$ff
nat_mode3 ;C= keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91,$96,$da,$c1,$97,$d7,$d3
.byte $c5,$01,$98,$d2,$ac,$99,$c3,$c6,$d4,$d8,$9a,$d9,$c7,$9b,$c2,$c8
.byte $d5,$d6,$df,$c9,$ca,$30,$3f,$cb,$cf,$ce,$dd,$d0,$cc,$2b,$2f,$cd
.byte $3d,$2e,$23,$5b,$25,$93,$01,$1c,$5d,$21,$81,$3e,$04,$95,$a0,$02
.byte $d1,$03,$84,$a9,$ab,$18,$a3,$a5,$a8,$a2,$1b,$a1,$2d,$0a,$8d,$a7
.byte $aa,$a4,$08,$a6,$de,$91,$11,$9d,$1d,$ff,$ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ad,$c0,$ae,$af,$00 ;dead keys
deadp .byte $01,$02,$07,$0c,$0e,$0f ;pointers to 'build' keys
oldead .byte $45,$41,$45,$55,$4f,$49,$41,$45 ;new key tables
.byte $49,$4f,$55,$45,$49,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff
nwdead .byte $bf,$b1,$b2,$b5,$b4,$b3,$b6,$b7 ;substitute key tables
.byte $b8,$b9,$ba,$db,$dc,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl ITALY CROSS REFERENCE
.end

296
EDITOR_C128_NATIONAL/norway.src

@ -0,0 +1,296 @@
.nam C/128 NORWAY NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $05 ;NORWAY p/n 325177-03 04/08/87 F.Bowen
checksum= $11 ;character ROM checksum
chr_sig = $3d99 ;character ROM signature
rom_sig = $4b68 ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * * * *** **** * * * * * *
; * ** * * * * * * * * * * * *
; * * * * * * **** * ** * ***** * *
; * * ** * * * * ** ** * * * *
; * * * *** * * * * * * * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 NORWAY KEYBOARD DRIVER (01/15/86)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl NORWAY NATIONAL KEYBOARD TABLES
nat_mode1 ;unshifted keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11,$33,$57,$41,$34,$5a,$53,$45,$01
.byte $35,$52,$44,$36,$43,$46,$54,$58,$37,$59,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e,$2b,$50,$4c,$2d,$2e,$5c,$5d,$2c
.byte $3a,$2a,$5b,$13,$01,$3d,$5e,$2f,$31,$5f,$04,$32,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_mode2 ;shifted keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b
.byte $91,$23,$d7,$c1,$24,$da,$d3,$c5,$01,$25,$d2,$c4,$26,$c3,$c6,$d4
.byte $d8,$27,$d9,$c7,$28,$c2,$c8,$d5,$d6,$29,$c9,$ca,$30,$cd,$cb,$cf
.byte $ce,$db,$d0,$cc,$dd,$3e,$dc,$dd,$3c,$3b,$c0,$db,$93,$01,$40,$de
.byte $3f,$21,$5f,$04,$22,$a0,$02,$d1,$83,$84,$38,$35,$18,$32,$34,$37
.byte $31,$1b,$2b,$2d,$0a,$8d,$36,$39,$33,$08,$30,$2e,$91,$11,$9d,$1d
.byte $ff,$ff
nat_mode3 ;C= keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91,$96,$b3,$b0,$97,$ad,$ae
.byte $b1,$01,$98,$b2,$ac,$99,$bc,$bb,$a3,$bd,$9a,$b7,$a5,$9b,$bf,$b4
.byte $b8,$be,$29,$a2,$b5,$30,$a7,$a1,$b9,$aa,$a6,$af,$b6,$dc,$3e,$ba
.byte $a4,$3c,$a8,$df,$a9,$93,$01,$40,$de,$3f,$81,$5f,$04,$95,$a0,$02
.byte $ab,$03,$84,$38,$35,$18,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$8d,$36
.byte $39,$33,$08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ff,$ff,$ff,$ff,$ff ;dead keys (none)
deadp .byte $ff,$ff,$ff,$ff,$ff,$ff ;pointers to 'build' keys
oldead .byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;new key tables
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff,$ff,$ff
nwdead .byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;substitute key tables
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl NORWAY EDITOR CROSS REFERENCE
.end

37
EDITOR_C128_NATIONAL/patches.src

@ -0,0 +1,37 @@
.page
.subttl editor patch file (05/09/86)
* = $cf00 ;-05 EDITOR PATCH AREA (FAB)
.editor_patch_begin
dopfky_patch
; fixes the problem of function keys overwriting previous function key
; string still in buffer. Also exits via 'scnrts', as it should have.
lda kyndx ;function key buffer in use?
bne 3$ ;...branch if active- ignore this scan
lda pkybuf,x ;set length of new function key string
sta kyndx
lda #0 ;index to start of string
clc
1$ dex ;pointer to string = sum(len(string(0-X)))
bmi 2$
adc pkybuf,x
bcc 1$ ;...always
2$ sta keyidx ;set pointer to active function key string
3$ jmp scnrts ;restore scan to last column & rts
.editor_patch_end
* = $cf80 ;-05 KERNEL PATCH AREA (FAB)
.kernal_patch_begin
;.end

976
EDITOR_C128_NATIONAL/relnotes.src

@ -0,0 +1,976 @@
.page
.subttl RELEASE NOTES: BETA-5 03/05/85
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE BETA-4 CODE TO CREATE THE
; BETA-5 VERSION RELEASED ON 03/05/85. THE BETA-5 RELEASE IS A PRE-PRODUCTION
; VERSION INTENDED FOR SYSTEM TEST AND EVALUATION AND PRELIMINARY APPLICATION
; SOFTWARE DEVELOPMENT ONLY.
;
;
; The following changes have been made to the MONITOR:
;
; 1/ The MONITOR now accepts binary, octal, decimal and hexidecimal
; values for any numeric field. This was accomplished by totally
; re-coding PARSE and portions of ASSEM, and installing a new
; routine called EVAL. Numbers prefixed by one of the characters
; $ + & % are interpreted by EVAL as base 16, 10, 8, or 2 values
; respectively. In the absence of a prefix, the base defaults to
; hexidecimal always. ASSEM will use the zero-page form wherever
; possible unless the value is preceeded by extra zeros to force
; the absolute form (except binary notation).
;
; 2/ The MONITOR now performs limited number conversion. Additions
; were made to MAIN1 and CMDCHR and a new routine called CONVERT
; was installed to handle the conversions. Any of the characters
; $ + & % entered as a command and prefixing a numeric value are
; PARSEd (see #1 above) and the hexidecimal value printed. Full
; conversion between bases may be added in a later release.
;
;
;
; The following changes have been made to the EDITOR:
;
; 1/ PLOT (SET) now performs range checking. The cursor position
; sought must lie within the currently defined window. If it does,
; the position is changed and .C=0 returned, else NO CHANGE made
; and .C=1 returned.
;
; 2/ PLOT (READ) now returns the current cursor position within the
; current window (with respect to the window's origin) and NOT
; necessarily the screen origin.
;
; 3/ SCRORG was changed in a previous release to return the current
; window size in .X and .Y and NOT the screen size. SCRORG will
; now return the maximum screen width (39 or 79) as well in .A.
;
; 4/ The entire data file, ED7.SRC, has been relocated to $FA00 to
; allow a reserved area in ROM for foreign language systems. The
; reserved area shall be $FC80 thru $FEFF. This affects the MODE
; tables, COLor tables, BITS, local variable init table, and all
; PKY function key tables.
;
; 5/ The default screen colors for the 80-column screen have been
; changed to BLACK background and CYAN characters. This was done
; to make a more presentable screen for systems using monochrome
; monitors and allow a full pallet of colors without background
; interference for systems using RGBI monitors.
;
;
;
; The following changes have been made to the KERNAL:
;
; 1/ IOINIT now initializes the 8563 chip from an updated table now
; that the tower has been removed. Also changed were the default
; screen colors (see #5 above) and adjustments for PAL systems.
;
; 2/ IOINIT now has a delay loop of approximately 300ms incorporated
; into it to allow older versions of the VIC-1541 disk drives to
; finish their reset sequence. The system previously hung in the
; auto-boot routine if in 40-column mode with old 1541's.
;
.page
.subttl RELEASE NOTES: BETA-6 03/20/85
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE BETA-5 CODE TO CREATE THE
; BETA-6 VERSION RELEASED ON 03/20/85. THE BETA-6 RELEASE IS A PRE-PRODUCTION
; VERSION INTENDED FOR SYSTEM TEST AND EVALUATION AND PRELIMINARY APPLICATION
; SOFTWARE DEVELOPMENT ONLY. NOTE THE CHANGE TO THE CHARACTER ROM ALSO.
;
;
;
; The following changes have been made to the MONITOR:
;
; 1/ Number conversion from/to all bases (hex,dec,oct,bin) fully
; functional. Display format different from beta-5 also.
;
; 2/ The monitor DOS parser now provides DIRECTORY display using
; the syntax: @[unit#],$[drive:filespec]
;
;
;
; The following changes have been made to the EDITOR:
;
; 1/ The KEYSCAN routine was corrected to properly leave the COLM
; driver port energizing only PB7. (Previously if no keys were
; down all lines were left energized.) Also the scan of the
; CAPS LOCK key was moved to the beginning of the KEYSCAN loop
; where it will always be scanned and SHFLAG correctly updated.
; (Previously if no matrix keys were down it was not scanned.)
;
; 2/ The CLRLIN and MOVLIN routines have had all the 'kludge' code
; removed as it is no longer necessary using 8563R7 parts. Two
; absolute variables consequently have disappeared, SAV80C & D.
;
; 3/ The various tables used by the screen editor have been shifted
; around to allow better utilization of free ROM. The MODEx tables
; now start at $FA80. All other tables now float above editor code.
;
;
;
; The following changes have been made to the KERNAL:
;
; 1/ The interrupt handlers now clear decimal mode (via CLD). This
; is done AFTER the indirect jumps are made. The correct mode is
; restored upon return from the interrupt code as usual.
;
; 2/ The SERIAL & TAPE routines now work at either 1 or 2MHz speed.
; This was accomplished by replacing 'SEI' and 'CLI' opcodes in
; time sensitive routines with JSR's to new code which saves the
; current states & forces sprites off & 1MHz speed, and then re-
; stores them all when through. This required minor changes to the
; TAPE routines, but the serial ACPTR routine was totally re-coded.
; Several absolute variables to store the states have been added
; as well as one called HOLD_OFF which, if B7 is set, will cause
; these new SEI/CLI routines to be skipped & require the user to
; assume full responsibility for controlling system speed & sprites
; during tape or serial I/O operations.
;
; 3/ The space key now correctly skips the current 'found' file during
; TAPE loads. (The C= key or <no> action will initiate program load.)
;
; 4/ The CLOSE routine now saves the CARRY status in SVXT and not VERCK.
; This corrects a conflict with the LOAD routine's use of VERCK.
;
; 5/ The BURST routine now correctly reports a 'device not present'. It
; previously reported 'illegal device number'.
;
; 6/ Improved TKSA (serial routine) turnaround by putting DEBPIA inline.
;
; 7/ The OPEN routine now JSR's to OPENI for serial operations. This
; corrects a problem that occurred when the device was not present.
; OPENI pops the return address and JMPs to ERROR5 at such time.
;
; 8/ The INSTALL routine now downloads to RAM the correct code for the
; DMA Controller. Previously the wrong subroutine was downloaded.
; Also, a NOP was added to the RAM code after the DMA request.
;
;
;
; The following changes have been made to the CHARACTER ROM:
;
; 1/ Part number 315010-02 has a minor error in the font definition
; for the lower case reverse field 'v'. This has been corrected in
; part number 315010-03.
;
; 2/ Part number 315010-03 also includes a modification to the lower
; case 'm' character (both normal & reverse fields) due to several
; complaints about its appearance.
;
.page
.subttl RELEASE NOTES: BETA-7 04/08/85
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE BETA-6 CODE TO CREATE THE
; BETA-7 VERSION RELEASED ON 04/08/85. THE BETA-7 RELEASE IS A PRE-PRODUCTION
; VERSION INTENDED FOR SYSTEM TEST AND EVALUATION AND PRELIMINARY APPLICATION
; SOFTWARE DEVELOPMENT ONLY. NOTE THE CHANGE TO THE CHARACTER ROM ALSO.
;
;
;
; The following changes have been made to the MONITOR:
;
; 1/ Previously the HUNT command treated <colon> and <question> in
; ASCII strings as terminators, hence they could not be hunted
; for. This has been corrected.
;
; The following changes have been made to the KERNAL:
;
; 1/ Previously the GO64 routine redirected the soft RESET vector
; back to itself thus providing a degree of protection to C/64
; software as the system had to be powered down to escape C/64
; mode. Unfortunately DRAM devices are not as volatile as they
; used to be and many systems required as much as 30 seconds to
; elapse before they would power up into C/128 mode. The RESET
; vector is still present but the GO64 code no longer redirects
; it. Applications using RESET should note the problem and pro-
; vide a friendly escape mechanism after protecting themselves.
;
; 2/ Previously it was possible to enter C64 mode running at 2MHz.
; This has been corrected. Note it is possible from C64 mode to
; access the 1-2MHz bit (VIC register 48) to speed up certain
; operations if so desired.
;
; 3/ Several minor changes to SERIAL code. Some inaccessable code
; was removed from TALK/LISTEN routine. TKSA now errors out if
; the SA could not be sent.
;
; 4/ Previously the BOOT routine returned without reporting any
; errors. BOOT now returns errors in the same manner as LOADs,
; with the carry set and error code in the accumulator.
;
; 5/ Previously the BURST load mechanism caused open disk channels
; to be flushed. This has been corrected and now preserves open
; user channels as the C/64 LOAD had (e.g. chaining programs).
; Note however that BOOT loads will cause all open files for
; the given device to be closed (see CLOSE_ALL note below).
;
; 6/ BURST must UNLISTEN the 1571 when a break occurs (STOP key)
; to signal the drive to abort the operation. Previously the
; drive stayed in its burst routine waiting to send the next
; block of data. This fix will prompt the drive to abort too.
;
; 7/ The DMA controller routine (for RAMDISK) has been modified to
; meet the latest RAMDISK specification.
;
; 8/ A new Kernal JUMP TABLE entry has been created for an all new
; Kernal subroutine, CLOSE_ALL. Unlike CLALL, which simply
; cleared the LAT, FAT, SAT tables and restored the default I/O
; devices without properly closing files, CLOSE_ALL is passed a
; device number (fa) and properly closes ALL open files on that
; device. If that device was the current I/O device, only then
; will CLOSE_ALL restore the appropriate default device. This
; new jump vector is located at $FF4A.
;
; 9/ The Kernal IOINIT routine will recognize 8563-R8 & initialize
; register #25 (horz. smooth scroll) to $47 per 8563 spec mods.
; Previously this register was initialized to $40. Note that
; the lower 3 bits of the 8563 status register will return the
; revision level of the 8563 part (0=R7, 1=R8, etc.)
;
;
; The following changes have been made to the CHARACTER ROM:
;
; 1/ The hardware now supports an 8K byte character ROM. The lower
; 4K contains the C/64 character set (P/N 901225-01), and the
; upper 4K contains the C/128 character set (P/N 315010-03).
; In domestic systems the switching mechanism is the /64-128
; MMU signal and is therefore transparent to the user. It has
; been proposed that international units replace one of the 4K
; character sets with their particular national character set
; and utilize the CAPS_LOCK key to manually switch sets.
.page
.subttl RELEASE NOTES: BETA-8 04/15/85
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE BETA-7 CODE TO CREATE THE
; BETA-8 VERSION RELEASED ON 04/15/85. THE BETA-8 RELEASE IS A PRE-PRODUCTION
; VERSION INTENDED FOR SYSTEM TEST AND EVALUATION AND PRELIMINARY APPLICATION
; SOFTWARE DEVELOPMENT ONLY.
;
; **************************************************************
; * PENDING SYSTEM TEST, THIS SHALL BE THE FINAL BETA RELEASE. *
; * ANY PROBLEMS OR NEEDS *MUST* BE REPORTED TO SYSTEM *
; * ENGINEERING BEFORE 04/19/85 FOR RESOLUTION AND INCLUSION *
; * INTO THE PRODUCTION ROM RELEASE! *
; **************************************************************
;
;
;
;
; The following changes have been made to the MONITOR:
;
; 1/ The Monitor DOS interface now uses the reserved logical
; channel number 0, and no longer transmits a 'close' to the
; disk. Previously it used channel 1 (which was often in use by
; the user) and performed a full 'close' (which caused the disk
; to close ALL open files).
;
; 2/ The Monitor DOS interface no longer allows access to unit
; numbers 3 and 31. They are illegal serial bus devices.
;
; 3/ The Monitor MEMORY DUMP facility correctly displays the full
; CBM ASCII character set. Previously the ASCII was masked to
; 7 bits.
;
; The following changes have been made to the KERNAL:
;
; 1/ The Kernal BOOT routine no longer transmits a 'close' to the
; disk. The disk status will now reflect the last I/O operation
; status similar to a 'load' operation. A reduntant attempt to
; transmit the disk warm start (UI) command was removed.
;
; 2/ The Kernal GO64 routine now insures that the 6510 port /HIRAM
; and /LORAM lines are set HIGH before entering C64 mode.
; Previously entering C64 mode (where /HIRAM and /LORAM select
; RAM and ROM memory configurations) from a C128 graphics mode
; (where /HIRAM and /LORAM select VIC and processor color
; nybble banks) would crash the C64 system because its system
; ROM was not in context and entry was not via hardware reset.
;
;
; The following changes have been made to the EDITOR:
;
; 1/ The IRQ screen handler has been modified to accommodate 2 MHz
; split screen operation. Previously the split screen operation
; in 2 MHz mode caused the IRQ keyscan to be skipped.
;
; 2/ A difference between the C64 and C128 screen editors has been
; noted but will NOT BE CHANGED because the same anomaly occurs
; with the windowing editor on other products. The effect is
; illustrated by the following BASIC operation:
;
; 10 OPEN 1,0 :REM OPEN CHANNEL TO KEYBOARD
; 20 INPUT#1,A$ :REM INPUT A LINE
; 30 PRINT A$ :REM DISPLAY LINE INPUT
;
; The PRINT A$ will overwrite the last character of the string
; entered in response to the 'INPUT'. The C/64 editor does not
; overwrite; in fact there are extra spaces found between the
; input and output strings. Any requests to change this should
; be sent as soon as possible!
;
.page
.subttl RELEASE NOTES: BETA-8 04/15/85
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE BETA-8 CODE TO CREATE THE
; BETA-9 VERSION RELEASED ON 04/19/85. THE BETA-8 RELEASE IS A PRE-PRODUCTION
; VERSION INTENDED FOR SYSTEM TEST AND EVALUATION AND PRELIMINARY APPLICATION
; SOFTWARE DEVELOPMENT ONLY.
;
; **************************************************************
; * PENDING SYSTEM TEST, THIS SHALL BE THE FINAL BETA RELEASE. *
; **************************************************************
;
;
; The following changes have been made to the KERNAL:
;
; 1/ The Kernal TAPE handler previously returned the wrong error
; code upon encountering the EOT. This has been fixed to report
; 'file not found'.
;
; The following changes have been made to the EDITOR:
;
; 1/ DOCUMENTATION ONLY: Please note that the Editor does not
; factor in 'VM1' when utilizing 'LDTBL1'. This means that the
; IRQ screen handler WILL move the screen per VM1 but that all
; printing will continue to update the screen at $400. Because
; LDTBL1 is in ROM it cannot be modified as in the C/64. Any
; requests to change this mechanism must be made NOW.
;
; 2/ The Editor now includes the National keyboard lookup tables
; and a National-to-ASCII conversion table. While there is no
; National keyboard driver code in ROM, it is expected that the
; inclusion of these tables will provide sufficient support for
; RAM or Function Cartridge based drivers. AN APPLICATION NOTE
; WILL BE FORTHCOMING TO DETAIL THE IMPLEMENTATION OF A DRIVER.
;
; The following changes reference ALL sections of code:
;
; 1/ The three (3) C/128 ROMs now contain a revision byte and a
; byte reserved for 'rounding' the checksum. The locations are
; given below. Please note that the 'revision' byte described
; here refers to the individual ROM contents, NOT to the
; software (e.g.: the KERNAL software revision byte is $FF80).
;
; LOW (U33): $7FFE - REVISION BYTE
; $7FFF - CHECKSUM ADJUST
;
; MID (U34): $BFFE - REVISION BYTE
; $BFFF - CHECKSUM ADJUST
;
; HIGH (U35): $CFFE - REVISION BYTE
; $CFFF - CHECKSUM ADJUST
;
; The 8-bit checksum is calculated over the ROM's contents by
; adding the sequential bytes for each 16KB ROM, discarding any
; carry between additions. Thus the sum of each ROM should be
; equal to the MSB of its starting address (e.g.: LO=$40, MID=
; $80, HI=$C0). Please note the checksum of the HI (U35) ROM
; does NOT include the CP/M portion (address range $D000-$DFFF)
; as this section of ROM cannot be read by the host processor.
.page
.subttl RELEASE NOTES: 318020-03 05/08/85
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE 318020-02 CODE TO CREATE
; THE 318020-03 VERSION RELEASED ON 05/08/85. THIS RELEASE IS MADE TO CREATE
; MASKED ROMS FOR PRODUCTION.
;
;
;
; The following changes have been made to the KERNAL:
;
; 1/ Previously the IOINIT routine improperly initialized PAL and
; 'R8' versions of the 8563 80-column display device. This has
; been corrected. Testing of these modes has been very limited.
;
; 2/ Previously the fast SERIAL routine SPINP forced the 50/60 Hz
; flag on D1CRA low (60Hz). This has been corrected to preserve
; the status of this line.
;
; 3/ A new jump table entry has been created for the fast SERIAL
; routines SPINP and SPOUT at $FF47. Users must enter with the
; carry flag clear to select SPINP and carry flag set for SPOUT
;
; 4/ Previously the SERIAL routine DISK_CLI enabled IRQ's before
; restoring the sprite enable register. This caused the BASIC
; IRQ sprite handler, under stress, to lose sprites. This has
; been corrected. The fix required a change as well to the TAPE
; routine TNIF which shared portions of the DISK_CLI routine.
; The shared code has been eliminated by copying the necessary
; portions to TNIF.
;
; 5/ Previously the Kernal RAM code for JMPFAR called the GETCFG
; ROM code directly. To preserve code modularity, the direct
; address was replaced by the Kernal jump table address.
;
; The following changes have been made to the EDITOR:
;
; 1/ Due to remaining problems with the 8563 block fill function,
; the so-called KLUDGE code has again been added to the CLRLIN
; routine. This patch will clear up the occasional characters
; seen on the 80-column text screen after a SCNCLR, and will be
; valid even after the 8563 bug is fixed. Two (2) absolute RAM
; variables were added to DECLARE without disturbing anything.
;
; 2/ Previously it was not possible to move the VIC 40-column text
; screen and still utilize the screen editor because LDTB1 is
; is ROM based (unlke the C64 which is RAM based). To provide
; this capability a new variable, LDTB1_SA has been created and
; may be used in conjunction with the variable VM1 to move the
; VIC text screen. VM1 should be written instead of VIC reg #24
; (default value $14) and LDTB1_SA loaded with the high byte of
; the new screen location (default value $04). Please note that
; the placement of VIC video matrices is limited by the image
; of the character ROM VIC sees at $1000-$1FFF and the presence
; of ROM beginning at $4000 in the system's memory map. This
; change affected Editor routines SCRSET and MOVLIN which used
; LDTB1 directly, and CINT which now initializes LDTB1_SA.
;
; 3/ There was a problem with windows one (1) character wide in 80
; column mode which affected areas outside the window. It was
; been corrected by testing for this special case in CLRL80.
;
; 4/ The NATIONAL keyboard lookup tables and the National-to-ASCII
; conversion table have been removed. They were found to be
; unnecessary for Foreign-language systems and insufficent for
; other applications. AN APPLICATION NOTE IS FORTHCOMING.
;
; 5/ The handling of 8563s special attributes (ALT, RVS, UNDERLINE
; and FLASH) has been made more consistant throughout. The
; BLANK and CLRLN routines now strip all attributes except ALT.
; (this will affect, for example, INSERT and DELETE). Various
; other routines now preserve the RVS bit (not to be confused
; with reverse-field mode; this hardware bit is unused by the
; system but can be set by the user).
;
; 6/ A single <ESCAPE> no longer cancels all editor modes (e.g.
; quote, insert, underline, flash & reverse). A double <ESCAPE>
; or <ESCAPE>-O is now required.
;
.page
.subttl RELEASE NOTES: 318018-04, 318019-04, 318020-05 11/07/86
;
; C128 ROM RELEASE NOTES: 318018-04, 318019-04, 318020-05
; 318022-02, 318023-02
;
;
; THE FOLLOWING MODIFICATIONS HAVE BEEN MADE TO THE 318018-02, 318019-02, AND
; 318020-03 CODE TO CREATE A NEW ROM SET RELEASED ON 11/07/86. THIS RELEASE
; IS MADE TO CREATE MASKED ROMS FOR PRODUCTION. THESE ROMS ARE TO BE USED AS
; A SET, REPLACING THE PREVIOUS ROM SET ENTIRELY. THEY ARE NOT TO BE MIXED.
; THIS RELEASE IS MADE SIMULTANEOUSLY IN THE FORM OF 16KB AND 32KB ROMS, FOR
; USE IN THE FOLLOWING SYSTEMS: C128, C128D, C128CR, C128DCR, AS APPROPRIATE.
;
;
;
; PLEASE NOTE: AN 11/18/85 ENGINEERING RELEASE OF A C128 ROM SET WAS NEVER
; RELEASED TO PRODUCTION, AND ACCOUNTS FOR THE APPARENT JUMP IN ROM REVISION
; NUMBERS. THE FOLLOWING INFORMATION INCLUDES THOSE DIFFERENCES AS WELL.
;
;
;
; The following information represents a filtered condensation of
; all known problems, complaints, and suggestions that pertain to
; the C/128 system software to date (exclusive of CP/M). The
; current ("original" ROMs) system software consists of:
;
;
;
;
; 1. Part No. 318018-02 --> BASIC LOW ($4000-$7FFF)
;
; 2. Part No. 318019-02 --> BASIC HIGH, MONITOR ($8000-$BFFF)
;
; 3. Part No. 318020-03 --> EDITOR, KERNEL, CP/M ($C000-$FFFF)
;
; 4. Part No. 315078-02 --> DIN ED, KERNEL, CP/M ($C000-$FFFF)
;
; 5. Part No. 318022-01 --> BASIC, MONITOR ($4000-$BFFF)
; (includes 1+2 above)
;
; 6. Part No. 318023-01 --> ED, KERN, CP/M, C64 ($C000-$FFFF)
; (includes 3+4 above)
;
;
;
; Each 16KB ROM block contains a small patch area for changes, and
; all patches described below have been accomplished such that any
; particular change will never affect more than one ROM. Similarly
; each ROM contains a revision status byte (at $7FFE, $BFFE, and
; $CFFE) which software can test to determine the version of the
; host system. The "original" ROMs contain $00 in these locations
; and the "update" ROMs described herein contain $01. Each ROM
; has had several changes, as summarized on the following pages.
;
;
;
; Part Number 318018-04 --> BASIC LOW ($4000-$7FFF)
;
; 1. LIST and DELETE commands. Previously they did not report as
; errors certain non-numeric characters passed as arguments,
; such as 'LIST A'. This has been corrected totally in-line
; by adjusting an erroneous relative branch in the 'RANGE'
; subroutine.
;
; 2. CIRCLE command. Previously an unspecified Y-radius
; defaulted to the X-radius (as it should), but the X-radius
; value had already been scaled for the X-axis and not the
; Y-axis. This has been corrected totally in-line by scaling
; the radii after the defaults have been established.
;
; 3. RS-232 STatus. Previously accessing ST after RS-232 I/O
; resulted in an incorrect status being returned from, and a
; zero written to, location $10A14, possibly corrupting the
; BASIC variable area. This was a result of BASIC calling the
; Kernel routine 'READSS' with the incorrect RAM bank in
; context. This has been corrected totally in-line by
; substituting the correct BASIC subroutine call.
;
; 4. CHAR command. Previously using CHAR with the 80-column text
; screen (GRAPHIC mode 5) resulted in RAM corruption at
; locations $D600 and $D601 of RAM bank 0 (the BASIC text
; bank) due to BASIC calling the Editor PLOT routine without
; the I/O block in context. This has been corrected utilizing
; two patch subroutines.
;
; 5. RENUMBER command. Previously the pass 2 routine, which was
; to pre-scan BASIC text and report 'out of memory' errors
; prior to actually changing anything, was seriously flawed.
; This has been corrected utilizing a patch subroutine.
;
; 6. DELETE command. Previously did not limit-check itself when
; moving down BASIC text, therefore it was possible to crash
; when DELETEing lines at or near the top of memory (near the
; MMU configuration registers). This has been corrected
;+ utilizing a patch subroutine. Also, DELETE previously
;+ exited to MAIN via 'JMP', effectively ending the evaluation
;+ of the current command string. This has been corrected by
;+ substituting an 'RTS', allowing direct commands like
;+ 'DELETE 10: PRINT"DELETED LINE 10"' to work correctly.
;
;+ 7. PLAY command. Previously the SID frequency tables were not
;+ exactly NTSC concert pitch. Also, there was no provision for
;+ adjusting the frequency for PAL systems. This has been
;+ corrected by changing the (NTSC) frequency tables, creating
;+ new PAL tables, and utilizing patch code to select from the
;+ appropriate table as determined by the Kernel PAL_NTSC flag.
;
;+ 8. The BASIC ERROR handler previously failed to clear pending
;+ string temporaries when an error was TRAPed. This has been
;+ corrected via patch code to reset TEMPT to TEMPST.
;
;+ 9. The powerup copyright notice has been updated to 1986, which
;+ will serve as an immediate visual indication of the ROM
;+ update status. Also, a new notice has been placed at $7FC0.
;
; 10. The ROM signature at location $7FFC and $7FFD (lo/hi) is
; $8DEF. (new since last release).
;
; 11. The ROM revision byte at location $7FFE, has incremented
; from $00 to $01.
;
; 12. The ROM checksum byte at location $7FFF, has changed from
; $4C to $61.
;
;
; Part Number 318019-04 --> BASIC HIGH, MONITOR ($8000-$BFFF)
;
; 13. RSPRITE and RSPPOS functions. Previously they accepted as
; parameters sprite numbers in the range 1-16, which is
; incorrect. This has been corrected totally in-line by
; limiting the range check to 1-8, and reporting an illegal
; quantity error for sprite numbers outside this range.
;
; 14. PRINT USING command. Previously there was an anomaly
; involving the use of floating money symbols ('$') and
; commas. The command 'PRINT USING "#,##$.##"; 123.45', for
; example, resulted in the output '$,123.45', which is
; incorrect. This has been fixed utilizing a patch subroutine
; which checks specifically for the '$,' occurrence and
; substitutes a '_$' ('_' = fill character) whenever found.
;
; 15. Relative Coordinates for all graphic commands (except
; MOVSPR) were incorrectly processed. The problem was
; apparent when negative relative coordinates were used, which
; resulted in an illegal quantity error. This has been
; corrected totally in-line by substituting a different
; subroutine call to pre-existing code. This change affects
; the BASIC commands LOCATE, DRAW, PAINT, BOX, CIRCLE, GSHAPE,
; and SSHAPE. This change also allows negative absolute
; coordinates to be accepted (previously they resulted in an
; illegal quantity error), although the legal range remains a
; 16-bit value: 0-65535 (unsigned) or -32768 to 32767
; (signed: i.e., -1 is equivalent to 65535).
;
; 16. DOPEN and APPEND commands. Previously it was possible to
; open two or more disk channels with the same logical file
; number without incurring an error report. This has been
; corrected totally in-line.
;
;+ 17. MATH package. An original bug fix (ref: double zero bug)
;+ to the (F)MULT routine has been found to result in small
;+ errors (such as 2^15 = 32768.0001). This has been corrected
;+ totally in line by fixing the original (dbl-0) problem in a
;+ different way.
;
;+ 18. A copyright notice has been placed, starting at $BFC0.
;
; 19. The ROM signature at location $BFFC and $BFFD (lo/hi) is
; $CDC8. (new since last release).
;
; 20. The ROM revision byte at location $BFFE, has incremented
; from $00 to $01.
;
; 21. The ROM checksum byte at location $BFFF, has changed from
; $3A to $C5.
;
;
; Part number 318020-05 --> EDITOR, KERNEL, CP/M ($C000-$FFFF)
;
; 22. CAPS LOCK Q. Previously an error in a key matrix decode
; table caused a lower-case 'Q' to be passed when the keyboard
; is in CAPS LOCK mode. The table has been corrected by
; substituting the correct value for upper-case 'Q'.
;
;+ 23. FUNCTION KEYs. Previously the funcion key handler, part of
;+ the SCNKEY routine at CKIT2, failed to detect a funtion key
;+ string pending. This has been corrected via patch routine,
;+ which will ignore new function key depressions until the
;+ string in progress has been output (i.e., KYNDX = 0). Also,
;+ DOPFKY now exits via SCNRTS, instead of simply RTSing.
;
; 24. IOINIT system initialization. Previously the RS-232
; pseudo-6551 registers were not initialized because these
; values are expected to be given by the user whenever RS-232
; channels are OPENed. Apparently many C64 users have taken
; advantage of the fact the C64 'happened' to clear these
; locations and fail to specify critical parameters. These
; RS-232 registers are now initialized to default to: no
; parity, full duplex, 3-line, 1-stop bit, 8-bit words and 300
; baud, via a patch subroutine.
;
; 25. IOINIT PAL system initialization. Adjustments have been
; made to the 8563 initialization values for PAL systems. The
; PAL horizontal total (register 0) changes from $7E to $7F.
; The PAL vertical total (register 4) changes from $27 to $26.
; These changes shift the cycle time from 20.320us to
; 20.032us. The patch required a patch subroutine, as well as
; a change to VDCTBL.
;
; 26. BASIN system call. Previously attempting input from a
; logical channel to the screen (e.g., via INPUT#) resulted in
; line too long errors. This has been corrected utilizing a
; subroutine patch to preserve bit-7 of CRSW, which serves as
; a flag to the Editor that a (pseudo) end-of-line has been
;+ reached. Also, TBLX is copied to LINTMP to correctly locate
;+ the current cursor line for the Editor. Please note that
;+ switching between the 40 and 80-column text screens, opening
;+ and closing windows, or clearing text screens can confuse
;+ logical screen channels. The Editor variable LINTMP ($A30)
;+ is a global, not local, variable as it should have been.
;+ Users can POKE LINTMP with the logical screen line number
;+ before INPUT#'s as a work-around.
;
; 27. OPEN RS-232 system call. Previously it was possible to
; receive a carry-set status, normally indicating a error,
; when no error existed after OPENing an RS-232 channel. This
; has been corrected totally in-line by a modification to the
; code which checks for the proper X-line hardware states.
;
; 28. LOAD system call. Previously the normal (a.k.a. SLOW) load
; mechanism did not preserve the starting address of any
; LOADs, which made the BASIC 'BOOT "file"' command form
; malfunction unpredictably. This is apparent only when used
; with 1541 drives. This has been corrected via a patch
; subroutine, which saves the starting address of all LOADed
; files at SAL and SAH, the same place the fast (a.k.a.
; BURST) load mechanism does.
;
; 29. DMA system call. Previously the Kernel forced the I/O block
; into the user's memory configuration at all times, which is
; no longer necessary and, in fact, seriously limits the
; functionality of the RAM expansion cartridge. This has been
; corrected by a ROM patch routine, which affects all Kernel
; DMA system calls as well as the BASIC FETCH, STASH, and SWAP
;+ commands. Also, previously it was possible for an IRQ to
;+ occur between the 'arm DMA' and 'trigger DMA' sequences,
;+ resulting in a DMA operation with the system configuration
;+ in context regardless of desired configuration. This has
;+ been corrected by adding 'PHP/SEI...PLP' instructions around
;+ the JSR to DMA RAM code at $3F0. Applications using the DMA
;+ RAM code at $3F0 should do likewise. Finally, in this patch
;+ changes were made to enable DMA operations to all RAM banks
;+ by correctly using the VIC bank pointer found in the MMU RAM
;+ configuration register ($D506, VA16=bit-6 and VA17=bit-7).
;+ Applications using the Kernel routine at $FF50 will inherit
;+ these changes automatically. Please note that NMI interrupts
;+ can screw-up DMA operations, as they cannot be masked.
;
;+ 30. A copyright notice has been placed, starting at $CFC0.
;
;+ 31. The ROM location $CFF8 is reserved for national character
;+ ROM checksums. This does not apply to US ROMs, which contain
;+ $FF here. (new since last release).
;
; 32. The ROM location $CFF9 is now reserved for country codes.
; The US ROMs contain $FF here. (new since last release).
;
; 33. The ROM location $CFFA and $CFFB (lo/hi) contain the
; national character set signature. This does not apply to US
; ROMs, which contain $FFFF here. (new since last release).
;
; 34. The ROM signature at location $CFFC and $CFFD (lo/hi) is
; $8F76. (new since last release).
;
; 35. The ROM revision byte at location $CFFE, has incremented
; from $00 to $01.
;
; 36. The ROM checksum byte at location $CFFF, has changed from
; $C3 to $3C.
;
; 37. The Kernel revision byte at location $FF80 has incremented
; from $00 to $01.
;
;
; Part number 315078-03 --> DIN ED, KERNEL, CP/M ($C000-$FFFF)
;
;+ There have been no revisions to the national portions of the
;+ many national Kernel/Editor ROMs. All revisions described above
;+ for the US version have also been made to the national versions.
;
;
;+ 38. A copyright notice has been placed, starting at $CFC0.
;
;+ 39. The ROM location $CFF8 is reserved for national character
;+ ROM checksums. The German/Austrian (DIN) ROMs contain a $FF
;+ here (that really is the checksum!).
;
; 40. The ROM location $CFF9 is now reserved for country codes.
; The German/Austrian (DIN) ROMs contain $00 here. US ROMs
; contain $FF here.
;
; 41. The ROM location $CFFA and $CFFB (lo/hi) contain the
; national character set signature. The DIN ROMs contain
; $91F3 here. This is unused ($FFFF) for US ROMs.
;
; 42. The ROM signature at location $CFFC and $CFFD (lo/hi) is
; $EA3B.
;
; 43. The ROM revision byte at location $CFFE, has incremented
; from $00 to $01.
;
; 44. The ROM checksum byte at location $CFFF, has changed from
; $C3 to $4C.
;
; 45. The Kernel revision byte at location $FF80 has incremented
; from $00 to $01.
;
;
; C/128 developer and documentation notes
;
; There were quite a few items that, for one reason or another, I
; categorized as un-fixable as the fix would compromise
; compatibility or be too radical given the work-around or
; relative severity of the problem. They are included here to
; document them along with any implications, work-arounds, etc.
;
; 1. DMA interface. It should also be noted that DMA hardware is
; unreliable at 2MHz clock speeds and consequently the user
; must insure 1MHz (SLOW) mode is used before any DMA
;+ operations are performed. NMI interrupts will also cause
;+ problems, and should be disabled or somehow avoided. RS-232
;+ operations use NMIs; the remote should be XOFFed or the
;+ channel disabled before DMA operations are performed.
;
; 2. IRQ handler. It is possible for the Kernel IRQ handler to
; perform a keyscan when the IRQ was not the Kernel's. While
; the fix is trivial, I did not include it because it might
; cause problems with existing software which may be taking
; advantage of the unintentional keyscans.
;
; 3. IRQ and NMI handlers. The Kernel forces the system bank
; into context before taking the RAM indirect vectors to the
; actual interrupt handler. Much flexibility can be added to
; the mechanism if the memory bank to be brought into context
; at interrupt time could be read from a variable instead of a
; ROM constant. I am reluctant to include this change because
; the RAM variable would have to be located in a previously
; 'free' location, which may be used by existing applications.
;
; 4. SAVE-to-disk. It is not possible to SAVE the last byte of
; any memory bank (e.g., RAM at $FFFF), because the SAVE
; routine requires you to specify the end of the area to be
; SAVEd as the ending address PLUS ONE ($FFFF+1 -> $0000).
; This is a problem found on all CBM 65xx systems.
;
; 5. SAVE-to-cassette. It is not possible to save the last page
; of any memory bank (e.g., RAM at $FF00-$FFFF) to tape. The
; tape handler hangs with the motor running until the user
; STOPs it. This is a problem found on all CBM 65xx systems
; except the Plus-4.
;
; 6. SAVE and LOAD. While program SAVEs correctly save the
; 16-bit starting address for future LOADs, the existing
; formats do not save the memory bank. This cannot be
; accommodated without the creation of special C128 program
; headers for disk and tape, which is undesirable and
; non-trivial.
;
; 7. STOP/RESET monitor entry. It is not possible to enter the
; Monitor directly via the STOP/RESET sequence from BASIC and
; then eXit back to BASIC without incurring a 'cold' BASIC
; initialization. The alternative, taking the BASIC 'warm'
; start route, would result in a system crash if BASIC had not
; been properly initialized and is therefore not a recommended
; fix. The work-around, assuming BASIC was running before
; STOP/RESET, is for the user to place the value $C1 into
; location $A04 (INITSTATUS) and then eXit.
;
; 8. Monitor 'H' (hunt) command. Because the editor performs
; various translations on data read from the screen, it is not
; possible to Hunt for certain CBM characters, such as pi and
; all reverse-field characters.
;
; 9. BOX command. BOX, because of the particular algorithm
; utilized, has a restricted range of -16384 to +16383
; (unscaled). The algorithm uses parameters that are twice
; those given for calculations and divides down the result
; before plotting. Thus it is possible for very large
; (unscaled) positive coordinates to result in large negative
; plots. The work-around is to use SCALEing, user
; range-checking, or avoid BOX and use either DRAW or CIRCLE
; commands instead.
;
; 10. RDOT, PEN, and RSPPOS functions. These BASIC functions
; return the current pixel cursor, lightpen and sprite
; positions, respectively, but the values they return are
; unSCALEd. Correcting this is trivial, but would result in
; problems for existing applications as well as being
; incompatible with C64 VSP and the PLUS-4.
;
; 11. FNDEF and GRAPHIC modes. After defining a user function,
; anything that results in program relocation must be avoided,
; such as GRAPHIC 'n' or GRAPHIC CLR. There is no fix
; planned. The work-around is a general rule: define GRAPHIC
; screens first (then SCALE), then define functions.
;
; 12. HELP command. HELP does not completely identify two type of
; syntax errors: 'RUN n' where 'n' is an undefined statement,
; and 'XXXX n' where 'XXXX' is any BASIC command which expects
; no argument. In the RUN case, TXTPTR had already been
; reset, but not OLDLIN, thus the correct line is displayed
; but without any highlighting. In the other case, because
; XEQCM exits via CHRGET, TXTPTR is incremented before the
; error is caught, resulting in part of the error not being
; highlighted. The fix would be too complex, especially
; considering the fact that the line containing the error is
; reported, albeit without highlighting.
;
; 13. GETKEY function. In the form 'GETKEY A', this BASIC
; function should wait until a numeric key is pressed, but
; certain non-numeric keys are accepted, such as 'E', colon,
; comma, period, '+', and '-'. The same anomaly occurs with
; 'GET A' for the same reason, as is a known CBM quirk.
;
; 14. PUDEF and PRINT USING commands. There is poor documentation
; of the fact that USING format fields such as "$,###.##", the
; leading '$' or commas are not interpreted per the PUDEFs as
; they are considered not part of the numeric field. This is
; found to occur in all versions of CBM BASIC 3.5 or higher.
;
; 15. RENUMBER command. Because of the routine's use of LINNUM to
; fetch from BASIC text the statement number of an object, it
; is possible to get a 'syntax error' when none existed within
; the RENUMBER command line itself. LINNUM itself reports any
; line numbers it reads that are out of range (>63999).
; Actually, you could use this to 'protect' a program from
; RENUMBERing. Also note that RENUMBER can not renumber line
; ranges. Therefore, LIST and DELETE statements within a
; program are NOT changed nor will they generate any errors.
;
; 16. OUT of MEMORY ERROR. It is possible to hang the system with
; this error from a running program when there is insufficient
; memory to contain the string representation of the original
; line number where the error occurred. One must STOP/RESTORE
; the system and type CLR to recover. This problem is found
; on most CBM 65xx systems.
;
;+ 17. BASIN ($FFCF) calls return <space><return> to <return> input
;+ (i.e., null input line). The culprit is an unnecessary BEQ
;+ test in LOOP4, which was left in for compatibility with the
;+ C64 and PLUS-4 editors, which behave in a similar manner.
;
;+ 18. MATH package. The binding of operators is such that unary
;+ minuses are evaluated after powers. This results in NO error
;+ when equations of the form (-4^.5) are evaluated (square
;+ root of a negative number). Of course, the error is given if
;+ the sign of the number is known when the power is applied
;+ (eg., X=-4 :PRINT X^.5). This is a known CBM quirk.
;
;+ 19. BASIC DOS commands, such as DOPEN and APPEND, limit
;+ filenames to 16 characters maximum. However, when the name
;+ string includes the filetype, such as "LONGLONGLONGLONG,P",
;+ BASIC reports a FILENAME TOO LONG error when, in fact, it is
;+ valid. This is a problem on all CBM systems > DOS 3.0.
;
;+ 20. DCLOSE accepts both LFN and UNIT parameters simultaneously,
;+ which it should not (they should be mutually exclusive). The
;+ LFN is always used, and the UNIT ignored, if both are given.
;
;+ 21. AUTO command puts next line number into the KEY buffer. It
;+ should probably just print it. This only causes a problem
;+ when used with function key strings containing <return>s.
;
; 22. INSERT Editor mode is not canceled by specific ESCAPE
; sequences which move the cursor. For example,
; <INS><INS><INS> <ESC>K <CRSR><CRSR><CRSR> illustrates that
; staying in INSERT mode after moving the cursor to the EOL is
; undesirable.
;
; 23. CIRCLE command in multicolor mode calculates default
; Y-radius based upon twice the X-radius. This is
; undesirable, but maintained to preserve compatibility among
; C64 VSP, PLUS-4, and C128.
;
;+ 24. TAPEs written in FAST mode are occasionally hard to read in
;+ SLOW mode. While I would not be surprised by this, I could
;+ not repeat the problem. The complaint comes from PAL/50Hz
;+ environments, but that may be the only place tapes are used!
;+ Users should take care to use tapes only in SLOW (1MHz) mode
;+ so that the tapes can be read on PETs, 8032s, C64s, etc.
;
;+ 25. VERIFY and DVERIFY will report 'verify error' when, in fact,
;+ the programs are identical. This occurs when the LOADed
;+ version of the BASIC program has been relocated since it was
;+ SAVEd, usually the result of the GRAPHIC command. In such
;+ cases, the MSB of line links differ, and (D)VERIFY fails.
;+ Try GRAPHIC <n|CLR> as appropriate and try again.
;
;
; The updated C/128 16KB ROM set bears the following part numbers. (The
; PCB socket number is valid only for original PCBs).
;
;
;
; 1. # 318018-04 --> BASIC LOW ($4000-$7FFF, U33) cksum= 9A40
;
; 2. # 318019-04 --> BASIC HIGH, MONITOR ($8000-$BFFF, U34) cksum= 6F80
;
; 3. # 318020-05 --> EDITOR, KERNEL, CP/M ($C000-$FFFF, U35) cksum= EEC4
;
; 4. # 315078-03 --> DIN ED, KERNEL, CP/M ($C000-$FFFF, U35) cksum= E4C4
;
;
;
; The new C/128 32KB ROM set bears the following part numbers.
;
;
;
; 1. # 318022-02 --> BASIC, MONITOR ($4000-$BFFF, U34) cksum= 09C0
;
; 2. # 318023-02 --> EDITOR, KERNEL, CP/M ($C000-$FFFF, U32) cksum= F324
;
; (Note that #2 above also contains the C/64 ROM code.)
;
;
;
;
; Fred Bowen 11/07/86

179
EDITOR_C128_NATIONAL/routines.src

@ -0,0 +1,179 @@
.page
.subttl 80-column editor routines (01/17/85)
swap
sta lstchr ;<escape> entry: must update 'lstchr' BEFORE swap!
swapper
ldx #.swapend-.swapbeg
1$ ldy .swapout,x
lda .swapbeg,x ;swap local editor variables
sta .swapout,x
tya
sta .swapbeg,x
dex
bpl 1$
ldx #13
2$ ldy .swapmap,x ;swap tab map and line wrap tables
lda tabmap,x
sta .swapmap,x
tya
sta tabmap,x
dex
bpl 2$
lda mode ;toggle 40/80 device mode flag
eor #$80
sta mode
swrts rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
cursor bit mode ;move the 8563 cursor
bpl swrts ;...branch if 80-col swapped out & rts
ldx #14 ;update the 8563 hardware cursor position
clc
lda pnt
adc pntr
pha ;cursor position low
lda pnt+1
adc #0
jsr vdcout ;cursor position high
inx
pla
jmp vdcout ;& rts
crsron bit mode ;enable the cursor on current screen
bpl crsr40 ;...branch if 40-column screen active
jsr scolor
ldy pntr ;set 'user' & .y to current position
jsr getusr ;read attribute byte at cursor
jsr vdcget
sta curcol ;save it
and #$f0
sta saver ;strip off color but save other attributes
jsr getusr
lda color ;get current attribute byte
and #$0f ;strip off special attributes but save color
ora saver ;merge existing specials with current color
jsr vdcput ;make cursor blink in current color
crsrdo ldx #10 ;//////entry from 'escape' functions here
lda curmod ;8563 cursor mode
jmp vdcout ;enable 80-column hardware cursor & rts
crsr40 lda #0
sta blnsw ;enable 40-column software cursor
rts
crsrof bit mode ;disable the cursor on current screen
bpl 1$ ;...branch if 40-column screen active
jsr getusr ;'user' & .y already point to cursor position
lda curcol
jsr vdcput ;restore attribute byte under cursor
ldx #10
lda #$20
jmp vdcout ;disable 80-column hardware cursor & rts
1$ sta blnsw ;disable 40-column software cursor (.a>0)
lda blnon
bpl 2$ ;...branch if cursor not visible at this time
and #$40
sta blnon ;flag vic cursor as not visible
lda gdbln ;get saved character
ldx gdcol ;get saved color
jsr disply ;restore corrected screen data at cursor position
2$ rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
vdcput ldx #31 ;update data register
vdcout stx vdcadr ;update 8563 register in .x with data in .a
vdc_so bit vdcadr ;////// entry to write next sequential byte
bpl vdc_so
sta vdcdat
rts
vdcget ldx #31 ;read data register
vdcin stx vdcadr ;read 8563 register in .x, pass data in .a
vdc_si bit vdcadr ;////// entry to read next sequential byte
bpl vdc_si
lda vdcdat
rts
getpnt ;setup 8563 update registers (18,19) with PNT + .Y
ldx #18 ;calculate absolute destination = PNT + colm ptr
clc
tya ;column pointer
adc pnt
pha
lda #0
adc pnt+1
jsr vdcout ;8563 text screen memory address hi
pla
inx
jmp vdcout ;8563 text screen memory address lo & rts
getusr ;setup 8563 update registers (18,19) with USER + .Y
ldx #18 ;calculate absolute destination = USER + colm ptr
clc
tya ;column pointer
adc user
pha
lda #0
adc user+1
jsr vdcout ;8563 attribute memory address hi
pla
inx
jmp vdcout ;8563 attribute memory address lo & rts
.page \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
init80
lda #<vicchr ;set up pointers to vic character rom
ldy #>vicchr
sta sedsal
sty sedsal+1
ldx #18
lda #>vdcchr
jsr vdcout ;initialize 8563 update register high
inx
lda #<vdcchr
jsr vdcout ;low
ldy #0
1$ ldx #14 ;bank where vic character rom can be read
lda #sedsal ;vector into character rom (.y is the index)
jsr _fetch ;get a byte
jsr vdcput
iny
cpy #8
bcc 1$ ;...loop until character is transfered
lda #0
2$ jsr vdcput ;pad with nulls to fill out 8563 chr definition
dey
bne 2$ ;...loop until done a character
clc
lda sedsal ;increment pointer to next character in rom
adc #8
sta sedsal
bcc 1$
inc sedsal+1
lda sedsal+1
cmp #>vicchr+$10
bcc 1$ ;...loop until done all characters
rts
;.end

318
EDITOR_C128_NATIONAL/spain.src

@ -0,0 +1,318 @@
.nam C/128 SPANISH NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $08 ;SPAIN p/n 325170-03 04/08/87 F.Bowen
checksum= $cf ;character ROM checksum
chr_sig = $7405 ;character ROM signature
rom_sig = $9fbb ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * *** **** * * * *** *** * * *
; * * * * * * ** * * * * * *
; * *** **** ***** * * * * *** ***** *
; * * * * * * * * * * * *
; * **** * * * * * *** **** * * *
; * *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 SPANISH KEYBOARD DRIVER (04/07/87)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl SPANISH NATIONAL KEYBOARD TABLES
nat_mode1
.byte $14,$0d,$1d,$88,$85,$86,$87,$11 ;unshifted
.byte $33,$57,$41,$34,$5a,$53,$45,$01
.byte $35,$52,$44,$36,$43,$46,$54,$58
.byte $37,$59,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e
.byte $2b,$50,$4c,$2d,$2e,$bd,$bf,$2c
.byte $3d,$ad,$3a,$13,$01,$3b,$5e,$2f
.byte $31,$5f,$04,$32,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31
.byte $1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff
.byte $ff
nat_mode2
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91 ;shifted
.byte $23,$d7,$c1,$24,$da,$d3,$c5,$01
.byte $25,$d2,$c4,$26,$c3,$c6,$d4,$d8
.byte $27,$d9,$c7,$28,$c2,$c8,$d5,$d6
.byte $29,$c9,$ca,$dc,$cd,$cb,$cf,$ce
.byte $40,$d0,$cc,$2a,$3e,$dd,$df,$3c
.byte $ac,$c0,$5b,$93,$01,$5d,$af,$3f
.byte $21,$db,$04,$22,$a0,$02,$d1,$83
.byte $84,$38,$35,$18,$32,$34,$37,$31
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff
.byte $ff
nat_mode3
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91 ;C=
.byte $96,$a7,$a8,$97,$a2,$aa,$a3,$01
.byte $98,$a9,$b1,$99,$c3,$b2,$b6,$a4
.byte $9a,$b7,$b4,$9b,$a1,$ae,$b8,$d6
.byte $29,$b9,$b3,$dc,$cd,$b5,$ba,$ce
.byte $ab,$bb,$be,$2a,$3e,$dd,$bc,$3c
.byte $ac,$a6,$5b,$93,$01,$5d,$de,$3f
.byte $81,$b0,$04,$95,$a0,$02,$a5,$03
.byte $84,$38,$35,$18,$32,$34,$37,$31
.byte $1b,$2b,$2d,$0a,$8d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff
.byte $ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ad,$af,$c0,$00,$00 ;dead keys
deadp .byte $01,$06,$08,$0b,$0b,$0b ;pointers to 'build' keys
oldead .byte $41,$45,$49,$4f,$55 ;SPANISH new key table #1
.byte $49,$55 ;SPANISH new key table #2
.byte $41,$45,$4f ;SPANISH new key table #3
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff
nwdead .byte $b6,$b7,$b8,$b9,$ba ;SPANISH substitute table #1
.byte $bb,$bc ;SPANISH substitute table #2
.byte $b1,$b2,$b4 ;SPANISH substitute table #3
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
.byte $ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl SPANISH EDITOR CROSS REFERENCE
.end

296
EDITOR_C128_NATIONAL/swiss.src

@ -0,0 +1,296 @@
.nam C/128 SWISS NATIONAL EDITOR
.subttl *** COPYRIGHT (C) 1987 by COMMODORE BUSINESS MACHINES, INC. ***
.forml 60
country = $03 ;SWISS p/n 325172-03 04/08/87 F.Bowen
checksum= $11 ;character ROM checksum
chr_sig = $ae22 ;character ROM signature
rom_sig = $3a44 ;ROM signature
; ******************************************************************
; * // *
; * CCCCCCC // 111 2222222 8888888 *
; * CCC CCC // 1111 222 222 888 888 *
; * CCC // 111 222 888 888 *
; * CCC // 111 222 88888 *
; * CCC // 111 222 888 888 *
; * CCC CCC // 111 222 222 888 888 *
; * CCCCCCC // 1111111 222222222 8888888 *
; * // *
; * *
; * EEEEEEEEE DDDDDDDD IIIII TTTTTTTTT OOOOOOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEE DDD DDD III TTT OOO OOO RRRRRRRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEE DDD DDD III TTT OOO OOO RRR RRR *
; * EEEEEEEEE DDDDDDDD IIIII TTT OOOOOOO RRR RRR *
; * *
; * *
; * COPYRIGHT (C)1987 BY COMMODORE BUSINESS MACHINES, INC. *
; * *
; ******************************************************************
; ******************************************************************
; * *
; * THIS LISTING CONTAINS CONFIDENTIAL AND PROPRIETARY INFORMATION *
; * OF CBM, INC. REPRODUCTION, DISSEMINATION OR DISCLOSURE TO *
; * OTHERS WITHOUT EXPRESS WRITTEN PERMISSION IS PROHIBITED. THIS *
; * SOFTWARE IS INTENDED FOR USE IN COMMODORE C/128 SYSTEMS ONLY. *
; * *
; * THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE *
; * WITHOUT NOTICE. *
; * *
; * NO RESPONSIBILITY IS ASSUMED FOR THE RELIABILITY OF THIS *
; * SOFTWARE. *
; * *
; ******************************************************************
.page
; ******************************************************************
; * *
; * THIS VERSION OF THE COMMODORE SCREEN EDITOR CONTAINS SPECIFIC *
; * MODIFICATIONS FOR THE IMPLEMENTATION OF THE FOLLOWING NATIONAL *
; * KEYBOARD AND SCREEN EDITOR: *
; * *
; * *** * * *** *** *** *
; * * * * * * * *
; * *** * ** * * *** *** *
; * * ** ** * * * *
; * **** * * *** **** **** *
; * *
; * THE ORIGINAL VERSION HEREIN IS BY: *
; * DR. KARL BENDER, WALTER SCHMITZ, and FRED BOWEN *
; * *
; ******************************************************************
;.end
.include sysdoc
.include relnotes
.include declare
.include entries
* = $c000
.editor_check_begin
.include ed1 ;contains NATIONAL patches (4 places)
.include ed2
.include ed3 ;contains NATIONAL patches (1 place)
.include ed4
.include ed5
.include ed6
.include routines
.include ed7 ;contains an ORG $FA80
.include patches ;contains an ORG $CF00 (& upper limit @ $CF7F)
; ***** ROM SPACE FROM $FC80 THRU $FEFF IS RESERVED FOR *****
; ***** NATIONAL KEYBOARD DRIVERS AND ASSOCIATED TABLES. *****
; .include <nation>.src ;contains an ORG $FC80 for national driver & tables
; .end
.page
.subttl C/128 SWISS KEYBOARD DRIVER (01/15/86)
* = $CFF8 ;reserved ROM signature area
.byte checksum
.byte country
.word chr_sig
.word rom_sig
* = $FC80 ;reserved ROM area
nat_init
sta dk_flag ;'cint' patch (.a=0)
sta sidreg+24
rts
nat_scnkey
bit dk_flag
bmi do_scan ;...branch if national keys disabled
lda shflag ;test 'CAPS LOCK' for keyboard selection
and #$10
beq 10$ ;...branch if up- use ASCII
lda decode+1
cmp #>nat_mode1
beq do_scan ;...branch if national keys already setup
lda #<nat_decode
ldy #>nat_decode
bne switch ;...else setup national keys
10$ lda decode+1
cmp #>mode1
beq do_scan ;...branch if ascii keys already setup
lda #<keycod ;...else setup ascii keys
ldy #>keycod
switch sta keytab
sty keytab+1
ldy #11 ;point keyscan to decode tables
10$ lda (keytab),y
sta decode,y
dey
bpl 10$
iny
sty dk_flag ;clear any pending dead keys
php
sei
jsr init80 ;move new character set to 8563 RAM
plp
rts
do_scan
jmp scnkey ;resume normal keyscan
.page
nat_keychk
ldx decode+1
cpx #>nat_mode1
bne 70$ ;...branch to normal keyscan if ASCII mode
ldx dk_flag
bmi 70$ ;...branch to normal keyscan if national scan disabled
beq 25$ ;...branch if previous key was not a dead key
ldy deadp,x ;previous key was a dead key- index in .x
dex
10$ dey
pha ;save .a (current character)
tya
cmp deadp,x ;look to see if index (.y) is out of range
pla ;restore current character
bcc 20$ ;...branch if not in table (out of range)
cmp oldead-1,y ;look to see if current key can be substituted
bne 10$ ;...branch if not
lda nwdead-1,y ;substitute it
20$ pha
and #$7f ;weed out control codes
cmp #$20
pla
bcc 45$ ;...branch if control code & ignore it
25$ ldx #5
30$ cmp dktbl-1,x ;look to see if current key is a dead key
beq 40$ ;...branch if it is
dex
bne 30$
40$ stx dk_flag ;save for next time...
cpx #$00
beq 70$ ;if current key is not a dead key we are done
tay ;save dead key code
bit insflg ;cannot display dead key if auto-insert mode active
bmi 45$ ;...branch if active
bit mode ;which screen (40/80) is active?
bpl 50$ ;...branch if 40
ldx #10
jsr vdcin ;read 8563 register 10 to determine if cursor is on
and #$40
bne 60$ ;...branch if cursor is on
45$ rts ;...else return & buffer nothing (dead key flag is set)
50$ lda blnsw
bne 45$ ;...branch if cursor is off
60$ tya ;display dead key using screen code
ora #$40
and #$7f ;convert dead key character to screen code
jmp displc ;put character on screen at cursor without moving cursor
;and without buffering dead key (dead key flag is set)
70$ ldx shflag ;setup registers as normal
ldy lstx
jmp (keychk) ;resume normal keyscan thru indirect
.page
.subttl SWISS NATIONAL KEYBOARD TABLES
nat_mode1 ;unshifted keys
.byte $14,$0d,$1d,$88,$85,$86,$87,$11,$33,$57,$41,$34,$59,$53,$45,$01
.byte $35,$52,$44,$36,$43,$46,$54,$58,$37,$5a,$47,$38,$42,$48,$55,$56
.byte $39,$49,$4a,$30,$4d,$4b,$4f,$4e,$27,$50,$4c,$ae,$2e,$bc,$bd,$2c
.byte $5d,$af,$bb,$13,$01,$24,$5b,$2d,$31,$3c,$04,$32,$20,$02,$51,$03
.byte $84,$38,$35,$09,$32,$34,$37,$31,$1b,$2b,$2d,$0a,$0d,$36,$39,$33
.byte $08,$30,$2e,$91,$11,$9d,$1d,$ff,$ff
nat_mode2 ;shifted keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b
.byte $91,$2a,$d7,$c1,$df,$d9,$d3,$c5,$01,$25,$d2,$c4,$26,$c3,$c6,$d4
.byte $d8,$2f,$da,$c7,$28,$c2,$c8,$d5,$d6,$29,$c9,$ca,$3d,$cd,$cb,$cf
.byte $ce,$3f,$d0,$cc,$c0,$3a,$bf,$b2,$3b,$5e,$21,$b1,$93,$01,$40,$23
.byte $5f,$2b,$3e,$04,$22,$a0,$02,$d1,$83,$84,$a9,$ab,$18,$a3,$a5,$a8
.byte $a2,$1b,$a1,$dd,$0a,$8d,$a7,$aa,$a4,$08,$a6,$de,$91,$11,$9d,$1d
.byte $ff,$ff
nat_mode3 ;C= keys
.byte $94,$8d,$9d,$8c,$89,$8a,$8b,$91,$96,$d7,$c1,$97,$d9,$d3
.byte $c5,$01,$98,$d2,$c4,$99,$c3,$c6,$d4,$d8,$9a,$da,$c7,$9b,$c2,$c8
.byte $d5,$d6,$29,$c9,$ca,$3d,$cd,$cb,$cf,$ce,$5c,$d0,$cc,$ad,$3a,$bf
.byte $b2,$3b,$ac,$21,$b1,$93,$01,$40,$23,$5f,$81,$3e,$04,$95,$a0,$02
.byte $d1,$03,$84,$a9,$ab,$18,$a3,$a5,$a8,$a2,$1b,$a1,$dd,$0a,$8d,$a7
.byte $aa,$a4,$08,$a6,$de,$91,$11,$9d,$1d,$ff,$ff
nat_decode
.word nat_mode1, nat_mode2, nat_mode3, mode4
.word nat_mode1, nat_mode1
.page
dktbl .byte $ad,$c0,$ae,$af,$00 ;dead keys
deadp .byte $01,$02,$07,$0c,$0e,$0f ;pointers to 'build' keys
oldead .byte $45,$41,$45,$55,$4f,$49,$41,$45 ;new key tables
.byte $49,$4f,$55,$45,$49,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff
nwdead .byte $bf,$b1,$b2,$b5,$b4,$b3,$b6,$b7 ;substitute key tables
.byte $b8,$b9,$ba,$db,$dc,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ;unused
.byte $ff,$ff,$ff
.page
; NATIONAL patch code. The following area contains patches specifically
; related to national keyboard implementations.
;
; (patch first included in part #315078-02, 10/01/85 F.Bowen)
ascii_din
lda r6510 ;scan for ASCII/DIN key (a.k.a. CAPS LOCK)
and #$40 ;P6 is it
eor #$40 ;invert sense.....up=0, dwn=1
lsr a
lsr a
sta shflag ;end of special abrieviated keyscan
rts
.editor_check_top
.subttl SWISS EDITOR CROSS REFERENCE
.end

551
EDITOR_C128_NATIONAL/sysdoc.src

@ -0,0 +1,551 @@
.subttl C/128 SYSTEM MEMORY MAPS (10/02/85)
.page
; COMPOSITE SYSTEM MEMORY MAP
;
; C64 Cartridges C64 C128 ROMs RAM Banks (0-3)
; $FFFF> _______________ _______________ _______________ _______________
; | | | | | | | |
; | Game | | KERNAL | | | | |
; | | | & | | KERNAL | | |
; | Card | | EDITOR | | | | |
; | | | | | | | |
; $E000>|_______________|-------|_______________|-------|_______________| | |
; | | | I/O | | |
; | I/O and CHARs | | CHARs & CP/M | | |
; $D000>------------------------|_______________|-------|_______________| | |
; | | | |
; _______________ _______________ | EDITOR | | |
; $C000>| |-------| |-------|_______________|-------| |
; | | | | | | | |
; | Application | | | | MONITOR | | |
; $B000>| |-------| BASIC |-------|_______________| | |
; | Card - HI | | | | | | |
; | | | | | | | _ |
; $A000>|_______________|-------|_______________| | | | | SYSTEM |
; | | | BASIC | | RAM0-| & BASIC|
; | Application | | | | |_ TEXT |
; | | | HI | | _ |
; | Card - LO | | | | | BASIC |
; | | | | | RAM1-| VARs |
; $8000>|_______________|-------------------------------|_______________|-------| |_ |
; | | | |
; | | | _ |
; | | | RAM2-| FUTURE |
; | BASIC | | RAM3-|_EXPAND |
; | | | |
; | LO | | |
; | | | |
; | | | |
; | | | |
; | | | |
; | | | |
; $4000>------------------------------------------------|_______________|-------| |
; | |
; | |
; | |
; | |
; | |
; | |
; | |
; | |
; | |
; $0400>------------------------------------------------------------------------|_______________|
; | COMMON |
; $0000>------------------------------------------------------------------------|_______________|
.page
; $0A00>|---------------| $1300>|---------------| $1C00>|---------------| $FFFF>|---------------|
; | | | | | | $FFFA>| NMI RST IRQ |
; | | | Basic | | | $FFD0>| CP/M RAM Code |
; | | | Absolute | | | | Krnl RAM Code |
; | Basic | | Variables | | | $FF05>|---------------|
; | | | | | | |MMU Config Regs|
; $0900>| Run-Time | $1200>|---------------| $1B00>| | $FF00>|---------------|
; | | | Basic | | | | |
; | Stack | | DOS / VSP | | | | |
; | | | Variables | | | | |
; | | $1108>|---------------| | | | |
; | | |CP/M Reset Code| | | | |
; $0800>|---------------| $1100>|---------------| $1A00>| | | |
; | | | | | | | |
; | | | Function | | | | |
; | | | Key | | | | |
; | | | Buffer | | | | |
; | VIC | | | | | | |
; | | $1000>|---------------| $1900>| | | |
; | Text | | | | | | |
; ~ ~ | | | Reserved | | Basic |
; | Screen | | | | | | |
; | | | Sprite | | for | | |
; | (VM#1) | | | | | | |
; | | $0F00>| Definition | $1800>| Applications | ~ Text ~
; | | | | | | | |
; | | | Area | | Software | | |
; | | | | | | | |
; | | | | | | | Area |
; | | | | | | | |
; $0400>|---------------| $0E00>|---------------| $1700>| | | |
; | Basic RAM Code| | | | | | (Basic Text |
; $0380>| - - - - - - - | | RS-232 | | | | begins at |
; | Kernal Tables | | Output | | | | $1C00 |
; $033C>| - - - - - - - | | Buffer | | | | if Bit-Map |
; | Indirects | | | | | | unallocated) |
; $02FC>|---------------| $0D00>|---------------| $1600>| | $4000>|---------------|
; |Kernal RAM Code| | | | | | |
; $02A2>| - - - - - - - | | RS-232 | | | | |
; |Basic & Monitor| | Input | | | | |
; | Input | | Buffer | | | | VIC |
; | Buffer | | | | | | |
; $0200>|---------------| $0C00>|---------------| $1500>| | ~ Bit-Map ~
; | System Stack | | (Disk Boot | | | | |
; $0149>| - - - - - - - | | Page) | | | | Screen |
; |Basic DOS,USING| $0BC0>| - - - - - - - | | | | |
; $0110>| - - - - - - - | | Cassette | | | | |
; | FBUFFER | | Buffer | | | | |
; $0100>|---------------| $0B00>|---------------| $1400>| | $2000>| - - - - - - - |
; | | | Monitor & | | | | |
; | Kernal Z.P. | | Kernal | | | | VIC |
; $0090>| - - - - - - - | | Absolute | | | ~ Bit-Map ~
; | Basic Z.P. | | Variables | | | | Color |
; $0002>| _ _ _ _ _ _ _ | | | | | | (VM#2) |
; $0000>|_______________| $0A00>|---------------| $1300>|---------------| $1C00>|---------------|
; C/128 SYSTEM ROM LAYOUT
;
; $FFFF _ _______________
; $FF4D _ |_______________|__________ Kernal Jump Table & Hardware Vectors --------
; | | |
; $FF05 _ |_______________|__________ Kernal Interrupt Dispatch Code |
; $FF00 _ |///////////////|__________ MMU Configuration Registers |
; | | |
; | | |
; $FC80 _ |_______________|__________ ROM Reserved for Foreign Language Versions |
; | | |
; | | |
; $FA80 _ |_______________|__________ Editor Tables |
; | | |
; | | |
; / / -\ HIGH
; | | -/ ROM
; $E000 _ |_______________|__________ Kernal ROM Code |
; |///////////////| |
; |///////////////| |
; ///////////////// |
; |///////////////| |
; $D000 _ |///////////////|__________ I/O Space |
; | | |
; | | |
; / / |
; | | |
; $C000 _ |_______________|__________ Editor ROM Code -----------------------------
; | | |
; | | |
; / / |
; | | |
; $B000 _ |_______________|__________ Monitor ROM Code -\ MID
; | | -/ ROM
; | | |
; | | |
; | | |
; | | |
; $8000 - / / ------------------------------------------------------|
; | | |
; | | -\ LOW
; | | -/ ROM
; | | |
; $4000 _ |_______________|---------- BASIC ROM Code -----------------------------|
.page
; I/O BLOCK MAP 6526 CIA REGISTER MAP (typical)
;
; $DFFF _ _______________ REG# FUNCTION
; | | ________
; | I/O - 2 | / F .... CRB (control register B)
; $DF00 _ |_______________| / E .... CRA (control register A)
; | | / D .... ICR (interrupt control register)
; | I/O - 1 | / C .... SDR (serial data register)
; $DE00 _ |_______________|_/ B .... TOD (hours)
; | | A .... TOD (minutes)
; | CIA - 2 | 9 .... TOD (seconds)
; $DD00 _ |_______________| 8 .... TOD (tenths)
; | | 7 .... TB-HI (timer B)
; | CIA - 1 | 6 .... TB-LO
; $DC00 _ |_______________|_ 5 .... TA-HI (timer A)
; | | \ 4 .... TA-LO
; | VIC | \ 3 .... DDRB (data direction port B)
; / COLOR / \ 2 .... DDRA (data direction port A)
; | RAM | \ 1 .... PRB (port B)
; $D800 _ |_______________| \________ 0 .... PRA (port A)
; | |
; | (RESERVED) |
; $D700 _ |_______________|
; | |
; | 8563 VDC | ..... (register map on following pages)
; $D600 _ |_______________|
; | |
; | MMU | ..... (register map on following pages)
; $D500 _ |_______________|
; | |
; | SID | ..... (register map on following pages)
; $D400 _ |_______________|
; | |
; | |
; / VIC / ..... (register map on following pages)
; | |
; $D000 _ |_______________|
.page
;/////////////// T H E C / 1 2 8 K E Y B O A R D \\\\\\\\\\\\\\\
; ------------------------------------------------------------------- -------
; | C0 | C1 | C2 | C3 | C4 | C5 | C6 | C7 | K0 | K1 | K2 | | GND |
; |PIN13|PIN19|PIN18|PIN17|PIN16|PIN15|PIN14|PIN20|PIN21|PIN22|PIN23| |PIN-1|
; ---|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|--- ---|---
; \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ \|/ |
; ------- ------------------------------------------------------------------- |
; | R0 |/__| INS | # | % | ' | ) | + | lb | ! | HELP| ESC | ALT | |
; |PIN12|\ | DEL | 3 | 5 | 7 | 9 | | | 1 | | | | |
; ------- ------------------------------------------------------------------- |
; | R1 |/__| RET | W | R | Y | I | P | * | <-- | 8 | + | 0 | |
; |PIN11|\ | | | | | | | | | | | | |
; ------- ------------------------------------------------------------------- |
; | R2 |/__| /_\ | A | D | G | J | L | ] | CTRL| 5 | - | . | |
; |PIN10|\ | \ / | | | | | | ; | | | | | |
; ------- ------------------------------------------------------------------- |
; | R3 |/__| F8 | $ | & | ( | 0 | - | CLR | " | TAB | LINE| /|\ | |
; |PIN-5|\ | F7 | 4 | 6 | 8 | | | HOM | 2 | | FEED| | | |
; ------- ------------------------------------------------------------------- |
; | R4 |/__| F2 | Z | C | B | M | > |RIGHT|SPACE| 2 |ENTER| | | |
; |PIN-8|\ | F1 | | | | | . |SHIFT| BAR | | | \|/ | |
; ------- ------------------------------------------------------------------- |
; | R5 |/__| F4 | S | F | H | K | [ | = | C= | 4 | 6 | /__ | |
; |PIN-7|\ | F3 | | | | | : | | | | | \ | |
; ------- ------------------------------------------------------------------- |
; | R6 |/__| F6 | E | T | U | O | @ | pi | Q | 7 | 9 | __\ | |
; |PIN-6|\ | F5 | | | | | | ^ | | | | / | |
; ------- ------------------------------------------------------------------- |
; | R7 |/__| /|\ |LEFT | X | V | N | < | ? | RUN | 1 | 3 | NO |_____ |
; |PIN-9|\ | \|/ |SHIFT| | | | , | / | STOP| | | SCRL| | |
; ------- ------------------------------------------------------------------- | |
; | | |
; ------- / (LOCKING) | |
; |SHIFT|__o o____________________________________________________| |
; | LOCK| |
; ------- |
; ------- ------- / |
; | NMI |/________|RESTR|__o o________________________________________________________o
; |PIN-3|\ | | |
; ------- ------- |
; ------- ------- / (LOCKING) |
; |40/80|/________|40/80|__o o________________________________________________________o
; |PIN24|\ |DSPLY| |
; ------- ------- |
; ------- ------- / (LOCKING) |
; |P6510|/________|CAPS |__o o________________________________________________________o
; |PIN25|\ |LOCK |
; ------- -------
;NOTES: 1/ THE 64 KEYS UNDER C0 THRU C7 ABOVE OCCUPY THE SAME MATRIX POSITION AS IN THE C/64,
; AS DOES THE 'RESTORE' KEY. INCLUDING THE 'SHIFT LOCK' KEY, THERE ARE 66 SUCH KEYS.
; 2/ THE 24 KEYS UNDER THE K0, K1 AND K2 OUTPUTS ARE PART OF THE EXTENDED KEYBOARD,
; AS ARE THE '40/80 DSPLY' AND 'CAPS LOCK' KEYS. THERE ARE 26 NEW KEYS. THEY WILL
; NOT BE SCANNED IN C/64 MODE, ALTHO THE USER MAY WRITE CODE TO SCAN THEM HIMSELF.
.page
; 8722 MMU REGISTER MAP
;
; REGISTER DESCRIPTION
; _______
; 11 (VR) ............. | 7 - 4 | ..... BANK Version
; Version Register | 3 - 0 | ..... MMU Version
; |-------|
; _______ __
; 10 (PAGE-1 HI) ...... | 7 - 4 | ..... ??? |
; 8 (PAGE-0 HI) | 3 | ......... A19 Swaps PAGE 0 and/or PAGE 1
; | 2 | ......... A18 with any other page in the
; | 1 | ......... A17 256K address space.
; | 0 | ......... A16 |
; |---| |
; ___ |
; 9 (PAGE-1 LO) ...... | 7 | ......... A15 |
; 7 (PAGE-0 LO) | 6 | ......... A14 |
; | 5 | ......... A13 |
; | 4 | ......... A12 |
; | 3 | ......... A11 |
; | 2 | ......... A10 |
; | 1 | ......... A9 |
; | 0 | ......... A8 __|
; |---|
; ___
; 6 (RCR) | 7 | ......... VA17 \ VIC RAM Bank
; | 6 | ......... VA16 /
; RAM Configuration | 5 | ......... \ RAM Block (for future expansion)
; Register | 4 | ......... /
; | 3 | ......... \ SHARE Status (none,bot,top,both)
; | 2 | ......... /
; | 1 | ......... \ SHARE Amount (1k,4k,8k,16k)
; | 0 | ......... /
; |---|
; ___
; 5 (MCR) | 7 | ......... 40/80 Key Sense
; | 6 | ......... OS Mode 0 = 128, 1 = 64
; Mode Configuration | 5 | ......... /EXROM line sense
; Register | 4 | ......... /GAME line sense
; | 3 | ......... FSDIR 0 = IN, 1 = OUT
; | 2 | ......... ???
; | 1 | ......... ???
; | 0 | ......... Processor: 0 = Z80, 1 = 85xx
; |---|
; ___
; 4 (PCR-D) | 7 | ......... A17 \ RAM BANK (0-3)
; 3 (PCR-C) | 6 | ......... A16 /
; 2 (PCR-B) | 5 | ......... \ ROM-HI (system,int,ext,RAM)
; 1 (PCR-A) | 4 | ......... /
; 0 (CR) | 3 | ......... \ ROM-MID (system,int,ext,RAM)
; | 2 | ......... /
; Pre-configuration | 1 | ................. ROM-LO (system,RAM)
; & Configuration | 0 | ................. I/O (I/O, else see ROM-HI)
; Registers |---|
.page
; 8726 DMA CONTROLLER REGISTER MAP (10/85)
;
;
; REG # _______________________________________________________
; 0_ | PEND | EOB | FAULT| SIZE | VER3 | VER2 | VER1 | VER0 |______ Status Register
; 1_ | EXEC | -- | LOAD | FF00 | -- | -- | MODE |______ Command Register
; 2_ | A7 | A6 | A5 | A4 | A3 | A2 | A1 | A0 |______ Host Address lo
; 3_ | A15 | A14 | A13 | A12 | A11 | A10 | A9 | A8 |______ Host Address hi
; 4_ | EX7 | EX6 | EX5 | EX4 | EX3 | EX2 | EX1 | EX0 |______ Expansion Address lo
; 5_ | EX15 | EX14 | EX13 | EX12 | EX11 | EX10 | EX9 | EX8 |______ Expansion Address hi
; 6_ | -- | -- | -- | -- | -- | BA2 | BA1 | BA0 |______ Expansion Bank pointer
; 7_ | L7 | L6 | L5 | L4 | L3 | L2 | L1 | L0 |______ Transfer Length lo
; 8_ | L15 | L14 | L13 | L12 | L11 | L10 | L9 | L8 |______ Transfer Length hi
; 9_ | ENBL | IEOB | VFY | -- | -- | -- | -- | -- |______ Interrupt Mask
; 10_ | AC1 | AC0 | -- | -- | -- | -- | -- | -- |______ Address Control
; |______|______|______|______|______|______|______|______|
; MODE => 00: Transfer FROM internal TO external
; 01: Transfer TO internal FROM external
; 10: Swap
; 11: Verify
;
; SIZE => 0: 128KB
; 1: 512KB
;
; Adr Contl => 00: Increment both host & expansion addresses
; 01: Fix expansion address
; 10: Fix host address
; 11: Fix both host & expansion addresses
;
;
; NOTE: Bits 7-5 of STATUS register are CLEARED when this register is READ
; The DMA CONTROLLER appears in the C/128 I/O memory map at IO2 ($DF00).
.page
; 8564 VIC REGISTER MAP
;
; REG # _______________________________________________________
; 0_ | S0x7 | S0x6 | S0x5 | S0x4 | S0x3 | S0x2 | S0x1 | S0x0 |______ Sprite 0 X location
; 1_ |______|______|______|______|______|______|______|______|______ Sprite 0 Y location
; 2_ | | | | | | | | |______ Sprite 1 X location
; 3_ |______|______|______|______|______|______|______|______|______ Sprite 1 Y location
; 4_ | | | | | | | | |______ Sprite 2 X location
; 5_ |______|______|______|______|______|______|______|______|______ Sprite 2 Y location
; 6_ | | | | | | | | |______ Sprite 3 X location
; 7_ |______|______|______|______|______|______|______|______|______ Sprite 3 Y location
; 8_ | | | | | | | | |______ Sprite 4 X location
; 9_ |______|______|______|______|______|______|______|______|______ Sprite 4 Y location
; 10_ | | | | | | | | |______ Sprite 5 X location
; 11_ |______|______|______|______|______|______|______|______|______ Sprite 5 Y location
; 12_ | | | | | | | | |______ Sprite 6 X location
; 13_ |______|______|______|______|______|______|______|______|______ Sprite 6 Y location
; 14_ | | | | | | | | |______ Sprite 7 X location
; 15_ |______|______|______|______|______|______|______|______|______ Sprite 7 Y location
; 16_ | S7x8 | S6x8 | S5x8 | S4x8 | S3x8 | S2x8 | S1x8 | S0x8 |______ MSB of Sprite X loctn
; 17_ | RC8 | ECM | BMM | Blank| ROWS | Y2 | Y1 | Y0 |______ mode, #row, y-scroll
; 18_ | RC7 | RC6 | RC5 | RC4 | RC3 | RC2 | RC1 | RC0 |______ Raster latch
; 19_ | LPx8 | LPx7 | LPx6 | LPx5 | LPx4 | LPx3 | LPx2 | LPx1 |______ Lightpen X latch
; 20_ | LPy7 | LPy6 | LPy5 | LPy4 | LPy3 | LPy2 | LPy1 | LPy0 |______ Lightpen Y latch
; 21_ | SD7 | SD6 | SD5 | SD4 | SD3 | SD2 | SD1 | SD0 |______ Sprite Disable
; 22_ | -- | -- | Reset| MCM | COLS | X2 | X1 | X0 |______ mode, #col, x-scroll
; 23_ | S7Ey | S6Ey | S5Ey | S4Ey | S3Ey | S2Ey | S1Ey | S0Ey |______ Sprite Y expand
; 24_ | VM13 | VM12 | VM11 | VM10 | CB13 | CB12 | CB11 | -- |______ VM Base, CHR Base
; 25_ | IRQ | -- | -- | -- | LP | S/S | S/B | RIRQ |______ IRQ source (wrt to clr)
; 26_ | -- | -- | -- | -- | _LP | _S/S | _S/B | _IRQ |______ IRQ enable (0=disable)
; 27_ | BSP7 | BSP6 | BSP5 | BSP4 | BSP3 | BSP2 | BSP1 | BSP0 |______ Sprite/Bgnd Priority
; 28_ | MCS7 | MCS6 | MCS5 | MCS4 | MCS3 | MCS2 | MCS1 | MCS0 |______ Multicolor Sprite Sel
; 29_ | S7Ex | S6Ex | S5Ex | S4Ex | S3Ex | S2Ex | S1Ex | S0Ex |______ Sprite X expand
; 30_ | SS7 | SS6 | SS5 | SS4 | SS3 | SS2 | SS1 | SS0 |______ S/S Collision latch
; 31_ | SB7 | SB6 | SB5 | SB4 | SB3 | SB2 | SB1 | SB0 |______ S/B Collision latch
; 32_ | -- | -- | -- | -- | | | | |______ Border Color
; 33_ | -- | -- | -- | -- | | | | |______ Background Color #0
; 34_ | -- | -- | -- | -- | | | | |______ Background Color #1
; 35_ | -- | -- | -- | -- | | | | |______ Background Color #2
; 36_ | -- | -- | -- | -- | | | | |______ Background Color #3
; 37_ | -- | -- | -- | -- | | | | |______ Sprite Multicolor #0
; 38_ | -- | -- | -- | -- | | | | |______ Sprite Multicolor #1
; 39_ | -- | -- | -- | -- | | | | |______ Sprite 0 Color
; 40_ | -- | -- | -- | -- | | | | |______ Sprite 1 Color
; 41_ | -- | -- | -- | -- | | | | |______ Sprite 2 Color
; 42_ | -- | -- | -- | -- | | | | |______ Sprite 3 Color
; 43_ | -- | -- | -- | -- | | | | |______ Sprite 4 Color
; 44_ | -- | -- | -- | -- | | | | |______ Sprite 5 Color
; 45_ | -- | -- | -- | -- | | | | |______ Sprite 6 Color
; 46_ | -- | -- | -- | -- | | | | |______ Sprite 7 Color
; 47_ | -- | -- | -- | -- | -- | K2 | K1 | K0 |______ Keyboard lines (new)
; 48_ | -- | -- | -- | -- | -- | -- | TEST | 2MHz |______ Clock speed
; |-------------------------------------------------------|
.page
; 6581 SID REGISTER MAP
;
; REG # _______________________________________________________
; 0_ | F7 | F6 | F5 | F4 | F3 | F2 | F1 | F0 |______ Frequency lo Voice-1
; 1_ | F15 | F14 | F13 | F12 | F11 | F10 | F9 | F8 |______ Frequency hi
; 2_ | PW7 | PW6 | PW5 | PW4 | PW3 | PW2 | PW1 | PW0 |______ Pulse Width lo
; 3_ | -- | -- | -- | -- | PW11 | PW10 | PW9 | PW8 |______ Pulse Width hi
; 4_ | NOISE| PULSE| SAW | TRI | TEST | RING | SYNC | GATE |______ Control Register
; 5_ | ATK3 | ATK2 | ATK1 | ATK0 | DCY3 | DCY2 | DCY1 | DCY0 |______ Attack/Decay
; 6_ | STN3 | STN2 | STN1 | STN0 | RLS3 | RLS2 | RLS1 | RLS0 |______ Sustain/Release
; |------|------|------|------|------|------|------|------|
; 7_ | F7 | F6 | F5 | F4 | F3 | F2 | F1 | F0 |______ Frequency lo Voice-2
; 8_ | F15 | F14 | F13 | F12 | F11 | F10 | F9 | F8 |______ Frequency hi
; 9_ | PW7 | PW6 | PW5 | PW4 | PW3 | PW2 | PW1 | PW0 |______ Pulse Width lo
; 10_ | -- | -- | -- | -- | PW11 | PW10 | PW9 | PW8 |______ Pulse Width hi
; 11_ | NOISE| PULSE| SAW | TRI | TEST | RING | SYNC | GATE |______ Control Register
; 12_ | ATK3 | ATK2 | ATK1 | ATK0 | DCY3 | DCY2 | DCY1 | DCY0 |______ Attack/Decay
; 13_ | STN3 | STN2 | STN1 | STN0 | RLS3 | RLS2 | RLS1 | RLS0 |______ Sustain/Release
; |------|------|------|------|------|------|------|------|
; 14_ | F7 | F6 | F5 | F4 | F3 | F2 | F1 | F0 |______ Frequency lo Voice-3
; 15_ | F15 | F14 | F13 | F12 | F11 | F10 | F9 | F8 |______ Frequency hi
; 16_ | PW7 | PW6 | PW5 | PW4 | PW3 | PW2 | PW1 | PW0 |______ Pulse Width lo
; 17_ | -- | -- | -- | -- | PW11 | PW10 | PW9 | PW8 |______ Pulse Width hi
; 18_ | NOISE| PULSE| SAW | TRI | TEST | RING | SYNC | GATE |______ Control Register
; 19_ | ATK3 | ATK2 | ATK1 | ATK0 | DCY3 | DCY2 | DCY1 | DCY0 |______ Attack/Decay
; 20_ | STN3 | STN2 | STN1 | STN0 | RLS3 | RLS2 | RLS1 | RLS0 |______ Sustain/Release
; |------|------|------|------|------|------|------|------|
; 21_ | -- | -- | -- | -- | -- | FC2 | FC1 | FC0 |______ Frequency lo Filter
; 22_ | FC10 | FC9 | FC8 | FC7 | FC6 | FC5 | FC4 | FC3 |______ Frequency hi
; 23_ | RES3 | RES2 | RES1 | RES0 |FILTEX| FILT3| FILT2| FILT0|______ Resonance/Filter
; 24_ | 3 OFF| HP | BP | LP | VOL3 | VOL2 | VOL1 | VOL0 |______ Mode/Volume
; |------|------|------|------|------|------|------|------|
; 25_ | PX7 | PX6 | PX5 | PX4 | PX3 | PX2 | PX1 | PX0 |______ Pot X Misc.
; 26_ | PY7 | PY6 | PY5 | PY4 | PY3 | PY2 | PY1 | PY0 |______ Pot Y
; 27_ | O7 | O6 | O5 | O4 | O3 | O2 | O1 | O0 |______ Oscillator 3
; 28_ | E7 | E6 | E5 | E4 | E3 | E2 | E1 | E0 |______ Envelope 3
; |-------------------------------------------------------|
.page
; 8563 VDC REGISTER MAP (also 8568, 10/85)
;
; REG # _______________________________________________________
; 0_ | HT7 | HT6 | HT5 | HT4 | HT3 | HT2 | HT1 | HT0 |______ Horizontal Total
; 1_ | HD7 | HD6 | HD5 | HD4 | HD3 | HD2 | HD1 | HD0 |______ Horizontal Displayed
; 2_ | HP7 | HP6 | HP5 | HP4 | HP3 | HP2 | HP1 | HP0 |______ Horizontal Sync Position
; 3_ | VW3 | VW2 | VW1 | VW0 | HW3 | HW2 | HW1 | HW0 |______ Vert/Horz Sync Width
; 4_ | VT7 | VT6 | VT5 | VT4 | VT3 | VT2 | VT1 | VT0 |______ Vertical Total
; 5_ | -- | -- | -- | VA4 | VA3 | VA2 | VA1 | VA0 |______ Vertical Total Adjust
; 6_ | VD7 | VD6 | VD5 | VD4 | VD3 | VD2 | VD1 | VD0 |______ Vertical Displayed
; 7_ | VP7 | VP6 | VP5 | VP4 | VP3 | VP2 | VP1 | VP0 |______ Vertical Sync Position
; 8_ | -- | -- | -- | -- | -- | -- | IM1 | IM0 |______ Interlace Mode
; 9_ | -- | -- | -- | CTV4 | CTV3 | CTV2 | CTV1 | CTV0 |______ Character Total Vertical
; 10_ | -- | CM1 | CM0 | CS4 | CS3 | CS2 | CS1 | CS0 |______ Cursor Mode, Start Scan
; 11_ | -- | -- | -- | CE4 | CE3 | CE2 | CE1 | CE0 |______ Cursor End Scan Line
; 12_ | DS15 | DS14 | DS13 | DS12 | DS11 | DS10 | DS9 | DS8 |______ Display Start Address hi
; 13_ | DS7 | DS6 | DS5 | DS4 | DS3 | DS2 | DS1 | DS0 |______ Display Start Address lo
; 14_ | CP15 | CP14 | CP13 | CP12 | CP11 | CP10 | CP9 | CP8 |______ Cursor Position hi
; 15_ | CP7 | CP6 | CP5 | CP4 | CP3 | CP2 | CP1 | CP0 |______ Cursor Position lo
; 16_ | LPV7 | LPV6 | LPV5 | LPV4 | LPV3 | LPV2 | LPV1 | LPV0 |______ Light Pen Vertical
; 17_ | LPH7 | LPH6 | LPH5 | LPH4 | LPH3 | LPH2 | LPH1 | LPH0 |______ Light Pen Horizontal
; 18_ | UA15 | UA14 | UA13 | UA12 | UA11 | UA10 | UA9 | UA8 |______ Update Address hi
; 19_ | UA7 | UA6 | UA5 | UA4 | UA3 | UA2 | UA1 | UA0 |______ Update Address lo
; 20_ | AA15 | AA14 | AA13 | AA12 | AA11 | AA10 | AA9 | AA8 |______ Attribute Start Adr hi
; 21_ | AA7 | AA6 | AA5 | AA4 | AA3 | AA2 | AA1 | AA0 |______ Attribute Start Adr lo
; 22_ | CTH3 | CTH2 | CTH1 | CTH0 | CDH3 | CDH2 | CDH1 | CDH0 |______ Character Tot(h), Dsp(v)
; 23_ | -- | -- | -- | CDV4 | CDV3 | CDV2 | CDV1 | CDV0 |______ Character Dsp(v)
; 24_ | COPY | RVS |CBRATE| VSS4 | VSS3 | VSS2 | VSS1 | VSS0 |______ Vertical smooth scroll
; 25_ | TEXT | ATR | SEMI | DBL | HSS3 | HSS2 | HSS1 | HSS0 |______ Horizontal smooth scroll
; 26_ | FG3 | FG2 | FG1 | FG0 | BG3 | BG2 | BG1 | BG0 |______ Foregnd/Bgnd Color
; 27_ | AI7 | AI6 | AI5 | AI4 | AI3 | AI2 | AI1 | AI0 |______ Address Increment / Row
; 28_ | CB15 | CB14 | CB13 | RAM | -- | -- | -- | -- |______ Character Base Address
; 29_ | -- | -- | -- | UL4 | UL3 | UL2 | UL1 | UL0 |______ Underline scan line
; 30_ | WC7 | WC6 | WC5 | WC4 | WC3 | WC2 | WC1 | WC0 |______ Word Count
; 31_ | DA7 | DA6 | DA5 | DA4 | DA3 | DA2 | DA1 | DA0 |______ Data
; 32_ | BA15 | BA14 | BA13 | BA12 | BA11 | BA10 | BA9 | BA8 |______ Block Start Address hi
; 33_ | BA7 | BA6 | BA5 | BA4 | BA3 | BA2 | BA1 | BA0 |______ Block Start Address lo
; 34_ | DEB7 | DEB6 | DEB5 | DEB4 | DEB3 | DEB2 | DEB1 | DEB0 |______ Display Enable Begin
; 35_ | DEE7 | DEE6 | DEE5 | DEE4 | DEE3 | DEE2 | DEE1 | DEE0 |______ Display Enable End
; 36_ | -- | -- | -- | -- | DRR3 | DRR2 | DRR1 | DRR0 |______ DRAM Refresh rate
; 37_ | HSYNC| VSYNC| -- | -- | -- | -- | -- | -- |______ Horz, Vert Sync Polarity
; |-------------------------------------------------------|
;
; (Register 37 appears on device 8568 only)
;
; Description of MAPPED registers:
; _______________________________________________________
; $D600 -> address (write): | -- | -- | R5 | R4 | R3 | R2 | R1 | R0 |
; status (read) : |STATUS| LP |VBLANK| -- | -- | VER2 | VER1 | VER0 |
; | | | | | | | | |
; $D601 -> data (r/w) : | D7 | D6 | D5 | D4 | D3 | D3 | D2 | D0 |
; |-------------------------------------------------------|
; _______________________________________________________
; ATTRIBUTE byte layout | ALT | RVS | UL | FLASH| R | G | B | I |
; |-------------------------------------------------------|
.page
; EXPLANATION OF VARIOUS KERNAL/EDITOR FLAG BYTES, ETC.
;
; Symbol Description
; 7 6 5 4 3 2 1 0
; _________________________________________________________
; D6510 | -- | (in) | (out)| (in) | (out)| (out)| (out)| (out)|
; | | | | | | | | |
; R6510 | -- |CAPKEY|CASMTR|CASSEN|CASWRT|CHAREN| HIRAM| LORAM|
; | | | | | | | | |
; LOCKS | CASE | CTL-S| -- | -- | -- | -- | -- | -- |
; | | | | | | | | |
; SCROLL | OFF |LINKER| | | | | | |
; | | | | | | | | |
; SHFLAG | -- | -- | -- | ALT | ALPHA| CTRL | C= | SHIFT|
; | | | | | | | | |
; RPTFLG | ALL | NONE | -- | -- | -- | -- | -- | -- |
; | | | | | | | | |
; BLNON | ON | BLNK | -- | -- | -- | -- | -- | -- |
; | | | | | | | | |
; BEEPER | ON | -- | -- | -- | -- | -- | -- | -- |
; | | | | | | | | |
; GRAPHM | MCM | SPLIT| BMM | -- | -- | -- | -- | -- |
; | | | | | | | | |
; MODE | 40/80| -- | -- | -- | -- | -- | -- | -- |
; | | | | | | | | |
; INIT_ |CHRSET| CINT | -- | -- | -- | -- | -- | BASIC|
; STATUS |-------------------------------------------------------|
; The following SYMBOLS are used by the c/128 EDITOR. Note that the
; EDITOR irq VIC screen handler depends upon them. In most cases the
; contents of these locations will be placed directly into the appropriate
; register and should be used by the user instead of the actual register.
; GRAPHM ....... See above. If = $FF then editor leaves VIC alone.
; CHAREN ....... Mask for R6510 /charen bit.
; VM1 .......... VIC text mode Video Matrix & Character Base pointer.
; VM2 .......... VIC graphic mode Video Matrix & Bit Map pointer.
; VM3 .......... 8563 text display base address.
; VM4 .......... 8563 attribute base address.
; SPLIT ........ If split screen mode, contains value for 'middle' raster IRQ.
; CURMOD ....... 8563 cursor mode.
; PAUSE ........ Control-S in effect flag. Is = $13 if so.
; Some insight into KERNAL symbols:
; INIT_STATUS .. See also above. Lets system know what has been initialized
; and what hasn't. Set to $00 by a reset but untouched by NMI.
; SYSTEM_VECTOR. Where the kernal goes when it has to go somewhere. It's set
; to BASIC COLD at reset. BASIC itself sets it to BASIC WARM
; after it has inited. The MONITOR respects it too.
; SYSTEM ....... Vector in RAM1 at $FFF8. Set at powerup to C128MODE, user may
; redirect it to his code. Taken at RESET always, providing
; user with control (protection) from reset.

5
README.md

@ -77,6 +77,7 @@ Using [kernalemu](https://github.com/mist64/kernalemu) and [cbm6502asm](https://
| [BASIC_C128](BASIC_C128) | 1986 |
| [EDITOR_C128](EDITOR_C128) | 1985 | 318020-05 |
| [EDITOR_C128_DIN](EDITOR_C128_DIN) | 1985 | 315078-03, German |
| [EDITOR_C128_NATIONAL](EDITOR_C128_NATIONAL) | 1987 | |
| [KERNAL_C128_03](KERNAL_C128_03) | 1985 | 318020-03 |
| [KERNAL_C128_05](KERNAL_C128_05) | 1985 | 318020-05 |
| [KERNAL_C128_06](KERNAL_C128_06) | 1988 | 318020-06 |
@ -268,7 +269,9 @@ The Commodore 128 BASIC 7.0, KERNAL, EDITOR and MONITOR sources (1985/1986). Sou
* KERNAL_C128_03 is 318020-03, $FF80 = 0. (It was reconstructed from listings/first_release/kernal.lis in the dump.)
* KERNAL_C128_05 is 318020-05, $FF80 = 1.
* KERNAL_C128_06 is 318020-06, $FF80 = 2. This version seems to have been unreleased.
* EDITOR_C128 is the US version (318020-05), EDITOR_C128_DIN the German version (315078-03).
* EDITOR_C128 is the US version (318020-05)
* EDITOR_C128_DIN is the German version (315078-03). The code is the same as in EDITOR_C128_NATIONAL, but the comments are slightly different.
* EDITOR_C128_NATIONAL contains Denmark (325174-03), Finland/Sweden (325180-03), France/Belgium (325166-03), Germany/Austria (315078-03), Italy (325168-03), Norway (325177-03), Spain (325170-03), Swiss (325172-03).
### BASIC_PET_V2_MICROSOFT

1
build.sh

@ -88,6 +88,7 @@ build1 KERNAL_CBM2_1983-07-07 kernal
build2 EDITOR_C128 editor
build2 EDITOR_C128_DIN editor
build2 EDITOR_C128_NATIONAL german
build1 EDITOR_CBM2_1982-11-19 sced.lib
build1 EDITOR_CBM2_1983-05-31 sced.lib

Loading…
Cancel
Save