Example for setting 0x15

Do you live and breathe hexadecimal? Do you like speaking to hardware directly?

Moderator: Programming Moderators

Post Reply
User avatar
robpearmain
Posts: 59
Joined: Tue May 30, 2017 5:35 pm
Location: York
Contact:

Example for setting 0x15

Post by robpearmain » Mon Dec 11, 2017 4:56 pm

Where can I find sample code for setting 0x15

https://www.specnext.com/tbblue-io-port-system

Can I use the new SPECNEXT extended Z80 code?

Thanks for any help
Rob Pearmain
Bipboi (Zx Spectrum 48k), Harry Hedgehog (ZX Spectrum [1K]), Luna C (PC), Turbotoons (PC)

ZX Spectrum 48k, +, 128k, Next (board)

Alcoholics Anonymous
Posts: 495
Joined: Mon May 29, 2017 7:00 pm

Re: Example for setting 0x15

Post by Alcoholics Anonymous » Mon Dec 11, 2017 6:09 pm

"nextreg" is currently bugged and "ldirscale" is not currently implemented, so no special instruction to set the registers at the moment.

This is what I am doing currently. I have a flag byte with individual bits that allow me to enable instructions in builds.

Code: Select all

   IF __USE_ZXN_OPCODES & __USE_ZXN_OPCODES_NEXTREG
   
      nextreg __REG_SPRITE_LAYER_SYSTEM, __RSLS_LAYER_PRIORITY_USL | __RSLS_SPRITES_VISIBLE
      
   ELSE
   
      ld bc,__IO_NEXTREG_REG    ; 0x243b
      ld a,__REG_SPRITE_LAYER_SYSTEM   ; 0x15
      out (c),a
      inc b
      ld a,__RSLS_LAYER_PRIORITY_USL | __RSLS_SPRITES_VISIBLE   ; 0x10 | 0x01
      out (c),a
      
   ENDIF

User avatar
robpearmain
Posts: 59
Joined: Tue May 30, 2017 5:35 pm
Location: York
Contact:

Re: Example for setting 0x15

Post by robpearmain » Mon Dec 11, 2017 6:58 pm

That’s great, thanks, much appreciated
Rob Pearmain
Bipboi (Zx Spectrum 48k), Harry Hedgehog (ZX Spectrum [1K]), Luna C (PC), Turbotoons (PC)

ZX Spectrum 48k, +, 128k, Next (board)

Post Reply