├── .gitignore ├── README.md ├── inc ├── global.h └── zona1dat.h ├── res ├── DiagBox1.png ├── DiagBox2.png ├── DiagBox3.png ├── Logos │ ├── AliceSim1.png │ └── disclaimer.png ├── Musicas │ ├── 18-Riddle,_Darkness_World.vgm │ └── 20-Zombie_World.vgm ├── Titulo │ ├── fondo.png │ ├── titulo-shader.png │ └── titulo.png ├── Zona1 │ ├── h0.png │ ├── h1.png │ ├── h1b.png │ ├── h2.png │ ├── h3.png │ └── h3b.png ├── basicos.h ├── basicos.res ├── cursor.png ├── font8x16b-SP.png ├── font_1c.png ├── logos.h ├── logos.res ├── musica.h ├── musica.res ├── pingu1.png ├── sombra-dirtering32.png ├── titulo.h ├── titulo.res ├── zona1.h └── zona1.res ├── screenshot ├── Zona2.JPG ├── Zona4.JPG ├── testzone1-test-CuadroDiag.jpg └── titulo.jpg ├── src ├── boot │ ├── rom_head.c │ └── sega.s ├── dialogos.c ├── logos-titulo.c ├── main.c ├── zona1dat.c └── zone-jugpri.c └── temp ├── ASCII-to-VRAM-Index.txt ├── Bizcat - an 8x16 bitmap font.url ├── Captura.PNG ├── Captura2.PNG ├── Captura3.PNG ├── Captura4.PNG ├── Captura5.PNG ├── Captura6.PNG ├── Captura7.PNG ├── Captura8.PNG ├── DiagBox1.png ├── Portapapeles01.png ├── Portapapeles02.png ├── Sprite-0001.png ├── Sprite-0002.png ├── dialogo.ase ├── font8x16.png ├── font8x16b.png ├── res ├── Zona1 │ ├── h1.ase │ └── h3.ase └── font_1b.png ├── rom_head.c ├── sombra-Num.png └── temp.c /.gitignore: -------------------------------------------------------------------------------- 1 | out/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Penguin-World 2 | 3 | ![Titulo](https://raw.githubusercontent.com/alicesim1/Penguin-World/main/screenshot/titulo.jpg) 4 | 5 | Proyecto indie retro en desarrollo: 6 | 7 | Plataforma: **SEGA Mega Drive/Genesis** 8 | 9 | # Que está desarrollado: # 10 | **+Logos + Titulo + Música** 11 | 12 | 13 | **Sistema de cuadros de dialogos! Primera version Alpha Test** 14 | ![Test Dialogo](https://raw.githubusercontent.com/alicesim1/Penguin-World/main/screenshot/testzone1-test-CuadroDiag.jpg) 15 | 16 | **Añadido Caracteres Españoles** 17 | 18 | 19 | **+4 Zonas de pruebas** in game , aun en desarrollo: 20 | 21 | ![Test Zone 2](https://raw.githubusercontent.com/alicesim1/Penguin-World/main/screenshot/Zona2.JPG) 22 | 23 | ![Test Zone 4](https://raw.githubusercontent.com/alicesim1/Penguin-World/main/screenshot/Zona4.JPG) 24 | 25 | Características de prioridad entre planos A/B con el jugador.(Zonas 2,3,4) 26 | 27 | Sistema de colisiones por grilla! 28 | 29 | Sistemas de puertas entre las 4 Zonas, transicion suave Fade. 30 | 31 | Zone 4 con paredes "semi" transparentes (matriz de pixeles pintados y no pintados) 32 | 33 | Resolucion vertical a 240p para PAL 50Hrz, 224 para NTSC(EEUU/JAP) 60Hrz (Diferencia de 16pixeles) 34 | 35 | ## Botones: ## 36 | 37 | **A = Test dialogo 1** 38 | 39 | **B = Test dialogo 2** 40 | 41 | **C = Test dialogo 3** 42 | 43 | **START = Test dialogo 4** 44 | 45 | 46 | **B = Cerrar dialogo 47 | 48 | ## SEGA Mouse## 49 | 50 | [[Puerto 2]] Opcionalmente! 51 | 52 | [Tambien compatible con PAD3/6 botones] Si esta conectado! 53 | 54 | Se visualiza un cursor de color verde, que se puede controlar con el raton!(o cruzeta) 55 | Por el momento no tiene interacion con nada... esta en desarrollo y estudio. 56 | 57 | https://segaretro.org/Sega_Mouse 58 | 59 | Emuladores compatibles y configurables: 60 | 61 | -Kega Fusion 364 (Genesis controles) 62 | 63 | -Blastem (Systema configuracion) 64 | 65 | -RetroArch -> Genesis Plus GX (Menu de configuracion) 66 | 67 | 68 | ---------------------------------------------------------- 69 | 70 | Creado con [SGDK de Stephane](https://github.com/Stephane-D/SGDK) 71 | 72 | 73 | Redes sociales: 74 | 75 | https://twitter.com/Alice_Sim1 76 | 77 | https://www.twitch.tv/AliceSim1 78 | 79 | https://www.youtube.com/user/simulatorone/ 80 | -------------------------------------------------------------------------------- /inc/global.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBAL_H 2 | #define _GLOBAL_H 3 | //------------------------------------------------------------------------------------------ 4 | #include "../res/basicos.h"//fuente, pinguno jug, cursor, 5 | 6 | //----------------------------------------------- 7 | 8 | u8 ScreenY; //27/29 9 | u8 ScreenMY; //112/120 10 | u8 ScreenTY; //224/240 11 | s8 fixAlturaY; //-24/-32 12 | 13 | u8 JoyType; //JOY_getJoypadType(JOY_1); //JOY_TYPE_PAD6 14 | u8 padraton; //JOY_getPortType(PORT_2); 15 | bool CursorON; 16 | 17 | 18 | u16 BUTTONS[20]; 19 | bool gat; 20 | 21 | Sprite* cursorsp; 22 | s16 readedX,readedY; 23 | Vect2D_s16 joypos; 24 | void _JOYsetXY ( s16 x, s16 y ); 25 | void _JOYupdateMouse (); 26 | 27 | 28 | char char_salida[8]; 29 | void VDP_drawInt(s32,u8,u8,u8); 30 | 31 | #include "../res/musica.h" //toda coleccion de musicas vgm 32 | void play_music(u8); 33 | u8 old_musica; 34 | 35 | 36 | u8 randU8(u8,u8); 37 | 38 | u16 paleta64[64]; 39 | 40 | void TITUTLO(); 41 | void ZoneMap(); 42 | 43 | 44 | #define diag_ind 200 //VRAM hex:4B0 45 | void dialogo(u16,u16,u8,u8,u8); 46 | 47 | 48 | //----------------------------------- 49 | typedef struct { 50 | const bool const PlanA; 51 | const u8 const musica; 52 | const u8 const Xtop; 53 | const u8 const Ytop; 54 | const u8 const *casillas; 55 | const u8 const top_blxpri; 56 | const u16 const *blockpri; 57 | const u8 const topPuertas; 58 | const u8 const *puertas; 59 | } t_zona; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /inc/zona1dat.h: -------------------------------------------------------------------------------- 1 | #ifndef _ZONA1DAT_H 2 | #define _ZONA1DAT_H 3 | 4 | 5 | #define TOP_ZONAS 4 6 | 7 | 8 | const t_zona zona1dat[TOP_ZONAS]; 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /res/DiagBox1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/DiagBox1.png -------------------------------------------------------------------------------- /res/DiagBox2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/DiagBox2.png -------------------------------------------------------------------------------- /res/DiagBox3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/DiagBox3.png -------------------------------------------------------------------------------- /res/Logos/AliceSim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Logos/AliceSim1.png -------------------------------------------------------------------------------- /res/Logos/disclaimer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Logos/disclaimer.png -------------------------------------------------------------------------------- /res/Musicas/18-Riddle,_Darkness_World.vgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Musicas/18-Riddle,_Darkness_World.vgm -------------------------------------------------------------------------------- /res/Musicas/20-Zombie_World.vgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Musicas/20-Zombie_World.vgm -------------------------------------------------------------------------------- /res/Titulo/fondo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Titulo/fondo.png -------------------------------------------------------------------------------- /res/Titulo/titulo-shader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Titulo/titulo-shader.png -------------------------------------------------------------------------------- /res/Titulo/titulo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Titulo/titulo.png -------------------------------------------------------------------------------- /res/Zona1/h0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Zona1/h0.png -------------------------------------------------------------------------------- /res/Zona1/h1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Zona1/h1.png -------------------------------------------------------------------------------- /res/Zona1/h1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Zona1/h1b.png -------------------------------------------------------------------------------- /res/Zona1/h2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Zona1/h2.png -------------------------------------------------------------------------------- /res/Zona1/h3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Zona1/h3.png -------------------------------------------------------------------------------- /res/Zona1/h3b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/Zona1/h3b.png -------------------------------------------------------------------------------- /res/basicos.h: -------------------------------------------------------------------------------- 1 | #ifndef _RES_BASICOS_H_ 2 | #define _RES_BASICOS_H_ 3 | 4 | extern const TileSet font1; 5 | extern const TileSet font16; 6 | extern const SpriteDefinition penguin; 7 | extern const SpriteDefinition cursor; 8 | extern const SpriteDefinition dig_marco1; 9 | extern const SpriteDefinition dig_marco2; 10 | extern const SpriteDefinition dig_marco3; 11 | extern const SpriteDefinition dig_marco4; 12 | 13 | #endif // _RES_BASICOS_H_ 14 | -------------------------------------------------------------------------------- /res/basicos.res: -------------------------------------------------------------------------------- 1 | TILESET font1 "font_1c.png" BEST NONE 2 | TILESET font16 "font8x16b-SP.png" APLIB NONE 3 | SPRITE penguin "pingu1.png" 3 4 APLIB 4 | SPRITE cursor "cursor.png" 1 1 APLIB 5 | SPRITE dig_marco1 "DiagBox1.png" 1 1 APLIB 6 | SPRITE dig_marco2 "DiagBox2.png" 4 1 APLIB 7 | SPRITE dig_marco3 "DiagBox3.png" 1 4 APLIB 8 | SPRITE dig_marco4 "sombra-dirtering32.png" 4 4 BEST -------------------------------------------------------------------------------- /res/cursor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/cursor.png -------------------------------------------------------------------------------- /res/font8x16b-SP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/font8x16b-SP.png -------------------------------------------------------------------------------- /res/font_1c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/font_1c.png -------------------------------------------------------------------------------- /res/logos.h: -------------------------------------------------------------------------------- 1 | #ifndef _RES_LOGOS_H_ 2 | #define _RES_LOGOS_H_ 3 | 4 | extern const Image disclaimer; 5 | extern const Image alicesim1; 6 | 7 | #endif // _RES_LOGOS_H_ 8 | -------------------------------------------------------------------------------- /res/logos.res: -------------------------------------------------------------------------------- 1 | IMAGE disclaimer "Logos/disclaimer.png" BEST 2 | IMAGE alicesim1 "Logos/AliceSim1.png" BEST -------------------------------------------------------------------------------- /res/musica.h: -------------------------------------------------------------------------------- 1 | #ifndef _RES_MUSICA_H_ 2 | #define _RES_MUSICA_H_ 3 | 4 | extern const u8 M_titulo[27392]; 5 | extern const u8 M_zone1[25344]; 6 | 7 | #endif // _RES_MUSICA_H_ 8 | -------------------------------------------------------------------------------- /res/musica.res: -------------------------------------------------------------------------------- 1 | XGM M_titulo Musicas/20-Zombie_World.vgm 2 | XGM M_zone1 Musicas/18-Riddle,_Darkness_World.vgm -------------------------------------------------------------------------------- /res/pingu1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/pingu1.png -------------------------------------------------------------------------------- /res/sombra-dirtering32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/res/sombra-dirtering32.png -------------------------------------------------------------------------------- /res/titulo.h: -------------------------------------------------------------------------------- 1 | #ifndef _RES_TITULO_H_ 2 | #define _RES_TITULO_H_ 3 | 4 | extern const Image titulo; 5 | extern const Image titush; 6 | extern const Image fondogr; 7 | 8 | #endif // _RES_TITULO_H_ 9 | -------------------------------------------------------------------------------- /res/titulo.res: -------------------------------------------------------------------------------- 1 | IMAGE titulo "Titulo/titulo.png" BEST 2 | IMAGE titush "Titulo/titulo-shader.png" BEST 3 | IMAGE fondogr "Titulo/fondo.png" BEST -------------------------------------------------------------------------------- /res/zona1.h: -------------------------------------------------------------------------------- 1 | #ifndef _RES_ZONA1_H_ 2 | #define _RES_ZONA1_H_ 3 | 4 | extern const TileSet z1h0_t; 5 | extern const TileSet z1h1_t; 6 | extern const TileSet z1h1b_t; 7 | extern const TileSet z1h2_t; 8 | extern const TileSet z1h3_t; 9 | extern const TileSet z1h3b_t; 10 | extern const MapDefinition z1h0; 11 | extern const MapDefinition z1h1; 12 | extern const MapDefinition z1h1b; 13 | extern const MapDefinition z1h2; 14 | extern const MapDefinition z1h3; 15 | extern const MapDefinition z1h3b; 16 | 17 | #endif // _RES_ZONA1_H_ 18 | -------------------------------------------------------------------------------- /res/zona1.res: -------------------------------------------------------------------------------- 1 | TILESET z1h0_t "Zona1/h0.png" BEST 2 | MAP z1h0 "Zona1/h0.png" z1h0_t BEST 3 | 4 | TILESET z1h1_t "Zona1/h1.png" BEST 5 | MAP z1h1 "Zona1/h1.png" z1h1_t BEST 6 | 7 | TILESET z1h1b_t "Zona1/h1b.png" BEST 8 | MAP z1h1b "Zona1/h1b.png" z1h1b_t BEST 9 | 10 | TILESET z1h2_t "Zona1/h2.png" BEST 11 | MAP z1h2 "Zona1/h2.png" z1h2_t BEST 12 | 13 | TILESET z1h3_t "Zona1/h3.png" BEST 14 | MAP z1h3 "Zona1/h3.png" z1h3_t BEST 15 | 16 | TILESET z1h3b_t "Zona1/h3b.png" BEST 17 | MAP z1h3b "Zona1/h3b.png" z1h3b_t BEST -------------------------------------------------------------------------------- /screenshot/Zona2.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/screenshot/Zona2.JPG -------------------------------------------------------------------------------- /screenshot/Zona4.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/screenshot/Zona4.JPG -------------------------------------------------------------------------------- /screenshot/testzone1-test-CuadroDiag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/screenshot/testzone1-test-CuadroDiag.jpg -------------------------------------------------------------------------------- /screenshot/titulo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/screenshot/titulo.jpg -------------------------------------------------------------------------------- /src/boot/rom_head.c: -------------------------------------------------------------------------------- 1 | #include "genesis.h" 2 | 3 | __attribute__((externally_visible)) 4 | const ROMHeader rom_header = { 5 | #if (ENABLE_BANK_SWITCH != 0) 6 | "SEGA SSF ", 7 | #elif (MODULE_MEGAWIFI != 0) 8 | "SEGA MEGAWIFI ", 9 | #else 10 | "SEGA MEGA DRIVE ", 11 | #endif 12 | "ALICESIM1 3/2022", 13 | "PENGUIN WORLD - ALPHA DEVOLOPER ", 14 | "PENGUIN WORLD - ALPHA DEVOLOPER ", 15 | "GM 00000000-00", 16 | 0x000, 17 | "J6M ", 18 | 0x00000000, 19 | #if (ENABLE_BANK_SWITCH != 0) 20 | 0x003FFFFF, 21 | #else 22 | 0x000FFFFF, 23 | #endif 24 | 0xE0FF0000, 25 | 0xE0FFFFFF, 26 | "RA", 27 | 0xF820, 28 | 0x00200000, 29 | 0x0020FFFF, 30 | " ", 31 | "DEMONSTRATION PROGRAM ", 32 | "JUE " 33 | }; 34 | -------------------------------------------------------------------------------- /src/boot/sega.s: -------------------------------------------------------------------------------- 1 | #include "task_cst.h" 2 | 3 | .section .text.keepboot 4 | 5 | *------------------------------------------------------- 6 | * 7 | * Sega startup code for the GNU Assembler 8 | * Translated from: 9 | * Sega startup code for the Sozobon C compiler 10 | * Written by Paul W. Lee 11 | * Modified by Charles Coty 12 | * Modified by Stephane Dallongeville 13 | * 14 | *------------------------------------------------------- 15 | 16 | .globl rom_header 17 | 18 | .org 0x00000000 19 | 20 | _Start_Of_Rom: 21 | _Vecteurs_68K: 22 | dc.l __stack /* Stack address */ 23 | dc.l _Entry_Point /* Program start address */ 24 | dc.l _Bus_Error 25 | dc.l _Address_Error 26 | dc.l _Illegal_Instruction 27 | dc.l _Zero_Divide 28 | dc.l _Chk_Instruction 29 | dc.l _Trapv_Instruction 30 | dc.l _Privilege_Violation 31 | dc.l _Trace 32 | dc.l _Line_1010_Emulation 33 | dc.l _Line_1111_Emulation 34 | dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception 35 | dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception 36 | dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception 37 | dc.l _Error_Exception 38 | dc.l _INT 39 | dc.l _EXTINT 40 | dc.l _INT 41 | dc.l hintCaller 42 | dc.l _INT 43 | dc.l _VINT 44 | dc.l _INT 45 | dc.l _trap_0 /* Resume supervisor task */ 46 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT 47 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT 48 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT 49 | dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT 50 | 51 | rom_header: 52 | .incbin "out/rom_head.bin", 0, 0x100 53 | 54 | _Entry_Point: 55 | move #0x2700,%sr 56 | tst.l 0xa10008 57 | bne.s SkipJoyDetect 58 | 59 | tst.w 0xa1000c 60 | 61 | SkipJoyDetect: 62 | bne.s SkipSetup 63 | 64 | lea Table,%a5 65 | movem.w (%a5)+,%d5-%d7 66 | movem.l (%a5)+,%a0-%a4 67 | * Check Version Number 68 | move.b -0x10ff(%a1),%d0 69 | andi.b #0x0f,%d0 70 | beq.s WrongVersion 71 | 72 | * Sega Security Code (SEGA) 73 | move.l #0x53454741,0x2f00(%a1) 74 | WrongVersion: 75 | * Read from the control port to cancel any pending read/write command 76 | move.w (%a4),%d0 77 | 78 | * Configure a USER_STACK_LENGTH bytes user stack at bottom, and system stack on top of it 79 | move %sp, %usp 80 | sub #USER_STACK_LENGTH, %sp 81 | 82 | move.w %d7,(%a1) 83 | move.w %d7,(%a2) 84 | 85 | * Jump to initialisation process now... 86 | 87 | jmp _start_entry 88 | 89 | SkipSetup: 90 | jmp _reset_entry 91 | 92 | 93 | Table: 94 | dc.w 0x8000,0x3fff,0x0100 95 | dc.l 0xA00000,0xA11100,0xA11200,0xC00000,0xC00004 96 | 97 | 98 | *------------------------------------------------ 99 | * 100 | * interrupt functions 101 | * 102 | *------------------------------------------------ 103 | 104 | registersDump: 105 | move.l %d0,registerState+0 106 | move.l %d1,registerState+4 107 | move.l %d2,registerState+8 108 | move.l %d3,registerState+12 109 | move.l %d4,registerState+16 110 | move.l %d5,registerState+20 111 | move.l %d6,registerState+24 112 | move.l %d7,registerState+28 113 | move.l %a0,registerState+32 114 | move.l %a1,registerState+36 115 | move.l %a2,registerState+40 116 | move.l %a3,registerState+44 117 | move.l %a4,registerState+48 118 | move.l %a5,registerState+52 119 | move.l %a6,registerState+56 120 | move.l %a7,registerState+60 121 | rts 122 | 123 | busAddressErrorDump: 124 | move.w 4(%sp),ext1State 125 | move.l 6(%sp),addrState 126 | move.w 10(%sp),ext2State 127 | move.w 12(%sp),srState 128 | move.l 14(%sp),pcState 129 | jmp registersDump 130 | 131 | exception4WDump: 132 | move.w 4(%sp),srState 133 | move.l 6(%sp),pcState 134 | move.w 10(%sp),ext1State 135 | jmp registersDump 136 | 137 | exceptionDump: 138 | move.w 4(%sp),srState 139 | move.l 6(%sp),pcState 140 | jmp registersDump 141 | 142 | 143 | _Bus_Error: 144 | jsr busAddressErrorDump 145 | movem.l %d0-%d1/%a0-%a1,-(%sp) 146 | move.l busErrorCB, %a0 147 | jsr (%a0) 148 | movem.l (%sp)+,%d0-%d1/%a0-%a1 149 | rte 150 | 151 | _Address_Error: 152 | jsr busAddressErrorDump 153 | movem.l %d0-%d1/%a0-%a1,-(%sp) 154 | move.l addressErrorCB, %a0 155 | jsr (%a0) 156 | movem.l (%sp)+,%d0-%d1/%a0-%a1 157 | rte 158 | 159 | _Illegal_Instruction: 160 | jsr exception4WDump 161 | movem.l %d0-%d1/%a0-%a1,-(%sp) 162 | move.l illegalInstCB, %a0 163 | jsr (%a0) 164 | movem.l (%sp)+,%d0-%d1/%a0-%a1 165 | rte 166 | 167 | _Zero_Divide: 168 | jsr exceptionDump 169 | movem.l %d0-%d1/%a0-%a1,-(%sp) 170 | move.l zeroDivideCB, %a0 171 | jsr (%a0) 172 | movem.l (%sp)+,%d0-%d1/%a0-%a1 173 | rte 174 | 175 | _Chk_Instruction: 176 | jsr exception4WDump 177 | movem.l %d0-%d1/%a0-%a1,-(%sp) 178 | move.l chkInstCB, %a0 179 | jsr (%a0) 180 | movem.l (%sp)+,%d0-%d1/%a0-%a1 181 | rte 182 | 183 | _Trapv_Instruction: 184 | jsr exception4WDump 185 | movem.l %d0-%d1/%a0-%a1,-(%sp) 186 | move.l trapvInstCB, %a0 187 | jsr (%a0) 188 | movem.l (%sp)+,%d0-%d1/%a0-%a1 189 | rte 190 | 191 | _Privilege_Violation: 192 | jsr exceptionDump 193 | movem.l %d0-%d1/%a0-%a1,-(%sp) 194 | move.l privilegeViolationCB, %a0 195 | jsr (%a0) 196 | movem.l (%sp)+,%d0-%d1/%a0-%a1 197 | rte 198 | 199 | _Trace: 200 | jsr exceptionDump 201 | movem.l %d0-%d1/%a0-%a1,-(%sp) 202 | move.l traceCB, %a0 203 | jsr (%a0) 204 | movem.l (%sp)+,%d0-%d1/%a0-%a1 205 | rte 206 | 207 | _Line_1010_Emulation: 208 | _Line_1111_Emulation: 209 | jsr exceptionDump 210 | movem.l %d0-%d1/%a0-%a1,-(%sp) 211 | move.l line1x1xCB, %a0 212 | jsr (%a0) 213 | movem.l (%sp)+,%d0-%d1/%a0-%a1 214 | rte 215 | 216 | _Error_Exception: 217 | jsr exceptionDump 218 | movem.l %d0-%d1/%a0-%a1,-(%sp) 219 | move.l errorExceptionCB, %a0 220 | jsr (%a0) 221 | movem.l (%sp)+,%d0-%d1/%a0-%a1 222 | rte 223 | 224 | _INT: 225 | movem.l %d0-%d1/%a0-%a1,-(%sp) 226 | move.l intCB, %a0 227 | jsr (%a0) 228 | movem.l (%sp)+,%d0-%d1/%a0-%a1 229 | rte 230 | 231 | _EXTINT: 232 | movem.l %d0-%d1/%a0-%a1,-(%sp) 233 | move.l eintCB, %a0 234 | jsr (%a0) 235 | movem.l (%sp)+,%d0-%d1/%a0-%a1 236 | rte 237 | 238 | _VINT: 239 | btst #5, (%sp) /* Skip context switch if not in user task */ 240 | bne.s no_user_task 241 | 242 | tst.w task_lock 243 | bne.s 1f 244 | move.w #0, -(%sp) /* TSK_superPend() will return 0 */ 245 | bra.s unlock /* If lock == 0, supervisor task is not locked */ 246 | 247 | 1: 248 | bcs.s no_user_task /* If lock < 0, super is locked with infinite wait */ 249 | subq.w #1, task_lock /* Locked with wait, subtract 1 to the frame count */ 250 | bne.s no_user_task /* And do not unlock if we did not reach 0 */ 251 | move.w #1, -(%sp) /* TSK_superPend() will return 1 */ 252 | 253 | unlock: 254 | /* Save bg task registers (excepting a7, that is stored in usp) */ 255 | move.l %a0, task_regs 256 | lea (task_regs + UTSK_REGS_LEN), %a0 257 | movem.l %d0-%d7/%a1-%a6, -(%a0) 258 | 259 | move.w (%sp)+, %d0 /* Load return value previously pushed to stack */ 260 | 261 | move.w (%sp)+, task_sr /* Pop user task sr and pc, and save them, */ 262 | move.l (%sp)+, task_pc /* so they can be restored later. */ 263 | movem.l (%sp)+, %d2-%d7/%a2-%a6 /* Restore non clobberable registers */ 264 | 265 | no_user_task: 266 | /* At this point, we always have in the stack the SR and PC of the task */ 267 | /* we want to jump after processing the interrupt, that might be the */ 268 | /* point where we came from (if there is no context switch) or the */ 269 | /* supervisor task (if we unlocked it). */ 270 | 271 | movem.l %d0-%d1/%a0-%a1,-(%sp) 272 | ori.w #0x0001, intTrace /* in V-Int */ 273 | addq.l #1, vtimer /* increment frame counter (more a vint counter) */ 274 | btst #3, VBlankProcess+1 /* PROCESS_XGM_TASK ? (use VBlankProcess+1 as btst is a byte operation) */ 275 | beq.s no_xgm_task 276 | 277 | jsr XGM_doVBlankProcess /* do XGM vblank task */ 278 | 279 | no_xgm_task: 280 | btst #1, VBlankProcess+1 /* PROCESS_BITMAP_TASK ? (use VBlankProcess+1 as btst is a byte operation) */ 281 | beq.s no_bmp_task 282 | 283 | jsr BMP_doVBlankProcess /* do BMP vblank task */ 284 | 285 | no_bmp_task: 286 | move.l vintCB, %a0 /* load user callback */ 287 | jsr (%a0) /* call user callback */ 288 | andi.w #0xFFFE, intTrace /* out V-Int */ 289 | movem.l (%sp)+,%d0-%d1/%a0-%a1 290 | rte 291 | 292 | *------------------------------------------------ 293 | * 294 | * Copyright (c) 1988 by Sozobon, Limited. Author: Johann Ruegg 295 | * 296 | * Permission is granted to anyone to use this software for any purpose 297 | * on any computer system, and to redistribute it freely, with the 298 | * following restrictions: 299 | * 1) No charge may be made other than reasonable charges for reproduction. 300 | * 2) Modified versions must be clearly marked as such. 301 | * 3) The authors are not responsible for any harmful consequences 302 | * of using this software, even if they result from defects in it. 303 | * 304 | *------------------------------------------------ 305 | 306 | ldiv: 307 | move.l 4(%a7),%d0 308 | bpl ld1 309 | neg.l %d0 310 | ld1: 311 | move.l 8(%a7),%d1 312 | bpl ld2 313 | neg.l %d1 314 | eor.b #0x80,4(%a7) 315 | ld2: 316 | bsr i_ldiv /* d0 = d0/d1 */ 317 | tst.b 4(%a7) 318 | bpl ld3 319 | neg.l %d0 320 | ld3: 321 | rts 322 | 323 | lmul: 324 | move.l 4(%a7),%d0 325 | bpl lm1 326 | neg.l %d0 327 | lm1: 328 | move.l 8(%a7),%d1 329 | bpl lm2 330 | neg.l %d1 331 | eor.b #0x80,4(%a7) 332 | lm2: 333 | bsr i_lmul /* d0 = d0*d1 */ 334 | tst.b 4(%a7) 335 | bpl lm3 336 | neg.l %d0 337 | lm3: 338 | rts 339 | 340 | lrem: 341 | move.l 4(%a7),%d0 342 | bpl lr1 343 | neg.l %d0 344 | lr1: 345 | move.l 8(%a7),%d1 346 | bpl lr2 347 | neg.l %d1 348 | lr2: 349 | bsr i_ldiv /* d1 = d0%d1 */ 350 | move.l %d1,%d0 351 | tst.b 4(%a7) 352 | bpl lr3 353 | neg.l %d0 354 | lr3: 355 | rts 356 | 357 | ldivu: 358 | move.l 4(%a7),%d0 359 | move.l 8(%a7),%d1 360 | bsr i_ldiv 361 | rts 362 | 363 | lmulu: 364 | move.l 4(%a7),%d0 365 | move.l 8(%a7),%d1 366 | bsr i_lmul 367 | rts 368 | 369 | lremu: 370 | move.l 4(%a7),%d0 371 | move.l 8(%a7),%d1 372 | bsr i_ldiv 373 | move.l %d1,%d0 374 | rts 375 | * 376 | * A in d0, B in d1, return A*B in d0 377 | * 378 | i_lmul: 379 | move.l %d3,%a2 /* save d3 */ 380 | move.w %d1,%d2 381 | mulu %d0,%d2 /* d2 = Al * Bl */ 382 | 383 | move.l %d1,%d3 384 | swap %d3 385 | mulu %d0,%d3 /* d3 = Al * Bh */ 386 | 387 | swap %d0 388 | mulu %d1,%d0 /* d0 = Ah * Bl */ 389 | 390 | add.l %d3,%d0 /* d0 = (Ah*Bl + Al*Bh) */ 391 | swap %d0 392 | clr.w %d0 /* d0 = (Ah*Bl + Al*Bh) << 16 */ 393 | 394 | add.l %d2,%d0 /* d0 = A*B */ 395 | move.l %a2,%d3 /* restore d3 */ 396 | rts 397 | * 398 | *A in d0, B in d1, return A/B in d0, A%B in d1 399 | * 400 | i_ldiv: 401 | tst.l %d1 402 | bne nz1 403 | 404 | * divide by zero 405 | * divu #0,%d0 /* cause trap */ 406 | move.l #0x80000000,%d0 407 | move.l %d0,%d1 408 | rts 409 | nz1: 410 | move.l %d3,%a2 /* save d3 */ 411 | cmp.l %d1,%d0 412 | bhi norm 413 | beq is1 414 | * AB and B is not 0 426 | norm: 427 | cmp.l #1,%d1 428 | bne not1 429 | * B==1, so ret A, rem 0 430 | clr.l %d1 431 | move.l %a2,%d3 /* restore d3 */ 432 | rts 433 | * check for A short (implies B short also) 434 | not1: 435 | cmp.l #0xffff,%d0 436 | bhi slow 437 | * A short and B short -- use 'divu' 438 | divu %d1,%d0 /* d0 = REM:ANS */ 439 | swap %d0 /* d0 = ANS:REM */ 440 | clr.l %d1 441 | move.w %d0,%d1 /* d1 = REM */ 442 | clr.w %d0 443 | swap %d0 444 | move.l %a2,%d3 /* restore d3 */ 445 | rts 446 | * check for B short 447 | slow: 448 | cmp.l #0xffff,%d1 449 | bhi slower 450 | * A long and B short -- use special stuff from gnu 451 | move.l %d0,%d2 452 | clr.w %d2 453 | swap %d2 454 | divu %d1,%d2 /* d2 = REM:ANS of Ahi/B */ 455 | clr.l %d3 456 | move.w %d2,%d3 /* d3 = Ahi/B */ 457 | swap %d3 458 | 459 | move.w %d0,%d2 /* d2 = REM << 16 + Alo */ 460 | divu %d1,%d2 /* d2 = REM:ANS of stuff/B */ 461 | 462 | move.l %d2,%d1 463 | clr.w %d1 464 | swap %d1 /* d1 = REM */ 465 | 466 | clr.l %d0 467 | move.w %d2,%d0 468 | add.l %d3,%d0 /* d0 = ANS */ 469 | move.l %a2,%d3 /* restore d3 */ 470 | rts 471 | * A>B, B > 1 472 | slower: 473 | move.l #1,%d2 474 | clr.l %d3 475 | moreadj: 476 | cmp.l %d0,%d1 477 | bhs adj 478 | add.l %d2,%d2 479 | add.l %d1,%d1 480 | bpl moreadj 481 | * we shifted B until its >A or sign bit set 482 | * we shifted #1 (d2) along with it 483 | adj: 484 | cmp.l %d0,%d1 485 | bhi ltuns 486 | or.l %d2,%d3 487 | sub.l %d1,%d0 488 | ltuns: 489 | lsr.l #1,%d1 490 | lsr.l #1,%d2 491 | bne adj 492 | * d3=answer, d0=rem 493 | move.l %d0,%d1 494 | move.l %d3,%d0 495 | move.l %a2,%d3 /* restore d3 */ 496 | rts 497 | -------------------------------------------------------------------------------- /src/dialogos.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/src/dialogos.c -------------------------------------------------------------------------------- /src/logos-titulo.c: -------------------------------------------------------------------------------- 1 | #include "genesis.h"//[[SGDK]] 2 | /******************************************************************************** 3 | * @Title: PENGUIN WORLD 4 | * @Author: Alicia Sanchez Martos "AliceSim1" 5 | ***********************************************************************************/ 6 | #include "../inc/global.h" 7 | #define Version "11/03" 8 | 9 | //res ficheros 10 | #include "../res/logos.h" 11 | #include "../res/titulo.h" 12 | //----------------------------------------------------- 13 | 14 | s16 vectorB[1]; 15 | 16 | //Definiciones de las funciones--------------------------------------------------- 17 | static void SGDKlogo(); 18 | static void ALICESIM1(); 19 | static void Titulo_scrollLine(); 20 | //---------------------------------------- 21 | 22 | 23 | /////////////////////////////INICIO DE TODO////////////////////////////////////////////////// 24 | void TITUTLO(){ 25 | //-------------------------------------- 26 | VDP_loadFont(&font1,CPU); 27 | 28 | VDP_drawImageEx(BG_B,&disclaimer,1,20-10,14-6,TRUE,CPU); 29 | JOY_waitPressBtnTime(900); 30 | VDP_clearPlane(BG_B,TRUE); 31 | 32 | SYS_doVBlankProcess(); 33 | XGM_startPlay(M_titulo); 34 | 35 | if(BUTTONS[0]==0) SGDKlogo(); 36 | if(BUTTONS[0]==0) ALICESIM1(); 37 | 38 | 39 | //PAL_setColors(0,palette_black,64,DMA); 40 | //------------------------------------------------------------- 41 | VDP_setScrollingMode(HSCROLL_LINE,VSCROLL_PLANE);//titulo 42 | 43 | memcpy(&paleta64[0],titulo.palette->data, 16 * 2); 44 | memcpy(&paleta64[16],fondogr.palette->data, 16 * 2); 45 | memcpy(&paleta64[32],titush.palette->data, 16 * 2); 46 | memcpy(&paleta64[48],&palette_red, 16 * 2); 47 | 48 | //carga la imagen en VRAM y la dibuja en pantalla 49 | VDP_drawImageEx(BG_B,&fondogr,TILE_ATTR_FULL(PAL1,FALSE,FALSE,FALSE,1),0,16,FALSE,CPU); 50 | //incrementa ind para 'apuntar' a una zona de VRAM libre para futuras tiles 51 | u16 ind=1+fondogr.tileset->numTile; 52 | 53 | VDP_drawImageEx(BG_A,&titulo,ind,4,1,FALSE,CPU); 54 | ind+=titulo.tileset->numTile; 55 | 56 | bool gat2=FALSE; 57 | 58 | 59 | u8 contador2=randU8(10,50); 60 | bool gat3=FALSE; 61 | u8 num_lin=0; 62 | vectorB[0]=240; 63 | vectorB[1]=-vectorB[0]; 64 | 65 | Titulo_scrollLine(); 66 | 67 | PAL_fadeInAll(paleta64,120,TRUE); 68 | 69 | u16 i=240; 70 | while(BUTTONS[0]<10 && i>0){ 71 | i-=3;vectorB[0]=i;vectorB[1]=-i; 72 | Titulo_scrollLine(); 73 | SYS_doVBlankProcess(); 74 | } 75 | 76 | vectorB[0]=vectorB[1]=0; 77 | Titulo_scrollLine(); 78 | if(BUTTONS[0]>9){ 79 | PAL_interruptFade(); 80 | PAL_setColors(0,&paleta64[0],64,CPU);//restaura las paletas 81 | } 82 | PAL_setPalette(2,palette_black,CPU); 83 | 84 | VDP_drawImageEx(BG_B,&titush,TILE_ATTR_FULL(PAL2,FALSE,FALSE,FALSE,ind),3,0,FALSE,CPU); 85 | //ind+=titulo.tileset->numTile; 86 | 87 | VDP_setTextPalette(PAL2); 88 | VDP_drawText(Version,35,0); 89 | 90 | VDP_setTextPalette(PAL3);VDP_drawText("AliceSim1",9,22);VDP_setTextPalette(PAL0);VDP_drawText("- 2020-2022",19,22); 91 | VDP_drawText("Twitter: @Alice_Sim1",9,24); 92 | u8 contador=0; 93 | bool gat=FALSE; 94 | 95 | bool gatS=TRUE; 96 | bool ok=FALSE; 97 | 98 | 99 | 100 | do{ 101 | 102 | if(XGM_getElapsed()>1755) XGM_startPlay(M_titulo); 103 | 104 | if(!PAL_isDoingFade()){ 105 | if(gat2) PAL_fadeIn(16,47,&paleta64[16],120,TRUE); 106 | else PAL_fadeOut(16,47,90,TRUE); 107 | gat2=!gat2; 108 | } 109 | 110 | contador++; 111 | if(contador==60){ contador=0; 112 | if(!gat){ 113 | VDP_setTextPalette(PAL0);VDP_drawText("PULSA BOTON",11,18); 114 | VDP_setTextPalette(PAL3);VDP_drawText("START!",23,18); 115 | } 116 | else VDP_clearText(11,18,18); 117 | gat=!gat; 118 | } 119 | 120 | if (gat3){ gat3=FALSE; 121 | vectorB[0]=0; 122 | VDP_setHorizontalScrollLine(BG_A,num_lin,vectorB,1,CPU); 123 | } 124 | 125 | contador2--; 126 | if(contador2==0){ contador2=randU8(1,25); 127 | vectorB[0]=randU8(0,10)-5; 128 | num_lin=randU8(10,112); 129 | VDP_setHorizontalScrollLine(BG_A,num_lin,vectorB,1,CPU); 130 | gat3=TRUE; 131 | } 132 | 133 | 134 | if(BUTTONS[8] && !gatS) ok=TRUE; 135 | else if(gatS && !BUTTONS[8]) gatS=FALSE; 136 | 137 | SYS_doVBlankProcess(); // Renderizamos la pantalla 138 | }while(!ok); 139 | 140 | PAL_fadeOutAll(90,FALSE); 141 | 142 | VDP_clearPlane(BG_A,TRUE);VDP_clearPlane(BG_B,TRUE); 143 | 144 | VDP_setTextPalette(PAL0); 145 | VDP_setScrollingMode(HSCROLL_PLANE,VSCROLL_PLANE); 146 | 147 | XGM_stopPlay(); 148 | 149 | } 150 | 151 | 152 | static void Titulo_scrollLine(){ 153 | for(u8 num_lin=9;num_lin<128;num_lin+=2) VDP_setHorizontalScrollLine(BG_A,num_lin,vectorB,2,DMA); 154 | } 155 | 156 | 157 | static void SGDKlogo(){ 158 | 159 | u16 paleta16or[16]; 160 | memcpy(&paleta16or[0],sgdk_logo.palette->data, 16 * 2); 161 | PAL_setPalette(0,palette_black,DMA); 162 | 163 | VDP_drawBitmapEx(BG_B,&sgdk_logo,1,20-4,14-4,FALSE); 164 | PAL_fadeIn(0,15,&paleta16or[0],10,TRUE); 165 | 166 | if(BUTTONS[0]==0)JOY_waitPressBtnTime(750); 167 | else PAL_setPalette(PAL0,sgdk_logo.palette->data,DMA); 168 | 169 | PAL_fadeOutAll(20,FALSE); 170 | VDP_clearPlane(BG_B,TRUE); 171 | } 172 | 173 | 174 | 175 | static void ALICESIM1(){ 176 | 177 | u16 colblank[1]={RGB24_TO_VDPCOLOR(0xFFFFFF)}; 178 | u16 paleta16or[16]; 179 | 180 | memcpy(&paleta16or[0],alicesim1.palette->data, 16 * 2); 181 | PAL_setPalette(0,palette_black,DMA); 182 | PAL_setPalette(1,palette_grey,DMA); 183 | VDP_setTextPalette(PAL1); 184 | 185 | VDP_drawImageEx(BG_B,&alicesim1,1,20-11,14-4,FALSE,TRUE); 186 | //Volvemos a activar las interrupciones del VDP 187 | 188 | u8 i; 189 | for(i=1;i<16;i+=2){ 190 | PAL_fadeIn(i,i,&paleta16or[i],3,TRUE); 191 | do{SYS_doVBlankProcess();}while(PAL_isDoingFade() && BUTTONS[0]==0); 192 | if(BUTTONS[0]>9)break; 193 | } 194 | VDP_drawText("Alicia Sanchez Martos",10,22); 195 | if(BUTTONS[0]==0){ 196 | for(i=1;i<16;i+=2){ 197 | PAL_fade(i,i+1,&paleta16or[i],&colblank[0],1,FALSE); 198 | PAL_fade(i,i+1,&colblank[0],&paleta16or[i],3,FALSE); 199 | do{SYS_doVBlankProcess();}while(PAL_isDoingFade() && BUTTONS[0]==0); 200 | if(BUTTONS[0]>9)break; 201 | } 202 | } 203 | 204 | if(BUTTONS[0]==0)JOY_waitPressBtnTime(750); 205 | else PAL_setPalette(0,paleta16or,DMA); 206 | 207 | PAL_fadeOutAll(20,FALSE); 208 | 209 | VDP_clearPlane(BG_B,TRUE);VDP_clearPlane(BG_A,TRUE); 210 | } 211 | 212 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/src/main.c -------------------------------------------------------------------------------- /src/zona1dat.c: -------------------------------------------------------------------------------- 1 | #include "genesis.h"//[[SGDK]] 2 | 3 | #include "../inc/global.h" 4 | #include "../inc/zona1dat.h" 5 | 6 | 7 | const u8 const casillas_0[] = { 8 | 0,7,7,7,7,7,7,0,//0 ,0-7 9 | 9,1,1,1,1,1,1,0,//1 ,8-15 10 | 9,1,1,1,1,1,1,0,//2 ,16-23 11 | 9,1,1,1,1,1,1,1,//3 ,24-31 12 | 9,1,1,1,1,1,1,0,//4 ,32-39 13 | 9,1,1,1,1,1,1,0 //5 ,40-47 14 | //0,0,0,0,0,0,0,0 15 | //--0,1,2,3,4,5,6,7 = 8 16 | }; 17 | 18 | const u8 const casillas_1[] = { 19 | 0,7,7,7,7,7,7,0,//0 ,0-7 20 | 9,1,1,1,1,1,1,0,//1 ,8-15 21 | 9,1,1,0,0,0,0,0,//2 ,16-23 22 | 1,1,1,1,1,1,1,1,//3 ,24-31 23 | 9,1,1,1,1,1,1,0,//4 ,32-39 24 | 9,1,1,1,1,1,1,0 //5 ,40-47 25 | //--0,1,2,3,4,5,6,7 = 8 26 | }; 27 | 28 | const u8 const casillas_2[] = { 29 | 0,0,0,0,0,0,0,0,0,0 ,6,3,1,6,6,0,//0 30 | 0,0,0,0,0,0,0,0,0,10,1,1,1,1,1,0,//1 31 | 0,0,0,0,0,0,0,0,0,10,1,1,1,1,1,0,//2 32 | 0,0,0,0,0,0,0,0,0,10,1,1,1,1,1,0,//3 33 | 0,0,0,0,0,0,0,0,0,10,1,1,1,1,1,0,//4 34 | 0,0,0,0,0,0,0,0,0,10,1,1,1,1,1,0,//5 35 | 0,7,7,7,7,7,7,7,7,7 ,1,1,1,1,1,0,//6 36 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0,//7 37 | 4,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0,//8 38 | 1,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,1,//9 39 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0,//10 40 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0 //11 41 | //--0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5 = 16 42 | }; //10 43 | 44 | const u8 const casillas_3[] = { 45 | 0,7,7,7,7,7,7,7,7,7 ,6,3,1,6,6,0, 46 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0, 47 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0, 48 | 9,1,1,0,0,0,0,0,0,8 ,1,1,1,1,1,0, 49 | 9,1,1,0,0,0,0,0,0,10,1,1,1,1,1,0, 50 | 9,1,1,0,0,0,0,0,0,10,1,1,1,1,1,0, 51 | 9,1,1,5,7,7,7,7,7,7 ,1,1,1,1,1,0, 52 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0, 53 | 4,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0, 54 | 1,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,1, 55 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0, 56 | 9,1,1,1,1,1,1,1,1,1 ,1,1,1,1,1,0 //11 57 | //--0,1,2,3,4,5,6,7,8,9 ,0,1,2,3,4,5 = 16 58 | }; //10 59 | 60 | const u16 const blxpri_0[] = { 61 | 159,143,//0,1 puerta 62 | 319,159,//2,3 bloque 63 | 351,175,//4,5 64 | 393,191,//6,7 65 | 415,207 //8,9 (top_blxpri=9) 66 | }; 67 | 68 | const u16 const blxpri_2[] = { 69 | 159,239,//0,1 puerta 70 | 896,287 //2,3 71 | }; 72 | 73 | const u16 const blxpri_3[] = { 74 | 159,239,//0,1 puerta 75 | 896,287,//2,3 76 | 384,223,//4,5 Pared << 77 | 671,271 //6,7 Pared >> 78 | }; 79 | 80 | //cordenas de la grilla 32x32 para indicar Numero de Zona a teletransportar 81 | //cord_origen: x,y,pdircm, num_zone_dest,cord_dest: 0,1,2,3,4,5 82 | const u8 const puertas_0[] = { 83 | 3,7,4,1,3,0 //Puerta [1] 84 | }; 85 | 86 | const u8 const puertas_1[] = { 87 | 3,0,3,0,3,7,//Puerta [1] 88 | 3,7,4,2,9,0 //Puerta [2] 89 | }; 90 | 91 | const u8 const puertas_2[] = { 92 | 9,0,3,1,3,7,//Puerta [1] 93 | 9,15,4,3,9,0 //Puerta [2] 94 | }; 95 | 96 | const u8 const puertas_3[] = { 97 | 9,0,3,2,9,15 //Puerta [1] 98 | }; 99 | 100 | 101 | 102 | const t_zona zona1dat[TOP_ZONAS] = { 103 | { 104 | FALSE, //PlanA 105 | 2,//musica 106 | 8,//Xtop 107 | 5,//Ytop 108 | casillas_0,//casillas 109 | 0,//top_blxpri 110 | 0,//blockpri 111 | 1,//topPuertas 112 | puertas_0 //puertas 113 | }, 114 | { 115 | TRUE, //PlanA 116 | 2,//musica 117 | 8,//Xtop 118 | 5,//Ytop 119 | casillas_1,//casillas 120 | 9, //top_blxpri 121 | blxpri_0,//blockpri 122 | 2,//topPuertas 123 | puertas_1 //puertas 124 | }, 125 | { 126 | FALSE, //PlanA 127 | 0, //musica 128 | 16,//Xtop 129 | 11,//Ytop 130 | casillas_2,//casillas 131 | 3, //top_blxpri 132 | blxpri_2, //blockpri 133 | 2,//topPuertas 134 | puertas_2 //puertas 135 | }, 136 | { 137 | TRUE, //PlanA 138 | 1, //musica 139 | 16,//Xtop 140 | 11,//Ytop 141 | casillas_3,//casillas 142 | 7, //top_blxpri 143 | blxpri_3, //blockpri 144 | 1, 145 | puertas_3 146 | } 147 | }; 148 | 149 | 150 | -------------------------------------------------------------------------------- /src/zone-jugpri.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/src/zone-jugpri.c -------------------------------------------------------------------------------- /temp/ASCII-to-VRAM-Index.txt: -------------------------------------------------------------------------------- 1 | Num ASCI(-32) [0-15] [tile-index] 2 | Caracter 3 | ------------------------------------------------------ 4 | 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5 = 00-15 5 | ,!,",#,$,%,&,',(,),*,+,,,-,.,/ 6 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 7 | 6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1 = 16-31 [+16>32-47] 8 | 0,1,2,3,4,5,6,7,8,9,:,;,<,=,>,? 9 | ------------------------------------------------------ 10 | 2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7 = 32-47 [+32>64-79] 11 | @,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O 12 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 13 | 8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3 = 48-63 [+48>96-111] 14 | P,Q,R,S,T,U,V,W,X,Y,Z,[,\,],^,_ 15 | ------------------------------------------------------ 16 | 17 | `abcdefghijklmnopqrstuvwxyz{|}~ 18 | -------------------------------------------------------------------------------- /temp/Bizcat - an 8x16 bitmap font.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://robey.lag.net/2020/02/09/bizcat-bitmap-font.html 3 | -------------------------------------------------------------------------------- /temp/Captura.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura.PNG -------------------------------------------------------------------------------- /temp/Captura2.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura2.PNG -------------------------------------------------------------------------------- /temp/Captura3.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura3.PNG -------------------------------------------------------------------------------- /temp/Captura4.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura4.PNG -------------------------------------------------------------------------------- /temp/Captura5.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura5.PNG -------------------------------------------------------------------------------- /temp/Captura6.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura6.PNG -------------------------------------------------------------------------------- /temp/Captura7.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura7.PNG -------------------------------------------------------------------------------- /temp/Captura8.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Captura8.PNG -------------------------------------------------------------------------------- /temp/DiagBox1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/DiagBox1.png -------------------------------------------------------------------------------- /temp/Portapapeles01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Portapapeles01.png -------------------------------------------------------------------------------- /temp/Portapapeles02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Portapapeles02.png -------------------------------------------------------------------------------- /temp/Sprite-0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Sprite-0001.png -------------------------------------------------------------------------------- /temp/Sprite-0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/Sprite-0002.png -------------------------------------------------------------------------------- /temp/dialogo.ase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/dialogo.ase -------------------------------------------------------------------------------- /temp/font8x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/font8x16.png -------------------------------------------------------------------------------- /temp/font8x16b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/font8x16b.png -------------------------------------------------------------------------------- /temp/res/Zona1/h1.ase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/res/Zona1/h1.ase -------------------------------------------------------------------------------- /temp/res/Zona1/h3.ase: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/res/Zona1/h3.ase -------------------------------------------------------------------------------- /temp/res/font_1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/res/font_1b.png -------------------------------------------------------------------------------- /temp/rom_head.c: -------------------------------------------------------------------------------- 1 | #include "genesis.h" 2 | 3 | __attribute__((externally_visible)) 4 | const ROMHeader rom_header = { 5 | #if (ENABLE_BANK_SWITCH != 0) 6 | "SEGA SSF ", 7 | #elif (MODULE_MEGAWIFI != 0) 8 | "SEGA MEGAWIFI ", 9 | #else 10 | "SEGA MEGA DRIVE ", 11 | #endif 12 | "ALICESIM1 - 2021", 13 | "PENGUIN WORLD - ALPHA DEVOLOPER ", 14 | "PENGUIN WORLD - ALPHA DEVOLOPER ", 15 | "GM 00000000-00", 16 | 0x000, 17 | "J6M ", 18 | 0x00000000, 19 | #if (ENABLE_BANK_SWITCH != 0) 20 | 0x003FFFFF, 21 | #else 22 | 0x000FFFFF, 23 | #endif 24 | 0xE0FF0000, 25 | 0xE0FFFFFF, 26 | "RA", 27 | 0xF820, 28 | 0x00200000, 29 | 0x0020FFFF, 30 | " ", 31 | "DEMONSTRATION PROGRAM ", 32 | "JUE " 33 | }; 34 | -------------------------------------------------------------------------------- /temp/sombra-Num.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alicesim1/Penguin-World/8fd19587eb8513611a98059bf6914c69a9c91e83/temp/sombra-Num.png -------------------------------------------------------------------------------- /temp/temp.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | u8 top_object2D 3 4 | struct t_object2D { 5 | Sprite* sprt; 6 | u16 x, y; 7 | }; 8 | struct t_object2D object2D[top_object2D]; 9 | //------------------------------------------------------------------------------------------ 10 | static void object2D_maker(SpriteDefinition sprited,u8 , u8, u16 , u16 , bool , bool ); 11 | 12 | 13 | //static void SPR_PRIORITY(){ 14 | //----------------------------------------------------------- 15 | for(u8 i=0;i<3;i++){ 16 | SPR_setPosition(object2D[i].sprt,object2D[i].x-posX,object2D[i].y-posY); 17 | } 18 | SPR_setDepth(penguinsp,-posY); 19 | 20 | 21 | 22 | //loadzona(){ 23 | //------------------------------------------- 24 | for(u8 i=1;i<4;i++){ 25 | object2D_maker(penguin,i-1,i,32*(i+2),32*(i+2),0,randU8(0,1)); 26 | } 27 | //-------------------------------------------- 28 | 29 | 30 | //ZoneMap() unloadmap 31 | for(u8 i=0; i<4; i++){ 32 | SPR_releaseSprite(object2D[i].sprt); //advertencia compilador!! 33 | } 34 | 35 | SPR_releaseSprite(object2D[0].sprt); 36 | SPR_releaseSprite(object2D[1].sprt); 37 | SPR_releaseSprite(object2D[2].sprt); 38 | SPR_releaseSprite(object2D[3].sprt); 39 | 40 | 41 | 42 | static void object2D_maker(SpriteDefinition sprited, u8 num_obj , u8 pal , u16 X, u16 Y, bool v, bool h){ 43 | 44 | object2D[num_obj].x= STARTXT+(X-Y) +160; 45 | object2D[num_obj].y=(STARTYT+(X+Y)/2)+112; 46 | 47 | bool tempbol=TRUE; 48 | if(zona1dat[0].top_blxpri>0){ 49 | for(u8 i=0;izona1dat[0].blockpri[i] && object2D[num_obj].x-48zona1dat[0].blockpri[i+1] && object2D[num_obj].y<=zona1dat[0].blockpri[i+1]){ 52 | tempbol=FALSE; break; 53 | } 54 | } 55 | } 56 | 57 | object2D[num_obj].x-=12;object2D[num_obj].y-=26; 58 | 59 | object2D[num_obj].sprt=SPR_addSprite(&sprited, object2D[num_obj].x-posX, object2D[num_obj].y-posY, TILE_ATTR(pal,tempbol,v,h)); 60 | SPR_setDepth(object2D[num_obj].sprt,-object2D[num_obj].y+112-26); 61 | 62 | SPR_setFrame(object2D[num_obj].sprt,1);//parado 63 | 64 | } 65 | 66 | 67 | switch(jugcontrol){ 68 | 69 | //BUTTONS[1]=changed & BUTTON_UP; 70 | //BUTTONS[2]=changed & BUTTON_DOWN; 71 | //BUTTONS[3]=changed & BUTTON_LEFT; 72 | //BUTTONS[4]=changed & BUTTON_RIGHT; 73 | 74 | case 0:{ //solo diagonales! 75 | if (BUTTONS[1] && BUTTONS[4])pdir=1;//up+>> 76 | else if (BUTTONS[2] && BUTTONS[3])pdir=2;//down+<< 77 | else if (BUTTONS[1] && BUTTONS[3])pdir=3;//up+<< 78 | else if (BUTTONS[2] && BUTTONS[4])pdir=4;//down+>> 79 | }break; 80 | case 1:{//evita diagonales 81 | if (BUTTONS[1] && !BUTTONS[3] && !BUTTONS[4])pdir=1;//up+>> 82 | else if (BUTTONS[2] && !BUTTONS[3] && !BUTTONS[4])pdir=2;//down+<< 83 | else if (BUTTONS[3] && !BUTTONS[1] && !BUTTONS[2])pdir=3;//up+<< 84 | else if (BUTTONS[4] && !BUTTONS[1] && !BUTTONS[2])pdir=4;//down+>> 85 | }break; 86 | case 2:{//evita diagonales 87 | if (BUTTONS[4] && !BUTTONS[1] && !BUTTONS[2])pdir=1;//up+>> 88 | else if (BUTTONS[3] && !BUTTONS[1] && !BUTTONS[2])pdir=2;//down+<< 89 | else if (BUTTONS[1] && !BUTTONS[3] && !BUTTONS[4])pdir=3;//up+<< 90 | else if (BUTTONS[2] && !BUTTONS[3] && !BUTTONS[4])pdir=4;//down+>> 91 | }break; 92 | case 3:{//hibrido!! 93 | 94 | 95 | }break; 96 | } 97 | 98 | 99 | 100 | if(BUTTONS[8]){ gat=TRUE; 101 | 102 | jugcontrol++; if(jugcontrol==4) jugcontrol=0; 103 | 104 | JOY_reset(); 105 | padtipo=JOY_getPortType(PORT_1);//13 = 106 | //padtipo=15;//NINGUNO 107 | //padtipo=13;//PAD3,6 108 | //padtipo=0;//MOUSE 109 | 110 | padraton=JOY_getPortType(PORT_2); 111 | if(padraton==PORT_TYPE_MOUSE) JOY_setSupport(PORT_2, JOY_SUPPORT_MOUSE); //3 112 | //padraton=15;//NINGUNO 113 | //padraton=13;//PAD3,6 114 | //padraton=3;//MOUSE 115 | VDP_drawInt(padtipo,2,0,ScreenMY-2); 116 | VDP_drawInt(padraton,2,20,ScreenMY-2); 117 | 118 | SYS_doVBlankProcess(); // Renderizamos la pantalla 119 | 120 | pad6=JOY_getJoypadType(JOY_1); 121 | //0=3 botones 122 | //1=6 botones 123 | //15=NINGUNO 124 | 125 | VDP_drawInt(pad6,0,10,ScreenY-2); 126 | //VDP_drawInt(padmouse,2,30,ScreenY-2); 127 | } 128 | 129 | 130 | static void dialogo(u8 ancho,u8 alto){ 131 | 132 | u16 tilenum=MAP_getTile(bga,48,26) & TILE_INDEX_MASK; 133 | 134 | KLog_U1("tilenum:",tilenum); 135 | 136 | VDP_fillTileMapRect(BG_A,TILE_ATTR_FULL(0,TRUE,FALSE,FALSE,1531),48,26,ancho,alto); 137 | 138 | SPR_update(); 139 | do{ 140 | SYS_doVBlankProcess(); 141 | }while(!BUTTONS[6]); 142 | 143 | KLog_U2("posX:",bga->posX,"posY:",bga->posY); 144 | KLog_U2("posX:",posX,"posY:",posY); 145 | 146 | //bga->planeWidthMask=0; // force full map update using row updates 147 | bga->lastXT = 0;bga->lastYT = 0; 148 | bga->posX = 0; bga->posY = 0; 149 | MAP_scrollTo(bga,posX,posY); 150 | 151 | } 152 | 153 | /* 154 | ts 0x7FF, 155 | If you find it easier you can also write it directly in binary, like so: 156 | 0b11111111111 (eleven ones, to mask bits 0 to 10), 157 | I wish C would support underscores in numbers to make it easier to read tho. 158 | */ 159 | 160 | //KLog_U1("ScreenY:",ScreenY); 161 | //KLog_S1("fixAlturaY:",fixAlturaY); 162 | ScreenTY=8+(ScreenY*8);//224/240 163 | ScreenMY=ScreenTY/2;//112/120 164 | 165 | //KLog_U1("ScreenTY:",ScreenTY); 166 | //KLog_U1("ScreenMY:",ScreenMY); 167 | //-------------------------------------- 168 | //KLog("---------------"); 169 | 170 | padtipo=JOY_getPortType(PORT_1);//13 = 171 | //padtipo=15;//NINGUNO 172 | //padtipo=13;//PAD3,6 173 | //padtipo=0;//MOUSE 174 | 175 | padraton=JOY_getPortType(PORT_2); 176 | if(padraton==PORT_TYPE_MOUSE) JOY_setSupport(PORT_2, JOY_SUPPORT_MOUSE); //3 177 | //padraton=15;//NINGUNO 178 | //padraton=13;//PAD3,6 179 | //padraton=3;//MOUSE 180 | 181 | SYS_doVBlankProcess(); // Renderizamos la pantalla 182 | 183 | pad6=JOY_getJoypadType(JOY_1); 184 | //0=3 botones 185 | //1=6 botones 186 | //15=NINGUNO 187 | 188 | JOY_setEventHandler(&inputHandler); 189 | 190 | 191 | 192 | // unpack first 193 | TileSet *t = unpackTileSet(&font16, NULL); 194 | // tiles 195 | VDP_loadTileData(t->tiles, index, t->numTile, tm); 196 | 197 | MEM_free(t); 198 | 199 | 200 | KLog_U1("numTile:",font16.numTile);//384 201 | 202 | u32 tile[8]= 203 | { 204 | 0x00111100, 205 | 0x01144110, 206 | 0x11244211, 207 | 0x11244211, 208 | 0x11222211, 209 | 0x11222211, 210 | 0x01122110, 211 | 0x00111100 212 | }; 213 | 214 | 215 | VDP_loadTileData( (u32 *)tile, 199, 1, CPU); 216 | VDP_loadTileSet(&font16,600,CPU); 217 | 218 | 219 | 220 | 221 | Sprite* DigCaracter; 222 | 223 | DigCaracter=SPR_addSpriteEx(&font16,-8,-16,TILE_ATTR_FULL(2,TRUE,FALSE,FALSE,ind+(4*i)),0,SPR_FLAG_AUTO_SPRITE_ALLOC | SPR_FLAG_AUTO_TILE_UPLOAD); 224 | SPR_setAnimAndFrame(DigCaracter,0,1+i); 225 | SPR_update();//SPR_FLAG_AUTO_TILE_UPLOAD FUNCIONE! Deve estar VISIBLE! Volvado automatico de tileset de los sprites a la VRAM 226 | SPR_releaseSprite(DigCaracter); 227 | --------------------------------------------------------------------------------