Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- textMode:
- xor a
- out (IO_ULA),a
- nextreg $6b,%11001001 ; Tilemap control
- nextreg $6b,%11001001 ; Tilemap control
- nextreg $6e,$00 ; Tilemap base offset $4000-$4f00 (80*24*2)
- nextreg $6f,$20 ; Tiles base offset $6000-$7000 (8*512)
- nextreg $4c,8 ; Transparency colour (bright black)
- nextreg $68,%10000000 ; Disable ULA output
- ; Reset scrolling and clip window
- xor a
- nextreg $1b,a
- nextreg $1b,159
- nextreg $1b,a
- nextreg $1b,255 ; Reset clip window
- nextreg $2f,a
- nextreg $30,a
- nextreg $31,a ; Reset scrolling
- call cls
- ; Initialise the tilemap palette
- nextreg $43,%00110000 ; Set tilemap palette
- xor a
- nextreg $40,a ; Start from index 0
- ld b,a ; Colour (PPPIIII)
- ld de,Palette
- .l1
- ; Set the paper colour
- ld a,b
- and $70
- swapnib ; a = 00000PPP
- ld hl,de
- add a,a
- add hl,a
- ld a,(hl)
- nextreg $44,a
- inc hl
- ld a,(hl)
- nextreg $44,a
- ; Set the ink colour
- ld a,b
- and $f
- ld hl,de
- add a,a
- add hl,a ; HL = address of palette colour
- ld a,(hl)
- nextreg $44,a
- inc hl
- ld a,(hl)
- nextreg $44,a
- inc b
- jp p,.l1
- ret
- ;;----------------------------------------------------------------------------------------------------------------------
- ;; Palette control
- Palette: ; R G B
- db %01001001, %0 ; 3 3 3 Dark grey
- db %00000011, %1 ; 0 0 7 Bright blue
- db %11100000, %0 ; 7 0 0 Bright red
- db %00000000, %0 ; 0 0 0 Black Black is here so we can have a black bg
- db %00011100, %0 ; 0 7 0 Bright green
- db %00011111, %1 ; 0 7 7 Bright cyan
- db %11111100, %0 ; 7 7 0 Bright yellow
- db %10110110, %1 ; 5 5 5 Light grey
- db %10100010, %1 ; 5 0 5 Magenta We'll never have a magenta background
- db %00000010, %1 ; 0 0 5 Blue
- db %10100000, %0 ; 5 0 0 Red
- db %11100011, %1 ; 7 0 7 Bright magenta
- db %00010100, %0 ; 0 5 0 Green
- db %00010110, %1 ; 0 5 5 Cyan
- db %10110100, %0 ; 5 5 0 Yellow
- db %11111111, %1 ; 7 7 7 White
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement