diff --git a/gameboy/makefile b/gameboy/makefile index a85b1b7..077e9eb 100644 --- a/gameboy/makefile +++ b/gameboy/makefile @@ -100,7 +100,8 @@ obj/gb/gfxincbins.o: \ obj/gb/megatontiles.chrgb16.pb16 \ obj/gb/stopwatchface.iu \ obj/gb/stopwatchhand.chrgb.pb16 obj/gb/stopwatchdigits.chrgb.pb16 \ - obj/gb/smptetiles.chrgb.pb16 obj/gb/gradientcolorbartiles.chrgb.pb16 \ + obj/gb/smptetiles.chrgb.pb16 obj/gb/plugetiles.chrgb.pb16 \ + obj/gb/gradientcolorbartiles.chrgb.pb16 # Graphics conversion diff --git a/gameboy/src/gbctests.z80 b/gameboy/src/gbctests.z80 index aa8b815..9823af7 100644 --- a/gameboy/src/gbctests.z80 +++ b/gameboy/src/gbctests.z80 @@ -69,10 +69,78 @@ color_handlers: ; PLUGE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; section "pluge", ROM0 +pluge_palette_ntsc: + drgb $101010 + drgb $181818 + drgb $080808 + drgb $080808 + drgb $686868 + drgb $989898 + drgb $c8c8c8 + drgb $f8f8f8 + +pluge_palette_ntscj: + drgb $000000 + drgb $080808 + drgb $080008 + drgb $000800 + activity_pluge: - ld a,PADF_A|PADF_B|PADF_START|PADF_LEFT|PADF_RIGHT + xor a + ldh [curpalette],a +.restart: + call clear_gbc_attr + + ld b,b + ; Load tiles and map + ld hl,CHRRAM0 + ld de,plugetiles_chr + ld b,5 + call pb16_unpack_block + ld hl,_SCRN0 + ld de,pluge_rowmap + call smpte_load_map + ld hl,pluge_palette_ntsc + ld bc,16*256+low(rBCPS) + ld a,$80 + call set_gbc_palette + + ld a,$FF + ldh [rLYC],a + ld a,LCDCF_ON|BG_NT0|BG_CHR01 + ld [vblank_lcdc_value],a + ldh [rLCDC],a + +.loop: ld b,helpsect_pluge - jp helpscreen + call read_pad_help_check + jr nz,.restart + + ld a,[new_keys] + ld b,a + bit PADB_B,b + ret nz + bit PADB_A,b + jr z,.notogglepalette + ldh a,[curpalette] + cpl + ldh [curpalette],a + .notogglepalette: + + call wait_vblank_irq + + ; Load palette and tiles + ld hl,pluge_palette_ntsc + ldh a,[curpalette] + or a + jr z,.notloadlight + ld hl,pluge_palette_ntscj + .notloadlight: + ld a,$80 + ld bc,(1*8)*256+low(rBCPS) + call set_gbc_palette + + jr .loop ; Gradient color bars ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -184,7 +252,6 @@ activity_gradient_bars: .not_toggle_grid: call wait_vblank_irq - ld a,[nmis] ld a,8 ld de,%000000000000001 call gradient_push_palette @@ -202,14 +269,14 @@ activity_gradient_bars: gradient_load_oam: ld hl,SOAM ld de,$18FF - call .threepair - call .threepair - call .threepair - call .threepair + call .threepairpair + call .threepairpair ld a,l ld [oam_used],a call lcd_clear_oam jp run_dma +.threepairpair: + call .threepair .threepair: ld a,d add 8 @@ -335,15 +402,20 @@ smpte_rowdata: db $30,$30,$34,$31,$31,$35,$32,$32,$36,$33, $a3,$a6,$a2,$a2,$a5,$a1,$a1,$a4,$a0,$a0 ; SMPTE2 db $43,$43,$43,$47,$42,$42,$42,$41,$41,$41, $48,$40,$40,$40,$51,$50,$52,$50,$50,$50 ; SMPTE3 db $10,$10,$14,$11,$11,$15,$12,$12,$16,$13, $83,$86,$82,$82,$85,$81,$81,$84,$80,$80 ; SMPTE1 flipped - db $00,$00,$00,$00,$02,$02,$11,$12,$21,$22, $31,$32,$41,$42,$51,$52,$61,$62,$71,$72 ; gradient - + db $00,$00,$01,$01,$00,$00,$04,$04,$00,$00, $13,$13,$13,$13,$13,$13,$13,$13,$00,$00 ; pluge 1 + db $00,$00,$01,$01,$00,$00,$04,$04,$00,$00, $12,$12,$12,$12,$12,$12,$12,$12,$00,$00 ; pluge 2 + db $00,$00,$01,$01,$00,$00,$04,$04,$00,$00, $11,$11,$11,$11,$11,$11,$11,$11,$00,$00 ; pluge 3 + db $00,$00,$01,$01,$00,$00,$04,$04,$00,$00, $10,$10,$10,$10,$10,$10,$10,$10,$00,$00 ; pluge 4 smpte_rowmap: db $B1,$22,$53,$00 ongray_rowmap: db $30,$41,$40,$44,$30,$00 gradient_rowmap: db $20,$35,$10,$35,$10,$35,$10,$35,$10,$00 +pluge_rowmap: + db $10,$46,$47,$48,$49,$10,$00 + ;; ; @param DE smpte_load_map: diff --git a/gameboy/src/gfxincbins.z80 b/gameboy/src/gfxincbins.z80 index d05969c..02642a3 100644 --- a/gameboy/src/gfxincbins.z80 +++ b/gameboy/src/gfxincbins.z80 @@ -136,10 +136,14 @@ spritegfx_chr:: ; GBC exclusive tests ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -section "gradientbars_gfx1",ROM0 +section "pluge_gfx0",ROM0 +plugetiles_chr:: + incbin "obj/gb/plugetiles.chrgb.pb16" + +section "gradientbars_gfx0",ROM0 gradientcolorbartiles_chr:: incbin "obj/gb/gradientcolorbartiles.chrgb.pb16" -section "smptebars_gfx1",ROM0 +section "smptebars_gfx0",ROM0 smptetiles_chr:: incbin "obj/gb/smptetiles.chrgb.pb16" diff --git a/gameboy/src/helppages.txt b/gameboy/src/helppages.txt index ca6770a..e517617 100644 --- a/gameboy/src/helppages.txt +++ b/gameboy/src/helppages.txt @@ -556,7 +556,7 @@ S: 00 for handheld or == Color tests: Menu == -NYA:PLUGE +PLUGE Gradient color bars SMPTE color bars Color bars on gray diff --git a/gameboy/tilesets/plugetiles.png b/gameboy/tilesets/plugetiles.png new file mode 100644 index 0000000..39c8044 Binary files /dev/null and b/gameboy/tilesets/plugetiles.png differ