Skip to content

Commit

Permalink
skip intros
Browse files Browse the repository at this point in the history
  • Loading branch information
xesf committed Oct 27, 2024
1 parent ca0cd82 commit 6e28d71
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 36 deletions.
31 changes: 9 additions & 22 deletions src/acf.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,11 @@ void two_banks_tile_decode() {
unaligned_stream++;

for (u32 y = 0; y < 8; y++) {
u32 part1 = *(i32*)aligned_stream; // On r‚cupŠre ainsi 5 octets...
u32 part1 = *(i32*)aligned_stream;
u32 part2 = *(i32*)(aligned_stream + 4);
aligned_stream += 5;
for (u32 x = 0; x < 8; x++) {
set_pixel(x, y, bank[(part1 & 16) >> 4] + (part1 & 15)); // Bit 4: Banque … utiliser / Bits 0-3:Couleur
set_pixel(x, y, bank[(part1 & 16) >> 4] + (part1 & 15));
part1 >>= 5;
part1 |= (part2 << 27);
part2 >>= 5;
Expand Down Expand Up @@ -517,7 +517,7 @@ void block_decode_3() {

void block_bank_1_decode_horizontal() {
u8 last_color = 0;
u8 bank = (*unaligned_stream) << 4; // R‚cupŠre la banque
u8 bank = (*unaligned_stream) << 4;
u8 flag = 1;

for (i32 y = 0; y < 8; y++) {
Expand All @@ -544,7 +544,7 @@ void block_bank_1_decode_horizontal() {

void block_bank_1_decode_vertical() {
u8 last_color = 0;
u8 bank = (*unaligned_stream) << 4; // get the bank back
u8 bank = (*unaligned_stream) << 4;
u8 flag = 1;

for (i32 x = 0; x < 8; x++) {
Expand All @@ -571,7 +571,7 @@ void block_bank_1_decode_vertical() {

void block_bank_1_decode_2() {
u8 last_color = 0;
u8 bank = (*unaligned_stream) << 4; // R‚cupŠre la banque
u8 bank = (*unaligned_stream) << 4;
u8 flag = 1;
u32* offsets = diagonal_offsets_1;

Expand Down Expand Up @@ -599,7 +599,7 @@ void block_bank_1_decode_2() {

void block_bank_1_decode_3() {
u8 last_color = 0;
u8 bank = (*unaligned_stream) << 4; // Get the bank number
u8 bank = (*unaligned_stream) << 4;
u8 flag = 1;
u32* offsets = diagonal_offsets_2;

Expand Down Expand Up @@ -640,27 +640,11 @@ void scale_2x(state_t *state) {
memcpy(dest + dest_index + 640, dest + dest_index, 2);
}
}

// for (i32 i = 0; i < frame_height; i++) {
// for (i32 j = 0; j < frame_width; j++) {
// *(dest++) = *(source);
// *(dest++) = *(source++);
// }
// if (i % (2)) {
// memcpy(dest, dest - 640 / 2, frame_width*2);
// dest += frame_width * 2;
// }
// if (i % 10) {
// memcpy(dest, dest - 640 / 2, frame_width*2);
// dest += frame_width * 2;
// }
// }
}

void decompreess_frame(state_t *state, frame_data_t *frame_data) {
previous_tile = previous_frame_buffer = previous_buffer;
current_tile = current_buffer;
// memset(current_tile, 0, frame_width * frame_height);

unaligned_stream = (u8*)frame_data + frame_data->colour_offset;
aligned_stream = (u8*)frame_data->opcodes + (frame_height / 8) * 30;
Expand Down Expand Up @@ -813,6 +797,9 @@ void acf_play(state_t *state, const u8 *filename) {

while (current_chunk < last_chunk) {
system_events(&state->system);
if (state->system.actions[ACTION_SKIP] || state->system.quit) {
break;
}

enum chunk_type_e chunk_type = CHUNK_TYPE_UNKNOWN;
print_chunk_name(current_chunk);
Expand Down
28 changes: 14 additions & 14 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ void game_image(state_t *state, u32 index, u32 delay, i32 fade_in) {
}

void game_introduction() {
// sample_play(3, 22050, 0, 0);
// game_image(state, HQR_SCREEN_ADELINE, 6000, FALSE);
sample_play(3, 22050, 0, 0);
game_image(state, HQR_SCREEN_ADELINE, 6000, FALSE);

switch(state->game_type) {
case TIMECO_US:
Expand All @@ -71,18 +71,18 @@ void game_introduction() {
break;
}

// game_image(state, HQR_SCREEN_TIMECO, 6000, TRUE);
// sample_stop_all();

// switch(state->game_type) {
// case TIMECO_DEMO:
// case TIMECO_MCAFEE_DEMO:
// acf_play(state, (const u8 *)ACF_TUNNEL);
// break;
// default:
// acf_play(state, (const u8 *)ACF_INTRO);
// break;
// }
game_image(state, HQR_SCREEN_TIMECO, 6000, TRUE);
sample_stop_all();

switch(state->game_type) {
case TIMECO_DEMO:
case TIMECO_MCAFEE_DEMO:
acf_play(state, (const u8 *)ACF_TUNNEL);
break;
default:
acf_play(state, (const u8 *)ACF_INTRO);
break;
}

// then menu > new game > then timewrap acf
game_image(state, HQR_SCREEN_MENU, 0, TRUE);
Expand Down
3 changes: 3 additions & 0 deletions src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include "lib/common.h"


#define ACTION_SKIP 27


typedef struct {
u32 tick;
u32 last_tick;
Expand Down
3 changes: 3 additions & 0 deletions src/system_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ inline void system_delay(u32 ms) {
void system_delay_events(system_t *system, u32 ms) {
u32 start = system_tick();
while (system_tick() - start < ms) {
if (system->actions[ACTION_SKIP] || system->quit) {
break;
}
system_events(system);
system_delay(1);
}
Expand Down

0 comments on commit 6e28d71

Please sign in to comment.