diff --git a/arch/z80/sms/xcomp.fs b/arch/z80/sms/xcomp.fs index f477878..d00b24f 100644 --- a/arch/z80/sms/xcomp.fs +++ b/arch/z80/sms/xcomp.fs @@ -13,15 +13,14 @@ SYSVARS 0x73 + CONSTANT CPORT_MEM 0xdd CONSTANT CPORT_D2 SYSVARS 0x74 + CONSTANT PAD_MEM 5 LOAD ( z80 assembler ) -: ZFILL, ( u ) 0 DO 0 C,* LOOP ; 262 LOAD ( xcomp ) 524 LOAD ( font compiler ) 165 LOAD ( Sega ROM signer ) 282 LOAD ( boot.z80.decl ) 270 LOAD ( xcomp overrides ) -DI, 0x100 JP, 0x62 ZFILL, ( 0x66 ) -RETN, 0x98 ZFILL, ( 0x100 ) +DI, 0x100 JP, 0x62 ALLOT0 ( 0x66 ) +RETN, 0x98 ALLOT0 ( 0x100 ) ( All set, carry on! ) CURRENT @ XCURRENT ! 0x100 BIN( ! diff --git a/arch/z80/sms/xcompkbd.fs b/arch/z80/sms/xcompkbd.fs index 8b4234a..e8ae877 100644 --- a/arch/z80/sms/xcompkbd.fs +++ b/arch/z80/sms/xcompkbd.fs @@ -14,15 +14,14 @@ SYSVARS 0x73 + CONSTANT CPORT_MEM 0xdd CONSTANT CPORT_D2 SYSVARS 0x74 + CONSTANT PS2_MEM 5 LOAD ( z80 assembler ) -: ZFILL, ( u ) 0 DO 0 C,* LOOP ; 262 LOAD ( xcomp ) 524 LOAD ( font compiler ) 165 LOAD ( Sega ROM signer ) 282 LOAD ( boot.z80.decl ) 270 LOAD ( xcomp overrides ) -DI, 0x100 JP, 0x62 ZFILL, ( 0x66 ) -RETN, 0x98 ZFILL, ( 0x100 ) +DI, 0x100 JP, 0x62 ALLOT0 ( 0x66 ) +RETN, 0x98 ALLOT0 ( 0x100 ) ( All set, carry on! ) CURRENT @ XCURRENT ! 0x100 BIN( ! diff --git a/arch/z80/sms/xcompsdc.fs b/arch/z80/sms/xcompsdc.fs index b006fc1..ce9bb3f 100644 --- a/arch/z80/sms/xcompsdc.fs +++ b/arch/z80/sms/xcompsdc.fs @@ -15,15 +15,14 @@ SYSVARS 0x73 + CONSTANT CPORT_MEM 0xdd CONSTANT CPORT_D2 SYSVARS 0x74 + CONSTANT PS2_MEM 5 LOAD ( z80 assembler ) -: ZFILL, ( u ) 0 DO 0 C,* LOOP ; 262 LOAD ( xcomp ) 524 LOAD ( font compiler ) 165 LOAD ( Sega ROM signer ) 282 LOAD ( boot.z80.decl ) 270 LOAD ( xcomp overrides ) -DI, 0x100 JP, 0x62 ZFILL, ( 0x66 ) -RETN, 0x98 ZFILL, ( 0x100 ) +DI, 0x100 JP, 0x62 ALLOT0 ( 0x66 ) +RETN, 0x98 ALLOT0 ( 0x100 ) ( All set, carry on! ) CURRENT @ XCURRENT ! 0x100 BIN( ! diff --git a/arch/z80/sms/xcomptextmode.fs b/arch/z80/sms/xcomptextmode.fs index bbd2bce..ae8141d 100644 --- a/arch/z80/sms/xcomptextmode.fs +++ b/arch/z80/sms/xcomptextmode.fs @@ -15,15 +15,14 @@ SYSVARS 0x73 + CONSTANT CPORT_MEM 0xdd CONSTANT CPORT_D2 SYSVARS 0x74 + CONSTANT PS2_MEM 5 LOAD ( z80 assembler ) -: ZFILL, ( u ) 0 DO 0 C,* LOOP ; 262 LOAD ( xcomp ) 523 LOAD ( font compiler ) 165 LOAD ( Sega ROM signer ) 282 LOAD ( boot.z80.decl ) 270 LOAD ( xcomp overrides ) -DI, 0x100 JP, 0x62 ZFILL, ( 0x66 ) -RETN, 0x98 ZFILL, ( 0x100 ) +DI, 0x100 JP, 0x62 ALLOT0 ( 0x66 ) +RETN, 0x98 ALLOT0 ( 0x100 ) ( All set, carry on! ) CURRENT @ XCURRENT ! 0x100 BIN( ! diff --git a/blk.fs b/blk.fs index e26218d..aa199da 100644 --- a/blk.fs +++ b/blk.fs @@ -1741,14 +1741,13 @@ with "390 LOAD" : / /MOD NIP ; : MOD /MOD DROP ; : ALLOT HERE +! ; -: FILL ( a n b -- ) - SWAP 2 PICK + ( a b a+n ) ROT ( b a+n a ) DO ( b ) - DUP I C! - LOOP DROP ; -: ALLOT0 ( n -- ) H@ OVER 0 FILL ALLOT ; SYSVARS 0x3e + :** C@* SYSVARS 0x40 + :** C!* SYSVARS 0x42 + :** C,* +: FILL ( a n b -- ) + ROT> OVER ( b a n a ) + SWAP ( b a+n a ) DO ( b ) + DUP I C!* LOOP DROP ; +: ALLOT0 ( n -- ) H@ OVER 0 FILL ALLOT ; ( ----- 356 ) SYSVARS 0x53 + :** EMIT : STYPE C@+ ( a len ) 0 DO C@+ EMIT LOOP DROP ;