Skip to content

Commit 014e944

Browse files
committed
added window icon
by Nigel Stewart <[email protected]>
1 parent 31f97b5 commit 014e944

File tree

6 files changed

+142
-2
lines changed

6 files changed

+142
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ matrix:
4141
language: python
4242
script:
4343
- python -m pip install editorconfig-checker
44-
- editorconfig-checker
44+
- editorconfig-checker -exclude "\\.xcf$"
4545
- name: WebAssembly
4646
os: linux
4747
addons:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ifdef EMSCRIPTEN
3939
OUTPUT=x16emu.html
4040
endif
4141

42-
OBJS = cpu/fake6502.o memory.o disasm.o video.o ps2.o via.o loadsave.o spi.o vera_spi.o audio.o vera_pcm.o vera_psg.o sdcard.o main.o debugger.o javascript_interface.o joystick.o rendertext.o keyboard.o
42+
OBJS = cpu/fake6502.o memory.o disasm.o video.o ps2.o via.o loadsave.o spi.o vera_spi.o audio.o vera_pcm.o vera_psg.o sdcard.o main.o debugger.o javascript_interface.o joystick.o rendertext.o keyboard.o icon.o
4343

4444
HEADERS = disasm.h cpu/fake6502.h glue.h memory.h video.h audio.h vera_pcm.h vera_psg.h ps2.h via.h loadsave.h joystick.h keyboard.h
4545

icon.c

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
#include "icon.h"
2+
3+
static char pixels[] =
4+
"................................................................................................"
5+
"................................................................................................"
6+
"................................................................................................"
7+
"................................................................................................"
8+
"................................................................................................"
9+
"................................................................................................"
10+
"................................................................................................"
11+
"................................................................................................"
12+
"................................................................................................"
13+
"................................................................................................"
14+
"................................................................................................"
15+
"................................................................................................"
16+
"................................................................................................"
17+
"................................................................................................"
18+
"................................................................................................"
19+
"................................................................................................"
20+
"................................................................................................"
21+
"................................................................................................"
22+
"................................................................................................"
23+
"................................................................................................"
24+
"....@@@@@@@@@@@@@@@@@@@@@@@@........................................@@@@@@@@@@@@@@@@@@@@@@@@...."
25+
".....@@@@@@@@@@@@@@@@@@@@@@@@......................................@@@@@@@@@@@@@@@@@@@@@@@@....."
26+
"......@@@@@@@@@@@@@@@@@@@@@@@@....................................@@@@@@@@@@@@@@@@@@@@@@@@......"
27+
".......@@@@@@@@@@@@@@@@@@@@@@@@..................................@@@@@@@@@@@@@@@@@@@@@@@@......."
28+
"........@@@@@@@@@@@@@@@@@@@@@@@@................................@@@@@@@@@@@@@@@@@@@@@@@@........"
29+
".........@@@@@@@@@@@@@@@@@@@@@@@@..............................@@@@@@@@@@@@@@@@@@@@@@@@........."
30+
"..........@@@@@@@@@@@@@@@@@@@@@@@@............................@@@@@@@@@@@@@@@@@@@@@@@@.........."
31+
"...........@@@@@@@@@@@@@@@@@@@@@@@@..........................@@@@@@@@@@@@@@@@@@@@@@@@..........."
32+
"............########################........................########################............"
33+
".............########################......................########################............."
34+
"..............########################....................########################.............."
35+
"...............########################..................########################..............."
36+
"................########################................########################................"
37+
".................########################..............########################................."
38+
"..................########################............########################.................."
39+
"...................########################..........########################..................."
40+
"....................************************........************************...................."
41+
".....................***********************........***********************....................."
42+
"......................**********************........**********************......................"
43+
".......................*********************........*********************......................."
44+
"........................********************........********************........................"
45+
".........................*******************........*******************........................."
46+
"..........................******************........******************.........................."
47+
"...........................*****************........*****************..........................."
48+
"....................................%%%%%%%%........%%%%%%%%...................................."
49+
"....................................%%%%%%%%........%%%%%%%%...................................."
50+
"....................................%%%%%%%%........%%%%%%%%...................................."
51+
"....................................%%%%%%%%........%%%%%%%%...................................."
52+
"....................................%%%%%%%%........%%%%%%%%...................................."
53+
"....................................%%%%%%%%........%%%%%%%%...................................."
54+
"....................................%%%%%%%%........%%%%%%%%...................................."
55+
"....................................%%%%%%%%........%%%%%%%%...................................."
56+
"............................&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&............................"
57+
"...........................&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&..........................."
58+
"..........................&&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&&.........................."
59+
".........................&&&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&&&........................."
60+
"........................&&&&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&&&&........................"
61+
".......................&&&&&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&&&&&......................."
62+
"......................&&&&&&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&&&&&&......................"
63+
".....................&&&&&&&&&&&&&&&&&&&&&&&........&&&&&&&&&&&&&&&&&&&&&&&....................."
64+
"....................$$$$$$$$$$$$$$$$$$$$$$$$........$$$$$$$$$$$$$$$$$$$$$$$$...................."
65+
"...................$$$$$$$$$$$$$$$$$$$$$$$$..........$$$$$$$$$$$$$$$$$$$$$$$$..................."
66+
"..................$$$$$$$$$$$$$$$$$$$$$$$$............$$$$$$$$$$$$$$$$$$$$$$$$.................."
67+
".................$$$$$$$$$$$$$$$$$$$$$$$$..............$$$$$$$$$$$$$$$$$$$$$$$$................."
68+
"................$$$$$$$$$$$$$$$$$$$$$$$$................$$$$$$$$$$$$$$$$$$$$$$$$................"
69+
"...............$$$$$$$$$$$$$$$$$$$$$$$$..................$$$$$$$$$$$$$$$$$$$$$$$$..............."
70+
"..............$$$$$$$$$$$$$$$$$$$$$$$$....................$$$$$$$$$$$$$$$$$$$$$$$$.............."
71+
".............$$$$$$$$$$$$$$$$$$$$$$$$......................$$$$$$$$$$$$$$$$$$$$$$$$............."
72+
"............++++++++++++++++++++++++........................++++++++++++++++++++++++............"
73+
"...........++++++++++++++++++++++++..........................++++++++++++++++++++++++..........."
74+
"..........++++++++++++++++++++++++............................++++++++++++++++++++++++.........."
75+
".........++++++++++++++++++++++++..............................++++++++++++++++++++++++........."
76+
"........++++++++++++++++++++++++................................++++++++++++++++++++++++........"
77+
".......++++++++++++++++++++++++..................................++++++++++++++++++++++++......."
78+
"......++++++++++++++++++++++++....................................++++++++++++++++++++++++......"
79+
".....++++++++++++++++++++++++......................................++++++++++++++++++++++++....."
80+
"................................................................................................"
81+
"................................................................................................"
82+
"................................................................................................"
83+
"................................................................................................"
84+
"................................................................................................"
85+
"................................................................................................"
86+
"................................................................................................"
87+
"................................................................................................"
88+
"................................................................................................"
89+
"................................................................................................"
90+
"................................................................................................"
91+
"................................................................................................"
92+
"................................................................................................"
93+
"................................................................................................"
94+
"................................................................................................"
95+
"................................................................................................"
96+
"................................................................................................"
97+
"................................................................................................"
98+
"................................................................................................"
99+
"................................................................................................";
100+
101+
102+
SDL_Surface *CommanderX16Icon()
103+
{
104+
const SDL_Color color[8] = {
105+
{ 0x00, 0x00, 0xAA, 0x00 },
106+
{ 0x88, 0x00, 0x00, 0xFF },
107+
{ 0xCC, 0x44, 0xCC, 0xFF },
108+
{ 0x00, 0x88, 0xFF, 0xFF },
109+
{ 0xDD, 0x88, 0x55, 0xFF },
110+
{ 0x00, 0xCC, 0x55, 0xFF },
111+
{ 0xEE, 0xEE, 0x77, 0xFF },
112+
{ 0xAA, 0xFF, 0xEE, 0xFF }
113+
};
114+
115+
SDL_Surface *surface;
116+
surface = SDL_CreateRGBSurfaceFrom(pixels, 96, 96, 8, 96, 0, 0, 0, 0);
117+
SDL_SetPaletteColors(surface->format->palette, color+0, '.', 1);
118+
SDL_SetPaletteColors(surface->format->palette, color+1, '+', 1);
119+
SDL_SetPaletteColors(surface->format->palette, color+2, '@', 1);
120+
SDL_SetPaletteColors(surface->format->palette, color+3, '#', 1);
121+
SDL_SetPaletteColors(surface->format->palette, color+4, '$', 1);
122+
SDL_SetPaletteColors(surface->format->palette, color+5, '%', 1);
123+
SDL_SetPaletteColors(surface->format->palette, color+6, '&', 1);
124+
SDL_SetPaletteColors(surface->format->palette, color+7, '*', 1);
125+
return surface;
126+
}

icon.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Commander X16 Emulator
2+
// Copyright (c) 2019 Michael Steil
3+
// All rights reserved. License: 2-clause BSD
4+
5+
#ifndef _ICON_H_
6+
#define _ICON_H_
7+
8+
#include <SDL.h>
9+
10+
SDL_Surface *CommanderX16Icon();
11+
12+
#endif

icon.xcf

2.16 KB
Binary file not shown.

video.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "vera_spi.h"
1414
#include "vera_psg.h"
1515
#include "vera_pcm.h"
16+
#include "icon.h"
1617

1718
#include <limits.h>
1819

@@ -178,6 +179,7 @@ video_init(int window_scale, char *quality)
178179
SCREEN_WIDTH, SCREEN_HEIGHT);
179180

180181
SDL_SetWindowTitle(window, "Commander X16");
182+
SDL_SetWindowIcon(window, CommanderX16Icon());
181183

182184
SDL_ShowCursor(SDL_DISABLE);
183185

0 commit comments

Comments
 (0)