diff --git a/presets/nes/Makefile b/presets/nes/Makefile new file mode 100644 index 00000000..ed9c55c7 --- /dev/null +++ b/presets/nes/Makefile @@ -0,0 +1,3 @@ + +test.rom: ex2.asm nesdefs.asm nesppu.asm + dasm ex2.asm diff --git a/presets/nes/crypto.c b/presets/nes/crypto.c index 11b1c0fc..577b3add 100644 --- a/presets/nes/crypto.c +++ b/presets/nes/crypto.c @@ -1,9 +1,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name (pop) - //#define DEBUG #define HAS_DEBUGGER diff --git a/presets/nes/ex1.asm b/presets/nes/ex1.asm index 90fc13d9..ced63e84 100644 --- a/presets/nes/ex1.asm +++ b/presets/nes/ex1.asm @@ -1,4 +1,4 @@ - + include "nesdefs.asm" ;;;;; VARIABLES @@ -6,11 +6,9 @@ seg.u RAM org $0 -ScrollPos byte ; used during NMI - ;;;;; NES CARTRIDGE HEADER - NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical + NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, horiz. mirror ;;;;; START OF CODE @@ -18,9 +16,9 @@ Start: NES_INIT ; set up stack pointer, turn off PPU jsr WaitSync ; wait for VSYNC jsr ClearRAM ; clear RAM - jsr SetPalette ; set palette colors - jsr FillVRAM ; set PPU video RAM jsr WaitSync ; wait for VSYNC (and PPU warmup) + jsr SetPalette ; set palette colors + jsr HelloVRAM ; set PPU video RAM lda #0 sta PPU_ADDR sta PPU_ADDR ; PPU addr = $0000 @@ -28,43 +26,47 @@ Start: sta PPU_SCROLL ; scroll = $0000 lda #CTRL_NMI sta PPU_CTRL ; enable NMI - lda #MASK_SPR|MASK_BG|MASK_SPR_CLIP|MASK_BG_CLIP + lda #MASK_BG sta PPU_MASK ; enable rendering .endless jmp .endless ; endless loop -; fill video RAM -FillVRAM: subroutine - txa +; fill video RAM with "Hello World" msg +HelloVRAM: subroutine ldy #$20 + lda #$21 ; PPU addr = $2021 sty PPU_ADDR - sta PPU_ADDR ; PPU addr = $2000 - ldy #$10 ; $10 (16) 256-byte pages + sta PPU_ADDR ; -> PPU_ADDR + ldy #0 .loop: - sta PPU_DATA ; write to VRAM - adc #7 ; add 7 to make randomish pattern - inx - bne .loop - dey ; next page - bne .loop ; out of pages? - rts + lda HelloMsg,y ; get next character + beq .end ; is 0? exit loop + sta PPU_DATA ; store+advance PPU + iny ; next character + bne .loop ; loop +.end + rts ; return to caller + +; ASCII message to display on screen +HelloMsg: + .byte "Hello, World!" + .byte 0 ; zero terminator ; set palette colors SetPalette: subroutine ldy #$00 lda #$3f sta PPU_ADDR - sty PPU_ADDR ; PPU addr = 0x3f00 - ldx #32 ; 32 palette colors + sty PPU_ADDR + ldx #32 .loop: - lda Palette,y ; load from ROM - sta PPU_DATA ; store to palette + lda Palette,y + sta PPU_DATA iny dex - bne .loop ; loop until 32 colors stored + bne .loop rts - ;;;;; COMMON SUBROUTINES include "nesppu.asm" @@ -72,16 +74,6 @@ SetPalette: subroutine ;;;;; INTERRUPT HANDLERS NMIHandler: -; save registers - pha ; save A -; update scroll position (must be done after VRAM updates) - inc ScrollPos - lda ScrollPos - sta PPU_SCROLL ; X scroll position - lda #0 - sta PPU_SCROLL ; Y scroll position -; reload registers - pla ; reload A rti ;;;;; CONSTANT DATA @@ -89,10 +81,10 @@ NMIHandler: align $100 Palette: hex 1f ;background - hex 09091900 ;bg0 + hex 09092c00 ;bg0 hex 09091900 ;bg1 - hex 09091900 ;bg2 - hex 09091900 ;bg3 + hex 09091500 ;bg2 + hex 09092500 ;bg3 ;;;;; CPU VECTORS @@ -101,13 +93,5 @@ Palette: ;;;;; TILE SETS org $10000 - REPEAT 64 - hex 003c6666766e663c007e181818381818 - hex 007e60300c06663c003c66061c06663c - hex 0006067f661e0e06003c6606067c607e - hex 003c66667c60663c00181818180c667e - hex 003c66663c66663c003c66063e66663c - hex 01010101010101010000000000000000 - hex ff000000000000000000000000000000 - hex 01020408102040800000000000000000 - REPEND + incbin "jroatch.chr" + diff --git a/presets/nes/ex2.asm b/presets/nes/ex2.asm index 2109b985..906f4acb 100644 --- a/presets/nes/ex2.asm +++ b/presets/nes/ex2.asm @@ -7,38 +7,32 @@ org $0 ScrollPos byte ; used during NMI -Rand byte -Temp1 byte - -SpriteBuf equ $200 ;;;;; NES CARTRIDGE HEADER - NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, vertical + NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, horiz. mirror ;;;;; START OF CODE Start: - NES_INIT ; set up stack pointer, turn off PPU - jsr WaitSync - jsr WaitSync - jsr ClearRAM - jsr WaitSync ;wait for VSYNC - jsr SetPalette ;set colors - jsr FillVRAM ;set PPU RAM - jsr WaitSync ;wait for VSYNC (and PPU warmup) - jsr InitSprites + NES_INIT ; set up stack pointer, turn off PPU + jsr WaitSync ; wait for VSYNC + jsr ClearRAM ; clear RAM + jsr WaitSync ; wait for VSYNC (and PPU warmup) + + jsr SetPalette ; set palette colors + jsr FillVRAM ; set PPU video RAM lda #0 sta PPU_ADDR - sta PPU_ADDR ;PPU addr = 0 + sta PPU_ADDR ; PPU addr = $0000 sta PPU_SCROLL - sta PPU_SCROLL ;scroll = 0 - lda #$90 - sta PPU_CTRL ;enable NMI - lda #$1e - sta PPU_MASK ;enable rendering + sta PPU_SCROLL ; scroll = $0000 + lda #CTRL_NMI + sta PPU_CTRL ; enable NMI + lda #MASK_BG + sta PPU_MASK ; enable rendering .endless - jmp .endless ;endless loop + jmp .endless ; endless loop ; fill video RAM FillVRAM: subroutine @@ -48,44 +42,14 @@ FillVRAM: subroutine sta PPU_ADDR ldy #$10 .loop: - sta PPU_DATA - adc #7 + stx PPU_DATA inx bne .loop dey bne .loop rts -; -InitSprites: subroutine - lda #1 - ldx #0 -.loop - sta SpriteBuf,x - jsr NextRandom - inx - bne .loop - rts - -; -MoveSprites: subroutine - lda #1 - ldx #0 -.loop - sta Temp1 - lda Temp1 - and #3 - clc - adc SpriteBuf,x - sta SpriteBuf,x - lda Temp1 - jsr NextRandom - inx - bne .loop - rts - ; set palette colors - SetPalette: subroutine ldy #$00 lda #$3f @@ -110,22 +74,12 @@ SetPalette: subroutine NMIHandler: ; save registers pha ; save A -; load sprites - lda #$02 - sta PPU_OAM_DMA ; update scroll position (must be done after VRAM updates) inc ScrollPos lda ScrollPos - sta PPU_SCROLL + sta PPU_SCROLL ; horiz byte lda #0 - sta PPU_SCROLL -; TODO: write high bits to PPUCTRL - lda ScrollPos - and #0 - ora #$90 ; enable NMI - sta PPU_CTRL -; move sprites - jsr MoveSprites + sta PPU_SCROLL ; vert byte ; reload registers pla ; reload A rti @@ -135,14 +89,10 @@ NMIHandler: align $100 Palette: hex 1f ;background - hex 09091900 ;bg0 + hex 09092c00 ;bg0 hex 09091900 ;bg1 - hex 09091900 ;bg2 - hex 09091900 ;bg3 - hex 14243400 ;sp0 - hex 15253500 ;sp1 - hex 16263600 ;sp2 - hex 17273700 ;sp3 + hex 09091500 ;bg2 + hex 09092500 ;bg3 ;;;;; CPU VECTORS @@ -151,13 +101,5 @@ Palette: ;;;;; TILE SETS org $10000 - REPEAT 64 - hex 003c6666766e663c007e181818381818 - hex 007e60300c06663c003c66061c06663c - hex 0006067f661e0e06003c6606067c607e - hex 003c66667c60663c00181818180c667e - hex 003c66663c66663c003c66063e66663c - hex 01010101010101010000000000000000 - hex ff000000000000000000000000000000 - hex 01020408102040800000000000000000 - REPEND + incbin "jroatch.chr" + diff --git a/presets/nes/ex3.asm b/presets/nes/ex3.asm new file mode 100644 index 00000000..49c69da7 --- /dev/null +++ b/presets/nes/ex3.asm @@ -0,0 +1,146 @@ + + include "nesdefs.asm" + +;;;;; VARIABLES + + seg.u RAM + org $0 + +ScrollPos byte ; used during NMI +Rand byte +Temp1 byte + +SpriteBuf equ $200 + +;;;;; NES CARTRIDGE HEADER + + NES_HEADER 0,2,1,0 ; mapper 0, 2 PRGs, 1 CHR, horiz. mirror + +;;;;; START OF CODE + +Start: + NES_INIT ; set up stack pointer, turn off PPU + jsr WaitSync + jsr WaitSync + jsr ClearRAM + jsr WaitSync ;wait for VSYNC + jsr SetPalette ;set colors + jsr FillVRAM ;set PPU RAM + jsr WaitSync ;wait for VSYNC (and PPU warmup) + jsr InitSprites + lda #0 + sta PPU_ADDR + sta PPU_ADDR ;PPU addr = 0 + sta PPU_SCROLL + sta PPU_SCROLL ;scroll = 0 + lda #CTRL_NMI + sta PPU_CTRL ; enable NMI + lda #MASK_BG|MASK_SPR + sta PPU_MASK ; enable rendering +.endless + jmp .endless ;endless loop + +; fill video RAM +FillVRAM: subroutine + txa + ldy #$20 + sty PPU_ADDR + sta PPU_ADDR + ldy #$10 +.loop: + stx PPU_DATA + inx + bne .loop + dey + bne .loop + rts + +; +InitSprites: subroutine + lda #1 + ldx #0 +.loop + sta SpriteBuf,x + jsr NextRandom + inx + bne .loop + rts + +; +MoveSprites: subroutine + lda #1 + ldx #0 +.loop + sta Temp1 + and #3 + clc + adc SpriteBuf,x + sta SpriteBuf,x + lda Temp1 + jsr NextRandom + inx + bne .loop + rts + +; set palette colors + +SetPalette: subroutine + ldy #$00 + lda #$3f + sta PPU_ADDR + sty PPU_ADDR + ldx #32 +.loop: + lda Palette,y + sta PPU_DATA + iny + dex + bne .loop + rts + + +;;;;; COMMON SUBROUTINES + + include "nesppu.asm" + +;;;;; INTERRUPT HANDLERS + +NMIHandler: + SAVE_REGS +; load sprites + lda #$02 + sta PPU_OAM_DMA +; update scroll position (must be done after VRAM updates) + inc ScrollPos + lda ScrollPos + sta PPU_SCROLL + lda #0 + sta PPU_SCROLL +; move sprites + jsr MoveSprites +; reload registers + RESTORE_REGS + rti + +;;;;; CONSTANT DATA + + align $100 +Palette: + hex 1f ;background + hex 09090000 ;bg0 + hex 09090c00 ;bg1 + hex 09091c00 ;bg2 + hex 09092c00 ;bg3 + hex 14243400 ;sp0 + hex 15253500 ;sp1 + hex 16263600 ;sp2 + hex 17273700 ;sp3 + +;;;;; CPU VECTORS + + NES_VECTORS + +;;;;; TILE SETS + + org $10000 + incbin "jroatch.chr" diff --git a/presets/nes/jroatch.c b/presets/nes/jroatch.c new file mode 100644 index 00000000..5bfb1cc0 --- /dev/null +++ b/presets/nes/jroatch.c @@ -0,0 +1,344 @@ +const unsigned char jroatch_chr[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0x55, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0xaa, 0x55, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0x55, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0x55, 0xaa, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xcc, 0x33, 0xcc, + 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xcc, 0x33, 0xcc, + 0x33, 0xcc, 0x33, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, + 0xcc, 0x33, 0xcc, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0xcc, 0x33, 0x33, 0xcc, 0x33, 0xcc, + 0x33, 0xcc, 0x33, 0xcc, 0x3e, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3e, + 0x3c, 0x42, 0x5a, 0x52, 0x5a, 0x42, 0x3c, 0x00, 0xfe, 0xff, 0x7f, 0x7b, + 0x7b, 0x00, 0x00, 0x00, 0xf4, 0x4a, 0x52, 0x52, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x0f, 0x0f, 0x3f, 0x7e, 0x7e, 0x7e, 0x3c, 0x0e, 0x06, 0x0a, 0x38, + 0x6c, 0x6c, 0x38, 0x00, 0x3c, 0x7e, 0x7e, 0x7e, 0x3c, 0x3c, 0x3c, 0x18, + 0x38, 0x6c, 0x6c, 0x38, 0x10, 0x38, 0x10, 0x00, 0x18, 0x3c, 0x7e, 0xff, + 0xff, 0xff, 0x3c, 0x3c, 0x10, 0x38, 0x7c, 0xfe, 0xee, 0x10, 0x38, 0x00, + 0x7e, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x6c, 0xfe, 0xfe, 0xfe, + 0x7c, 0x38, 0x10, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18, + 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x3c, 0x7e, 0x7e, 0xff, + 0xff, 0xff, 0x3c, 0x3c, 0x38, 0x7c, 0x38, 0xfe, 0xd6, 0x10, 0x38, 0x00, + 0x18, 0x3c, 0xff, 0xff, 0x7e, 0x7e, 0x7e, 0x7e, 0x10, 0x38, 0xfe, 0x7c, + 0x38, 0x7c, 0x6c, 0x00, 0x0f, 0x1f, 0x7f, 0xff, 0xfc, 0xfc, 0xfc, 0x78, + 0x0a, 0x14, 0x72, 0xf8, 0xf8, 0xf8, 0x70, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xf6, 0xf6, 0xf6, 0xf6, 0x00, 0x00, 0xee, 0x84, 0xe4, 0x24, 0xe4, 0x00, + 0x00, 0x00, 0xfc, 0xfc, 0xfc, 0xfc, 0xff, 0xff, 0x00, 0x00, 0xe8, 0x88, + 0xe8, 0x28, 0xee, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0xdb, 0x18, 0x18, + 0x10, 0x38, 0x7c, 0xd6, 0x92, 0x10, 0x10, 0x00, 0x18, 0x18, 0xdb, 0xff, + 0xff, 0x7e, 0x3c, 0x18, 0x10, 0x10, 0x92, 0xd6, 0x7c, 0x38, 0x10, 0x00, + 0x1c, 0x3c, 0x78, 0xff, 0xff, 0x78, 0x3c, 0x1c, 0x18, 0x30, 0x60, 0xfe, + 0x60, 0x30, 0x18, 0x00, 0x38, 0x3c, 0x1e, 0xff, 0xff, 0x1e, 0x3c, 0x38, + 0x30, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x3c, 0x3c, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x30, 0x30, + 0x30, 0x00, 0x30, 0x00, 0x3c, 0x3c, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x7e, 0x7e, + 0x7e, 0x7e, 0x3c, 0x00, 0x00, 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x00, 0x00, + 0x0c, 0x3f, 0x3f, 0x3e, 0x3e, 0x7e, 0x7e, 0x18, 0x08, 0x3e, 0x28, 0x3c, + 0x14, 0x7c, 0x10, 0x00, 0x00, 0x76, 0x7e, 0x7c, 0x3e, 0x7e, 0x6e, 0x00, + 0x00, 0x64, 0x48, 0x10, 0x24, 0x4c, 0x00, 0x00, 0x00, 0x38, 0x7c, 0x7c, + 0x7e, 0x7e, 0x7e, 0x3e, 0x00, 0x30, 0x48, 0x30, 0x5c, 0x48, 0x34, 0x00, + 0x30, 0x30, 0x70, 0x60, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1e, 0x3c, 0x38, 0x38, 0x3c, 0x1e, 0x0e, + 0x0c, 0x18, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, 0x70, 0x78, 0x3c, 0x1c, + 0x1c, 0x3c, 0x78, 0x70, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00, + 0x00, 0x00, 0x3e, 0x3e, 0x3e, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, + 0x3c, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18, 0x00, + 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x38, 0x78, 0x70, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x00, 0x00, 0x00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, 0x38, 0x6c, 0x6c, 0x38, 0x00, + 0x3c, 0x7e, 0x7e, 0x7e, 0x3e, 0x7e, 0x7e, 0x3c, 0x38, 0x6c, 0x6c, 0x3c, + 0x0c, 0x6c, 0x38, 0x00, 0x00, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x00, + 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x38, 0x38, 0x38, + 0x38, 0x38, 0x78, 0x70, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0x00, + 0x0e, 0x1e, 0x3c, 0x78, 0x78, 0x3c, 0x1e, 0x0e, 0x0c, 0x18, 0x30, 0x60, + 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x3e, 0x3e, 0x3e, 0x3e, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x70, 0x78, 0x3c, 0x1e, + 0x1e, 0x3c, 0x78, 0x70, 0x60, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0x00, + 0x3c, 0x7e, 0x7e, 0x1e, 0x3c, 0x38, 0x38, 0x38, 0x38, 0x6c, 0x0c, 0x18, + 0x30, 0x00, 0x30, 0x00, 0x3c, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x3e, + 0x38, 0x44, 0x5c, 0x54, 0x5c, 0x40, 0x3c, 0x00, 0x3e, 0x7f, 0x77, 0x7f, + 0x7f, 0x77, 0x77, 0x77, 0x3c, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x00, + 0x7e, 0x7f, 0x77, 0x7f, 0x7f, 0x77, 0x7f, 0x7e, 0x7c, 0x66, 0x66, 0x7c, + 0x66, 0x66, 0x7c, 0x00, 0x3e, 0x7f, 0x77, 0x70, 0x70, 0x77, 0x7f, 0x3e, + 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x00, 0x7c, 0x7e, 0x7f, 0x77, + 0x77, 0x7f, 0x7e, 0x7c, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x00, + 0x7f, 0x7f, 0x70, 0x7f, 0x7f, 0x70, 0x7f, 0x7f, 0x7e, 0x60, 0x60, 0x7e, + 0x60, 0x60, 0x7e, 0x00, 0x7f, 0x7f, 0x70, 0x7c, 0x7c, 0x70, 0x70, 0x70, + 0x7e, 0x60, 0x60, 0x78, 0x60, 0x60, 0x60, 0x00, 0x3e, 0x7f, 0x77, 0x7f, + 0x7f, 0x77, 0x7f, 0x3e, 0x3c, 0x66, 0x60, 0x6e, 0x66, 0x66, 0x3c, 0x00, + 0x77, 0x77, 0x77, 0x7f, 0x7f, 0x77, 0x77, 0x77, 0x66, 0x66, 0x66, 0x7e, + 0x66, 0x66, 0x66, 0x00, 0x7f, 0x7f, 0x1c, 0x1c, 0x1c, 0x1c, 0x7f, 0x7f, + 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x07, 0x07, 0x07, 0x07, + 0x77, 0x77, 0x7f, 0x3e, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, + 0x77, 0x7f, 0x7e, 0x7c, 0x7c, 0x7e, 0x7f, 0x77, 0x66, 0x6c, 0x78, 0x70, + 0x78, 0x6c, 0x66, 0x00, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x7f, 0x7f, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x00, 0xfe, 0xff, 0xff, 0xff, + 0xff, 0xe7, 0xe7, 0xe7, 0xec, 0xfe, 0xd6, 0xd6, 0xc6, 0xc6, 0xc6, 0x00, + 0x77, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x77, 0x77, 0x66, 0x76, 0x7e, 0x7e, + 0x6e, 0x66, 0x66, 0x00, 0x3e, 0x7f, 0x77, 0x77, 0x77, 0x77, 0x7f, 0x3e, + 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x7e, 0x7f, 0x77, 0x7f, + 0x7e, 0x70, 0x70, 0x70, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x00, + 0x3e, 0x7f, 0x77, 0x77, 0x77, 0x7f, 0x7f, 0x3f, 0x3c, 0x66, 0x66, 0x66, + 0x66, 0x6c, 0x3e, 0x00, 0x7e, 0x7f, 0x77, 0x7f, 0x7e, 0x7e, 0x7f, 0x77, + 0x7c, 0x66, 0x66, 0x7c, 0x78, 0x6c, 0x66, 0x00, 0x3e, 0x7f, 0x77, 0x7e, + 0x3f, 0x77, 0x7f, 0x3e, 0x3c, 0x66, 0x60, 0x3c, 0x06, 0x66, 0x3c, 0x00, + 0x7f, 0x7f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x7e, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x00, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x7f, 0x3e, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x77, 0x77, 0x77, 0x77, + 0x7f, 0x3e, 0x3e, 0x1c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x3c, 0x18, 0x00, + 0xe7, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0xc6, 0xc6, 0xd6, 0xd6, + 0xd6, 0xfe, 0x6c, 0x00, 0x77, 0x77, 0x7f, 0x3e, 0x3e, 0x7f, 0x77, 0x77, + 0x66, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x66, 0x00, 0x77, 0x77, 0x77, 0x7f, + 0x3e, 0x1c, 0x1c, 0x1c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, + 0x7f, 0x7f, 0x0f, 0x1e, 0x3c, 0x78, 0x7f, 0x7f, 0x7e, 0x06, 0x0c, 0x18, + 0x30, 0x60, 0x7e, 0x00, 0x1f, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x1f, + 0x1e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1e, 0x00, 0x30, 0x38, 0x38, 0x1c, + 0x1c, 0x0e, 0x0e, 0x06, 0x20, 0x30, 0x10, 0x18, 0x08, 0x0c, 0x04, 0x00, + 0xf8, 0xf8, 0x38, 0x38, 0x38, 0x38, 0xf8, 0xf8, 0xf0, 0x30, 0x30, 0x30, + 0x30, 0x30, 0xf0, 0x00, 0x18, 0x3c, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, + 0x10, 0x38, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, + 0x30, 0x30, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3e, 0x3e, 0x7e, 0x7e, 0x3e, + 0x00, 0x00, 0x38, 0x0c, 0x3c, 0x4c, 0x34, 0x00, 0x70, 0x70, 0x7c, 0x7e, + 0x7e, 0x7e, 0x7e, 0x7c, 0x60, 0x60, 0x78, 0x6c, 0x6c, 0x6c, 0x78, 0x00, + 0x00, 0x00, 0x3c, 0x7e, 0x7e, 0x7e, 0x7e, 0x3c, 0x00, 0x00, 0x38, 0x6c, + 0x60, 0x6c, 0x38, 0x00, 0x0e, 0x0e, 0x3e, 0x7e, 0x7e, 0x7e, 0x7e, 0x3e, + 0x0c, 0x0c, 0x3c, 0x6c, 0x6c, 0x6c, 0x3c, 0x00, 0x00, 0x00, 0x3c, 0x7e, + 0x7e, 0x7e, 0x7e, 0x3e, 0x00, 0x00, 0x38, 0x64, 0x7c, 0x60, 0x3c, 0x00, + 0x00, 0x3c, 0x7e, 0x7e, 0x7c, 0x7c, 0x70, 0x70, 0x00, 0x38, 0x6c, 0x60, + 0x78, 0x60, 0x60, 0x00, 0x00, 0x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, 0x00, 0x00, 0x78, 0x6c, + 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x3e, 0x7e, 0x7c, 0x3e, 0x7e, 0x7c, + 0x00, 0x00, 0x3c, 0x60, 0x38, 0x0c, 0x78, 0x00, 0x00, 0x1c, 0x3e, 0x3e, + 0x1c, 0x1c, 0x1e, 0x0e, 0x00, 0x18, 0x3c, 0x18, 0x18, 0x18, 0x0c, 0x00, + 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x3e, 0x00, 0x00, 0x6c, 0x6c, + 0x6c, 0x6c, 0x34, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x3e, 0x1c, + 0x00, 0x00, 0x6c, 0x6c, 0x6c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0xe7, 0xe7, + 0xff, 0xff, 0x7e, 0x7e, 0x00, 0x00, 0xc6, 0xc6, 0xd6, 0x7c, 0x6c, 0x00, + 0x00, 0x00, 0x7e, 0x7e, 0x3c, 0x3c, 0x7e, 0x7e, 0x00, 0x00, 0x6c, 0x38, + 0x10, 0x38, 0x6c, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x3e, 0x7c, 0x78, + 0x00, 0x00, 0x6c, 0x6c, 0x3c, 0x18, 0x70, 0x00, 0x00, 0x00, 0x7e, 0x7e, + 0x3c, 0x78, 0x7e, 0x7e, 0x00, 0x00, 0x7c, 0x18, 0x30, 0x60, 0x7c, 0x00, + 0x0e, 0x1e, 0x1c, 0x3c, 0x3c, 0x1c, 0x1e, 0x0e, 0x0c, 0x18, 0x18, 0x30, + 0x18, 0x18, 0x0c, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x70, 0x78, 0x38, 0x3c, + 0x3c, 0x38, 0x78, 0x70, 0x60, 0x30, 0x30, 0x18, 0x30, 0x30, 0x60, 0x00, + 0x00, 0x00, 0x7f, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, + 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, + 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, 0x0f, 0x0f, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xf0, 0xf0, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0f, 0x0f, 0x0f, 0x0f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f, 0xc0, 0xc0, + 0xc0, 0xc0, 0xc0, 0xc0, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1f, 0x1f, 0x1f, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x07, 0x07, + 0x07, 0xf8, 0xf8, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0xfc, 0xfc, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xfe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x7f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x3f, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x1f, 0x1f, 0xe0, + 0xe0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x07, 0x07, 0x07, 0x07, 0x07, 0xf8, 0xf8, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x30, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x30, 0xc0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xc0, 0x30, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x0c, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x20, 0x20, + 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x04, 0x04, + 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x42, 0x24, 0x18, + 0x18, 0x24, 0x42, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x0c, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x10, 0x3e, 0x2e, 0x2e, 0x2a, 0x2e, + 0x00, 0x3c, 0xbc, 0x5a, 0x00, 0x20, 0x24, 0x7e, 0x18, 0x00, 0x80, 0x42, + 0x18, 0x04, 0x00, 0x12, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x24, 0x00, 0x5a, 0x00, + 0x24, 0x00, 0x18, 0x00, 0x24, 0x00, 0x5a, 0x00, 0x24, 0x00, 0x18, 0x3c, + 0x4d, 0x41, 0x00, 0x2e, 0x24, 0x24, 0x6a, 0x6e, 0x0c, 0x00, 0x10, 0x3e, + 0x2e, 0x2e, 0x2a, 0x2e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe7, 0xc3, 0xc3, 0xe7, 0xe7, 0xdb, 0xdb, 0x93, 0x24, 0x24, 0xc3, 0x08, + 0x18, 0xc3, 0x24, 0x24, 0x18, 0x66, 0x42, 0x91, 0x89, 0x42, 0x66, 0x18, + 0x18, 0x24, 0x00, 0x24, 0x00, 0x18, 0x00, 0x00, 0x24, 0x00, 0x5a, 0x00, + 0x24, 0x00, 0x18, 0x3c, 0x5a, 0x36, 0x00, 0x00, 0x6c, 0x3b, 0x76, 0x00, + 0x24, 0x7e, 0x54, 0x45, 0x48, 0x7e, 0x3e, 0x00, 0x00, 0x08, 0x14, 0x2a, + 0x55, 0x2a, 0x14, 0x08, 0x80, 0x49, 0x36, 0x3e, 0x5d, 0x3e, 0x36, 0x49, + 0x0f, 0x1f, 0x3f, 0x3d, 0x38, 0x38, 0x3c, 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0xb6, 0xb7, 0xff, 0x01, 0xb7, + 0x7f, 0x7f, 0x7f, 0x00, 0x7f, 0x7f, 0x7f, 0x00, 0xad, 0xad, 0xad, 0xff, + 0x80, 0xad, 0xad, 0xff, 0xea, 0xe2, 0xfe, 0x00, 0xfe, 0xfe, 0xfe, 0x00, + 0xb5, 0xbd, 0xa1, 0xff, 0x01, 0xb7, 0xb7, 0xff, 0x00, 0x22, 0x4c, 0x1f, + 0x36, 0x3f, 0x5f, 0x17, 0x01, 0x63, 0x3f, 0x20, 0x2d, 0x29, 0x60, 0xec, + 0x80, 0xc4, 0xf2, 0xfc, 0xdc, 0xfc, 0xfa, 0xd8, 0x00, 0x86, 0xdc, 0x04, + 0xb0, 0x24, 0x06, 0x37, 0xff, 0x7f, 0x36, 0x3f, 0x1f, 0x5c, 0x22, 0x00, + 0x68, 0x20, 0x0d, 0x29, 0x20, 0x77, 0x43, 0x01, 0xff, 0xfe, 0xdc, 0xfc, + 0xfc, 0xfa, 0xc4, 0x80, 0x26, 0x04, 0xb0, 0x20, 0x04, 0xcc, 0x86, 0x00, + 0x00, 0x00, 0x00, 0x1c, 0x26, 0x2f, 0x3f, 0x3f, 0x00, 0x00, 0x1c, 0x3e, + 0x7f, 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x38, 0x4c, 0xdc, 0xf4, 0xf4, + 0x00, 0x00, 0x38, 0x74, 0xfa, 0xfa, 0xfa, 0xfa, 0x1f, 0x0f, 0x07, 0x03, + 0x01, 0x00, 0x00, 0x00, 0x3f, 0x1f, 0x0f, 0x07, 0x02, 0x01, 0x00, 0x00, + 0xe8, 0xd0, 0xa0, 0x40, 0x80, 0x00, 0x00, 0x00, 0xf4, 0xe8, 0xd0, 0xa0, + 0x40, 0x80, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x30, 0x73, 0x73, 0x73, 0x70, + 0x03, 0x0f, 0x3f, 0xff, 0xfc, 0xfd, 0xfd, 0xff, 0x80, 0x20, 0xc8, 0x72, +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x18, + 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0x07, 0x07, 0x00, 0xc8, 0xf8, 0xf0, + 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xe0, 0xc0, + 0x1f, 0x1f, 0x0f, 0x0f, 0x3f, 0x7c, 0x30, 0x18, 0x1f, 0x3f, 0x3f, 0x00, + 0x00, 0x60, 0x30, 0x18, 0xc0, 0xf0, 0xf8, 0xe4, 0xfc, 0xfc, 0x7c, 0x00, + 0xcc, 0xfc, 0xf8, 0x04, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x17, 0x0f, 0x1f, + 0x12, 0x30, 0x08, 0x18, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0x07, 0x07, + 0x00, 0xc8, 0xf8, 0xf0, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa0, 0xb0, 0xe0, 0xc0, 0x0f, 0x1f, 0x1f, 0x13, 0x03, 0x0e, 0x0e, 0x0f, + 0x0f, 0x1f, 0x1f, 0x1c, 0x0c, 0x00, 0x0e, 0x0f, 0xc0, 0xc0, 0xc0, 0xc0, + 0xc0, 0xc0, 0xe0, 0x00, 0xc0, 0xc0, 0xe0, 0x20, 0x00, 0xc0, 0xe0, 0x00, + 0x00, 0x00, 0x17, 0x0f, 0x1f, 0x12, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0d, 0x0f, 0x07, 0x00, 0x00, 0xc8, 0xf8, 0xf0, 0x40, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xe0, 0x18, 0x1f, 0x0f, 0x0f, + 0x3f, 0x7b, 0x43, 0x03, 0x07, 0x1f, 0x3f, 0x37, 0x20, 0x60, 0x43, 0x03, + 0x00, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0xc0, 0xc0, 0xf8, 0xf8, 0xc0, + 0x00, 0x00, 0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 0x3c, 0x19, 0x03, 0x00, 0x00, + 0x4e, 0x7e, 0x0e, 0xee, 0x7e, 0x3c, 0xf8, 0x00, 0xb4, 0x8c, 0xfc, 0x3c, + 0x98, 0xc0, 0x00, 0x00 +}; diff --git a/presets/nes/jroatch.chr b/presets/nes/jroatch.chr new file mode 100644 index 00000000..d561a3a6 Binary files /dev/null and b/presets/nes/jroatch.chr differ diff --git a/presets/nes/music.c b/presets/nes/music.c index 8db42cad..97462942 100644 --- a/presets/nes/music.c +++ b/presets/nes/music.c @@ -1,4 +1,3 @@ - #include #include @@ -7,8 +6,6 @@ typedef unsigned char byte; -#pragma data-name (push,"CHARS") - const unsigned char TILESET[8*128] = {/*{w:8,h:8,bpp:1,count:128,brev:1}*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x7c,0x7c,0x7c,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x6c,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0xfe,0x6c,0xfe,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfe,0xd0,0xfe,0x16,0xfe,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xdc,0x38,0x76,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6c,0x7c,0xec,0xee,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x70,0x70,0x70,0x70,0x70,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x38,0x38,0x38,0x38,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x38,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0xfe,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x1e,0x3c,0x78,0xf0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7c,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x78,0x38,0x38,0x38,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x0e,0x7c,0xe0,0xee,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x0e,0x3c,0x0e,0x0e,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x7e,0xee,0xee,0xfe,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xe0,0xfc,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0xfc,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xee,0x1c,0x1c,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0x7c,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0x7e,0x0e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x38,0x70,0x70,0x38,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x1c,0x1c,0x38,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0x1c,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -16,8 +13,6 @@ const unsigned char TILESET[8*128] = {/*{w:8,h:8,bpp:1,count:128,brev:1}*/ 0x00,0xfc,0xee,0xee,0xee,0xfc,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xec,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xee,0xee,0xee,0xfc,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0x7c,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x38,0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0x6c,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xfe,0xfe,0xee,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0x7c,0x38,0x7c,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0x7c,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x1c,0x38,0x70,0xe0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -#pragma data-name(pop) - // // MUSIC ROUTINES // diff --git a/presets/nes/neslib.h b/presets/nes/neslib.h index e6762296..188548f9 100644 --- a/presets/nes/neslib.h +++ b/presets/nes/neslib.h @@ -293,3 +293,8 @@ void __fastcall__ nmi_set_callback(void (*callback)(void)); #define MSB(x) (((x)>>8)) #define LSB(x) (((x)&0xff)) + +// ensure CHARS segment is defined + +#pragma data-name(push,"CHARS") +#pragma data-name(pop) diff --git a/presets/nes/neslib1.c b/presets/nes/neslib1.c index a5d42c6c..c83ae60e 100644 --- a/presets/nes/neslib1.c +++ b/presets/nes/neslib1.c @@ -3,16 +3,9 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") - -const unsigned char TILESET[8*128] = {/*{w:8,h:8,bpp:1,count:64,brev:1,np:2,pofs:8,remap:[0,1,2,4,5,6,7,8,9,10,11,12]}*/ -0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x7c,0x7c,0x7c,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x6c,0x48,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0xfe,0x6c,0xfe,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0xfe,0xd0,0xfe,0x16,0xfe,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xdc,0x38,0x76,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x6c,0x7c,0xec,0xee,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x70,0x70,0x70,0x70,0x70,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x38,0x38,0x38,0x38,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6c,0x38,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x38,0xfe,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x1e,0x3c,0x78,0xf0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x7c,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x78,0x38,0x38,0x38,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x0e,0x7c,0xe0,0xee,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x0e,0x3c,0x0e,0x0e,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x7e,0xee,0xee,0xfe,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xe0,0xfc,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0xfc,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xee,0x1c,0x1c,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0x7c,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0x7e,0x0e,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x60,0x60,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x38,0x70,0x70,0x38,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x38,0x1c,0x1c,0x38,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0x1c,0x38,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0x7c,0xee,0xee,0xee,0xe0,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xfe,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xee,0xfc,0xee,0xee,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xe0,0xe0,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0xec,0xee,0xee,0xee,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xe0,0xf0,0xe0,0xe0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xe0,0xf8,0xe0,0xe0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0xee,0xee,0xee,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xfe,0xee,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x38,0x38,0x38,0x38,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x0e,0x0e,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xfc,0xf8,0xec,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0xe0,0xe0,0xe0,0xee,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc6,0xee,0xfe,0xfe,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xee,0xfe,0xfe,0xee,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x00,0xfc,0xee,0xee,0xee,0xfc,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xee,0xee,0xee,0xec,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xee,0xee,0xee,0xfc,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0xe0,0x7c,0x0e,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x38,0x38,0x38,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0xee,0xee,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0x6c,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xfe,0xfe,0xee,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0x7c,0x38,0x7c,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xee,0xee,0xee,0x7c,0x38,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x1c,0x38,0x70,0xe0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -}; - -#pragma data-name(pop) +//#link "jroatch.c" +extern unsigned char jroatch_chr[0x1000]; +#define TILESET jroatch_chr //this macro is used remove need of calculation of the nametable address in runtime @@ -27,7 +20,7 @@ void put_str(unsigned int adr,const char *str) while(1) { if(!*str) break; - vram_put((*str++)-0x20);//-0x20 because ASCII code 0x20 is placed in tile 0 of the CHR + vram_put((*str++)); } } @@ -38,7 +31,9 @@ void main(void) vram_write((unsigned char*)TILESET, sizeof(TILESET)); //rendering is disabled at the startup, and palette is all black - pal_col(1,0x30);//set while color + pal_col(1,0x04); + pal_col(2,0x20); + pal_col(3,0x30); //you can't put data into vram through vram_put while rendering is enabled //so you have to disable rendering to put things like text or a level map @@ -51,9 +46,6 @@ void main(void) put_str(NTADR(2,4),"THIS CODE PRINTS SOME TEXT"); put_str(NTADR(2,5),"USING ASCII-ENCODED CHARACTER"); put_str(NTADR(2,6),"SET WITH CAPITAL LETTERS ONLY"); - put_str(NTADR(2,8),"TO USE CHR MORE EFFICIENTLY"); - put_str(NTADR(2,9),"YOU'D NEED A CUSTOM ENCODING"); - put_str(NTADR(2,10),"AND A CONVERSION TABLE"); ppu_on_all();//enable rendering diff --git a/presets/nes/neslib2.c b/presets/nes/neslib2.c index 560a6495..f3beda90 100644 --- a/presets/nes/neslib2.c +++ b/presets/nes/neslib2.c @@ -4,9 +4,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - //#link "tileset1.c" // palette for balls, there are four sets for different ball colors diff --git a/presets/nes/neslib3.c b/presets/nes/neslib3.c index 8687e43a..d621a5e3 100644 --- a/presets/nes/neslib3.c +++ b/presets/nes/neslib3.c @@ -6,9 +6,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - //#link "tileset1.c" // tile set, two planes for 4 colors diff --git a/presets/nes/neslib4.c b/presets/nes/neslib4.c index 91c0690c..fc8e83fc 100644 --- a/presets/nes/neslib4.c +++ b/presets/nes/neslib4.c @@ -1,9 +1,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - //#link "tileset1.c" // tile set, two planes for 4 colors diff --git a/presets/nes/neslib5.c b/presets/nes/neslib5.c index 82523846..f6d428f6 100644 --- a/presets/nes/neslib5.c +++ b/presets/nes/neslib5.c @@ -4,9 +4,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - const unsigned char test[308]={ 0x01,0x00,0x01,0xa3,0x10,0x01,0x04,0x00,0x10,0x01,0x04,0x00,0x10,0x01,0x04,0x00, 0x10,0x01,0x04,0x00,0x01,0x0a,0x10,0x00,0x01,0x02,0x10,0x00,0x01,0x04,0x10,0x00, diff --git a/presets/nes/shoot2.c b/presets/nes/shoot2.c index 80eef825..8d8fea79 100644 --- a/presets/nes/shoot2.c +++ b/presets/nes/shoot2.c @@ -5,9 +5,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - #define COLS 32 #define ROWS 28 diff --git a/presets/nes/siegegame.c b/presets/nes/siegegame.c index 78ad13bc..8ebefc70 100644 --- a/presets/nes/siegegame.c +++ b/presets/nes/siegegame.c @@ -6,9 +6,6 @@ #include "neslib.h" -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - //#link "tileset1.c" extern unsigned char palSprites[16]; diff --git a/presets/nes/transtable.c b/presets/nes/transtable.c index 16bda3b3..ceb7e779 100644 --- a/presets/nes/transtable.c +++ b/presets/nes/transtable.c @@ -5,9 +5,6 @@ #include -#pragma data-name (push,"CHARS") -#pragma data-name(pop) - const unsigned char TILESET[48*16] = {/*{w:8,h:8,bpp:1,count:48,brev:1,np:2,pofs:8,remap:[0,1,2,4,5,6,7,8,9,10,11,12]}*/ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x7e,0x42,0x42,0x46,0x46,0x46,0x7e,0x00,0x7e,0x42,0x42,0x46,0x46,0x46,0x7e,0x00, diff --git a/src/platform/nes.ts b/src/platform/nes.ts index ee14cd77..936441be 100644 --- a/src/platform/nes.ts +++ b/src/platform/nes.ts @@ -10,8 +10,9 @@ declare var jsnes : any; const JSNES_PRESETS = [ {id:'ex0.asm', name:'Initialization (ASM)'}, - {id:'ex1.asm', name:'Scrolling Demo (ASM)'}, - {id:'ex2.asm', name:'Sprite Demo (ASM)'}, + {id:'ex1.asm', name:'Hello World (ASM)'}, + {id:'ex2.asm', name:'Scrolling Demo (ASM)'}, + {id:'ex3.asm', name:'Sprite Demo (ASM)'}, {id:'neslib1.c', name:'Text'}, {id:'neslib2.c', name:'Sprites'}, {id:'neslib3.c', name:'Cursor'}, diff --git a/src/project.ts b/src/project.ts index 23ba0f8c..eff1a5da 100644 --- a/src/project.ts +++ b/src/project.ts @@ -1,7 +1,7 @@ "use strict"; import { FileData, Dependency, SourceLine, SourceFile, CodeListing, CodeListingMap, WorkerError, WorkerResult } from "./workertypes"; -import { getFilenameForPath, getFilenamePrefix, getFolderForPath } from "./util"; +import { getFilenameForPath, getFilenamePrefix, getFolderForPath, isProbablyBinary } from "./util"; type BuildResultCallback = (result:WorkerResult) => void; type BuildStatusCallback = (busy:boolean) => void; @@ -206,12 +206,13 @@ export class CodeProject { var webpath = "presets/" + preset_id + "/" + path; if (this.platform_id.startsWith('vcs') && path.indexOf('.') <= 0) webpath += ".a"; // legacy stuff - this.callbackGetRemote( webpath, (text:string) => { + // try to GET file, use file ext to determine text/binary + this.callbackGetRemote( webpath, (text:FileData) => { console.log("GET",webpath,text.length,'bytes'); this.filedata[path] = text; // do not update store, just cache addResult(path, text); loadNext(); - }, 'text') + }, isProbablyBinary(path) ? 'arraybuffer' : 'text') .fail( (err:XMLHttpRequest) => { console.log("Could not load preset", path, err.status); // only cache result if status is 404 (not found) diff --git a/src/ui.ts b/src/ui.ts index 01d6305a..097eae03 100644 --- a/src/ui.ts +++ b/src/ui.ts @@ -296,7 +296,7 @@ function handleFileUpload(files: File[]) { var arrbuf = (e.target).result as ArrayBuffer; var data : FileData = new Uint8Array(arrbuf); // convert to UTF8, unless it's a binary file - if (isProbablyBinary(data)) { // path.endsWith("bin")) { + if (isProbablyBinary(path, data)) { gotoMainFile = false; } else { data = byteArrayToUTF8(data); diff --git a/src/util.ts b/src/util.ts index 614629f1..cc7dd1b7 100644 --- a/src/util.ts +++ b/src/util.ts @@ -315,10 +315,16 @@ export function removeBOM(s:string) { return s; } -export function isProbablyBinary(data : number[] | Uint8Array) : boolean { +export function isProbablyBinary(path:string, data?:number[] | Uint8Array) : boolean { var score = 0; + // check extensions + if (path) { + path = path.toUpperCase(); + if (path.endsWith('.CHR') || path.endsWith('.BIN')) + score++; + } // decode as UTF-8 - for (var i = 0; i < data.length;) { + for (var i = 0; i < (data?data.length:0);) { let c = data[i++]; if ((c & 0x80) == 0) { // more likely binary if we see a NUL or obscure control character