Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit d558766

Browse files
committed
Visual Improvement ! +bug fix
1 parent bfb007d commit d558766

File tree

5 files changed

+974
-24
lines changed

5 files changed

+974
-24
lines changed

VN_Engine.c

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ const char ANGESPR[][8] = {
6565

6666
/*{pal:"nes",layout:"nes"}*/
6767
const char PALETTE[32] = {
68-
0x03, // screen color
68+
0x0C, // screen color
6969

70-
0x0D,0x31,0x30,0x00, // background palette 0
70+
0x0D,0x15,0x30,0x00, // background palette 0
7171
0x1C,0x20,0x2C,0x00, // background palette 1
7272
0x00,0x10,0x20,0x00, // background palette 2
7373
0x06,0x16,0x26,0x00, // background palette 3
@@ -79,11 +79,12 @@ const char PALETTE[32] = {
7979
};
8080

8181
//----Enums
82+
8283
enum LABELS {START, l_DIAL, l_NON, l_OUI /*LABELS_COUNT*/};
8384
enum LABELS labl=START;
8485

8586
enum GAME_STATE {GAME, DIAL, CHOICE, END};
86-
enum GAME_STATE game_st=DIAL;
87+
enum GAME_STATE game_st=GAME;
8788

8889
enum DIAL_T {N='n', C='c', F='f', J='j', A='a'};
8990

@@ -123,6 +124,8 @@ bool d_pressed = false; //DOWN
123124
bool l_pressed = false; //LEFT (gauche)
124125
bool r_pressed = false; //RIGHT (drouate)
125126

127+
bool debug_mode = false;
128+
126129

127130
int i;
128131
char oam_id;
@@ -227,32 +230,38 @@ void updt_dial(){
227230

228231
if (pad&PAD_A){
229232
if (!a_pressed){
230-
if (index<9){
231-
index+=1;
232-
cursor=1;
233-
//Remplace txt par blanc, trouver une autre soluce
234-
// clrscr ?
235-
vrambuf_put(NTADR_A(2,24)," ", 64);
236-
237-
a_pressed=true;
238-
}
239-
else{
240-
game_st=END;
241-
clrscr();
233+
a_pressed=true;
234+
if (index<9){
235+
index+=1;
236+
cursor=1;
237+
//Remplace txt par blanc, trouver une autre soluce
238+
// clrscr ?
239+
vrambuf_put(NTADR_A(2,24)," ", 64);
240+
241+
}
242+
else{
243+
game_st=END;
244+
clrscr();
245+
}
242246
}
243247
}
244-
}
245248
else{
246249
a_pressed=false;
247250
}
248251

249252
if (cursor<63) cursor++;
250253

254+
//delay(2);//Si tu veux ralentir la vitesse du texte
255+
251256
}
252257

253258
void draw_game(){
254259
//oam_spr(x,y,sprite,color,id)
255-
oam_id = oam_spr(40, 40, 8, 1, oam_id);
260+
//oam_id = oam_spr(40, 40, 8, 1, oam_id);
261+
vrambuf_put(NTADR_A(3,10),"~PROMENADE AU BORD DE MER~",26);
262+
vrambuf_put(NTADR_A(4,11),"________________________",24);
263+
vrambuf_put(NTADR_A(7,13),"une demo pour VNES",18);
264+
vrambuf_put(NTADR_A(18,26),"2020 NIGHTEN",12);
256265

257266
}
258267

@@ -310,6 +319,9 @@ void updt_choice(){
310319
}
311320

312321
void draw_end(){
322+
vrambuf_put(NTADR_A(12,10),"GAMEOVER",8);
323+
vrambuf_put(NTADR_A(6,20),"merci d'avoir joue !",20);
324+
313325

314326
}
315327

@@ -333,7 +345,6 @@ void updt_end(){
333345
void main(void)
334346
{
335347
setup_graphics();
336-
draw_ange();
337348

338349

339350
// enable rendering
@@ -348,25 +359,25 @@ void main(void)
348359
pad = pad_poll(0); //pad j1
349360

350361
if (game_st==GAME){
351-
vrambuf_put(NTADR_A(2,2),"Game",4);
362+
if (debug_mode){vrambuf_put(NTADR_A(2,2),"Game",4);}
352363
draw_game();
353364
updt_game();
354365

355366
}
356367
else if (game_st==DIAL){
357-
vrambuf_put(NTADR_A(2,2),"Dialogue",8);
368+
if (debug_mode){vrambuf_put(NTADR_A(2,2),"Dialogue",8);}
358369
draw_dial();
359370
updt_dial();
360371

361372
}
362373
else if (game_st==CHOICE){
363-
vrambuf_put(NTADR_A(2,2),"Choice",6);
374+
if (debug_mode){vrambuf_put(NTADR_A(2,2),"Choice",6);}
364375
draw_choice();
365376
updt_choice();
366377

367378
}
368379
else if (game_st==END){
369-
vrambuf_put(NTADR_A(2,2),"END",3);
380+
if (debug_mode){vrambuf_put(NTADR_A(2,2),"END",3);}
370381
draw_end();
371382
updt_end();
372383

bin/VN_Engine.c.rom

0 Bytes
Binary file not shown.

chr_generic.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@
191191
.byte $F0,$30,$30,$30,$30,$30,$F0,$00
192192
.byte $18,$3C,$7E,$7E,$00,$00,$00,$00
193193
.byte $10,$38,$6C,$00,$00,$00,$00,$00
194-
.byte $00,$00,$00,$00,$00,$00,$7F,$7F
195-
.byte $00,$00,$00,$00,$00,$00,$7E,$00
194+
.byte $00,$00,$00,$00,$00,$00,$FF,$FF
195+
.byte $00,$00,$00,$00,$00,$00,$FF,$00
196196
.byte $30,$30,$38,$18,$00,$00,$00,$00
197197
.byte $20,$20,$10,$00,$00,$00,$00,$00
198198
.byte $00,$00,$3C,$3E,$3E,$7E,$7E,$3E

demosounds.s

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
;this file for FamiTone2 libary generated by nsf2data tool
2+
3+
.export _demo_sounds
4+
_demo_sounds:
5+
.word @ntsc
6+
.word @pal
7+
@ntsc:
8+
.word @sfx_ntsc_0
9+
.word @sfx_ntsc_1
10+
.word @sfx_ntsc_2
11+
.word @sfx_ntsc_3
12+
@pal:
13+
.word @sfx_pal_0
14+
.word @sfx_pal_1
15+
.word @sfx_pal_2
16+
.word @sfx_pal_3
17+
18+
@sfx_ntsc_0:
19+
.byte $80,$bf,$81,$56,$82,$03,$83,$bf,$84,$a6,$85,$02,$04,$81,$3a,$82
20+
.byte $02,$84,$c4,$85,$01,$04,$81,$ab,$82,$01,$84,$52,$04,$81,$1c,$84
21+
.byte $e1,$85,$00,$04,$81,$d5,$82,$00,$84,$a9,$04,$80,$b8,$81,$1c,$82
22+
.byte $01,$83,$b8,$84,$e1,$04,$81,$d5,$82,$00,$84,$a9,$04,$80,$30,$00
23+
@sfx_pal_0:
24+
.byte $80,$bf,$81,$19,$82,$03,$83,$bf,$84,$75,$85,$02,$04,$81,$11,$82
25+
.byte $02,$84,$a4,$85,$01,$03,$81,$8c,$82,$01,$84,$3a,$03,$81,$08,$84
26+
.byte $d1,$85,$00,$04,$81,$c6,$82,$00,$84,$9d,$03,$80,$b8,$81,$08,$82
27+
.byte $01,$83,$b8,$84,$d1,$03,$81,$c6,$82,$00,$84,$9d,$04,$80,$30,$00
28+
@sfx_ntsc_1:
29+
.byte $89,$3f,$8a,$0d,$01,$8a,$0b,$01,$8a,$09,$01,$8a,$07,$01,$8a,$05
30+
.byte $01,$8a,$03,$01,$89,$3e,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$8a
31+
.byte $0b,$01,$89,$3d,$8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$8a,$03,$01
32+
.byte $89,$3c,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$8a,$0b,$01,$89,$3b
33+
.byte $8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$8a,$03,$01,$89,$3a,$8a,$01
34+
.byte $01,$8a,$0f,$01,$8a,$0d,$01,$8a,$0b,$01,$89,$39,$8a,$09,$01,$8a
35+
.byte $07,$01,$8a,$05,$01,$8a,$03,$01,$89,$38,$8a,$01,$01,$8a,$0f,$01
36+
.byte $8a,$0d,$01,$8a,$0b,$01,$89,$37,$8a,$09,$01,$8a,$07,$01,$8a,$05
37+
.byte $01,$8a,$03,$01,$89,$36,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$8a
38+
.byte $0b,$01,$89,$35,$8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$8a,$03,$01
39+
.byte $89,$34,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$8a,$0b,$01,$89,$33
40+
.byte $8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$8a,$03,$01,$89,$32,$8a,$01
41+
.byte $01,$8a,$0f,$01,$8a,$0d,$01,$8a,$0b,$01,$89,$31,$8a,$09,$01,$8a
42+
.byte $07,$01,$8a,$05,$01,$8a,$03,$01,$8a,$01,$01,$8a,$0f,$01,$8a,$0d
43+
.byte $01,$00
44+
@sfx_pal_1:
45+
.byte $89,$3f,$8a,$0d,$01,$8a,$0b,$01,$8a,$09,$01,$8a,$07,$01,$8a,$05
46+
.byte $01,$89,$3e,$8a,$03,$01,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$89
47+
.byte $3d,$8a,$0b,$01,$8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$89,$3c,$8a
48+
.byte $03,$01,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$89,$3b,$8a,$0b,$01
49+
.byte $8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$89,$3a,$8a,$03,$01,$8a,$01
50+
.byte $01,$8a,$0f,$01,$8a,$0d,$01,$89,$39,$8a,$0b,$01,$8a,$09,$01,$8a
51+
.byte $07,$01,$8a,$05,$01,$89,$38,$8a,$03,$01,$8a,$01,$01,$8a,$0f,$01
52+
.byte $8a,$0d,$01,$89,$37,$8a,$0b,$01,$8a,$09,$01,$8a,$07,$01,$8a,$05
53+
.byte $01,$89,$36,$8a,$03,$01,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$89
54+
.byte $35,$8a,$0b,$01,$8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$89,$34,$8a
55+
.byte $03,$01,$8a,$01,$01,$8a,$0f,$01,$8a,$0d,$01,$89,$33,$8a,$0b,$01
56+
.byte $8a,$09,$01,$8a,$07,$01,$8a,$05,$01,$89,$32,$8a,$03,$01,$8a,$01
57+
.byte $01,$8a,$0f,$01,$8a,$0d,$01,$89,$31,$8a,$0b,$01,$8a,$09,$01,$8a
58+
.byte $07,$01,$8a,$05,$01,$8a,$03,$01,$8a,$01,$01,$8a,$0f,$01,$00
59+
@sfx_ntsc_2:
60+
.byte $80,$bf,$81,$d5,$82,$00,$02,$81,$6a,$02,$80,$b4,$04,$80,$b8,$81
61+
.byte $d5,$02,$81,$6a,$02,$80,$b2,$04,$00
62+
@sfx_pal_2:
63+
.byte $80,$bf,$81,$c6,$82,$00,$02,$81,$62,$02,$80,$b4,$03,$80,$b8,$81
64+
.byte $c6,$02,$81,$62,$01,$80,$b2,$04,$00
65+
@sfx_ntsc_3:
66+
.byte $86,$81,$87,$6a,$88,$00,$01,$87,$70,$01,$87,$6a,$01,$87,$70,$01
67+
.byte $87,$6a,$01,$00
68+
@sfx_pal_3:
69+
.byte $86,$81,$87,$62,$88,$00,$01,$87,$68,$01,$87,$62,$01,$87,$68,$01
70+
.byte $87,$62,$01,$00

0 commit comments

Comments
 (0)