(uxndis)Added 0x100 offset to address

This commit is contained in:
Devine Lu Linvega 2024-07-21 08:41:53 -07:00
parent 61ff230941
commit c825444f24
2 changed files with 39 additions and 51 deletions

View File

@ -1,5 +1,8 @@
( uxncli uxndis.rom input.rom )
|10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1
|a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|000 |000
@src $40 @src $40
@ -43,8 +46,7 @@
;&b .File/read DEO2 ;&b .File/read DEO2
[ LIT2 00 -File/success-lb ] DEI EQU ?{ [ LIT2 00 -File/success-lb ] DEI EQU ?{
[ LIT &b $1 ] [ LIT2 &ptr =rom ] INC2k ,&ptr STR2 [ LIT &b $1 ] [ LIT2 &ptr =rom ] INC2k ,&ptr STR2
STA STA !&>stream }
!&>stream }
JMP2r JMP2r
@<load-sym> ( src* -- ) @<load-sym> ( src* -- )
@ -68,7 +70,7 @@
JMP2r JMP2r
@<print-address> ( addr* -- ) @<print-address> ( addr* -- )
<phex> #0100 ADD2 <phex>
[ LIT2 ": 18 ] DEO [ LIT2 ": 18 ] DEO
#03 !<print-pad> #03 !<print-pad>
@ -135,8 +137,7 @@
SWP2 ;rom SUB2 #0103 ADD2 OVR2 ADD2 find-sym SWP2 ;rom SUB2 #0103 ADD2 OVR2 ADD2 find-sym
( ) INC2k ORA ?{ ( ) INC2k ORA ?{
POP2 OVR #80 AND ?<pdec> POP2 OVR #80 AND ?<pdec>
[ LIT2 "+ 18 ] DEO [ LIT2 "+ 18 ] DEO !<pdec> }
!<pdec> }
NIP2 !<pstr> NIP2 !<pstr>
@<print-pad> ( count -- ) @<print-pad> ( count -- )
@ -165,6 +166,7 @@
#8000 SWP2 SUB2 #7fff AND2 } #8000 SWP2 SUB2 #7fff AND2 }
[ LIT2 00 _&z ] STR [ LIT2 00 _&z ] STR
#2710 /p #03e8 /p #0064 /p #000a /p NIP !<pnum> #2710 /p #03e8 /p #0064 /p #000a /p NIP !<pnum>
&p ( -- ) &p ( -- )
DIV2k DUPk [ LIT &z $1 ] EQU ?{ DIV2k DUPk [ LIT &z $1 ] EQU ?{
DUP <pnum> DUP <pnum>
@ -199,7 +201,7 @@
( name ) "Uxndis 0a ( name ) "Uxndis 0a
( desc ) "Uxntal 20 "Disassembler 0a ( desc ) "Uxntal 20 "Disassembler 0a
( auth ) "By 20 "Devine 20 "Lu 20 "Linvega 0a ( auth ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
( date ) "11 20 "Jun 20 "2024 $2 ( date ) "21 20 "Jul 20 "2024 $2
@opcodes [ @opcodes [
"LIT 00 "INC 00 "POP 00 "NIP 00 "LIT 00 "INC 00 "POP 00 "NIP 00
@ -213,7 +215,8 @@
&brk "BRK 00 &jci "JCI 00 &jmi "JMI &brk "BRK 00 &jci "JCI 00 &jmi "JMI
00 &jsi "JSI 00 ] 00 &jsi "JSI 00 ]
@dict &usage "usage: 20 "uxndis.rom 20 "input.rom 0a $1 @dict
&usage "usage: 20 "uxndis.rom 20 "input.rom 0a $1
@rom $8000 @rom $8000

View File

@ -6,6 +6,7 @@
|80 @Controller &vector $2 &button $1 &key $1 |80 @Controller &vector $2 &button $1 &key $1
|90 @Mouse &vector $2 &x $1 &lx $1 &y $1 &ly $1 &state $1 &chord $1 |90 @Mouse &vector $2 &x $1 &lx $1 &y $1 &ly $1 &state $1 &chord $1
|a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 |a0 @File &vector $2 &success $1 &success-lb $1 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|000 |000
@page $1 @page $1
@ -37,7 +38,7 @@
( name ) "Note 20 "Pad 0a ( name ) "Note 20 "Pad 0a
( details ) "Original 20 "by 20 "Donn 20 "Denman 0a ( details ) "Original 20 "by 20 "Donn 20 "Denman 0a
( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a ( author ) "By 20 "Devine 20 "Lu 20 "Linvega 0a
( date ) "12 20 "Jun, 20 "2024 $1 ( date ) "21 20 "Jul 20 "2024 $1
( fields ) 01 ( fields ) 01
( > icon ) 83 =appicon ( > icon ) 83 =appicon
@ -101,8 +102,7 @@
<draw-header> <draw-header>
( release on close button ) .Mouse/state DEI ?&unchanged ( release on close button ) .Mouse/state DEI ?&unchanged
.Mouse/x DEI2 #0008 SUB2 #000a GTH2 ?&unchanged .Mouse/x DEI2 #0008 SUB2 #000a GTH2 ?&unchanged
( exit ) #800f DEO ( exit ) #800f DEO &unchanged BRK
&unchanged BRK
@on-mouse-body ( -> ) @on-mouse-body ( -> )
<trap-mouse> <trap-mouse>
@ -130,8 +130,7 @@
#01 <set-pixel> #01 <set-pixel>
<draw-sketch> } <draw-sketch> }
DUP #01 NEQ ?{ DUP #01 NEQ ?{
( release/drag mouse1 ) ( release/drag mouse1 ) ( from* ) [ LIT2 &x1 $2 ] [ LIT2 &y1 $2 ]
( from* ) [ LIT2 &x1 $2 ] [ LIT2 &y1 $2 ]
( to ) .Mouse/x DEI2 DUP2 ,&x1 STR2 ( to ) .Mouse/x DEI2 DUP2 ,&x1 STR2
.Mouse/y DEI2 #0012 SUB2 DUP2 ,&y1 STR2 .Mouse/y DEI2 #0012 SUB2 DUP2 ,&y1 STR2
( paint ) #01 <paint-line> ( paint ) #01 <paint-line>
@ -148,10 +147,12 @@
( | continue ) ( | continue )
[ LIT2 00 -Mouse/state ] DEI NEQ .Mouse/x DEI2 #0018 LTH2 AND ?&down [ LIT2 00 -Mouse/state ] DEI NEQ .Mouse/x DEI2 #0018 LTH2 AND ?&down
BRK BRK
&down ( -> ) &down ( -> )
[ LIT2 00 -Mouse/state ] DEO [ LIT2 00 -Mouse/state ] DEO
.Mouse/y DEI2 #00da SUB2 NIP [ LIT2 18 -Mouse/lx ] DEI SUB ADD #18 LTH ?&go-next .Mouse/y DEI2 #00da SUB2 NIP [ LIT2 18 -Mouse/lx ] DEI SUB ADD #18 LTH ?&go-next
prev-page BRK &go-next next-page BRK prev-page BRK
&go-next next-page BRK
@on-frame ( -> ) @on-frame ( -> )
[ LIT2 &last $1 &f $1 ] INCk ,&f STR [ LIT2 &last $1 &f $1 ] INCk ,&f STR
@ -170,25 +171,21 @@
DUP #0d EQU #03 MUL SUB .selection/length LDZ2 #0000 EQU2 ?{ erase-selection } DUP #0d EQU #03 MUL SUB .selection/length LDZ2 #0000 EQU2 ?{ erase-selection }
get-from STH2k #0001 SUB2 get-eof #0001 <msfr> get-from STH2k #0001 SUB2 get-eof #0001 <msfr>
STH2kr STA STH2kr STA
STH2r INC2 <select-from> STH2r INC2 <select-from> !file-save
!file-save
@erase ( -- ) @erase ( -- )
#00 ;on-frame/f STA #00 ;on-frame/f STA
.selection/length LDZ2 #0000 EQU2 ?{ erase-selection !<select-reset> } .selection/length LDZ2 #0000 EQU2 ?{ erase-selection !<select-reset> }
get-from get-page NEQ2 [ JMP JMP2r ] get-from #0001 SUB2 DUP2 cut-char <select-from> get-from get-page NEQ2 [ JMP JMP2r ] get-from #0001 SUB2 DUP2 cut-char <select-from> !file-save
!file-save
@erase-selection ( -- ) @erase-selection ( -- )
get-from get-eof .selection/length LDZ2 <msfl> get-from get-eof .selection/length LDZ2 <msfl> !file-save
!file-save
@delete ( -- ) @delete ( -- )
#00 ;on-frame/f STA #00 ;on-frame/f STA
.selection/length LDZ2 ORA ?{ .selection/length LDZ2 ORA ?{
get-from INC2k get-eof NEQ2 ?{ POP2 JMP2r } get-from INC2k get-eof NEQ2 ?{ POP2 JMP2r }
cut-char <redraw> cut-char <redraw> !file-save }
!file-save }
erase-selection !<select-reset> erase-selection !<select-reset>
@get-eof ( -- addr* ) @get-eof ( -- addr* )
@ -206,8 +203,8 @@
POP2 !<update-cursor> POP2 !<update-cursor>
@erase-sketch ( -- ) @erase-sketch ( -- )
;&mcpy .System/expansion DEO2 ;&mcpy .System/expansion DEO2 !<redraw>
!<redraw>
&mcpy [ 00 1500 0000 =sketch 00 ] &mcpy [ 00 1500 0000 =sketch 00 ]
@get-row ( x* y* -- row* ) @get-row ( x* y* -- row* )
@ -289,13 +286,11 @@
@<select-from> ( addr* -- ) @<select-from> ( addr* -- )
clamp-selection DUP2 .selection/a STZ2 clamp-selection DUP2 .selection/a STZ2
.selection/b STZ2 .selection/b STZ2 !select
!select
@<select-to> ( addr* -- ) @<select-to> ( addr* -- )
clamp-selection DUP2 .selection/b LDZ2 NEQ2 ?{ POP2 JMP2r } clamp-selection DUP2 .selection/b LDZ2 NEQ2 ?{ POP2 JMP2r }
.selection/b STZ2 .selection/b STZ2 !select
!select
@<select-word> ( addr* -- ) @<select-word> ( addr* -- )
DUP2 DUP2
@ -306,15 +301,13 @@
INC2 LDAk #20 GTH ?&>next INC2 LDAk #20 GTH ?&>next
OVR2 OVR2 is-selection ?{ OVR2 OVR2 is-selection ?{
.selection/b STZ2 .selection/b STZ2
.selection/a STZ2 .selection/a STZ2 !select }
!select }
POP2 POP2
( >> ) ( >> )
@<select-line> ( addr* -- ) @<select-line> ( addr* -- )
DUP2 find-line-start .selection/a STZ2 DUP2 find-line-start .selection/a STZ2
find-line-end .selection/b STZ2 find-line-end .selection/b STZ2 !select
!select
@<select-all> ( -- ) @<select-all> ( -- )
get-page DUP2 .selection/a STZ2 get-page DUP2 .selection/a STZ2
@ -323,8 +316,7 @@
@select ( -- ) @select ( -- )
get-to get-from SUB2 .selection/length STZ2 get-to get-from SUB2 .selection/length STZ2
#00 ;on-frame/f STA #00 ;on-frame/f STA !<redraw>
!<redraw>
@<select-left> ( -- ) @<select-left> ( -- )
.selection/length LDZ2 #0000 EQU2 [ LIT2 04 -Controller/button ] DEI AND #00 NEQ ORA ?{ get-from !<select-from> } .selection/length LDZ2 #0000 EQU2 [ LIT2 04 -Controller/button ] DEI AND #00 NEQ ORA ?{ get-from !<select-from> }
@ -373,6 +365,7 @@
#20 STH2r STA #20 STH2r STA
INC GTHk ?&>l INC GTHk ?&>l
POP2 JMP2r POP2 JMP2r
&mcpy [ 01 0100 0000 =placeholder 0000 =mem ] &mcpy [ 01 0100 0000 =placeholder 0000 =mem ]
@file-save ( -- ) @file-save ( -- )
@ -405,8 +398,7 @@
get-from STH2r ADD2 !<select-from> get-from STH2r ADD2 !<select-from>
@edit-cut ( -- ) @edit-cut ( -- )
.selection/length LDZ2 #0001 GTH2 [ JMP JMP2r ] edit-copy erase-selection <select-reset> .selection/length LDZ2 #0001 GTH2 [ JMP JMP2r ] edit-copy erase-selection <select-reset> !file-save
!file-save
@edit-copy ( -- ) @edit-copy ( -- )
.selection/length LDZ2 #0001 GTH2 [ JMP JMP2r ] ;snarf-path .File/name DEO2 .selection/length LDZ2 #0001 GTH2 [ JMP JMP2r ] ;snarf-path .File/name DEO2
@ -466,8 +458,7 @@
&>walk-char ( -- ) &>walk-char ( -- )
.Screen/x DEI2 [ LIT2 &x $2 ] GTH2 ?&end-char .Screen/x DEI2 [ LIT2 &x $2 ] GTH2 ?&end-char
walk-char ?&end-char walk-char ?&end-char
INC2 LDAk ?&>walk-char INC2 LDAk ?&>walk-char &end-char JMP2r
&end-char JMP2r
@walk-char ( addr* -- addr* lb ) @walk-char ( addr* -- addr* lb )
( | wrap ) ( | wrap )
@ -481,6 +472,7 @@
( lb line ) DUP2 #013e NEQ2 ?{ POP2 #01 #0011 !<draw-linebreak> } ( lb line ) DUP2 #013e NEQ2 ?{ POP2 #01 #0011 !<draw-linebreak> }
( lb caret ) DUP2 #012d NEQ2 ?{ POP2 #01 #0012 !<draw-linebreak> } ( lb caret ) DUP2 #012d NEQ2 ?{ POP2 #01 #0012 !<draw-linebreak> }
POP2 #01 #0008 !<draw-linebreak> POP2 #01 #0008 !<draw-linebreak>
&no-wrap ( char ) &no-wrap ( char )
LDAk char-width .Screen/x DEI2 ADD2 .Screen/x DEO2 LDAk char-width .Screen/x DEI2 ADD2 .Screen/x DEO2
( | tab ) ( | tab )
@ -520,30 +512,26 @@
;mem #0001 SUB2 SWP2 ;mem #0001 SUB2 SWP2
&>l ( -- ) &>l ( -- )
#0001 SUB2 LDAk DUP #0a EQU SWP #00 EQU ORA ?&end #0001 SUB2 LDAk DUP #0a EQU SWP #00 EQU ORA ?&end
LTH2k ?&>l LTH2k ?&>l &end NIP2 INC2 JMP2r
&end NIP2 INC2 JMP2r
@find-line-end ( addr* -- addr* ) @find-line-end ( addr* -- addr* )
get-eof SWP2 get-eof SWP2
&>l ( -- ) &>l ( -- )
LDAk #0a EQU ?&end LDAk #0a EQU ?&end
LDAk #00 EQU ?&end LDAk #00 EQU ?&end
INC2 GTH2k ?&>l INC2 GTH2k ?&>l &end NIP2 JMP2r
&end NIP2 JMP2r
@find-word-start ( addr* -- addr* ) @find-word-start ( addr* -- addr* )
;mem SWP2 ;mem SWP2
&>l ( -- ) &>l ( -- )
#0001 SUB2 LDAk #21 LTH ?&end #0001 SUB2 LDAk #21 LTH ?&end
LTH2k ?&>l LTH2k ?&>l &end NIP2 INC2 JMP2r
&end NIP2 INC2 JMP2r
@find-word-end ( addr* -- addr* ) @find-word-end ( addr* -- addr* )
get-eof SWP2 get-eof SWP2
&>l ( -- ) &>l ( -- )
LDAk #21 LTH ?&end LDAk #21 LTH ?&end
INC2 GTH2k ?&>l INC2 GTH2k ?&>l &end NIP2 JMP2r
&end NIP2 JMP2r
( (
@|drawing ) @|drawing )
@ -586,8 +574,7 @@
#0000 .Screen/x DEO2 #0000 .Screen/x DEO2
#0018 .Screen/y DEO2 #0018 .Screen/y DEO2
[ LIT2 80 -Screen/pixel ] DEO [ LIT2 80 -Screen/pixel ] DEO
<draw-note> <draw-note> !<draw-footer>
!<draw-footer>
@<draw-note> ( -- ) @<draw-note> ( -- )
[ LIT2 00 -collapsed ] LDZ EQU ?{ JMP2r } [ LIT2 00 -collapsed ] LDZ EQU ?{ JMP2r }
@ -612,8 +599,7 @@
;on-frame/last LDA #01 AND ?&block ;on-frame/last LDA #01 AND ?&block
;blink-icn .Screen/addr DEO2 ;blink-icn .Screen/addr DEO2
[ LIT2 05 -Screen/sprite ] DEO [ LIT2 05 -Screen/sprite ] DEO
.Screen/x DEI2k #0008 SUB2 ROT DEO2 .Screen/x DEI2k #0008 SUB2 ROT DEO2 &block walk-char POP INC2 LDAk ?&>w
&block walk-char POP INC2 LDAk ?&>w
POP2 POP2
( >> ) ( >> )
@ -701,8 +687,7 @@
@|stdlib ) @|stdlib )
@scap ( str* -- end* ) @scap ( str* -- end* )
&>w ( -- ) INC2 & LDAk ?scap
INC2 & LDAk ?&>w
JMP2r JMP2r
@<phex> ( short* -: ) @<phex> ( short* -: )