; ; How to set up screen mode with BIOS? ; Featuring also VDP writing and keyboard reading. ; Note that TASM doesn't know about precedence in arithmetic. ; ; - Marq/L!T PIXELS .equ 0 ; Address of pixels in VRAM .org 100h ld a,3 ; SCREEN 3 (64x48 gfxmode) ld (0fcafh),a ld ix,05fh ld iy,(0fcc0h) call 01ch ; Inter-slot call ld d,0 mainloop: halt ; Wait for vertical blank ld a,PIXELS & 0ffh ; Set write address to VDP out (099h),a ld a,PIXELS >> 8 or 040h out (099h),a ld bc,32*48 ; We'll write 64*48 pixels (1 byte=2 pixels) filloop: ld a,d out (98h),a ; Write fill byte to VRAM. VDP increases the address dec bc ; automatically ld a,b or c jp nz,filloop ; Over and over inc d ; Increase fill byte in a,(0aah) ; Check whether space is pressed and 0f0h or 8 out (0aah),a in a,(0a9h) and 1 jp nz,mainloop ; Not pressed, keep on keeping on xor a ; SCREEN 0 (40x24 textmode) ld (0fcafh),a ld ix,05fh ld iy,(0fcc0h) call 01ch ; Inter-slot call ret ; Back to DOS .end