corrected load-theme and save-theme; thanks Willem!

This commit is contained in:
sejo 2022-04-19 10:00:16 -05:00
parent a887b9eb18
commit cc42352771
2 changed files with 10 additions and 10 deletions

View File

@ -136,7 +136,7 @@ podríamos adaptar nuestra subrutina anterior para cargar el archivo de temas y
#0006 .Archivo/largo DEO2 ( intentará leer 6 bytes )
( establecer la dirección de los datos a leer y hacer lectura )
;tema/datos .Archivo/cargar DEO2
;tema/datos .Archivo/leer DEO2
( comprobar el byte éxito y saltar según corresponda )
.Archivo/éxito DEI2 #0006 NEQ2 ,&fallo JCN
@ -166,15 +166,15 @@ y para hacer la operación contraria, podemos leer los colores del sistema en nu
```
@guardar-tema ( -- )
( leer los colores del sistema en la memoria del programa )
.Sistema/r DEO2 ;tema/r STA2
.Sistema/g DEO2 ;tema/g STA2
.Sistema/b DEO2 ;tema/b STA2
.Sistema/r DEI2 ;tema/r STA2
.Sistema/g DEI2 ;tema/g STA2
.Sistema/b DEI2 ;tema/b STA2
;tema/nombre .Archivo/nombre DEO2 ( establecer la dirección de la ruta del archivo )
#0006 .Archivo/leer DEO2 ( intentará escribir 6 bytes )
( establecer la dirección de los datos y hacer la escritura )
;tema/datos .Archivo/guardar DEO2
;tema/datos .Archivo/escribir DEO2
( comprobar el byte de éxito y saltar según corresponda )
.Archivo/éxito DEI2 #0006 NEQ2 ,&fallo JCN

View File

@ -136,7 +136,7 @@ we could adapt our previous subroutine in order to load the theme file and apply
#0006 .File/length DEO2 ( will attempt to read 6 bytes )
( set address for the data to read, and do read )
;theme/data .File/load DEO2
;theme/data .File/read DEO2
( check the success byte and jump accordingly )
.File/success DEI2 #0006 NEQ2 ,&failed JCN
@ -166,15 +166,15 @@ and for doing the opposite operation, we can read the system colors into our res
```
@save-theme ( -- )
( read system colors into program memory )
.System/r DEO2 ;theme/r STA2
.System/g DEO2 ;theme/g STA2
.System/b DEO2 ;theme/b STA2
.System/r DEI2 ;theme/r STA2
.System/g DEI2 ;theme/g STA2
.System/b DEI2 ;theme/b STA2
;theme/name .File/name DEO2 ( set address of file path )
#0006 .File/length DEO2 ( will attempt to write 6 bytes )
( set address for the data and do write )
;theme/data .File/save DEO2
;theme/data .File/write DEO2
( check the success byte and jump accordingly )
.File/success DEI2 #0006 NEQ2 ,&failed JCN