Skip to content

Instantly share code, notes, and snippets.

View gnacu's full-sized avatar

Gregory Naçu gnacu

View GitHub Profile
;----[ basic.s ]------------------------
;HOW TO USE:
;
; .include this file as first code.
; Omit the *= $xxxx from your code.
*= $0801
.word end ;Next Line Ptr
10 print"ascii to petscii converter"
20 print"copyright to whoever wrote it"
30 print
40 input"source file";sf$
50 input"destination file";df$
60 dv=peek(186)
70 open2,dv,2,sf$+",s,r"
80 open3,dv,3,df$+",s,w"
85 rem --------------------------------
90 get#2,a$:s=status
;---------------------------------------
extern
#inc_h "file"
fopen #syscall lfil,fopen_
fread #syscall lfil,fread_
fwrite #syscall lfil,fwrite_
fclose #syscall lfil,fclose_
#inc_h "input"
initmouse #syscall linp,initmouse_
;-- Tab 1: Table Delegates ---
t1_sidx .byte 0 ;Selected Index
t1_ci ;Column Info
#stxy ptr
ldy #2 ;#tc_id ... where def'd?
lda (this),y
tax
mthcycle ;Month Button Cycled
;this -> month cycle button
ldy #settitle_
jsr getmethod
ldy #value
lda (this),y
jsr months_s
jmp sysjmp
a_togfoot ;Menu option toggle footer
#storeget tstviews,9 ;Checkbox
jsr ptrthis
ldy #cflags
lda (this),y
eor #cf_state
sta (this),y
a_togwrap ;Menu option toggle wrap
#ldxy tkenv
jsr settkenv
#storeget tstviews,8 ;Checkbox
jsr ptrthis
ldy #cflags
lda (this),y
eor #cf_state
menucmd ;X -> Menu Command Code
.block
txa
#switch 8
.text "khls!ewf"
.rta a_killmus,a_hidemus
.rta a_loadmus,a_showmus
.rta quitapp
.rta a_raise
.rta a_togwrap,a_togfoot
menuenq ;X -> Menu Command Code
.block
txa
#switch 2
.text "wf"
.rta a_wrapchk,a_footchk
;Current Tab
cmp #"4"
bcs done ;>"3"
msgcmd ;A -> Message Code
.block
#switch 6
.byte mc_menq,mc_mnu,mc_stptr
.byte mc_col,mc_rflg,mc_theme
.rta menuenq,menucmd,statptr
.rta colorset,rflags,cthem
sec ;Message Not Supported